@doist/reactist 27.4.0 → 27.5.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.
@@ -1 +1 @@
1
- {"version":3,"file":"reactist.cjs.production.min.js","sources":["../src/utils/polymorphism.ts","../src/utils/responsive-props.ts","../src/box/box.tsx","../src/columns/columns.tsx","../src/divider/divider.tsx","../src/inline/inline.tsx","../src/stack/stack.tsx","../src/hidden/hidden.tsx","../src/hidden-visually/hidden-visually.tsx","../src/utils/common-helpers.ts","../src/spinner/spinner.tsx","../src/tooltip/tooltip.tsx","../src/button/button.tsx","../src/icons/close-icon.tsx","../src/icons/banner-icon.tsx","../src/text-link/text-link.tsx","../src/banner/banner.tsx","../src/loading/loading.tsx","../src/icons/alert-icon.tsx","../src/text/text.tsx","../src/toast/static-toast.tsx","../src/toast/toast-animation.ts","../src/toast/use-toasts.tsx","../src/heading/heading.tsx","../src/checkbox-field/checkbox-icon.tsx","../src/checkbox-field/checkbox-field.tsx","../src/checkbox-field/use-fork-ref.ts","../src/icons/password-visible-icon.tsx","../src/icons/password-hidden-icon.tsx","../src/base-field/base-field.tsx","../src/text-field/text-field.tsx","../src/password-field/password-field.tsx","../src/select-field/select-field.tsx","../src/switch-field/switch-field.tsx","../src/text-area/text-area.tsx","../src/avatar/utils.ts","../src/avatar/avatar.tsx","../src/modal/modal.tsx","../src/tabs/tabs.tsx","../src/menu/menu.tsx","../src/components/deprecated-button/deprecated-button.tsx","../src/components/deprecated-dropdown/dropdown.tsx","../src/components/color-picker/color-picker.tsx","../src/components/keyboard-shortcut/keyboard-shortcut.tsx","../src/components/key-capturer/key-capturer.tsx","../src/components/progress-bar/progress-bar.tsx","../src/components/time/time-utils.ts","../src/components/time/time.tsx","../src/components/deprecated-input/input.tsx","../src/components/deprecated-select/select.tsx","../src/badge/badge.tsx","../src/notice/notice.tsx","../src/prose/prose.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as React from 'react'\nimport type { ObfuscatedClassName } from './common-types'\n\ntype Merge<P1, P2> = Omit<P1, keyof P2> & P2\n\ntype EmptyObject = {\n [K in any]: never\n}\n\ntype ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName'\n\n/**\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This can be customized via the second generic parameter, as there are cases where it may be\n * needed to omit this behaviour and keep the `className`. You can also instruct it to remove the\n * `className` prop while not replacing it with the `exceptionallySetClassName` one.\n *\n * @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop\n * @see PolymorphicComponent for details about this feature\n */\ntype WithObfuscatedClassName<\n Props,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = 'className' extends keyof Props\n ? ShouldObfuscateClassName extends 'obfuscateClassName'\n ? Omit<Props, 'className'> & ObfuscatedClassName\n : ShouldObfuscateClassName extends 'omitClassName'\n ? Omit<Props, 'className'>\n : ShouldObfuscateClassName extends 'keepClassName'\n ? Props\n : never\n : Props\n\ntype PolymorphicProp<ComponentType extends React.ElementType> = {\n /**\n * Used to instruct this component what React element to render as. It can be both a string\n * representing a HTML tag name, or a React component.\n *\n * When using this prop, the component you apply it to will also recognize in its props types\n * all the props from the component or HTML element you are rendering it as.\n *\n * Some uses for this feature:\n *\n * - Using some of our layout components, while at the same time being able to set them to use\n * semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).\n * - Using a design system link component, but have it internally use a client-side router link\n * implemented via a React component (e.g. react-router's `Link`).\n *\n * Keep in mind that not all compositions of this kind may work well, especially when composing\n * with another React component and not with a HTML tag name. In particular, if the components\n * being composed have opposing concerns of clashing features (e.g. they have contradicting\n * styles applied to them) things may not go well. In those cases prefer to nest them instead.\n *\n * @see PolymorphicComponent\n */\n as?: ComponentType\n}\n\n/**\n * Given a component or element type, and a set of additional props, this builds the entire set of\n * props for a polymorphic component.\n *\n * It does three things:\n *\n * 1. it merges the element type props with the `OwnProps`\n * 2. it adds the `as` prop to allow for polymorphism to happen\n * 3. it optionally obfuscates or omits the className prop if present\n *\n * @see PolymorphicProp\n * @see WithObfuscatedClassName\n */\ntype PolymorphicComponentProps<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = Merge<\n WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>,\n OwnProps & PolymorphicProp<ComponentType>\n>\n\ntype ElementTagNameMap = HTMLElementTagNameMap &\n Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>\n\ntype ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName]\n\ntype ElementByTagOrAny<\n ComponentType extends React.ElementType\n> = ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any\n\n/**\n * The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via\n * the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.\n *\n * @see PolymorphicComponentProps\n * @see WithObfuscatedClassName\n */\ninterface ForwardRefFunction<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> {\n (\n props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>,\n ref:\n | ((instance: ElementByTagOrAny<ComponentType> | null) => void)\n | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null>\n | null,\n ): React.ReactElement | null\n displayName?: string\n}\n\n/**\n * A component that can customize the React element type that it renders (a.k.a. a polymorphic\n * component). This is achieved by passing a prop `as={ElementType}` or `as=\"html-tag-name\"`.\n *\n * It transparently takes care of forwarding refs, and properly sets the ref type depending on the\n * element type.\n *\n * ## Recognizing props based on the polymorphic type\n *\n * The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop\n * component or HTML element is, the type system will automatically allow you to pass props that are\n * not explicitly defined by you, but that are recognized as valid props to be passed to the\n * component you are rendering.\n *\n * For instance, see the following example:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor=\"field-id\">Hello</Box>\n * ```\n *\n * The `htmlFor` prop is exclusive to label elements. If you omit the `as=\"label\"` prop, the type\n * system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of\n * an incorrect type to such prop. For instance, the example below will issue a type error:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor={123}>Hello</Box>\n * ```\n *\n * ## Omitting or obfuscating the `className` prop\n *\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This is to discourage customizing design system components via custom styling, while still\n * leaving the door open to do it as an escape hatch when the design system still has shortcomings\n * with respect to the product designs we want to achieve.\n *\n * The cumbersome name also serves the purpose of aiding in easily searching for the places in the\n * code where this escape hatch was needed, in order to identify areas where the design system\n * components need to improve to better match our needs.\n *\n * This behaviour can be customized via an optional second generic argument that allows to disable\n * this feature, or to omit the `className` altogether without replacing it with the obfuscated prop\n * name.\n *\n * @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)\n */\ninterface PolymorphicComponent<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n> {\n <TT extends React.ElementType = ComponentType>(\n props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>,\n ): React.ReactElement | null\n readonly $$typeof: symbol\n defaultProps?: Partial<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n propTypes?: React.WeakValidationMap<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n displayName?: string\n}\n\n/**\n * A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a\n * convenience over merely using React.forwardRef directly, and then manually forcing the resulting\n * value to be typed using `as PolymorphicComponent<…>`.\n *\n * @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)\n */\nfunction polymorphicComponent<\n ComponentType extends React.ElementType = 'div',\n OwnProps = EmptyObject,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>) {\n return React.forwardRef(render) as PolymorphicComponent<\n ComponentType,\n OwnProps,\n ShouldObfuscateClassName\n >\n}\n\nexport type { PolymorphicComponent }\nexport { polymorphicComponent }\n","type ResponsiveBreakpoints = 'mobile' | 'tablet' | 'desktop'\n\ntype Atom = string | number | boolean\n\n/**\n * A responsive prop supports receiving values of its given base type, or an object mapping a\n * responsive breakpoint name to a value from the prop's base type.\n *\n * Some examples:\n *\n * - `align={{ mobile: 'left', tablet: 'center', desktop: 'right' }}`\n */\ntype ResponsiveProp<AtomType extends Atom> =\n | AtomType\n | Readonly<{ [key in ResponsiveBreakpoints]?: AtomType }>\n\nconst DEBUG = process.env.NODE_ENV === 'development'\n\n/**\n * Builds a css module class name for a given prop + prop-value combination.\n *\n * We have a convention of building the internal utility-based class names system in a way that\n * resembles the prop for which it is used and the value of the prop. For instance, in a component\n * with a prop `width` with possible values `narrow` and `wide`, we encode the styles for each of\n * these alternatives in the class-names `.width-narrow` and `.width-wide`.\n *\n * Furthermore, this helper is aware of responsive prop values. For instance, if you provide the\n * `width` prop above with the value `['narrow', 'wide']` this returns `['narrow', 'tablet-wide']`.\n * That is, it returns an array of class names, following the same convention above, but also\n * prefixing by the viewport width variant (`tablet-` or `desktop-`).\n *\n * @param styles the class names mapping imported from a css module\n * @param property the prop name\n * @param value the given prop's value\n */\nfunction getClassNames(\n styles: Record<string, string>,\n property: string,\n value: ResponsiveProp<string> | null | undefined,\n): Array<string | undefined> | null {\n if (!value) {\n return null\n }\n\n const classList: Array<string | undefined> = []\n\n if (typeof value === 'string') {\n classList.push(styles[`${property}-${value}`])\n } else {\n if (value.mobile) classList.push(styles[`${property}-${value.mobile}`])\n if (value.tablet) classList.push(styles[`tablet-${property}-${value.tablet}`])\n if (value.desktop) classList.push(styles[`desktop-${property}-${value.desktop}`])\n }\n\n if (DEBUG && !classList.every(Boolean)) {\n // eslint-disable-next-line no-console\n console.warn('Not all generated class names were found', { property, value, classList })\n }\n\n return classList\n}\n\n/**\n * A mapping over a responsive prop value.\n *\n * Since response values can be an object but also a scalar value, this helper makes it easier to\n * to map the values when it's an object but keeps it consistent for the case when it is a scalar\n * value as well.\n *\n * @param fromValue the responsive prop value\n * @param mapper the mapping function\n */\nfunction mapResponsiveProp<From extends Atom, To extends Atom>(\n fromValue: ResponsiveProp<From> | undefined,\n mapper: (from: From) => To,\n): ResponsiveProp<To> | undefined {\n if (!fromValue) {\n return undefined\n }\n\n if (typeof fromValue !== 'object') {\n return mapper(fromValue)\n }\n\n return {\n mobile: fromValue.mobile ? mapper(fromValue.mobile) : undefined,\n tablet: fromValue.tablet ? mapper(fromValue.tablet) : undefined,\n desktop: fromValue.desktop ? mapper(fromValue.desktop) : undefined,\n }\n}\n\nexport type { ResponsiveProp, ResponsiveBreakpoints }\nexport { getClassNames, mapResponsiveProp }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { getClassNames } from '../utils/responsive-props'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type {\n DividerWeight,\n Space,\n SpaceWithNegatives,\n WithEnhancedClassName,\n} from '../utils/common-types'\n\nimport styles from './box.module.css'\nimport paddingStyles from './padding.module.css'\nimport marginStyles from './margin.module.css'\nimport widthStyles from './width.module.css'\nimport gapStyles from './gap.module.css'\n\ninterface BoxPaddingProps {\n padding?: ResponsiveProp<Space>\n paddingX?: ResponsiveProp<Space>\n paddingY?: ResponsiveProp<Space>\n paddingTop?: ResponsiveProp<Space>\n paddingRight?: ResponsiveProp<Space>\n paddingBottom?: ResponsiveProp<Space>\n paddingLeft?: ResponsiveProp<Space>\n}\n\ninterface BoxMarginProps {\n margin?: ResponsiveProp<SpaceWithNegatives>\n marginX?: ResponsiveProp<SpaceWithNegatives>\n marginY?: ResponsiveProp<SpaceWithNegatives>\n marginTop?: ResponsiveProp<SpaceWithNegatives>\n marginRight?: ResponsiveProp<SpaceWithNegatives>\n marginBottom?: ResponsiveProp<SpaceWithNegatives>\n marginLeft?: ResponsiveProp<SpaceWithNegatives>\n}\n\ntype BoxDisplay = 'block' | 'flex' | 'inline' | 'inlineBlock' | 'inlineFlex' | 'none'\ntype BoxFlexDirection = 'column' | 'row'\ntype BoxFlexWrap = 'nowrap' | 'wrap'\ntype BoxAlignItems = 'center' | 'flexEnd' | 'flexStart' | 'baseline'\ntype BoxJustifyContent =\n | 'center'\n | 'flexEnd'\n | 'flexStart'\n | 'spaceAround'\n | 'spaceBetween'\n | 'spaceEvenly'\ntype BoxAlignSelf = 'flexStart' | 'flexEnd' | 'center' | 'baseline' | 'stretch'\ntype BoxOverflow = 'hidden' | 'auto' | 'visible' | 'scroll'\n\ntype BoxMaxMinWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'\ntype BoxMinWidth = 0 | BoxMaxMinWidth\ntype BoxMaxWidth = BoxMaxMinWidth | 'full'\ntype BoxWidth = 0 | BoxMaxMinWidth | 'full' | 'auto' | 'maxContent' | 'minContent' | 'fitContent'\ntype BoxBackground = 'default' | 'aside' | 'highlight' | 'selected' | 'toast'\ntype BoxBorderRadius = 'standard' | 'none' | 'full'\n\ninterface BorderProps {\n borderRadius?: BoxBorderRadius\n border?: DividerWeight\n}\n\ninterface ReusableBoxProps extends BorderProps, BoxPaddingProps {\n minWidth?: BoxMinWidth\n maxWidth?: BoxMaxWidth\n width?: BoxWidth\n background?: BoxBackground\n flexGrow?: 0 | 1\n flexShrink?: 0\n}\n\ntype BoxPosition = 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'\ntype BoxTextAlign = 'start' | 'center' | 'end' | 'justify'\n\ninterface BoxProps extends WithEnhancedClassName, ReusableBoxProps, BoxMarginProps {\n position?: ResponsiveProp<BoxPosition>\n display?: ResponsiveProp<BoxDisplay>\n flexDirection?: ResponsiveProp<BoxFlexDirection>\n flexWrap?: BoxFlexWrap\n gap?: ResponsiveProp<Space | 'none'>\n alignItems?: ResponsiveProp<BoxAlignItems>\n alignSelf?: ResponsiveProp<BoxAlignSelf>\n justifyContent?: ResponsiveProp<BoxJustifyContent>\n overflow?: BoxOverflow\n height?: 'full'\n textAlign?: ResponsiveProp<BoxTextAlign>\n}\n\nfunction getBoxClassNames({\n position = 'static',\n display,\n flexDirection = 'row',\n flexWrap,\n flexGrow,\n flexShrink,\n gap,\n alignItems,\n justifyContent,\n alignSelf,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign,\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n}: BoxProps) {\n const resolvedPaddingTop = paddingTop ?? paddingY ?? padding\n const resolvedPaddingRight = paddingRight ?? paddingX ?? padding\n const resolvedPaddingBottom = paddingBottom ?? paddingY ?? padding\n const resolvedPaddingLeft = paddingLeft ?? paddingX ?? padding\n\n const resolvedMarginTop = marginTop ?? marginY ?? margin\n const resolvedMarginRight = marginRight ?? marginX ?? margin\n const resolvedMarginBottom = marginBottom ?? marginY ?? margin\n const resolvedMarginLeft = marginLeft ?? marginX ?? margin\n\n const omitFlex =\n !display || (typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex')\n\n return classNames(\n className,\n styles.box,\n display ? getClassNames(styles, 'display', display) : null,\n position !== 'static' ? getClassNames(styles, 'position', position) : null,\n minWidth != null ? getClassNames(widthStyles, 'minWidth', String(minWidth)) : null,\n getClassNames(widthStyles, 'maxWidth', maxWidth),\n getClassNames(styles, 'textAlign', textAlign),\n // padding\n getClassNames(paddingStyles, 'paddingTop', resolvedPaddingTop),\n getClassNames(paddingStyles, 'paddingRight', resolvedPaddingRight),\n getClassNames(paddingStyles, 'paddingBottom', resolvedPaddingBottom),\n getClassNames(paddingStyles, 'paddingLeft', resolvedPaddingLeft),\n // margin\n getClassNames(marginStyles, 'marginTop', resolvedMarginTop),\n getClassNames(marginStyles, 'marginRight', resolvedMarginRight),\n getClassNames(marginStyles, 'marginBottom', resolvedMarginBottom),\n getClassNames(marginStyles, 'marginLeft', resolvedMarginLeft),\n // flex props\n omitFlex ? null : getClassNames(styles, 'flexDirection', flexDirection),\n omitFlex ? null : getClassNames(styles, 'flexWrap', flexWrap),\n omitFlex ? null : getClassNames(styles, 'alignItems', alignItems),\n omitFlex ? null : getClassNames(styles, 'justifyContent', justifyContent),\n alignSelf != null ? getClassNames(styles, 'alignSelf', alignSelf) : null,\n flexShrink != null ? getClassNames(styles, 'flexShrink', String(flexShrink)) : null,\n flexGrow != null ? getClassNames(styles, 'flexGrow', String(flexGrow)) : null,\n gap ? getClassNames(gapStyles, 'gap', gap) : null,\n // other props\n getClassNames(styles, 'overflow', overflow),\n width != null ? getClassNames(widthStyles, 'width', String(width)) : null,\n getClassNames(styles, 'height', height),\n getClassNames(styles, 'bg', background),\n borderRadius !== 'none' ? getClassNames(styles, 'borderRadius', borderRadius) : null,\n border !== 'none' ? getClassNames(styles, 'border', border) : null,\n )\n}\n\nconst Box = polymorphicComponent<'div', BoxProps, 'keepClassName'>(function Box(\n {\n as: component = 'div',\n position = 'static',\n display,\n flexDirection = 'row',\n flexWrap,\n flexGrow,\n flexShrink,\n gap,\n alignItems,\n justifyContent,\n alignSelf,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign,\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n children,\n ...props\n },\n ref,\n) {\n return React.createElement(\n component,\n {\n ...props,\n className: getBoxClassNames({\n position,\n display,\n flexDirection,\n flexWrap,\n flexGrow,\n flexShrink,\n gap,\n alignItems,\n justifyContent,\n alignSelf,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign,\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n }),\n ref,\n },\n children,\n )\n})\n\nexport type {\n BoxProps,\n BoxPaddingProps,\n BoxMarginProps,\n ReusableBoxProps,\n BoxMinWidth,\n BoxMaxWidth,\n BoxDisplay,\n BoxPosition,\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxOverflow,\n BoxTextAlign,\n BoxBackground,\n BoxBorderRadius,\n}\n\nexport { Box, getBoxClassNames }\n","import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { getClassNames, mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp, ResponsiveBreakpoints } from '../utils/responsive-props'\nimport type { Space } from '../utils/common-types'\nimport type { ReusableBoxProps } from '../box'\n\nimport styles from './columns.module.css'\n\ntype ColumnWidth =\n | 'auto'\n | 'content'\n | '1/2'\n | '1/3'\n | '2/3'\n | '1/4'\n | '3/4'\n | '1/5'\n | '2/5'\n | '3/5'\n | '4/5'\n\ninterface ColumnProps {\n width?: ColumnWidth\n}\n\nconst Column = polymorphicComponent<'div', ColumnProps>(function Column(\n { width = 'auto', children, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n className={[\n exceptionallySetClassName,\n getClassNames(styles, 'columnWidth', width.replace('/', '-')),\n ]}\n minWidth={0}\n height=\"full\"\n flexShrink={width === 'content' ? 0 : undefined}\n flexGrow={width === 'auto' ? 1 : 0}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\ntype ColumnsHorizontalAlignment = 'left' | 'center' | 'right'\ntype ColumnsVerticalAlignment = 'top' | 'center' | 'bottom' | 'baseline'\ntype ColumnsCollapseBelow = Exclude<ResponsiveBreakpoints, 'mobile'>\n\ninterface ColumnsProps extends ReusableBoxProps {\n space?: ResponsiveProp<Space>\n align?: ResponsiveProp<ColumnsHorizontalAlignment>\n alignY?: ResponsiveProp<ColumnsVerticalAlignment>\n collapseBelow?: ResponsiveBreakpoints\n}\n\nconst Columns = polymorphicComponent<'div', ColumnsProps>(function Columns(\n {\n space,\n align = 'left',\n alignY = 'top',\n collapseBelow,\n children,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n return (\n <Box\n {...props}\n className={[\n exceptionallySetClassName,\n styles.container,\n getClassNames(styles, 'container', space),\n ]}\n display=\"flex\"\n gap={space}\n flexDirection={\n collapseBelow === 'desktop'\n ? { mobile: 'column', tablet: 'column', desktop: 'row' }\n : collapseBelow === 'tablet'\n ? { mobile: 'column', tablet: 'row' }\n : 'row'\n }\n alignItems={mapResponsiveProp(alignY, (alignY) =>\n alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : alignY,\n )}\n justifyContent={mapResponsiveProp(align, (align) =>\n align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : align,\n )}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type {\n ColumnProps,\n ColumnsProps,\n ColumnWidth,\n ColumnsCollapseBelow,\n ColumnsHorizontalAlignment,\n ColumnsVerticalAlignment,\n}\n\nexport { Column, Columns }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport type { DividerWeight } from '../utils/common-types'\n\nimport styles from './divider.module.css'\n\ninterface DividerProps {\n weight?: Exclude<DividerWeight, 'none'>\n}\n\nfunction Divider({ weight = 'tertiary', ...props }: DividerProps) {\n return <Box as=\"hr\" className={getClassNames(styles, 'weight', weight)} {...props} />\n}\n\nexport type { DividerProps, DividerWeight }\nexport { Divider }\n","import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type { Space } from '../utils/common-types'\nimport type { ReusableBoxProps } from '../box'\n\ntype InlineAlign = 'left' | 'center' | 'right'\n\ninterface InlineProps extends ReusableBoxProps {\n space?: ResponsiveProp<Space>\n align?: ResponsiveProp<InlineAlign>\n alignY?: ResponsiveProp<'top' | 'center' | 'bottom'>\n}\n\nconst Inline = polymorphicComponent<'div', InlineProps>(function Inline(\n { as, space, align = 'left', alignY = 'center', children, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"flex\"\n flexWrap=\"wrap\"\n gap={space}\n className={exceptionallySetClassName}\n ref={ref}\n alignItems={mapResponsiveProp(alignY, (alignY) =>\n alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center',\n )}\n justifyContent={mapResponsiveProp(align, (align) =>\n align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center',\n )}\n >\n {children}\n </Box>\n )\n})\n\nexport type { InlineProps, InlineAlign }\nexport { Inline }\n","import * as React from 'react'\nimport flattenChildren from 'react-keyed-flatten-children'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport { Divider } from '../divider'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type { DividerWeight, Space } from '../utils/common-types'\nimport type { BoxProps, ReusableBoxProps } from '../box'\n\ntype Align = 'start' | 'center' | 'end'\n\ninterface StackProps extends ReusableBoxProps {\n /** Space between items */\n space?: ResponsiveProp<Space>\n /** Align items horizontally */\n align?: ResponsiveProp<Align>\n /** The weight of the dividers to add. Defaults to 'none', which means no dividers are added */\n dividers?: DividerWeight\n}\n\nconst Stack = polymorphicComponent<'div', StackProps>(function Stack(\n {\n as,\n space,\n align,\n dividers = 'none',\n width = 'full',\n children,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const alignItems: BoxProps['alignItems'] =\n align === undefined\n ? undefined\n : mapResponsiveProp(align, (align) =>\n align === 'start' ? 'flexStart' : align === 'end' ? 'flexEnd' : 'center',\n )\n\n return (\n <Box\n {...props}\n display=\"flex\"\n flexDirection=\"column\"\n width={width}\n alignItems={alignItems}\n gap={space}\n as={as}\n className={exceptionallySetClassName}\n ref={ref}\n >\n {dividers !== 'none'\n ? React.Children.map(flattenChildren(children), (child, index) =>\n index > 0 ? (\n <>\n <Divider weight={dividers} />\n {child}\n </>\n ) : (\n child\n ),\n )\n : children}\n </Box>\n )\n})\n\nexport type { StackProps }\nexport { Stack }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport styles from './hidden.module.css'\nimport type { ResponsiveBreakpoints } from '../utils/responsive-props'\nimport { polymorphicComponent } from '../utils/polymorphism'\n\ntype AboveProp = {\n /**\n * Hides the element on viewport sizes equal or larger to the one given.\n *\n * It is not supported to pass it alongside `below`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see below\n */\n above: Exclude<ResponsiveBreakpoints, 'desktop'>\n below?: never\n}\n\ntype BelowProp = {\n /**\n * Hides the element on viewport sizes equal or smaller to the one given.\n *\n * It is not supported to pass it alongside `above`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see above\n */\n below: Exclude<ResponsiveBreakpoints, 'mobile'>\n above?: never\n}\n\ntype CommonProps = {\n children: React.ReactNode\n /**\n * hides the element when on print media.\n */\n print?: boolean\n /**\n * Useful if you want the element to be an inline element when it is visible.\n */\n display?: 'inline' | 'block'\n}\n\ntype HiddenProps = CommonProps & (AboveProp | BelowProp | Required<Pick<CommonProps, 'print'>>)\n\n/**\n * A component that allows to specify how to hide itself on certain responsive screen sizes, or on\n * print media.\n *\n * @see HiddenProps\n * @see HiddenVisually for hiding content only visually, while keeping it available for assistive\n * technologies.\n */\nconst Hidden = polymorphicComponent<'div', HiddenProps>(function Hidden(\n { display = 'block', children, exceptionallySetClassName, ...props },\n ref,\n) {\n const hiddenOnPrint = 'print' in props && props.print\n\n const hiddenOnDesktop = 'above' in props\n const hiddenOnMobile = 'below' in props\n const hiddenOnTablet =\n ('below' in props && props.below === 'desktop') ||\n ('above' in props && props.above === 'mobile')\n\n if (hiddenOnDesktop && hiddenOnMobile) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> should receive either above=\"…\" or below=\"…\" but not both')\n }\n\n if (!hiddenOnDesktop && !hiddenOnMobile && !hiddenOnPrint) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> did not receive any criteria to hide itself')\n }\n\n // We need to delete these so they do not get forwarded to the Box\n if ('above' in props) delete props['above']\n if ('below' in props) delete props['below']\n if ('print' in props) delete props['print']\n\n return (\n <Box\n {...props}\n ref={ref}\n className={[exceptionallySetClassName, hiddenOnPrint ? styles.hiddenOnPrint : null]}\n display={\n hiddenOnDesktop && hiddenOnMobile\n ? 'none'\n : {\n mobile: hiddenOnMobile ? 'none' : display,\n tablet: hiddenOnTablet ? 'none' : display,\n desktop: hiddenOnDesktop ? 'none' : display,\n }\n }\n >\n {children}\n </Box>\n )\n})\n\nexport { Hidden }\nexport type { HiddenProps }\n","import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { Box } from '../box'\nimport styles from './hidden-visually.module.css'\n\ntype Props = {\n children: React.ReactNode\n}\n\n/**\n * Provides content to assistive technologies while hiding it from the screen.\n *\n * @see Hidden for fully hiding content, and only under certain conditions.\n */\nconst HiddenVisually = polymorphicComponent<'div', Props, 'omitClassName'>(function HiddenVisually(\n props,\n ref,\n) {\n return (\n <Box\n {...props}\n ref={ref}\n position=\"absolute\"\n overflow=\"hidden\"\n className={styles.hiddenVisually}\n />\n )\n})\n\nexport { HiddenVisually }\n","import * as React from 'react'\n\nlet uid = 0\nfunction uniqueId() {\n return uid++\n}\n\nexport function generateElementId(prefix: string): string {\n const num = uniqueId()\n return `${prefix}-${num}`\n}\n\nexport function useId(providedId?: string): string {\n const ref = React.useRef<string | null>(providedId ?? null)\n if (!ref.current) {\n ref.current = generateElementId('element')\n }\n return ref.current\n}\n","import * as React from 'react'\nimport styles from './spinner.module.css'\n\nfunction Spinner({ size = 24 }: { size?: number }) {\n return (\n <svg\n aria-hidden\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n className={styles.svg}\n data-chromatic=\"ignore\"\n >\n <g fill=\"none\" fillRule=\"nonzero\">\n <path\n className={styles.tint}\n d=\"M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z\"\n />\n <path\n className={styles.fill}\n d=\"M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z\"\n />\n </g>\n </svg>\n )\n}\n\nexport { Spinner }\n","import * as React from 'react'\n\nimport {\n useTooltipStore,\n Tooltip as AriakitTooltip,\n TooltipAnchor,\n TooltipArrow,\n} from '@ariakit/react'\nimport { Box } from '../box'\n\nimport type { TooltipStoreState } from '@ariakit/react'\n\nimport styles from './tooltip.module.css'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nconst defaultShowTimeout = 500\nconst defaultHideTimeout = 100\n\ntype TooltipContextState = {\n showTimeout: number\n hideTimeout: number\n}\n\nconst TooltipContext = React.createContext<TooltipContextState>({\n showTimeout: defaultShowTimeout,\n hideTimeout: defaultHideTimeout,\n})\n\nfunction TooltipProvider({\n showTimeout = defaultShowTimeout,\n hideTimeout = defaultHideTimeout,\n children,\n}: React.PropsWithChildren<{\n showTimeout?: number\n hideTimeout?: number\n}>) {\n const value = React.useMemo(() => ({ showTimeout, hideTimeout }), [showTimeout, hideTimeout])\n return <TooltipContext.Provider value={value}>{children}</TooltipContext.Provider>\n}\n\ninterface TooltipProps extends ObfuscatedClassName {\n /**\n * The element that triggers the tooltip. Generally a button or link.\n *\n * It should be an interactive element accessible both via mouse and keyboard interactions.\n */\n children: React.ReactNode\n\n /**\n * The content to show in the tooltip.\n *\n * It can be rich content provided via React elements, or string content. It should not include\n * interactive elements inside it. This includes links or buttons.\n *\n * You can provide a function instead of the content itself. In this case, the function should\n * return the desired content. This is useful if the content is expensive to generate. It can\n * also be useful if the content dynamically changes often, so every time you trigger the\n * tooltip the content may have changed (e.g. if you show a ticking time clock in the tooltip).\n *\n * The trigger element will be associated to this content via `aria-describedby`. This means\n * that the tooltip content will be read by assistive technologies such as screen readers. It\n * will likely read this content right after reading the trigger element label.\n */\n content: React.ReactNode | (() => React.ReactNode)\n\n /**\n * How to place the tooltip relative to its trigger element.\n *\n * The possible values are \"top\", \"bottom\", \"left\", \"right\". Additionally, any of these values\n * can be combined with `-start` or `-end` for even more control. For instance `top-start` will\n * place the tooltip at the top, but with the start (e.g. left) side of the toolip and the\n * trigger aligned. If neither `-start` or `-end` are provided, the tooltip is centered along\n * the vertical or horizontal axis with the trigger.\n *\n * The position is enforced whenever possible, but tooltips can appear in different positions\n * if the specified one would make the tooltip intersect with the viewport edges.\n *\n * @default 'top'\n */\n position?: TooltipStoreState['placement']\n\n /**\n * The separation (in pixels) between the trigger element and the tooltip.\n * @default 3\n */\n gapSize?: number\n\n /**\n * Whether to show an arrow-like element attached to the tooltip, and pointing towards the\n * trigger element.\n * @default false\n */\n withArrow?: boolean\n\n /**\n * The amount of time in milliseconds to wait before showing the tooltip\n * Use `<TooltipContext.Provider>` to set a global value for all tooltips\n * @default 500\n */\n showTimeout?: number\n\n /**\n * The amount of time in milliseconds to wait before hiding the tooltip\n * Use `<TooltipContext.Provider>` to set a global value for all tooltips\n * @default 100\n */\n hideTimeout?: number\n}\n\nfunction Tooltip({\n children,\n content,\n position = 'top',\n gapSize = 3,\n withArrow = false,\n showTimeout,\n hideTimeout,\n exceptionallySetClassName,\n}: TooltipProps) {\n const { showTimeout: globalShowTimeout, hideTimeout: globalHideTimeout } = React.useContext(\n TooltipContext,\n )\n const tooltip = useTooltipStore({\n placement: position,\n showTimeout: showTimeout ?? globalShowTimeout,\n hideTimeout: hideTimeout ?? globalHideTimeout,\n })\n const isOpen = tooltip.useState('open')\n\n const child = React.Children.only(\n children as React.FunctionComponentElement<JSX.IntrinsicElements['div']> | null,\n )\n\n if (!child) {\n return child\n }\n\n if (typeof child.ref === 'string') {\n throw new Error('Tooltip: String refs cannot be used as they cannot be forwarded')\n }\n\n return (\n <>\n <TooltipAnchor render={child} store={tooltip} ref={child.ref} />\n {isOpen && content ? (\n <AriakitTooltip\n store={tooltip}\n gutter={gapSize}\n render={\n <Box\n className={[styles.tooltip, exceptionallySetClassName]}\n background=\"toast\"\n borderRadius=\"standard\"\n paddingX=\"small\"\n paddingY=\"xsmall\"\n maxWidth=\"medium\"\n width=\"fitContent\"\n overflow=\"hidden\"\n textAlign=\"center\"\n />\n }\n >\n {withArrow ? <TooltipArrow /> : null}\n {typeof content === 'function' ? content() : content}\n </AriakitTooltip>\n ) : null}\n </>\n )\n}\n\nexport type { TooltipProps }\nexport { Tooltip, TooltipProvider }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport { Role, RoleProps } from '@ariakit/react'\n\nimport { Box, getBoxClassNames } from '../box'\nimport { Spinner } from '../spinner'\nimport { Tooltip, TooltipProps } from '../tooltip'\n\nimport styles from './button.module.css'\n\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nfunction preventDefault(event: React.SyntheticEvent) {\n event.preventDefault()\n}\n\ntype ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary'\ntype ButtonTone = 'normal' | 'destructive'\ntype ButtonSize = 'small' | 'normal' | 'large'\ntype IconElement = React.ReactElement | string\n\ninterface CommonButtonProps\n extends ObfuscatedClassName,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>,\n Pick<RoleProps, 'render'> {\n /**\n * The button's variant.\n */\n variant: ButtonVariant\n\n /**\n * The button's tone.\n *\n * @default 'normal'\n */\n tone?: ButtonTone\n\n /**\n * The button's size.\n *\n * @default 'normal'\n */\n size?: ButtonSize\n\n /**\n * Controls the shape of the button.\n *\n * Specifically, it allows to make it have slightly curved corners (the default) vs. having them\n * fully curved to the point that they are as round as possible.\n *\n * In icon-only buttons this allows to have the button be circular.\n *\n * @default 'normal'\n */\n shape?: 'normal' | 'rounded'\n\n /**\n * Whether the button is disabled or not.\n *\n * Buttons are disabled using aria-disabled, rather than the HTML disabled attribute. This\n * allows the buttons to be focusable, which can aid discoverability. This way, users can tab to\n * the button and read its label, even if they can't activate it.\n *\n * It is also convenient when buttons are rendered as a link. Links cannot normally be disabled,\n * but by using aria-disabled, we can make them behave as if they were.\n *\n * The `onClick` handler is automatically prevented when the button is disabled in this way, to\n * mimic the behavior of a native disabled attribute.\n *\n * @default false\n */\n disabled?: boolean\n\n /**\n * Whether the button is busy/loading.\n *\n * A button in this state is functionally and semantically disabled. Visually is does not look\n * dimmed (as disabled buttons normally do), but it shows a loading spinner instead.\n *\n * @default false\n */\n loading?: boolean\n\n /**\n * A tooltip linked to the button element.\n */\n tooltip?: TooltipProps['content']\n\n /**\n * The type of the button.\n *\n * @default 'button'\n */\n type?: 'button' | 'submit' | 'reset'\n}\n\ninterface ButtonProps extends CommonButtonProps {\n /**\n * The button label content.\n */\n children?: React.ReactNode\n\n /**\n * The icon to display at the start of the button (before the label).\n */\n startIcon?: IconElement\n\n /**\n * The icon to display at the end of the button (after the label).\n */\n endIcon?: IconElement\n\n /**\n * The width of the button.\n *\n * - `'auto'`: The button will be as wide as its content.\n * - `'full'`: The button will be as wide as its container.\n *\n * @default 'auto'\n */\n width?: 'auto' | 'full'\n\n /**\n * The alignment of the button label inside the button.\n *\n * @default 'center'\n */\n align?: 'start' | 'center' | 'end'\n}\n\n/**\n * A button element that displays a text label and optionally a start or end icon. It follows the\n * [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant,\n tone = 'normal',\n size = 'normal',\n shape = 'normal',\n type = 'button',\n disabled = false,\n loading = false,\n tooltip,\n render,\n onClick,\n exceptionallySetClassName,\n children,\n startIcon,\n endIcon,\n width = 'auto',\n align = 'center',\n ...props\n },\n ref,\n) {\n const isDisabled = loading || disabled\n const buttonElement = (\n <Role.button\n {...props}\n render={render}\n type={render != null ? undefined : type}\n ref={ref}\n aria-disabled={isDisabled}\n onClick={isDisabled ? preventDefault : onClick}\n className={classNames([\n getBoxClassNames({ width }),\n exceptionallySetClassName,\n styles.baseButton,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n shape === 'rounded' ? styles['shape-rounded'] : null,\n disabled ? styles.disabled : null,\n ])}\n >\n <>\n {startIcon ? (\n <Box display=\"flex\" className={styles.startIcon} aria-hidden>\n {loading && !endIcon ? <Spinner /> : startIcon}\n </Box>\n ) : null}\n\n {children ? (\n <Box\n as=\"span\"\n className={styles.label}\n overflow=\"hidden\"\n width={width === 'full' ? 'full' : undefined}\n textAlign={width === 'auto' ? 'center' : align}\n >\n {children}\n </Box>\n ) : null}\n\n {endIcon || (loading && !startIcon) ? (\n <Box display=\"flex\" className={styles.endIcon} aria-hidden>\n {loading ? <Spinner /> : endIcon}\n </Box>\n ) : null}\n </>\n </Role.button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{buttonElement}</Tooltip> : buttonElement\n})\n\ninterface IconButtonProps extends CommonButtonProps {\n /**\n * The icon to display inside the button.\n */\n icon: IconElement\n\n /**\n * The button label.\n *\n * It is used for assistive technologies, and it is also shown as a tooltip (if not tooltip is\n * provided explicitly).\n */\n 'aria-label': string\n}\n\n/**\n * A button element that displays an icon only, visually, though it is semantically labelled. It\n * also makes sure to always show a tooltip with its label. It follows the\n * [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).\n */\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n variant,\n tone = 'normal',\n size = 'normal',\n shape = 'normal',\n type = 'button',\n disabled = false,\n loading = false,\n tooltip,\n render,\n onClick,\n exceptionallySetClassName,\n children,\n icon,\n ...props\n },\n ref,\n) {\n const isDisabled = loading || disabled\n const buttonElement = (\n <Role.button\n {...props}\n render={render}\n type={render != null ? undefined : type}\n ref={ref}\n aria-disabled={isDisabled}\n onClick={isDisabled ? preventDefault : onClick}\n className={classNames([\n exceptionallySetClassName,\n styles.baseButton,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n shape === 'rounded' ? styles['shape-rounded'] : null,\n styles.iconButton,\n disabled ? styles.disabled : null,\n ])}\n >\n {(loading && <Spinner />) || icon}\n </Role.button>\n )\n\n const tooltipContent = tooltip === undefined ? props['aria-label'] : tooltip\n return tooltipContent ? (\n <Tooltip content={tooltipContent}>{buttonElement}</Tooltip>\n ) : (\n buttonElement\n )\n})\n\nexport type { ButtonProps, IconButtonProps, ButtonVariant, ButtonTone }\nexport { Button, IconButton }\n","import * as React from 'react'\n\nfunction CloseIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M5.146 5.146a.5.5 0 0 1 .708 0L12 11.293l6.146-6.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 0 .708L12.707 12l6.147 6.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.708 0L12 12.707l-6.146 6.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1 0-.708L11.293 12 5.146 5.854a.5.5 0 0 1-.057-.638z\"\n />\n </svg>\n )\n}\n\nexport { CloseIcon }\n","import * as React from 'react'\nimport type { SystemBannerType } from '../banner/banner'\n\nimport styles from './banner-icon.module.css'\n\nconst bannerIconForType: Record<SystemBannerType, typeof BannerInfoIcon> = {\n info: BannerInfoIcon,\n upgrade: BannerUpgradeIcon,\n experiment: BannerExperimentIcon,\n warning: BannerWarningIcon,\n error: BannerErrorIcon,\n success: BannerSuccessIcon,\n}\n\nfunction BannerIcon({ type, ...props }: JSX.IntrinsicElements['svg'] & { type: SystemBannerType }) {\n const Icon = bannerIconForType[type]\n return Icon ? (\n <Icon {...props} data-testid={`banner-icon-${type}`} className={styles[type]} aria-hidden />\n ) : null\n}\n\nfunction BannerInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.75 1.94a.75.75 0 0 0 0 1.5h1.25v3.5h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13V11a.752.752 0 0 0-.75-.75h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerUpgradeIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M13.974 4.226a2.485 2.485 0 0 0-3.948 0 2.485 2.485 0 0 1-2.304.954A2.485 2.485 0 0 0 4.93 7.972a2.485 2.485 0 0 1-.954 2.304 2.485 2.485 0 0 0 0 3.948 2.485 2.485 0 0 1 .954 2.304 2.485 2.485 0 0 0 2.792 2.792 2.485 2.485 0 0 1 2.304.954 2.485 2.485 0 0 0 3.948 0 2.485 2.485 0 0 1 2.304-.954 2.485 2.485 0 0 0 2.792-2.792 2.485 2.485 0 0 1 .954-2.304 2.485 2.485 0 0 0 0-3.948 2.485 2.485 0 0 1-.954-2.304 2.485 2.485 0 0 0-2.792-2.792 2.485 2.485 0 0 1-2.304-.954ZM11.228 7.08c-.297-.581-1.177-.345-1.144.306l.125 2.437a.605.605 0 0 1-.635.635l-2.437-.125c-.651-.033-.887.847-.306 1.144l2.172 1.11c.32.163.428.567.233.868L7.91 15.503c-.355.548.289 1.192.837.837l2.047-1.326a.605.605 0 0 1 .868.233l1.11 2.172c.297.581 1.177.345 1.144-.306l-.125-2.437a.605.605 0 0 1 .635-.635l2.437.125c.651.033.887-.847.306-1.144l-2.172-1.11a.605.605 0 0 1-.233-.868l1.326-2.047c.355-.548-.289-1.192-.837-.837l-2.047 1.326a.605.605 0 0 1-.868-.233l-1.11-2.172Z\"\n clipRule=\"evenodd\"\n />\n <path\n fill=\"#fff\"\n d=\"M10.084 7.387c-.033-.651.847-.887 1.144-.306l1.11 2.172c.163.32.567.428.868.233l2.047-1.326c.548-.355 1.192.289.837.837l-1.326 2.047a.605.605 0 0 0 .233.868l2.172 1.11c.581.297.345 1.177-.306 1.144l-2.437-.125a.605.605 0 0 0-.635.635l.125 2.437c.033.651-.847.887-1.144.306l-1.11-2.172a.605.605 0 0 0-.868-.233L8.747 16.34c-.548.355-1.192-.289-.837-.837l1.326-2.047a.605.605 0 0 0-.233-.868l-2.172-1.11c-.581-.297-.345-1.177.306-1.144l2.437.125a.605.605 0 0 0 .635-.635l-.125-2.437Z\"\n />\n </svg>\n )\n}\n\nfunction BannerExperimentIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M12 3.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1H14v4.333a2 2 0 0 0 .4 1.2l4.4 5.867a1 1 0 0 1-.8 1.6H6a1 1 0 0 1-.8-1.6l4.4-5.867a2 2 0 0 0 .4-1.2V8.25h-.5a.5.5 0 0 1-.5-.5Zm1.5-2.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1Zm4.5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-4 3v4.333a3 3 0 0 1-.6 1.8l-.752 1.003c.11.078.245.16.403.226.41.173.985.253 1.682-.188.808-.51 1.547-.67 2.142-.674l-.275-.367a3 3 0 0 1-.6-1.8V8.25h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerWarningIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"m10.272 5.212-7.018 12.03a2 2 0 0 0 1.728 3.008h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.014A.987.987 0 0 0 12 8.75h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.028Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerErrorIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M12.987 2.5a2.07 2.07 0 0 0-1.974 0L4.048 6.287A1.989 1.989 0 0 0 3 8.032v7.436c0 .725.401 1.393 1.048 1.745L11.013 21a2.07 2.07 0 0 0 1.974 0l6.965-3.787A1.989 1.989 0 0 0 21 15.468V8.032c0-.725-.401-1.393-1.048-1.745L12.987 2.5ZM12 7.25a.987.987 0 0 1 .986 1.014l-.001.027-.236 4.25c-.053.945-1.445.945-1.498 0l-.236-4.25a.987.987 0 0 1 .93-1.04h.028L12 7.25Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerSuccessIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.303a.748.748 0 0 1-1.061 0L7.666 13.15a.75.75 0 1 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nexport { BannerIcon }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport styles from './text-link.module.css'\nimport type { OpenInNewTab } from '../utils/common-types'\n\ntype TextLinkColors = 'default' | 'inherit'\n\ntype TextLinkProps = OpenInNewTab & {\n color?: TextLinkColors\n underline?: boolean\n}\n\nconst TextLink = polymorphicComponent<'a', TextLinkProps>(function TextLink(\n {\n as = 'a',\n openInNewTab = false,\n exceptionallySetClassName,\n color = 'default',\n underline = true,\n ...props\n },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"inline\"\n className={[\n exceptionallySetClassName,\n styles.container,\n styles[color],\n underline ? styles.underline : styles['no-underline'],\n ]}\n ref={ref}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n />\n )\n})\n\nexport { TextLink }\nexport type { TextLinkProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './banner.module.css'\nimport { Button, ButtonProps, IconButton } from '../button'\nimport { CloseIcon } from '../icons/close-icon'\nimport { BannerIcon } from '../icons/banner-icon'\nimport { TextLink } from '../text-link'\n\n/**\n * Represents the type of a banner.\n * 'neutral' accepts a custom icon, the rest do not.\n * @default 'neutral'\n */\nexport type BannerType = 'neutral' | SystemBannerType\n\n/**\n * Predefined system types for banners.\n * Each type has its own preset icon.\n */\nexport type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success'\n\ntype BaseAction = {\n variant: 'primary' | 'tertiary'\n label: string\n} & Pick<ButtonProps, 'loading' | 'disabled'>\ntype ActionButton = BaseAction & { type: 'button' } & Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'className'\n >\ntype ActionLink = BaseAction & { type: 'link' } & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'className'\n >\n/**\n * Represents an action that can be taken from the banner.\n * Can be either a button or a link, sharing common properties from BaseAction.\n */\ntype Action = ActionButton | ActionLink\n\n/**\n * Configuration for inline links within the banner description.\n * Extends TextLink component props with a required label.\n */\ntype InlineLink = { label: string } & React.ComponentProps<typeof TextLink>\n\ntype WithCloseButton = {\n closeLabel?: string\n onClose: () => void\n}\ntype WithoutCloseButton = {\n closeLabel?: never\n onClose?: never\n}\n/**\n * Controls the close button behavior.\n * If none is provided, the banner will not have a close button.\n */\ntype CloseButton = WithCloseButton | WithoutCloseButton\n\ntype BaseBanner = {\n id?: string\n title?: React.ReactNode\n description: Exclude<React.ReactNode, null | undefined | boolean>\n action?: Action\n inlineLinks?: InlineLink[]\n} & CloseButton\n\n/**\n * Configuration for neutral banners.\n * Can include either an image, an icon, or neither, but never both.\n */\ntype NeutralBanner = BaseBanner & {\n type: Extract<BannerType, 'neutral'>\n} & (\n | { image: React.ReactElement; icon?: never }\n | { icon: React.ReactElement; image?: never }\n | { image?: never; icon?: never }\n )\n\n/**\n * Configuration for system banners.\n * Cannot include custom images or icons as they use preset ones.\n */\ntype SystemBanner = BaseBanner & {\n type: SystemBannerType\n image?: never\n icon?: never\n}\n\ntype BannerProps = NeutralBanner | SystemBanner\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n id,\n type,\n title,\n description,\n action,\n icon,\n image,\n inlineLinks,\n closeLabel,\n onClose,\n ...props\n }: BannerProps,\n ref,\n) {\n const titleId = useId()\n const descriptionId = useId()\n\n const closeButton = onClose ? (\n <IconButton\n exceptionallySetClassName={styles.closeButton}\n variant=\"quaternary\"\n onClick={onClose}\n icon={<CloseIcon />}\n aria-label={closeLabel ?? 'Close banner'}\n />\n ) : null\n\n return (\n <Box\n {...props}\n ref={ref}\n id={id}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"center\"\n role=\"status\"\n aria-labelledby={title ? titleId : descriptionId}\n aria-describedby={title ? descriptionId : undefined}\n aria-live=\"polite\"\n tabIndex={0}\n borderRadius=\"full\"\n className={styles.banner}\n >\n {image ? <Box className={styles.image}>{image}</Box> : null}\n\n <Box className={styles.content} display=\"flex\" gap=\"small\" alignItems=\"center\">\n <Box className={styles.staticContent} display=\"flex\" gap=\"small\" flexGrow={1}>\n <Box className={styles.icon}>\n {type === 'neutral' ? icon : <BannerIcon type={type} />}\n {closeButton}\n </Box>\n\n <Box className={styles.copy} display=\"flex\" flexDirection=\"column\">\n {title ? (\n <Box id={titleId} className={styles.title}>\n {title}\n </Box>\n ) : null}\n <Box\n id={descriptionId}\n className={[styles.description, title ? styles.secondary : null]}\n >\n {description}\n {inlineLinks?.map(({ label, ...props }, index) => {\n return (\n <React.Fragment key={index}>\n <TextLink\n {...props}\n exceptionallySetClassName={styles.inlineLink}\n >\n {label}\n </TextLink>\n {index < inlineLinks.length - 1 ? <span> · </span> : ''}\n </React.Fragment>\n )\n })}\n </Box>\n </Box>\n </Box>\n\n {action || closeButton ? (\n <Box className={styles.actions} display=\"flex\" gap=\"small\">\n {action?.type === 'button' ? <ActionButton {...action} /> : null}\n {action?.type === 'link' ? <ActionLink {...action} /> : null}\n {closeButton}\n </Box>\n ) : null}\n </Box>\n </Box>\n )\n})\n\nfunction ActionButton({ type, label, ...props }: ActionButton) {\n return <Button {...props}>{label}</Button>\n}\n\nfunction ActionLink({ type, label, variant, ...props }: ActionLink) {\n return (\n <Button\n variant={variant}\n render={<a rel=\"noopener noreferrer\" target=\"_blank\" {...props} />}\n >\n {label}\n </Button>\n )\n}\n\nexport { Banner }\nexport type { BannerProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype Size = 'xsmall' | 'small' | 'medium' | 'large'\n\ntype NativeProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'\n>\n\ntype LoadingProps = NativeProps &\n ObfuscatedClassName & {\n /**\n * The size of the loading spinner.\n * @default 'small'\n */\n size?: Size\n\n /**\n * Identifies the element (or elements) that describes the loading component for assistive technologies.\n */\n 'aria-describedby'?: string\n } & (\n | {\n /** Defines a string value that labels the current loading component for assistive technologies. */\n 'aria-label': string\n 'aria-labelledby'?: never\n }\n | {\n /** Identifies the element (or elements) that labels the current loading component for assistive technologies. */\n 'aria-labelledby': string\n 'aria-label'?: never\n }\n )\n\nconst sizeMapping: Record<Size, number> = {\n xsmall: 16,\n small: 24,\n medium: 36,\n large: 48,\n}\n\nfunction Loading({ size = 'small', exceptionallySetClassName, ...props }: LoadingProps) {\n const numericSize = sizeMapping[size] ?? sizeMapping.small\n const ariaLabel = props['aria-label']\n ? props['aria-label']\n : !props['aria-labelledby']\n ? 'Loading…'\n : undefined\n\n return (\n <Box\n {...props}\n aria-label={ariaLabel}\n className={exceptionallySetClassName}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n role=\"progressbar\"\n >\n <Spinner size={numericSize} aria-hidden />\n </Box>\n )\n}\n\nexport { Loading }\nexport type { LoadingProps }\n","import * as React from 'react'\nimport type { AlertTone } from '../utils/common-types'\n\nconst alertIconForTone: Record<AlertTone, typeof AlertInfoIcon> = {\n info: AlertInfoIcon,\n positive: AlertPositiveIcon,\n caution: AlertCautionIcon,\n critical: AlertCriticalIcon,\n}\n\nfunction AlertIcon({ tone, ...props }: JSX.IntrinsicElements['svg'] & { tone: AlertTone }) {\n const Icon = alertIconForTone[tone]\n return Icon ? <Icon {...props} /> : null\n}\n\nfunction AlertInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM10.25 10a.75.75 0 0 0 0 1.5h1.25V15h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13v-4.25a.75.75 0 0 0-.75-.75h-2Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertPositiveIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.304a.748.748 0 0 1-1.061 0l-2.475-2.475a.75.75 0 0 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCautionIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m10.272 4.962-7.018 12.03A2 2 0 0 0 4.982 20h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.013A.987.987 0 0 0 12 8.5h-.028l-.027.002a.987.987 0 0 0-.93 1.04l.236 4.25c.052.944 1.445.944 1.498 0l.236-4.25a1.925 1.925 0 0 0 .001-.055Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCriticalIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.9866 2.25049C12.3729 1.91683 11.6271 1.91683 11.0134 2.25049L4.04793 6.03744C3.40122 6.38904 2.99999 7.05702 2.99999 7.78208V15.2184C2.99999 15.9435 3.40122 16.6115 4.04793 16.963L11.0134 20.75C11.6271 21.0837 12.3729 21.0837 12.9866 20.75L19.9521 16.963C20.5988 16.6114 21 15.9435 21 15.2184V7.78208C21 7.05701 20.5988 6.38904 19.9521 6.03744L12.9866 2.25049ZM12 7.00024C12.5448 7.00024 12.9865 7.44191 12.9865 7.98674C12.9864 8.00043 12.9863 8.00727 12.9861 8.01411C12.9859 8.02095 12.9856 8.02779 12.985 8.04146L12.7489 12.2918C12.6964 13.2364 11.3036 13.2364 11.2512 12.2918L11.015 8.04146C10.9848 7.49747 11.4013 7.03198 11.9453 7.00176L11.9726 7.00062L12 7.00024ZM13 15.0002C13 15.5525 12.5523 16.0002 12 16.0002C11.4477 16.0002 11 15.5525 11 15.0002C11 14.448 11.4477 14.0002 12 14.0002C12.5523 14.0002 13 14.448 13 15.0002Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { AlertIcon }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../utils/polymorphism'\n\nimport type { Tone } from '../utils/common-types'\nimport type { BoxProps } from '../box'\n\nimport styles from './text.module.css'\n\ntype TextProps = {\n children: React.ReactNode\n /**\n * The size of the text.\n *\n * The supported values, from smaller size to larger size, are:\n * 'caption', 'copy', 'body', and 'subtitle'\n *\n * @default 'body'\n */\n size?: 'caption' | 'copy' | 'body' | 'subtitle'\n /**\n * The weight of the text font.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'semibold' | 'bold'\n /**\n * The tone (semantic color) of the text.\n *\n * @default 'normal'\n */\n tone?: Tone\n /**\n * Used to truncate the text to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n /**\n * How to align the text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Text = polymorphicComponent<'div', TextProps>(function Text(\n {\n as,\n size = 'body',\n weight = 'regular',\n tone = 'normal',\n align,\n children,\n lineClamp,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp ?? 1) > 1\n\n return (\n <Box\n {...props}\n as={as}\n className={[\n exceptionallySetClassName,\n styles.text,\n size !== 'body' ? getClassNames(styles, 'size', size) : null,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type { TextProps }\nexport { Text }\n","import React from 'react'\n\nimport { CloseIcon } from '../icons/close-icon'\nimport { Box } from '../box'\nimport { IconButton, Button } from '../button'\nimport { Stack } from '../stack'\nimport { Text } from '../text'\n\nimport styles from './toast.module.css'\n\ntype ToastActionObject = {\n label: string\n onClick: () => void\n}\n\ntype StaticToastProps = {\n /**\n * The message shown in the toast.\n */\n message: NonNullable<React.ReactNode>\n\n /**\n * An optional extra description that complements the main message shown in the toast.\n */\n description?: React.ReactNode\n\n /**\n * An icon to be shown in front of the message.\n */\n icon?: React.ReactNode\n\n /**\n * The action to call when the user clicks on the dismiss button. If omitted, the dismiss button\n * does not appear.\n */\n onDismiss?: () => void\n\n /**\n * The label for the button that dismisses the toast.\n */\n dismissLabel?: string\n\n /**\n * What to render in the action slot. Usually a button or link.\n *\n * You can also pass an object that containst the action label, and a function that performs the\n * action. This is used by the toast component to render a button for you.\n *\n * In general, you should prefer the action object most of the time. But it is possible to pass\n * a React element instead, if you need more control over what to render. For instance, you may\n * want to render a link instead of a button.\n *\n * Keep in mind, though, that the default button rendered uses `variant=\"tertiary\"` and\n * `size=\"small\"`. In most cases you should stick to the variants `tertiary` or `primary`, which\n * are the ones that look better in the toast's dark background. And in all cases you should use\n * size `small`.\n */\n action?: React.ReactElement | ToastActionObject\n}\n\n/**\n * A toast that shows a message, and an optional action associated with it.\n *\n * This component is generally not meant to be used directly. Most of the time you'll want to use\n * toasts generated via `useToasts` instead. However, this component is available in case you need\n * to take control of rendering a toast under different circumstances than that of notification-like\n * floating toasts.\n *\n * This component makes no assumptions outwardly about how it is positioned on the screen. That is,\n * it will not be shown floating or fixed to the viewport edges, as toasts normally show up. It only\n * provides the toast look and feel, but you are responsible for positioning it as you want.\n *\n * @see useToasts\n */\nconst StaticToast = React.forwardRef<HTMLDivElement, StaticToastProps>(function Toast(\n { message, description, icon, action, onDismiss, dismissLabel = 'Close', ...props },\n ref,\n) {\n return (\n <Box\n ref={ref}\n role=\"alert\"\n aria-live=\"polite\"\n borderRadius=\"full\"\n width=\"fitContent\"\n background=\"toast\"\n display=\"flex\"\n padding=\"large\"\n alignItems=\"center\"\n className={styles.toastContainer}\n {...props}\n >\n {icon ? <ToastContentSlot>{icon}</ToastContentSlot> : null}\n\n <Box flexGrow={1} maxWidth=\"small\">\n {description ? (\n <Stack space=\"small\">\n <Text weight=\"bold\">{message} </Text>\n <Text>{description}</Text>\n </Stack>\n ) : (\n <Text>{message}</Text>\n )}\n </Box>\n\n {action ? (\n <ToastContentSlot>\n {isActionObject(action) ? (\n <Button variant=\"tertiary\" size=\"small\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : (\n action\n )}\n </ToastContentSlot>\n ) : null}\n\n {onDismiss ? (\n <ToastContentSlot>\n <IconButton\n variant=\"quaternary\"\n size=\"small\"\n onClick={onDismiss}\n aria-label={dismissLabel}\n icon={<CloseIcon />}\n />\n </ToastContentSlot>\n ) : null}\n </Box>\n )\n})\n\nfunction isActionObject(action: StaticToastProps['action']): action is ToastActionObject {\n return (\n action != null &&\n typeof action === 'object' &&\n 'label' in action &&\n 'onClick' in action &&\n typeof action.label === 'string' &&\n typeof action.onClick === 'function'\n )\n}\n\nfunction ToastContentSlot({ children }: { children: React.ReactNode }) {\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n marginX=\"-xsmall\"\n marginY=\"-medium\"\n className={styles.slot}\n >\n {children}\n </Box>\n )\n}\n\nexport { StaticToast, isActionObject }\nexport type { StaticToastProps }\n","/**\n * Adapted with minor changes from https://github.com/seek-oss/braid-design-system/blob/7a5ebccb/packages/braid-design-system/lib/components/useToast/useFlipList.ts\n *\n * MIT License\n *\n * Copyright (c) 2018 SEEK\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { useMemo, useCallback, useLayoutEffect } from 'react'\n\nconst ANIMATION_TIMEOUT = 400\nconst ENTRANCE_TRANSITION = 'transform 0.3s ease, opacity 0.3s ease'\nconst EXIT_TRANSITION = 'opacity 0.2s ease'\n\ntype Transform = {\n property: 'opacity' | 'transform' | 'scale'\n from?: string\n to?: string\n}\n\n/**\n * Applies the \"from\" value of given CSS properties, and also sets a transition CSS property. Then\n * it waits an animation frame before setting the same CSS properties to the target \"to\" value. This\n * triggers the browser to perform the CSS transition on them.\n *\n * At the end of the animation, it cleans up, unsetting all the CSS properties (including the\n * transition), and calls the \"done\" callback, if given.\n */\nfunction animate({\n element,\n transforms,\n transition,\n done,\n}: {\n element: HTMLElement\n transforms: Transform[]\n transition: string\n done?: () => void\n}) {\n const fallbackTimeout = setTimeout(() => {\n done?.()\n }, ANIMATION_TIMEOUT)\n\n transforms.forEach(({ property, from = '' }) => {\n element.style.setProperty(property, from)\n })\n element.style.setProperty('transition', '')\n\n function transitionEndHandler(event: TransitionEvent) {\n if (event.target !== element) {\n return\n }\n element.style.setProperty('transition', '')\n done?.()\n element.removeEventListener('transitionend', transitionEndHandler)\n clearTimeout(fallbackTimeout)\n }\n\n element.addEventListener('transitionend', transitionEndHandler)\n\n // Call requestAnimationFrame twice to make sure we have a full animation frame at our disposal\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n element.style.setProperty('transition', transition)\n transforms.forEach(({ property, to = '' }) => {\n element.style.setProperty(property, to)\n })\n })\n })\n}\n\ntype ToastsAnimationToolkit = {\n /**\n * Used for gathering all the active stacked toast elements. Should be used by passing\n * `ref={mappedRef(toastId)}` to the stacked toasts.\n */\n mappedRef: (toastId: string) => (ref: HTMLElement | null) => void\n\n /**\n * The stacked toasts view should use this callback when it needs to remove a toast, instead of\n * removing it right away. The actual removal from the state (and consequently, from the DOM)\n * should happen in the `onAnimationDone` instead.\n */\n animateRemove: (toastId: string, onAnimationDone: () => void) => void\n}\n\n/**\n * Provides the functionality of animating the stacked toasts when they appear and before they\n * disappear.\n *\n * It works by keeping a mapping from toast IDs to the toast elements, and keeping a mapping from\n * toast IDs to their top position. Then, on every single re-render, it compares the new DOM\n * situation with the previously stored one in these mappings. With this information, it applies\n * animations that smoothly transitions between both states.\n */\nfunction useToastsAnimation(): ToastsAnimationToolkit {\n const refs = useMemo(() => new Map<string, HTMLElement | null>(), [])\n const positions = useMemo(() => new Map<string, number>(), [])\n\n useLayoutEffect(() => {\n const animations: Array<{\n element: HTMLElement\n transforms: Transform[]\n transition: string\n }> = []\n\n Array.from(refs.entries()).forEach(([id, element]) => {\n if (!element) {\n refs.delete(id)\n return\n }\n\n const prevTop = positions.get(id)\n const { top, height } = element.getBoundingClientRect()\n\n if (typeof prevTop === 'number' && prevTop !== top) {\n // Move animation\n animations.push({\n element,\n transition: ENTRANCE_TRANSITION,\n transforms: [{ property: 'transform', from: `translateY(${prevTop - top}px)` }],\n })\n } else if (typeof prevTop !== 'number') {\n // Enter animation\n animations.push({\n element,\n transition: ENTRANCE_TRANSITION,\n transforms: [\n { property: 'transform', from: `translateY(${height}px)` },\n { property: 'opacity', from: '0' },\n ],\n })\n }\n\n positions.set(id, element.getBoundingClientRect().top)\n })\n\n animations.forEach(({ element, transforms, transition }) => {\n animate({ element, transforms, transition })\n })\n })\n\n const animateRemove = useCallback(\n function animateRemove(id: string, onAnimationDone: () => void) {\n const element = refs.get(id)\n if (element) {\n // Removal animation\n animate({\n element,\n transforms: [{ property: 'opacity', to: '0' }],\n transition: EXIT_TRANSITION,\n done: onAnimationDone,\n })\n }\n },\n [refs],\n )\n\n const mappedRef = useCallback(\n (id: string) => (ref: HTMLElement | null) => {\n refs.set(id, ref)\n },\n [refs],\n )\n\n return { mappedRef, animateRemove }\n}\n\nexport { ANIMATION_TIMEOUT, useToastsAnimation }\n","import React from 'react'\nimport { Portal } from '@ariakit/react'\n\nimport { generateElementId } from '../utils/common-helpers'\nimport { Box } from '../box'\nimport { Stack } from '../stack'\nimport { isActionObject, StaticToast, StaticToastProps } from './static-toast'\n\nimport styles from './toast.module.css'\n\nimport type { Space } from '../utils/common-types'\nimport { useToastsAnimation } from './toast-animation'\n\n/**\n * The props needed to fire up a new notification toast.\n */\ntype ToastProps = StaticToastProps & {\n /**\n * The number of seconds the toast is expected to be shown before it is dismissed automatically,\n * or false to disable auto-dismiss.\n *\n * It defaults to whatever is the autoDismissDelay set in the ToastsProvider.\n */\n autoDismissDelay?: number | false\n\n /**\n * The label for the button that dismisses the toast.\n *\n * It defaults to the value set in the ToastsProvider, but individual toasts can have a\n * different value if needed.\n */\n dismissLabel?: string\n\n /**\n * Whether to show the dismiss button or not.\n *\n * Use this value with care. If combined with disabling `autoDismissDelay`, it may leave you\n * with toasts that the user won't be able to dismiss at will. It then is your responsibility to\n * dismiss the toast by calling the function returned by `showToast`.\n */\n showDismissButton?: boolean\n}\n\n//\n// InternalToast component and its props\n//\n\ntype InternalToastProps = Omit<ToastProps, 'autoDismissDelay' | 'dismissLabel'> &\n Required<Pick<ToastProps, 'autoDismissDelay' | 'dismissLabel'>> & {\n toastId: string\n onRemoveToast: (toastId: string) => void\n }\n\n/** @private */\nconst InternalToast = React.forwardRef<HTMLDivElement, InternalToastProps>(function InternalToast(\n {\n message,\n description,\n icon,\n action,\n autoDismissDelay,\n dismissLabel,\n showDismissButton = true,\n toastId,\n onDismiss,\n onRemoveToast,\n },\n ref,\n) {\n const [timeoutRunning, setTimeoutRunning] = React.useState(Boolean(autoDismissDelay))\n const timeoutRef = React.useRef<number | undefined>()\n\n const startTimeout = React.useCallback(function startTimeout() {\n setTimeoutRunning(true)\n }, [])\n\n const stopTimeout = React.useCallback(function stopTimeout() {\n setTimeoutRunning(false)\n clearTimeout(timeoutRef.current)\n timeoutRef.current = undefined\n }, [])\n\n const removeToast = React.useCallback(\n function removeToast() {\n onRemoveToast(toastId)\n onDismiss?.()\n },\n [onDismiss, onRemoveToast, toastId],\n )\n\n React.useEffect(\n function setupAutoDismiss() {\n if (!timeoutRunning || !autoDismissDelay) return\n timeoutRef.current = window.setTimeout(removeToast, autoDismissDelay * 1000)\n return stopTimeout\n },\n [autoDismissDelay, removeToast, stopTimeout, timeoutRunning],\n )\n\n /**\n * If the action is toast action object and not a custom element,\n * the `onClick` property is wrapped in another handler responsible\n * for removing the toast when the action is triggered.\n */\n const actionWithCustomActionHandler = React.useMemo(() => {\n if (!isActionObject(action)) {\n return action\n }\n\n return {\n ...action,\n onClick: function handleActionClick() {\n if (!action) {\n return\n }\n\n action.onClick()\n removeToast()\n },\n }\n }, [action, removeToast])\n\n return (\n <StaticToast\n ref={ref}\n message={message}\n description={description}\n icon={icon}\n action={actionWithCustomActionHandler}\n onDismiss={showDismissButton ? removeToast : undefined}\n dismissLabel={dismissLabel}\n // @ts-expect-error\n onMouseEnter={stopTimeout}\n onMouseLeave={startTimeout}\n />\n )\n})\n\n//\n// Internal state and context\n//\n\ntype InternalToastEntry = Omit<InternalToastProps, 'onRemoveToast'>\ntype ToastsList = readonly InternalToastEntry[]\n\ntype ShowToastAction = (props: ToastProps) => () => void\nconst ToastsContext = React.createContext<ShowToastAction>(() => () => undefined)\n\n/**\n * The props needed by the ToastsProvider component.\n *\n * @see ToastsProvider\n */\ntype ToastsProviderProps = {\n /**\n * The default label to apply to toast dismiss buttons.\n *\n * This is useful in environments that need locatization, so you do not need to pass the same\n * translated label every time you trigger a toast.\n *\n * However, you can still apply a different label to a specific toast, by passing a different\n * value when calling showToast.\n *\n * @default 'Close'\n */\n defaultDismissLabel?: string\n\n /**\n * The default number of seconds after which the toast will be dismissed automatically.\n *\n * You can pass a different value to a specific toast when calling `showToast`. You can even\n * pass `false` if you want a certain toast to never be dismissed automatically.\n *\n * @default 10 (seconds)\n */\n defaultAutoDismissDelay?: number\n\n /**\n * The padding used to separate the toasts from the viewport borders.\n *\n * @default 'large'\n */\n padding?: Space\n\n /**\n * The app wrapped by the provider.\n */\n children: NonNullable<React.ReactNode>\n\n /**\n * Custom classname for the toasts container, if you need to fine-tune the position or other styles\n */\n containerClassName?: string\n}\n\n/**\n * Provides the state management and rendering of the toasts currently active.\n *\n * You need to render this near the top of your app components tree, in order to `useToasts`.\n *\n * @see useToasts\n */\nfunction ToastsProvider({\n children,\n padding = 'large',\n defaultAutoDismissDelay = 10 /* seconds */,\n defaultDismissLabel = 'Close',\n containerClassName,\n}: ToastsProviderProps) {\n const [toasts, setToasts] = React.useState<ToastsList>([])\n const { mappedRef, animateRemove } = useToastsAnimation()\n\n const removeToast = React.useCallback(\n function onRemoveToast(toastId: string) {\n animateRemove(toastId, () => {\n setToasts((list) => {\n const index = list.findIndex((n) => n.toastId === toastId)\n if (index < 0) return list\n const copy = [...list]\n copy.splice(index, 1)\n return copy\n })\n })\n },\n [animateRemove],\n )\n\n const showToast = React.useCallback(\n function showToast(props: ToastProps) {\n const toastId = generateElementId('toast')\n const newToast: InternalToastEntry = {\n autoDismissDelay: defaultAutoDismissDelay,\n dismissLabel: defaultDismissLabel,\n ...props,\n toastId,\n }\n setToasts((list) => [...list, newToast])\n return () => removeToast(toastId)\n },\n [defaultAutoDismissDelay, defaultDismissLabel, removeToast],\n )\n\n return (\n <ToastsContext.Provider value={showToast}>\n {children}\n <Portal>\n {toasts.length === 0 ? null : (\n <Box\n className={[styles.stackedToastsView, containerClassName]}\n position=\"fixed\"\n width=\"full\"\n paddingX={padding}\n paddingBottom={padding}\n data-testid=\"toasts-container\"\n >\n <Stack space=\"medium\">\n {toasts.map(({ toastId, ...props }) => (\n <InternalToast\n key={toastId}\n ref={mappedRef(toastId)}\n toastId={toastId}\n onRemoveToast={removeToast}\n {...props}\n />\n ))}\n </Stack>\n </Box>\n )}\n </Portal>\n </ToastsContext.Provider>\n )\n}\n\n/**\n * Provides a function `showToast` that shows a new toast every time you call it.\n *\n * ```jsx\n * const showToast = useToasts()\n *\n * <button onClick={() => showToast({ message: 'Hello' })}>\n * Say hello\n * </button>\n * ```\n *\n * All toasts fired via this function are rendered in a global fixed location, and stacked one on\n * top of the other.\n *\n * When called, `showToast` returns a function that dismisses the toast when called.\n *\n * @see ToastsProvider\n */\nfunction useToasts() {\n return React.useContext(ToastsContext)\n}\n\n/**\n * Adds a toast to be rendered, stacked alongside any other currently active toasts.\n *\n * For most situations, you should prefer to use the `showToast` function obtained from `useToasts`.\n * This component is provided for convenience to render toasts in the markup, but it has some\n * peculiarities, which are discussed below.\n *\n * Internally, this calls `showToast`. It is provided for two reasons:\n *\n * 1. Convenience, when you want to fire a toast in markup/jsx code. Keep in mind, though, that\n * toasts rendered in this way will be removed from view when the context where it is rendered\n * is unmounted. Unlike toasts fired with `showToast`, which will normally be dismissed, either\n * by the user or after a delay. They'll still be animated on their way out, though.\n * 2. When combined with disabling dismissing it (e.g. `showDismissButton={false}` and\n * `autoDismissDelay={false}` it provides a way to show \"permanent\" toasts that only go away when\n * the component ceases to be rendered).\n *\n * This is useful for cases when the consumer wants to control when a toast is visible, and to keep\n * it visible based on an app-specific condition.\n *\n * Something important to note about this component is that it triggers the toast based on the props\n * passed when first rendered, and it does not update the toast if these props change on subsequent\n * renders. In this sense, this is an imperative component, more than a descriptive one. This is\n * done to simplify the internals, and to keep it in line with how `showToast` works: you fire up a\n * toast imperatively, and you loose control over it. It remains rendered according to the props you\n * first passed.\n *\n * @see useToasts\n */\nfunction Toast(props: ToastProps) {\n const showToast = useToasts()\n const propsRef = React.useRef<ToastProps>(props)\n React.useEffect(() => {\n const dismissToast = showToast(propsRef.current)\n return dismissToast\n }, [showToast])\n return null\n}\n\nexport { Toast, ToastsProvider, useToasts }\nexport type { ToastProps, ToastsProviderProps }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport styles from './heading.module.css'\nimport type { ObfuscatedClassName, Tone } from '../utils/common-types'\nimport type { BoxProps } from '../box'\n\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'\ntype HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\ntype HeadingProps = Omit<React.HTMLAttributes<HTMLHeadingElement>, 'className' | 'children'> & {\n children: React.ReactNode\n /**\n * The semantic level of the heading.\n */\n level: HeadingLevel\n\n /**\n * The weight of the heading. Used to de-emphasize the heading visually when using 'medium' or 'light'.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'medium' | 'light'\n\n /**\n * Shifts the default heading visual text size up or down, depending on the original size\n * imposed by the `level`. The heading continues to be semantically at the given level.\n *\n * By default, no value is applied, and the default size from the level is applied. The values\n * have the following effect:\n *\n * - 'smaller' shifts the default level size down in the font-size scale (it tends to make the\n * level look visually as if it were of the immediately lower level).\n * - 'larger' has the opposite effect than 'smaller' shifting the visual font size up in the\n * scale.\n * - 'largest' can be thought of as applying 'larger' twice.\n *\n * @see level\n * @default undefined\n */\n size?: 'smaller' | 'larger' | 'largest'\n\n /**\n * The tone (semantic color) of the heading.\n *\n * @default 'normal'\n */\n tone?: Tone\n\n /**\n * Used to truncate the heading to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n\n /**\n * How to align the heading text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Heading = React.forwardRef<HTMLHeadingElement, HeadingProps & ObfuscatedClassName>(\n function Heading(\n {\n level,\n weight = 'regular',\n size,\n tone = 'normal',\n children,\n lineClamp,\n align,\n exceptionallySetClassName,\n ...props\n },\n ref,\n ) {\n // In TypeScript v4.1, this would be properly recognized without needing the type assertion\n // https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types\n const headingElementName = `h${level}` as HeadingElement\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? parseInt(lineClamp, 10) > 1 : (lineClamp || 0) > 1\n\n return (\n <Box\n {...props}\n className={[\n exceptionallySetClassName,\n styles.heading,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n getClassNames(styles, 'size', size),\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n as={headingElementName}\n ref={ref}\n >\n {children}\n </Box>\n )\n },\n)\n\nexport type { HeadingProps, HeadingLevel }\nexport { Heading }\n","import * as React from 'react'\n\nconst svgPath = {\n checked:\n 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2.457 4.293l-5.293 5.293-1.793-1.793a1 1 0 1 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l6-6a1 1 0 1 0-1.414-1.414z',\n unchecked:\n 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm0 1H6a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z',\n mixed:\n 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2 7H8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2z',\n filled:\n 'M6 4H18C19.1046 4 20 4.89543 20 6V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4Z',\n} as const\n\ntype Props = React.SVGProps<SVGSVGElement> & {\n checked?: boolean\n indeterminate?: boolean\n disabled?: boolean\n}\n\nfunction getPathKey({ checked, indeterminate, disabled }: Props): keyof typeof svgPath {\n if (indeterminate) {\n return 'mixed' // indeterminate, when true, overrides the checked state\n }\n\n if (checked) {\n return 'checked'\n }\n\n // We only used 'filled' when unchecked AND disabled, because the default unchecked icon\n // is not enough to convey the disabled state with opacity alone. For all other cases\n // above, when disabled, we use the same icon the corresponds to that state, and the\n // opacity conveys the fact that the checkbox is disabled.\n // See https://twist.com/a/1585/ch/414345/t/2257308/c/65201390\n if (disabled) {\n return 'filled'\n }\n\n return 'unchecked'\n}\n\nfunction CheckboxIcon({ checked, indeterminate, disabled, ...props }: Props) {\n const pathKey = getPathKey({ checked, indeterminate, disabled })\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path fill=\"currentColor\" fillRule=\"nonzero\" d={svgPath[pathKey]} />\n </svg>\n )\n}\n\nexport { CheckboxIcon }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { Text } from '../text'\nimport { CheckboxIcon } from './checkbox-icon'\n\nimport styles from './checkbox-field.module.css'\nimport { useForkRef } from './use-fork-ref'\n\ninterface CheckboxFieldProps\n extends Omit<\n JSX.IntrinsicElements['input'],\n | 'type'\n | 'className'\n | 'disabled'\n | 'aria-controls'\n | 'aria-describedby'\n | 'aria-label'\n | 'aria-labelledby'\n > {\n 'aria-checked'?: never\n /**\n *\n * Identifies the set of checkboxes controlled by the mixed checkbox for assistive technologies.\n */\n 'aria-controls'?: string\n\n /**\n * Identifies the element (or elements) that describes the checkbox for assistive technologies.\n */\n 'aria-describedby'?: string\n\n /**\n * Defines a string value that labels the current checkbox for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * Identifies the element (or elements) that labels the current checkbox for assistive technologies.\n */\n 'aria-labelledby'?: string\n\n /**\n * Defines whether or not the checkbox is disabled.\n */\n disabled?: boolean\n\n /**\n * The label for the checkbox element.\n */\n label?: React.ReactNode\n\n /**\n * The icon that should be added to the checkbox label.\n */\n icon?: React.ReactElement | string | number\n\n /**\n * Defines whether or not the checkbox can be of a `mixed` state.\n */\n indeterminate?: boolean\n}\n\nconst CheckboxField = React.forwardRef<HTMLInputElement, CheckboxFieldProps>(function CheckboxField(\n { label, icon, disabled, indeterminate, defaultChecked, onChange, ...props },\n ref,\n) {\n const isControlledComponent = typeof props.checked === 'boolean'\n if (typeof indeterminate === 'boolean' && !isControlledComponent) {\n // eslint-disable-next-line no-console\n console.warn('Cannot use indeterminate on an uncontrolled checkbox')\n indeterminate = undefined\n }\n\n if (!label && !props['aria-label'] && !props['aria-labelledby']) {\n // eslint-disable-next-line no-console\n console.warn('A Checkbox needs a label')\n }\n\n const [keyFocused, setKeyFocused] = React.useState(false)\n const [checkedState, setChecked] = React.useState(props.checked ?? defaultChecked ?? false)\n const isChecked = props.checked ?? checkedState\n\n const internalRef = React.useRef<HTMLInputElement>(null)\n const combinedRef = useForkRef(internalRef, ref)\n React.useEffect(\n function setIndeterminate() {\n if (internalRef.current && typeof indeterminate === 'boolean') {\n internalRef.current.indeterminate = indeterminate\n }\n },\n [indeterminate],\n )\n\n return (\n <Box\n as=\"label\"\n display=\"flex\"\n alignItems=\"center\"\n className={[\n styles.container,\n disabled ? styles.disabled : null,\n isChecked ? styles.checked : null,\n keyFocused ? styles.keyFocused : null,\n ]}\n >\n <input\n {...props}\n ref={combinedRef}\n type=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : isChecked}\n checked={isChecked}\n disabled={disabled}\n onChange={(event) => {\n onChange?.(event)\n if (!event.defaultPrevented) {\n setChecked(event.currentTarget.checked)\n }\n }}\n onBlur={(event) => {\n setKeyFocused(false)\n props?.onBlur?.(event)\n }}\n onKeyUp={(event) => {\n setKeyFocused(true)\n props?.onKeyUp?.(event)\n }}\n />\n <CheckboxIcon\n checked={isChecked}\n disabled={disabled}\n indeterminate={indeterminate}\n aria-hidden\n />\n {icon ? (\n <Box display=\"flex\" className={styles.icon} aria-hidden>\n {icon}\n </Box>\n ) : null}\n {label ? (\n <Box display=\"flex\" className={styles.label}>\n <Text>{label}</Text>\n </Box>\n ) : null}\n </Box>\n )\n})\n\nexport { CheckboxField }\nexport type { CheckboxFieldProps }\n","import { useMemo } from 'react'\n\n/**\n * Sets both a function and object React ref.\n */\nfunction setRef<T>(\n ref: React.RefCallback<T> | React.MutableRefObject<T> | null | undefined,\n value: T,\n) {\n if (typeof ref === 'function') {\n ref(value)\n } else if (ref) {\n ref.current = value\n }\n}\n\n/**\n * Merges React Refs into a single memoized function ref so you can pass it to an element.\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const internalRef = React.useRef();\n * return <div {...props} ref={useForkRef(internalRef, ref)} />;\n * });\n */\nfunction useForkRef(...refs: Array<React.Ref<unknown> | undefined>) {\n return useMemo(\n () => {\n if (!refs.some(Boolean)) return\n return (value: unknown) => {\n refs.forEach((ref) => setRef(ref, value))\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n refs,\n )\n}\n\nexport { useForkRef }\n","import * as React from 'react'\n\nfunction PasswordVisibleIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"none\" fillRule=\"evenodd\" stroke=\"gray\">\n <path d=\"M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3.5\" />\n </g>\n </svg>\n )\n}\n\nexport { PasswordVisibleIcon }\n","import * as React from 'react'\n\nfunction PasswordHiddenIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"gray\" fillRule=\"evenodd\" transform=\"translate(2 4)\">\n <path\n fillRule=\"nonzero\"\n d=\"M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z\"\n />\n <path\n fillRule=\"nonzero\"\n d=\"M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z\"\n />\n <rect\n width=\"21\"\n height=\"1\"\n x=\"-.722\"\n y=\"7.778\"\n rx=\".5\"\n transform=\"rotate(-45 9.778 8.278)\"\n />\n </g>\n </svg>\n )\n}\n\nexport { PasswordHiddenIcon }\n","import * as React from 'react'\nimport { Box, BoxProps } from '../box'\nimport { useId } from '../utils/common-helpers'\nimport { Text } from '../text'\nimport styles from './base-field.module.css'\nimport { Stack } from '../stack'\n\nimport type { WithEnhancedClassName } from '../utils/common-types'\nimport { Spinner } from '../spinner'\nimport { Column, Columns } from '../columns'\n\n// Define the remaining characters before the character count turns red\n// See: https://twist.com/a/1585/ch/765851/t/6664583/c/93631846 for latest spec\nconst MAX_LENGTH_THRESHOLD = 0\n\ntype FieldTone = 'neutral' | 'success' | 'error' | 'loading'\n\ntype FieldMessageProps = {\n id: string\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction fieldToneToTextTone(tone: FieldTone) {\n return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary'\n}\n\nfunction FieldMessage({ id, children, tone }: FieldMessageProps) {\n return (\n <Text as=\"p\" tone={fieldToneToTextTone(tone)} size=\"copy\" id={id}>\n {tone === 'loading' ? (\n <Box\n as=\"span\"\n marginRight=\"xsmall\"\n display=\"inlineFlex\"\n className={styles.loadingIcon}\n >\n <Spinner size={16} />\n </Box>\n ) : null}\n {children}\n </Text>\n )\n}\n\ntype FieldCharacterCountProps = {\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction FieldCharacterCount({ children, tone }: FieldCharacterCountProps) {\n return (\n <Text tone={fieldToneToTextTone(tone)} size=\"copy\">\n {children}\n </Text>\n )\n}\n\ntype ValidateInputLengthProps = {\n value?: React.InputHTMLAttributes<unknown>['value']\n maxLength?: number\n}\n\ntype ValidateInputLengthResult = {\n count: string | null\n tone: FieldTone\n}\n\nfunction validateInputLength({\n value,\n maxLength,\n}: ValidateInputLengthProps): ValidateInputLengthResult {\n if (!maxLength) {\n return {\n count: null,\n tone: 'neutral',\n }\n }\n\n const currentLength = String(value || '').length\n const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD\n\n return {\n count: `${currentLength}/${maxLength}`,\n tone: isNearMaxLength ? 'error' : 'neutral',\n }\n}\n\n//\n// BaseField\n//\n\ntype ChildrenRenderProps = {\n id: string\n value?: React.InputHTMLAttributes<unknown>['value']\n 'aria-describedby'?: string\n 'aria-invalid'?: true\n onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>\n characterCountElement?: React.ReactNode | null\n}\n\ntype HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<\n React.InputHTMLAttributes<T>,\n T\n>\n\ntype BaseFieldVariant = 'default' | 'bordered'\ntype BaseFieldVariantProps = {\n /**\n * Provides alternative visual layouts or modes that the field can be rendered in.\n *\n * Namely, there are two variants supported:\n *\n * - the default one\n * - a \"bordered\" variant, where the border of the field surrounds also the labels, instead\n * of just surrounding the actual field element\n *\n * In both cases, the message and description texts for the field lie outside the bordered\n * area.\n */\n variant?: BaseFieldVariant\n}\n\nexport type BaseFieldProps = WithEnhancedClassName &\n Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {\n /**\n * The main label for this field element.\n *\n * This prop is not optional. Consumers of field components must be explicit about not\n * wanting a label by passing `label=\"\"` or `label={null}`. In those situations, consumers\n * should make sure that fields are properly labelled semantically by other means (e.g using\n * `aria-labelledby`, or rendering a `<label />` element referencing the field by id).\n *\n * Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.\n *\n * @see BaseFieldProps['auxiliaryLabel']\n */\n label: React.ReactNode\n\n /**\n * The initial value for this field element.\n *\n * This prop is used to calculate the character count for the initial value, and is then\n * passed to the underlying child element.\n */\n value?: React.InputHTMLAttributes<unknown>['value']\n\n /**\n * An optional extra element to be placed to the right of the main label.\n *\n * This extra element is not included in the accessible name of the field element. Its only\n * purpose is either visual, or functional (if you include interactive elements in it).\n *\n * @see BaseFieldProps['label']\n *\n * @deprecated The usage of this element is discouraged given that it was removed from the\n * latest form field spec revision.\n */\n auxiliaryLabel?: React.ReactNode\n\n /**\n * A message associated with the field. It is rendered below the field, and with an\n * appearance that conveys the tone of the field (e.g. coloured red for errors, green for\n * success, etc).\n *\n * The message element is associated to the field via the `aria-describedby` attribute.\n *\n * In the future, when `aria-errormessage` gets better user agent support, we should use it\n * to associate the filed with a message when tone is `\"error\"`.\n *\n * @see BaseFieldProps['tone']\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid\n */\n message?: React.ReactNode\n\n /**\n * The tone with which the message, if any, is presented.\n *\n * If the tone is `\"error\"`, the field border turns red, and the message, if any, is also\n * red.\n *\n * When the tone is `\"loading\"`, it is recommended that you also disable the field. However,\n * this is not enforced by the component. It is only a recommendation.\n *\n * @see BaseFieldProps['message']\n * @see BaseFieldProps['hint']\n */\n tone?: FieldTone\n\n /**\n * The maximum width that the input field can expand to.\n */\n maxWidth?: BoxProps['maxWidth']\n\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n\n /**\n * Used internally by components composed using `BaseField`. It is not exposed as part of\n * the public props of such components.\n */\n children: (props: ChildrenRenderProps) => React.ReactNode\n\n /**\n * The position of the character count element.\n * It can be shown below the field or inline with the field.\n *\n * @default 'below'\n */\n characterCountPosition?: 'below' | 'inline' | 'hidden'\n }\n\ntype FieldComponentProps<T extends HTMLElement> = Omit<\n BaseFieldProps,\n 'children' | 'className' | 'fieldRef' | 'variant'\n> &\n Omit<HtmlInputProps<T>, 'className' | 'style'>\n\n/**\n * BaseField is a base component that provides a consistent structure for form fields.\n */\nfunction BaseField({\n variant = 'default',\n label,\n value,\n auxiliaryLabel,\n message,\n tone = 'neutral',\n className,\n children,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': originalAriaDescribedBy,\n id: originalId,\n characterCountPosition = 'below',\n}: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName) {\n const id = useId(originalId)\n const messageId = useId()\n\n const inputLength = validateInputLength({ value, maxLength })\n\n const [characterCount, setCharacterCount] = React.useState<string | null>(inputLength.count)\n const [characterCountTone, setCharacterCountTone] = React.useState<FieldTone>(inputLength.tone)\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null)\n\n /**\n * Renders the character count element.\n * If the characterCountPosition value is 'hidden', it returns null.\n */\n function renderCharacterCount() {\n return characterCountPosition !== 'hidden' ? (\n <FieldCharacterCount tone={characterCountTone}>{characterCount}</FieldCharacterCount>\n ) : null\n }\n\n const childrenProps: ChildrenRenderProps = {\n id,\n value,\n ...(ariaDescribedBy ? { 'aria-describedby': ariaDescribedBy } : {}),\n 'aria-invalid': tone === 'error' ? true : undefined,\n onChange(event) {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value: event.currentTarget.value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n // If the character count is inline, we pass it as a prop to the children element so it can be rendered inline\n characterCountElement: characterCountPosition === 'inline' ? renderCharacterCount() : null,\n }\n\n React.useEffect(\n function updateCharacterCountOnPropChange() {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n [maxLength, value],\n )\n\n return (\n <Stack space=\"xsmall\" hidden={hidden}>\n <Box\n className={[\n className,\n styles.container,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n >\n {label || auxiliaryLabel ? (\n <Box\n as=\"span\"\n display=\"flex\"\n justifyContent=\"spaceBetween\"\n alignItems=\"flexEnd\"\n >\n <Text\n size={variant === 'bordered' ? 'caption' : 'body'}\n as=\"label\"\n htmlFor={id}\n >\n {label ? <span className={styles.primaryLabel}>{label}</span> : null}\n </Text>\n {auxiliaryLabel ? (\n <Box className={styles.auxiliaryLabel} paddingLeft=\"small\">\n {auxiliaryLabel}\n </Box>\n ) : null}\n </Box>\n ) : null}\n {children(childrenProps)}\n </Box>\n\n {message || characterCount ? (\n <Columns align=\"right\" space=\"small\" maxWidth={maxWidth}>\n {message ? (\n <Column width=\"auto\">\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n </Column>\n ) : null}\n\n {/* If the character count is below the field, we render it, if it's inline,\n we pass it as a prop to the children element so it can be rendered inline */}\n {characterCountPosition === 'below' ? (\n <Column width=\"content\">{renderCharacterCount()}</Column>\n ) : null}\n </Columns>\n ) : null}\n </Stack>\n )\n}\n\nexport { BaseField, FieldMessage }\nexport type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps }\n","import * as React from 'react'\nimport { BaseField, BaseFieldVariantProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-field.module.css'\nimport type { BaseFieldProps, FieldComponentProps } from '../base-field'\nimport { useMergeRefs } from 'use-callback-ref'\n\ntype TextFieldType = 'email' | 'search' | 'tel' | 'text' | 'url'\n\ninterface TextFieldProps\n extends Omit<FieldComponentProps<HTMLInputElement>, 'type'>,\n BaseFieldVariantProps,\n Pick<BaseFieldProps, 'characterCountPosition'> {\n type?: TextFieldType\n startSlot?: React.ReactElement | string | number\n endSlot?: React.ReactElement | string | number\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n}\n\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n {\n variant = 'default',\n id,\n label,\n value,\n auxiliaryLabel,\n message,\n tone,\n type = 'text',\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n startSlot,\n endSlot,\n onChange: originalOnChange,\n characterCountPosition = 'below',\n ...props\n },\n ref,\n) {\n const internalRef = React.useRef<HTMLInputElement>(null)\n const combinedRef = useMergeRefs([ref, internalRef])\n\n function handleClick(event: React.MouseEvent) {\n if (event.currentTarget === combinedRef.current) return\n internalRef.current?.focus()\n }\n\n return (\n <BaseField\n variant={variant}\n id={id}\n label={label}\n value={value}\n auxiliaryLabel={auxiliaryLabel}\n message={message}\n tone={tone}\n maxWidth={maxWidth}\n maxLength={maxLength}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n characterCountPosition={characterCountPosition}\n >\n {({ onChange, characterCountElement, ...extraProps }) => (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n className={[\n styles.inputWrapper,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n props.readOnly ? styles.readOnly : null,\n ]}\n onClick={handleClick}\n >\n {startSlot ? (\n <Box\n className={styles.slot}\n display=\"flex\"\n marginRight={variant === 'bordered' ? 'xsmall' : '-xsmall'}\n marginLeft={variant === 'bordered' ? '-xsmall' : 'xsmall'}\n >\n {startSlot}\n </Box>\n ) : null}\n <input\n {...props}\n {...extraProps}\n type={type}\n ref={combinedRef}\n maxLength={maxLength}\n onChange={(event) => {\n originalOnChange?.(event)\n onChange?.(event)\n }}\n />\n {endSlot || characterCountElement ? (\n <Box\n className={styles.slot}\n display=\"flex\"\n marginRight={variant === 'bordered' ? '-xsmall' : 'xsmall'}\n marginLeft={variant === 'bordered' ? 'xsmall' : '-xsmall'}\n >\n {characterCountElement}\n {endSlot}\n </Box>\n ) : null}\n </Box>\n )}\n </BaseField>\n )\n})\n\nexport { TextField }\nexport type { TextFieldProps, TextFieldType }\n","import * as React from 'react'\n\nimport { PasswordVisibleIcon } from '../icons/password-visible-icon'\nimport { PasswordHiddenIcon } from '../icons/password-hidden-icon'\n\nimport { TextField, TextFieldProps } from '../text-field'\nimport { IconButton } from '../button'\n\nimport type { BaseFieldVariantProps } from '../base-field'\n\ninterface PasswordFieldProps\n extends Omit<TextFieldProps, 'type' | 'startSlot' | 'endSlot'>,\n BaseFieldVariantProps {\n togglePasswordLabel?: string\n endSlot?: React.ReactElement | string | number\n}\n\nconst PasswordField = React.forwardRef<HTMLInputElement, PasswordFieldProps>(function PasswordField(\n { togglePasswordLabel = 'Toggle password visibility', endSlot, ...props },\n ref,\n) {\n const [isPasswordVisible, setPasswordVisible] = React.useState(false)\n const Icon = isPasswordVisible ? PasswordVisibleIcon : PasswordHiddenIcon\n return (\n <TextField\n {...props}\n ref={ref}\n // @ts-expect-error TextField does not support type=\"password\", so we override the type check here\n type={isPasswordVisible ? 'text' : 'password'}\n endSlot={\n <>\n {endSlot}\n <IconButton\n variant=\"quaternary\"\n icon={<Icon aria-hidden />}\n aria-label={togglePasswordLabel}\n onClick={() => setPasswordVisible((v) => !v)}\n />\n </>\n }\n />\n )\n})\n\nexport { PasswordField }\nexport type { PasswordFieldProps }\n","import * as React from 'react'\nimport { BaseField, BaseFieldVariantProps, FieldComponentProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './select-field.module.css'\n\ninterface SelectFieldProps\n extends Omit<FieldComponentProps<HTMLSelectElement>, 'maxLength' | 'characterCountPosition'>,\n BaseFieldVariantProps {}\n\nconst SelectField = React.forwardRef<HTMLSelectElement, SelectFieldProps>(function SelectField(\n {\n variant = 'default',\n id,\n label,\n value,\n auxiliaryLabel,\n message,\n tone,\n maxWidth,\n children,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n onChange: originalOnChange,\n ...props\n },\n ref,\n) {\n return (\n <BaseField\n variant={variant}\n id={id}\n label={label}\n value={value}\n auxiliaryLabel={auxiliaryLabel}\n message={message}\n tone={tone}\n maxWidth={maxWidth}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n >\n {(extraProps) => (\n <Box\n data-testid=\"select-wrapper\"\n className={[\n styles.selectWrapper,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n >\n <select\n {...props}\n {...extraProps}\n ref={ref}\n onChange={(event) => {\n originalOnChange?.(event)\n }}\n >\n {children}\n </select>\n <SelectChevron aria-hidden />\n </Box>\n )}\n </BaseField>\n )\n})\n\nfunction SelectChevron(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"16\" height=\"16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M11.646 5.646a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 1 1 .708-.708L8 9.293l3.646-3.647z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { SelectField }\nexport type { SelectFieldProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { Stack } from '../stack'\nimport { Text } from '../text'\nimport { HiddenVisually } from '../hidden-visually'\nimport { FieldComponentProps, FieldMessage } from '../base-field'\nimport { useId } from '../utils/common-helpers'\nimport styles from './switch-field.module.css'\n\ninterface SwitchFieldProps\n extends Omit<\n FieldComponentProps<HTMLInputElement>,\n | 'type'\n | 'auxiliaryLabel'\n | 'maxWidth'\n | 'aria-describedby'\n | 'aria-label'\n | 'aria-labelledby'\n > {\n /**\n * Identifies the element (or elements) that describes the switch for assistive technologies.\n */\n 'aria-describedby'?: string\n\n /**\n * Defines a string value that labels the current switch for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * Identifies the element (or elements) that labels the current switch for assistive technologies.\n */\n 'aria-labelledby'?: string\n}\n\nconst SwitchField = React.forwardRef<HTMLInputElement, SwitchFieldProps>(function SwitchField(\n {\n label,\n message,\n tone = 'neutral',\n disabled = false,\n hidden,\n defaultChecked,\n id: originalId,\n 'aria-describedby': originalAriaDescribedBy,\n 'aria-label': originalAriaLabel,\n 'aria-labelledby': originalAriaLabelledby,\n onChange,\n ...props\n },\n ref,\n) {\n const id = useId(originalId)\n const messageId = useId()\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : undefined)\n const ariaLabel = originalAriaLabel ?? undefined\n const ariaLabelledBy = originalAriaLabelledby ?? undefined\n\n const [keyFocused, setKeyFocused] = React.useState(false)\n const [checkedState, setChecked] = React.useState(props.checked ?? defaultChecked ?? false)\n const isChecked = props.checked ?? checkedState\n\n return (\n <Stack space=\"small\" hidden={hidden}>\n <Box\n className={[\n styles.container,\n disabled ? styles.disabled : null,\n isChecked ? styles.checked : null,\n keyFocused ? styles.keyFocused : null,\n ]}\n as=\"label\"\n display=\"flex\"\n alignItems=\"center\"\n >\n <Box\n position=\"relative\"\n display=\"inlineBlock\"\n overflow=\"visible\"\n marginRight=\"small\"\n flexShrink={0}\n className={styles.toggle}\n >\n <HiddenVisually>\n <input\n {...props}\n id={id}\n type=\"checkbox\"\n disabled={disabled}\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n checked={isChecked}\n onChange={(event) => {\n onChange?.(event)\n if (!event.defaultPrevented) {\n setChecked(event.currentTarget.checked)\n }\n }}\n onBlur={(event) => {\n setKeyFocused(false)\n props?.onBlur?.(event)\n }}\n onKeyUp={(event) => {\n setKeyFocused(true)\n props?.onKeyUp?.(event)\n }}\n />\n </HiddenVisually>\n <span className={styles.handle} />\n </Box>\n <Text exceptionallySetClassName={styles.label}>{label}</Text>\n </Box>\n {message ? (\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n ) : null}\n </Stack>\n )\n})\n\nexport { SwitchField }\nexport type { SwitchFieldProps }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport { useMergeRefs } from 'use-callback-ref'\nimport { BaseField, BaseFieldVariantProps, FieldComponentProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-area.module.css'\n\ninterface TextAreaProps extends FieldComponentProps<HTMLTextAreaElement>, BaseFieldVariantProps {\n /**\n * The number of visible text lines for the text area.\n *\n * If it is specified, it must be a positive integer. If it is not specified, the default\n * value is 2 (set by the browser).\n *\n * When `autoExpand` is true, this value serves the purpose of specifying the minimum number\n * of rows that the textarea will shrink to when the content is not large enough to make it\n * expand.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n */\n rows?: number\n\n /**\n * If `true`, the textarea will be automatically resized to fit the content, and the ability to\n * manually resize the textarea will be disabled.\n */\n autoExpand?: boolean\n\n /**\n * If `true`, the ability to manually resize the textarea will be disabled.\n *\n * When `autoExpand` is true, this property serves no purpose, because the ability to manually\n * resize the textarea is always disabled when `autoExpand` is true.\n */\n disableResize?: boolean\n}\n\nconst TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n {\n variant = 'default',\n id,\n label,\n value,\n auxiliaryLabel,\n message,\n tone,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n rows,\n autoExpand = false,\n disableResize = false,\n onChange: originalOnChange,\n ...props\n },\n ref,\n) {\n const containerRef = React.useRef<HTMLDivElement>(null)\n const internalRef = React.useRef<HTMLTextAreaElement>(null)\n const combinedRef = useMergeRefs([ref, internalRef])\n\n const textAreaClassName = classNames([\n autoExpand ? styles.disableResize : null,\n disableResize ? styles.disableResize : null,\n ])\n\n React.useEffect(\n function setupAutoExpand() {\n const containerElement = containerRef.current\n\n function handleAutoExpand(value: string) {\n if (containerElement) {\n containerElement.dataset.replicatedValue = value\n }\n }\n\n function handleInput(event: Event) {\n handleAutoExpand((event.currentTarget as HTMLTextAreaElement).value)\n }\n\n const textAreaElement = internalRef.current\n if (!textAreaElement || !autoExpand) {\n return undefined\n }\n\n // Apply change initially, in case the text area has a non-empty initial value\n handleAutoExpand(textAreaElement.value)\n\n textAreaElement.addEventListener('input', handleInput)\n return () => textAreaElement.removeEventListener('input', handleInput)\n },\n [autoExpand],\n )\n\n return (\n <BaseField\n variant={variant}\n id={id}\n label={label}\n value={value}\n auxiliaryLabel={auxiliaryLabel}\n message={message}\n tone={tone}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n className={[\n styles.textAreaContainer,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n maxLength={maxLength}\n >\n {({ onChange, ...extraProps }) => (\n <Box\n width=\"full\"\n display=\"flex\"\n className={styles.innerContainer}\n ref={containerRef}\n >\n <textarea\n {...props}\n {...extraProps}\n ref={combinedRef}\n rows={rows}\n className={textAreaClassName}\n maxLength={maxLength}\n onChange={(event) => {\n originalOnChange?.(event)\n onChange?.(event)\n }}\n />\n </Box>\n )}\n </BaseField>\n )\n})\n\nexport { TextArea }\nexport type { TextAreaProps }\n","function getInitials(name?: string) {\n if (!name) {\n return ''\n }\n\n const seed = name.trim().split(' ')\n const firstInitial = seed[0]\n const lastInitial = seed[seed.length - 1]\n\n let initials = firstInitial?.[0]\n if (\n firstInitial != null &&\n lastInitial != null &&\n initials != null &&\n // Better readable this way.\n // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with\n firstInitial[0] !== lastInitial[0]\n ) {\n initials += lastInitial[0]\n }\n return initials?.toUpperCase()\n}\n\nfunction emailToIndex(email: string, maxIndex: number) {\n const seed = email.split('@')[0]\n const hash = seed ? seed.charCodeAt(0) + seed.charCodeAt(seed.length - 1) || 0 : 0\n return hash % maxIndex\n}\n\nexport { getInitials, emailToIndex }\n","import * as React from 'react'\n\nimport { getInitials, emailToIndex } from './utils'\n\nimport { getClassNames, ResponsiveProp } from '../utils/responsive-props'\nimport styles from './avatar.module.css'\nimport { Box } from '../box'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nconst AVATAR_COLORS = [\n '#fcc652',\n '#e9952c',\n '#e16b2d',\n '#d84b40',\n '#e8435a',\n '#e5198a',\n '#ad3889',\n '#86389c',\n '#a8a8a8',\n '#98be2f',\n '#5d9d50',\n '#5f9f85',\n '#5bbcb6',\n '#32a3bf',\n '#2bafeb',\n '#2d88c3',\n '#3863cc',\n '#5e5e5e',\n]\n\ntype AvatarSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl'\n\ntype Props = ObfuscatedClassName & {\n /** @deprecated Please use `exceptionallySetClassName` */\n className?: string\n /** @deprecated */\n colorList?: string[]\n size?: ResponsiveProp<AvatarSize>\n avatarUrl?: string\n user: { name?: string; email: string }\n}\n\nfunction Avatar({\n user,\n avatarUrl,\n size = 'l',\n className,\n colorList = AVATAR_COLORS,\n exceptionallySetClassName,\n ...props\n}: Props) {\n const userInitials = getInitials(user.name) || getInitials(user.email)\n const avatarSize = size ? size : 'l'\n\n const style = avatarUrl\n ? {\n backgroundImage: `url(${avatarUrl})`,\n textIndent: '-9999px', // hide the initials\n }\n : {\n backgroundColor: colorList[emailToIndex(user.email, colorList.length)],\n }\n\n const sizeClassName = getClassNames(styles, 'size', avatarSize)\n\n return (\n <Box\n className={[className, styles.avatar, sizeClassName, exceptionallySetClassName]}\n style={style}\n {...props}\n >\n {userInitials}\n </Box>\n )\n}\nAvatar.displayName = 'Avatar'\n\nexport { Avatar }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport FocusLock from 'react-focus-lock'\nimport { hideOthers } from 'aria-hidden'\n\nimport { Dialog, DialogOptions, useDialogStore, Portal, PortalOptions } from '@ariakit/react'\n\nimport { CloseIcon } from '../icons/close-icon'\nimport { Column, Columns } from '../columns'\nimport { Inline } from '../inline'\nimport { Divider } from '../divider'\nimport { Box } from '../box'\nimport { IconButtonProps, IconButton } from '../button'\n\nimport styles from './modal.module.css'\nimport type { ObfuscatedClassName } from '../utils/common-types'\nimport { forwardRef } from 'react'\n\ntype ModalWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'full'\ntype ModalHeightMode = 'expand' | 'fitContent'\n\n//\n// ModalContext\n//\n\ntype ModalContextValue = {\n onDismiss?(this: void): void\n height: ModalHeightMode\n}\n\nconst ModalContext = React.createContext<ModalContextValue>({\n onDismiss: undefined,\n height: 'fitContent',\n})\n\n//\n// Modal container\n//\n\ntype DivProps = Omit<\n React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLDivElement>, HTMLDivElement>,\n 'className' | 'children' | `aria-label` | `aria-labelledby`\n>\n\nexport interface ModalProps extends DivProps, ObfuscatedClassName {\n /**\n * The content of the modal.\n */\n children: React.ReactNode\n\n /**\n * Whether the modal is open and visible or not.\n */\n isOpen: boolean\n\n /**\n * Called when the user triggers closing the modal.\n */\n onDismiss?(): void\n\n /**\n * A descriptive setting for how wide the modal should aim to be, depending on how much space\n * it has on screen.\n * @default 'medium'\n */\n width?: ModalWidth\n\n /**\n * A descriptive setting for how tall the modal should aim to be.\n *\n * - 'expand': the modal aims to fill most of the available screen height, leaving only a small\n * padding above and below.\n * - 'fitContent': the modal shrinks to the smallest size that allow it to fit its content.\n *\n * In either case, if content does not fit, the content of the main body is set to scroll\n * (provided you use `ModalBody`) so that the modal never has to strech vertically beyond the\n * viewport boundaries.\n *\n * If you do not use `ModalBody`, the modal still prevents overflow, and you are in charge of\n * the inner layout to ensure scroll, or whatever other strategy you may want.\n */\n height?: ModalHeightMode\n\n /**\n * Whether to set or not the focus initially to the first focusable element inside the modal.\n */\n autoFocus?: boolean\n\n /**\n * Controls if the modal is dismissed when pressing \"Escape\".\n */\n hideOnEscape?: DialogOptions['hideOnEscape']\n\n /**\n * Controls if the modal is dismissed when clicking outside the modal body, on the overlay.\n */\n hideOnInteractOutside?: DialogOptions['hideOnInteractOutside']\n\n /**\n * An escape hatch in case you need to provide a custom class name to the overlay element.\n */\n exceptionallySetOverlayClassName?: string\n\n /**\n * Defines a string value that labels the current modal for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * Identifies the element (or elements) that labels the current modal for assistive technologies.\n */\n 'aria-labelledby'?: string\n\n /**\n * An HTML element or a memoized callback function that returns an HTML element to be used as\n * the portal element. By default, the portal element will be a `div` element appended to the\n * `document.body`.\n *\n * @default HTMLDivElement\n *\n * @example\n * const [portal, setPortal] = useState(null);\n * <Portal portalElement={portal} />;\n * <div ref={setPortal} />;\n *\n * @example\n * const getPortalElement = useCallback(() => {\n * const div = document.createElement(\"div\");\n * const portalRoot = document.getElementById(\"portal-root\");\n * portalRoot.appendChild(div);\n * return div;\n * }, []);\n * <Portal portalElement={getPortalElement} />;\n */\n portalElement?: PortalOptions['portalElement']\n}\n\nfunction isNotInternalFrame(element: HTMLElement) {\n return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe')\n}\n\n/**\n * Renders a modal that sits on top of the rest of the content in the entire page.\n *\n * Follows the WAI-ARIA Dialog (Modal) Pattern.\n *\n * @see ModalHeader\n * @see ModalFooter\n * @see ModalBody\n */\nexport function Modal({\n isOpen,\n onDismiss,\n height = 'fitContent',\n width = 'medium',\n exceptionallySetClassName,\n exceptionallySetOverlayClassName,\n autoFocus = true,\n hideOnEscape = true,\n hideOnInteractOutside = true,\n children,\n portalElement,\n onKeyDown,\n // @ts-expect-error we want to make sure to not pass it to the Dialog component\n className,\n ...props\n}: ModalProps) {\n const setOpen = React.useCallback(\n (visible: boolean) => {\n if (!visible) {\n onDismiss?.()\n }\n },\n [onDismiss],\n )\n const store = useDialogStore({ open: isOpen, setOpen })\n\n const contextValue: ModalContextValue = React.useMemo(() => ({ onDismiss, height }), [\n onDismiss,\n height,\n ])\n\n const portalRef = React.useRef<HTMLElement | null>(null)\n const dialogRef = React.useRef<HTMLDivElement | null>(null)\n const backdropRef = React.useRef<HTMLDivElement | null>(null)\n const handleBackdropClick = React.useCallback(\n (event: React.MouseEvent) => {\n if (\n // The focus lock element takes up the same space as the backdrop and is where the event bubbles up from,\n // so instead of checking the backdrop as the event target, we need to make sure it's just above the dialog\n !dialogRef.current?.contains(event.target as Node) &&\n // Events fired from other portals will bubble up to the backdrop, even if it isn't a child in the DOM\n backdropRef.current?.contains(event.target as Node)\n ) {\n event.stopPropagation()\n onDismiss?.()\n }\n },\n [onDismiss],\n )\n\n React.useLayoutEffect(\n function disableAccessibilityTreeOutside() {\n if (!isOpen || !portalRef.current) {\n return\n }\n\n return hideOthers(portalRef.current)\n },\n [isOpen],\n )\n\n const handleKeyDown = React.useCallback(\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n if (\n hideOnEscape &&\n onDismiss != null &&\n event.key === 'Escape' &&\n !event.defaultPrevented\n ) {\n event.stopPropagation()\n onDismiss()\n }\n onKeyDown?.(event)\n },\n [onDismiss, hideOnEscape, onKeyDown],\n )\n\n if (!isOpen) {\n return null\n }\n\n return (\n <Portal portalRef={portalRef} portalElement={portalElement}>\n <Box\n data-testid=\"modal-overlay\"\n data-overlay\n className={classNames(\n styles.overlay,\n styles[height],\n styles[width],\n exceptionallySetOverlayClassName,\n )}\n /**\n * We're using `onPointerDown` instead of `onClick` to prevent the modal from\n * closing when the click starts inside the modal and ends on the backdrop.\n */\n onPointerDown={hideOnInteractOutside ? handleBackdropClick : undefined}\n ref={backdropRef}\n >\n <FocusLock\n autoFocus={autoFocus}\n whiteList={isNotInternalFrame}\n returnFocus={true}\n crossFrame={false}\n >\n <Dialog\n {...props}\n ref={dialogRef}\n render={\n <Box\n borderRadius=\"full\"\n background=\"default\"\n display=\"flex\"\n flexDirection=\"column\"\n overflow=\"hidden\"\n height={height === 'expand' ? 'full' : undefined}\n flexGrow={height === 'expand' ? 1 : 0}\n />\n }\n className={classNames(exceptionallySetClassName, styles.container)}\n store={store}\n preventBodyScroll\n // Disable focus lock as we set up our own using ReactFocusLock\n modal={false}\n autoFocus={false}\n autoFocusOnShow={false}\n autoFocusOnHide={false}\n // Disable portal and backdrop as we control their markup\n portal={false}\n backdrop={false}\n hideOnInteractOutside={false}\n hideOnEscape={false}\n onKeyDown={handleKeyDown}\n >\n <ModalContext.Provider value={contextValue}>\n {children}\n </ModalContext.Provider>\n </Dialog>\n </FocusLock>\n </Box>\n </Portal>\n )\n}\n\n//\n// ModalCloseButton\n//\n\nexport interface ModalCloseButtonProps\n extends Omit<\n IconButtonProps,\n 'type' | 'variant' | 'icon' | 'disabled' | 'loading' | 'tabIndex' | 'ref'\n > {\n /**\n * The descriptive label of the button.\n */\n 'aria-label': string\n}\n\n/**\n * The close button rendered by ModalHeader. Provided independently so that consumers can customize\n * the button's label.\n *\n * @see ModalHeader\n */\nexport function ModalCloseButton(props: ModalCloseButtonProps) {\n const { onDismiss } = React.useContext(ModalContext)\n const [includeInTabOrder, setIncludeInTabOrder] = React.useState(false)\n const [isMounted, setIsMounted] = React.useState(false)\n\n React.useEffect(\n function skipAutoFocus() {\n if (isMounted) {\n setIncludeInTabOrder(true)\n } else {\n setIsMounted(true)\n }\n },\n [isMounted],\n )\n\n return (\n <IconButton\n {...props}\n variant=\"quaternary\"\n onClick={onDismiss}\n icon={<CloseIcon />}\n tabIndex={includeInTabOrder ? 0 : -1}\n />\n )\n}\n\n//\n// ModalHeader\n//\n\nexport interface ModalHeaderProps extends DivProps, ObfuscatedClassName {\n /**\n * The content of the header.\n */\n children: React.ReactNode\n\n /**\n * Allows to provide a custom button element, or to omit the close button if set to false.\n * @see ModalCloseButton\n */\n button?: React.ReactNode | boolean\n\n /**\n * Whether to render a divider line below the header.\n * @default false\n */\n withDivider?: boolean\n}\n\n/**\n * Renders a standard modal header area with an optional close button.\n *\n * @see Modal\n * @see ModalFooter\n * @see ModalBody\n */\nexport function ModalHeader({\n children,\n button = true,\n withDivider = false,\n exceptionallySetClassName,\n ...props\n}: ModalHeaderProps) {\n return (\n <>\n <Box\n {...props}\n as=\"header\"\n paddingLeft=\"large\"\n paddingRight={button === false || button === null ? 'large' : 'small'}\n paddingY=\"small\"\n className={exceptionallySetClassName}\n >\n <Columns space=\"large\" alignY=\"center\">\n <Column width=\"auto\">{children}</Column>\n {button === false || button === null ? (\n <div className={styles.headerContent} />\n ) : (\n <Column\n width=\"content\"\n exceptionallySetClassName={styles.buttonContainer}\n data-testid=\"button-container\"\n >\n {typeof button === 'boolean' ? (\n <ModalCloseButton aria-label=\"Close modal\" autoFocus={false} />\n ) : (\n button\n )}\n </Column>\n )}\n </Columns>\n </Box>\n {withDivider ? <Divider /> : null}\n </>\n )\n}\n\n//\n// ModalBody\n//\n\nexport interface ModalBodyProps extends DivProps, ObfuscatedClassName {\n /**\n * The content of the modal body.\n */\n children: React.ReactNode\n}\n\n/**\n * Renders the body of a modal.\n *\n * Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other\n * things, that the content of the modal body expands or contracts depending on the modal height\n * setting or the size of the content. The body content also automatically scrolls when it's too\n * large to fit the available space.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalFooter\n */\nexport const ModalBody = forwardRef<HTMLDivElement, ModalBodyProps>(function ModalBody(\n { exceptionallySetClassName, children, ...props },\n ref,\n) {\n const { height } = React.useContext(ModalContext)\n return (\n <Box\n {...props}\n ref={ref}\n className={exceptionallySetClassName}\n flexGrow={height === 'expand' ? 1 : 0}\n height={height === 'expand' ? 'full' : undefined}\n overflow=\"auto\"\n >\n <Box padding=\"large\" paddingBottom=\"xxlarge\">\n {children}\n </Box>\n </Box>\n )\n})\n\n//\n// ModalFooter\n//\n\nexport interface ModalFooterProps extends DivProps, ObfuscatedClassName {\n /**\n * The contant of the modal footer.\n */\n children: React.ReactNode\n /**\n * Whether to render a divider line below the footer.\n * @default false\n */\n withDivider?: boolean\n}\n\n/**\n * Renders a standard modal footer area.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalBody\n */\nexport function ModalFooter({\n exceptionallySetClassName,\n withDivider = false,\n ...props\n}: ModalFooterProps) {\n return (\n <>\n {withDivider ? <Divider /> : null}\n <Box as=\"footer\" {...props} className={exceptionallySetClassName} padding=\"large\" />\n </>\n )\n}\n\n//\n// ModalActions\n//\n\nexport type ModalActionsProps = ModalFooterProps\n\n/**\n * A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).\n * @see ModalFooter\n */\nexport function ModalActions({ children, ...props }: ModalActionsProps) {\n return (\n <ModalFooter {...props}>\n <Inline align=\"right\" space=\"large\">\n {children}\n </Inline>\n </ModalFooter>\n )\n}\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport {\n useTabStore,\n Tab as BaseTab,\n TabProps as BaseTabProps,\n TabList as BaseTabList,\n TabPanel as BaseTabPanel,\n TabPanelProps as BaseTabPanelProps,\n TabStore,\n} from '@ariakit/react'\nimport { Inline } from '../inline'\nimport type { ObfuscatedClassName, Space } from '../utils/common-types'\n\nimport styles from './tabs.module.css'\nimport { Box } from '../box'\n\ntype TabsContextValue = Required<Pick<TabsProps, 'variant'>> & {\n tabStore: TabStore\n}\n\nconst TabsContext = React.createContext<TabsContextValue | null>(null)\n\ninterface TabsProps {\n /**\n * The `<Tabs>` component must be composed from a `<TabList>` and corresponding `<TabPanel>`\n * components\n */\n children: React.ReactNode\n\n /**\n * Determines the look and feel of the tabs\n */\n variant?: 'themed' | 'neutral'\n\n /**\n * The id of the selected tab. Assigning a value makes this a controlled component\n */\n selectedId?: string | null\n\n /**\n * The tab to initially select. This can be used if the component should not\n * be a controlled component but needs to have a tab selected\n */\n defaultSelectedId?: string | null\n\n /**\n * Called with the tab id when a tab is selected\n */\n onSelectedIdChange?: (selectedId: string | null | undefined) => void\n}\n\n/**\n * Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.\n */\nfunction Tabs({\n children,\n selectedId,\n defaultSelectedId,\n variant = 'neutral',\n onSelectedIdChange,\n}: TabsProps): React.ReactElement {\n const tabStore = useTabStore({\n defaultSelectedId,\n selectedId,\n setSelectedId: onSelectedIdChange,\n })\n const actualSelectedId = tabStore.useState('selectedId')\n\n const memoizedTabState = React.useMemo(\n () => ({ tabStore, variant, selectedId: selectedId ?? actualSelectedId ?? null }),\n [variant, tabStore, selectedId, actualSelectedId],\n )\n return <TabsContext.Provider value={memoizedTabState}>{children}</TabsContext.Provider>\n}\n\ninterface TabProps\n extends ObfuscatedClassName,\n Omit<BaseTabProps, 'store' | 'className' | 'children' | 'id'> {\n /**\n * The content to render inside of the tab button\n */\n children: React.ReactNode\n\n /**\n * The tab's identifier. This must match its corresponding `<TabPanel>`'s id\n */\n id: string\n}\n\n/**\n * Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.\n */\nconst Tab = React.forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { children, id, exceptionallySetClassName, render, onClick },\n ref,\n): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n if (!tabContextValue) return null\n\n const { variant, tabStore } = tabContextValue\n const className = classNames(exceptionallySetClassName, styles.tab, styles[`tab-${variant}`])\n\n return (\n <BaseTab\n id={id}\n ref={ref}\n store={tabStore}\n render={render}\n className={className}\n onClick={onClick}\n >\n {children}\n </BaseTab>\n )\n})\n\ntype TabListProps = (\n | {\n /** Labels the tab list for assistive technologies. This must be provided if `aria-labelledby` is omitted. */\n 'aria-label': string\n }\n | {\n /**\n * One or more element IDs used to label the tab list for assistive technologies. Required if\n * `aria-label` is omitted.\n */\n 'aria-labelledby': string\n }\n | {\n /**\n * For cases where multiple instances of the tab list exists, the duplicates may be marked as aria-hidden\n */\n 'aria-hidden': boolean\n }\n) & {\n /**\n * A list of `<Tab>` elements\n */\n children: React.ReactNode\n\n /**\n * Controls the spacing between tabs\n */\n space?: Space\n}\n\n/**\n * A component used to group `<Tab>` elements together.\n */\nfunction TabList({ children, space, ...props }: TabListProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n\n if (!tabContextValue) {\n return null\n }\n\n const { tabStore, variant } = tabContextValue\n\n return (\n // The extra <div> prevents <Inline>'s negative margins from collapsing when used in a flex container\n // which will render the track with the wrong height\n <div>\n <BaseTabList\n store={tabStore}\n render={<Box position=\"relative\" width=\"maxContent\" />}\n {...props}\n >\n <Box className={[styles.track, styles[`track-${variant}`]]} />\n <Inline space={space}>{children}</Inline>\n </BaseTabList>\n </div>\n )\n}\n\ninterface TabPanelProps\n extends React.HTMLAttributes<HTMLDivElement>,\n Pick<BaseTabPanelProps, 'render'> {\n /** The content to be rendered inside the tab */\n children?: React.ReactNode\n\n /** The tabPanel's identifier. This must match its corresponding `<Tab>`'s id */\n id: string\n\n /**\n * By default, the tab panel's content is always rendered even when they are not active. This\n * behaviour can be changed to 'active', which renders only when the tab is active, and 'lazy',\n * meaning while inactive tab panels will not be rendered initially, they will remain mounted\n * once they are active until the entire Tabs tree is unmounted.\n */\n renderMode?: 'always' | 'active' | 'lazy'\n}\n\n/**\n * Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a\n * corresponding `<Tab>` component.\n */\nconst TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel(\n { children, id, renderMode = 'always', ...props },\n ref,\n): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const [tabRendered, setTabRendered] = React.useState(false)\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n const tabIsActive = selectedId === id\n\n React.useEffect(\n function trackTabRenderedState() {\n if (!tabRendered && tabIsActive) {\n setTabRendered(true)\n }\n },\n [tabRendered, tabIsActive],\n )\n\n if (!tabContextValue) {\n return null\n }\n\n const { tabStore } = tabContextValue\n const shouldRender =\n renderMode === 'always' ||\n (renderMode === 'active' && tabIsActive) ||\n (renderMode === 'lazy' && (tabIsActive || tabRendered))\n\n return shouldRender ? (\n <BaseTabPanel {...props} tabId={id} store={tabStore} ref={ref}>\n {children}\n </BaseTabPanel>\n ) : null\n})\n\ntype TabAwareSlotProps = {\n /**\n * Render prop used to provide the content to be rendered inside the slot. The render prop will\n * be called with the current `selectedId`\n */\n children: (provided: { selectedId?: string | null }) => React.ReactElement | null\n}\n\n/**\n * Allows content to be rendered based on the current tab being selected while outside of the\n * TabPanel component. Can be placed freely within the main `<Tabs>` component.\n */\nfunction TabAwareSlot({ children }: TabAwareSlotProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n return tabContextValue ? children({ selectedId }) : null\n}\n\nexport { Tab, Tabs, TabList, TabPanel, TabAwareSlot }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport {\n Portal,\n MenuStore,\n MenuStoreProps,\n useMenuStore,\n MenuProps as AriakitMenuProps,\n Menu as AriakitMenu,\n MenuGroup as AriakitMenuGroup,\n MenuItem as AriakitMenuItem,\n MenuItemProps as AriakitMenuItemProps,\n MenuButton as AriakitMenuButton,\n MenuButtonProps as AriakitMenuButtonProps,\n Role,\n RoleProps,\n} from '@ariakit/react'\n\nimport './menu.less'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype MenuContextState = {\n menuStore: MenuStore | null\n handleItemSelect?: (value: string | null | undefined) => void\n getAnchorRect: (() => { x: number; y: number }) | null\n setAnchorRect: (rect: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>({\n menuStore: null,\n handleItemSelect: () => undefined,\n getAnchorRect: null,\n setAnchorRect: () => undefined,\n})\n\nconst SubMenuContext = React.createContext<{ isSubMenu: boolean }>({ isSubMenu: false })\n\n//\n// Menu\n//\n\ninterface MenuProps extends Omit<MenuStoreProps, 'visible'> {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const [anchorRect, setAnchorRect] = React.useState<{ x: number; y: number } | null>(null)\n const getAnchorRect = React.useMemo(() => (anchorRect ? () => anchorRect : null), [anchorRect])\n const menuStore = useMenuStore({ focusLoop: true, ...props })\n\n const value: MenuContextState = React.useMemo(\n () => ({ menuStore, handleItemSelect: onItemSelect, getAnchorRect, setAnchorRect }),\n [menuStore, onItemSelect, getAnchorRect, setAnchorRect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ninterface MenuButtonProps\n extends Omit<AriakitMenuButtonProps, 'store' | 'className' | 'as'>,\n ObfuscatedClassName {}\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = React.forwardRef<HTMLButtonElement, MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuButton must be wrapped in <Menu/>')\n }\n return (\n <AriakitMenuButton\n {...props}\n store={menuStore}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// ContextMenuTrigger\n//\n\ninterface ContextMenuTriggerProps\n extends ObfuscatedClassName,\n React.HTMLAttributes<HTMLDivElement>,\n Pick<RoleProps, 'render'> {}\n\nconst ContextMenuTrigger = React.forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ render, ...props }, ref) {\n const { setAnchorRect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('ContextMenuTrigger must be wrapped in <Menu/>')\n }\n\n const handleContextMenu = React.useCallback(\n function handleContextMenu(event: React.MouseEvent) {\n event.preventDefault()\n setAnchorRect({ x: event.clientX, y: event.clientY })\n menuStore.show()\n },\n [setAnchorRect, menuStore],\n )\n\n const isOpen = menuStore.useState('open')\n React.useEffect(() => {\n if (!isOpen) setAnchorRect(null)\n }, [isOpen, setAnchorRect])\n\n return <Role.div {...props} onContextMenu={handleContextMenu} ref={ref} render={render} />\n },\n)\n\n//\n// MenuList\n//\n\ninterface MenuListProps\n extends Omit<AriakitMenuProps, 'store' | 'className'>,\n ObfuscatedClassName {}\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = React.forwardRef<HTMLDivElement, MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, flip, ...props },\n ref,\n) {\n const { menuStore, getAnchorRect } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuList must be wrapped in <Menu/>')\n }\n\n const { isSubMenu } = React.useContext(SubMenuContext)\n\n const isOpen = menuStore.useState('open')\n\n return isOpen ? (\n <Portal preserveTabOrder>\n <AriakitMenu\n {...props}\n store={menuStore}\n gutter={8}\n shift={4}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n getAnchorRect={getAnchorRect ?? undefined}\n modal={modal}\n flip={flip ?? (isSubMenu ? 'left bottom' : undefined)}\n />\n </Portal>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ninterface MenuItemProps extends AriakitMenuItemProps, ObfuscatedClassName {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuItem must be wrapped in <Menu/>')\n }\n\n const { hide } = menuStore\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect?.(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <AriakitMenuItem\n {...props}\n store={menuStore}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n hideOnClick={false}\n >\n {children}\n </AriakitMenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('SubMenu must be wrapped in <Menu/>')\n }\n\n const { hide: parentMenuHide } = menuStore\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n onItemSelect?.(value)\n parentMenuItemSelect?.(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n const buttonElement = button as React.ReactElement<MenuButtonProps>\n const subMenuContextValue = React.useMemo(() => ({ isSubMenu: true }), [])\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <AriakitMenuItem store={menuStore} ref={ref} hideOnClick={false} render={buttonElement}>\n {buttonElement.props.children}\n </AriakitMenuItem>\n <SubMenuContext.Provider value={subMenuContextValue}>{list}</SubMenuContext.Provider>\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ninterface MenuGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className'>,\n ObfuscatedClassName {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = React.forwardRef<HTMLDivElement, MenuGroupProps>(function MenuGroup(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuGroup must be wrapped in <Menu/>')\n }\n\n return (\n <AriakitMenuGroup\n {...props}\n ref={ref}\n store={menuStore}\n className={exceptionallySetClassName}\n >\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </AriakitMenuGroup>\n )\n})\n\nexport { ContextMenuTrigger, Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, MenuGroupProps }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport { Tooltip } from '../../tooltip'\n\nimport './deprecated-button.less'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\n/** @deprecated */\nexport type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link'\n\n/** @deprecated */\nexport type ButtonSize = 'default' | 'small' | 'large'\n\n/** @deprecated */\nexport type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {\n /**\n * Loading style. When true it disables the button, but it also adds a visual indication of\n * some in-progress operation going on.\n */\n loading?: boolean\n /**\n * Controls visually how the button shows up from a predefined set of kinds of buttons.\n */\n variant?: ButtonVariant\n /**\n * The size of the button. If not provided it shows up in a normal size.\n */\n size?: ButtonSize\n /**\n * Tooltip that is displayed on hover.\n *\n * This replaces `title` which is not supported for these buttons to avoid confusion.\n */\n tooltip?: React.ReactNode\n}\n\n/**\n * @deprecated\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n variant,\n size = 'default',\n loading = false,\n disabled = false,\n tooltip,\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const className = classNames(\n 'reactist_button',\n variant ? `reactist_button--${variant}` : null,\n size !== 'default' ? `reactist_button--${size}` : null,\n { 'reactist_button--loading': loading },\n props.className,\n )\n\n const button = (\n <button\n {...props}\n ref={ref}\n type={type}\n className={className}\n aria-disabled={disabled || loading}\n onClick={disabled || loading ? undefined : onClick}\n >\n {children}\n </button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{button}</Tooltip> : button\n})\n\nButton.displayName = 'Button'\n\nButton.defaultProps = {\n size: 'default',\n loading: false,\n disabled: false,\n}\n\nexport { Button }\n","import * as React from 'react'\nimport ReactDOM from 'react-dom'\nimport classNames from 'classnames'\n\nimport Button from '../deprecated-button'\n\nimport './dropdown.less'\n\ntype BoxProps = {\n onShowBody?: () => void\n onHideBody?: () => void\n allowBodyInteractions?: boolean\n top?: boolean\n right?: boolean\n scrolling_parent?: string\n children?: [\n React.ReactElement<TriggerProps>,\n React.ReactElement<BodyProps> | ((props: BodyProps) => JSX.Element),\n ]\n className?: string\n}\n\ntype BoxState = {\n top: boolean\n showBody: boolean\n}\n\nclass Box extends React.Component<BoxProps, BoxState> {\n public static displayName: string\n\n constructor(props: BoxProps, context: React.Context<unknown>) {\n super(props, context)\n this.state = {\n showBody: false,\n top: props.top || false,\n }\n\n this._timeout = undefined\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this._handleClickOutside, true)\n if (this._timeout) {\n clearTimeout(this._timeout)\n }\n }\n _timeout?: ReturnType<typeof setTimeout>\n\n _handleClickOutside = (event: MouseEvent) => {\n const dropdownDOMNode = ReactDOM.findDOMNode(this)\n\n if (dropdownDOMNode && !dropdownDOMNode.contains(event.target as Node))\n this._toggleShowBody()\n else if (!this.props.allowBodyInteractions) {\n // won't close when body interactions are allowed\n this._timeout = setTimeout(() => {\n if (this.state.showBody) {\n this._toggleShowBody()\n }\n }, 100)\n }\n }\n\n _toggleShowBody = () => {\n if (!this.state.showBody) {\n // will show\n if (this.props.onShowBody) this.props.onShowBody()\n document.addEventListener('click', this._handleClickOutside, true)\n } else {\n // will hide\n if (this.props.onHideBody) this.props.onHideBody()\n document.removeEventListener('click', this._handleClickOutside, true)\n }\n\n this.setState({\n showBody: !this.state.showBody,\n })\n }\n\n _getTriggerComponent() {\n const _trigger = this.props.children?.[0]\n return _trigger\n ? React.cloneElement(_trigger, { onClick: this._toggleShowBody })\n : undefined\n }\n\n // https://facebook.github.io/react/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components\n _setPosition = (body: HTMLElement | null) => {\n if (body) {\n const scrollingParent = document.getElementById(\n this.props.scrolling_parent ? this.props.scrolling_parent : '',\n )\n\n if (scrollingParent) {\n const dropdown = ReactDOM.findDOMNode(this)\n if (!dropdown) {\n return\n }\n const dropdownVerticalPosition = (ReactDOM.findDOMNode(this) as HTMLElement)\n .offsetTop\n const dropdownTrigger = (dropdown as Element).querySelector('.trigger')\n if (!dropdownTrigger) {\n return\n }\n const dropdownTriggerHeight = dropdownTrigger.clientHeight\n const dropdownBodyHeight = body.clientHeight\n\n const scrollingParentHeight = scrollingParent.clientHeight\n const scrollingParentOffset = scrollingParent.scrollTop\n\n const bottomOffset =\n scrollingParentHeight +\n scrollingParentOffset -\n dropdownVerticalPosition -\n dropdownTriggerHeight\n\n const top = bottomOffset < dropdownBodyHeight\n\n if (top !== this.state.top) {\n this.setState({ top })\n }\n }\n }\n }\n\n _getBodyComponent() {\n if (!this.state.showBody) {\n return null\n }\n const { top } = this.state\n const { right = false, children } = this.props\n const props = { top, right, setPosition: this._setPosition }\n\n const className = classNames({\n body_wrapper: true,\n with_arrow: true,\n top: top,\n bottom: !top,\n })\n\n const body = children?.[1]\n\n const contentMarkup =\n typeof body === 'function'\n ? body(props)\n : body\n ? React.cloneElement(body, props)\n : undefined\n return (\n <div className={className} style={{ position: 'relative' }}>\n {contentMarkup}\n </div>\n )\n }\n\n render() {\n const className = classNames('reactist_dropdown', this.props.className)\n const { top } = this.state\n\n return (\n <div\n style={{ display: 'inline-block' }}\n className={className}\n data-testid=\"reactist-dropdown-box\"\n >\n {top && this._getBodyComponent()}\n {this._getTriggerComponent()}\n {!top && this._getBodyComponent()}\n </div>\n )\n }\n}\n\nBox.displayName = 'Dropdown.Box'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\ntype TriggerProps = Omit<NativeButtonProps, 'title' | 'onClick'> & {\n tooltip?: React.ReactNode\n /**\n * @private the onClick prop is not to be used externally\n */\n onClick?: NativeButtonProps['onClick']\n}\n\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(function Trigger(\n { children, onClick, tooltip, className, ...props },\n ref,\n) {\n function handleClick(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) {\n event.preventDefault()\n event.stopPropagation()\n if (onClick) onClick(event)\n }\n\n return (\n <Button\n {...props}\n className={classNames('trigger', className)}\n onClick={handleClick}\n tooltip={tooltip}\n ref={ref}\n >\n {children}\n </Button>\n )\n})\n\nTrigger.displayName = 'Dropdown.Trigger'\n\ntype BodyProps = {\n setPosition?: React.Ref<HTMLDivElement>\n children?: React.ReactNode\n top?: boolean\n right?: boolean\n}\n\nfunction Body({ top, right, children, setPosition }: BodyProps) {\n const style: React.CSSProperties = { position: 'absolute', right: 0, top: 0 }\n\n if (top) {\n style.top = 'auto'\n style.bottom = 0\n }\n\n if (right) {\n style.right = 'auto'\n style.left = 0\n }\n\n return (\n <div\n ref={setPosition}\n style={style}\n className=\"body\"\n id=\"reactist-dropdown-body\"\n data-testid=\"reactist-dropdown-body\"\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dropdown.Body'\n\nconst Dropdown = {\n Box,\n Trigger,\n Body,\n}\n\nexport { Dropdown }\n","import * as React from 'react'\nimport classnames from 'classnames'\n\nimport DeprecatedDropdown from '../deprecated-dropdown'\nimport { Tooltip } from '../../tooltip'\n\nimport './color-picker.less'\n\ntype NamedColor = { name: string; color: string }\n\nconst COLORS = [\n '#606060',\n '#4A90E2',\n '#03B3B2',\n '#008299',\n '#82BA00',\n '#D24726',\n '#AC193D',\n '#DC4FAD',\n '#3BD5FB',\n '#74E8D3',\n '#FFCC00',\n '#FB886E',\n '#CCCCCC',\n]\n\nconst _isNamedColor = (color: string | NamedColor | undefined): color is NamedColor =>\n typeof color !== 'string'\n\nconst _getColor = (colorList: (string | NamedColor)[], colorIndex: number) => {\n const index = colorIndex >= colorList.length ? 0 : colorIndex\n return colorList[index]\n}\n\ntype Props = {\n small?: boolean\n color?: number\n onChange?: (color: number) => void\n colorList?: (string | NamedColor)[]\n}\n\nfunction ColorPicker({ color = 0, small, onChange, colorList = COLORS }: Props) {\n return (\n <DeprecatedDropdown.Box right className=\"reactist_color_picker\">\n <DeprecatedDropdown.Trigger>\n {(() => {\n const backgroundColor = _getColor(colorList, color)\n\n return (\n <span\n className={classnames('color_trigger', { small })}\n style={{\n backgroundColor: _isNamedColor(backgroundColor)\n ? backgroundColor.color\n : backgroundColor,\n }}\n >\n <span className=\"color_trigger--inner_ring\" />\n </span>\n )\n })()}\n </DeprecatedDropdown.Trigger>\n <DeprecatedDropdown.Body>\n <div className=\"color_options\">\n {colorList.reduce<React.ReactNode[]>((items, currentColor, currentIndex) => {\n items.push(\n <ColorItem\n isActive={\n color >= colorList.length\n ? currentIndex === 0\n : currentIndex === color\n }\n key={currentIndex}\n color={\n _isNamedColor(currentColor) ? currentColor.color : currentColor\n }\n colorIndex={currentIndex}\n onClick={onChange}\n tooltip={_isNamedColor(currentColor) ? currentColor.name : null}\n />,\n )\n return items\n }, [])}\n </div>\n </DeprecatedDropdown.Body>\n </DeprecatedDropdown.Box>\n )\n}\nColorPicker.displayName = 'ColorPicker'\n\ntype ColorItemProps = {\n color: string\n colorIndex: number\n isActive?: boolean\n onClick?: (colorIndex: number) => void\n tooltip?: React.ReactNode\n}\n\nfunction ColorItem({ color, colorIndex, isActive, onClick, tooltip }: ColorItemProps) {\n const item = (\n <span\n data-testid=\"reactist-color-item\"\n className={'reactist color_item' + (isActive ? ' active' : '')}\n style={{ backgroundColor: color }}\n onClick={() => onClick?.(colorIndex)}\n >\n <span className=\"color_item--inner_ring\" />\n </span>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{item}</Tooltip> : item\n}\nColorItem.displayName = 'ColorItem'\n\nexport { ColorPicker, ColorItem, COLORS }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\n//\n// Support for setting up how to translate modifiers globally.\n//\n\nlet globalTranslateKey = (key: string) => key\n\ntype TranslateKey = typeof globalTranslateKey\n\nKeyboardShortcut.setTranslateKey = (tr: TranslateKey) => {\n globalTranslateKey = tr\n}\n\nfunction translateKeyMac(key: string) {\n switch (key.toLowerCase()) {\n case 'cmd':\n case 'mod':\n return '⌘'\n case 'control':\n case 'ctrl':\n return '⌃'\n case 'alt':\n return '⌥'\n case 'shift':\n return '⇧'\n case 'space':\n return '␣'\n default:\n return key\n }\n}\n\n//\n// Some helpers\n//\n\nfunction capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()\n}\n\nfunction hasModifiers(str: string) {\n return /\\b(mod|cmd|ctrl|control|alt|shift)\\b/i.test(str)\n}\n\nfunction isSpecialKey(str: string) {\n return /^(mod|cmd|ctrl|control|alt|shift|space|super)$/i.test(str)\n}\n\nfunction parseKeys(shortcut: string, isMac: boolean, translateKey: TranslateKey) {\n const t = isMac ? translateKeyMac : translateKey\n const _hasModifiers = hasModifiers(shortcut)\n\n function mapIndividualKey(str: string) {\n if (isSpecialKey(str)) {\n return capitalize(t(str))\n }\n if (_hasModifiers && str.length === 1) {\n return str.toUpperCase()\n }\n return str\n }\n\n if (!isMac) {\n shortcut = shortcut.replace(/\\b(mod|cmd)\\b/i, 'ctrl')\n }\n\n return shortcut.split(/\\s*\\+\\s*/).map(mapIndividualKey)\n}\n\n//\n// The KeyboardShortcut component\n//\n\ntype NativeSpanProps = React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLSpanElement>,\n HTMLSpanElement\n>\n\ntype Props = Omit<NativeSpanProps, 'children'> & {\n /**\n * The shortcut to be represented as markup. It supports an intuitive syntax where you can\n * combine modifiers (cmd, ctrl, shift, alt) with single keys all concatenated with plus signs.\n * You can also pass various shortcuts as an array, which will be depicted separated by commas.\n */\n children: string | string[]\n /**\n * A function that allows you to change how some key names are represented. This may be useful,\n * for instance, to translate modifier names that are expressed differently in other languages\n * (e.g. `Ctrl` is named `Strg` in German).\n *\n * It defaults to a global version that leaves the key as is. You can pass your version as a\n * prop, or you can also set your own version of this global default one, so you don't need to\n * pass your own on each invocation of this component.\n *\n * ```js\n * import { KeyboardShortcut } from '@doist/reactist'\n * KeyboardShortcut.setTranslateKey = key => { ... }\n * ```\n *\n * Note: When the component detects the macOS operating system it bypasses key translation for\n * most modifiers and uses macOS-specific symbols. See the `isMac` prop for details.\n */\n translateKey?: TranslateKey\n /**\n * This prop is not meant to be passed. The component will automatically initialize it to `true`\n * if it detects that the current browser / operating system is on macOS, in which case modifier\n * keys are represented using macOS' notation (e.g. ⌘ ⌃ ⌥ ⇧).\n *\n * Though it is discouraged, if you don't want this special treatment in macOS, you can pass\n * `isMac={false}` in all invocations of this component.\n */\n isMac?: boolean\n}\n\nfunction KeyboardShortcut({\n children,\n className,\n translateKey = globalTranslateKey,\n isMac = navigator.platform?.toUpperCase().includes('MAC') ?? false,\n ...props\n}: Props) {\n const shortcuts = typeof children === 'string' ? [children] : children\n return (\n <span\n className={classNames('reactist_keyboard_shortcut', className, {\n 'reactist_keyboard_shortcut--macos': isMac,\n })}\n {...props}\n >\n {shortcuts.map((shortcut, i) => (\n <React.Fragment key={i}>\n {i === 0 ? null : ', '}\n <kbd>\n {parseKeys(shortcut, isMac, translateKey).map((key, j) => (\n <kbd key={j}>{key}</kbd>\n ))}\n </kbd>\n </React.Fragment>\n ))}\n </span>\n )\n}\n\nexport { KeyboardShortcut }\n","import * as React from 'react'\n\ntype Key = 'ArrowUp' | 'ArrowRight' | 'ArrowDown' | 'ArrowLeft' | 'Enter' | 'Backspace' | 'Escape'\n\nconst SUPPORTED_KEYS: Record<string, Key> = {\n ARROW_UP: 'ArrowUp',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ENTER: 'Enter',\n BACKSPACE: 'Backspace',\n ESCAPE: 'Escape',\n}\n\nconst KeyCapturerResolver = {\n resolveByKey(eventKey: string): Key | null {\n switch (eventKey) {\n case 'Left': // IE specific\n case 'ArrowLeft': {\n return 'ArrowLeft'\n }\n case 'Up': // IE specific\n case 'ArrowUp': {\n return 'ArrowUp'\n }\n case 'Right': // IE specific\n case 'ArrowRight': {\n return 'ArrowRight'\n }\n case 'Down': // IE specific\n case 'ArrowDown': {\n return 'ArrowDown'\n }\n case 'Enter': {\n return 'Enter'\n }\n case 'Backspace': {\n return 'Backspace'\n }\n case 'Esc': // IE specific\n case 'Escape': {\n return 'Escape'\n }\n default: {\n return null\n }\n }\n },\n\n resolveByKeyCode(keyCode: number): Key | null {\n switch (keyCode) {\n case 37: {\n return 'ArrowLeft'\n }\n case 38: {\n return 'ArrowUp'\n }\n case 39: {\n return 'ArrowRight'\n }\n case 40: {\n return 'ArrowDown'\n }\n case 13: {\n return 'Enter'\n }\n case 8: {\n return 'Backspace'\n }\n case 27: {\n return 'Escape'\n }\n default: {\n return null\n }\n }\n },\n}\n\ntype EventHandler = (event: React.SyntheticEvent) => void\n\ntype EventHandlerProps = {\n onArrowUp?: EventHandler\n onArrowDown?: EventHandler\n onArrowLeft?: EventHandler\n onArrowRight?: EventHandler\n onEnter?: EventHandler\n onBackspace?: EventHandler\n onEscape?: EventHandler\n}\n\ntype PropagateProps = {\n propagateArrowUp?: boolean\n propagateArrowDown?: boolean\n propagateArrowLeft?: boolean\n propagateArrowRight?: boolean\n propagateEnter?: boolean\n propagateBackspace?: boolean\n propagateEscape?: boolean\n}\n\nconst keyEventHandlerMapping: Record<Key, keyof EventHandlerProps> = {\n ArrowUp: 'onArrowUp',\n ArrowDown: 'onArrowDown',\n ArrowLeft: 'onArrowLeft',\n ArrowRight: 'onArrowRight',\n Enter: 'onEnter',\n Backspace: 'onBackspace',\n Escape: 'onEscape',\n}\n\nconst keyPropagatePropMapping: Record<Key, keyof PropagateProps> = {\n ArrowUp: 'propagateArrowUp',\n ArrowDown: 'propagateArrowDown',\n ArrowLeft: 'propagateArrowLeft',\n ArrowRight: 'propagateArrowRight',\n Enter: 'propagateEnter',\n Backspace: 'propagateBackspace',\n Escape: 'propagateEscape',\n}\n\ntype KeyCapturerProps = EventHandlerProps &\n PropagateProps & {\n eventName?: 'onKeyDown' | 'onKeyDownCapture' | 'onKeyUp' | 'onKeyUpCapture'\n children: React.ReactElement<unknown>\n }\n\n/**\n * Use this component to wrap anything you want to handle key events for (e.g. an input).\n * You can specify the `eventName` to capture (defaults to `onKeyDown`).\n * Check the SUPPORTED_KEYS map to see which keys are supported and supply the respective\n * `on${Key}` prop (i.e. `onEnter` or `onArrowDown`).\n * If you want the default behaviour to be preserved (i.e. only want to hook into the event\n * instead of replacing it) set the `propagate${Key}` prop (e.g. propagateBackspace).\n */\nfunction KeyCapturer(props: KeyCapturerProps) {\n const { children, eventName = 'onKeyDown' } = props\n const composingRef = React.useRef(false)\n const composingEventHandlers = props.onEnter\n ? {\n onCompositionStart: () => {\n composingRef.current = true\n },\n onCompositionEnd: () => {\n composingRef.current = false\n },\n }\n : undefined\n\n function handleKeyEvent(event: React.KeyboardEvent<HTMLInputElement>) {\n // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n const key =\n event.key !== undefined\n ? KeyCapturerResolver.resolveByKey(event.key)\n : KeyCapturerResolver.resolveByKeyCode(event.keyCode)\n\n if (!key) return\n const propagateEvent = props[keyPropagatePropMapping[key]] || false\n const eventHandler = props[keyEventHandlerMapping[key]]\n\n if (key === 'Enter' && eventHandler) {\n if (\n composingRef.current ||\n // Safari fires the onCompositionEnd event before the keydown event, so we\n // have to rely on the 229 keycode, which is Enter when fired from an IME\n // https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode\n (event.keyCode || event.which) === 229\n ) {\n return\n }\n }\n\n if (eventHandler) {\n eventHandler(event)\n if (!propagateEvent) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n }\n\n return React.cloneElement(children, {\n [eventName]: handleKeyEvent,\n ...composingEventHandlers,\n })\n}\n\nexport { KeyCapturer, KeyCapturerResolver, SUPPORTED_KEYS }\n","import * as React from 'react'\nimport { HiddenVisually } from '../../hidden-visually'\nimport classNames from 'classnames'\n\nimport './progress-bar.less'\n\ntype Props = {\n /** Additional css class applied to the progress bar. */\n className?: string\n /** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */\n fillPercentage?: number\n /** Defines the human readable text alternative for assitive technologies. */\n 'aria-valuetext'?: string\n}\nfunction ProgressBar({ fillPercentage = 0, className, 'aria-valuetext': ariaValuetext }: Props) {\n const finalClassName = classNames('reactist_progress_bar', className)\n const width = fillPercentage < 0 ? 0 : fillPercentage > 100 ? 100 : fillPercentage\n return (\n <div className={finalClassName}>\n <div className=\"inner\" style={{ width: `${width}%` }} />\n <HiddenVisually>\n <progress value={width} max={100} aria-valuetext={ariaValuetext ?? undefined} />\n </HiddenVisually>\n </div>\n )\n}\nProgressBar.displayName = 'ProgressBar'\n\nexport { ProgressBar }\n","import dayjs from 'dayjs'\n/**\n * There's a problem with our setup where the default export from\n * localizedFormat (and likely every other dayjs plugin) isn't properly\n * recognized. The proposed workarounds (importing with `.js` ending, or adding\n * `allowSyntheticDefaultImports` to the tsconfig) either broke linting or type\n * checking. After spending some time on this it was decided that further\n * investigations are not worth it, the code works and the eslint ignore is fine.\n * ref: https://github.com/iamkun/dayjs/issues/593\n * ref: https://day.js.org/docs/en/installation/typescript\n */\n// eslint-disable-next-line import/default\nimport LocalizedFormat from 'dayjs/plugin/localizedFormat'\n\ndayjs.extend(LocalizedFormat)\n\ntype TimeConfig = {\n locale?: string\n longFormat?: string\n shortFormatCurrentYear?: string\n shortFormatPastYear?: string\n daysSuffix?: string\n hoursSuffix?: string\n minutesSuffix?: string\n momentsAgo?: string\n}\n\nconst TimeUtils = {\n SHORT_FORMAT_CURRENT_YEAR: 'L',\n SHORT_FORMAT_PAST_YEAR: 'LL',\n LONG_FORMAT: 'LL, LT',\n\n timeAgo(timestamp: number, config: TimeConfig = {}) {\n const {\n locale = 'en',\n shortFormatCurrentYear = this.SHORT_FORMAT_CURRENT_YEAR,\n shortFormatPastYear = this.SHORT_FORMAT_PAST_YEAR,\n daysSuffix = 'd',\n hoursSuffix = 'h',\n minutesSuffix = 'm',\n momentsAgo = 'moments ago',\n } = config\n const now = dayjs()\n const date = dayjs(timestamp * 1000)\n date.locale(locale)\n const diffMinutes = now.diff(date, 'minute')\n const diffHours = now.diff(date, 'hour')\n const diffDays = now.diff(date, 'day')\n\n if (diffDays > 1) {\n if (date.isSame(now, 'year')) {\n return date.format(shortFormatCurrentYear)\n } else {\n return date.format(shortFormatPastYear)\n }\n } else if (diffDays === 1) {\n return `${diffDays}${daysSuffix}`\n } else if (diffHours > 0 && diffHours <= 23) {\n return `${diffHours}${hoursSuffix}`\n } else if (diffMinutes > 0 && diffMinutes <= 59) {\n return `${diffMinutes}${minutesSuffix}`\n } else {\n return momentsAgo\n }\n },\n\n formatTime(timestamp: number, config: TimeConfig = {}) {\n const {\n locale = 'en',\n shortFormatCurrentYear = this.SHORT_FORMAT_CURRENT_YEAR,\n shortFormatPastYear = this.SHORT_FORMAT_PAST_YEAR,\n } = config\n const date = dayjs(timestamp * 1000)\n date.locale(locale)\n if (date.isSame(dayjs(), 'year')) {\n return date.format(shortFormatCurrentYear)\n } else {\n return date.format(shortFormatPastYear)\n }\n },\n\n formatTimeLong(timestamp: number, config: TimeConfig = {}) {\n const { locale = 'en', longFormat = this.LONG_FORMAT } = config\n const date = dayjs(timestamp * 1000)\n date.locale(locale)\n return date.format(longFormat)\n },\n}\n\nexport { TimeUtils, TimeConfig }\n","import * as React from 'react'\n\nimport { Tooltip } from '../../tooltip'\nimport { TimeUtils, TimeConfig } from './time-utils'\n\nimport './time.less'\n\nconst DELAY = 60000\n\ntype Props = {\n /** UNIX timestamp of the time to display. */\n time?: number\n /** Configuration for localization. */\n config?: TimeConfig\n /** Additional css class applied to the time element. */\n className?: string\n tooltipOnHover?: boolean\n /** Refresh the component every DELAY seconds. */\n refresh?: boolean\n /** If you don't want to use the default time format on the tooltip use this prop to supply a custom text */\n tooltip?: React.ReactNode\n /** When hovering over time it expands to short absolute version. */\n expandOnHover?: boolean\n /** When hovering over time it expands to the full absolute version. */\n expandFullyOnHover?: boolean\n}\n\ntype State = {\n hovered: boolean\n mouseX?: number\n mouseY?: number\n}\n\nclass Time extends React.Component<Props, State> {\n public static displayName: string\n public static defaultProps: Props\n\n constructor(props: Props) {\n super(props)\n this.refreshInterval = undefined\n\n this.state = {\n hovered: false,\n mouseX: undefined,\n mouseY: undefined,\n }\n }\n\n componentDidMount() {\n if (this.props.refresh) {\n this._refresh()\n }\n }\n\n componentDidUpdate(prevProps: Props) {\n if (!prevProps.refresh && this.props.refresh) {\n this._refresh()\n }\n\n if (prevProps.refresh && !this.props.refresh) {\n if (this.refreshInterval) {\n clearTimeout(this.refreshInterval)\n }\n }\n }\n\n componentWillUnmount() {\n if (this.refreshInterval) {\n clearTimeout(this.refreshInterval)\n }\n }\n\n refreshInterval?: ReturnType<typeof setTimeout>\n\n _setHovered(hovered: boolean, event: React.MouseEvent) {\n const { mouseX, mouseY } = this.state\n const { clientX, clientY } = event\n if (clientX !== mouseX || clientY !== mouseY) {\n // mouse has moved\n this.setState(() => ({\n hovered,\n mouseX: clientX,\n mouseY: clientY,\n }))\n }\n }\n\n _renderTime(config: Props['config']) {\n if (!this.props.time) {\n return\n }\n if (this.state.hovered) {\n if (this.props.expandFullyOnHover && !this.props.tooltipOnHover) {\n return TimeUtils.formatTimeLong(this.props.time, config)\n }\n if (this.props.expandOnHover && !this.props.tooltipOnHover) {\n return TimeUtils.formatTime(this.props.time, config)\n }\n }\n return TimeUtils.timeAgo(this.props.time, config)\n }\n\n _refresh() {\n this.refreshInterval = setInterval(() => {\n this.forceUpdate()\n }, DELAY)\n }\n\n render() {\n let className = 'reactist_time'\n if (this.props.className) {\n className = this.props.className\n }\n\n const timeComponent = this._renderTime(this.props.config)\n\n return (\n <time\n className={className}\n onMouseEnter={(event) => this._setHovered(true, event)}\n onMouseLeave={(event) => this._setHovered(false, event)}\n >\n {this.props.tooltipOnHover ? (\n <Tooltip\n content={\n this.props.tooltip ||\n (this.props.time &&\n TimeUtils.formatTimeLong(this.props.time, this.props.config))\n }\n >\n <span>{timeComponent}</span>\n </Tooltip>\n ) : (\n timeComponent\n )}\n </time>\n )\n }\n}\nTime.displayName = 'Time'\n\nTime.defaultProps = {\n expandOnHover: false,\n expandFullyOnHover: false,\n tooltipOnHover: false,\n refresh: true,\n config: {\n locale: 'en',\n daysSuffix: 'd',\n hoursSuffix: 'h',\n minutesSuffix: 'm',\n momentsAgo: 'moments ago',\n },\n}\n\nexport { Time }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport './input.less'\n\ninterface Props extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string\n}\n\n/**\n * @deprecated\n */\nconst Input = React.forwardRef<HTMLInputElement, Props>(function Input(props, ref) {\n const className = classNames('reactist_input', props.className)\n return <input {...props} className={className} ref={ref} />\n})\nInput.displayName = 'Input'\n\nexport { Input }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport './select.less'\n\ntype Option = {\n /** Optional key for each option. If not provided `value` is used. */\n key?: string | number\n /** Value of the option. */\n value: string | number\n /** Text to display for the option. */\n text?: string | number\n /** Whether the options is disabled or not. */\n disabled?: boolean\n}\n\ntype Props = {\n className?: string\n disabled?: boolean\n /** Currently selected value. */\n value?: string | number\n /** Callback for the change event. Will be called with the next value (not the full event). */\n onChange?: (value: string) => void\n /** Options that are rendered in the select. */\n options?: Option[]\n /** Value to initially be set */\n defaultValue?: string | number\n}\n\nfunction Select({\n value,\n options = [],\n onChange,\n disabled = true,\n className = '',\n defaultValue,\n ...otherProps\n}: Props) {\n const selectClassName = classNames('reactist_select', { disabled }, className)\n return (\n <select\n className={selectClassName}\n value={value}\n onChange={(event) => (onChange ? onChange(event.target.value) : undefined)}\n disabled={disabled}\n defaultValue={defaultValue}\n {...otherProps}\n >\n {options?.map((option) => (\n <option\n key={option.key || option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n ))}\n </select>\n )\n}\nSelect.displayName = 'Select'\nSelect.defaultProps = {\n options: [],\n disabled: false,\n}\n\nexport { Select }\n","import * as React from 'react'\n\nimport { Box } from '../box'\n\nimport styles from './badge.module.css'\n\ntype BadgeTone = 'info' | 'positive' | 'promote' | 'attention' | 'warning'\n\ntype BadgeProps = {\n /**\n * The label to show inside the badge element.\n */\n label: string\n /**\n * The tone of the badge.\n */\n tone: BadgeTone\n}\n\nfunction Badge({ tone, label, ...props }: BadgeProps) {\n return (\n <Box\n {...props}\n as=\"span\" // It enables putting the badge inside a button (https://stackoverflow.com/a/12982334)\n display=\"inline\"\n className={[styles.badge, styles[`badge-${tone}`]]}\n >\n {label}\n </Box>\n )\n}\n\nexport { Badge }\nexport type { BadgeProps }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport { Columns, Column } from '../columns'\nimport { AlertIcon } from '../icons/alert-icon'\n\nimport type { AlertTone } from '../utils/common-types'\n\nimport styles from './notice.module.css'\n\ntype NoticeProps = {\n id?: string\n children: React.ReactNode\n tone: AlertTone\n}\n\nfunction Notice({ id, children, tone }: NoticeProps) {\n return (\n <Box\n id={id}\n role=\"alert\"\n aria-live=\"polite\"\n className={[styles.container, getClassNames(styles, 'tone', tone)]}\n >\n <Columns space=\"small\" alignY=\"top\">\n <Column width=\"content\">\n <AlertIcon tone={tone} className={styles.icon} />\n </Column>\n <Column>\n <Box className={styles.content}>{children}</Box>\n </Column>\n </Columns>\n </Box>\n )\n}\n\nexport { Notice }\nexport type { NoticeProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport styles from './prose.module.css'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ninterface ProseProps extends ObfuscatedClassName {\n /**\n * The prose content.\n *\n * This must consist of React nodes and elements. It is the consumer’s responsibility to\n * generate this from other sources, such as converting raw markdown content to React elements,\n * etc.\n *\n * Alternatively, you can use `<Prose dangerouslySetInnerHTML={{ __html: htmlString }}` />`\n * instead.\n */\n children?: React.ReactNode\n\n /**\n * Sets the prose content to be raw HTML stored in a string value.\n *\n * Warning: be advised that setting HTML content in this way is risky, because you can\n * inadvertently be vulnerable to a cross-site scripting (XSS) attack. Make sure you only use\n * this option with HTML content that has been sanitized (especially if it comes from user\n * provided content) or content that you fully control how it's generated, that cannot possibly\n * have any XSS content in it.\n *\n * @see https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml\n */\n dangerouslySetInnerHTML?: { __html: string } | undefined\n\n /**\n * Whether to customize the typography styles for dark mode.\n *\n * Applies finessed optimizations since our eyes perceive space differently when looking at dark\n * text on a light background and light text on a dark background.\n *\n * This does not apply a dark theme on the text. That's still the consumer apps’ responsibility.\n */\n darkModeTypography: boolean\n}\n\n/**\n * Used to style HTML you don’t control, like HTML content generated from Markdown.\n */\nfunction Prose({ darkModeTypography, exceptionallySetClassName, ...props }: ProseProps) {\n return (\n <Box\n {...props}\n className={[\n styles.prose,\n darkModeTypography ? styles.darkModeTypography : null,\n exceptionallySetClassName,\n ]}\n />\n )\n}\n\nexport { Prose }\nexport type { ProseProps }\n"],"names":["polymorphicComponent","render","React","forwardRef","getClassNames","styles","property","value","classList","push","mobile","tablet","desktop","mapResponsiveProp","fromValue","mapper","undefined","getBoxClassNames","position","display","flexDirection","flexWrap","flexGrow","flexShrink","gap","alignItems","justifyContent","alignSelf","overflow","width","height","background","border","borderRadius","minWidth","maxWidth","textAlign","padding","paddingY","paddingX","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginY","marginX","marginTop","marginRight","marginBottom","marginLeft","className","_ref","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","resolvedPaddingTop","resolvedPaddingRight","resolvedPaddingBottom","resolvedPaddingLeft","resolvedMarginTop","resolvedMarginRight","resolvedMarginBottom","resolvedMarginLeft","omitFlex","classNames","box","widthStyles","String","paddingStyles","marginStyles","gapStyles","Box","_ref9","ref","as","component","children","props","_objectWithoutProperties","_excluded","createElement","Column","exceptionallySetClassName","replace","Columns","space","align","alignY","collapseBelow","_excluded2","container","Divider","weight","_objectSpread","Inline","Stack","dividers","Children","map","flattenChildren","child","index","Fragment","Hidden","hiddenOnPrint","print","hiddenOnDesktop","hiddenOnMobile","hiddenOnTablet","below","above","console","warn","HiddenVisually","uid","generateElementId","prefix","useId","providedId","useRef","current","Spinner","size","viewBox","fill","fillRule","d","TooltipContext","createContext","showTimeout","hideTimeout","Tooltip","content","gapSize","withArrow","globalShowTimeout","globalHideTimeout","useContext","tooltip","useTooltipStore","placement","isOpen","useState","only","Error","TooltipAnchor","store","AriakitTooltip","gutter","TooltipArrow","preventDefault","event","Button","variant","tone","shape","type","disabled","loading","onClick","startIcon","endIcon","isDisabled","buttonElement","Role","button","aria-disabled","baseButton","aria-hidden","label","IconButton","icon","iconButton","tooltipContent","CloseIcon","xmlns","bannerIconForType","info","clipRule","upgrade","experiment","warning","error","success","BannerIcon","Icon","data-testid","TextLink","openInNewTab","color","underline","target","rel","Banner","id","title","description","action","image","inlineLinks","closeLabel","onClose","titleId","descriptionId","closeButton","aria-label","role","aria-describedby","aria-live","tabIndex","key","length","ActionButton","ActionLink","_excluded3","_excluded4","sizeMapping","xsmall","small","medium","large","alertIconForTone","positive","caution","critical","AlertIcon","Text","lineClamp","lineClampMultipleLines","Number","text","toString","StaticToast","message","onDismiss","dismissLabel","ToastContentSlot","isActionObject","animate","element","transforms","transition","done","fallbackTimeout","setTimeout","forEach","from","style","setProperty","addEventListener","transitionEndHandler","removeEventListener","clearTimeout","window","requestAnimationFrame","to","InternalToast","autoDismissDelay","showDismissButton","toastId","onRemoveToast","timeoutRunning","setTimeoutRunning","Boolean","timeoutRef","startTimeout","useCallback","stopTimeout","removeToast","useEffect","actionWithCustomActionHandler","useMemo","onMouseEnter","onMouseLeave","ToastsContext","useToasts","Heading","level","headingElementName","parseInt","heading","svgPath","checked","unchecked","mixed","filled","CheckboxIcon","indeterminate","pathKey","getPathKey","CheckboxField","_props$checked","_props$checked2","defaultChecked","onChange","keyFocused","setKeyFocused","checkedState","setChecked","isChecked","internalRef","combinedRef","refs","some","setRef","useForkRef","aria-checked","defaultPrevented","currentTarget","onBlur","onKeyUp","PasswordVisibleIcon","stroke","cx","cy","r","PasswordHiddenIcon","transform","x","y","rx","fieldToneToTextTone","FieldMessage","FieldCharacterCount","validateInputLength","maxLength","count","currentLength","BaseField","auxiliaryLabel","hidden","originalAriaDescribedBy","originalId","characterCountPosition","messageId","inputLength","characterCount","setCharacterCount","characterCountTone","setCharacterCountTone","ariaDescribedBy","renderCharacterCount","childrenProps","aria-invalid","characterCountElement","htmlFor","TextField","startSlot","endSlot","originalOnChange","useMergeRefs","handleClick","_internalRef$current","focus","extraProps","readOnly","PasswordField","togglePasswordLabel","isPasswordVisible","setPasswordVisible","v","SelectField","SelectChevron","SwitchField","originalAriaLabel","aria-labelledby","originalAriaLabelledby","ariaLabel","ariaLabelledBy","TextArea","rows","autoExpand","disableResize","containerRef","textAreaClassName","containerElement","handleAutoExpand","dataset","replicatedValue","handleInput","textAreaElement","getInitials","name","_initials","seed","trim","split","firstInitial","lastInitial","initials","toUpperCase","emailToIndex","email","maxIndex","charCodeAt","AVATAR_COLORS","Avatar","user","avatarUrl","colorList","userInitials","avatarSize","backgroundImage","textIndent","backgroundColor","sizeClassName","avatar","displayName","ModalContext","isNotInternalFrame","ownerDocument","document","tagName","toLowerCase","ModalCloseButton","includeInTabOrder","setIncludeInTabOrder","isMounted","setIsMounted","ModalBody","ModalFooter","withDivider","TabsContext","Tab","tabContextValue","tabStore","tab","BaseTab","TabPanel","renderMode","tabRendered","setTabRendered","tabIsActive","BaseTabPanel","tabId","MenuContext","menuStore","handleItemSelect","getAnchorRect","setAnchorRect","SubMenuContext","isSubMenu","Menu","onItemSelect","anchorRect","useMenuStore","focusLoop","Provider","MenuButton","AriakitMenuButton","ContextMenuTrigger","handleContextMenu","clientX","clientY","show","div","onContextMenu","MenuList","modal","flip","Portal","preserveTabOrder","AriakitMenu","shift","MenuItem","onSelect","hideOnSelect","_excluded5","hide","shouldClose","AriakitMenuItem","hideOnClick","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","list","toArray","subMenuContextValue","MenuGroup","_excluded6","AriakitMenuGroup","reactist_button--loading","defaultProps","Component","constructor","context","super","this","_timeout","_handleClickOutside","dropdownDOMNode","ReactDOM","findDOMNode","contains","_toggleShowBody","allowBodyInteractions","state","showBody","onHideBody","onShowBody","setState","_setPosition","body","scrollingParent","getElementById","scrolling_parent","dropdown","dropdownVerticalPosition","offsetTop","dropdownTrigger","querySelector","top","clientHeight","scrollTop","componentWillUnmount","_getTriggerComponent","_this$props$children","_trigger","cloneElement","_getBodyComponent","right","setPosition","body_wrapper","with_arrow","bottom","contentMarkup","Trigger","stopPropagation","Body","left","Dropdown","COLORS","_isNamedColor","ColorPicker","DeprecatedDropdown","colorIndex","_getColor","classnames","reduce","items","currentColor","currentIndex","ColorItem","isActive","item","globalTranslateKey","translateKeyMac","KeyboardShortcut","_navigator$platform$t","_navigator$platform","translateKey","isMac","navigator","platform","includes","shortcuts","reactist_keyboard_shortcut--macos","shortcut","i","t","_hasModifiers","test","str","isSpecialKey","charAt","slice","capitalize","parseKeys","j","setTranslateKey","tr","KeyCapturerResolver","resolveByKey","eventKey","resolveByKeyCode","keyCode","keyEventHandlerMapping","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Backspace","Escape","keyPropagatePropMapping","ProgressBar","fillPercentage","aria-valuetext","ariaValuetext","finalClassName","max","dayjs","extend","LocalizedFormat","TimeUtils","SHORT_FORMAT_CURRENT_YEAR","SHORT_FORMAT_PAST_YEAR","LONG_FORMAT","timeAgo","timestamp","config","locale","shortFormatCurrentYear","shortFormatPastYear","daysSuffix","hoursSuffix","minutesSuffix","momentsAgo","now","date","diffMinutes","diff","diffHours","diffDays","isSame","format","formatTime","formatTimeLong","longFormat","Time","refreshInterval","hovered","mouseX","mouseY","componentDidMount","refresh","_refresh","componentDidUpdate","prevProps","_setHovered","_renderTime","time","expandFullyOnHover","tooltipOnHover","expandOnHover","setInterval","forceUpdate","timeComponent","Input","Select","options","defaultValue","otherProps","selectClassName","option","badge","eventName","composingRef","[object Object]","propagateEvent","eventHandler","which","onEnter","onCompositionStart","onCompositionEnd","_sizeMapping$size","numericSize","exceptionallySetOverlayClassName","autoFocus","hideOnEscape","hideOnInteractOutside","portalElement","onKeyDown","setOpen","visible","useDialogStore","open","contextValue","portalRef","dialogRef","backdropRef","handleBackdropClick","_dialogRef$current","_backdropRef$current","useLayoutEffect","hideOthers","handleKeyDown","data-overlay","overlay","onPointerDown","FocusLock","whiteList","returnFocus","crossFrame","Dialog","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","portal","backdrop","headerContent","buttonContainer","darkModeTypography","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","ARROW_LEFT","ENTER","BACKSPACE","ESCAPE","selectedId","BaseTabList","TabList","track","defaultSelectedId","onSelectedIdChange","useTabStore","setSelectedId","actualSelectedId","memoizedTabState","showToast","propsRef","defaultAutoDismissDelay","defaultDismissLabel","containerClassName","toasts","setToasts","mappedRef","animateRemove","Map","positions","animations","Array","entries","delete","prevTop","get","getBoundingClientRect","set","onAnimationDone","useToastsAnimation","findIndex","n","copy","splice","newToast"],"mappings":"6xDA2LA,SAASA,EAIPC,GACE,OAAOC,EAAMC,WAAWF,GC7J5B,SAASG,EACLC,EACAC,EACAC,GAEA,IAAKA,EACD,OAAO,KAGX,MAAMC,EAAuC,GAe7C,MAbqB,iBAAVD,EACPC,EAAUC,KAAKJ,EAAUC,EAAJ,IAAgBC,KAE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InB,CAACf,IAGCR,EAAY1sB,EAAK,QAAC6Q,aACpB,SAAmB7L,GACf,MAAMsL,EAAUhJ,EAAkB,SAC5B6mB,EAAQnoB,EAAAA,EAAA,CACVoK,iBAAkBwc,EAClB9d,aAAc+d,GACX7nB,GAHO,GAAA,CAIVsL,QAAAA,IAGJ,OADA0c,EAAWjP,GAAS,IAAIA,EAAMoQ,IACvB,IAAMpd,EAAYT,KAE7B,CAACsc,EAAyBC,EAAqB9b,IAGnD,OACI/Q,wBAACqR,GAAc6K,SAAS,CAAA7b,MAAOqsB,GAC1B3nB,EACD/E,EAAC,QAAAmF,cAAA4X,EAAAA,YACsB,IAAlBgQ,EAAOzf,OAAe,KACnBtN,UAAAmF,cAACT,EACG,CAAAzB,UAAW,aAA2B6pB,GACtC9rB,SAAS,QACTW,MAAM,OACNU,SAAUF,EACVK,cAAeL,gBACH,oBAEZnC,EAAC,QAAAmF,cAAAe,EAAM,CAAAV,MAAM,UACRunB,EAAO1mB,IAAInD,IAAA,IAACoN,QAAEA,GAAHpN,EAAe8B,EAAfC,EAAA/B,EAAAgC,IAAA,OACRlF,UAAAmF,cAACgL,GAADnK,EAAA,CACIqH,IAAKiD,EACL1L,IAAKqoB,EAAU3c,GACfA,QAASA,EACTC,cAAeQ,GACX/L,sDX1OxC,UAAyBoD,YACrBA,EAduB,IAaFC,YAErBA,EAduB,IAYFtD,SAGrBA,IAKA,MAAM1E,EAAQL,EAAMkR,QAAQ,KAAO,CAAE9I,YAAAA,EAAaC,YAAAA,IAAgB,CAACD,EAAaC,IAChF,OAAOrI,EAAAmF,cAAC+C,GAAegU,SAAQ,CAAC7b,MAAOA,GAAQ0E"}
1
+ {"version":3,"file":"reactist.cjs.production.min.js","sources":["../src/utils/polymorphism.ts","../src/utils/responsive-props.ts","../src/box/box.tsx","../src/columns/columns.tsx","../src/divider/divider.tsx","../src/inline/inline.tsx","../src/stack/stack.tsx","../src/hidden/hidden.tsx","../src/hidden-visually/hidden-visually.tsx","../src/utils/common-helpers.ts","../src/spinner/spinner.tsx","../src/tooltip/tooltip.tsx","../src/button/button.tsx","../src/icons/close-icon.tsx","../src/icons/banner-icon.tsx","../src/text-link/text-link.tsx","../src/banner/banner.tsx","../src/loading/loading.tsx","../src/icons/alert-icon.tsx","../src/text/text.tsx","../src/toast/static-toast.tsx","../src/toast/toast-animation.ts","../src/toast/use-toasts.tsx","../src/heading/heading.tsx","../src/checkbox-field/checkbox-icon.tsx","../src/checkbox-field/checkbox-field.tsx","../src/checkbox-field/use-fork-ref.ts","../src/icons/password-visible-icon.tsx","../src/icons/password-hidden-icon.tsx","../src/base-field/base-field.tsx","../src/text-field/text-field.tsx","../src/password-field/password-field.tsx","../src/select-field/select-field.tsx","../src/switch-field/switch-field.tsx","../src/text-area/text-area.tsx","../src/avatar/utils.ts","../src/avatar/avatar.tsx","../src/modal/modal.tsx","../src/tabs/tabs.tsx","../src/menu/menu.tsx","../src/components/deprecated-button/deprecated-button.tsx","../src/components/deprecated-dropdown/dropdown.tsx","../src/components/color-picker/color-picker.tsx","../src/components/keyboard-shortcut/keyboard-shortcut.tsx","../src/components/key-capturer/key-capturer.tsx","../src/components/progress-bar/progress-bar.tsx","../src/components/time/time-utils.ts","../src/components/time/time.tsx","../src/components/deprecated-input/input.tsx","../src/components/deprecated-select/select.tsx","../src/badge/badge.tsx","../src/notice/notice.tsx","../src/prose/prose.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as React from 'react'\nimport type { ObfuscatedClassName } from './common-types'\n\ntype Merge<P1, P2> = Omit<P1, keyof P2> & P2\n\ntype EmptyObject = {\n [K in any]: never\n}\n\ntype ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName'\n\n/**\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This can be customized via the second generic parameter, as there are cases where it may be\n * needed to omit this behaviour and keep the `className`. You can also instruct it to remove the\n * `className` prop while not replacing it with the `exceptionallySetClassName` one.\n *\n * @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop\n * @see PolymorphicComponent for details about this feature\n */\ntype WithObfuscatedClassName<\n Props,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = 'className' extends keyof Props\n ? ShouldObfuscateClassName extends 'obfuscateClassName'\n ? Omit<Props, 'className'> & ObfuscatedClassName\n : ShouldObfuscateClassName extends 'omitClassName'\n ? Omit<Props, 'className'>\n : ShouldObfuscateClassName extends 'keepClassName'\n ? Props\n : never\n : Props\n\ntype PolymorphicProp<ComponentType extends React.ElementType> = {\n /**\n * Used to instruct this component what React element to render as. It can be both a string\n * representing a HTML tag name, or a React component.\n *\n * When using this prop, the component you apply it to will also recognize in its props types\n * all the props from the component or HTML element you are rendering it as.\n *\n * Some uses for this feature:\n *\n * - Using some of our layout components, while at the same time being able to set them to use\n * semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).\n * - Using a design system link component, but have it internally use a client-side router link\n * implemented via a React component (e.g. react-router's `Link`).\n *\n * Keep in mind that not all compositions of this kind may work well, especially when composing\n * with another React component and not with a HTML tag name. In particular, if the components\n * being composed have opposing concerns of clashing features (e.g. they have contradicting\n * styles applied to them) things may not go well. In those cases prefer to nest them instead.\n *\n * @see PolymorphicComponent\n */\n as?: ComponentType\n}\n\n/**\n * Given a component or element type, and a set of additional props, this builds the entire set of\n * props for a polymorphic component.\n *\n * It does three things:\n *\n * 1. it merges the element type props with the `OwnProps`\n * 2. it adds the `as` prop to allow for polymorphism to happen\n * 3. it optionally obfuscates or omits the className prop if present\n *\n * @see PolymorphicProp\n * @see WithObfuscatedClassName\n */\ntype PolymorphicComponentProps<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = Merge<\n WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>,\n OwnProps & PolymorphicProp<ComponentType>\n>\n\ntype ElementTagNameMap = HTMLElementTagNameMap &\n Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>\n\ntype ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName]\n\ntype ElementByTagOrAny<\n ComponentType extends React.ElementType\n> = ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any\n\n/**\n * The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via\n * the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.\n *\n * @see PolymorphicComponentProps\n * @see WithObfuscatedClassName\n */\ninterface ForwardRefFunction<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> {\n (\n props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>,\n ref:\n | ((instance: ElementByTagOrAny<ComponentType> | null) => void)\n | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null>\n | null,\n ): React.ReactElement | null\n displayName?: string\n}\n\n/**\n * A component that can customize the React element type that it renders (a.k.a. a polymorphic\n * component). This is achieved by passing a prop `as={ElementType}` or `as=\"html-tag-name\"`.\n *\n * It transparently takes care of forwarding refs, and properly sets the ref type depending on the\n * element type.\n *\n * ## Recognizing props based on the polymorphic type\n *\n * The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop\n * component or HTML element is, the type system will automatically allow you to pass props that are\n * not explicitly defined by you, but that are recognized as valid props to be passed to the\n * component you are rendering.\n *\n * For instance, see the following example:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor=\"field-id\">Hello</Box>\n * ```\n *\n * The `htmlFor` prop is exclusive to label elements. If you omit the `as=\"label\"` prop, the type\n * system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of\n * an incorrect type to such prop. For instance, the example below will issue a type error:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor={123}>Hello</Box>\n * ```\n *\n * ## Omitting or obfuscating the `className` prop\n *\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This is to discourage customizing design system components via custom styling, while still\n * leaving the door open to do it as an escape hatch when the design system still has shortcomings\n * with respect to the product designs we want to achieve.\n *\n * The cumbersome name also serves the purpose of aiding in easily searching for the places in the\n * code where this escape hatch was needed, in order to identify areas where the design system\n * components need to improve to better match our needs.\n *\n * This behaviour can be customized via an optional second generic argument that allows to disable\n * this feature, or to omit the `className` altogether without replacing it with the obfuscated prop\n * name.\n *\n * @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)\n */\ninterface PolymorphicComponent<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n> {\n <TT extends React.ElementType = ComponentType>(\n props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>,\n ): React.ReactElement | null\n readonly $$typeof: symbol\n defaultProps?: Partial<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n propTypes?: React.WeakValidationMap<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n displayName?: string\n}\n\n/**\n * A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a\n * convenience over merely using React.forwardRef directly, and then manually forcing the resulting\n * value to be typed using `as PolymorphicComponent<…>`.\n *\n * @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)\n */\nfunction polymorphicComponent<\n ComponentType extends React.ElementType = 'div',\n OwnProps = EmptyObject,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>) {\n return React.forwardRef(render) as PolymorphicComponent<\n ComponentType,\n OwnProps,\n ShouldObfuscateClassName\n >\n}\n\nexport type { PolymorphicComponent }\nexport { polymorphicComponent }\n","type ResponsiveBreakpoints = 'mobile' | 'tablet' | 'desktop'\n\ntype Atom = string | number | boolean\n\n/**\n * A responsive prop supports receiving values of its given base type, or an object mapping a\n * responsive breakpoint name to a value from the prop's base type.\n *\n * Some examples:\n *\n * - `align={{ mobile: 'left', tablet: 'center', desktop: 'right' }}`\n */\ntype ResponsiveProp<AtomType extends Atom> =\n | AtomType\n | Readonly<{ [key in ResponsiveBreakpoints]?: AtomType }>\n\nconst DEBUG = process.env.NODE_ENV === 'development'\n\n/**\n * Builds a css module class name for a given prop + prop-value combination.\n *\n * We have a convention of building the internal utility-based class names system in a way that\n * resembles the prop for which it is used and the value of the prop. For instance, in a component\n * with a prop `width` with possible values `narrow` and `wide`, we encode the styles for each of\n * these alternatives in the class-names `.width-narrow` and `.width-wide`.\n *\n * Furthermore, this helper is aware of responsive prop values. For instance, if you provide the\n * `width` prop above with the value `['narrow', 'wide']` this returns `['narrow', 'tablet-wide']`.\n * That is, it returns an array of class names, following the same convention above, but also\n * prefixing by the viewport width variant (`tablet-` or `desktop-`).\n *\n * @param styles the class names mapping imported from a css module\n * @param property the prop name\n * @param value the given prop's value\n */\nfunction getClassNames(\n styles: Record<string, string>,\n property: string,\n value: ResponsiveProp<string> | null | undefined,\n): Array<string | undefined> | null {\n if (!value) {\n return null\n }\n\n const classList: Array<string | undefined> = []\n\n if (typeof value === 'string') {\n classList.push(styles[`${property}-${value}`])\n } else {\n if (value.mobile) classList.push(styles[`${property}-${value.mobile}`])\n if (value.tablet) classList.push(styles[`tablet-${property}-${value.tablet}`])\n if (value.desktop) classList.push(styles[`desktop-${property}-${value.desktop}`])\n }\n\n if (DEBUG && !classList.every(Boolean)) {\n // eslint-disable-next-line no-console\n console.warn('Not all generated class names were found', { property, value, classList })\n }\n\n return classList\n}\n\n/**\n * A mapping over a responsive prop value.\n *\n * Since response values can be an object but also a scalar value, this helper makes it easier to\n * to map the values when it's an object but keeps it consistent for the case when it is a scalar\n * value as well.\n *\n * @param fromValue the responsive prop value\n * @param mapper the mapping function\n */\nfunction mapResponsiveProp<From extends Atom, To extends Atom>(\n fromValue: ResponsiveProp<From> | undefined,\n mapper: (from: From) => To,\n): ResponsiveProp<To> | undefined {\n if (!fromValue) {\n return undefined\n }\n\n if (typeof fromValue !== 'object') {\n return mapper(fromValue)\n }\n\n return {\n mobile: fromValue.mobile ? mapper(fromValue.mobile) : undefined,\n tablet: fromValue.tablet ? mapper(fromValue.tablet) : undefined,\n desktop: fromValue.desktop ? mapper(fromValue.desktop) : undefined,\n }\n}\n\nexport type { ResponsiveProp, ResponsiveBreakpoints }\nexport { getClassNames, mapResponsiveProp }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { getClassNames } from '../utils/responsive-props'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type {\n DividerWeight,\n Space,\n SpaceWithNegatives,\n WithEnhancedClassName,\n} from '../utils/common-types'\n\nimport styles from './box.module.css'\nimport paddingStyles from './padding.module.css'\nimport marginStyles from './margin.module.css'\nimport widthStyles from './width.module.css'\nimport gapStyles from './gap.module.css'\n\ninterface BoxPaddingProps {\n padding?: ResponsiveProp<Space>\n paddingX?: ResponsiveProp<Space>\n paddingY?: ResponsiveProp<Space>\n paddingTop?: ResponsiveProp<Space>\n paddingRight?: ResponsiveProp<Space>\n paddingBottom?: ResponsiveProp<Space>\n paddingLeft?: ResponsiveProp<Space>\n}\n\ninterface BoxMarginProps {\n margin?: ResponsiveProp<SpaceWithNegatives>\n marginX?: ResponsiveProp<SpaceWithNegatives>\n marginY?: ResponsiveProp<SpaceWithNegatives>\n marginTop?: ResponsiveProp<SpaceWithNegatives>\n marginRight?: ResponsiveProp<SpaceWithNegatives>\n marginBottom?: ResponsiveProp<SpaceWithNegatives>\n marginLeft?: ResponsiveProp<SpaceWithNegatives>\n}\n\ntype BoxDisplay = 'block' | 'flex' | 'inline' | 'inlineBlock' | 'inlineFlex' | 'none'\ntype BoxFlexDirection = 'column' | 'row'\ntype BoxFlexWrap = 'nowrap' | 'wrap'\ntype BoxAlignItems = 'center' | 'flexEnd' | 'flexStart' | 'baseline'\ntype BoxJustifyContent =\n | 'center'\n | 'flexEnd'\n | 'flexStart'\n | 'spaceAround'\n | 'spaceBetween'\n | 'spaceEvenly'\ntype BoxAlignSelf = 'flexStart' | 'flexEnd' | 'center' | 'baseline' | 'stretch'\ntype BoxOverflow = 'hidden' | 'auto' | 'visible' | 'scroll'\n\ntype BoxMaxMinWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'\ntype BoxMinWidth = 0 | BoxMaxMinWidth\ntype BoxMaxWidth = BoxMaxMinWidth | 'full'\ntype BoxWidth = 0 | BoxMaxMinWidth | 'full' | 'auto' | 'maxContent' | 'minContent' | 'fitContent'\ntype BoxBackground = 'default' | 'aside' | 'highlight' | 'selected' | 'toast'\ntype BoxBorderRadius = 'standard' | 'none' | 'full'\n\ninterface BorderProps {\n borderRadius?: BoxBorderRadius\n border?: DividerWeight\n}\n\ninterface ReusableBoxProps extends BorderProps, BoxPaddingProps {\n minWidth?: BoxMinWidth\n maxWidth?: BoxMaxWidth\n width?: BoxWidth\n background?: BoxBackground\n flexGrow?: 0 | 1\n flexShrink?: 0\n}\n\ntype BoxPosition = 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'\ntype BoxTextAlign = 'start' | 'center' | 'end' | 'justify'\n\ninterface BoxProps extends WithEnhancedClassName, ReusableBoxProps, BoxMarginProps {\n position?: ResponsiveProp<BoxPosition>\n display?: ResponsiveProp<BoxDisplay>\n flexDirection?: ResponsiveProp<BoxFlexDirection>\n flexWrap?: BoxFlexWrap\n gap?: ResponsiveProp<Space | 'none'>\n alignItems?: ResponsiveProp<BoxAlignItems>\n alignSelf?: ResponsiveProp<BoxAlignSelf>\n justifyContent?: ResponsiveProp<BoxJustifyContent>\n overflow?: BoxOverflow\n height?: 'full'\n textAlign?: ResponsiveProp<BoxTextAlign>\n}\n\nfunction getBoxClassNames({\n position = 'static',\n display,\n flexDirection = 'row',\n flexWrap,\n flexGrow,\n flexShrink,\n gap,\n alignItems,\n justifyContent,\n alignSelf,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign,\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n}: BoxProps) {\n const resolvedPaddingTop = paddingTop ?? paddingY ?? padding\n const resolvedPaddingRight = paddingRight ?? paddingX ?? padding\n const resolvedPaddingBottom = paddingBottom ?? paddingY ?? padding\n const resolvedPaddingLeft = paddingLeft ?? paddingX ?? padding\n\n const resolvedMarginTop = marginTop ?? marginY ?? margin\n const resolvedMarginRight = marginRight ?? marginX ?? margin\n const resolvedMarginBottom = marginBottom ?? marginY ?? margin\n const resolvedMarginLeft = marginLeft ?? marginX ?? margin\n\n const omitFlex =\n !display || (typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex')\n\n return classNames(\n className,\n styles.box,\n display ? getClassNames(styles, 'display', display) : null,\n position !== 'static' ? getClassNames(styles, 'position', position) : null,\n minWidth != null ? getClassNames(widthStyles, 'minWidth', String(minWidth)) : null,\n getClassNames(widthStyles, 'maxWidth', maxWidth),\n getClassNames(styles, 'textAlign', textAlign),\n // padding\n getClassNames(paddingStyles, 'paddingTop', resolvedPaddingTop),\n getClassNames(paddingStyles, 'paddingRight', resolvedPaddingRight),\n getClassNames(paddingStyles, 'paddingBottom', resolvedPaddingBottom),\n getClassNames(paddingStyles, 'paddingLeft', resolvedPaddingLeft),\n // margin\n getClassNames(marginStyles, 'marginTop', resolvedMarginTop),\n getClassNames(marginStyles, 'marginRight', resolvedMarginRight),\n getClassNames(marginStyles, 'marginBottom', resolvedMarginBottom),\n getClassNames(marginStyles, 'marginLeft', resolvedMarginLeft),\n // flex props\n omitFlex ? null : getClassNames(styles, 'flexDirection', flexDirection),\n omitFlex ? null : getClassNames(styles, 'flexWrap', flexWrap),\n omitFlex ? null : getClassNames(styles, 'alignItems', alignItems),\n omitFlex ? null : getClassNames(styles, 'justifyContent', justifyContent),\n alignSelf != null ? getClassNames(styles, 'alignSelf', alignSelf) : null,\n flexShrink != null ? getClassNames(styles, 'flexShrink', String(flexShrink)) : null,\n flexGrow != null ? getClassNames(styles, 'flexGrow', String(flexGrow)) : null,\n gap ? getClassNames(gapStyles, 'gap', gap) : null,\n // other props\n getClassNames(styles, 'overflow', overflow),\n width != null ? getClassNames(widthStyles, 'width', String(width)) : null,\n getClassNames(styles, 'height', height),\n getClassNames(styles, 'bg', background),\n borderRadius !== 'none' ? getClassNames(styles, 'borderRadius', borderRadius) : null,\n border !== 'none' ? getClassNames(styles, 'border', border) : null,\n )\n}\n\nconst Box = polymorphicComponent<'div', BoxProps, 'keepClassName'>(function Box(\n {\n as: component = 'div',\n position = 'static',\n display,\n flexDirection = 'row',\n flexWrap,\n flexGrow,\n flexShrink,\n gap,\n alignItems,\n justifyContent,\n alignSelf,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign,\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n children,\n ...props\n },\n ref,\n) {\n return React.createElement(\n component,\n {\n ...props,\n className: getBoxClassNames({\n position,\n display,\n flexDirection,\n flexWrap,\n flexGrow,\n flexShrink,\n gap,\n alignItems,\n justifyContent,\n alignSelf,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign,\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n }),\n ref,\n },\n children,\n )\n})\n\nexport type {\n BoxProps,\n BoxPaddingProps,\n BoxMarginProps,\n ReusableBoxProps,\n BoxMinWidth,\n BoxMaxWidth,\n BoxDisplay,\n BoxPosition,\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxOverflow,\n BoxTextAlign,\n BoxBackground,\n BoxBorderRadius,\n}\n\nexport { Box, getBoxClassNames }\n","import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { getClassNames, mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp, ResponsiveBreakpoints } from '../utils/responsive-props'\nimport type { Space } from '../utils/common-types'\nimport type { ReusableBoxProps } from '../box'\n\nimport styles from './columns.module.css'\n\ntype ColumnWidth =\n | 'auto'\n | 'content'\n | '1/2'\n | '1/3'\n | '2/3'\n | '1/4'\n | '3/4'\n | '1/5'\n | '2/5'\n | '3/5'\n | '4/5'\n\ninterface ColumnProps {\n width?: ColumnWidth\n}\n\nconst Column = polymorphicComponent<'div', ColumnProps>(function Column(\n { width = 'auto', children, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n className={[\n exceptionallySetClassName,\n getClassNames(styles, 'columnWidth', width.replace('/', '-')),\n ]}\n minWidth={0}\n height=\"full\"\n flexShrink={width === 'content' ? 0 : undefined}\n flexGrow={width === 'auto' ? 1 : 0}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\ntype ColumnsHorizontalAlignment = 'left' | 'center' | 'right'\ntype ColumnsVerticalAlignment = 'top' | 'center' | 'bottom' | 'baseline'\ntype ColumnsCollapseBelow = Exclude<ResponsiveBreakpoints, 'mobile'>\n\ninterface ColumnsProps extends ReusableBoxProps {\n space?: ResponsiveProp<Space>\n align?: ResponsiveProp<ColumnsHorizontalAlignment>\n alignY?: ResponsiveProp<ColumnsVerticalAlignment>\n collapseBelow?: ResponsiveBreakpoints\n}\n\nconst Columns = polymorphicComponent<'div', ColumnsProps>(function Columns(\n {\n space,\n align = 'left',\n alignY = 'top',\n collapseBelow,\n children,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n return (\n <Box\n {...props}\n className={[\n exceptionallySetClassName,\n styles.container,\n getClassNames(styles, 'container', space),\n ]}\n display=\"flex\"\n gap={space}\n flexDirection={\n collapseBelow === 'desktop'\n ? { mobile: 'column', tablet: 'column', desktop: 'row' }\n : collapseBelow === 'tablet'\n ? { mobile: 'column', tablet: 'row' }\n : 'row'\n }\n alignItems={mapResponsiveProp(alignY, (alignY) =>\n alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : alignY,\n )}\n justifyContent={mapResponsiveProp(align, (align) =>\n align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : align,\n )}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type {\n ColumnProps,\n ColumnsProps,\n ColumnWidth,\n ColumnsCollapseBelow,\n ColumnsHorizontalAlignment,\n ColumnsVerticalAlignment,\n}\n\nexport { Column, Columns }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport type { DividerWeight } from '../utils/common-types'\n\nimport styles from './divider.module.css'\n\ninterface DividerProps {\n weight?: Exclude<DividerWeight, 'none'>\n}\n\nfunction Divider({ weight = 'tertiary', ...props }: DividerProps) {\n return <Box as=\"hr\" className={getClassNames(styles, 'weight', weight)} {...props} />\n}\n\nexport type { DividerProps, DividerWeight }\nexport { Divider }\n","import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type { Space } from '../utils/common-types'\nimport type { ReusableBoxProps } from '../box'\n\ntype InlineAlign = 'left' | 'center' | 'right'\n\ninterface InlineProps extends ReusableBoxProps {\n space?: ResponsiveProp<Space>\n align?: ResponsiveProp<InlineAlign>\n alignY?: ResponsiveProp<'top' | 'center' | 'bottom'>\n}\n\nconst Inline = polymorphicComponent<'div', InlineProps>(function Inline(\n { as, space, align = 'left', alignY = 'center', children, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"flex\"\n flexWrap=\"wrap\"\n gap={space}\n className={exceptionallySetClassName}\n ref={ref}\n alignItems={mapResponsiveProp(alignY, (alignY) =>\n alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center',\n )}\n justifyContent={mapResponsiveProp(align, (align) =>\n align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center',\n )}\n >\n {children}\n </Box>\n )\n})\n\nexport type { InlineProps, InlineAlign }\nexport { Inline }\n","import * as React from 'react'\nimport flattenChildren from 'react-keyed-flatten-children'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport { Divider } from '../divider'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type { DividerWeight, Space } from '../utils/common-types'\nimport type { BoxProps, ReusableBoxProps } from '../box'\n\ntype Align = 'start' | 'center' | 'end'\n\ninterface StackProps extends ReusableBoxProps {\n /** Space between items */\n space?: ResponsiveProp<Space>\n /** Align items horizontally */\n align?: ResponsiveProp<Align>\n /** The weight of the dividers to add. Defaults to 'none', which means no dividers are added */\n dividers?: DividerWeight\n}\n\nconst Stack = polymorphicComponent<'div', StackProps>(function Stack(\n {\n as,\n space,\n align,\n dividers = 'none',\n width = 'full',\n children,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const alignItems: BoxProps['alignItems'] =\n align === undefined\n ? undefined\n : mapResponsiveProp(align, (align) =>\n align === 'start' ? 'flexStart' : align === 'end' ? 'flexEnd' : 'center',\n )\n\n return (\n <Box\n {...props}\n display=\"flex\"\n flexDirection=\"column\"\n width={width}\n alignItems={alignItems}\n gap={space}\n as={as}\n className={exceptionallySetClassName}\n ref={ref}\n >\n {dividers !== 'none'\n ? React.Children.map(flattenChildren(children), (child, index) =>\n index > 0 ? (\n <>\n <Divider weight={dividers} />\n {child}\n </>\n ) : (\n child\n ),\n )\n : children}\n </Box>\n )\n})\n\nexport type { StackProps }\nexport { Stack }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport styles from './hidden.module.css'\nimport type { ResponsiveBreakpoints } from '../utils/responsive-props'\nimport { polymorphicComponent } from '../utils/polymorphism'\n\ntype AboveProp = {\n /**\n * Hides the element on viewport sizes equal or larger to the one given.\n *\n * It is not supported to pass it alongside `below`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see below\n */\n above: Exclude<ResponsiveBreakpoints, 'desktop'>\n below?: never\n}\n\ntype BelowProp = {\n /**\n * Hides the element on viewport sizes equal or smaller to the one given.\n *\n * It is not supported to pass it alongside `above`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see above\n */\n below: Exclude<ResponsiveBreakpoints, 'mobile'>\n above?: never\n}\n\ntype CommonProps = {\n children: React.ReactNode\n /**\n * hides the element when on print media.\n */\n print?: boolean\n /**\n * Useful if you want the element to be an inline element when it is visible.\n */\n display?: 'inline' | 'block'\n}\n\ntype HiddenProps = CommonProps & (AboveProp | BelowProp | Required<Pick<CommonProps, 'print'>>)\n\n/**\n * A component that allows to specify how to hide itself on certain responsive screen sizes, or on\n * print media.\n *\n * @see HiddenProps\n * @see HiddenVisually for hiding content only visually, while keeping it available for assistive\n * technologies.\n */\nconst Hidden = polymorphicComponent<'div', HiddenProps>(function Hidden(\n { display = 'block', children, exceptionallySetClassName, ...props },\n ref,\n) {\n const hiddenOnPrint = 'print' in props && props.print\n\n const hiddenOnDesktop = 'above' in props\n const hiddenOnMobile = 'below' in props\n const hiddenOnTablet =\n ('below' in props && props.below === 'desktop') ||\n ('above' in props && props.above === 'mobile')\n\n if (hiddenOnDesktop && hiddenOnMobile) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> should receive either above=\"…\" or below=\"…\" but not both')\n }\n\n if (!hiddenOnDesktop && !hiddenOnMobile && !hiddenOnPrint) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> did not receive any criteria to hide itself')\n }\n\n // We need to delete these so they do not get forwarded to the Box\n if ('above' in props) delete props['above']\n if ('below' in props) delete props['below']\n if ('print' in props) delete props['print']\n\n return (\n <Box\n {...props}\n ref={ref}\n className={[exceptionallySetClassName, hiddenOnPrint ? styles.hiddenOnPrint : null]}\n display={\n hiddenOnDesktop && hiddenOnMobile\n ? 'none'\n : {\n mobile: hiddenOnMobile ? 'none' : display,\n tablet: hiddenOnTablet ? 'none' : display,\n desktop: hiddenOnDesktop ? 'none' : display,\n }\n }\n >\n {children}\n </Box>\n )\n})\n\nexport { Hidden }\nexport type { HiddenProps }\n","import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { Box } from '../box'\nimport styles from './hidden-visually.module.css'\n\ntype Props = {\n children: React.ReactNode\n}\n\n/**\n * Provides content to assistive technologies while hiding it from the screen.\n *\n * @see Hidden for fully hiding content, and only under certain conditions.\n */\nconst HiddenVisually = polymorphicComponent<'div', Props, 'omitClassName'>(function HiddenVisually(\n props,\n ref,\n) {\n return (\n <Box\n {...props}\n ref={ref}\n position=\"absolute\"\n overflow=\"hidden\"\n className={styles.hiddenVisually}\n />\n )\n})\n\nexport { HiddenVisually }\n","import * as React from 'react'\n\nlet uid = 0\nfunction uniqueId() {\n return uid++\n}\n\nexport function generateElementId(prefix: string): string {\n const num = uniqueId()\n return `${prefix}-${num}`\n}\n\nexport function useId(providedId?: string): string {\n const ref = React.useRef<string | null>(providedId ?? null)\n if (!ref.current) {\n ref.current = generateElementId('element')\n }\n return ref.current\n}\n","import * as React from 'react'\nimport styles from './spinner.module.css'\n\nfunction Spinner({ size = 24 }: { size?: number }) {\n return (\n <svg\n aria-hidden\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n className={styles.svg}\n data-chromatic=\"ignore\"\n >\n <g fill=\"none\" fillRule=\"nonzero\">\n <path\n className={styles.tint}\n d=\"M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z\"\n />\n <path\n className={styles.fill}\n d=\"M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z\"\n />\n </g>\n </svg>\n )\n}\n\nexport { Spinner }\n","import * as React from 'react'\n\nimport {\n useTooltipStore,\n Tooltip as AriakitTooltip,\n TooltipAnchor,\n TooltipArrow,\n} from '@ariakit/react'\nimport { Box } from '../box'\n\nimport type { TooltipStoreState } from '@ariakit/react'\n\nimport styles from './tooltip.module.css'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nconst defaultShowTimeout = 500\nconst defaultHideTimeout = 100\n\ntype TooltipContextState = {\n showTimeout: number\n hideTimeout: number\n}\n\nconst TooltipContext = React.createContext<TooltipContextState>({\n showTimeout: defaultShowTimeout,\n hideTimeout: defaultHideTimeout,\n})\n\nfunction TooltipProvider({\n showTimeout = defaultShowTimeout,\n hideTimeout = defaultHideTimeout,\n children,\n}: React.PropsWithChildren<{\n showTimeout?: number\n hideTimeout?: number\n}>) {\n const value = React.useMemo(() => ({ showTimeout, hideTimeout }), [showTimeout, hideTimeout])\n return <TooltipContext.Provider value={value}>{children}</TooltipContext.Provider>\n}\n\ninterface TooltipProps extends ObfuscatedClassName {\n /**\n * The element that triggers the tooltip. Generally a button or link.\n *\n * It should be an interactive element accessible both via mouse and keyboard interactions.\n */\n children: React.ReactNode\n\n /**\n * The content to show in the tooltip.\n *\n * It can be rich content provided via React elements, or string content. It should not include\n * interactive elements inside it. This includes links or buttons.\n *\n * You can provide a function instead of the content itself. In this case, the function should\n * return the desired content. This is useful if the content is expensive to generate. It can\n * also be useful if the content dynamically changes often, so every time you trigger the\n * tooltip the content may have changed (e.g. if you show a ticking time clock in the tooltip).\n *\n * The trigger element will be associated to this content via `aria-describedby`. This means\n * that the tooltip content will be read by assistive technologies such as screen readers. It\n * will likely read this content right after reading the trigger element label.\n */\n content: React.ReactNode | (() => React.ReactNode)\n\n /**\n * How to place the tooltip relative to its trigger element.\n *\n * The possible values are \"top\", \"bottom\", \"left\", \"right\". Additionally, any of these values\n * can be combined with `-start` or `-end` for even more control. For instance `top-start` will\n * place the tooltip at the top, but with the start (e.g. left) side of the toolip and the\n * trigger aligned. If neither `-start` or `-end` are provided, the tooltip is centered along\n * the vertical or horizontal axis with the trigger.\n *\n * The position is enforced whenever possible, but tooltips can appear in different positions\n * if the specified one would make the tooltip intersect with the viewport edges.\n *\n * @default 'top'\n */\n position?: TooltipStoreState['placement']\n\n /**\n * The separation (in pixels) between the trigger element and the tooltip.\n * @default 3\n */\n gapSize?: number\n\n /**\n * Whether to show an arrow-like element attached to the tooltip, and pointing towards the\n * trigger element.\n * @default false\n */\n withArrow?: boolean\n\n /**\n * The amount of time in milliseconds to wait before showing the tooltip\n * Use `<TooltipContext.Provider>` to set a global value for all tooltips\n * @default 500\n */\n showTimeout?: number\n\n /**\n * The amount of time in milliseconds to wait before hiding the tooltip\n * Use `<TooltipContext.Provider>` to set a global value for all tooltips\n * @default 100\n */\n hideTimeout?: number\n}\n\nfunction Tooltip({\n children,\n content,\n position = 'top',\n gapSize = 3,\n withArrow = false,\n showTimeout,\n hideTimeout,\n exceptionallySetClassName,\n}: TooltipProps) {\n const { showTimeout: globalShowTimeout, hideTimeout: globalHideTimeout } = React.useContext(\n TooltipContext,\n )\n const tooltip = useTooltipStore({\n placement: position,\n showTimeout: showTimeout ?? globalShowTimeout,\n hideTimeout: hideTimeout ?? globalHideTimeout,\n })\n const isOpen = tooltip.useState('open')\n\n const child = React.Children.only(\n children as React.FunctionComponentElement<JSX.IntrinsicElements['div']> | null,\n )\n\n if (!child) {\n return child\n }\n\n if (typeof child.ref === 'string') {\n throw new Error('Tooltip: String refs cannot be used as they cannot be forwarded')\n }\n\n return (\n <>\n <TooltipAnchor render={child} store={tooltip} ref={child.ref} />\n {isOpen && content ? (\n <AriakitTooltip\n store={tooltip}\n gutter={gapSize}\n render={\n <Box\n className={[styles.tooltip, exceptionallySetClassName]}\n background=\"toast\"\n borderRadius=\"standard\"\n paddingX=\"small\"\n paddingY=\"xsmall\"\n maxWidth=\"medium\"\n width=\"fitContent\"\n overflow=\"hidden\"\n textAlign=\"center\"\n />\n }\n >\n {withArrow ? <TooltipArrow /> : null}\n {typeof content === 'function' ? content() : content}\n </AriakitTooltip>\n ) : null}\n </>\n )\n}\n\nexport type { TooltipProps }\nexport { Tooltip, TooltipProvider }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport { Role, RoleProps } from '@ariakit/react'\n\nimport { Box, getBoxClassNames } from '../box'\nimport { Spinner } from '../spinner'\nimport { Tooltip, TooltipProps } from '../tooltip'\n\nimport styles from './button.module.css'\n\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nfunction preventDefault(event: React.SyntheticEvent) {\n event.preventDefault()\n}\n\ntype ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary'\ntype ButtonTone = 'normal' | 'destructive'\ntype ButtonSize = 'small' | 'normal' | 'large'\ntype IconElement = React.ReactElement | string\n\ninterface CommonButtonProps\n extends ObfuscatedClassName,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>,\n Pick<RoleProps, 'render'> {\n /**\n * The button's variant.\n */\n variant: ButtonVariant\n\n /**\n * The button's tone.\n *\n * @default 'normal'\n */\n tone?: ButtonTone\n\n /**\n * The button's size.\n *\n * @default 'normal'\n */\n size?: ButtonSize\n\n /**\n * Controls the shape of the button.\n *\n * Specifically, it allows to make it have slightly curved corners (the default) vs. having them\n * fully curved to the point that they are as round as possible.\n *\n * In icon-only buttons this allows to have the button be circular.\n *\n * @default 'normal'\n */\n shape?: 'normal' | 'rounded'\n\n /**\n * Whether the button is disabled or not.\n *\n * Buttons are disabled using aria-disabled, rather than the HTML disabled attribute. This\n * allows the buttons to be focusable, which can aid discoverability. This way, users can tab to\n * the button and read its label, even if they can't activate it.\n *\n * It is also convenient when buttons are rendered as a link. Links cannot normally be disabled,\n * but by using aria-disabled, we can make them behave as if they were.\n *\n * The `onClick` handler is automatically prevented when the button is disabled in this way, to\n * mimic the behavior of a native disabled attribute.\n *\n * @default false\n */\n disabled?: boolean\n\n /**\n * Whether the button is busy/loading.\n *\n * A button in this state is functionally and semantically disabled. Visually is does not look\n * dimmed (as disabled buttons normally do), but it shows a loading spinner instead.\n *\n * @default false\n */\n loading?: boolean\n\n /**\n * A tooltip linked to the button element.\n */\n tooltip?: TooltipProps['content']\n\n /**\n * The type of the button.\n *\n * @default 'button'\n */\n type?: 'button' | 'submit' | 'reset'\n}\n\ninterface ButtonProps extends CommonButtonProps {\n /**\n * The button label content.\n */\n children?: React.ReactNode\n\n /**\n * The icon to display at the start of the button (before the label).\n */\n startIcon?: IconElement\n\n /**\n * The icon to display at the end of the button (after the label).\n */\n endIcon?: IconElement\n\n /**\n * The width of the button.\n *\n * - `'auto'`: The button will be as wide as its content.\n * - `'full'`: The button will be as wide as its container.\n *\n * @default 'auto'\n */\n width?: 'auto' | 'full'\n\n /**\n * The alignment of the button label inside the button.\n *\n * @default 'center'\n */\n align?: 'start' | 'center' | 'end'\n}\n\n/**\n * A button element that displays a text label and optionally a start or end icon. It follows the\n * [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant,\n tone = 'normal',\n size = 'normal',\n shape = 'normal',\n type = 'button',\n disabled = false,\n loading = false,\n tooltip,\n render,\n onClick,\n exceptionallySetClassName,\n children,\n startIcon,\n endIcon,\n width = 'auto',\n align = 'center',\n ...props\n },\n ref,\n) {\n const isDisabled = loading || disabled\n const buttonElement = (\n <Role.button\n {...props}\n render={render}\n type={render != null ? undefined : type}\n ref={ref}\n aria-disabled={isDisabled}\n onClick={isDisabled ? preventDefault : onClick}\n className={classNames([\n getBoxClassNames({ width }),\n exceptionallySetClassName,\n styles.baseButton,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n shape === 'rounded' ? styles['shape-rounded'] : null,\n disabled ? styles.disabled : null,\n ])}\n >\n <>\n {startIcon ? (\n <Box display=\"flex\" className={styles.startIcon} aria-hidden>\n {loading && !endIcon ? <Spinner /> : startIcon}\n </Box>\n ) : null}\n\n {children ? (\n <Box\n as=\"span\"\n className={styles.label}\n overflow=\"hidden\"\n width={width === 'full' ? 'full' : undefined}\n textAlign={width === 'auto' ? 'center' : align}\n >\n {children}\n </Box>\n ) : null}\n\n {endIcon || (loading && !startIcon) ? (\n <Box display=\"flex\" className={styles.endIcon} aria-hidden>\n {loading ? <Spinner /> : endIcon}\n </Box>\n ) : null}\n </>\n </Role.button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{buttonElement}</Tooltip> : buttonElement\n})\n\ninterface IconButtonProps extends CommonButtonProps {\n /**\n * The icon to display inside the button.\n */\n icon: IconElement\n\n /**\n * The button label.\n *\n * It is used for assistive technologies, and it is also shown as a tooltip (if not tooltip is\n * provided explicitly).\n */\n 'aria-label': string\n}\n\n/**\n * A button element that displays an icon only, visually, though it is semantically labelled. It\n * also makes sure to always show a tooltip with its label. It follows the\n * [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).\n */\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n variant,\n tone = 'normal',\n size = 'normal',\n shape = 'normal',\n type = 'button',\n disabled = false,\n loading = false,\n tooltip,\n render,\n onClick,\n exceptionallySetClassName,\n children,\n icon,\n ...props\n },\n ref,\n) {\n const isDisabled = loading || disabled\n const buttonElement = (\n <Role.button\n {...props}\n render={render}\n type={render != null ? undefined : type}\n ref={ref}\n aria-disabled={isDisabled}\n onClick={isDisabled ? preventDefault : onClick}\n className={classNames([\n exceptionallySetClassName,\n styles.baseButton,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n shape === 'rounded' ? styles['shape-rounded'] : null,\n styles.iconButton,\n disabled ? styles.disabled : null,\n ])}\n >\n {(loading && <Spinner />) || icon}\n </Role.button>\n )\n\n const tooltipContent = tooltip === undefined ? props['aria-label'] : tooltip\n return tooltipContent ? (\n <Tooltip content={tooltipContent}>{buttonElement}</Tooltip>\n ) : (\n buttonElement\n )\n})\n\nexport type { ButtonProps, IconButtonProps, ButtonVariant, ButtonTone }\nexport { Button, IconButton }\n","import * as React from 'react'\n\nfunction CloseIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M5.146 5.146a.5.5 0 0 1 .708 0L12 11.293l6.146-6.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 0 .708L12.707 12l6.147 6.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.708 0L12 12.707l-6.146 6.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1 0-.708L11.293 12 5.146 5.854a.5.5 0 0 1-.057-.638z\"\n />\n </svg>\n )\n}\n\nexport { CloseIcon }\n","import * as React from 'react'\nimport type { SystemBannerType } from '../banner/banner'\n\nimport styles from './banner-icon.module.css'\n\nconst bannerIconForType: Record<SystemBannerType, typeof BannerInfoIcon> = {\n info: BannerInfoIcon,\n upgrade: BannerUpgradeIcon,\n experiment: BannerExperimentIcon,\n warning: BannerWarningIcon,\n error: BannerErrorIcon,\n success: BannerSuccessIcon,\n}\n\nfunction BannerIcon({ type, ...props }: JSX.IntrinsicElements['svg'] & { type: SystemBannerType }) {\n const Icon = bannerIconForType[type]\n return Icon ? (\n <Icon {...props} data-testid={`banner-icon-${type}`} className={styles[type]} aria-hidden />\n ) : null\n}\n\nfunction BannerInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.75 1.94a.75.75 0 0 0 0 1.5h1.25v3.5h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13V11a.752.752 0 0 0-.75-.75h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerUpgradeIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M13.974 4.226a2.485 2.485 0 0 0-3.948 0 2.485 2.485 0 0 1-2.304.954A2.485 2.485 0 0 0 4.93 7.972a2.485 2.485 0 0 1-.954 2.304 2.485 2.485 0 0 0 0 3.948 2.485 2.485 0 0 1 .954 2.304 2.485 2.485 0 0 0 2.792 2.792 2.485 2.485 0 0 1 2.304.954 2.485 2.485 0 0 0 3.948 0 2.485 2.485 0 0 1 2.304-.954 2.485 2.485 0 0 0 2.792-2.792 2.485 2.485 0 0 1 .954-2.304 2.485 2.485 0 0 0 0-3.948 2.485 2.485 0 0 1-.954-2.304 2.485 2.485 0 0 0-2.792-2.792 2.485 2.485 0 0 1-2.304-.954ZM11.228 7.08c-.297-.581-1.177-.345-1.144.306l.125 2.437a.605.605 0 0 1-.635.635l-2.437-.125c-.651-.033-.887.847-.306 1.144l2.172 1.11c.32.163.428.567.233.868L7.91 15.503c-.355.548.289 1.192.837.837l2.047-1.326a.605.605 0 0 1 .868.233l1.11 2.172c.297.581 1.177.345 1.144-.306l-.125-2.437a.605.605 0 0 1 .635-.635l2.437.125c.651.033.887-.847.306-1.144l-2.172-1.11a.605.605 0 0 1-.233-.868l1.326-2.047c.355-.548-.289-1.192-.837-.837l-2.047 1.326a.605.605 0 0 1-.868-.233l-1.11-2.172Z\"\n clipRule=\"evenodd\"\n />\n <path\n fill=\"#fff\"\n d=\"M10.084 7.387c-.033-.651.847-.887 1.144-.306l1.11 2.172c.163.32.567.428.868.233l2.047-1.326c.548-.355 1.192.289.837.837l-1.326 2.047a.605.605 0 0 0 .233.868l2.172 1.11c.581.297.345 1.177-.306 1.144l-2.437-.125a.605.605 0 0 0-.635.635l.125 2.437c.033.651-.847.887-1.144.306l-1.11-2.172a.605.605 0 0 0-.868-.233L8.747 16.34c-.548.355-1.192-.289-.837-.837l1.326-2.047a.605.605 0 0 0-.233-.868l-2.172-1.11c-.581-.297-.345-1.177.306-1.144l2.437.125a.605.605 0 0 0 .635-.635l-.125-2.437Z\"\n />\n </svg>\n )\n}\n\nfunction BannerExperimentIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M12 3.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1H14v4.333a2 2 0 0 0 .4 1.2l4.4 5.867a1 1 0 0 1-.8 1.6H6a1 1 0 0 1-.8-1.6l4.4-5.867a2 2 0 0 0 .4-1.2V8.25h-.5a.5.5 0 0 1-.5-.5Zm1.5-2.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1Zm4.5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-4 3v4.333a3 3 0 0 1-.6 1.8l-.752 1.003c.11.078.245.16.403.226.41.173.985.253 1.682-.188.808-.51 1.547-.67 2.142-.674l-.275-.367a3 3 0 0 1-.6-1.8V8.25h-2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerWarningIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"m10.272 5.212-7.018 12.03a2 2 0 0 0 1.728 3.008h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.014A.987.987 0 0 0 12 8.75h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.028Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerErrorIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M12.987 2.5a2.07 2.07 0 0 0-1.974 0L4.048 6.287A1.989 1.989 0 0 0 3 8.032v7.436c0 .725.401 1.393 1.048 1.745L11.013 21a2.07 2.07 0 0 0 1.974 0l6.965-3.787A1.989 1.989 0 0 0 21 15.468V8.032c0-.725-.401-1.393-1.048-1.745L12.987 2.5ZM12 7.25a.987.987 0 0 1 .986 1.014l-.001.027-.236 4.25c-.053.945-1.445.945-1.498 0l-.236-4.25a.987.987 0 0 1 .93-1.04h.028L12 7.25Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nfunction BannerSuccessIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" {...props}>\n <path\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n d=\"M21 12.25a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.303a.748.748 0 0 1-1.061 0L7.666 13.15a.75.75 0 1 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )\n}\n\nexport { BannerIcon }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport styles from './text-link.module.css'\nimport type { OpenInNewTab } from '../utils/common-types'\n\ntype TextLinkColors = 'default' | 'inherit'\n\ntype TextLinkProps = OpenInNewTab & {\n color?: TextLinkColors\n underline?: boolean\n}\n\nconst TextLink = polymorphicComponent<'a', TextLinkProps>(function TextLink(\n {\n as = 'a',\n openInNewTab = false,\n exceptionallySetClassName,\n color = 'default',\n underline = true,\n ...props\n },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"inline\"\n className={[\n exceptionallySetClassName,\n styles.container,\n styles[color],\n underline ? styles.underline : styles['no-underline'],\n ]}\n ref={ref}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n />\n )\n})\n\nexport { TextLink }\nexport type { TextLinkProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './banner.module.css'\nimport { Button, ButtonProps, IconButton } from '../button'\nimport { CloseIcon } from '../icons/close-icon'\nimport { BannerIcon } from '../icons/banner-icon'\nimport { TextLink } from '../text-link'\n\n/**\n * Represents the type of a banner.\n * 'neutral' accepts a custom icon, the rest do not.\n * @default 'neutral'\n */\nexport type BannerType = 'neutral' | SystemBannerType\n\n/**\n * Predefined system types for banners.\n * Each type has its own preset icon.\n */\nexport type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success'\n\ntype BaseAction = {\n variant: 'primary' | 'tertiary'\n label: string\n} & Pick<ButtonProps, 'loading' | 'disabled'>\ntype ActionButton = BaseAction & { type: 'button' } & Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'className'\n >\ntype ActionLink = BaseAction & { type: 'link' } & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'className'\n >\n/**\n * Represents an action that can be taken from the banner.\n * Can be either a button or a link, sharing common properties from BaseAction.\n */\ntype Action = ActionButton | ActionLink\n\n/**\n * Configuration for inline links within the banner description.\n * Extends TextLink component props with a required label.\n */\ntype InlineLink = { label: string } & React.ComponentProps<typeof TextLink>\n\ntype WithCloseButton = {\n closeLabel?: string\n onClose: () => void\n}\ntype WithoutCloseButton = {\n closeLabel?: never\n onClose?: never\n}\n/**\n * Controls the close button behavior.\n * If none is provided, the banner will not have a close button.\n */\ntype CloseButton = WithCloseButton | WithoutCloseButton\n\ntype BaseBanner = {\n id?: string\n title?: React.ReactNode\n description: Exclude<React.ReactNode, null | undefined | boolean>\n action?: Action\n inlineLinks?: InlineLink[]\n} & CloseButton\n\n/**\n * Configuration for neutral banners.\n * Can include either an image, an icon, or neither, but never both.\n */\ntype NeutralBanner = BaseBanner & {\n type: Extract<BannerType, 'neutral'>\n} & (\n | { image: React.ReactElement; icon?: never }\n | { icon: React.ReactElement; image?: never }\n | { image?: never; icon?: never }\n )\n\n/**\n * Configuration for system banners.\n * Cannot include custom images or icons as they use preset ones.\n */\ntype SystemBanner = BaseBanner & {\n type: SystemBannerType\n image?: never\n icon?: never\n}\n\ntype BannerProps = NeutralBanner | SystemBanner\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n id,\n type,\n title,\n description,\n action,\n icon,\n image,\n inlineLinks,\n closeLabel,\n onClose,\n ...props\n }: BannerProps,\n ref,\n) {\n const titleId = useId()\n const descriptionId = useId()\n\n const closeButton = onClose ? (\n <IconButton\n exceptionallySetClassName={styles.closeButton}\n variant=\"quaternary\"\n onClick={onClose}\n icon={<CloseIcon />}\n aria-label={closeLabel ?? 'Close banner'}\n />\n ) : null\n\n return (\n <Box\n {...props}\n ref={ref}\n id={id}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"center\"\n role=\"status\"\n aria-labelledby={title ? titleId : descriptionId}\n aria-describedby={title ? descriptionId : undefined}\n aria-live=\"polite\"\n tabIndex={0}\n borderRadius=\"full\"\n className={styles.banner}\n >\n {image ? <Box className={styles.image}>{image}</Box> : null}\n\n <Box className={styles.content} display=\"flex\" gap=\"small\" alignItems=\"center\">\n <Box className={styles.staticContent} display=\"flex\" gap=\"small\" flexGrow={1}>\n <Box className={styles.icon}>\n {type === 'neutral' ? icon : <BannerIcon type={type} />}\n {closeButton}\n </Box>\n\n <Box className={styles.copy} display=\"flex\" flexDirection=\"column\">\n {title ? (\n <Box id={titleId} className={styles.title}>\n {title}\n </Box>\n ) : null}\n <Box\n id={descriptionId}\n className={[styles.description, title ? styles.secondary : null]}\n >\n {description}\n {inlineLinks?.map(({ label, ...props }, index) => {\n return (\n <React.Fragment key={index}>\n <TextLink\n {...props}\n exceptionallySetClassName={styles.inlineLink}\n >\n {label}\n </TextLink>\n {index < inlineLinks.length - 1 ? <span> · </span> : ''}\n </React.Fragment>\n )\n })}\n </Box>\n </Box>\n </Box>\n\n {action || closeButton ? (\n <Box className={styles.actions} display=\"flex\" gap=\"small\">\n {action?.type === 'button' ? <ActionButton {...action} /> : null}\n {action?.type === 'link' ? <ActionLink {...action} /> : null}\n {closeButton}\n </Box>\n ) : null}\n </Box>\n </Box>\n )\n})\n\nfunction ActionButton({ type, label, ...props }: ActionButton) {\n return <Button {...props}>{label}</Button>\n}\n\nfunction ActionLink({ type, label, variant, ...props }: ActionLink) {\n return (\n <Button\n variant={variant}\n render={<a rel=\"noopener noreferrer\" target=\"_blank\" {...props} />}\n >\n {label}\n </Button>\n )\n}\n\nexport { Banner }\nexport type { BannerProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype Size = 'xsmall' | 'small' | 'medium' | 'large'\n\ntype NativeProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'\n>\n\ntype LoadingProps = NativeProps &\n ObfuscatedClassName & {\n /**\n * The size of the loading spinner.\n * @default 'small'\n */\n size?: Size\n\n /**\n * Identifies the element (or elements) that describes the loading component for assistive technologies.\n */\n 'aria-describedby'?: string\n } & (\n | {\n /** Defines a string value that labels the current loading component for assistive technologies. */\n 'aria-label': string\n 'aria-labelledby'?: never\n }\n | {\n /** Identifies the element (or elements) that labels the current loading component for assistive technologies. */\n 'aria-labelledby': string\n 'aria-label'?: never\n }\n )\n\nconst sizeMapping: Record<Size, number> = {\n xsmall: 16,\n small: 24,\n medium: 36,\n large: 48,\n}\n\nfunction Loading({ size = 'small', exceptionallySetClassName, ...props }: LoadingProps) {\n const numericSize = sizeMapping[size] ?? sizeMapping.small\n const ariaLabel = props['aria-label']\n ? props['aria-label']\n : !props['aria-labelledby']\n ? 'Loading…'\n : undefined\n\n return (\n <Box\n {...props}\n aria-label={ariaLabel}\n className={exceptionallySetClassName}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n role=\"progressbar\"\n >\n <Spinner size={numericSize} aria-hidden />\n </Box>\n )\n}\n\nexport { Loading }\nexport type { LoadingProps }\n","import * as React from 'react'\nimport type { AlertTone } from '../utils/common-types'\n\nconst alertIconForTone: Record<AlertTone, typeof AlertInfoIcon> = {\n info: AlertInfoIcon,\n positive: AlertPositiveIcon,\n caution: AlertCautionIcon,\n critical: AlertCriticalIcon,\n}\n\nfunction AlertIcon({ tone, ...props }: JSX.IntrinsicElements['svg'] & { tone: AlertTone }) {\n const Icon = alertIconForTone[tone]\n return Icon ? <Icon {...props} /> : null\n}\n\nfunction AlertInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM10.25 10a.75.75 0 0 0 0 1.5h1.25V15h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13v-4.25a.75.75 0 0 0-.75-.75h-2Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertPositiveIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.304a.748.748 0 0 1-1.061 0l-2.475-2.475a.75.75 0 0 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCautionIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m10.272 4.962-7.018 12.03A2 2 0 0 0 4.982 20h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.013A.987.987 0 0 0 12 8.5h-.028l-.027.002a.987.987 0 0 0-.93 1.04l.236 4.25c.052.944 1.445.944 1.498 0l.236-4.25a1.925 1.925 0 0 0 .001-.055Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCriticalIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.9866 2.25049C12.3729 1.91683 11.6271 1.91683 11.0134 2.25049L4.04793 6.03744C3.40122 6.38904 2.99999 7.05702 2.99999 7.78208V15.2184C2.99999 15.9435 3.40122 16.6115 4.04793 16.963L11.0134 20.75C11.6271 21.0837 12.3729 21.0837 12.9866 20.75L19.9521 16.963C20.5988 16.6114 21 15.9435 21 15.2184V7.78208C21 7.05701 20.5988 6.38904 19.9521 6.03744L12.9866 2.25049ZM12 7.00024C12.5448 7.00024 12.9865 7.44191 12.9865 7.98674C12.9864 8.00043 12.9863 8.00727 12.9861 8.01411C12.9859 8.02095 12.9856 8.02779 12.985 8.04146L12.7489 12.2918C12.6964 13.2364 11.3036 13.2364 11.2512 12.2918L11.015 8.04146C10.9848 7.49747 11.4013 7.03198 11.9453 7.00176L11.9726 7.00062L12 7.00024ZM13 15.0002C13 15.5525 12.5523 16.0002 12 16.0002C11.4477 16.0002 11 15.5525 11 15.0002C11 14.448 11.4477 14.0002 12 14.0002C12.5523 14.0002 13 14.448 13 15.0002Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { AlertIcon }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../utils/polymorphism'\n\nimport type { Tone } from '../utils/common-types'\nimport type { BoxProps } from '../box'\n\nimport styles from './text.module.css'\n\ntype TextProps = {\n children: React.ReactNode\n /**\n * The size of the text.\n *\n * The supported values, from smaller size to larger size, are:\n * 'caption', 'copy', 'body', and 'subtitle'\n *\n * @default 'body'\n */\n size?: 'caption' | 'copy' | 'body' | 'subtitle'\n /**\n * The weight of the text font.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'semibold' | 'bold'\n /**\n * The tone (semantic color) of the text.\n *\n * @default 'normal'\n */\n tone?: Tone\n /**\n * Used to truncate the text to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n /**\n * How to align the text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Text = polymorphicComponent<'div', TextProps>(function Text(\n {\n as,\n size = 'body',\n weight = 'regular',\n tone = 'normal',\n align,\n children,\n lineClamp,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp ?? 1) > 1\n\n return (\n <Box\n {...props}\n as={as}\n className={[\n exceptionallySetClassName,\n styles.text,\n size !== 'body' ? getClassNames(styles, 'size', size) : null,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type { TextProps }\nexport { Text }\n","import React from 'react'\n\nimport { CloseIcon } from '../icons/close-icon'\nimport { Box } from '../box'\nimport { IconButton, Button } from '../button'\nimport { Stack } from '../stack'\nimport { Text } from '../text'\n\nimport styles from './toast.module.css'\n\ntype ToastActionObject = {\n label: string\n onClick: () => void\n}\n\ntype StaticToastProps = {\n /**\n * The message shown in the toast.\n */\n message: NonNullable<React.ReactNode>\n\n /**\n * An optional extra description that complements the main message shown in the toast.\n */\n description?: React.ReactNode\n\n /**\n * An icon to be shown in front of the message.\n */\n icon?: React.ReactNode\n\n /**\n * The action to call when the user clicks on the dismiss button. If omitted, the dismiss button\n * does not appear.\n */\n onDismiss?: () => void\n\n /**\n * The label for the button that dismisses the toast.\n */\n dismissLabel?: string\n\n /**\n * What to render in the action slot. Usually a button or link.\n *\n * You can also pass an object that containst the action label, and a function that performs the\n * action. This is used by the toast component to render a button for you.\n *\n * In general, you should prefer the action object most of the time. But it is possible to pass\n * a React element instead, if you need more control over what to render. For instance, you may\n * want to render a link instead of a button.\n *\n * Keep in mind, though, that the default button rendered uses `variant=\"tertiary\"` and\n * `size=\"small\"`. In most cases you should stick to the variants `tertiary` or `primary`, which\n * are the ones that look better in the toast's dark background. And in all cases you should use\n * size `small`.\n */\n action?: React.ReactElement | ToastActionObject\n}\n\n/**\n * A toast that shows a message, and an optional action associated with it.\n *\n * This component is generally not meant to be used directly. Most of the time you'll want to use\n * toasts generated via `useToasts` instead. However, this component is available in case you need\n * to take control of rendering a toast under different circumstances than that of notification-like\n * floating toasts.\n *\n * This component makes no assumptions outwardly about how it is positioned on the screen. That is,\n * it will not be shown floating or fixed to the viewport edges, as toasts normally show up. It only\n * provides the toast look and feel, but you are responsible for positioning it as you want.\n *\n * @see useToasts\n */\nconst StaticToast = React.forwardRef<HTMLDivElement, StaticToastProps>(function Toast(\n { message, description, icon, action, onDismiss, dismissLabel = 'Close', ...props },\n ref,\n) {\n return (\n <Box\n ref={ref}\n role=\"alert\"\n aria-live=\"polite\"\n borderRadius=\"full\"\n width=\"fitContent\"\n background=\"toast\"\n display=\"flex\"\n padding=\"large\"\n alignItems=\"center\"\n className={styles.toastContainer}\n {...props}\n >\n {icon ? <ToastContentSlot>{icon}</ToastContentSlot> : null}\n\n <Box flexGrow={1} maxWidth=\"small\">\n {description ? (\n <Stack space=\"small\">\n <Text weight=\"bold\">{message} </Text>\n <Text>{description}</Text>\n </Stack>\n ) : (\n <Text>{message}</Text>\n )}\n </Box>\n\n {action ? (\n <ToastContentSlot>\n {isActionObject(action) ? (\n <Button variant=\"tertiary\" size=\"small\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : (\n action\n )}\n </ToastContentSlot>\n ) : null}\n\n {onDismiss ? (\n <ToastContentSlot>\n <IconButton\n variant=\"quaternary\"\n size=\"small\"\n onClick={onDismiss}\n aria-label={dismissLabel}\n icon={<CloseIcon />}\n />\n </ToastContentSlot>\n ) : null}\n </Box>\n )\n})\n\nfunction isActionObject(action: StaticToastProps['action']): action is ToastActionObject {\n return (\n action != null &&\n typeof action === 'object' &&\n 'label' in action &&\n 'onClick' in action &&\n typeof action.label === 'string' &&\n typeof action.onClick === 'function'\n )\n}\n\nfunction ToastContentSlot({ children }: { children: React.ReactNode }) {\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n marginX=\"-xsmall\"\n marginY=\"-medium\"\n className={styles.slot}\n >\n {children}\n </Box>\n )\n}\n\nexport { StaticToast, isActionObject }\nexport type { StaticToastProps }\n","/**\n * Adapted with minor changes from https://github.com/seek-oss/braid-design-system/blob/7a5ebccb/packages/braid-design-system/lib/components/useToast/useFlipList.ts\n *\n * MIT License\n *\n * Copyright (c) 2018 SEEK\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { useMemo, useCallback, useLayoutEffect } from 'react'\n\nconst ANIMATION_TIMEOUT = 400\nconst ENTRANCE_TRANSITION = 'transform 0.3s ease, opacity 0.3s ease'\nconst EXIT_TRANSITION = 'opacity 0.2s ease'\n\ntype Transform = {\n property: 'opacity' | 'transform' | 'scale'\n from?: string\n to?: string\n}\n\n/**\n * Applies the \"from\" value of given CSS properties, and also sets a transition CSS property. Then\n * it waits an animation frame before setting the same CSS properties to the target \"to\" value. This\n * triggers the browser to perform the CSS transition on them.\n *\n * At the end of the animation, it cleans up, unsetting all the CSS properties (including the\n * transition), and calls the \"done\" callback, if given.\n */\nfunction animate({\n element,\n transforms,\n transition,\n done,\n}: {\n element: HTMLElement\n transforms: Transform[]\n transition: string\n done?: () => void\n}) {\n const fallbackTimeout = setTimeout(() => {\n done?.()\n }, ANIMATION_TIMEOUT)\n\n transforms.forEach(({ property, from = '' }) => {\n element.style.setProperty(property, from)\n })\n element.style.setProperty('transition', '')\n\n function transitionEndHandler(event: TransitionEvent) {\n if (event.target !== element) {\n return\n }\n element.style.setProperty('transition', '')\n done?.()\n element.removeEventListener('transitionend', transitionEndHandler)\n clearTimeout(fallbackTimeout)\n }\n\n element.addEventListener('transitionend', transitionEndHandler)\n\n // Call requestAnimationFrame twice to make sure we have a full animation frame at our disposal\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n element.style.setProperty('transition', transition)\n transforms.forEach(({ property, to = '' }) => {\n element.style.setProperty(property, to)\n })\n })\n })\n}\n\ntype ToastsAnimationToolkit = {\n /**\n * Used for gathering all the active stacked toast elements. Should be used by passing\n * `ref={mappedRef(toastId)}` to the stacked toasts.\n */\n mappedRef: (toastId: string) => (ref: HTMLElement | null) => void\n\n /**\n * The stacked toasts view should use this callback when it needs to remove a toast, instead of\n * removing it right away. The actual removal from the state (and consequently, from the DOM)\n * should happen in the `onAnimationDone` instead.\n */\n animateRemove: (toastId: string, onAnimationDone: () => void) => void\n}\n\n/**\n * Provides the functionality of animating the stacked toasts when they appear and before they\n * disappear.\n *\n * It works by keeping a mapping from toast IDs to the toast elements, and keeping a mapping from\n * toast IDs to their top position. Then, on every single re-render, it compares the new DOM\n * situation with the previously stored one in these mappings. With this information, it applies\n * animations that smoothly transitions between both states.\n */\nfunction useToastsAnimation(): ToastsAnimationToolkit {\n const refs = useMemo(() => new Map<string, HTMLElement | null>(), [])\n const positions = useMemo(() => new Map<string, number>(), [])\n\n useLayoutEffect(() => {\n const animations: Array<{\n element: HTMLElement\n transforms: Transform[]\n transition: string\n }> = []\n\n Array.from(refs.entries()).forEach(([id, element]) => {\n if (!element) {\n refs.delete(id)\n return\n }\n\n const prevTop = positions.get(id)\n const { top, height } = element.getBoundingClientRect()\n\n if (typeof prevTop === 'number' && prevTop !== top) {\n // Move animation\n animations.push({\n element,\n transition: ENTRANCE_TRANSITION,\n transforms: [{ property: 'transform', from: `translateY(${prevTop - top}px)` }],\n })\n } else if (typeof prevTop !== 'number') {\n // Enter animation\n animations.push({\n element,\n transition: ENTRANCE_TRANSITION,\n transforms: [\n { property: 'transform', from: `translateY(${height}px)` },\n { property: 'opacity', from: '0' },\n ],\n })\n }\n\n positions.set(id, element.getBoundingClientRect().top)\n })\n\n animations.forEach(({ element, transforms, transition }) => {\n animate({ element, transforms, transition })\n })\n })\n\n const animateRemove = useCallback(\n function animateRemove(id: string, onAnimationDone: () => void) {\n const element = refs.get(id)\n if (element) {\n // Removal animation\n animate({\n element,\n transforms: [{ property: 'opacity', to: '0' }],\n transition: EXIT_TRANSITION,\n done: onAnimationDone,\n })\n }\n },\n [refs],\n )\n\n const mappedRef = useCallback(\n (id: string) => (ref: HTMLElement | null) => {\n refs.set(id, ref)\n },\n [refs],\n )\n\n return { mappedRef, animateRemove }\n}\n\nexport { ANIMATION_TIMEOUT, useToastsAnimation }\n","import React from 'react'\nimport { Portal } from '@ariakit/react'\n\nimport { generateElementId } from '../utils/common-helpers'\nimport { Box } from '../box'\nimport { Stack } from '../stack'\nimport { isActionObject, StaticToast, StaticToastProps } from './static-toast'\n\nimport styles from './toast.module.css'\n\nimport type { Space } from '../utils/common-types'\nimport { useToastsAnimation } from './toast-animation'\n\n/**\n * The props needed to fire up a new notification toast.\n */\ntype ToastProps = StaticToastProps & {\n /**\n * The number of seconds the toast is expected to be shown before it is dismissed automatically,\n * or false to disable auto-dismiss.\n *\n * It defaults to whatever is the autoDismissDelay set in the ToastsProvider.\n */\n autoDismissDelay?: number | false\n\n /**\n * The label for the button that dismisses the toast.\n *\n * It defaults to the value set in the ToastsProvider, but individual toasts can have a\n * different value if needed.\n */\n dismissLabel?: string\n\n /**\n * Whether to show the dismiss button or not.\n *\n * Use this value with care. If combined with disabling `autoDismissDelay`, it may leave you\n * with toasts that the user won't be able to dismiss at will. It then is your responsibility to\n * dismiss the toast by calling the function returned by `showToast`.\n */\n showDismissButton?: boolean\n}\n\n//\n// InternalToast component and its props\n//\n\ntype InternalToastProps = Omit<ToastProps, 'autoDismissDelay' | 'dismissLabel'> &\n Required<Pick<ToastProps, 'autoDismissDelay' | 'dismissLabel'>> & {\n toastId: string\n onRemoveToast: (toastId: string) => void\n }\n\n/** @private */\nconst InternalToast = React.forwardRef<HTMLDivElement, InternalToastProps>(function InternalToast(\n {\n message,\n description,\n icon,\n action,\n autoDismissDelay,\n dismissLabel,\n showDismissButton = true,\n toastId,\n onDismiss,\n onRemoveToast,\n },\n ref,\n) {\n const [timeoutRunning, setTimeoutRunning] = React.useState(Boolean(autoDismissDelay))\n const timeoutRef = React.useRef<number | undefined>()\n\n const startTimeout = React.useCallback(function startTimeout() {\n setTimeoutRunning(true)\n }, [])\n\n const stopTimeout = React.useCallback(function stopTimeout() {\n setTimeoutRunning(false)\n clearTimeout(timeoutRef.current)\n timeoutRef.current = undefined\n }, [])\n\n const removeToast = React.useCallback(\n function removeToast() {\n onRemoveToast(toastId)\n onDismiss?.()\n },\n [onDismiss, onRemoveToast, toastId],\n )\n\n React.useEffect(\n function setupAutoDismiss() {\n if (!timeoutRunning || !autoDismissDelay) return\n timeoutRef.current = window.setTimeout(removeToast, autoDismissDelay * 1000)\n return stopTimeout\n },\n [autoDismissDelay, removeToast, stopTimeout, timeoutRunning],\n )\n\n /**\n * If the action is toast action object and not a custom element,\n * the `onClick` property is wrapped in another handler responsible\n * for removing the toast when the action is triggered.\n */\n const actionWithCustomActionHandler = React.useMemo(() => {\n if (!isActionObject(action)) {\n return action\n }\n\n return {\n ...action,\n onClick: function handleActionClick() {\n if (!action) {\n return\n }\n\n action.onClick()\n removeToast()\n },\n }\n }, [action, removeToast])\n\n return (\n <StaticToast\n ref={ref}\n message={message}\n description={description}\n icon={icon}\n action={actionWithCustomActionHandler}\n onDismiss={showDismissButton ? removeToast : undefined}\n dismissLabel={dismissLabel}\n // @ts-expect-error\n onMouseEnter={stopTimeout}\n onMouseLeave={startTimeout}\n />\n )\n})\n\n//\n// Internal state and context\n//\n\ntype InternalToastEntry = Omit<InternalToastProps, 'onRemoveToast'>\ntype ToastsList = readonly InternalToastEntry[]\n\ntype ShowToastAction = (props: ToastProps) => () => void\nconst ToastsContext = React.createContext<ShowToastAction>(() => () => undefined)\n\n/**\n * The props needed by the ToastsProvider component.\n *\n * @see ToastsProvider\n */\ntype ToastsProviderProps = {\n /**\n * The default label to apply to toast dismiss buttons.\n *\n * This is useful in environments that need locatization, so you do not need to pass the same\n * translated label every time you trigger a toast.\n *\n * However, you can still apply a different label to a specific toast, by passing a different\n * value when calling showToast.\n *\n * @default 'Close'\n */\n defaultDismissLabel?: string\n\n /**\n * The default number of seconds after which the toast will be dismissed automatically.\n *\n * You can pass a different value to a specific toast when calling `showToast`. You can even\n * pass `false` if you want a certain toast to never be dismissed automatically.\n *\n * @default 10 (seconds)\n */\n defaultAutoDismissDelay?: number\n\n /**\n * The padding used to separate the toasts from the viewport borders.\n *\n * @default 'large'\n */\n padding?: Space\n\n /**\n * The app wrapped by the provider.\n */\n children: NonNullable<React.ReactNode>\n\n /**\n * Custom classname for the toasts container, if you need to fine-tune the position or other styles\n */\n containerClassName?: string\n}\n\n/**\n * Provides the state management and rendering of the toasts currently active.\n *\n * You need to render this near the top of your app components tree, in order to `useToasts`.\n *\n * @see useToasts\n */\nfunction ToastsProvider({\n children,\n padding = 'large',\n defaultAutoDismissDelay = 10 /* seconds */,\n defaultDismissLabel = 'Close',\n containerClassName,\n}: ToastsProviderProps) {\n const [toasts, setToasts] = React.useState<ToastsList>([])\n const { mappedRef, animateRemove } = useToastsAnimation()\n\n const removeToast = React.useCallback(\n function onRemoveToast(toastId: string) {\n animateRemove(toastId, () => {\n setToasts((list) => {\n const index = list.findIndex((n) => n.toastId === toastId)\n if (index < 0) return list\n const copy = [...list]\n copy.splice(index, 1)\n return copy\n })\n })\n },\n [animateRemove],\n )\n\n const showToast = React.useCallback(\n function showToast(props: ToastProps) {\n const toastId = generateElementId('toast')\n const newToast: InternalToastEntry = {\n autoDismissDelay: defaultAutoDismissDelay,\n dismissLabel: defaultDismissLabel,\n ...props,\n toastId,\n }\n setToasts((list) => [...list, newToast])\n return () => removeToast(toastId)\n },\n [defaultAutoDismissDelay, defaultDismissLabel, removeToast],\n )\n\n return (\n <ToastsContext.Provider value={showToast}>\n {children}\n <Portal>\n {toasts.length === 0 ? null : (\n <Box\n className={[styles.stackedToastsView, containerClassName]}\n position=\"fixed\"\n width=\"full\"\n paddingX={padding}\n paddingBottom={padding}\n data-testid=\"toasts-container\"\n >\n <Stack space=\"medium\">\n {toasts.map(({ toastId, ...props }) => (\n <InternalToast\n key={toastId}\n ref={mappedRef(toastId)}\n toastId={toastId}\n onRemoveToast={removeToast}\n {...props}\n />\n ))}\n </Stack>\n </Box>\n )}\n </Portal>\n </ToastsContext.Provider>\n )\n}\n\n/**\n * Provides a function `showToast` that shows a new toast every time you call it.\n *\n * ```jsx\n * const showToast = useToasts()\n *\n * <button onClick={() => showToast({ message: 'Hello' })}>\n * Say hello\n * </button>\n * ```\n *\n * All toasts fired via this function are rendered in a global fixed location, and stacked one on\n * top of the other.\n *\n * When called, `showToast` returns a function that dismisses the toast when called.\n *\n * @see ToastsProvider\n */\nfunction useToasts() {\n return React.useContext(ToastsContext)\n}\n\n/**\n * Adds a toast to be rendered, stacked alongside any other currently active toasts.\n *\n * For most situations, you should prefer to use the `showToast` function obtained from `useToasts`.\n * This component is provided for convenience to render toasts in the markup, but it has some\n * peculiarities, which are discussed below.\n *\n * Internally, this calls `showToast`. It is provided for two reasons:\n *\n * 1. Convenience, when you want to fire a toast in markup/jsx code. Keep in mind, though, that\n * toasts rendered in this way will be removed from view when the context where it is rendered\n * is unmounted. Unlike toasts fired with `showToast`, which will normally be dismissed, either\n * by the user or after a delay. They'll still be animated on their way out, though.\n * 2. When combined with disabling dismissing it (e.g. `showDismissButton={false}` and\n * `autoDismissDelay={false}` it provides a way to show \"permanent\" toasts that only go away when\n * the component ceases to be rendered).\n *\n * This is useful for cases when the consumer wants to control when a toast is visible, and to keep\n * it visible based on an app-specific condition.\n *\n * Something important to note about this component is that it triggers the toast based on the props\n * passed when first rendered, and it does not update the toast if these props change on subsequent\n * renders. In this sense, this is an imperative component, more than a descriptive one. This is\n * done to simplify the internals, and to keep it in line with how `showToast` works: you fire up a\n * toast imperatively, and you loose control over it. It remains rendered according to the props you\n * first passed.\n *\n * @see useToasts\n */\nfunction Toast(props: ToastProps) {\n const showToast = useToasts()\n const propsRef = React.useRef<ToastProps>(props)\n React.useEffect(() => {\n const dismissToast = showToast(propsRef.current)\n return dismissToast\n }, [showToast])\n return null\n}\n\nexport { Toast, ToastsProvider, useToasts }\nexport type { ToastProps, ToastsProviderProps }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport styles from './heading.module.css'\nimport type { ObfuscatedClassName, Tone } from '../utils/common-types'\nimport type { BoxProps } from '../box'\n\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'\ntype HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\ntype HeadingProps = Omit<React.HTMLAttributes<HTMLHeadingElement>, 'className' | 'children'> & {\n children: React.ReactNode\n /**\n * The semantic level of the heading.\n */\n level: HeadingLevel\n\n /**\n * The weight of the heading. Used to de-emphasize the heading visually when using 'medium' or 'light'.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'medium' | 'light'\n\n /**\n * Shifts the default heading visual text size up or down, depending on the original size\n * imposed by the `level`. The heading continues to be semantically at the given level.\n *\n * By default, no value is applied, and the default size from the level is applied. The values\n * have the following effect:\n *\n * - 'smaller' shifts the default level size down in the font-size scale (it tends to make the\n * level look visually as if it were of the immediately lower level).\n * - 'larger' has the opposite effect than 'smaller' shifting the visual font size up in the\n * scale.\n * - 'largest' can be thought of as applying 'larger' twice.\n *\n * @see level\n * @default undefined\n */\n size?: 'smaller' | 'larger' | 'largest'\n\n /**\n * The tone (semantic color) of the heading.\n *\n * @default 'normal'\n */\n tone?: Tone\n\n /**\n * Used to truncate the heading to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n\n /**\n * How to align the heading text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Heading = React.forwardRef<HTMLHeadingElement, HeadingProps & ObfuscatedClassName>(\n function Heading(\n {\n level,\n weight = 'regular',\n size,\n tone = 'normal',\n children,\n lineClamp,\n align,\n exceptionallySetClassName,\n ...props\n },\n ref,\n ) {\n // In TypeScript v4.1, this would be properly recognized without needing the type assertion\n // https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types\n const headingElementName = `h${level}` as HeadingElement\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? parseInt(lineClamp, 10) > 1 : (lineClamp || 0) > 1\n\n return (\n <Box\n {...props}\n className={[\n exceptionallySetClassName,\n styles.heading,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n getClassNames(styles, 'size', size),\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n as={headingElementName}\n ref={ref}\n >\n {children}\n </Box>\n )\n },\n)\n\nexport type { HeadingProps, HeadingLevel }\nexport { Heading }\n","import * as React from 'react'\n\nconst svgPath = {\n checked:\n 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2.457 4.293l-5.293 5.293-1.793-1.793a1 1 0 1 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l6-6a1 1 0 1 0-1.414-1.414z',\n unchecked:\n 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm0 1H6a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z',\n mixed:\n 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2 7H8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2z',\n filled:\n 'M6 4H18C19.1046 4 20 4.89543 20 6V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4Z',\n} as const\n\ntype Props = React.SVGProps<SVGSVGElement> & {\n checked?: boolean\n indeterminate?: boolean\n disabled?: boolean\n}\n\nfunction getPathKey({ checked, indeterminate, disabled }: Props): keyof typeof svgPath {\n if (indeterminate) {\n return 'mixed' // indeterminate, when true, overrides the checked state\n }\n\n if (checked) {\n return 'checked'\n }\n\n // We only used 'filled' when unchecked AND disabled, because the default unchecked icon\n // is not enough to convey the disabled state with opacity alone. For all other cases\n // above, when disabled, we use the same icon the corresponds to that state, and the\n // opacity conveys the fact that the checkbox is disabled.\n // See https://twist.com/a/1585/ch/414345/t/2257308/c/65201390\n if (disabled) {\n return 'filled'\n }\n\n return 'unchecked'\n}\n\nfunction CheckboxIcon({ checked, indeterminate, disabled, ...props }: Props) {\n const pathKey = getPathKey({ checked, indeterminate, disabled })\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path fill=\"currentColor\" fillRule=\"nonzero\" d={svgPath[pathKey]} />\n </svg>\n )\n}\n\nexport { CheckboxIcon }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { Text } from '../text'\nimport { CheckboxIcon } from './checkbox-icon'\n\nimport styles from './checkbox-field.module.css'\nimport { useForkRef } from './use-fork-ref'\n\ninterface CheckboxFieldProps\n extends Omit<\n JSX.IntrinsicElements['input'],\n | 'type'\n | 'className'\n | 'disabled'\n | 'aria-controls'\n | 'aria-describedby'\n | 'aria-label'\n | 'aria-labelledby'\n > {\n 'aria-checked'?: never\n /**\n *\n * Identifies the set of checkboxes controlled by the mixed checkbox for assistive technologies.\n */\n 'aria-controls'?: string\n\n /**\n * Identifies the element (or elements) that describes the checkbox for assistive technologies.\n */\n 'aria-describedby'?: string\n\n /**\n * Defines a string value that labels the current checkbox for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * Identifies the element (or elements) that labels the current checkbox for assistive technologies.\n */\n 'aria-labelledby'?: string\n\n /**\n * Defines whether or not the checkbox is disabled.\n */\n disabled?: boolean\n\n /**\n * The label for the checkbox element.\n */\n label?: React.ReactNode\n\n /**\n * The icon that should be added to the checkbox label.\n */\n icon?: React.ReactElement | string | number\n\n /**\n * Defines whether or not the checkbox can be of a `mixed` state.\n */\n indeterminate?: boolean\n}\n\nconst CheckboxField = React.forwardRef<HTMLInputElement, CheckboxFieldProps>(function CheckboxField(\n { label, icon, disabled, indeterminate, defaultChecked, onChange, ...props },\n ref,\n) {\n const isControlledComponent = typeof props.checked === 'boolean'\n if (typeof indeterminate === 'boolean' && !isControlledComponent) {\n // eslint-disable-next-line no-console\n console.warn('Cannot use indeterminate on an uncontrolled checkbox')\n indeterminate = undefined\n }\n\n if (!label && !props['aria-label'] && !props['aria-labelledby']) {\n // eslint-disable-next-line no-console\n console.warn('A Checkbox needs a label')\n }\n\n const [keyFocused, setKeyFocused] = React.useState(false)\n const [checkedState, setChecked] = React.useState(props.checked ?? defaultChecked ?? false)\n const isChecked = props.checked ?? checkedState\n\n const internalRef = React.useRef<HTMLInputElement>(null)\n const combinedRef = useForkRef(internalRef, ref)\n React.useEffect(\n function setIndeterminate() {\n if (internalRef.current && typeof indeterminate === 'boolean') {\n internalRef.current.indeterminate = indeterminate\n }\n },\n [indeterminate],\n )\n\n return (\n <Box\n as=\"label\"\n display=\"flex\"\n alignItems=\"center\"\n className={[\n styles.container,\n disabled ? styles.disabled : null,\n isChecked ? styles.checked : null,\n keyFocused ? styles.keyFocused : null,\n ]}\n >\n <input\n {...props}\n ref={combinedRef}\n type=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : isChecked}\n checked={isChecked}\n disabled={disabled}\n onChange={(event) => {\n onChange?.(event)\n if (!event.defaultPrevented) {\n setChecked(event.currentTarget.checked)\n }\n }}\n onBlur={(event) => {\n setKeyFocused(false)\n props?.onBlur?.(event)\n }}\n onKeyUp={(event) => {\n setKeyFocused(true)\n props?.onKeyUp?.(event)\n }}\n />\n <CheckboxIcon\n checked={isChecked}\n disabled={disabled}\n indeterminate={indeterminate}\n aria-hidden\n />\n {icon ? (\n <Box display=\"flex\" className={styles.icon} aria-hidden>\n {icon}\n </Box>\n ) : null}\n {label ? (\n <Box display=\"flex\" className={styles.label}>\n <Text>{label}</Text>\n </Box>\n ) : null}\n </Box>\n )\n})\n\nexport { CheckboxField }\nexport type { CheckboxFieldProps }\n","import { useMemo } from 'react'\n\n/**\n * Sets both a function and object React ref.\n */\nfunction setRef<T>(\n ref: React.RefCallback<T> | React.MutableRefObject<T> | null | undefined,\n value: T,\n) {\n if (typeof ref === 'function') {\n ref(value)\n } else if (ref) {\n ref.current = value\n }\n}\n\n/**\n * Merges React Refs into a single memoized function ref so you can pass it to an element.\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const internalRef = React.useRef();\n * return <div {...props} ref={useForkRef(internalRef, ref)} />;\n * });\n */\nfunction useForkRef(...refs: Array<React.Ref<unknown> | undefined>) {\n return useMemo(\n () => {\n if (!refs.some(Boolean)) return\n return (value: unknown) => {\n refs.forEach((ref) => setRef(ref, value))\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n refs,\n )\n}\n\nexport { useForkRef }\n","import * as React from 'react'\n\nfunction PasswordVisibleIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"none\" fillRule=\"evenodd\" stroke=\"gray\">\n <path d=\"M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3.5\" />\n </g>\n </svg>\n )\n}\n\nexport { PasswordVisibleIcon }\n","import * as React from 'react'\n\nfunction PasswordHiddenIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"gray\" fillRule=\"evenodd\" transform=\"translate(2 4)\">\n <path\n fillRule=\"nonzero\"\n d=\"M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z\"\n />\n <path\n fillRule=\"nonzero\"\n d=\"M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z\"\n />\n <rect\n width=\"21\"\n height=\"1\"\n x=\"-.722\"\n y=\"7.778\"\n rx=\".5\"\n transform=\"rotate(-45 9.778 8.278)\"\n />\n </g>\n </svg>\n )\n}\n\nexport { PasswordHiddenIcon }\n","import * as React from 'react'\nimport { Box, BoxProps } from '../box'\nimport { useId } from '../utils/common-helpers'\nimport { Text } from '../text'\nimport styles from './base-field.module.css'\nimport { Stack } from '../stack'\n\nimport type { WithEnhancedClassName } from '../utils/common-types'\nimport { Spinner } from '../spinner'\nimport { Column, Columns } from '../columns'\n\n// Define the remaining characters before the character count turns red\n// See: https://twist.com/a/1585/ch/765851/t/6664583/c/93631846 for latest spec\nconst MAX_LENGTH_THRESHOLD = 0\n\ntype FieldTone = 'neutral' | 'success' | 'error' | 'loading'\n\ntype FieldMessageProps = {\n id: string\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction fieldToneToTextTone(tone: FieldTone) {\n return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary'\n}\n\nfunction FieldMessage({ id, children, tone }: FieldMessageProps) {\n return (\n <Text as=\"p\" tone={fieldToneToTextTone(tone)} size=\"copy\" id={id}>\n {tone === 'loading' ? (\n <Box\n as=\"span\"\n marginRight=\"xsmall\"\n display=\"inlineFlex\"\n className={styles.loadingIcon}\n >\n <Spinner size={16} />\n </Box>\n ) : null}\n {children}\n </Text>\n )\n}\n\ntype FieldCharacterCountProps = {\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction FieldCharacterCount({ children, tone }: FieldCharacterCountProps) {\n return (\n <Text tone={fieldToneToTextTone(tone)} size=\"copy\">\n {children}\n </Text>\n )\n}\n\ntype ValidateInputLengthProps = {\n value?: React.InputHTMLAttributes<unknown>['value']\n maxLength?: number\n}\n\ntype ValidateInputLengthResult = {\n count: string | null\n tone: FieldTone\n}\n\nfunction validateInputLength({\n value,\n maxLength,\n}: ValidateInputLengthProps): ValidateInputLengthResult {\n if (!maxLength) {\n return {\n count: null,\n tone: 'neutral',\n }\n }\n\n const currentLength = String(value || '').length\n const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD\n\n return {\n count: `${currentLength}/${maxLength}`,\n tone: isNearMaxLength ? 'error' : 'neutral',\n }\n}\n\n//\n// BaseField\n//\n\ntype ChildrenRenderProps = {\n id: string\n value?: React.InputHTMLAttributes<unknown>['value']\n 'aria-describedby'?: string\n 'aria-invalid'?: true\n onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>\n characterCountElement?: React.ReactNode | null\n}\n\ntype HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<\n React.InputHTMLAttributes<T>,\n T\n>\n\ntype BaseFieldVariant = 'default' | 'bordered'\ntype BaseFieldVariantProps = {\n /**\n * Provides alternative visual layouts or modes that the field can be rendered in.\n *\n * Namely, there are two variants supported:\n *\n * - the default one\n * - a \"bordered\" variant, where the border of the field surrounds also the labels, instead\n * of just surrounding the actual field element\n *\n * In both cases, the message and description texts for the field lie outside the bordered\n * area.\n */\n variant?: BaseFieldVariant\n}\n\nexport type BaseFieldProps = WithEnhancedClassName &\n Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {\n /**\n * The main label for this field element.\n *\n * This prop is not optional. Consumers of field components must be explicit about not\n * wanting a label by passing `label=\"\"` or `label={null}`. In those situations, consumers\n * should make sure that fields are properly labelled semantically by other means (e.g using\n * `aria-labelledby`, or rendering a `<label />` element referencing the field by id).\n *\n * Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.\n *\n * @see BaseFieldProps['auxiliaryLabel']\n */\n label: React.ReactNode\n\n /**\n * The initial value for this field element.\n *\n * This prop is used to calculate the character count for the initial value, and is then\n * passed to the underlying child element.\n */\n value?: React.InputHTMLAttributes<unknown>['value']\n\n /**\n * An optional extra element to be placed to the right of the main label.\n *\n * This extra element is not included in the accessible name of the field element. Its only\n * purpose is either visual, or functional (if you include interactive elements in it).\n *\n * @see BaseFieldProps['label']\n *\n * @deprecated The usage of this element is discouraged given that it was removed from the\n * latest form field spec revision.\n */\n auxiliaryLabel?: React.ReactNode\n\n /**\n * A message associated with the field. It is rendered below the field, and with an\n * appearance that conveys the tone of the field (e.g. coloured red for errors, green for\n * success, etc).\n *\n * The message element is associated to the field via the `aria-describedby` attribute.\n *\n * In the future, when `aria-errormessage` gets better user agent support, we should use it\n * to associate the filed with a message when tone is `\"error\"`.\n *\n * @see BaseFieldProps['tone']\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid\n */\n message?: React.ReactNode\n\n /**\n * The tone with which the message, if any, is presented.\n *\n * If the tone is `\"error\"`, the field border turns red, and the message, if any, is also\n * red.\n *\n * When the tone is `\"loading\"`, it is recommended that you also disable the field. However,\n * this is not enforced by the component. It is only a recommendation.\n *\n * @see BaseFieldProps['message']\n * @see BaseFieldProps['hint']\n */\n tone?: FieldTone\n\n /**\n * The maximum width that the input field can expand to.\n */\n maxWidth?: BoxProps['maxWidth']\n\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n\n /**\n * Used internally by components composed using `BaseField`. It is not exposed as part of\n * the public props of such components.\n */\n children: (props: ChildrenRenderProps) => React.ReactNode\n\n /**\n * The position of the character count element.\n * It can be shown below the field or inline with the field.\n *\n * @default 'below'\n */\n characterCountPosition?: 'below' | 'inline' | 'hidden'\n } & (\n | {\n supportsStartAndEndSlots?: false\n endSlot?: never\n endSlotPosition?: never\n }\n | {\n supportsStartAndEndSlots: true\n endSlot?: React.ReactElement | string | number\n /**\n * This is solely for `bordered` variants of TextField. When set to `bottom` (the default),\n * the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot\n * will be placed to the side of both the input field and the label.\n */\n endSlotPosition?: 'bottom' | 'fullHeight'\n }\n )\n\ntype FieldComponentProps<T extends HTMLElement> = Omit<\n BaseFieldProps,\n 'children' | 'className' | 'fieldRef' | 'variant'\n> &\n Omit<HtmlInputProps<T>, 'className' | 'style'>\n\n/**\n * BaseField is a base component that provides a consistent structure for form fields.\n */\nfunction BaseField({\n variant = 'default',\n label,\n value,\n auxiliaryLabel,\n message,\n tone = 'neutral',\n className,\n children,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': originalAriaDescribedBy,\n id: originalId,\n characterCountPosition = 'below',\n endSlot,\n endSlotPosition = 'bottom',\n}: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName) {\n const id = useId(originalId)\n const messageId = useId()\n\n const inputLength = validateInputLength({ value, maxLength })\n\n const [characterCount, setCharacterCount] = React.useState<string | null>(inputLength.count)\n const [characterCountTone, setCharacterCountTone] = React.useState<FieldTone>(inputLength.tone)\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null)\n\n /**\n * Renders the character count element.\n * If the characterCountPosition value is 'hidden', it returns null.\n */\n function renderCharacterCount() {\n return characterCountPosition !== 'hidden' ? (\n <FieldCharacterCount tone={characterCountTone}>{characterCount}</FieldCharacterCount>\n ) : null\n }\n\n const childrenProps: ChildrenRenderProps = {\n id,\n value,\n ...(ariaDescribedBy ? { 'aria-describedby': ariaDescribedBy } : {}),\n 'aria-invalid': tone === 'error' ? true : undefined,\n onChange(event) {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value: event.currentTarget.value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n // If the character count is inline, we pass it as a prop to the children element so it can be rendered inline\n characterCountElement: characterCountPosition === 'inline' ? renderCharacterCount() : null,\n }\n\n React.useEffect(\n function updateCharacterCountOnPropChange() {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n [maxLength, value],\n )\n\n return (\n <Stack space=\"xsmall\" hidden={hidden}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n className={[\n className,\n styles.container,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n alignItems=\"center\"\n >\n <Box flexGrow={1}>\n {label || auxiliaryLabel ? (\n <Box\n as=\"span\"\n display=\"flex\"\n justifyContent=\"spaceBetween\"\n alignItems=\"flexEnd\"\n >\n <Text\n size={variant === 'bordered' ? 'caption' : 'body'}\n as=\"label\"\n htmlFor={id}\n >\n {label ? (\n <span className={styles.primaryLabel}>{label}</span>\n ) : null}\n </Text>\n {auxiliaryLabel ? (\n <Box className={styles.auxiliaryLabel} paddingLeft=\"small\">\n {auxiliaryLabel}\n </Box>\n ) : null}\n </Box>\n ) : null}\n {children(childrenProps)}\n </Box>\n {endSlot && endSlotPosition === 'fullHeight' ? endSlot : null}\n </Box>\n\n {message || characterCount ? (\n <Columns align=\"right\" space=\"small\" maxWidth={maxWidth}>\n {message ? (\n <Column width=\"auto\">\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n </Column>\n ) : null}\n\n {/* If the character count is below the field, we render it, if it's inline,\n we pass it as a prop to the children element so it can be rendered inline */}\n {characterCountPosition === 'below' ? (\n <Column width=\"content\">{renderCharacterCount()}</Column>\n ) : null}\n </Columns>\n ) : null}\n </Stack>\n )\n}\n\nexport { BaseField, FieldMessage }\nexport type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps }\n","import * as React from 'react'\nimport { BaseField, BaseFieldVariantProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-field.module.css'\nimport type { BaseFieldProps, FieldComponentProps } from '../base-field'\nimport { useMergeRefs } from 'use-callback-ref'\n\ntype TextFieldType = 'email' | 'search' | 'tel' | 'text' | 'url'\n\ninterface TextFieldProps\n extends Omit<FieldComponentProps<HTMLInputElement>, 'type' | 'supportsStartAndEndSlots'>,\n BaseFieldVariantProps,\n Pick<BaseFieldProps, 'characterCountPosition'> {\n type?: TextFieldType\n startSlot?: React.ReactElement | string | number\n endSlot?: React.ReactElement | string | number\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n}\n\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n {\n variant = 'default',\n id,\n label,\n value,\n auxiliaryLabel,\n message,\n tone,\n type = 'text',\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n startSlot,\n endSlot,\n onChange: originalOnChange,\n characterCountPosition = 'below',\n endSlotPosition = 'bottom',\n ...props\n },\n ref,\n) {\n const internalRef = React.useRef<HTMLInputElement>(null)\n const combinedRef = useMergeRefs([ref, internalRef])\n\n function handleClick(event: React.MouseEvent) {\n if (event.currentTarget === combinedRef.current) return\n internalRef.current?.focus()\n }\n\n const displayEndSlot =\n endSlot &&\n (variant === 'default' || (variant === 'bordered' && endSlotPosition === 'bottom'))\n\n return (\n <BaseField\n variant={variant}\n id={id}\n label={label}\n value={value}\n auxiliaryLabel={auxiliaryLabel}\n message={message}\n tone={tone}\n maxWidth={maxWidth}\n maxLength={maxLength}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n characterCountPosition={characterCountPosition}\n supportsStartAndEndSlots\n endSlot={endSlot}\n endSlotPosition={variant === 'bordered' ? endSlotPosition : undefined}\n >\n {({ onChange, characterCountElement, ...extraProps }) => (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n className={[\n styles.inputWrapper,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n props.readOnly ? styles.readOnly : null,\n ]}\n onClick={handleClick}\n >\n {startSlot ? (\n <Box\n className={styles.slot}\n display=\"flex\"\n marginRight={variant === 'bordered' ? 'xsmall' : '-xsmall'}\n marginLeft={variant === 'bordered' ? '-xsmall' : 'xsmall'}\n >\n {startSlot}\n </Box>\n ) : null}\n <input\n {...props}\n {...extraProps}\n type={type}\n ref={combinedRef}\n maxLength={maxLength}\n onChange={(event) => {\n originalOnChange?.(event)\n onChange?.(event)\n }}\n />\n {displayEndSlot || characterCountElement ? (\n <Box\n className={styles.slot}\n display=\"flex\"\n marginRight={variant === 'bordered' ? '-xsmall' : 'xsmall'}\n marginLeft={variant === 'bordered' ? 'xsmall' : '-xsmall'}\n >\n {characterCountElement}\n {displayEndSlot ? endSlot : null}\n </Box>\n ) : null}\n </Box>\n )}\n </BaseField>\n )\n})\n\nexport { TextField }\nexport type { TextFieldProps, TextFieldType }\n","import * as React from 'react'\n\nimport { PasswordVisibleIcon } from '../icons/password-visible-icon'\nimport { PasswordHiddenIcon } from '../icons/password-hidden-icon'\n\nimport { TextField, TextFieldProps } from '../text-field'\nimport { IconButton } from '../button'\n\nimport type { BaseFieldVariantProps } from '../base-field'\n\ninterface PasswordFieldProps\n extends Omit<TextFieldProps, 'type' | 'startSlot' | 'endSlot'>,\n BaseFieldVariantProps {\n togglePasswordLabel?: string\n endSlot?: React.ReactElement | string | number\n}\n\nconst PasswordField = React.forwardRef<HTMLInputElement, PasswordFieldProps>(function PasswordField(\n { togglePasswordLabel = 'Toggle password visibility', endSlot, ...props },\n ref,\n) {\n const [isPasswordVisible, setPasswordVisible] = React.useState(false)\n const Icon = isPasswordVisible ? PasswordVisibleIcon : PasswordHiddenIcon\n return (\n <TextField\n {...props}\n ref={ref}\n // @ts-expect-error TextField does not support type=\"password\", so we override the type check here\n type={isPasswordVisible ? 'text' : 'password'}\n endSlot={\n <>\n {endSlot}\n <IconButton\n variant=\"quaternary\"\n icon={<Icon aria-hidden />}\n aria-label={togglePasswordLabel}\n onClick={() => setPasswordVisible((v) => !v)}\n />\n </>\n }\n />\n )\n})\n\nexport { PasswordField }\nexport type { PasswordFieldProps }\n","import * as React from 'react'\nimport { BaseField, BaseFieldVariantProps, FieldComponentProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './select-field.module.css'\n\ninterface SelectFieldProps\n extends Omit<\n FieldComponentProps<HTMLSelectElement>,\n | 'maxLength'\n | 'characterCountPosition'\n | 'endSlot'\n | 'supportsStartAndEndSlots'\n | 'endSlotPosition'\n >,\n BaseFieldVariantProps {}\n\nconst SelectField = React.forwardRef<HTMLSelectElement, SelectFieldProps>(function SelectField(\n {\n variant = 'default',\n id,\n label,\n value,\n auxiliaryLabel,\n message,\n tone,\n maxWidth,\n children,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n onChange: originalOnChange,\n ...props\n },\n ref,\n) {\n return (\n <BaseField\n variant={variant}\n id={id}\n label={label}\n value={value}\n auxiliaryLabel={auxiliaryLabel}\n message={message}\n tone={tone}\n maxWidth={maxWidth}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n >\n {(extraProps) => (\n <Box\n data-testid=\"select-wrapper\"\n className={[\n styles.selectWrapper,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n >\n <select\n {...props}\n {...extraProps}\n ref={ref}\n onChange={(event) => {\n originalOnChange?.(event)\n }}\n >\n {children}\n </select>\n <SelectChevron aria-hidden />\n </Box>\n )}\n </BaseField>\n )\n})\n\nfunction SelectChevron(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"16\" height=\"16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M11.646 5.646a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 1 1 .708-.708L8 9.293l3.646-3.647z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { SelectField }\nexport type { SelectFieldProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport { Stack } from '../stack'\nimport { Text } from '../text'\nimport { HiddenVisually } from '../hidden-visually'\nimport { FieldComponentProps, FieldMessage } from '../base-field'\nimport { useId } from '../utils/common-helpers'\nimport styles from './switch-field.module.css'\n\ninterface SwitchFieldProps\n extends Omit<\n FieldComponentProps<HTMLInputElement>,\n | 'type'\n | 'auxiliaryLabel'\n | 'maxWidth'\n | 'aria-describedby'\n | 'aria-label'\n | 'aria-labelledby'\n > {\n /**\n * Identifies the element (or elements) that describes the switch for assistive technologies.\n */\n 'aria-describedby'?: string\n\n /**\n * Defines a string value that labels the current switch for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * Identifies the element (or elements) that labels the current switch for assistive technologies.\n */\n 'aria-labelledby'?: string\n}\n\nconst SwitchField = React.forwardRef<HTMLInputElement, SwitchFieldProps>(function SwitchField(\n {\n label,\n message,\n tone = 'neutral',\n disabled = false,\n hidden,\n defaultChecked,\n id: originalId,\n 'aria-describedby': originalAriaDescribedBy,\n 'aria-label': originalAriaLabel,\n 'aria-labelledby': originalAriaLabelledby,\n onChange,\n ...props\n },\n ref,\n) {\n const id = useId(originalId)\n const messageId = useId()\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : undefined)\n const ariaLabel = originalAriaLabel ?? undefined\n const ariaLabelledBy = originalAriaLabelledby ?? undefined\n\n const [keyFocused, setKeyFocused] = React.useState(false)\n const [checkedState, setChecked] = React.useState(props.checked ?? defaultChecked ?? false)\n const isChecked = props.checked ?? checkedState\n\n return (\n <Stack space=\"small\" hidden={hidden}>\n <Box\n className={[\n styles.container,\n disabled ? styles.disabled : null,\n isChecked ? styles.checked : null,\n keyFocused ? styles.keyFocused : null,\n ]}\n as=\"label\"\n display=\"flex\"\n alignItems=\"center\"\n >\n <Box\n position=\"relative\"\n display=\"inlineBlock\"\n overflow=\"visible\"\n marginRight=\"small\"\n flexShrink={0}\n className={styles.toggle}\n >\n <HiddenVisually>\n <input\n {...props}\n id={id}\n type=\"checkbox\"\n disabled={disabled}\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n checked={isChecked}\n onChange={(event) => {\n onChange?.(event)\n if (!event.defaultPrevented) {\n setChecked(event.currentTarget.checked)\n }\n }}\n onBlur={(event) => {\n setKeyFocused(false)\n props?.onBlur?.(event)\n }}\n onKeyUp={(event) => {\n setKeyFocused(true)\n props?.onKeyUp?.(event)\n }}\n />\n </HiddenVisually>\n <span className={styles.handle} />\n </Box>\n <Text exceptionallySetClassName={styles.label}>{label}</Text>\n </Box>\n {message ? (\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n ) : null}\n </Stack>\n )\n})\n\nexport { SwitchField }\nexport type { SwitchFieldProps }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport { useMergeRefs } from 'use-callback-ref'\nimport { BaseField, BaseFieldVariantProps, FieldComponentProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-area.module.css'\n\ninterface TextAreaProps\n extends FieldComponentProps<HTMLTextAreaElement>,\n Omit<BaseFieldVariantProps, 'supportsStartAndEndSlots' | 'endSlot' | 'endSlotPosition'> {\n /**\n * The number of visible text lines for the text area.\n *\n * If it is specified, it must be a positive integer. If it is not specified, the default\n * value is 2 (set by the browser).\n *\n * When `autoExpand` is true, this value serves the purpose of specifying the minimum number\n * of rows that the textarea will shrink to when the content is not large enough to make it\n * expand.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n */\n rows?: number\n\n /**\n * If `true`, the textarea will be automatically resized to fit the content, and the ability to\n * manually resize the textarea will be disabled.\n */\n autoExpand?: boolean\n\n /**\n * If `true`, the ability to manually resize the textarea will be disabled.\n *\n * When `autoExpand` is true, this property serves no purpose, because the ability to manually\n * resize the textarea is always disabled when `autoExpand` is true.\n */\n disableResize?: boolean\n}\n\nconst TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n {\n variant = 'default',\n id,\n label,\n value,\n auxiliaryLabel,\n message,\n tone,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n rows,\n autoExpand = false,\n disableResize = false,\n onChange: originalOnChange,\n ...props\n },\n ref,\n) {\n const containerRef = React.useRef<HTMLDivElement>(null)\n const internalRef = React.useRef<HTMLTextAreaElement>(null)\n const combinedRef = useMergeRefs([ref, internalRef])\n\n const textAreaClassName = classNames([\n autoExpand ? styles.disableResize : null,\n disableResize ? styles.disableResize : null,\n ])\n\n React.useEffect(\n function setupAutoExpand() {\n const containerElement = containerRef.current\n\n function handleAutoExpand(value: string) {\n if (containerElement) {\n containerElement.dataset.replicatedValue = value\n }\n }\n\n function handleInput(event: Event) {\n handleAutoExpand((event.currentTarget as HTMLTextAreaElement).value)\n }\n\n const textAreaElement = internalRef.current\n if (!textAreaElement || !autoExpand) {\n return undefined\n }\n\n // Apply change initially, in case the text area has a non-empty initial value\n handleAutoExpand(textAreaElement.value)\n\n textAreaElement.addEventListener('input', handleInput)\n return () => textAreaElement.removeEventListener('input', handleInput)\n },\n [autoExpand],\n )\n\n return (\n <BaseField\n variant={variant}\n id={id}\n label={label}\n value={value}\n auxiliaryLabel={auxiliaryLabel}\n message={message}\n tone={tone}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n className={[\n styles.textAreaContainer,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n maxLength={maxLength}\n >\n {({ onChange, ...extraProps }) => (\n <Box\n width=\"full\"\n display=\"flex\"\n className={styles.innerContainer}\n ref={containerRef}\n >\n <textarea\n {...props}\n {...extraProps}\n ref={combinedRef}\n rows={rows}\n className={textAreaClassName}\n maxLength={maxLength}\n onChange={(event) => {\n originalOnChange?.(event)\n onChange?.(event)\n }}\n />\n </Box>\n )}\n </BaseField>\n )\n})\n\nexport { TextArea }\nexport type { TextAreaProps }\n","function getInitials(name?: string) {\n if (!name) {\n return ''\n }\n\n const seed = name.trim().split(' ')\n const firstInitial = seed[0]\n const lastInitial = seed[seed.length - 1]\n\n let initials = firstInitial?.[0]\n if (\n firstInitial != null &&\n lastInitial != null &&\n initials != null &&\n // Better readable this way.\n // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with\n firstInitial[0] !== lastInitial[0]\n ) {\n initials += lastInitial[0]\n }\n return initials?.toUpperCase()\n}\n\nfunction emailToIndex(email: string, maxIndex: number) {\n const seed = email.split('@')[0]\n const hash = seed ? seed.charCodeAt(0) + seed.charCodeAt(seed.length - 1) || 0 : 0\n return hash % maxIndex\n}\n\nexport { getInitials, emailToIndex }\n","import * as React from 'react'\n\nimport { getInitials, emailToIndex } from './utils'\n\nimport { getClassNames, ResponsiveProp } from '../utils/responsive-props'\nimport styles from './avatar.module.css'\nimport { Box } from '../box'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nconst AVATAR_COLORS = [\n '#fcc652',\n '#e9952c',\n '#e16b2d',\n '#d84b40',\n '#e8435a',\n '#e5198a',\n '#ad3889',\n '#86389c',\n '#a8a8a8',\n '#98be2f',\n '#5d9d50',\n '#5f9f85',\n '#5bbcb6',\n '#32a3bf',\n '#2bafeb',\n '#2d88c3',\n '#3863cc',\n '#5e5e5e',\n]\n\ntype AvatarSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl'\n\ntype Props = ObfuscatedClassName & {\n /** @deprecated Please use `exceptionallySetClassName` */\n className?: string\n /** @deprecated */\n colorList?: string[]\n size?: ResponsiveProp<AvatarSize>\n avatarUrl?: string\n user: { name?: string; email: string }\n}\n\nfunction Avatar({\n user,\n avatarUrl,\n size = 'l',\n className,\n colorList = AVATAR_COLORS,\n exceptionallySetClassName,\n ...props\n}: Props) {\n const userInitials = getInitials(user.name) || getInitials(user.email)\n const avatarSize = size ? size : 'l'\n\n const style = avatarUrl\n ? {\n backgroundImage: `url(${avatarUrl})`,\n textIndent: '-9999px', // hide the initials\n }\n : {\n backgroundColor: colorList[emailToIndex(user.email, colorList.length)],\n }\n\n const sizeClassName = getClassNames(styles, 'size', avatarSize)\n\n return (\n <Box\n className={[className, styles.avatar, sizeClassName, exceptionallySetClassName]}\n style={style}\n {...props}\n >\n {userInitials}\n </Box>\n )\n}\nAvatar.displayName = 'Avatar'\n\nexport { Avatar }\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport FocusLock from 'react-focus-lock'\nimport { hideOthers } from 'aria-hidden'\n\nimport { Dialog, DialogOptions, useDialogStore, Portal, PortalOptions } from '@ariakit/react'\n\nimport { CloseIcon } from '../icons/close-icon'\nimport { Column, Columns } from '../columns'\nimport { Inline } from '../inline'\nimport { Divider } from '../divider'\nimport { Box } from '../box'\nimport { IconButtonProps, IconButton } from '../button'\n\nimport styles from './modal.module.css'\nimport type { ObfuscatedClassName } from '../utils/common-types'\nimport { forwardRef } from 'react'\n\ntype ModalWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'full'\ntype ModalHeightMode = 'expand' | 'fitContent'\n\n//\n// ModalContext\n//\n\ntype ModalContextValue = {\n onDismiss?(this: void): void\n height: ModalHeightMode\n}\n\nconst ModalContext = React.createContext<ModalContextValue>({\n onDismiss: undefined,\n height: 'fitContent',\n})\n\n//\n// Modal container\n//\n\ntype DivProps = Omit<\n React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLDivElement>, HTMLDivElement>,\n 'className' | 'children' | `aria-label` | `aria-labelledby`\n>\n\nexport interface ModalProps extends DivProps, ObfuscatedClassName {\n /**\n * The content of the modal.\n */\n children: React.ReactNode\n\n /**\n * Whether the modal is open and visible or not.\n */\n isOpen: boolean\n\n /**\n * Called when the user triggers closing the modal.\n */\n onDismiss?(): void\n\n /**\n * A descriptive setting for how wide the modal should aim to be, depending on how much space\n * it has on screen.\n * @default 'medium'\n */\n width?: ModalWidth\n\n /**\n * A descriptive setting for how tall the modal should aim to be.\n *\n * - 'expand': the modal aims to fill most of the available screen height, leaving only a small\n * padding above and below.\n * - 'fitContent': the modal shrinks to the smallest size that allow it to fit its content.\n *\n * In either case, if content does not fit, the content of the main body is set to scroll\n * (provided you use `ModalBody`) so that the modal never has to strech vertically beyond the\n * viewport boundaries.\n *\n * If you do not use `ModalBody`, the modal still prevents overflow, and you are in charge of\n * the inner layout to ensure scroll, or whatever other strategy you may want.\n */\n height?: ModalHeightMode\n\n /**\n * Whether to set or not the focus initially to the first focusable element inside the modal.\n */\n autoFocus?: boolean\n\n /**\n * Controls if the modal is dismissed when pressing \"Escape\".\n */\n hideOnEscape?: DialogOptions['hideOnEscape']\n\n /**\n * Controls if the modal is dismissed when clicking outside the modal body, on the overlay.\n */\n hideOnInteractOutside?: DialogOptions['hideOnInteractOutside']\n\n /**\n * An escape hatch in case you need to provide a custom class name to the overlay element.\n */\n exceptionallySetOverlayClassName?: string\n\n /**\n * Defines a string value that labels the current modal for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * Identifies the element (or elements) that labels the current modal for assistive technologies.\n */\n 'aria-labelledby'?: string\n\n /**\n * An HTML element or a memoized callback function that returns an HTML element to be used as\n * the portal element. By default, the portal element will be a `div` element appended to the\n * `document.body`.\n *\n * @default HTMLDivElement\n *\n * @example\n * const [portal, setPortal] = useState(null);\n * <Portal portalElement={portal} />;\n * <div ref={setPortal} />;\n *\n * @example\n * const getPortalElement = useCallback(() => {\n * const div = document.createElement(\"div\");\n * const portalRoot = document.getElementById(\"portal-root\");\n * portalRoot.appendChild(div);\n * return div;\n * }, []);\n * <Portal portalElement={getPortalElement} />;\n */\n portalElement?: PortalOptions['portalElement']\n}\n\nfunction isNotInternalFrame(element: HTMLElement) {\n return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe')\n}\n\n/**\n * Renders a modal that sits on top of the rest of the content in the entire page.\n *\n * Follows the WAI-ARIA Dialog (Modal) Pattern.\n *\n * @see ModalHeader\n * @see ModalFooter\n * @see ModalBody\n */\nexport function Modal({\n isOpen,\n onDismiss,\n height = 'fitContent',\n width = 'medium',\n exceptionallySetClassName,\n exceptionallySetOverlayClassName,\n autoFocus = true,\n hideOnEscape = true,\n hideOnInteractOutside = true,\n children,\n portalElement,\n onKeyDown,\n // @ts-expect-error we want to make sure to not pass it to the Dialog component\n className,\n ...props\n}: ModalProps) {\n const setOpen = React.useCallback(\n (visible: boolean) => {\n if (!visible) {\n onDismiss?.()\n }\n },\n [onDismiss],\n )\n const store = useDialogStore({ open: isOpen, setOpen })\n\n const contextValue: ModalContextValue = React.useMemo(() => ({ onDismiss, height }), [\n onDismiss,\n height,\n ])\n\n const portalRef = React.useRef<HTMLElement | null>(null)\n const dialogRef = React.useRef<HTMLDivElement | null>(null)\n const backdropRef = React.useRef<HTMLDivElement | null>(null)\n const handleBackdropClick = React.useCallback(\n (event: React.MouseEvent) => {\n if (\n // The focus lock element takes up the same space as the backdrop and is where the event bubbles up from,\n // so instead of checking the backdrop as the event target, we need to make sure it's just above the dialog\n !dialogRef.current?.contains(event.target as Node) &&\n // Events fired from other portals will bubble up to the backdrop, even if it isn't a child in the DOM\n backdropRef.current?.contains(event.target as Node)\n ) {\n event.stopPropagation()\n onDismiss?.()\n }\n },\n [onDismiss],\n )\n\n React.useLayoutEffect(\n function disableAccessibilityTreeOutside() {\n if (!isOpen || !portalRef.current) {\n return\n }\n\n return hideOthers(portalRef.current)\n },\n [isOpen],\n )\n\n const handleKeyDown = React.useCallback(\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n if (\n hideOnEscape &&\n onDismiss != null &&\n event.key === 'Escape' &&\n !event.defaultPrevented\n ) {\n event.stopPropagation()\n onDismiss()\n }\n onKeyDown?.(event)\n },\n [onDismiss, hideOnEscape, onKeyDown],\n )\n\n if (!isOpen) {\n return null\n }\n\n return (\n <Portal portalRef={portalRef} portalElement={portalElement}>\n <Box\n data-testid=\"modal-overlay\"\n data-overlay\n className={classNames(\n styles.overlay,\n styles[height],\n styles[width],\n exceptionallySetOverlayClassName,\n )}\n /**\n * We're using `onPointerDown` instead of `onClick` to prevent the modal from\n * closing when the click starts inside the modal and ends on the backdrop.\n */\n onPointerDown={hideOnInteractOutside ? handleBackdropClick : undefined}\n ref={backdropRef}\n >\n <FocusLock\n autoFocus={autoFocus}\n whiteList={isNotInternalFrame}\n returnFocus={true}\n crossFrame={false}\n >\n <Dialog\n {...props}\n ref={dialogRef}\n render={\n <Box\n borderRadius=\"full\"\n background=\"default\"\n display=\"flex\"\n flexDirection=\"column\"\n overflow=\"hidden\"\n height={height === 'expand' ? 'full' : undefined}\n flexGrow={height === 'expand' ? 1 : 0}\n />\n }\n className={classNames(exceptionallySetClassName, styles.container)}\n store={store}\n preventBodyScroll\n // Disable focus lock as we set up our own using ReactFocusLock\n modal={false}\n autoFocus={false}\n autoFocusOnShow={false}\n autoFocusOnHide={false}\n // Disable portal and backdrop as we control their markup\n portal={false}\n backdrop={false}\n hideOnInteractOutside={false}\n hideOnEscape={false}\n onKeyDown={handleKeyDown}\n >\n <ModalContext.Provider value={contextValue}>\n {children}\n </ModalContext.Provider>\n </Dialog>\n </FocusLock>\n </Box>\n </Portal>\n )\n}\n\n//\n// ModalCloseButton\n//\n\nexport interface ModalCloseButtonProps\n extends Omit<\n IconButtonProps,\n 'type' | 'variant' | 'icon' | 'disabled' | 'loading' | 'tabIndex' | 'ref'\n > {\n /**\n * The descriptive label of the button.\n */\n 'aria-label': string\n}\n\n/**\n * The close button rendered by ModalHeader. Provided independently so that consumers can customize\n * the button's label.\n *\n * @see ModalHeader\n */\nexport function ModalCloseButton(props: ModalCloseButtonProps) {\n const { onDismiss } = React.useContext(ModalContext)\n const [includeInTabOrder, setIncludeInTabOrder] = React.useState(false)\n const [isMounted, setIsMounted] = React.useState(false)\n\n React.useEffect(\n function skipAutoFocus() {\n if (isMounted) {\n setIncludeInTabOrder(true)\n } else {\n setIsMounted(true)\n }\n },\n [isMounted],\n )\n\n return (\n <IconButton\n {...props}\n variant=\"quaternary\"\n onClick={onDismiss}\n icon={<CloseIcon />}\n tabIndex={includeInTabOrder ? 0 : -1}\n />\n )\n}\n\n//\n// ModalHeader\n//\n\nexport interface ModalHeaderProps extends DivProps, ObfuscatedClassName {\n /**\n * The content of the header.\n */\n children: React.ReactNode\n\n /**\n * Allows to provide a custom button element, or to omit the close button if set to false.\n * @see ModalCloseButton\n */\n button?: React.ReactNode | boolean\n\n /**\n * Whether to render a divider line below the header.\n * @default false\n */\n withDivider?: boolean\n}\n\n/**\n * Renders a standard modal header area with an optional close button.\n *\n * @see Modal\n * @see ModalFooter\n * @see ModalBody\n */\nexport function ModalHeader({\n children,\n button = true,\n withDivider = false,\n exceptionallySetClassName,\n ...props\n}: ModalHeaderProps) {\n return (\n <>\n <Box\n {...props}\n as=\"header\"\n paddingLeft=\"large\"\n paddingRight={button === false || button === null ? 'large' : 'small'}\n paddingY=\"small\"\n className={exceptionallySetClassName}\n >\n <Columns space=\"large\" alignY=\"center\">\n <Column width=\"auto\">{children}</Column>\n {button === false || button === null ? (\n <div className={styles.headerContent} />\n ) : (\n <Column\n width=\"content\"\n exceptionallySetClassName={styles.buttonContainer}\n data-testid=\"button-container\"\n >\n {typeof button === 'boolean' ? (\n <ModalCloseButton aria-label=\"Close modal\" autoFocus={false} />\n ) : (\n button\n )}\n </Column>\n )}\n </Columns>\n </Box>\n {withDivider ? <Divider /> : null}\n </>\n )\n}\n\n//\n// ModalBody\n//\n\nexport interface ModalBodyProps extends DivProps, ObfuscatedClassName {\n /**\n * The content of the modal body.\n */\n children: React.ReactNode\n}\n\n/**\n * Renders the body of a modal.\n *\n * Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other\n * things, that the content of the modal body expands or contracts depending on the modal height\n * setting or the size of the content. The body content also automatically scrolls when it's too\n * large to fit the available space.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalFooter\n */\nexport const ModalBody = forwardRef<HTMLDivElement, ModalBodyProps>(function ModalBody(\n { exceptionallySetClassName, children, ...props },\n ref,\n) {\n const { height } = React.useContext(ModalContext)\n return (\n <Box\n {...props}\n ref={ref}\n className={exceptionallySetClassName}\n flexGrow={height === 'expand' ? 1 : 0}\n height={height === 'expand' ? 'full' : undefined}\n overflow=\"auto\"\n >\n <Box padding=\"large\" paddingBottom=\"xxlarge\">\n {children}\n </Box>\n </Box>\n )\n})\n\n//\n// ModalFooter\n//\n\nexport interface ModalFooterProps extends DivProps, ObfuscatedClassName {\n /**\n * The contant of the modal footer.\n */\n children: React.ReactNode\n /**\n * Whether to render a divider line below the footer.\n * @default false\n */\n withDivider?: boolean\n}\n\n/**\n * Renders a standard modal footer area.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalBody\n */\nexport function ModalFooter({\n exceptionallySetClassName,\n withDivider = false,\n ...props\n}: ModalFooterProps) {\n return (\n <>\n {withDivider ? <Divider /> : null}\n <Box as=\"footer\" {...props} className={exceptionallySetClassName} padding=\"large\" />\n </>\n )\n}\n\n//\n// ModalActions\n//\n\nexport type ModalActionsProps = ModalFooterProps\n\n/**\n * A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).\n * @see ModalFooter\n */\nexport function ModalActions({ children, ...props }: ModalActionsProps) {\n return (\n <ModalFooter {...props}>\n <Inline align=\"right\" space=\"large\">\n {children}\n </Inline>\n </ModalFooter>\n )\n}\n","import * as React from 'react'\nimport classNames from 'classnames'\nimport {\n useTabStore,\n Tab as BaseTab,\n TabProps as BaseTabProps,\n TabList as BaseTabList,\n TabPanel as BaseTabPanel,\n TabPanelProps as BaseTabPanelProps,\n TabStore,\n} from '@ariakit/react'\nimport { Inline } from '../inline'\nimport type { ObfuscatedClassName, Space } from '../utils/common-types'\n\nimport styles from './tabs.module.css'\nimport { Box } from '../box'\n\ntype TabsContextValue = Required<Pick<TabsProps, 'variant'>> & {\n tabStore: TabStore\n}\n\nconst TabsContext = React.createContext<TabsContextValue | null>(null)\n\ninterface TabsProps {\n /**\n * The `<Tabs>` component must be composed from a `<TabList>` and corresponding `<TabPanel>`\n * components\n */\n children: React.ReactNode\n\n /**\n * Determines the look and feel of the tabs\n */\n variant?: 'themed' | 'neutral'\n\n /**\n * The id of the selected tab. Assigning a value makes this a controlled component\n */\n selectedId?: string | null\n\n /**\n * The tab to initially select. This can be used if the component should not\n * be a controlled component but needs to have a tab selected\n */\n defaultSelectedId?: string | null\n\n /**\n * Called with the tab id when a tab is selected\n */\n onSelectedIdChange?: (selectedId: string | null | undefined) => void\n}\n\n/**\n * Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.\n */\nfunction Tabs({\n children,\n selectedId,\n defaultSelectedId,\n variant = 'neutral',\n onSelectedIdChange,\n}: TabsProps): React.ReactElement {\n const tabStore = useTabStore({\n defaultSelectedId,\n selectedId,\n setSelectedId: onSelectedIdChange,\n })\n const actualSelectedId = tabStore.useState('selectedId')\n\n const memoizedTabState = React.useMemo(\n () => ({ tabStore, variant, selectedId: selectedId ?? actualSelectedId ?? null }),\n [variant, tabStore, selectedId, actualSelectedId],\n )\n return <TabsContext.Provider value={memoizedTabState}>{children}</TabsContext.Provider>\n}\n\ninterface TabProps\n extends ObfuscatedClassName,\n Omit<BaseTabProps, 'store' | 'className' | 'children' | 'id'> {\n /**\n * The content to render inside of the tab button\n */\n children: React.ReactNode\n\n /**\n * The tab's identifier. This must match its corresponding `<TabPanel>`'s id\n */\n id: string\n}\n\n/**\n * Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.\n */\nconst Tab = React.forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { children, id, exceptionallySetClassName, render, onClick },\n ref,\n): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n if (!tabContextValue) return null\n\n const { variant, tabStore } = tabContextValue\n const className = classNames(exceptionallySetClassName, styles.tab, styles[`tab-${variant}`])\n\n return (\n <BaseTab\n id={id}\n ref={ref}\n store={tabStore}\n render={render}\n className={className}\n onClick={onClick}\n >\n {children}\n </BaseTab>\n )\n})\n\ntype TabListProps = (\n | {\n /** Labels the tab list for assistive technologies. This must be provided if `aria-labelledby` is omitted. */\n 'aria-label': string\n }\n | {\n /**\n * One or more element IDs used to label the tab list for assistive technologies. Required if\n * `aria-label` is omitted.\n */\n 'aria-labelledby': string\n }\n | {\n /**\n * For cases where multiple instances of the tab list exists, the duplicates may be marked as aria-hidden\n */\n 'aria-hidden': boolean\n }\n) & {\n /**\n * A list of `<Tab>` elements\n */\n children: React.ReactNode\n\n /**\n * Controls the spacing between tabs\n */\n space?: Space\n}\n\n/**\n * A component used to group `<Tab>` elements together.\n */\nfunction TabList({ children, space, ...props }: TabListProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n\n if (!tabContextValue) {\n return null\n }\n\n const { tabStore, variant } = tabContextValue\n\n return (\n // The extra <div> prevents <Inline>'s negative margins from collapsing when used in a flex container\n // which will render the track with the wrong height\n <div>\n <BaseTabList\n store={tabStore}\n render={<Box position=\"relative\" width=\"maxContent\" />}\n {...props}\n >\n <Box className={[styles.track, styles[`track-${variant}`]]} />\n <Inline space={space}>{children}</Inline>\n </BaseTabList>\n </div>\n )\n}\n\ninterface TabPanelProps\n extends React.HTMLAttributes<HTMLDivElement>,\n Pick<BaseTabPanelProps, 'render'> {\n /** The content to be rendered inside the tab */\n children?: React.ReactNode\n\n /** The tabPanel's identifier. This must match its corresponding `<Tab>`'s id */\n id: string\n\n /**\n * By default, the tab panel's content is always rendered even when they are not active. This\n * behaviour can be changed to 'active', which renders only when the tab is active, and 'lazy',\n * meaning while inactive tab panels will not be rendered initially, they will remain mounted\n * once they are active until the entire Tabs tree is unmounted.\n */\n renderMode?: 'always' | 'active' | 'lazy'\n}\n\n/**\n * Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a\n * corresponding `<Tab>` component.\n */\nconst TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel(\n { children, id, renderMode = 'always', ...props },\n ref,\n): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const [tabRendered, setTabRendered] = React.useState(false)\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n const tabIsActive = selectedId === id\n\n React.useEffect(\n function trackTabRenderedState() {\n if (!tabRendered && tabIsActive) {\n setTabRendered(true)\n }\n },\n [tabRendered, tabIsActive],\n )\n\n if (!tabContextValue) {\n return null\n }\n\n const { tabStore } = tabContextValue\n const shouldRender =\n renderMode === 'always' ||\n (renderMode === 'active' && tabIsActive) ||\n (renderMode === 'lazy' && (tabIsActive || tabRendered))\n\n return shouldRender ? (\n <BaseTabPanel {...props} tabId={id} store={tabStore} ref={ref}>\n {children}\n </BaseTabPanel>\n ) : null\n})\n\ntype TabAwareSlotProps = {\n /**\n * Render prop used to provide the content to be rendered inside the slot. The render prop will\n * be called with the current `selectedId`\n */\n children: (provided: { selectedId?: string | null }) => React.ReactElement | null\n}\n\n/**\n * Allows content to be rendered based on the current tab being selected while outside of the\n * TabPanel component. Can be placed freely within the main `<Tabs>` component.\n */\nfunction TabAwareSlot({ children }: TabAwareSlotProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n return tabContextValue ? children({ selectedId }) : null\n}\n\nexport { Tab, Tabs, TabList, TabPanel, TabAwareSlot }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport {\n Portal,\n MenuStore,\n MenuStoreProps,\n useMenuStore,\n MenuProps as AriakitMenuProps,\n Menu as AriakitMenu,\n MenuGroup as AriakitMenuGroup,\n MenuItem as AriakitMenuItem,\n MenuItemProps as AriakitMenuItemProps,\n MenuButton as AriakitMenuButton,\n MenuButtonProps as AriakitMenuButtonProps,\n Role,\n RoleProps,\n} from '@ariakit/react'\n\nimport './menu.less'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype MenuContextState = {\n menuStore: MenuStore | null\n handleItemSelect?: (value: string | null | undefined) => void\n getAnchorRect: (() => { x: number; y: number }) | null\n setAnchorRect: (rect: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>({\n menuStore: null,\n handleItemSelect: () => undefined,\n getAnchorRect: null,\n setAnchorRect: () => undefined,\n})\n\nconst SubMenuContext = React.createContext<{ isSubMenu: boolean }>({ isSubMenu: false })\n\n//\n// Menu\n//\n\ninterface MenuProps extends Omit<MenuStoreProps, 'visible'> {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const [anchorRect, setAnchorRect] = React.useState<{ x: number; y: number } | null>(null)\n const getAnchorRect = React.useMemo(() => (anchorRect ? () => anchorRect : null), [anchorRect])\n const menuStore = useMenuStore({ focusLoop: true, ...props })\n\n const value: MenuContextState = React.useMemo(\n () => ({ menuStore, handleItemSelect: onItemSelect, getAnchorRect, setAnchorRect }),\n [menuStore, onItemSelect, getAnchorRect, setAnchorRect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ninterface MenuButtonProps\n extends Omit<AriakitMenuButtonProps, 'store' | 'className' | 'as'>,\n ObfuscatedClassName {}\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = React.forwardRef<HTMLButtonElement, MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuButton must be wrapped in <Menu/>')\n }\n return (\n <AriakitMenuButton\n {...props}\n store={menuStore}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// ContextMenuTrigger\n//\n\ninterface ContextMenuTriggerProps\n extends ObfuscatedClassName,\n React.HTMLAttributes<HTMLDivElement>,\n Pick<RoleProps, 'render'> {}\n\nconst ContextMenuTrigger = React.forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ render, ...props }, ref) {\n const { setAnchorRect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('ContextMenuTrigger must be wrapped in <Menu/>')\n }\n\n const handleContextMenu = React.useCallback(\n function handleContextMenu(event: React.MouseEvent) {\n event.preventDefault()\n setAnchorRect({ x: event.clientX, y: event.clientY })\n menuStore.show()\n },\n [setAnchorRect, menuStore],\n )\n\n const isOpen = menuStore.useState('open')\n React.useEffect(() => {\n if (!isOpen) setAnchorRect(null)\n }, [isOpen, setAnchorRect])\n\n return <Role.div {...props} onContextMenu={handleContextMenu} ref={ref} render={render} />\n },\n)\n\n//\n// MenuList\n//\n\ninterface MenuListProps\n extends Omit<AriakitMenuProps, 'store' | 'className'>,\n ObfuscatedClassName {}\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = React.forwardRef<HTMLDivElement, MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, flip, ...props },\n ref,\n) {\n const { menuStore, getAnchorRect } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuList must be wrapped in <Menu/>')\n }\n\n const { isSubMenu } = React.useContext(SubMenuContext)\n\n const isOpen = menuStore.useState('open')\n\n return isOpen ? (\n <Portal preserveTabOrder>\n <AriakitMenu\n {...props}\n store={menuStore}\n gutter={8}\n shift={4}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n getAnchorRect={getAnchorRect ?? undefined}\n modal={modal}\n flip={flip ?? (isSubMenu ? 'left bottom' : undefined)}\n />\n </Portal>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ninterface MenuItemProps extends AriakitMenuItemProps, ObfuscatedClassName {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuItem must be wrapped in <Menu/>')\n }\n\n const { hide } = menuStore\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect?.(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <AriakitMenuItem\n {...props}\n store={menuStore}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n hideOnClick={false}\n >\n {children}\n </AriakitMenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('SubMenu must be wrapped in <Menu/>')\n }\n\n const { hide: parentMenuHide } = menuStore\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n onItemSelect?.(value)\n parentMenuItemSelect?.(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n const buttonElement = button as React.ReactElement<MenuButtonProps>\n const subMenuContextValue = React.useMemo(() => ({ isSubMenu: true }), [])\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <AriakitMenuItem store={menuStore} ref={ref} hideOnClick={false} render={buttonElement}>\n {buttonElement.props.children}\n </AriakitMenuItem>\n <SubMenuContext.Provider value={subMenuContextValue}>{list}</SubMenuContext.Provider>\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ninterface MenuGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className'>,\n ObfuscatedClassName {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = React.forwardRef<HTMLDivElement, MenuGroupProps>(function MenuGroup(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuGroup must be wrapped in <Menu/>')\n }\n\n return (\n <AriakitMenuGroup\n {...props}\n ref={ref}\n store={menuStore}\n className={exceptionallySetClassName}\n >\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </AriakitMenuGroup>\n )\n})\n\nexport { ContextMenuTrigger, Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, MenuGroupProps }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport { Tooltip } from '../../tooltip'\n\nimport './deprecated-button.less'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\n/** @deprecated */\nexport type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link'\n\n/** @deprecated */\nexport type ButtonSize = 'default' | 'small' | 'large'\n\n/** @deprecated */\nexport type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {\n /**\n * Loading style. When true it disables the button, but it also adds a visual indication of\n * some in-progress operation going on.\n */\n loading?: boolean\n /**\n * Controls visually how the button shows up from a predefined set of kinds of buttons.\n */\n variant?: ButtonVariant\n /**\n * The size of the button. If not provided it shows up in a normal size.\n */\n size?: ButtonSize\n /**\n * Tooltip that is displayed on hover.\n *\n * This replaces `title` which is not supported for these buttons to avoid confusion.\n */\n tooltip?: React.ReactNode\n}\n\n/**\n * @deprecated\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n variant,\n size = 'default',\n loading = false,\n disabled = false,\n tooltip,\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const className = classNames(\n 'reactist_button',\n variant ? `reactist_button--${variant}` : null,\n size !== 'default' ? `reactist_button--${size}` : null,\n { 'reactist_button--loading': loading },\n props.className,\n )\n\n const button = (\n <button\n {...props}\n ref={ref}\n type={type}\n className={className}\n aria-disabled={disabled || loading}\n onClick={disabled || loading ? undefined : onClick}\n >\n {children}\n </button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{button}</Tooltip> : button\n})\n\nButton.displayName = 'Button'\n\nButton.defaultProps = {\n size: 'default',\n loading: false,\n disabled: false,\n}\n\nexport { Button }\n","import * as React from 'react'\nimport ReactDOM from 'react-dom'\nimport classNames from 'classnames'\n\nimport Button from '../deprecated-button'\n\nimport './dropdown.less'\n\ntype BoxProps = {\n onShowBody?: () => void\n onHideBody?: () => void\n allowBodyInteractions?: boolean\n top?: boolean\n right?: boolean\n scrolling_parent?: string\n children?: [\n React.ReactElement<TriggerProps>,\n React.ReactElement<BodyProps> | ((props: BodyProps) => JSX.Element),\n ]\n className?: string\n}\n\ntype BoxState = {\n top: boolean\n showBody: boolean\n}\n\nclass Box extends React.Component<BoxProps, BoxState> {\n public static displayName: string\n\n constructor(props: BoxProps, context: React.Context<unknown>) {\n super(props, context)\n this.state = {\n showBody: false,\n top: props.top || false,\n }\n\n this._timeout = undefined\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this._handleClickOutside, true)\n if (this._timeout) {\n clearTimeout(this._timeout)\n }\n }\n _timeout?: ReturnType<typeof setTimeout>\n\n _handleClickOutside = (event: MouseEvent) => {\n const dropdownDOMNode = ReactDOM.findDOMNode(this)\n\n if (dropdownDOMNode && !dropdownDOMNode.contains(event.target as Node))\n this._toggleShowBody()\n else if (!this.props.allowBodyInteractions) {\n // won't close when body interactions are allowed\n this._timeout = setTimeout(() => {\n if (this.state.showBody) {\n this._toggleShowBody()\n }\n }, 100)\n }\n }\n\n _toggleShowBody = () => {\n if (!this.state.showBody) {\n // will show\n if (this.props.onShowBody) this.props.onShowBody()\n document.addEventListener('click', this._handleClickOutside, true)\n } else {\n // will hide\n if (this.props.onHideBody) this.props.onHideBody()\n document.removeEventListener('click', this._handleClickOutside, true)\n }\n\n this.setState({\n showBody: !this.state.showBody,\n })\n }\n\n _getTriggerComponent() {\n const _trigger = this.props.children?.[0]\n return _trigger\n ? React.cloneElement(_trigger, { onClick: this._toggleShowBody })\n : undefined\n }\n\n // https://facebook.github.io/react/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components\n _setPosition = (body: HTMLElement | null) => {\n if (body) {\n const scrollingParent = document.getElementById(\n this.props.scrolling_parent ? this.props.scrolling_parent : '',\n )\n\n if (scrollingParent) {\n const dropdown = ReactDOM.findDOMNode(this)\n if (!dropdown) {\n return\n }\n const dropdownVerticalPosition = (ReactDOM.findDOMNode(this) as HTMLElement)\n .offsetTop\n const dropdownTrigger = (dropdown as Element).querySelector('.trigger')\n if (!dropdownTrigger) {\n return\n }\n const dropdownTriggerHeight = dropdownTrigger.clientHeight\n const dropdownBodyHeight = body.clientHeight\n\n const scrollingParentHeight = scrollingParent.clientHeight\n const scrollingParentOffset = scrollingParent.scrollTop\n\n const bottomOffset =\n scrollingParentHeight +\n scrollingParentOffset -\n dropdownVerticalPosition -\n dropdownTriggerHeight\n\n const top = bottomOffset < dropdownBodyHeight\n\n if (top !== this.state.top) {\n this.setState({ top })\n }\n }\n }\n }\n\n _getBodyComponent() {\n if (!this.state.showBody) {\n return null\n }\n const { top } = this.state\n const { right = false, children } = this.props\n const props = { top, right, setPosition: this._setPosition }\n\n const className = classNames({\n body_wrapper: true,\n with_arrow: true,\n top: top,\n bottom: !top,\n })\n\n const body = children?.[1]\n\n const contentMarkup =\n typeof body === 'function'\n ? body(props)\n : body\n ? React.cloneElement(body, props)\n : undefined\n return (\n <div className={className} style={{ position: 'relative' }}>\n {contentMarkup}\n </div>\n )\n }\n\n render() {\n const className = classNames('reactist_dropdown', this.props.className)\n const { top } = this.state\n\n return (\n <div\n style={{ display: 'inline-block' }}\n className={className}\n data-testid=\"reactist-dropdown-box\"\n >\n {top && this._getBodyComponent()}\n {this._getTriggerComponent()}\n {!top && this._getBodyComponent()}\n </div>\n )\n }\n}\n\nBox.displayName = 'Dropdown.Box'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\ntype TriggerProps = Omit<NativeButtonProps, 'title' | 'onClick'> & {\n tooltip?: React.ReactNode\n /**\n * @private the onClick prop is not to be used externally\n */\n onClick?: NativeButtonProps['onClick']\n}\n\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(function Trigger(\n { children, onClick, tooltip, className, ...props },\n ref,\n) {\n function handleClick(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) {\n event.preventDefault()\n event.stopPropagation()\n if (onClick) onClick(event)\n }\n\n return (\n <Button\n {...props}\n className={classNames('trigger', className)}\n onClick={handleClick}\n tooltip={tooltip}\n ref={ref}\n >\n {children}\n </Button>\n )\n})\n\nTrigger.displayName = 'Dropdown.Trigger'\n\ntype BodyProps = {\n setPosition?: React.Ref<HTMLDivElement>\n children?: React.ReactNode\n top?: boolean\n right?: boolean\n}\n\nfunction Body({ top, right, children, setPosition }: BodyProps) {\n const style: React.CSSProperties = { position: 'absolute', right: 0, top: 0 }\n\n if (top) {\n style.top = 'auto'\n style.bottom = 0\n }\n\n if (right) {\n style.right = 'auto'\n style.left = 0\n }\n\n return (\n <div\n ref={setPosition}\n style={style}\n className=\"body\"\n id=\"reactist-dropdown-body\"\n data-testid=\"reactist-dropdown-body\"\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dropdown.Body'\n\nconst Dropdown = {\n Box,\n Trigger,\n Body,\n}\n\nexport { Dropdown }\n","import * as React from 'react'\nimport classnames from 'classnames'\n\nimport DeprecatedDropdown from '../deprecated-dropdown'\nimport { Tooltip } from '../../tooltip'\n\nimport './color-picker.less'\n\ntype NamedColor = { name: string; color: string }\n\nconst COLORS = [\n '#606060',\n '#4A90E2',\n '#03B3B2',\n '#008299',\n '#82BA00',\n '#D24726',\n '#AC193D',\n '#DC4FAD',\n '#3BD5FB',\n '#74E8D3',\n '#FFCC00',\n '#FB886E',\n '#CCCCCC',\n]\n\nconst _isNamedColor = (color: string | NamedColor | undefined): color is NamedColor =>\n typeof color !== 'string'\n\nconst _getColor = (colorList: (string | NamedColor)[], colorIndex: number) => {\n const index = colorIndex >= colorList.length ? 0 : colorIndex\n return colorList[index]\n}\n\ntype Props = {\n small?: boolean\n color?: number\n onChange?: (color: number) => void\n colorList?: (string | NamedColor)[]\n}\n\nfunction ColorPicker({ color = 0, small, onChange, colorList = COLORS }: Props) {\n return (\n <DeprecatedDropdown.Box right className=\"reactist_color_picker\">\n <DeprecatedDropdown.Trigger>\n {(() => {\n const backgroundColor = _getColor(colorList, color)\n\n return (\n <span\n className={classnames('color_trigger', { small })}\n style={{\n backgroundColor: _isNamedColor(backgroundColor)\n ? backgroundColor.color\n : backgroundColor,\n }}\n >\n <span className=\"color_trigger--inner_ring\" />\n </span>\n )\n })()}\n </DeprecatedDropdown.Trigger>\n <DeprecatedDropdown.Body>\n <div className=\"color_options\">\n {colorList.reduce<React.ReactNode[]>((items, currentColor, currentIndex) => {\n items.push(\n <ColorItem\n isActive={\n color >= colorList.length\n ? currentIndex === 0\n : currentIndex === color\n }\n key={currentIndex}\n color={\n _isNamedColor(currentColor) ? currentColor.color : currentColor\n }\n colorIndex={currentIndex}\n onClick={onChange}\n tooltip={_isNamedColor(currentColor) ? currentColor.name : null}\n />,\n )\n return items\n }, [])}\n </div>\n </DeprecatedDropdown.Body>\n </DeprecatedDropdown.Box>\n )\n}\nColorPicker.displayName = 'ColorPicker'\n\ntype ColorItemProps = {\n color: string\n colorIndex: number\n isActive?: boolean\n onClick?: (colorIndex: number) => void\n tooltip?: React.ReactNode\n}\n\nfunction ColorItem({ color, colorIndex, isActive, onClick, tooltip }: ColorItemProps) {\n const item = (\n <span\n data-testid=\"reactist-color-item\"\n className={'reactist color_item' + (isActive ? ' active' : '')}\n style={{ backgroundColor: color }}\n onClick={() => onClick?.(colorIndex)}\n >\n <span className=\"color_item--inner_ring\" />\n </span>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{item}</Tooltip> : item\n}\nColorItem.displayName = 'ColorItem'\n\nexport { ColorPicker, ColorItem, COLORS }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\n//\n// Support for setting up how to translate modifiers globally.\n//\n\nlet globalTranslateKey = (key: string) => key\n\ntype TranslateKey = typeof globalTranslateKey\n\nKeyboardShortcut.setTranslateKey = (tr: TranslateKey) => {\n globalTranslateKey = tr\n}\n\nfunction translateKeyMac(key: string) {\n switch (key.toLowerCase()) {\n case 'cmd':\n case 'mod':\n return '⌘'\n case 'control':\n case 'ctrl':\n return '⌃'\n case 'alt':\n return '⌥'\n case 'shift':\n return '⇧'\n case 'space':\n return '␣'\n default:\n return key\n }\n}\n\n//\n// Some helpers\n//\n\nfunction capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()\n}\n\nfunction hasModifiers(str: string) {\n return /\\b(mod|cmd|ctrl|control|alt|shift)\\b/i.test(str)\n}\n\nfunction isSpecialKey(str: string) {\n return /^(mod|cmd|ctrl|control|alt|shift|space|super)$/i.test(str)\n}\n\nfunction parseKeys(shortcut: string, isMac: boolean, translateKey: TranslateKey) {\n const t = isMac ? translateKeyMac : translateKey\n const _hasModifiers = hasModifiers(shortcut)\n\n function mapIndividualKey(str: string) {\n if (isSpecialKey(str)) {\n return capitalize(t(str))\n }\n if (_hasModifiers && str.length === 1) {\n return str.toUpperCase()\n }\n return str\n }\n\n if (!isMac) {\n shortcut = shortcut.replace(/\\b(mod|cmd)\\b/i, 'ctrl')\n }\n\n return shortcut.split(/\\s*\\+\\s*/).map(mapIndividualKey)\n}\n\n//\n// The KeyboardShortcut component\n//\n\ntype NativeSpanProps = React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLSpanElement>,\n HTMLSpanElement\n>\n\ntype Props = Omit<NativeSpanProps, 'children'> & {\n /**\n * The shortcut to be represented as markup. It supports an intuitive syntax where you can\n * combine modifiers (cmd, ctrl, shift, alt) with single keys all concatenated with plus signs.\n * You can also pass various shortcuts as an array, which will be depicted separated by commas.\n */\n children: string | string[]\n /**\n * A function that allows you to change how some key names are represented. This may be useful,\n * for instance, to translate modifier names that are expressed differently in other languages\n * (e.g. `Ctrl` is named `Strg` in German).\n *\n * It defaults to a global version that leaves the key as is. You can pass your version as a\n * prop, or you can also set your own version of this global default one, so you don't need to\n * pass your own on each invocation of this component.\n *\n * ```js\n * import { KeyboardShortcut } from '@doist/reactist'\n * KeyboardShortcut.setTranslateKey = key => { ... }\n * ```\n *\n * Note: When the component detects the macOS operating system it bypasses key translation for\n * most modifiers and uses macOS-specific symbols. See the `isMac` prop for details.\n */\n translateKey?: TranslateKey\n /**\n * This prop is not meant to be passed. The component will automatically initialize it to `true`\n * if it detects that the current browser / operating system is on macOS, in which case modifier\n * keys are represented using macOS' notation (e.g. ⌘ ⌃ ⌥ ⇧).\n *\n * Though it is discouraged, if you don't want this special treatment in macOS, you can pass\n * `isMac={false}` in all invocations of this component.\n */\n isMac?: boolean\n}\n\nfunction KeyboardShortcut({\n children,\n className,\n translateKey = globalTranslateKey,\n isMac = navigator.platform?.toUpperCase().includes('MAC') ?? false,\n ...props\n}: Props) {\n const shortcuts = typeof children === 'string' ? [children] : children\n return (\n <span\n className={classNames('reactist_keyboard_shortcut', className, {\n 'reactist_keyboard_shortcut--macos': isMac,\n })}\n {...props}\n >\n {shortcuts.map((shortcut, i) => (\n <React.Fragment key={i}>\n {i === 0 ? null : ', '}\n <kbd>\n {parseKeys(shortcut, isMac, translateKey).map((key, j) => (\n <kbd key={j}>{key}</kbd>\n ))}\n </kbd>\n </React.Fragment>\n ))}\n </span>\n )\n}\n\nexport { KeyboardShortcut }\n","import * as React from 'react'\n\ntype Key = 'ArrowUp' | 'ArrowRight' | 'ArrowDown' | 'ArrowLeft' | 'Enter' | 'Backspace' | 'Escape'\n\nconst SUPPORTED_KEYS: Record<string, Key> = {\n ARROW_UP: 'ArrowUp',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ENTER: 'Enter',\n BACKSPACE: 'Backspace',\n ESCAPE: 'Escape',\n}\n\nconst KeyCapturerResolver = {\n resolveByKey(eventKey: string): Key | null {\n switch (eventKey) {\n case 'Left': // IE specific\n case 'ArrowLeft': {\n return 'ArrowLeft'\n }\n case 'Up': // IE specific\n case 'ArrowUp': {\n return 'ArrowUp'\n }\n case 'Right': // IE specific\n case 'ArrowRight': {\n return 'ArrowRight'\n }\n case 'Down': // IE specific\n case 'ArrowDown': {\n return 'ArrowDown'\n }\n case 'Enter': {\n return 'Enter'\n }\n case 'Backspace': {\n return 'Backspace'\n }\n case 'Esc': // IE specific\n case 'Escape': {\n return 'Escape'\n }\n default: {\n return null\n }\n }\n },\n\n resolveByKeyCode(keyCode: number): Key | null {\n switch (keyCode) {\n case 37: {\n return 'ArrowLeft'\n }\n case 38: {\n return 'ArrowUp'\n }\n case 39: {\n return 'ArrowRight'\n }\n case 40: {\n return 'ArrowDown'\n }\n case 13: {\n return 'Enter'\n }\n case 8: {\n return 'Backspace'\n }\n case 27: {\n return 'Escape'\n }\n default: {\n return null\n }\n }\n },\n}\n\ntype EventHandler = (event: React.SyntheticEvent) => void\n\ntype EventHandlerProps = {\n onArrowUp?: EventHandler\n onArrowDown?: EventHandler\n onArrowLeft?: EventHandler\n onArrowRight?: EventHandler\n onEnter?: EventHandler\n onBackspace?: EventHandler\n onEscape?: EventHandler\n}\n\ntype PropagateProps = {\n propagateArrowUp?: boolean\n propagateArrowDown?: boolean\n propagateArrowLeft?: boolean\n propagateArrowRight?: boolean\n propagateEnter?: boolean\n propagateBackspace?: boolean\n propagateEscape?: boolean\n}\n\nconst keyEventHandlerMapping: Record<Key, keyof EventHandlerProps> = {\n ArrowUp: 'onArrowUp',\n ArrowDown: 'onArrowDown',\n ArrowLeft: 'onArrowLeft',\n ArrowRight: 'onArrowRight',\n Enter: 'onEnter',\n Backspace: 'onBackspace',\n Escape: 'onEscape',\n}\n\nconst keyPropagatePropMapping: Record<Key, keyof PropagateProps> = {\n ArrowUp: 'propagateArrowUp',\n ArrowDown: 'propagateArrowDown',\n ArrowLeft: 'propagateArrowLeft',\n ArrowRight: 'propagateArrowRight',\n Enter: 'propagateEnter',\n Backspace: 'propagateBackspace',\n Escape: 'propagateEscape',\n}\n\ntype KeyCapturerProps = EventHandlerProps &\n PropagateProps & {\n eventName?: 'onKeyDown' | 'onKeyDownCapture' | 'onKeyUp' | 'onKeyUpCapture'\n children: React.ReactElement<unknown>\n }\n\n/**\n * Use this component to wrap anything you want to handle key events for (e.g. an input).\n * You can specify the `eventName` to capture (defaults to `onKeyDown`).\n * Check the SUPPORTED_KEYS map to see which keys are supported and supply the respective\n * `on${Key}` prop (i.e. `onEnter` or `onArrowDown`).\n * If you want the default behaviour to be preserved (i.e. only want to hook into the event\n * instead of replacing it) set the `propagate${Key}` prop (e.g. propagateBackspace).\n */\nfunction KeyCapturer(props: KeyCapturerProps) {\n const { children, eventName = 'onKeyDown' } = props\n const composingRef = React.useRef(false)\n const composingEventHandlers = props.onEnter\n ? {\n onCompositionStart: () => {\n composingRef.current = true\n },\n onCompositionEnd: () => {\n composingRef.current = false\n },\n }\n : undefined\n\n function handleKeyEvent(event: React.KeyboardEvent<HTMLInputElement>) {\n // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n const key =\n event.key !== undefined\n ? KeyCapturerResolver.resolveByKey(event.key)\n : KeyCapturerResolver.resolveByKeyCode(event.keyCode)\n\n if (!key) return\n const propagateEvent = props[keyPropagatePropMapping[key]] || false\n const eventHandler = props[keyEventHandlerMapping[key]]\n\n if (key === 'Enter' && eventHandler) {\n if (\n composingRef.current ||\n // Safari fires the onCompositionEnd event before the keydown event, so we\n // have to rely on the 229 keycode, which is Enter when fired from an IME\n // https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode\n (event.keyCode || event.which) === 229\n ) {\n return\n }\n }\n\n if (eventHandler) {\n eventHandler(event)\n if (!propagateEvent) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n }\n\n return React.cloneElement(children, {\n [eventName]: handleKeyEvent,\n ...composingEventHandlers,\n })\n}\n\nexport { KeyCapturer, KeyCapturerResolver, SUPPORTED_KEYS }\n","import * as React from 'react'\nimport { HiddenVisually } from '../../hidden-visually'\nimport classNames from 'classnames'\n\nimport './progress-bar.less'\n\ntype Props = {\n /** Additional css class applied to the progress bar. */\n className?: string\n /** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */\n fillPercentage?: number\n /** Defines the human readable text alternative for assitive technologies. */\n 'aria-valuetext'?: string\n}\nfunction ProgressBar({ fillPercentage = 0, className, 'aria-valuetext': ariaValuetext }: Props) {\n const finalClassName = classNames('reactist_progress_bar', className)\n const width = fillPercentage < 0 ? 0 : fillPercentage > 100 ? 100 : fillPercentage\n return (\n <div className={finalClassName}>\n <div className=\"inner\" style={{ width: `${width}%` }} />\n <HiddenVisually>\n <progress value={width} max={100} aria-valuetext={ariaValuetext ?? undefined} />\n </HiddenVisually>\n </div>\n )\n}\nProgressBar.displayName = 'ProgressBar'\n\nexport { ProgressBar }\n","import dayjs from 'dayjs'\n/**\n * There's a problem with our setup where the default export from\n * localizedFormat (and likely every other dayjs plugin) isn't properly\n * recognized. The proposed workarounds (importing with `.js` ending, or adding\n * `allowSyntheticDefaultImports` to the tsconfig) either broke linting or type\n * checking. After spending some time on this it was decided that further\n * investigations are not worth it, the code works and the eslint ignore is fine.\n * ref: https://github.com/iamkun/dayjs/issues/593\n * ref: https://day.js.org/docs/en/installation/typescript\n */\n// eslint-disable-next-line import/default\nimport LocalizedFormat from 'dayjs/plugin/localizedFormat'\n\ndayjs.extend(LocalizedFormat)\n\ntype TimeConfig = {\n locale?: string\n longFormat?: string\n shortFormatCurrentYear?: string\n shortFormatPastYear?: string\n daysSuffix?: string\n hoursSuffix?: string\n minutesSuffix?: string\n momentsAgo?: string\n}\n\nconst TimeUtils = {\n SHORT_FORMAT_CURRENT_YEAR: 'L',\n SHORT_FORMAT_PAST_YEAR: 'LL',\n LONG_FORMAT: 'LL, LT',\n\n timeAgo(timestamp: number, config: TimeConfig = {}) {\n const {\n locale = 'en',\n shortFormatCurrentYear = this.SHORT_FORMAT_CURRENT_YEAR,\n shortFormatPastYear = this.SHORT_FORMAT_PAST_YEAR,\n daysSuffix = 'd',\n hoursSuffix = 'h',\n minutesSuffix = 'm',\n momentsAgo = 'moments ago',\n } = config\n const now = dayjs()\n const date = dayjs(timestamp * 1000)\n date.locale(locale)\n const diffMinutes = now.diff(date, 'minute')\n const diffHours = now.diff(date, 'hour')\n const diffDays = now.diff(date, 'day')\n\n if (diffDays > 1) {\n if (date.isSame(now, 'year')) {\n return date.format(shortFormatCurrentYear)\n } else {\n return date.format(shortFormatPastYear)\n }\n } else if (diffDays === 1) {\n return `${diffDays}${daysSuffix}`\n } else if (diffHours > 0 && diffHours <= 23) {\n return `${diffHours}${hoursSuffix}`\n } else if (diffMinutes > 0 && diffMinutes <= 59) {\n return `${diffMinutes}${minutesSuffix}`\n } else {\n return momentsAgo\n }\n },\n\n formatTime(timestamp: number, config: TimeConfig = {}) {\n const {\n locale = 'en',\n shortFormatCurrentYear = this.SHORT_FORMAT_CURRENT_YEAR,\n shortFormatPastYear = this.SHORT_FORMAT_PAST_YEAR,\n } = config\n const date = dayjs(timestamp * 1000)\n date.locale(locale)\n if (date.isSame(dayjs(), 'year')) {\n return date.format(shortFormatCurrentYear)\n } else {\n return date.format(shortFormatPastYear)\n }\n },\n\n formatTimeLong(timestamp: number, config: TimeConfig = {}) {\n const { locale = 'en', longFormat = this.LONG_FORMAT } = config\n const date = dayjs(timestamp * 1000)\n date.locale(locale)\n return date.format(longFormat)\n },\n}\n\nexport { TimeUtils, TimeConfig }\n","import * as React from 'react'\n\nimport { Tooltip } from '../../tooltip'\nimport { TimeUtils, TimeConfig } from './time-utils'\n\nimport './time.less'\n\nconst DELAY = 60000\n\ntype Props = {\n /** UNIX timestamp of the time to display. */\n time?: number\n /** Configuration for localization. */\n config?: TimeConfig\n /** Additional css class applied to the time element. */\n className?: string\n tooltipOnHover?: boolean\n /** Refresh the component every DELAY seconds. */\n refresh?: boolean\n /** If you don't want to use the default time format on the tooltip use this prop to supply a custom text */\n tooltip?: React.ReactNode\n /** When hovering over time it expands to short absolute version. */\n expandOnHover?: boolean\n /** When hovering over time it expands to the full absolute version. */\n expandFullyOnHover?: boolean\n}\n\ntype State = {\n hovered: boolean\n mouseX?: number\n mouseY?: number\n}\n\nclass Time extends React.Component<Props, State> {\n public static displayName: string\n public static defaultProps: Props\n\n constructor(props: Props) {\n super(props)\n this.refreshInterval = undefined\n\n this.state = {\n hovered: false,\n mouseX: undefined,\n mouseY: undefined,\n }\n }\n\n componentDidMount() {\n if (this.props.refresh) {\n this._refresh()\n }\n }\n\n componentDidUpdate(prevProps: Props) {\n if (!prevProps.refresh && this.props.refresh) {\n this._refresh()\n }\n\n if (prevProps.refresh && !this.props.refresh) {\n if (this.refreshInterval) {\n clearTimeout(this.refreshInterval)\n }\n }\n }\n\n componentWillUnmount() {\n if (this.refreshInterval) {\n clearTimeout(this.refreshInterval)\n }\n }\n\n refreshInterval?: ReturnType<typeof setTimeout>\n\n _setHovered(hovered: boolean, event: React.MouseEvent) {\n const { mouseX, mouseY } = this.state\n const { clientX, clientY } = event\n if (clientX !== mouseX || clientY !== mouseY) {\n // mouse has moved\n this.setState(() => ({\n hovered,\n mouseX: clientX,\n mouseY: clientY,\n }))\n }\n }\n\n _renderTime(config: Props['config']) {\n if (!this.props.time) {\n return\n }\n if (this.state.hovered) {\n if (this.props.expandFullyOnHover && !this.props.tooltipOnHover) {\n return TimeUtils.formatTimeLong(this.props.time, config)\n }\n if (this.props.expandOnHover && !this.props.tooltipOnHover) {\n return TimeUtils.formatTime(this.props.time, config)\n }\n }\n return TimeUtils.timeAgo(this.props.time, config)\n }\n\n _refresh() {\n this.refreshInterval = setInterval(() => {\n this.forceUpdate()\n }, DELAY)\n }\n\n render() {\n let className = 'reactist_time'\n if (this.props.className) {\n className = this.props.className\n }\n\n const timeComponent = this._renderTime(this.props.config)\n\n return (\n <time\n className={className}\n onMouseEnter={(event) => this._setHovered(true, event)}\n onMouseLeave={(event) => this._setHovered(false, event)}\n >\n {this.props.tooltipOnHover ? (\n <Tooltip\n content={\n this.props.tooltip ||\n (this.props.time &&\n TimeUtils.formatTimeLong(this.props.time, this.props.config))\n }\n >\n <span>{timeComponent}</span>\n </Tooltip>\n ) : (\n timeComponent\n )}\n </time>\n )\n }\n}\nTime.displayName = 'Time'\n\nTime.defaultProps = {\n expandOnHover: false,\n expandFullyOnHover: false,\n tooltipOnHover: false,\n refresh: true,\n config: {\n locale: 'en',\n daysSuffix: 'd',\n hoursSuffix: 'h',\n minutesSuffix: 'm',\n momentsAgo: 'moments ago',\n },\n}\n\nexport { Time }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport './input.less'\n\ninterface Props extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string\n}\n\n/**\n * @deprecated\n */\nconst Input = React.forwardRef<HTMLInputElement, Props>(function Input(props, ref) {\n const className = classNames('reactist_input', props.className)\n return <input {...props} className={className} ref={ref} />\n})\nInput.displayName = 'Input'\n\nexport { Input }\n","import * as React from 'react'\nimport classNames from 'classnames'\n\nimport './select.less'\n\ntype Option = {\n /** Optional key for each option. If not provided `value` is used. */\n key?: string | number\n /** Value of the option. */\n value: string | number\n /** Text to display for the option. */\n text?: string | number\n /** Whether the options is disabled or not. */\n disabled?: boolean\n}\n\ntype Props = {\n className?: string\n disabled?: boolean\n /** Currently selected value. */\n value?: string | number\n /** Callback for the change event. Will be called with the next value (not the full event). */\n onChange?: (value: string) => void\n /** Options that are rendered in the select. */\n options?: Option[]\n /** Value to initially be set */\n defaultValue?: string | number\n}\n\nfunction Select({\n value,\n options = [],\n onChange,\n disabled = true,\n className = '',\n defaultValue,\n ...otherProps\n}: Props) {\n const selectClassName = classNames('reactist_select', { disabled }, className)\n return (\n <select\n className={selectClassName}\n value={value}\n onChange={(event) => (onChange ? onChange(event.target.value) : undefined)}\n disabled={disabled}\n defaultValue={defaultValue}\n {...otherProps}\n >\n {options?.map((option) => (\n <option\n key={option.key || option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n ))}\n </select>\n )\n}\nSelect.displayName = 'Select'\nSelect.defaultProps = {\n options: [],\n disabled: false,\n}\n\nexport { Select }\n","import * as React from 'react'\n\nimport { Box } from '../box'\n\nimport styles from './badge.module.css'\n\ntype BadgeTone = 'info' | 'positive' | 'promote' | 'attention' | 'warning'\n\ntype BadgeProps = {\n /**\n * The label to show inside the badge element.\n */\n label: string\n /**\n * The tone of the badge.\n */\n tone: BadgeTone\n}\n\nfunction Badge({ tone, label, ...props }: BadgeProps) {\n return (\n <Box\n {...props}\n as=\"span\" // It enables putting the badge inside a button (https://stackoverflow.com/a/12982334)\n display=\"inline\"\n className={[styles.badge, styles[`badge-${tone}`]]}\n >\n {label}\n </Box>\n )\n}\n\nexport { Badge }\nexport type { BadgeProps }\n","import * as React from 'react'\nimport { getClassNames } from '../utils/responsive-props'\nimport { Box } from '../box'\nimport { Columns, Column } from '../columns'\nimport { AlertIcon } from '../icons/alert-icon'\n\nimport type { AlertTone } from '../utils/common-types'\n\nimport styles from './notice.module.css'\n\ntype NoticeProps = {\n id?: string\n children: React.ReactNode\n tone: AlertTone\n}\n\nfunction Notice({ id, children, tone }: NoticeProps) {\n return (\n <Box\n id={id}\n role=\"alert\"\n aria-live=\"polite\"\n className={[styles.container, getClassNames(styles, 'tone', tone)]}\n >\n <Columns space=\"small\" alignY=\"top\">\n <Column width=\"content\">\n <AlertIcon tone={tone} className={styles.icon} />\n </Column>\n <Column>\n <Box className={styles.content}>{children}</Box>\n </Column>\n </Columns>\n </Box>\n )\n}\n\nexport { Notice }\nexport type { NoticeProps }\n","import * as React from 'react'\nimport { Box } from '../box'\nimport styles from './prose.module.css'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ninterface ProseProps extends ObfuscatedClassName {\n /**\n * The prose content.\n *\n * This must consist of React nodes and elements. It is the consumer’s responsibility to\n * generate this from other sources, such as converting raw markdown content to React elements,\n * etc.\n *\n * Alternatively, you can use `<Prose dangerouslySetInnerHTML={{ __html: htmlString }}` />`\n * instead.\n */\n children?: React.ReactNode\n\n /**\n * Sets the prose content to be raw HTML stored in a string value.\n *\n * Warning: be advised that setting HTML content in this way is risky, because you can\n * inadvertently be vulnerable to a cross-site scripting (XSS) attack. Make sure you only use\n * this option with HTML content that has been sanitized (especially if it comes from user\n * provided content) or content that you fully control how it's generated, that cannot possibly\n * have any XSS content in it.\n *\n * @see https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml\n */\n dangerouslySetInnerHTML?: { __html: string } | undefined\n\n /**\n * Whether to customize the typography styles for dark mode.\n *\n * Applies finessed optimizations since our eyes perceive space differently when looking at dark\n * text on a light background and light text on a dark background.\n *\n * This does not apply a dark theme on the text. That's still the consumer apps’ responsibility.\n */\n darkModeTypography: boolean\n}\n\n/**\n * Used to style HTML you don’t control, like HTML content generated from Markdown.\n */\nfunction Prose({ darkModeTypography, exceptionallySetClassName, ...props }: ProseProps) {\n return (\n <Box\n {...props}\n className={[\n styles.prose,\n darkModeTypography ? styles.darkModeTypography : null,\n exceptionallySetClassName,\n ]}\n />\n )\n}\n\nexport { Prose }\nexport type { ProseProps }\n"],"names":["polymorphicComponent","render","React","forwardRef","getClassNames","styles","property","value","classList","push","mobile","tablet","desktop","mapResponsiveProp","fromValue","mapper","undefined","getBoxClassNames","position","display","flexDirection","flexWrap","flexGrow","flexShrink","gap","alignItems","justifyContent","alignSelf","overflow","width","height","background","border","borderRadius","minWidth","maxWidth","textAlign","padding","paddingY","paddingX","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginY","marginX","marginTop","marginRight","marginBottom","marginLeft","className","_ref","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","resolvedPaddingTop","resolvedPaddingRight","resolvedPaddingBottom","resolvedPaddingLeft","resolvedMarginTop","resolvedMarginRight","resolvedMarginBottom","resolvedMarginLeft","omitFlex","classNames","box","widthStyles","String","paddingStyles","marginStyles","gapStyles","Box","_ref9","ref","as","component","children","props","_objectWithoutProperties","_excluded","createElement","Column","exceptionallySetClassName","replace","Columns","space","align","alignY","collapseBelow","_excluded2","container","Divider","weight","_objectSpread","Inline","Stack","dividers","Children","map","flattenChildren","child","index","Fragment","Hidden","hiddenOnPrint","print","hiddenOnDesktop","hiddenOnMobile","hiddenOnTablet","below","above","console","warn","HiddenVisually","uid","generateElementId","prefix","useId","providedId","useRef","current","Spinner","size","viewBox","fill","fillRule","d","TooltipContext","createContext","showTimeout","hideTimeout","Tooltip","content","gapSize","withArrow","globalShowTimeout","globalHideTimeout","useContext","tooltip","useTooltipStore","placement","isOpen","useState","only","Error","TooltipAnchor","store","AriakitTooltip","gutter","TooltipArrow","preventDefault","event","Button","variant","tone","shape","type","disabled","loading","onClick","startIcon","endIcon","isDisabled","buttonElement","Role","button","aria-disabled","baseButton","aria-hidden","label","IconButton","icon","iconButton","tooltipContent","CloseIcon","xmlns","bannerIconForType","info","clipRule","upgrade","experiment","warning","error","success","BannerIcon","Icon","data-testid","TextLink","openInNewTab","color","underline","target","rel","Banner","id","title","description","action","image","inlineLinks","closeLabel","onClose","titleId","descriptionId","closeButton","aria-label","role","aria-describedby","aria-live","tabIndex","key","length","ActionButton","ActionLink","_excluded3","_excluded4","sizeMapping","xsmall","small","medium","large","alertIconForTone","positive","caution","critical","AlertIcon","Text","lineClamp","lineClampMultipleLines","Number","text","toString","StaticToast","message","onDismiss","dismissLabel","ToastContentSlot","isActionObject","animate","element","transforms","transition","done","fallbackTimeout","setTimeout","forEach","from","style","setProperty","addEventListener","transitionEndHandler","removeEventListener","clearTimeout","window","requestAnimationFrame","to","InternalToast","autoDismissDelay","showDismissButton","toastId","onRemoveToast","timeoutRunning","setTimeoutRunning","Boolean","timeoutRef","startTimeout","useCallback","stopTimeout","removeToast","useEffect","actionWithCustomActionHandler","useMemo","onMouseEnter","onMouseLeave","ToastsContext","useToasts","Heading","level","headingElementName","parseInt","heading","svgPath","checked","unchecked","mixed","filled","CheckboxIcon","indeterminate","pathKey","getPathKey","CheckboxField","_props$checked","_props$checked2","defaultChecked","onChange","keyFocused","setKeyFocused","checkedState","setChecked","isChecked","internalRef","combinedRef","refs","some","setRef","useForkRef","aria-checked","defaultPrevented","currentTarget","onBlur","onKeyUp","PasswordVisibleIcon","stroke","cx","cy","r","PasswordHiddenIcon","transform","x","y","rx","fieldToneToTextTone","FieldMessage","FieldCharacterCount","validateInputLength","maxLength","count","currentLength","BaseField","auxiliaryLabel","hidden","originalAriaDescribedBy","originalId","characterCountPosition","endSlot","endSlotPosition","messageId","inputLength","characterCount","setCharacterCount","characterCountTone","setCharacterCountTone","ariaDescribedBy","renderCharacterCount","childrenProps","aria-invalid","characterCountElement","htmlFor","TextField","startSlot","originalOnChange","useMergeRefs","handleClick","_internalRef$current","focus","displayEndSlot","supportsStartAndEndSlots","extraProps","readOnly","PasswordField","togglePasswordLabel","isPasswordVisible","setPasswordVisible","v","SelectField","SelectChevron","SwitchField","originalAriaLabel","aria-labelledby","originalAriaLabelledby","ariaLabel","ariaLabelledBy","TextArea","rows","autoExpand","disableResize","containerRef","textAreaClassName","containerElement","handleAutoExpand","dataset","replicatedValue","handleInput","textAreaElement","getInitials","name","_initials","seed","trim","split","firstInitial","lastInitial","initials","toUpperCase","emailToIndex","email","maxIndex","charCodeAt","AVATAR_COLORS","Avatar","user","avatarUrl","colorList","userInitials","avatarSize","backgroundImage","textIndent","backgroundColor","sizeClassName","avatar","displayName","ModalContext","isNotInternalFrame","ownerDocument","document","tagName","toLowerCase","ModalCloseButton","includeInTabOrder","setIncludeInTabOrder","isMounted","setIsMounted","ModalBody","ModalFooter","withDivider","TabsContext","Tab","tabContextValue","tabStore","tab","BaseTab","TabPanel","renderMode","tabRendered","setTabRendered","tabIsActive","BaseTabPanel","tabId","MenuContext","menuStore","handleItemSelect","getAnchorRect","setAnchorRect","SubMenuContext","isSubMenu","Menu","onItemSelect","anchorRect","useMenuStore","focusLoop","Provider","MenuButton","AriakitMenuButton","ContextMenuTrigger","handleContextMenu","clientX","clientY","show","div","onContextMenu","MenuList","modal","flip","Portal","preserveTabOrder","AriakitMenu","shift","MenuItem","onSelect","hideOnSelect","_excluded5","hide","shouldClose","AriakitMenuItem","hideOnClick","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","list","toArray","subMenuContextValue","MenuGroup","_excluded6","AriakitMenuGroup","reactist_button--loading","defaultProps","Component","constructor","context","super","this","_timeout","_handleClickOutside","dropdownDOMNode","ReactDOM","findDOMNode","contains","_toggleShowBody","allowBodyInteractions","state","showBody","onHideBody","onShowBody","setState","_setPosition","body","scrollingParent","getElementById","scrolling_parent","dropdown","dropdownVerticalPosition","offsetTop","dropdownTrigger","querySelector","top","clientHeight","scrollTop","componentWillUnmount","_getTriggerComponent","_this$props$children","_trigger","cloneElement","_getBodyComponent","right","setPosition","body_wrapper","with_arrow","bottom","contentMarkup","Trigger","stopPropagation","Body","left","Dropdown","COLORS","_isNamedColor","ColorPicker","DeprecatedDropdown","colorIndex","_getColor","classnames","reduce","items","currentColor","currentIndex","ColorItem","isActive","item","globalTranslateKey","translateKeyMac","KeyboardShortcut","_navigator$platform$t","_navigator$platform","translateKey","isMac","navigator","platform","includes","shortcuts","reactist_keyboard_shortcut--macos","shortcut","i","t","_hasModifiers","test","str","isSpecialKey","charAt","slice","capitalize","parseKeys","j","setTranslateKey","tr","KeyCapturerResolver","resolveByKey","eventKey","resolveByKeyCode","keyCode","keyEventHandlerMapping","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Backspace","Escape","keyPropagatePropMapping","ProgressBar","fillPercentage","aria-valuetext","ariaValuetext","finalClassName","max","dayjs","extend","LocalizedFormat","TimeUtils","SHORT_FORMAT_CURRENT_YEAR","SHORT_FORMAT_PAST_YEAR","LONG_FORMAT","timeAgo","timestamp","config","locale","shortFormatCurrentYear","shortFormatPastYear","daysSuffix","hoursSuffix","minutesSuffix","momentsAgo","now","date","diffMinutes","diff","diffHours","diffDays","isSame","format","formatTime","formatTimeLong","longFormat","Time","refreshInterval","hovered","mouseX","mouseY","componentDidMount","refresh","_refresh","componentDidUpdate","prevProps","_setHovered","_renderTime","time","expandFullyOnHover","tooltipOnHover","expandOnHover","setInterval","forceUpdate","timeComponent","Input","Select","options","defaultValue","otherProps","selectClassName","option","badge","eventName","composingRef","[object Object]","propagateEvent","eventHandler","which","onEnter","onCompositionStart","onCompositionEnd","_sizeMapping$size","numericSize","exceptionallySetOverlayClassName","autoFocus","hideOnEscape","hideOnInteractOutside","portalElement","onKeyDown","setOpen","visible","useDialogStore","open","contextValue","portalRef","dialogRef","backdropRef","handleBackdropClick","_dialogRef$current","_backdropRef$current","useLayoutEffect","hideOthers","handleKeyDown","data-overlay","overlay","onPointerDown","FocusLock","whiteList","returnFocus","crossFrame","Dialog","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","portal","backdrop","headerContent","buttonContainer","darkModeTypography","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","ARROW_LEFT","ENTER","BACKSPACE","ESCAPE","selectedId","BaseTabList","TabList","track","defaultSelectedId","onSelectedIdChange","useTabStore","setSelectedId","actualSelectedId","memoizedTabState","showToast","propsRef","defaultAutoDismissDelay","defaultDismissLabel","containerClassName","toasts","setToasts","mappedRef","animateRemove","Map","positions","animations","Array","entries","delete","prevTop","get","getBoundingClientRect","set","onAnimationDone","useToastsAnimation","findIndex","n","copy","splice","newToast"],"mappings":"6xDA2LA,SAASA,EAIPC,GACE,OAAOC,EAAMC,WAAWF,GC7J5B,SAASG,EACLC,EACAC,EACAC,GAEA,IAAKA,EACD,OAAO,KAGX,MAAMC,EAAuC,GAe7C,MAbqB,iBAAVD,EACPC,EAAUC,KAAKJ,EAAUC,EAAJ,IAAgBC,KAEjCA,EAAMG,QAAQF,EAAUC,KAAKJ,EAAUC,EAAJ,IAAgBC,EAAMG,SACzDH,EAAMI,QAAQH,EAAUC,KAAKJ,YAAiBC,EAAX,IAAuBC,EAAMI,SAChEJ,EAAMK,SAASJ,EAAUC,KAAKJ,aAAkBC,EAAZ,IAAwBC,EAAMK,WAQnEJ,EAaX,SAASK,EACLC,EACAC,GAEA,GAAKD,EAIL,MAAyB,iBAAdA,EACAC,EAAOD,GAGX,CACHJ,OAAQI,EAAUJ,OAASK,EAAOD,EAAUJ,aAAUM,EACtDL,OAAQG,EAAUH,OAASI,EAAOD,EAAUH,aAAUK,EACtDJ,QAASE,EAAUF,QAAUG,EAAOD,EAAUF,cAAWI,k+aCIjE,SAASC,GAAiBC,SACtBA,EAAW,SADWC,QAEtBA,EAFsBC,cAGtBA,EAAgB,MAHMC,SAItBA,EAJsBC,SAKtBA,EALsBC,WAMtBA,EANsBC,IAOtBA,EAPsBC,WAQtBA,EARsBC,eAStBA,EATsBC,UAUtBA,EAVsBC,SAWtBA,EAXsBC,MAYtBA,EAZsBC,OAatBA,EAbsBC,WActBA,EAdsBC,OAetBA,EAfsBC,aAgBtBA,EAhBsBC,SAiBtBA,EAjBsBC,SAkBtBA,EAlBsBC,UAmBtBA,EAnBsBC,QAoBtBA,EApBsBC,SAqBt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