@loadsmart/loadsmart-ui 7.5.0 → 7.6.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.
Files changed (36) hide show
  1. package/dist/index.js +162 -162
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +4063 -5327
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/miranda-compatibility.theme-ChPV-BBw.js +2 -0
  6. package/dist/miranda-compatibility.theme-ChPV-BBw.js.map +1 -0
  7. package/dist/{miranda-compatibility.theme-ClCWbTIT.mjs → miranda-compatibility.theme-DQDHkWzC.mjs} +256 -312
  8. package/dist/miranda-compatibility.theme-DQDHkWzC.mjs.map +1 -0
  9. package/dist/prop-5m3D4883.mjs +54 -0
  10. package/dist/{prop-C4yDbi0C.mjs.map → prop-5m3D4883.mjs.map} +1 -1
  11. package/dist/prop-BwhJNJHO.js +2 -0
  12. package/dist/{prop-pWSEOvKc.js.map → prop-BwhJNJHO.js.map} +1 -1
  13. package/dist/testing/index.js +1 -1
  14. package/dist/testing/index.js.map +1 -1
  15. package/dist/testing/index.mjs +44 -43
  16. package/dist/testing/index.mjs.map +1 -1
  17. package/dist/theming/index.js +1 -1
  18. package/dist/theming/index.js.map +1 -1
  19. package/dist/theming/index.mjs +13 -12
  20. package/dist/theming/index.mjs.map +1 -1
  21. package/dist/toArray-BW3gx_gH.js +2 -0
  22. package/dist/toArray-BW3gx_gH.js.map +1 -0
  23. package/dist/toArray-DqgeO2ua.mjs +8 -0
  24. package/dist/toArray-DqgeO2ua.mjs.map +1 -0
  25. package/dist/tools/index.js +1 -1
  26. package/dist/tools/index.mjs +1 -1
  27. package/package.json +6 -5
  28. package/dist/miranda-compatibility.theme-C3Dt-45K.js +0 -2
  29. package/dist/miranda-compatibility.theme-C3Dt-45K.js.map +0 -1
  30. package/dist/miranda-compatibility.theme-ClCWbTIT.mjs.map +0 -1
  31. package/dist/prop-C4yDbi0C.mjs +0 -53
  32. package/dist/prop-pWSEOvKc.js +0 -2
  33. package/dist/toArray-BJfx0Xhj.mjs +0 -38
  34. package/dist/toArray-BJfx0Xhj.mjs.map +0 -1
  35. package/dist/toArray-Dw6F-w3t.js +0 -2
  36. package/dist/toArray-Dw6F-w3t.js.map +0 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/styles/transition.tsx","../src/components/IconFactory/IconFactory.tsx","../src/components/Icon/assets/back.svg","../src/components/Icon/assets/burger-menu.svg","../src/components/Icon/assets/calendar.svg","../src/components/Icon/assets/caret-down.svg","../src/components/Icon/assets/caret-left.svg","../src/components/Icon/assets/check.svg","../src/components/Icon/assets/chevron-down.svg","../src/components/Icon/assets/caret-right.svg","../src/components/Icon/assets/circle.svg","../src/components/Icon/assets/close.svg","../src/components/Icon/assets/information.svg","../src/components/Icon/assets/minus.svg","../src/components/Icon/assets/plus.svg","../src/components/Icon/assets/refresh.svg","../src/components/Icon/assets/sort-asc.svg","../src/components/Icon/assets/sort-desc.svg","../src/components/Icon/assets/sort.svg","../src/components/Icon/assets/upload.svg","../src/components/Icon/assets/warning.svg","../src/components/Icon/assets/dots-horizontal.svg","../src/components/Icon/assets/caret-right-last.svg","../src/components/Icon/Icon.tsx","../src/utils/toolset/interleave.ts","../src/styles/activatable.tsx","../src/styles/disableable.tsx","../src/styles/ellipsizable.tsx","../src/styles/focusable.tsx","../src/styles/hoverable.tsx","../src/styles/font.tsx","../src/styles/typography.ts","../src/components/Loaders/Spinner.tsx","../src/components/Layout/Layout.utils.ts","../src/components/Layout/Group.tsx","../src/components/Layout/Stack.tsx","../src/components/Layout/Box.tsx","../src/components/Layout/Sidebar.tsx","../src/components/Layout/Switcher.tsx","../src/components/Layout/Grid.tsx","../src/components/Layout/Layout.tsx","../src/components/Loaders/LoadingBar.tsx","../src/components/Loaders/LoadingDots.tsx","../src/components/Button/Button.tsx","../src/common/CloseButton/CloseButton.tsx","../src/common/BackButton/BackButton.tsx","../node_modules/clsx/dist/clsx.m.js","../src/common/SelectionWrapper.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/hooks/useFocusWithin/useFocusWithin.ts","../src/utils/types/Status.ts","../src/components/TextField/TextField.tsx","../src/components/TextField/useTextField.tsx","../src/components/Textarea/Textarea.tsx","../node_modules/@loadsmart/utils-string/lib/objectFromQueryString.js","../node_modules/@loadsmart/utils-string/lib/queryStringFromObject.js","../node_modules/@loadsmart/utils-string/lib/toCapitalizeFirstLetter.js","../node_modules/@loadsmart/utils-string/lib/toLocaleCapitalizeFirstLetter.js","../node_modules/@loadsmart/utils-string/lib/isBlank.js","../node_modules/@loadsmart/utils-string/lib/index.js","../src/components/Link/useSafeLink.ts","../src/components/Link/Link.tsx","../src/components/Breadcrumbs/Breadcrumb.tsx","../src/components/Breadcrumbs/Breadcrumbs.tsx","../src/hooks/useDidMount/useDidMount.ts","../src/hooks/useSelectable/SelectableStrategy.ts","../src/utils/toolset/getID.ts","../src/hooks/useFingerprint/useFingerprint.ts","../src/hooks/useSelectable/useSelectable.ts","../src/components/ToggleGroup/ToggleGroupContext.ts","../src/components/ToggleGroup/Toggle.tsx","../src/components/ToggleGroup/ToggleGroup.tsx","../src/components/Tabs/TabsContext.ts","../src/hooks/useID/useID.ts","../src/components/Tabs/Tabs.tsx","../src/components/Section/Section.tsx","../src/styles/hidden.tsx","../src/components/Accordion/Accordion.context.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Banner/Banner.tsx","../src/components/Text/Text.tsx","../src/components/Modal/Modal.tsx","../src/components/Dialog/Dialog.tsx","../src/components/Dialog/useDialog.tsx","../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../src/components/Popover/Popover.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Label/Label.tsx","../src/components/Pagination/Pagination.constants.ts","../src/components/Pagination/PaginationItem.tsx","../src/components/Pagination/Pagination.helper.ts","../src/components/Pagination/usePagination.ts","../src/components/Pagination/Pagination.tsx","../src/components/ProgressBar/ProgressBar.tsx","../src/components/Switch/Switch.tsx","../src/components/Tag/Tag.tsx","../src/components/Toast/Toast.tsx","../src/components/Steps/Steps.helpers.ts","../src/components/Steps/StepsContext.ts","../src/components/Steps/ProgressSteps/ProgressStep.tsx","../src/components/Steps/ProgressSteps/ProgressSteps.tsx","../src/components/Steps/StepsStep.tsx","../src/components/Steps/Steps.tsx","../src/components/Steps/useSteps.ts","../src/components/Card/CardTitle.tsx","../src/components/Card/Card.tsx","../src/components/Dropdown/Dropdown.context.ts","../src/components/Dropdown/DropdownMenu.tsx","../src/utils/toolset/keyboard.ts","../src/hooks/useClickOutside/useClickOutside.ts","../src/components/Dropdown/DropdownTrigger.tsx","../src/components/Dropdown/useDropdown.ts","../src/components/Dropdown/Dropdown.tsx","../src/components/Select/Select.context.ts","../src/utils/toolset/pluralize.ts","../src/components/Select/SelectTrigger.tsx","../src/hooks/useFocusTrap/useFocusTrap.ts","../src/utils/toolset/isThenable.ts","../src/components/Select/Select.constants.ts","../src/components/Select/useSelect.helpers.ts","../src/components/Select/useSelect.ts","../src/utils/toolset/highlightMatch.tsx","../src/components/HighlightMatch/HighlightMatch.tsx","../src/components/Select/SelectOption.tsx","../src/components/Select/SelectEmpty.tsx","../src/components/Select/SelectCreatableOption.tsx","../src/components/Select/components.tsx","../src/components/Select/Select.tsx","../src/components/Select/useSelectExternal.ts","../src/components/SideNavigation/Logo/Logo.tsx","../src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.ts","../src/components/SideNavigation/Menu/MenuBaseItem.tsx","../src/components/SideNavigation/Menu/MenuLink.tsx","../src/components/SideNavigation/Menu/MenuExpandable.tsx","../src/utils/toolset/styledCompounds.ts","../src/components/SideNavigation/Menu/Menu.tsx","../src/components/SideNavigation/Separator/Separator.tsx","../src/components/SideNavigation/SideNavigation.tsx","../src/hooks/useWindowResize/useWindowResize.ts","../src/components/SideNavigation/useSideNavigation.ts","../src/components/Drawer/Drawer.tsx","../src/components/Table/Selection.tsx","../src/components/Table/TableSortHandle.tsx","../src/components/Table/Table.tsx","../src/components/TopNavigation/Logo/Logo.tsx","../src/components/TopNavigation/Menu/MenuItemDropdown.tsx","../src/components/TopNavigation/Menu/MenuItemIcon.tsx","../src/components/TopNavigation/Menu/Menu.tsx","../src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx","../src/components/TopNavigation/TopNavigation.tsx","../src/components/EmptyState/EmptyStateWithIcon.tsx","../src/components/EmptyState/Illustration.tsx","../src/components/EmptyState/EmptyStateWithIllustration.tsx","../src/components/EmptyState/EmptyState.tsx","../src/components/Calendar/Month.helper.ts","../src/components/Calendar/PickerModeToggle.tsx","../src/components/Calendar/Date.helper.ts","../src/components/Calendar/useCalendar.ts","../src/utils/toolset/getOrdinalSuffix.ts","../src/components/Calendar/DateFormat.helper.ts","../src/components/Calendar/Pickers/PickerButton.tsx","../src/components/Calendar/Pickers/DayPicker.tsx","../src/components/Calendar/Pickers/MonthPicker.tsx","../src/components/Calendar/Pickers/YearPicker.tsx","../src/components/Calendar/usePickerMode.ts","../src/components/Calendar/Calendar.tsx","../src/components/Calendar/Calendar.helpers.ts","../src/components/DatePicker/useDatePicker.ts","../src/components/DatePicker/DatePicker.tsx","../src/components/DatePicker/useDateRangePicker.ts","../src/components/DatePicker/DateRangePicker.tsx","../src/components/ErrorMessage/ErrorMessage.tsx","../src/components/DragDropFile/styles.tsx","../src/components/DragDropFile/components/Wrapper.tsx","../src/components/DragDropFile/components/DropZone.tsx","../src/utils/toolset/formatBytes.ts","../src/components/DragDropFile/components/FileItem.tsx","../src/components/DragDropFile/components/FileList.tsx","../src/components/DragDropFile/DragDropFile.tsx","../src/components/TablePagination/TablePagination.styles.ts","../src/components/TablePagination/TablePaginationActions.tsx","../src/components/TablePagination/RowsPerPage.tsx","../src/components/TablePagination/TablePagination.tsx","../src/components/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["interface TransitionStyleOptions {\n property?: string\n timingFunction?: string\n duration?: string\n}\n\n/**\n * Add basic CSS style for default transition parameters\n * @returns {string}\n */\nfunction transitionStyle(options?: TransitionStyleOptions): string {\n // TODO: add parameter to type of transition\n\n return `\n transition-property: ${\n options?.property ||\n 'background, border-color, box-shadow, color, fill, left, stroke, transform, opacity'\n };\n transition-timing-function: ${options?.timingFunction || 'cubic-bezier(0.4, 0, 0.2, 1)'};\n transition-duration: ${options?.duration || '450ms'};\n transition-delay: 0ms;\n `\n}\n\nexport default transitionStyle\n","import React, { ReactNode, ComponentType, type ReactElement } from 'react'\nimport styled from 'styled-components'\n\nimport transition from 'styles/transition'\nimport { getToken as token } from 'theming'\n\nimport type { ThemeToken } from 'theming'\n\ntype ThemeColors = keyof {\n [ColorToken in ThemeToken as ColorToken extends `color-${infer Token}`\n ? Token\n : never]: ColorToken\n}\n\nconst Wrapper = styled.span<{ $color?: ThemeColors }>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n &,\n & > svg {\n ${transition({\n property: 'transform',\n })}\n\n /*\n * prop('$color', 'currentColor')\n * Not using the prop helper function since we can't return\n * an evaluated token from it\n */\n color: ${(props) =>\n props.$color ? token(`color-${props.$color}` as ThemeToken, props) : 'currentColor'};\n\n fill: currentColor;\n }\n`\n\nexport interface IconProps<T> {\n name: keyof T\n size?: string | number\n width?: string | number\n height?: string | number\n className?: string\n color?: ThemeColors\n}\n\nexport type IconMapping = Record<string, ReactElement | ((props: never) => ReactElement)>\n\nexport function UnknownIcon(): ReactElement {\n return <span aria-label=\"Unknown icon\">&#9785;</span>\n}\n\nfunction IconFactory(map: IconMapping): ComponentType<IconProps<typeof map>> {\n function getIcon(name: keyof typeof map): ReactNode | null {\n // eslint-disable-next-line no-param-reassign\n name = String(name || '').toLowerCase()\n\n if (!(name in map)) return UnknownIcon\n\n return map[name]\n }\n\n return function Icon(props: IconProps<typeof map>) {\n const { name, size, width = '1em', height = '1em', className, color, ...rest } = props\n\n const I = getIcon(name) as typeof React.Component\n return (\n <Wrapper className={className} $color={color}>\n <I width={size || width} height={size || height} {...rest} />\n </Wrapper>\n )\n }\n}\n\nexport default IconFactory\n","import * as React from \"react\";\nconst SvgBack = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0 0h24v24H0V0z\", fill: \"none\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\" }));\nexport default SvgBack;\n","import * as React from \"react\";\nconst SvgBurgerMenu = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M4 37.6667H44V33.2222H4V37.6667ZM4 26.5556H44V22.1111H4V26.5556ZM4 11V15.4444H44V11H4Z\", fill: \"#313336\" }));\nexport default SvgBurgerMenu;\n","import * as React from \"react\";\nconst SvgCalendar = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0 0h24v24H0V0z\", fill: \"none\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V10h16v11zm0-13H4V5h16v3z\" }));\nexport default SvgCalendar;\n","import * as React from \"react\";\nconst SvgCaretDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M24 30L13 19H35L24 30Z\", clipRule: \"evenodd\" }));\nexport default SvgCaretDown;\n","import * as React from \"react\";\nconst SvgCaretLeft = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M30 42.3848L34.2426 38.1421L20.1005 24L34.2426 9.85786L30 5.61522L15.8579 19.7574L11.6152 24L15.8579 28.2426L30 42.3848Z\" }));\nexport default SvgCaretLeft;\n","import * as React from \"react\";\nconst SvgCheck = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M44.4203 13.3431L40.1777 9.1005L18.9645 30.3137L9.06496 20.4142L4.82232 24.6569L14.7218 34.5563L18.9645 38.799L23.2071 34.5563L44.4203 13.3431Z\" }));\nexport default SvgCheck;\n","import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z\" }));\nexport default SvgChevronDown;\n","import * as React from \"react\";\nconst SvgCaretRight = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M18 5.61522L13.7574 9.85786L27.8995 24L13.7574 38.1421L18 42.3848L32.1421 28.2426L36.3848 24L32.1421 19.7574L18 5.61522Z\" }));\nexport default SvgCaretRight;\n","import * as React from \"react\";\nconst SvgCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 18 18\", ...props }, /* @__PURE__ */ React.createElement(\"circle\", { cx: 9, cy: 9, r: 9, fillRule: \"evenodd\" }));\nexport default SvgCircle;\n","import * as React from \"react\";\nconst SvgClose = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 20 20\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17.0711 4.69671L15.3033 2.92894L10 8.23224L4.6967 2.92894L2.92893 4.69671L8.23223 10L2.92893 15.3033L4.6967 17.0711L10 11.7678L15.3033 17.0711L17.0711 15.3033L11.7678 10L17.0711 4.69671Z\" }));\nexport default SvgClose;\n","import * as React from \"react\";\nconst SvgInformation = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M12 2C6.48625 2 2 6.48625 2 12C2 17.5138 6.48625 22 12 22C17.5138 22 22 17.5138 22 12C22 6.48625 17.5138 2 12 2ZM12 19.2727C11.2473 19.2727 10.6364 18.6618 10.6364 17.9091C10.6364 17.1564 11.2473 16.5455 12 16.5455C12.7527 16.5455 13.3636 17.1564 13.3636 17.9091C13.3636 18.6618 12.7527 19.2727 12 19.2727ZM13.3636 14.2727H10.6364L10.6364 5.18182L13.3636 5.18182L13.3636 14.2727Z\" }));\nexport default SvgInformation;\n","import * as React from \"react\";\nconst SvgMinus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0 0h24v24H0V0z\", fill: \"none\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M19 13H5v-2h14v2z\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgPlus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"rect\", { fill: \"none\", height: 24, width: 24 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6V13z\" }));\nexport default SvgPlus;\n","import * as React from \"react\";\nconst SvgRefresh = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 12 12\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M6.782 1.5a4.499 4.499 0 0 0-4.437 3.785l-.89-.888-.705.705 2.123 2.123 2.12-2.122-.708-.708-.935.935A3.503 3.503 0 0 1 6.782 2.5c1.93 0 3.5 1.57 3.5 3.5s-1.57 3.5-3.5 3.5v1a4.5 4.5 0 0 0 0-9Z\" }));\nexport default SvgRefresh;\n","import * as React from \"react\";\nconst SvgSortAsc = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 10 11\", xmlns: \"http://www.w3.org/2000/svg\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_1\", fill: \"#313336\", d: \"m4.58334,0l4.58332,4.41667l-9.16666,0l4.58334,-4.41667z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }), /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_2\", fill: \"#CACCCF\", d: \"m4.58335,10.83337l-4.58333,-4.4167l9.16664,0l-4.58331,4.4167z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }));\nexport default SvgSortAsc;\n","import * as React from \"react\";\nconst SvgSortDesc = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 10 11\", xmlns: \"http://www.w3.org/2000/svg\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_1\", fill: \"#CACCCF\", d: \"m4.58334,0l4.58332,4.41667l-9.16666,0l4.58334,-4.41667z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }), /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_2\", fill: \"#313336\", d: \"m4.58335,10.83337l-4.58333,-4.4167l9.16664,0l-4.58331,4.4167z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }));\nexport default SvgSortDesc;\n","import * as React from \"react\";\nconst SvgSort = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 10 11\", xmlns: \"http://www.w3.org/2000/svg\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_1\", fill: \"#313336\", d: \"m4.58334,0l4.58332,4.41667l-9.16666,0l4.58334,-4.41667z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }), /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_2\", fill: \"#313336\", d: \"m4.58335,10.83337l-4.58333,-4.4167l9.16664,0l-4.58331,4.4167z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }));\nexport default SvgSort;\n","import * as React from \"react\";\nconst SvgUpload = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M39.0129 20.0894H29.9817V36.097H19.0291V20.0894H9.01953L24.1351 5L39.0129 20.0894ZM9 40V44H39V40H9Z\" }));\nexport default SvgUpload;\n","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { clipRule: \"evenodd\", d: \"M3.79753 20.9444H20.2031C21.1809 20.9444 21.8064 19.9034 21.3454 19.0421L13.142 3.68477C12.655 2.77174 11.3443 2.77174 10.856 3.68477L2.65392 19.0421C2.19415 19.9034 2.8197 20.9444 3.79753 20.9444ZM10.7045 9.30522H13.2948V14.4782H10.7045V9.30522ZM11.9996 15.7715C12.7146 15.7715 13.2948 16.3508 13.2948 17.0647C13.2948 17.7786 12.7146 18.358 11.9996 18.358C11.2847 18.358 10.7045 17.7786 10.7045 17.0647C10.7045 16.3508 11.2847 15.7715 11.9996 15.7715Z\" }));\nexport default SvgWarning;\n","import * as React from \"react\";\nconst SvgDotsHorizontal = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 24a5 5 0 11-10 0 5 5 0 0110 0zm15 0a5 5 0 11-10 0 5 5 0 0110 0zm15 0a5 5 0 11-10 0 5 5 0 0110 0z\", fill: \"currentColor\", fillRule: \"evenodd\" }));\nexport default SvgDotsHorizontal;\n","import * as React from \"react\";\nconst SvgCaretRightLast = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M18.2501 6.38126L14.1842 10.4471L27.7371 24L14.1842 37.5529L18.2501 41.6187L31.803 28.0659L35.8688 24L31.803 19.9341L18.2501 6.38126Z\" }), /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M40.2922 38.375L44.1256 38.375L44.1256 9.625L40.2922 9.625L40.2922 38.375Z\" }));\nexport default SvgCaretRightLast;\n","import { IconFactory } from '../IconFactory'\n\nimport BackIcon from './assets/back.svg'\nimport BurguerMenuIcon from './assets/burger-menu.svg'\nimport CalendarIcon from './assets/calendar.svg'\nimport CaretDownIcon from './assets/caret-down.svg'\nimport CaretLeftIcon from './assets/caret-left.svg'\nimport CheckIcon from './assets/check.svg'\nimport ChevronDownIcon from './assets/chevron-down.svg'\nimport ChevronRightIcon from './assets/caret-right.svg'\nimport CircleIcon from './assets/circle.svg'\nimport CloseIcon from './assets/close.svg'\nimport InformationIcon from './assets/information.svg'\nimport MinusIcon from './assets/minus.svg'\nimport PlusIcon from './assets/plus.svg'\nimport RefreshIcon from './assets/refresh.svg'\nimport SortAscIcon from './assets/sort-asc.svg'\nimport SortDescIcon from './assets/sort-desc.svg'\nimport SortIcon from './assets/sort.svg'\nimport UploadIcon from './assets/upload.svg'\nimport WarningIcon from './assets/warning.svg'\nimport DotsHorizontalIcon from './assets/dots-horizontal.svg'\nimport CaretRightLastIcon from './assets/caret-right-last.svg'\n\nimport type { IconProps as GenericIconProps } from '../IconFactory'\n\nconst icons = {\n 'burguer-menu': BurguerMenuIcon,\n calendar: CalendarIcon,\n 'caret-down': CaretDownIcon,\n 'caret-left': CaretLeftIcon,\n 'caret-right': ChevronRightIcon,\n 'chevron-down': ChevronDownIcon,\n back: BackIcon,\n check: CheckIcon,\n circle: CircleIcon,\n close: CloseIcon,\n information: InformationIcon,\n minus: MinusIcon,\n plus: PlusIcon,\n refresh: RefreshIcon,\n sort: SortIcon,\n 'sort-asc': SortAscIcon,\n 'sort-desc': SortDescIcon,\n upload: UploadIcon,\n warning: WarningIcon,\n 'dots-horizontal': DotsHorizontalIcon,\n 'caret-right-last': CaretRightLastIcon,\n}\n\nconst Icon = IconFactory(icons)\n\nexport type IconProps = GenericIconProps<typeof icons>\n\nexport default Icon\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport flatten from './flatten'\nimport isEmpty from './isEmpty'\nimport toArray from './toArray'\n\n// TODO: add this helper to @loadsmart/utils\n\nfunction interleave<T>(array1: Array<T>, array2: Array<T>): T[] {\n const safeArray1 = toArray(array1)\n const safeArray2 = toArray(array2)\n\n if (isEmpty(safeArray1) && isEmpty(safeArray2)) {\n return []\n } else if (isEmpty(safeArray1)) {\n return safeArray2\n } else if (isEmpty(safeArray2)) {\n return safeArray1\n }\n\n return flatten(safeArray1.map((element, index) => [element, safeArray2[index]]))\n}\n\nexport default interleave\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n\n/**\n * Add basic CSS style wrapping block for `:active` state.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction activatableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Array\n\n return [\n `\n &:enabled:not(.is-disabled) {\n &:active {`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n }\n `,\n ]\n}\n\nexport default activatableStyle\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n\n/**\n * Add basic CSS style wrapping block for `:disabled` state or `.is-disabled` class.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction disableableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Array\n\n return [\n `\n &.is-disabled,\n &:disabled {\n cursor: not-allowed;\n opacity: 0.40;\n\n user-select: none;\n\n &:active {\n pointer-events: none;\n }`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n\n // prevent overlapping the opacity for nested disabled elements\n .is-disabled &.is-disabled,\n .is-disabled &[disabled],\n [disabled] &[disabled],\n [disabled] &.is-disabled {\n opacity: 1 !important;\n }\n `,\n ]\n}\n\nexport default disableableStyle\n","/**\n * Add basic CSS style for ellipsizing the content of an element.\n * Setting `max-width` is a responsability of the caller.\n * @returns {string}\n */\nfunction ellipsizableStyle(): string {\n return `\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n `\n}\n\nexport default ellipsizableStyle\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n/**\n * Add basic CSS style wrapping block for `:active` state.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction focusableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Aray\n\n return [\n `\n outline: none;\n\n &:focus,\n &:focus-within,\n &.is-focused {\n outline: none;`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n `,\n ]\n}\n\nexport default focusableStyle\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n\n/**\n * Add basic CSS style wrapping block for `:hover` state; it includes check for non-disabled (`:enabled` or not `.is-disabled`) elements.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction hoverableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Array\n\n return [\n `\n &:not(.is-disabled):not(:disabled) {\n &:hover {`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n }\n `,\n ]\n}\n\nexport default hoverableStyle\n","import { css } from 'styled-components'\nimport type { FlattenInterpolation } from 'styled-components'\n\nimport { getToken } from 'theming'\nimport type { ThemedProps, ThemeToken } from 'theming'\n\ninterface FontStyleOptions {\n size?: ThemeToken\n family?: ThemeToken\n weight?: ThemeToken\n height?: ThemeToken\n color?: ThemeToken\n transform?: 'uppercase' | 'none'\n}\n\n/**\n * Add basic CSS style for default font\n * @returns {FlattenInterpolation}\n */\nfunction fontStyle({\n color = 'color-neutral-darkest',\n weight = 'font-weight-regular',\n size = 'font-size-4',\n family = 'font-family-default',\n height = 'font-height-3',\n transform = 'none',\n}: FontStyleOptions): FlattenInterpolation<ThemedProps> {\n return css`\n color: ${getToken(color)};\n font-weight: ${getToken(weight)};\n font-size: ${getToken(size)};\n font-family: ${getToken(family)};\n line-height: ${getToken(height)};\n text-transform: ${transform};\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n `\n}\n\nexport default fontStyle\n","import { css, ThemedStyledProps } from 'styled-components'\nimport type { FlattenInterpolation } from 'styled-components'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport conditional from 'tools/conditional'\nimport type { CustomTheme, ThemeToken } from 'theming'\nimport fontStyle from './font'\n\nexport type TypographyOptions = {\n italic?: boolean\n color?: ThemeToken\n}\n\ntype PropertiesToken = {\n fontSize: ThemeToken\n lineHeight: ThemeToken\n fontWeight: ThemeToken\n fontFamily?: ThemeToken\n textTransform?: 'none' | 'uppercase'\n color?: ThemeToken\n}\n\nexport type TypographyVariants =\n | 'heading-lg'\n | 'heading-md'\n | 'heading-md-bold'\n | 'heading-sm'\n | 'heading-sm-bold'\n | 'body'\n | 'body-bold'\n | 'caption'\n | 'caption-bold'\n | 'number-sm'\n | 'number-md'\n | 'button-sm'\n | 'button-md'\n | 'button-lg'\n | 'table-header-sm'\n | 'table-header-md'\n | 'chips-sm'\n | 'link'\n\ntype TypographyProperties = Record<TypographyVariants, PropertiesToken>\n\nexport const typographyProperties: TypographyProperties = {\n 'heading-lg': {\n fontSize: 'font-size-1',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n },\n 'heading-md': {\n fontSize: 'font-size-2',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n },\n 'heading-md-bold': {\n fontSize: 'font-size-2',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-bold',\n },\n 'heading-sm': {\n fontSize: 'font-size-3',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-medium',\n },\n 'heading-sm-bold': {\n fontSize: 'font-size-3',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n },\n body: {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-medium',\n },\n 'body-bold': {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n },\n caption: {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-medium',\n },\n 'caption-bold': {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n },\n 'number-sm': {\n fontFamily: 'font-family-monospace',\n fontSize: 'font-size-5',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n },\n 'number-md': {\n fontFamily: 'font-family-monospace',\n fontSize: 'font-size-4',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n },\n 'button-sm': {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'button-md': {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'button-lg': {\n fontSize: 'font-size-3',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'table-header-sm': {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-bold',\n },\n 'table-header-md': {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'chips-sm': {\n fontSize: 'font-size-6',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n link: {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n color: 'color-accent',\n },\n}\n\nconst DEFAULT_VARIANT: TypographyVariants = 'body'\n\nfunction getPropertiesByVariant(variant: TypographyVariants) {\n return variant in typographyProperties\n ? typographyProperties[variant]\n : typographyProperties[DEFAULT_VARIANT]\n}\n\ntype StyledTemplate<P> = FlattenInterpolation<ThemedStyledProps<P, CustomTheme>>\n\n/**\n * Standard styles for screen-rendered text\n * @param {TypographyVariants} variant Name of the variant\n * @param {TypographyOptions} options Add boldness, italics and color\n * @returns {FlattenInterpolation}\n */\nfunction typography<P>(\n variant: TypographyVariants | ((props: P) => string) = DEFAULT_VARIANT,\n options?: TypographyOptions\n): StyledTemplate<P> | ((props: P) => StyledTemplate<P>) {\n if (isFunction(variant)) {\n return ((props: P) => typography(variant(props) as TypographyVariants, options)) as (\n props: P\n ) => StyledTemplate<P>\n }\n\n const properties = getPropertiesByVariant(variant)\n\n return css`\n ${fontStyle({\n family: properties.fontFamily,\n height: properties.lineHeight,\n size: properties.fontSize,\n weight: properties.fontWeight,\n transform: properties.textTransform,\n color: properties.color || options?.color,\n })}\n\n ${conditional({\n 'font-style: italic;': options?.italic,\n })};\n `\n}\n\nexport default typography\n","import React from 'react'\nimport styled, { keyframes } from 'styled-components'\n\nconst ANIMATION_DURATION = 0.8\n\nconst animation = keyframes`\n 0% { opacity: 0 }\n 25% { opacity: 1 }\n 50% { opacity: 0.66 }\n 75% { opacity: 0.33; }\n 100% { opacity: 0 }\n`\n\ninterface LayerProps {\n index: number\n}\n\nconst Layer = styled.path<LayerProps>`\n animation-name: ${animation};\n animation-duration: ${ANIMATION_DURATION}s;\n animation-delay: -${(props) => props.index * (ANIMATION_DURATION / 4)}s;\n animation-iteration-count: infinite;\n`\n\nexport interface SpinnerProps {\n title?: string\n size: number\n}\n\nexport default function Spinner({ title, size, ...props }: SpinnerProps): JSX.Element {\n return (\n <svg\n {...props}\n viewBox=\"0 0 48 48\"\n fillRule=\"evenodd\"\n strokeLinejoin=\"round\"\n strokeMiterlimit=\"2\"\n clipRule=\"evenodd\"\n width={size}\n height={size}\n >\n <title>{title || 'Loading'}</title>\n <g\n id=\"surface1\"\n transform=\"matrix(0.0806777,0,0,0.0806777,0,-9.96047)\"\n fill=\"#33CC60\"\n fillRule=\"nonzero\"\n >\n <Layer\n index={0}\n d=\"M362.176,638.695C366.445,638.695 370.535,637 373.527,633.996L505.332,502.211L224.305,502.211C222.074,502.211 220.066,501.316 218.617,499.855L84.488,633.996C87.395,636.902 91.406,638.695 95.82,638.695L362.176,638.695Z\"\n />\n <Layer\n index={1}\n d=\"M376.164,482.289L512.648,482.289L512.648,217.34C512.648,212.906 510.855,208.898 507.945,205.988L373.809,340.121C375.266,341.578 376.164,343.59 376.164,345.805L376.164,482.289Z\"\n />\n <Layer\n index={2}\n d=\"M500.48,201.746L235.535,201.746L235.535,338.23L372.02,338.23C374.234,338.23 376.246,339.129 377.703,340.586L511.832,206.445C508.926,203.539 504.918,201.746 500.48,201.746Z\"\n />\n <Layer\n index={3}\n d=\"M215.449,495.488L215.449,214.461L83.668,346.262C80.66,349.289 78.965,353.359 78.965,357.625L78.965,623.973C78.965,628.398 80.758,632.406 83.668,635.313L217.805,501.176C216.348,499.715 215.449,497.707 215.449,495.488Z\"\n />\n </g>\n </svg>\n )\n}\n","import { css } from 'styled-components'\n\nimport type { FlattenInterpolation } from 'styled-components'\nimport type { ThemedProps } from 'theming'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nexport const getSpace = (prop: string): FlattenInterpolation<ThemedProps> => css`\n ${conditional({\n 'space-none': whenProps({ [prop]: 'none' }),\n 'space-2xs': whenProps({ [prop]: '2xs' }),\n 'space-xs': whenProps({ [prop]: 'xs' }),\n 'space-s': whenProps({ [prop]: 's' }),\n 'space-m': whenProps({ [prop]: 'm' }),\n 'space-l': whenProps({ [prop]: 'l' }),\n 'space-xl': whenProps({ [prop]: 'xl' }),\n 'space-2xl': whenProps({ [prop]: '2xl' }),\n 'space-3xl': whenProps({ [prop]: '3xl' }),\n })}\n`\n","import React from 'react'\nimport type { HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nimport { getSpace } from './Layout.utils'\nimport type { Spacing, JustifyValue, AlignValue } from './Layout.types'\n\nexport interface GroupProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n justify?: JustifyValue\n align?: AlignValue\n as?: string | React.ComponentType<any>\n}\n\nconst GroupContainer = styled.div<{\n $space: GroupProps['space']\n $justify: GroupProps['justify']\n $align: GroupProps['align']\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${getSpace('$space')};\n\n align-items: ${conditional({\n center: whenProps({ $align: 'center' }),\n 'flex-start': whenProps({ $align: 'flex-start' }),\n 'flex-end': whenProps({ $align: 'flex-end' }),\n stretch: whenProps({ $align: 'stretch' }),\n })};\n\n justify-content: ${conditional({\n center: whenProps({ $justify: 'center' }),\n 'flex-start': whenProps({ $justify: 'flex-start' }),\n 'flex-end': whenProps({ $justify: 'flex-end' }),\n 'space-between': whenProps({ $justify: 'space-between' }),\n 'space-around': whenProps({ $justify: 'space-around' }),\n 'space-evenly': whenProps({ $justify: 'space-evenly' }),\n })};\n`\n\n/**\n * Group layout component.\n * @param {GroupProps} props\n */\nexport function Group(props: GroupProps): JSX.Element {\n const { space = 'm', justify = 'flex-start', align = 'flex-start', children, ...rest } = props\n\n return (\n <GroupContainer $space={space} $justify={justify} $align={align} {...rest}>\n {children}\n </GroupContainer>\n )\n}\n","import React from 'react'\nimport type { HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nimport { getSpace } from './Layout.utils'\nimport type { Spacing, JustifyValue, AlignValue } from './Layout.types'\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n justify?: JustifyValue\n align?: AlignValue\n as?: string | React.ComponentType<any>\n}\n\nexport const StackContainer = styled.div<{\n $space: StackProps['space']\n $justify: StackProps['justify']\n $align: StackProps['align']\n}>`\n display: flex;\n flex-direction: column;\n\n align-items: ${conditional({\n center: whenProps({ $align: 'center' }),\n 'flex-start': whenProps({ $align: 'flex-start' }),\n 'flex-end': whenProps({ $align: 'flex-end' }),\n stretch: whenProps({ $align: 'stretch' }),\n })};\n\n justify-content: ${conditional({\n center: whenProps({ $justify: 'center' }),\n 'flex-start': whenProps({ $justify: 'flex-start' }),\n 'flex-end': whenProps({ $justify: 'flex-end' }),\n 'space-between': whenProps({ $justify: 'space-between' }),\n 'space-around': whenProps({ $justify: 'space-around' }),\n 'space-evenly': whenProps({ $justify: 'space-evenly' }),\n })};\n\n & > * {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n & > * + * {\n margin-top: ${getSpace('$space')};\n }\n`\n\n/**\n * Stack layout component.\n * @param {StackProps} props\n */\nexport function Stack(props: StackProps): JSX.Element {\n const { space = 'm', justify = 'flex-start', align = 'stretch', children, ...rest } = props\n\n return (\n <StackContainer $space={space} $justify={justify} $align={align} {...rest}>\n {children}\n </StackContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport type { Spacing } from './Layout.types'\nimport { getSpace } from './Layout.utils'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface BoxProps extends HTMLAttributes<HTMLElement> {\n background?: 'transparent' | 'neutral-white' | 'neutral-lighter' | 'neutral-lightest'\n padding?: Spacing\n borderRadius?: 'none' | 's' | 'm' | 'l'\n borderWidth?: 'medium' | 'thin' | 'none'\n borderColor?: 'neutral-darker' | 'neutral-light' | 'neutral-lighter' | 'neutral-white' | 'primary'\n textAlign?: 'left' | 'center' | 'right'\n}\n\nconst BoxContainer = styled.div<{\n $background: BoxProps['background']\n $padding: BoxProps['padding']\n $borderRadius: BoxProps['borderRadius']\n $borderWidth: BoxProps['borderWidth']\n $borderColor: BoxProps['borderColor']\n $textAlign: BoxProps['textAlign']\n}>`\n padding: ${getSpace('$padding')};\n\n color: ${token('color-neutral-darker')};\n\n text-align: ${conditional({\n left: whenProps({ $textAlign: 'left' }),\n center: whenProps({ $textAlign: 'center' }),\n right: whenProps({ $textAlign: 'right' }),\n })};\n\n background-color: ${conditional({\n 'color-transparent': whenProps({ $background: 'transparent' }),\n 'color-neutral-white': whenProps({ $background: 'neutral-white' }),\n 'color-neutral-lighter': whenProps({ $background: 'neutral-lighter' }),\n 'color-neutral-lightest': whenProps({ $background: 'neutral-lightest' }),\n })};\n\n border-color: ${conditional({\n 'color-neutral-darker': whenProps({ $borderColor: 'neutral-darker' }),\n 'color-neutral-light': whenProps({ $borderColor: 'neutral-light' }),\n 'color-neutral-lighter': whenProps({ $borderColor: 'neutral-lighter' }),\n 'color-neutral-white': whenProps({ $borderColor: 'neutral-white' }),\n 'color-primary': whenProps({ $borderColor: 'primary' }),\n })};\n\n border-style: solid;\n\n border-width: ${conditional({\n 'border-width-medium': whenProps({ $borderWidth: 'medium' }),\n 'border-width-thin': whenProps({ $borderWidth: 'thin' }),\n 'border-width-none': whenProps({ $borderWidth: 'none' }),\n })};\n\n border-radius: ${conditional({\n 'border-radius-none': whenProps({ $borderRadius: 'none' }),\n 'border-radius-s': whenProps({ $borderRadius: 's' }),\n 'border-radius-m': whenProps({ $borderRadius: 'm' }),\n 'border-radius-l': whenProps({ $borderRadius: 'l' }),\n })};\n`\n\n/**\n * Box layout component.\n * @param {BoxProps} props\n */\nexport function Box(props: BoxProps): JSX.Element {\n const {\n background = 'transparent',\n borderColor = 'neutral-light',\n borderRadius = 's',\n borderWidth = 'none',\n padding = 'm',\n textAlign = 'left',\n children,\n ...rest\n } = props\n\n return (\n <BoxContainer\n $background={background}\n $borderColor={borderColor}\n $borderRadius={borderRadius}\n $borderWidth={borderWidth}\n $padding={padding}\n $textAlign={textAlign}\n {...rest}\n >\n {children}\n </BoxContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport prop from 'tools/prop'\n\nimport type { Spacing } from './Layout.types'\nimport { getSpace } from './Layout.utils'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface SidebarProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n reversed?: boolean\n sideWidth?: string\n minContentWidth?: string\n}\n\nconst SidebarContainer = styled.div<{\n $space: SidebarProps['space']\n $reversed: SidebarProps['reversed']\n $sideWidth: SidebarProps['sideWidth']\n $minContentWidth: SidebarProps['minContentWidth']\n}>`\n display: flex;\n flex-wrap: wrap;\n\n gap: ${getSpace('$space')};\n\n &\n > ${conditional({\n ':first-child': whenProps({ $reversed: false }),\n ':last-child': whenProps({ $reversed: true }),\n })} {\n flex-basis: ${prop('$sideWidth')};\n flex-grow: 1;\n }\n\n &\n > ${conditional({\n ':first-child': whenProps({ $reversed: true }),\n ':last-child': whenProps({ $reversed: false }),\n })} {\n flex-basis: 0;\n flex-grow: 999;\n min-width: ${prop('$minContentWidth')};\n }\n`\n\n/**\n * Sidebar layout component.\n * @param {SidebarProps} props\n */\nexport function Sidebar(props: SidebarProps): JSX.Element {\n const {\n minContentWidth = '50%',\n reversed = false,\n sideWidth = 'auto',\n space = 'm',\n children,\n ...rest\n } = props\n\n return (\n <SidebarContainer\n $minContentWidth={minContentWidth}\n $reversed={reversed}\n $sideWidth={sideWidth}\n $space={space}\n {...rest}\n >\n {children}\n </SidebarContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport prop from 'tools/prop'\n\nimport type { Spacing } from './Layout.types'\nimport { getSpace } from './Layout.utils'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface SwitcherProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n threshold?: string\n limit?: number\n}\n\nconst SwitcherContainer = styled.div<{\n $space: SwitcherProps['space']\n $threshold: SwitcherProps['threshold']\n $limit: SwitcherProps['limit']\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${getSpace('$space')};\n\n > * {\n flex-basis: calc((${prop('$threshold')} - 100%) * 999);\n flex-grow: 1;\n }\n\n & > :nth-last-child(n + ${prop('$limit')}),\n & > :nth-last-child(n + ${prop('$limit')}) ~ * {\n flex-basis: 100%;\n }\n`\n\n/**\n * Switcher layout component.\n * @param {SwitcherProps} props\n */\nexport function Switcher(props: SwitcherProps): JSX.Element {\n const { limit = 4, space = 's', threshold = '10rem', children, ...rest } = props\n\n return (\n <SwitcherContainer $space={space} $threshold={threshold} $limit={limit + 1} {...rest}>\n {children}\n </SwitcherContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport prop from 'tools/prop'\n\nimport { getSpace } from 'components/Layout/Layout.utils'\nimport type { Spacing } from './Layout.types'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface GridProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n minColumnWidth?: string\n}\n\nconst GridContainer = styled.div<{\n $space: GridProps['space']\n $minColumnWidth: GridProps['minColumnWidth']\n}>`\n display: grid;\n grid-gap: ${getSpace('$space')};\n\n @supports (width: min(${prop('$minColumnWidth')}, 100%)) {\n & {\n grid-template-columns: repeat(auto-fit, minmax(min(${prop('$minColumnWidth')}, 100%), 1fr));\n }\n }\n`\n\n/**\n * Grid layout component.\n * @param {GridProps} props\n */\nexport function Grid(props: GridProps): JSX.Element {\n const { space = 'm', minColumnWidth = '50%', children, ...rest } = props\n\n return (\n <GridContainer $space={space} $minColumnWidth={minColumnWidth} {...rest}>\n {children}\n </GridContainer>\n )\n}\n","import { Group } from './Group'\nimport { Stack } from './Stack'\nimport { Box } from './Box'\nimport { Sidebar } from './Sidebar'\nimport { Switcher } from './Switcher'\nimport { Grid } from './Grid'\n\nconst Layout = (): null => {\n return null\n}\n\nLayout.Group = Group\nLayout.Stack = Stack\nLayout.Box = Box\nLayout.Sidebar = Sidebar\nLayout.Switcher = Switcher\nLayout.Grid = Grid\n\nexport default Layout\n","import { Layout } from 'components/Layout'\nimport React from 'react'\nimport styled, { keyframes } from 'styled-components'\nimport { getToken as token } from 'theming'\n\nconst loading = keyframes` \n from {\n width: 0\n }\n to {\n width: 100%\n } \n`\n\nexport const Bar = styled.div<{ width?: number; velocity?: number }>`\n position: relative;\n\n width: ${({ width }) => (width ? `${width}px` : '100%')};\n height: ${token('space-s')};\n overflow: hidden;\n\n background-color: ${token('color-neutral-light')};\n border-radius: ${token('border-radius-m')};\n\n &:before {\n position: absolute;\n\n display: block;\n width: 100%;\n height: ${token('space-s')};\n\n background-color: ${token('color-primary')};\n\n animation: ${loading} ${({ velocity }) => (velocity && velocity > 0 ? velocity : 2.5)}s linear\n infinite;\n\n content: '';\n }\n`\n\nexport interface LoadingBarProps {\n alignment?: 'left' | 'center' | 'right'\n title?: React.ReactNode\n secondaryTitle?: React.ReactNode\n width?: number | undefined\n velocity?: number | undefined\n}\n\nexport default function LoadingBar({\n alignment,\n title,\n secondaryTitle,\n width = undefined,\n velocity = 2.5,\n}: LoadingBarProps): JSX.Element {\n return (\n <Layout.Box textAlign={alignment}>\n <Layout.Stack space=\"s\">\n {title}\n <Bar width={width} velocity={velocity} />\n {secondaryTitle}\n </Layout.Stack>\n </Layout.Box>\n )\n}\n","import React from 'react'\nimport styled, { keyframes } from 'styled-components'\nimport conditional, { whenProps } from 'tools/conditional'\nimport prop from 'tools/prop'\nimport { getToken as token } from 'theming'\n\nconst pulse = keyframes`\n 50% {\n opacity: 0.2;\n }\n\n 100% {\n opacity: 1;\n }\n`\n\nconst Wrapper = styled.div`\n text-align: center;\n\n div:nth-child(1) {\n animation: ${pulse} 1s infinite ease-in-out -0.2s;\n }\n\n div:nth-child(2) {\n animation: ${pulse} 1s infinite ease-in-out -0.1s;\n }\n\n div:nth-child(3) {\n animation: ${pulse} 1s infinite ease-in-out 0s;\n }\n`\n\ninterface DotProps {\n size?: number\n variant?: 'light' | 'dark'\n}\n\nconst Dot = styled.div<DotProps>`\n display: inline-block;\n width: ${prop('size')}px;\n height: ${prop('size')}px;\n margin: ${token('space-2xs')};\n\n background-color: ${conditional({\n 'color-neutral-white': whenProps({ variant: 'light' }),\n 'color-neutral-dark': whenProps({ variant: 'dark' }),\n })};\n border-radius: ${token('border-radius-circle')};\n`\n\nexport interface LoadingDotsProps {\n size?: number\n variant?: 'dark' | 'light'\n}\n\nexport default function LoadingDots({\n size = 10,\n variant = 'dark',\n ...props\n}: LoadingDotsProps): JSX.Element {\n return (\n <Wrapper role=\"progressbar\" aria-label=\"Loading\" {...props}>\n <Dot size={size} variant={variant} />\n <Dot size={size} variant={variant} />\n <Dot size={size} variant={variant} />\n </Wrapper>\n )\n}\n","import React, { forwardRef } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport ellipsizable from 'styles/ellipsizable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport omit from 'utils/toolset/omit'\nimport rem from 'utils/toolset/rem'\nimport transition from 'styles/transition'\nimport typography from 'styles/typography'\n\nimport { LoadingDots } from 'components/Loaders'\n\nimport type { ButtonHTMLAttributes, ForwardedRef, ReactNode } from 'react'\nimport type { IconProps } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport type { LoadingDotsProps } from 'components/Loaders'\n\nexport type ButtonVariants = 'primary' | 'secondary' | 'warning' | 'icon' | 'tertiary'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n className?: string\n leading?: ReactNode\n scheme?: ColorScheme\n trailing?: ReactNode\n variant?: ButtonVariants\n scale?: 'small' | 'default' | 'large'\n loading?: boolean\n}\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n padding: ${rem('6px')} 0;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Trailing = styled(StyledSpan)`\n /* placeholder */\n`\n\nexport const Children = styled.span<ButtonProps>`\n ${({ children }) =>\n typeof children === 'string'\n ? ellipsizable()\n : `\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n `}\n\n padding: ${rem('6px')} 0;\n`\n\nconst BaseStyledButton = styled.button<{\n $scale: ButtonProps['scale']\n $loading?: ButtonProps['loading']\n}>`\n ${transition()}\n\n ${typography(\n conditional({\n 'button-md': whenProps({ $scale: 'default' }),\n 'button-sm': whenProps({ $scale: 'small' }),\n 'button-lg': whenProps({ $scale: 'large' }),\n })\n )}\n\n box-sizing: border-box;\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n text-transform: uppercase;\n text-align: center;\n\n cursor: pointer;\n\n border-radius: ${token('border-radius-s')};\n border-width: ${token('border-width-thin')};\n border-style: solid;\n border-color: ${token('color-neutral-darker')};\n\n height: ${conditional({\n 'button-height': whenProps({ $scale: 'default' }),\n 'button-small-height': whenProps({ $scale: 'small' }),\n 'button-large-height': whenProps({ $scale: 'large' }),\n })};\n\n padding: 0 8px;\n\n ${disableable()}\n\n ${({ $loading }) =>\n $loading\n ? css`\n pointer-events: none;\n position: relative;\n `\n : ''}\n\n ${Leading} {\n margin: 0 ${token('space-xs')} 0 0;\n }\n\n ${Trailing} {\n margin: 0 0 0 ${token('space-xs')};\n }\n`\n\nconst StyledButton = styled(BaseStyledButton)<{\n $variant: ButtonProps['variant']\n $scale: ButtonProps['scale']\n $scheme: ButtonProps['scheme']\n}>`\n width: ${conditional({\n 'button-width': whenProps({ $variant: ['primary', 'secondary', 'warning', 'tertiary'] }),\n 'button-icon-width': whenProps({ $variant: 'icon', $scale: 'default' }),\n 'button-icon-small-width': whenProps({ $variant: 'icon', $scale: 'small' }),\n 'button-icon-large-width': whenProps({ $variant: 'icon', $scale: 'large' }),\n })};\n\n height: ${conditional({\n 'button-height': whenProps({ $scale: 'default' }),\n 'button-small-height': whenProps({ $scale: 'small' }),\n 'button-large-height': whenProps({ $scale: 'large' }),\n })};\n\n color: ${conditional({\n 'button-primary-color': whenProps({ $variant: 'primary' }),\n 'button-secondary-color': whenProps({ $variant: 'secondary', $scheme: 'light' }),\n 'button-secondary-dark-color': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-color': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color': whenProps({ $variant: 'warning' }),\n 'button-icon-color': whenProps({ $variant: 'icon' }),\n })};\n\n background: ${conditional({\n 'button-primary-background': whenProps({ $variant: 'primary' }),\n 'button-secondary-background': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background': whenProps({\n $variant: 'tertiary',\n }),\n 'button-warning-background': whenProps({ $variant: 'warning' }),\n 'button-icon-background': whenProps({ $variant: 'icon' }),\n })};\n\n border-color: ${conditional({\n 'button-primary-border-color': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color': whenProps({ $variant: 'secondary', $scheme: 'light' }),\n 'button-secondary-dark-border-color': whenProps({ $variant: 'secondary', $scheme: 'dark' }),\n 'button-tertiary-border-color': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color': whenProps({ $variant: 'icon' }),\n })};\n border-radius: ${conditional({\n 'button-border-radius': whenProps({ $variant: ['primary', 'secondary', 'warning'] }),\n 'button-icon-border-radius': whenProps({ $variant: 'icon' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'button-primary-background--hover': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background--hover': whenProps({\n $variant: 'tertiary',\n }),\n 'button-warning-background--hover': whenProps({ $variant: 'warning' }),\n 'button-icon-background--hover': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--hover': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-border-color--hover': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color--hover': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--hover': whenProps({ $variant: 'icon' }),\n })};\n color: ${conditional({\n 'button-primary-color--hover': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-color--hover': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color--hover': whenProps({ $variant: 'warning' }),\n 'button-icon-color--hover': whenProps({ $variant: 'icon' }),\n })};\n `}\n\n ${disableable`\n background: ${conditional({\n 'button-primary-background--disabled': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background--disabled': whenProps({ $variant: 'tertiary' }),\n 'button-warning-background--disabled': whenProps({ $variant: 'warning' }),\n 'button-icon-background--disabled': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--disabled': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-border-color--disabled': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color--disabled': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--disabled': whenProps({ $variant: 'icon' }),\n })};\n color: ${conditional({\n 'button-primary-color--disabled': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-color--disabled': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color--disabled': whenProps({ $variant: 'warning' }),\n 'button-icon-color--disabled': whenProps({ $variant: 'icon' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'button-primary-background--focus': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background--focus': whenProps({ $variant: 'tertiary' }),\n 'button-warning-background--focus': whenProps({ $variant: 'warning' }),\n 'button-icon-background--focus': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--focus': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-border-color--focus': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color--focus': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--focus': whenProps({ $variant: 'icon' }),\n })};\n color: ${conditional({\n 'button-primary-color--focus': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--focus': whenProps({ $variant: 'secondary', $scheme: 'dark' }),\n 'button-tertiary-color--focus': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color--focus': whenProps({ $variant: 'warning' }),\n 'button-icon-color--focus': whenProps({ $variant: 'icon' }),\n })};\n\n box-shadow: ${conditional({\n 'button-primary-box-shadow': whenProps({ $variant: 'primary' }),\n 'button-secondary-box-shadow': whenProps({ $variant: 'secondary' }),\n 'button-warning-box-shadow': whenProps({ $variant: 'warning' }),\n 'button-tertiary-box-shadow': whenProps({ $variant: 'tertiary' }),\n 'button-icon-box-shadow': whenProps({ $variant: 'icon' }),\n })};\n\n outline: ${conditional({\n 'button-primary-outline': whenProps({ $variant: 'primary' }),\n 'button-secondary-outline': whenProps({ $variant: 'secondary' }),\n 'button-tertiary-outline': whenProps({ $variant: 'tertiary' }),\n 'button-warning-outline': whenProps({ $variant: 'warning' }),\n 'button-icon-outline': whenProps({ $variant: 'icon' }),\n })};\n\n outline-offset: ${token('button-outline-offset')};\n `}\n\n ${activatable`\n background: ${conditional({\n 'button-primary-background--active': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--active': whenProps({\n $variant: ['secondary', 'tertiary'],\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--active': whenProps({\n $variant: ['secondary', 'tertiary'],\n $scheme: 'dark',\n }),\n 'button-warning-background--active': whenProps({ $variant: 'warning' }),\n 'button-icon-background--active': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--active': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--active': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--active': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-warning-border-color--active': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--active': whenProps({ $variant: 'icon' }),\n 'color-transparent': whenProps({ $variant: 'tertiary' }),\n })};\n color: ${conditional({\n 'button-primary-color--active': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--active': whenProps({\n $variant: ['secondary', 'tertiary'],\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--active': whenProps({ $variant: 'secondary', $scheme: 'dark' }),\n 'button-warning-color--active': whenProps({ $variant: 'warning' }),\n 'button-icon-color--active': whenProps({ $variant: 'icon' }),\n })};\n `}\n\n ${Children} {\n margin: 0 ${token('button-spacing-x')};\n }\n\n ${Leading} {\n margin: 0 0 0 ${token('button-spacing-x')};\n }\n\n ${Trailing} {\n margin: 0 ${token('button-spacing-x')} 0 0;\n }\n`\n\nconst StyledSelector = styled(StyledButton)`\n ${Children} {\n flex: 1;\n }\n\n ${Trailing} {\n margin: 0;\n }\n`\n\nconst TextHidden = styled.span`\n transform: scale(0);\n`\n\n/**\n * Accessible attributes in `LoadingDots` aren't necessary\n * because the `Button` will keep its content, but invisible\n */\nconst StyledLoadingDots = styled(LoadingDots).attrs({\n 'aria-label': undefined,\n role: 'presentation',\n})`\n position: absolute;\n left: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n`\n\nconst ButtonLoadingDots = ({\n buttonVariant = 'secondary',\n ...remainingProps\n}: Omit<LoadingDotsProps, 'variant'> & { buttonVariant?: ButtonVariants }) => {\n const buttonLightVariants = new Set(['secondary', 'warning', 'icon', 'tertiary'])\n /**\n * Change LoadingDots variant between `light` and `dark` to have contrast with Button's variant\n */\n const loadingDotsVariant: 'dark' | 'light' = buttonLightVariants.has(buttonVariant)\n ? 'dark'\n : 'light'\n\n return <StyledLoadingDots {...remainingProps} variant={loadingDotsVariant} />\n}\n\nfunction ButtonChildrenWrapper({\n loading,\n children,\n variant,\n}: Pick<ButtonProps, 'loading' | 'children' | 'variant'>) {\n if (loading) {\n return (\n <>\n <ButtonLoadingDots buttonVariant={variant} />\n <TextHidden>{children}</TextHidden>\n </>\n )\n }\n\n return <>{children}</>\n}\n\nexport const BaseButton = forwardRef<HTMLButtonElement, ButtonProps>(function BaseButton(\n {\n scale = 'default',\n children,\n leading,\n trailing,\n loading,\n disabled,\n variant,\n ...others\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n return (\n <BaseStyledButton\n ref={ref}\n {...others}\n aria-disabled={loading ? 'true' : undefined}\n disabled={disabled}\n $scale={scale}\n $loading={loading}\n >\n <ButtonChildrenWrapper loading={loading} variant={variant}>\n {leading && <Leading aria-hidden=\"true\">{leading}</Leading>}\n <Children loading={loading}>{children}</Children>\n {trailing && <Trailing aria-hidden=\"true\">{trailing}</Trailing>}\n </ButtonChildrenWrapper>\n </BaseStyledButton>\n )\n})\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n scheme = 'light',\n scale = 'default',\n variant = 'secondary',\n children,\n leading,\n trailing,\n disabled,\n loading,\n ...others\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n return (\n <StyledButton\n ref={ref}\n {...others}\n type={type}\n aria-disabled={loading ? 'true' : undefined}\n disabled={disabled}\n $scheme={scheme}\n $scale={scale}\n $variant={variant}\n $loading={loading}\n >\n <ButtonChildrenWrapper loading={loading} variant={variant}>\n {leading && <Leading>{leading}</Leading>}\n <Children>{children}</Children>\n {trailing && <Trailing>{trailing}</Trailing>}\n </ButtonChildrenWrapper>\n </StyledButton>\n )\n})\n\nexport function Caret(props: Omit<IconProps, 'name'>): JSX.Element {\n return <Icon size={20} {...props} name=\"caret-down\" />\n}\n\nexport const SelectorButton = forwardRef<HTMLButtonElement, ButtonProps>(function SelectorButton(\n {\n scheme = 'light',\n scale = 'default',\n type = 'button',\n variant = 'secondary',\n children,\n trailing,\n disabled,\n loading,\n ...others\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n others = omit<ButtonProps>(others, ['leading'])\n\n return (\n <StyledSelector\n ref={ref}\n {...others}\n type={type}\n aria-disabled={loading ? 'true' : undefined}\n disabled={disabled}\n $loading={loading}\n $scheme={scheme}\n $scale={scale}\n $variant={variant}\n >\n <ButtonChildrenWrapper loading={loading} variant={variant}>\n <Children>{children}</Children>\n {trailing && <Trailing>{trailing}</Trailing>}\n </ButtonChildrenWrapper>\n </StyledSelector>\n )\n})\n\nexport type IconButtonProps = Omit<ButtonProps, 'leading' | 'trailing' | 'variant' | 'loading'>\n\nexport const IconButton = forwardRef<HTMLButtonElement, ButtonProps>(function IconButton(\n { scheme = 'light', scale = 'default', type = 'button', children, ...others }: IconButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n others = omit<ButtonProps>(others, ['leading', 'trailing', 'variant'])\n\n return (\n <StyledButton ref={ref} {...others} type={type} $scheme={scheme} $scale={scale} $variant=\"icon\">\n <Children>{children}</Children>\n </StyledButton>\n )\n})\n\nexport default Button\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport focusable from 'styles/focusable'\n\nimport type { ButtonProps } from 'components/Button'\n\nexport interface CloseButtonProps extends ButtonProps {\n size?: string | number\n}\n\nconst Button = styled(BaseButton)`\n border: none;\n border-radius: ${token('border-radius-circle')};\n\n color: ${token('color-neutral-darker')};\n\n background: ${token('color-transparent')};\n\n padding: ${token('space-xs')};\n\n font-size: ${token('font-size-3')};\n\n /*\n * button height is set in the BaseButton component\n * we set width here to ensure a perfectly rounded button\n */\n width: ${conditional({\n 'button-height': whenProps({ scale: 'default' }),\n 'button-small-height': whenProps({ scale: 'small' }),\n 'button-large-height': whenProps({ scale: 'large' }),\n })};\n\n ${focusable`\n box-shadow: ${token('button-icon-box-shadow')};\n\n outline: ${token('button-icon-outline')};\n outline-offset: ${token('button-outline-offset')};\n `}\n`\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction CloseButton({ scale = 'small', size = 16, ...others }: CloseButtonProps): JSX.Element {\n return (\n <Button scale={scale} {...others}>\n <Icon name=\"close\" size={size} />\n </Button>\n )\n}\n\nexport default CloseButton\n","import React from 'react'\n\nimport { IconButton } from 'components/Button'\nimport { Icon } from 'components/Icon'\n\nimport type { ButtonProps } from 'components/Button'\n\nexport type BackButtonProps = Omit<ButtonProps, 'children'>\n\nfunction BackButton({ scale = 'small', ...others }: BackButtonProps): JSX.Element {\n return (\n <IconButton scale={scale} {...others}>\n <Icon name=\"back\" size={16} />\n </IconButton>\n )\n}\n\nexport default BackButton\n","function toVal(mix) {\n\tvar k, y, str='';\n\n\tif (typeof mix === 'string' || typeof mix === 'number') {\n\t\tstr += mix;\n\t} else if (typeof mix === 'object') {\n\t\tif (Array.isArray(mix)) {\n\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tif (y = toVal(mix[k])) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (k in mix) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\tstr += k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, tmp, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (tmp = arguments[i++]) {\n\t\t\tif (x = toVal(tmp)) {\n\t\t\t\tstr && (str += ' ');\n\t\t\t\tstr += x\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n}\n","import React, { LabelHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\nimport styled from 'styled-components'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\n\nexport interface SelectionStyleProps {\n scale?: 'small' | 'default'\n scheme?: ColorScheme\n disabled?: boolean\n}\n\nexport interface SelectionWrapperProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n SelectionStyleProps {\n selector: ReactNode\n leading?: ReactNode\n trailing?: ReactNode\n}\n\nconst SelectorWrapper = styled.span`\n position: relative;\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Trailing = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Children = styled.span`\n /* placeholder */\n`\n\nconst StyledLabel = styled.label<SelectionStyleProps>`\n box-sizing: border-box;\n\n ${transition()}\n ${font({\n weight: 'checkbox-font-weight',\n })}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n\n cursor: pointer;\n\n border-radius: ${token('border-radius-s')};\n\n font-size: ${conditional({\n 'checkbox-font-size': whenProps({ scale: 'default' }),\n 'checkbox-small-font-size': whenProps({ scale: 'small' }),\n })};\n\n color: ${conditional({\n 'checkbox-color': whenProps({ scheme: 'light' }),\n 'checkbox-dark-color': whenProps({ scheme: 'dark' }),\n })};\n\n ${Children} {\n margin: 0 ${token('space-xs')};\n }\n\n ${SelectorWrapper} {\n margin: 0 ${token('space-xs')} 0 0;\n }\n\n ${Leading} {\n margin: 0 ${token('space-xs')};\n }\n\n ${Trailing} {\n margin: 0 0 0 ${token('space-xs')};\n }\n\n ${disableable()}\n\n ${focusable`\n outline: ${token('checkbox-selector-outline')};\n outline-offset: ${token('checkbox-selector-outline-offset')};\n `}\n`\n\nfunction SelectionWrapper({\n selector,\n children,\n leading,\n trailing,\n className,\n disabled = false,\n ...others\n}: SelectionWrapperProps): JSX.Element {\n return (\n <StyledLabel\n className={clsx(className, {\n 'is-disabled': disabled,\n })}\n {...others}\n >\n {selector && <SelectorWrapper>{selector}</SelectorWrapper>}\n {leading && <Leading data-testid=\"selection-leading\">{leading}</Leading>}\n <Children>{children}</Children>\n {trailing && <Trailing data-testid=\"selection-trailing\">{trailing}</Trailing>}\n </StyledLabel>\n )\n}\n\nexport default SelectionWrapper\n","import React, { Fragment, InputHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nimport { Icon } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport SelectionWrapper, { SelectionStyleProps } from 'common/SelectionWrapper'\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\n\nexport interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement>, SelectionStyleProps {\n leading?: ReactNode\n scheme?: ColorScheme\n trailing?: ReactNode\n}\n\nconst Check = styled(Icon)<SelectionStyleProps>`\n position: absolute;\n top: 50%;\n\n left: 50%;\n\n transform: translate(-50%, -50%);\n\n pointer-events: none;\n`\n\nconst Selector = styled.input<SelectionStyleProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n\n cursor: pointer;\n\n appearance: none;\n\n outline: none;\n\n color: white;\n\n height: ${token('checkbox-selector-size')};\n width: ${token('checkbox-selector-size')};\n\n border-radius: ${token('checkbox-selector-border-radius')};\n border-width: ${token('button-border-width')};\n border-style: solid;\n\n border-color: ${conditional({\n 'checkbox-selector-border-color': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color': whenProps({ scheme: 'dark' }),\n })};\n\n background: ${conditional({\n 'checkbox-selector-background': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background': whenProps({ scheme: 'dark' }),\n })};\n\n :checked {\n background-color: ${token('checkbox-selector-checked-background')};\n border-color: ${token('checkbox-selector-checked-border-color')};\n }\n\n :checked + ${Check} {\n color: ${token('checkbox-selector-icon-color')};\n }\n\n :not(:checked) + ${Check} {\n color: transparent;\n }\n\n ${disableable`\n background: ${conditional({\n 'checkbox-selector-background--disabled': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background--disabled': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'checkbox-selector-border-color--disabled': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color--disabled': whenProps({ scheme: 'dark' }),\n })};\n :checked {\n background-color: ${token('checkbox-selector-checked-background--disabled')};\n border-color: ${token('checkbox-selector-checked-border-color--disabled')};\n }\n `}\n\n ${hoverable`\n background: ${conditional({\n 'checkbox-selector-background--hover': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background--hover': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'checkbox-selector-border-color--hover': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n\n :checked {\n background-color: ${token('checkbox-selector-checked-background--hover')};\n border-color: ${token('checkbox-selector-checked-border-color--hover')};\n }\n\n :checked + ${Check} {\n color: ${token('checkbox-selector-icon-color')};\n }\n `}\n\n ${focusable`\n background: ${conditional({\n 'checkbox-selector-background--focus': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background--focus': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'checkbox-selector-border-color--focus': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n :checked {\n background-color: ${token('checkbox-selector-checked-background--focus')};\n border-color: ${token('checkbox-selector-checked-border-color--focus')};\n }\n :checked + ${Check} {\n color: ${token('checkbox-selector-icon-color')};\n }\n\n box-shadow: ${token('checkbox-selector-box-shadow')};\n `}\n`\n\nfunction Checkbox({\n className,\n disabled,\n children,\n leading,\n trailing,\n scheme = 'light',\n scale = 'default',\n ...others\n}: CheckboxProps): JSX.Element {\n return (\n <SelectionWrapper\n scheme={scheme}\n scale={scale}\n selector={\n <Fragment>\n <Selector\n data-testid=\"selector\"\n {...others}\n scheme={scheme}\n disabled={disabled}\n type=\"checkbox\"\n />\n <Check name=\"check\" size={14} className=\"check\" />\n </Fragment>\n }\n leading={leading}\n trailing={trailing}\n className={clsx({ 'is-disabled': disabled }, className)}\n data-testid=\"checkbox\"\n >\n {children}\n </SelectionWrapper>\n )\n}\n\nexport default Checkbox\n","import React, { Fragment, InputHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nimport { Icon } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport SelectionWrapper, { SelectionStyleProps } from 'common/SelectionWrapper'\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\n\nexport interface RadioProps extends InputHTMLAttributes<HTMLInputElement>, SelectionStyleProps {\n leading?: ReactNode\n scheme?: ColorScheme\n trailing?: ReactNode\n}\n\nconst Check = styled(Icon)<SelectionStyleProps>`\n position: absolute;\n top: 50%;\n\n left: 50%;\n\n width: 10px;\n height: 10px;\n\n transform: translate(-50%, -50%);\n\n pointer-events: none;\n\n fill: currentColor;\n`\n\nconst Selector = styled.input<SelectionStyleProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n\n cursor: pointer;\n\n appearance: none;\n\n outline: none;\n\n color: white;\n\n height: ${token('radio-small-selector-size')};\n width: ${token('radio-small-selector-size')};\n\n border-radius: ${token('radio-selector-border-radius')};\n border-width: ${token('button-border-width')};\n border-style: solid;\n\n background: ${conditional({\n 'radio-selector-background': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background': whenProps({ scheme: 'dark' }),\n })};\n\n &:not(:checked) {\n border-color: ${conditional({\n 'radio-selector-border-color': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color': whenProps({ scheme: 'dark' }),\n })};\n\n + ${Check} {\n color: transparent;\n }\n }\n\n &:checked {\n border-color: ${token('radio-selector-border-color--checked')};\n\n + ${Check} {\n color: ${token('radio-selector-border-color--checked')};\n }\n }\n\n ${disableable`\n background: ${conditional({\n 'radio-selector-background--disabled': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background--disabled': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'radio-selector-border-color--disabled': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color--disabled': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${hoverable`\n background: ${conditional({\n 'radio-selector-background--hover': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background--hover': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'radio-selector-border-color--hover': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'radio-selector-background--focus': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background--focus': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'radio-selector-border-color--focus': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n box-shadow: ${token('radio-selector-box-shadow')};\n `}\n`\n\nfunction Radio({\n className,\n disabled,\n children,\n leading,\n trailing,\n scheme = 'light',\n ...others\n}: RadioProps): JSX.Element {\n return (\n <SelectionWrapper\n scheme={scheme}\n selector={\n <Fragment>\n <Selector\n data-testid=\"selector\"\n {...others}\n scheme={scheme}\n disabled={disabled}\n type=\"radio\"\n />\n <Check name=\"circle\" className=\"check\" />\n </Fragment>\n }\n leading={leading}\n trailing={trailing}\n className={clsx({ 'is-disabled': disabled }, className)}\n data-testid=\"radio\"\n >\n {children}\n </SelectionWrapper>\n )\n}\n\nexport default Radio\n","import { useEffect, useState, useCallback, useRef } from 'react'\n\nimport type { RefObject } from 'react'\n\nexport interface useFocusWithinProps {\n onFocus?: () => void\n onBlur?: () => void\n}\n\n/**\n * As CSS's focus-within is not fully supported, this hook\n * helps with identifying focus within elements.\n * @param {Object} props - Hook props\n */\nfunction useFocusWithin<T>(props: useFocusWithinProps = {}): {\n ref: RefObject<T>\n focused: boolean\n} {\n const { onFocus, onBlur } = props\n const [focused, setFocused] = useState(false)\n const containerRef = useRef<T>(null)\n\n function getContainer() {\n return containerRef.current as unknown as HTMLElement\n }\n\n const handleFocus = useCallback(\n function handleFocus() {\n onFocus?.()\n setFocused(true)\n },\n [onFocus]\n )\n\n const handleBlur = useCallback(\n function handleBlur() {\n onBlur?.()\n setFocused(false)\n },\n [onBlur]\n )\n\n useEffect(\n function updateContainerRef() {\n getContainer()?.addEventListener('focusin', handleFocus)\n getContainer()?.addEventListener('focusout', handleBlur)\n\n return function unsubscribe() {\n getContainer()?.removeEventListener('focusin', handleFocus)\n getContainer()?.removeEventListener('focusout', handleBlur)\n }\n },\n [containerRef, handleBlur, handleFocus]\n )\n\n return {\n ref: containerRef,\n focused,\n }\n}\n\nexport default useFocusWithin\n","enum Status {\n Success = 'success',\n Danger = 'danger',\n Warn = 'warn',\n Neutral = 'neutral',\n}\n\nexport default Status\n","import React, { forwardRef } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport { useFocusWithin } from 'hooks/useFocusWithin'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport Status from 'utils/types/Status'\nimport transition from 'styles/transition'\n\nimport type { InputHTMLAttributes, ReactNode } from 'react'\n\ninterface WithAdditionalProps {\n scale?: 'small' | 'default' | 'large'\n status?: Status\n scheme?: ColorScheme\n leading?: ReactNode\n trailing?: ReactNode\n}\n\nexport interface TextFieldProps extends InputHTMLAttributes<HTMLInputElement>, WithAdditionalProps {\n className?: string\n children?: ReactNode\n}\n\nconst InputWrapper = styled.div<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n\n height: ${conditional({\n 'text-field-height': whenProps({ scale: 'default' }),\n 'text-field-small-height': whenProps({ scale: 'small' }),\n 'text-field-large-height': whenProps({ scale: 'large' }),\n })};\n min-width: 0;\n\n ${font({\n height: 'text-field-font-height',\n })}\n\n font-size: ${conditional({\n 'text-field-font-size': whenProps({ scale: 'default' }),\n 'text-field-small-font-size': whenProps({ scale: 'small' }),\n 'text-field-large-font-size': whenProps({ scale: 'large' }),\n })};\n\n border-radius: ${token('text-field-border-radius')};\n border-width: 1px;\n border-style: solid;\n\n background: ${conditional({\n 'text-field-background': whenProps({ scheme: 'light' }),\n 'text-field-dark-background': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'text-field-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'text-field-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'text-field-danger-border-color': whenProps({ status: Status.Danger }),\n 'text-field-success-border-color': whenProps({ status: Status.Success }),\n })};\n\n color: ${conditional({\n 'text-field-color': whenProps({ scheme: 'light' }),\n 'text-field-dark-color': whenProps({ scheme: 'dark' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'text-field-background--hover': whenProps({ scheme: 'light' }),\n 'text-field-dark-background--hover': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'text-field-border-color--hover': whenProps({ scheme: 'light' }),\n 'text-field-dark-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'text-field-background--focus': whenProps({ scheme: 'light' }),\n 'text-field-dark-background--focus': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'text-field-border-color--focus': whenProps({ scheme: 'light' }),\n 'text-field-dark-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n box-shadow: ${conditional({\n 'text-field-box-shadow': whenProps({ scheme: 'light' }),\n 'text-field-dark-box-shadow': whenProps({ scheme: 'dark' }),\n })};\n\n outline: ${token('text-field-outline')};\n outline-offset: ${token('text-field-outline-offset')};\n `}\n\n ${disableable()}\n`\n\nconst StyledSpan = styled.span<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n color: ${conditional({\n 'text-field-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'text-field-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'text-field-danger-border-color': whenProps({ status: Status.Danger }),\n 'text-field-success-border-color': whenProps({ status: Status.Success }),\n })};\n`\n\nexport const Leading = styled(StyledSpan)<WithAdditionalProps>`\n margin: 0 0 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })};\n`\n\nexport const Trailing = styled(StyledSpan)<WithAdditionalProps>`\n margin: 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })}\n 0 0;\n`\n\nconst StyledInput = styled.input<WithAdditionalProps>`\n ${transition()}\n\n ${font({\n height: 'text-field-font-height',\n })}\n\n background: transparent;\n\n padding: ${conditional({\n 'text-field-padding-y': whenProps({ scale: 'default' }),\n 'text-field-small-padding-y': whenProps({ scale: 'small' }),\n 'text-field-large-padding-y': whenProps({ scale: 'large' }),\n })}\n 0;\n\n margin: 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })};\n\n border: none;\n\n flex: 1;\n\n min-width: 0;\n\n ${focusable()}\n ${disableable()}\n\n /* suppress the clear button for IE */\n &[type=\"search\"]::-ms-clear,\n &[type=\"search\"]::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* suppress the clear button for Chromium-based browsers */\n &[type='search']::-webkit-search-decoration,\n &[type='search']::-webkit-search-cancel-button,\n &[type='search']::-webkit-search-results-button,\n &[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n`\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n props: TextFieldProps,\n ref\n): JSX.Element {\n const {\n disabled = false,\n status = Status.Neutral,\n scheme = 'light',\n scale = 'default',\n className,\n leading,\n trailing,\n ...others\n } = props\n const { ref: containerRef, focused } = useFocusWithin<HTMLDivElement>()\n\n return (\n <InputWrapper\n className={clsx(className, {\n 'is-disabled': disabled,\n 'is-focused': focused,\n })}\n scheme={scheme}\n status={status}\n scale={scale}\n ref={containerRef}\n >\n {leading && (\n <Leading status={status} scheme={scheme} scale={scale}>\n {leading}\n </Leading>\n )}\n <StyledInput\n ref={ref}\n type=\"text\"\n data-testid=\"input\"\n {...others}\n scale={scale}\n status={status}\n scheme={scheme}\n leading={leading}\n trailing={trailing}\n disabled={disabled}\n />\n {trailing && (\n <Trailing status={status} scheme={scheme} scale={scale}>\n {trailing}\n </Trailing>\n )}\n </InputWrapper>\n )\n})\n\nexport default TextField\n","import { useCallback, useState } from 'react'\n\nimport type { ChangeEvent } from 'react'\nimport type { TextFieldProps } from './TextField'\n\ntype InputValue = string | number | readonly string[] | undefined\ntype ReturnType = [InputValue, (e: ChangeEvent<HTMLInputElement>) => void]\n\nfunction useTextField({ onChange: onChangeProp, value: valueProp }: TextFieldProps): ReturnType {\n const [value, setValue] = useState(valueProp || '')\n\n const onChange = useCallback(\n function handleChange(e: ChangeEvent<HTMLInputElement>) {\n const {\n target: { value },\n } = e\n setValue(value)\n onChangeProp?.(e)\n },\n [onChangeProp]\n )\n\n return [value, onChange]\n}\n\nexport default useTextField\n","import React, { forwardRef } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport { useFocusWithin } from 'hooks/useFocusWithin'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport Status from 'utils/types/Status'\nimport transition from 'styles/transition'\n\nimport type { TextareaHTMLAttributes, ReactNode } from 'react'\n\ninterface WithAdditionalProps {\n scale?: 'small' | 'default' | 'large'\n status?: Status\n scheme?: ColorScheme\n leading?: ReactNode\n trailing?: ReactNode\n}\n\nexport interface TextareaProps\n extends TextareaHTMLAttributes<HTMLTextAreaElement>,\n WithAdditionalProps {\n className?: string\n children?: ReactNode\n}\n\nconst TextareaWrapper = styled.div<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n\n min-height: ${token('textarea-min-height')};\n\n ${font({\n height: 'textarea-font-height',\n })}\n\n font-size: ${conditional({\n 'textarea-font-size': whenProps({ scale: 'default' }),\n 'textarea-small-font-size': whenProps({ scale: 'small' }),\n 'textarea-large-font-size': whenProps({ scale: 'large' }),\n })};\n\n border-radius: ${token('textarea-border-radius')};\n border-width: 1px;\n border-style: solid;\n\n background: ${conditional({\n 'textarea-background': whenProps({ scheme: 'light' }),\n 'textarea-dark-background': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'textarea-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'textarea-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'textarea-danger-border-color': whenProps({ status: Status.Danger }),\n 'textarea-success-border-color': whenProps({ status: Status.Success }),\n })};\n\n color: ${conditional({\n 'textarea-color': whenProps({ scheme: 'light' }),\n 'textarea-dark-color': whenProps({ scheme: 'dark' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'textarea-background--hover': whenProps({ scheme: 'light' }),\n 'textarea-dark-background--hover': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'textarea-border-color--hover': whenProps({ scheme: 'light' }),\n 'textarea-dark-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'textarea-background--focus': whenProps({ scheme: 'light' }),\n 'textarea-dark-background--focus': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'textarea-border-color--focus': whenProps({ scheme: 'light' }),\n 'textarea-dark-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n box-shadow: ${conditional({\n 'textarea-box-shadow': whenProps({ scheme: 'light' }),\n 'textarea-dark-box-shadow': whenProps({ scheme: 'dark' }),\n })};\n\n outline: ${token('textarea-outline')};\n outline-offset: ${token('textarea-outline-offset')};\n `}\n\n ${disableable()}\n`\n\nconst StyledSpan = styled.span<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n color: ${conditional({\n 'textarea-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'textarea-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'textarea-danger-border-color': whenProps({ status: Status.Danger }),\n 'textarea-success-border-color': whenProps({ status: Status.Success }),\n })};\n`\n\nconst Leading = styled(StyledSpan)<WithAdditionalProps>`\n align-items: flex-start;\n\n margin: 0 0 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })};\n\n padding: ${token('space-s')} 0;\n`\n\nconst Trailing = styled(StyledSpan)<WithAdditionalProps>`\n align-items: flex-start;\n\n margin: 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })}\n 0 0;\n\n padding: ${token('space-s')} 0;\n`\n\nconst StyledTextarea = styled.textarea<WithAdditionalProps>`\n ${transition()}\n\n ${font({\n height: 'textarea-font-height',\n })}\n\n background: transparent;\n\n padding: ${conditional({\n 'textarea-padding-y': whenProps({ scale: 'default' }),\n 'textarea-small-padding-y': whenProps({ scale: 'small' }),\n 'textarea-large-padding-y': whenProps({ scale: 'large' }),\n })}\n 0;\n\n margin: 0\n ${conditional({\n 'textarea-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'textarea-small-padding-x': whenProps({ scale: 'small' }),\n })};\n\n border: none;\n\n flex: 1 0 auto;\n\n ${focusable()}\n ${disableable()}\n`\n\nconst Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n props: TextareaProps,\n ref\n): JSX.Element {\n const {\n disabled = false,\n status = Status.Neutral,\n scheme = 'light',\n scale = 'default',\n className,\n leading,\n trailing,\n ...others\n } = props\n const { ref: containerRef, focused } = useFocusWithin<HTMLDivElement>()\n\n return (\n <TextareaWrapper\n className={clsx(className, {\n 'is-disabled': disabled,\n 'is-focused': focused,\n })}\n scheme={scheme}\n scale={scale}\n status={status}\n ref={containerRef}\n >\n {leading && (\n <Leading status={status} scheme={scheme} scale={scale}>\n {leading}\n </Leading>\n )}\n <StyledTextarea\n ref={ref}\n data-testid=\"textarea\"\n {...others}\n scale={scale}\n status={status}\n scheme={scheme}\n leading={leading}\n trailing={trailing}\n disabled={disabled}\n />\n {trailing && (\n <Trailing status={status} scheme={scheme} scale={scale}>\n {trailing}\n </Trailing>\n )}\n </TextareaWrapper>\n )\n})\n\nexport default Textarea\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.objectFromQueryString = void 0\nexports.objectFromQueryString = function (qs) {\n if (!qs) return null\n if (qs[0] === '?') {\n qs = qs.slice(1)\n }\n return JSON.parse(\n '{\"' + qs.replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}',\n function (key, value) {\n return key === '' ? value : decodeURIComponent(value)\n }\n )\n}\n//# sourceMappingURL=objectFromQueryString.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.queryStringFromObject = void 0\nexports.queryStringFromObject = function (obj) {\n if (!obj || Object.keys(obj).length === 0) return null\n var qs =\n '?' +\n Object.keys(obj)\n .filter(function (key) {\n return obj[key] !== null && obj[key] !== undefined\n })\n .filter(function (key) {\n return (\n typeof obj[key] === 'string' ||\n typeof obj[key] === 'number' ||\n typeof obj[key] === 'boolean'\n )\n })\n .map(function (key) {\n return key + '=' + obj[key]\n })\n .join('&')\n return qs === '?' ? null : qs\n}\n//# sourceMappingURL=queryStringFromObject.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.toCapitalizeFirstLetter = void 0\nvar toUpperCaseFirstLetter = function (word) {\n return word.charAt(0).toUpperCase() + word.slice(1)\n}\nvar toCapitalizeFirstLetter = function (word) {\n if (!word) return ''\n return word.split(' ').map(toUpperCaseFirstLetter).join(' ')\n}\nexports.toCapitalizeFirstLetter = toCapitalizeFirstLetter\n//# sourceMappingURL=toCapitalizeFirstLetter.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.toLocaleCapitalizeFirstLetter = void 0\nvar toLocaleUpperCaseFirstLetter = function (word, locale) {\n return word.charAt(0).toLocaleUpperCase(locale) + word.slice(1)\n}\nvar toLocaleCapitalizeFirstLetter = function (word, locale) {\n if (!word) return ''\n var localeDefined = locale || navigator.language\n return word\n .split(' ')\n .map(function (item) {\n return toLocaleUpperCaseFirstLetter(item, localeDefined)\n })\n .join(' ')\n}\nexports.toLocaleCapitalizeFirstLetter = toLocaleCapitalizeFirstLetter\n//# sourceMappingURL=toLocaleCapitalizeFirstLetter.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nfunction isBlank(text) {\n if (text == null) {\n return true\n }\n var trimmedText = String(text).trim()\n return trimmedText == ''\n}\nexports.default = isBlank\n//# sourceMappingURL=isBlank.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.toCapitalizeFirstLetter = exports.toLocaleCapitalizeFirstLetter = exports.queryStringFromObject = exports.objectFromQueryString = exports.isBlank = void 0\nvar objectFromQueryString_1 = require('./objectFromQueryString')\nObject.defineProperty(exports, 'objectFromQueryString', {\n enumerable: true,\n get: function () {\n return objectFromQueryString_1.objectFromQueryString\n },\n})\nvar queryStringFromObject_1 = require('./queryStringFromObject')\nObject.defineProperty(exports, 'queryStringFromObject', {\n enumerable: true,\n get: function () {\n return queryStringFromObject_1.queryStringFromObject\n },\n})\nvar toCapitalizeFirstLetter_1 = require('./toCapitalizeFirstLetter')\nObject.defineProperty(exports, 'toCapitalizeFirstLetter', {\n enumerable: true,\n get: function () {\n return toCapitalizeFirstLetter_1.toCapitalizeFirstLetter\n },\n})\nvar toLocaleCapitalizeFirstLetter_1 = require('./toLocaleCapitalizeFirstLetter')\nObject.defineProperty(exports, 'toLocaleCapitalizeFirstLetter', {\n enumerable: true,\n get: function () {\n return toLocaleCapitalizeFirstLetter_1.toLocaleCapitalizeFirstLetter\n },\n})\nvar isBlank_1 = require('./isBlank')\nexports.isBlank = isBlank_1.default\n//# sourceMappingURL=index.js.map\n","import type { AnchorHTMLAttributes } from 'react'\nimport { isBlank } from '@loadsmart/utils-string'\n\nconst INSECURE_HREF = /^javascript:/i\n\nfunction checkHref(props: AnchorHTMLAttributes<HTMLAnchorElement>) {\n const { href, ...others } = props\n\n if (isBlank(href || '')) {\n return props\n }\n\n if (INSECURE_HREF.test(`${href || ''}`)) {\n // security risk, thus, removing it\n return others\n }\n\n return props\n}\n\nfunction checkTarget({ target, rel }: AnchorHTMLAttributes<HTMLAnchorElement>) {\n if (isBlank(target || '')) {\n return { target, rel }\n }\n\n const sanitizedRel = new Set((rel || '').split(/\\s+/).filter(Boolean))\n\n if (target === '_blank') {\n sanitizedRel.add('noopener')\n }\n\n /**\n * To avoid exploitation of the window.opener API, Adding noreferrer,\n * as recommended in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a\n */\n sanitizedRel.add('noreferrer')\n\n return { rel: Array.from(sanitizedRel).join(' '), target }\n}\n\nfunction useSafeLink(\n props: AnchorHTMLAttributes<HTMLAnchorElement>\n): AnchorHTMLAttributes<HTMLAnchorElement> {\n const { rel, target } = checkTarget(props) || {}\n\n return { ...checkHref(props), rel, target }\n}\n\nexport default useSafeLink\n","import React, { forwardRef } from 'react'\nimport type { AnchorHTMLAttributes, ForwardedRef } from 'react'\nimport clsx from 'clsx'\nimport styled, { css } from 'styled-components'\n\nimport useSafeLink from './useSafeLink'\nimport font from 'styles/font'\nimport transition from 'styles/transition'\nimport ellipsizable from 'styles/ellipsizable'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport disableable from 'styles/disableable'\nimport { getToken as token } from 'theming'\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n className?: string\n disabled?: boolean\n}\n\nconst StyledBaseAnchor = styled.a`\n ${font({\n height: 'link-font-height',\n weight: 'link-font-weight',\n })}\n ${transition()}\n\n ${ellipsizable()}\n\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n text-align: center;\n font-size: ${token('link-font-size')};\n color: ${token('color-neutral-darker')};\n text-decoration: none;\n\n min-height: 24px;\n\n border-radius: ${token('border-radius-s')};\n\n ${hoverable`\n text-decoration: underline;\n font-weight: ${token('link-font-weight--hover')};\n `}\n\n ${focusable`\n box-shadow: ${token('link-box-shadow')};\n outline: ${token('link-outline')};\n outline-offset: ${token('link-outline-offset')};\n `}\n\n ${disableable``}\n\n ${({ children }) =>\n 'string' == typeof children &&\n // to prevent layout shift on hover, https://css-tricks.com/bold-on-hover-without-the-layout-shift/\n css`\n &::after {\n height: 0;\n overflow: hidden;\n\n font-weight: ${token('link-font-weight--hover')};\n\n visibility: hidden;\n\n content: attr(data-text);\n content: attr(data-text) / '';\n user-select: none;\n pointer-events: none;\n\n @media speech {\n display: none;\n }\n }\n `}\n`\n\nexport const BaseLink = forwardRef(function BaseLink(\n { disabled = false, ...props }: LinkProps,\n forwardedRef: ForwardedRef<HTMLAnchorElement>\n): JSX.Element {\n const { href = '/', children, className, target = '_self', ...others } = useSafeLink(props)\n\n return (\n <StyledBaseAnchor\n className={clsx(\n {\n 'is-disabled': disabled,\n },\n className\n )}\n href={href}\n target={target}\n {...others}\n ref={forwardedRef}\n data-text={'string' == typeof children ? children : ''}\n data-testid=\"link\"\n >\n {children}\n </StyledBaseAnchor>\n )\n})\n\nconst StyledAnchor = styled(BaseLink)<LinkProps>`\n color: ${token('link-color')};\n`\n\nfunction Link(props: LinkProps): JSX.Element {\n return <StyledAnchor {...props} />\n}\n\nexport default Link\n","import React, { HTMLAttributes } from 'react'\nimport { isNil } from '@loadsmart/utils-object'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\n\nimport { Link } from '../Link'\n\nexport interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {\n active?: boolean\n label: string\n url?: string\n}\n\nconst StyledLink = styled(Link)`\n font-size: ${token('breadcrumbs-font-size')};\n line-height: ${token('breadcrumbs-font-height')};\n`\n\nconst StyledLi = styled.li<BreadcrumbProps>`\n ${font({\n height: 'breadcrumbs-font-height',\n weight: 'breadcrumbs-font-weight',\n })}\n\n position: relative;\n\n display: inline-flex;\n align-items: center;\n\n font-weight: ${conditional({\n 'breadcrumbs-font-weight': whenProps({ active: false }),\n 'breadcrumbs-font-weight--active': whenProps({ active: true }),\n })};\n\n font-size: ${token('breadcrumbs-font-size')};\n line-height: ${token('breadcrumbs-font-height')};\n\n & + & {\n margin: 0 0 0 ${token('breadcrumbs-spacing-x')};\n }\n\n &:not(:only-child):not(:last-child)::after {\n position: absolute;\n left: calc(100% + 14px);\n\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('breadcrumbs-font-size')};\n\n line-height: ${token('breadcrumbs-font-height')};\n\n content: '/';\n }\n`\n\nfunction getWrappedLabel(props: Partial<BreadcrumbProps>) {\n const { url, label, onClick, active, ...rest } = props\n\n if (isNil(url) && !onClick) {\n return label\n }\n\n return (\n <StyledLink\n href={url}\n target=\"_self\"\n onClick={onClick}\n {...(active && { 'aria-current': 'page' })}\n {...rest}\n >\n {label}\n </StyledLink>\n )\n}\n\nfunction Breadcrumb({ active, label, url, ...rest }: BreadcrumbProps): JSX.Element {\n return (\n <StyledLi\n className={clsx({ 'is-active': active })}\n label={label}\n data-testid=\"breadcrumb\"\n active={active}\n >\n {getWrappedLabel({ label, url, active, ...rest })}\n </StyledLi>\n )\n}\n\nexport default Breadcrumb\n","import React, { MouseEvent } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport Breadcrumb, { BreadcrumbProps } from './Breadcrumb'\nimport BackButton from 'common/BackButton'\n\nexport interface BreadcrumbsProps {\n className?: string\n disabled?: boolean\n entries: BreadcrumbProps[]\n onBack?: (e: MouseEvent<HTMLButtonElement>) => void\n}\n\nconst StyledWrapper = styled.nav`\n display: flex;\n flex-direction: row;\n`\n\nconst StyledOl = styled.ol`\n display: flex;\n flex-direction: row;\n margin: 0;\n\n padding: 0;\n\n list-style: none;\n`\n\nconst StyledBackButton = styled(BackButton)`\n margin: 0 ${token('space-m')} 0 0;\n`\n\nfunction Breadcrumbs({ entries = [], onBack, disabled, ...others }: BreadcrumbsProps): JSX.Element {\n return (\n <StyledWrapper aria-label=\"Breadcrumb\" {...others}>\n {onBack && (\n <StyledBackButton\n data-testid=\"breadcrumbs-back\"\n onClick={onBack}\n disabled={disabled}\n aria-label=\"Back to previous page\"\n />\n )}\n\n <StyledOl data-testid=\"breadcrumbs\">\n {entries.map((entry: BreadcrumbProps) => {\n return <Breadcrumb key={entry.label} {...entry} />\n })}\n </StyledOl>\n </StyledWrapper>\n )\n}\nexport default Breadcrumbs\n","import { useRef, useEffect } from 'react'\n\n/**\n * Hook useful to trigger action conditionally based\n * on if the component is mounted.\n * Be aware that your effect, callback, memo, etc cannot list is\n * as a dependency, otherwise it will be triggered at the wrong moment.\n * @returns {boolean} Whether the component is mounted or not.\n */\nfunction useDidMount(): boolean {\n const counter = useRef(0)\n\n useEffect(function onMount() {\n counter.current = 1\n }, [])\n\n return counter.current > 0\n}\n\nexport default useDidMount\n","import get from 'utils/toolset/get'\n\nimport type {\n Selectable,\n SelectableAdapter,\n SelectableKeyType,\n SelectableState,\n SelectableStrategy,\n} from './useSelectable.types'\n\nexport type SelectableStrategyContext<T extends Selectable> = {\n getAdapter: (type?: string) => SelectableAdapter<T>\n}\n\nconst GenericAdapter: SelectableAdapter<unknown> = {\n getKey(o): string {\n return get(o, 'value')!\n },\n}\n\nfunction createSelectionStrategy<T extends Selectable>(props: {\n multiple?: boolean\n adapters: Record<string, SelectableAdapter<T>>\n}): SelectableStrategy<T> {\n const { adapters, multiple } = props\n\n const context: SelectableStrategyContext<T> = {\n getAdapter(type?: string) {\n if (type == null) {\n return GenericAdapter\n }\n\n return adapters[type] || GenericAdapter\n },\n }\n\n if (multiple) {\n return MultipleSelectionStrategy(context)\n }\n\n return SingleSelectionStrategy(context)\n}\n\nexport function SingleSelectionStrategy<T extends Selectable>(\n context: SelectableStrategyContext<T>\n): SelectableStrategy<T> {\n return {\n type() {\n return 'single'\n },\n init(items: T[]) {\n return this.select(items, new Map())\n },\n select(items: T[]) {\n const newSelection = new Map<SelectableKeyType, T>()\n\n for (let i = 0; i < items.slice(0, 1).length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n newSelection.set(adapter.getKey(items[i]), items[i])\n }\n\n return newSelection\n },\n unselect(keys: SelectableKeyType[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < keys.length; i++) {\n newSelection.delete(keys[i])\n }\n\n return newSelection\n },\n toggle(items: T[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>()\n\n for (let i = 0; i < items.slice(0, 1).length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n\n if (!selection.has(adapter.getKey(items[i]))) {\n newSelection.set(adapter.getKey(items[i]), items[i])\n }\n }\n\n return newSelection\n },\n clear() {\n return new Map<SelectableKeyType, T>()\n },\n }\n}\n\nexport function MultipleSelectionStrategy<T extends Selectable>(\n context: SelectableStrategyContext<T>\n): SelectableStrategy<T> {\n return {\n type() {\n return 'multiple'\n },\n init(items: T[]) {\n return this.select(items, new Map<SelectableKeyType, T>())\n },\n select(items: T[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < items.length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n newSelection.set(adapter.getKey(items[i]), items[i])\n }\n\n return newSelection\n },\n unselect(keys: SelectableKeyType[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < keys.length; i++) {\n newSelection.delete(keys[i])\n }\n\n return newSelection\n },\n toggle(items: T[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < items.length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n const key = adapter.getKey(items[i])\n\n if (!selection.has(key)) {\n newSelection.set(key, items[i])\n } else {\n newSelection.delete(key)\n }\n }\n\n return newSelection\n },\n clear() {\n return new Map<SelectableKeyType, T>()\n },\n }\n}\n\nexport default createSelectionStrategy\n","import range from './range'\n\nconst MAX_LENGTH = 15\nconst INITIAL_LENGTH = 2\nconst ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-'\n\n/**\n *\n * @param {Object} options - Options\n * @param\n * @returns\n */\nexport function IDGenerator({\n maxIDLength,\n initialIDLength,\n alphabet,\n}: {\n maxIDLength: number\n initialIDLength: number\n alphabet: string\n}): () => string {\n let currentLength = initialIDLength\n\n // eslint-disable-next-line prefer-const\n let filledCharacters = [\n ...(Array(maxIDLength - currentLength).fill(-1) as number[]),\n ...(Array(currentLength).fill(0) as number[]),\n ]\n\n let availableIDs = range(initialIDLength, maxIDLength + 1).reduce(\n // using arrangement with repetition formula\n (acc: number, n: number) => acc + Math.pow(alphabet.length, n),\n 0\n )\n\n return function getID() {\n if (availableIDs == 0) {\n throw new Error(`No more IDs available with the provided alphabet and max length`)\n }\n\n availableIDs--\n const newID = filledCharacters.slice(-1 * currentLength).map((at: number) => alphabet[at])\n\n /**\n * [0, 0, 0, 0]\n * ^ at\n */\n let at = filledCharacters.length\n\n /**\n * move to the left in the `filledCharacters` array if\n * we have surpassed the last possible character in `alphabet`.\n * That means:\n * [0,0,0,(alphabet.length - 1)]\n * Becomes:\n * [0,0,1,0]\n */\n\n do {\n at--\n filledCharacters[at] = (filledCharacters[at] + 1) % alphabet.length\n } while (filledCharacters[at] == 0 && at >= filledCharacters.length - currentLength)\n\n /**\n * if we moved to the left as much as `currentLength` allowed,\n * and we have incremented as many times as we could, for each\n * position so we're back to `0`, due to the module operation,\n * i.e., if `currentLength = 3`, for example:\n *\n * [0, 0, 0, 0]\n * ^ currentLength\n * ^at\n *\n * So we need to increase `currentLength` to start incrementing from there:\n * [0, 0, 0, 0]\n * ^ currentLength\n */\n if (filledCharacters.length - at > currentLength) {\n currentLength++\n }\n\n return `genid-${newID.join('')}`\n }\n}\n\n// this configuration is capable of generating 469172025408063600 different IDs.\nconst getID = IDGenerator({\n maxIDLength: MAX_LENGTH,\n alphabet: ALPHABET,\n initialIDLength: INITIAL_LENGTH,\n})\n\nexport default getID\n","import { useState, useRef } from 'react'\n\nimport getID from 'utils/toolset/getID'\nimport isEmpty from 'utils/toolset/isEmpty'\n\ntype FingerprintAdapter<T> = (item: T) => string\n\n/**\n * This hook helps with stabilizing changes for components that rely on non-primitive props, more specifically, arrays,\n * objects, maps, sets and so on; when we need to update an internal state based on such types of prop, we might run into an infinite loop.\n * By creating a fingerprint - a string that identifies that set of items - we can garantee that the same set of items will\n * always return the same fingerprint, thus, making check for changes more predictable.\n *\n * @param adapter - adapter function that gets a unique identifier for each item in the `items` prop\n * @param items - list of items whose fingerprint should be checked.\n * @returns\n */\nfunction useFingerprint<T>(\n adapter: FingerprintAdapter<T>,\n items: T[]\n): {\n fingerprint: string\n getFingerprint: (items?: T[] | null, insert?: boolean) => string\n resetFingerprint: (items: T[]) => void\n hasSameFingerprint: (otherItems: T[]) => boolean\n} {\n const knownRef = useRef({} as Record<string, T | string>)\n const [fingerprint, setFingerprint] = useState(() => getFingerprint('', items, true))\n\n /**\n * Get a fingerprint based on the sorted items identifiers.\n *\n * @param {string[]} items - array of items\n * @param {boolean} update - update `known` with the provided `items`, if it contains different set of items.\n * @returns {string}\n */\n function getFingerprint(currentFingerprint: string, items?: T[] | null, update = false) {\n const known = knownRef.current\n\n const safeItems = items || []\n\n let newKnown: Record<string, T | string> = {}\n let hasSameItems = Object.keys(known).length === safeItems.length\n\n for (let i = 0; i < safeItems.length; i++) {\n const item = safeItems[i]\n const key = adapter(item)\n\n hasSameItems = hasSameItems && known[key] != null\n\n newKnown = {\n ...newKnown,\n // we associate a previously created or a new random value to compose the fingerprint\n [key]: known[key] ?? getID(),\n }\n }\n\n if (hasSameItems) {\n return currentFingerprint\n }\n\n if (update) {\n knownRef.current = newKnown\n }\n\n const fingerprint = Object.keys(newKnown)\n .sort()\n .reduce((fingerprint, item) => {\n return `${fingerprint}${newKnown[item] as string}`\n }, '')\n\n return fingerprint\n }\n\n return {\n fingerprint,\n getFingerprint(items?: T[] | null, update = false) {\n return getFingerprint(fingerprint, items, update)\n },\n resetFingerprint(items: T[]) {\n setFingerprint(getFingerprint(fingerprint, items, true))\n },\n /**\n * Check if the provided items have the same fingerprint.\n * @param {string[]} otherItems - items\n * @returns {boolean}\n */\n hasSameFingerprint(otherItems: T[]) {\n return fingerprint === getFingerprint(fingerprint, otherItems)\n },\n }\n}\n\nexport default useFingerprint\n","import { createContext, useEffect, useMemo, useReducer, useRef } from 'react'\nimport { identity } from '@loadsmart/utils-function'\n\nimport { useDidMount } from 'hooks/useDidMount'\nimport createSelectionStrategy from './SelectableStrategy'\nimport toArray from 'utils/toolset/toArray'\nimport useFingerprint from 'hooks/useFingerprint'\n\nimport type { Context } from 'react'\nimport type {\n Selectable,\n SelectableAction,\n SelectableKeyType,\n SelectableState,\n SelectableStrategy,\n useSelectableProps,\n useSelectableReturn,\n} from './useSelectable.types'\n\nconst DEFAULT_ADAPTERS = {}\n\n/**\n * Create a generic manager for collection selection.\n * @returns\n */\nfunction createUseSelectable<T extends Selectable>() {\n return function useSelectable(props: useSelectableProps<T>): useSelectableReturn<T> {\n const { adapters, multiple, onChange } = props\n\n const didMount = useDidMount()\n\n const strategy = useMemo<SelectableStrategy<T>>(() => {\n return createSelectionStrategy<T>({\n adapters: adapters || DEFAULT_ADAPTERS,\n multiple: Boolean(multiple),\n })\n }, [adapters, multiple])\n\n function reducer(state: SelectableState<T>, action: SelectableAction<T>) {\n switch (action.type) {\n case 'select':\n return strategy.select(action.payload, state)\n case 'unselect':\n return strategy.unselect(action.payload, state)\n case 'toggle':\n return strategy.toggle(action.payload, state)\n case 'clear':\n return strategy.clear(state)\n case 'reset':\n return action.payload\n }\n }\n\n function initializer() {\n return strategy.init(toArray(props.selected))\n }\n\n const [selected, dispatch] = useReducer(reducer, new Map<SelectableKeyType, T>(), initializer)\n const { resetFingerprint, hasSameFingerprint } = useFingerprint<string>(\n identity,\n [...selected.keys()].map(String)\n )\n const propagateChangeRef = useRef(false)\n\n function type() {\n return strategy.type()\n }\n\n function select(items: T | T[]) {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'select',\n payload: toArray(items),\n })\n }\n\n function unselect(keys: SelectableKeyType | SelectableKeyType[]) {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'unselect',\n payload: toArray(keys),\n })\n }\n\n function toggle(items: T | T[]) {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'toggle',\n payload: toArray(items),\n })\n }\n\n function clear() {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'clear',\n })\n }\n\n useEffect(\n function handleChange() {\n if (didMount && propagateChangeRef.current) {\n onChange?.(selected)\n }\n\n propagateChangeRef.current = false\n },\n /**\n * We don't want to update when didMount or the onChange callback changes, because we're only interested\n * in changes to the selected state.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selected]\n )\n\n useEffect(\n function updateOnSelectedPropChange() {\n const newSelected = initializer()\n const keys = [...newSelected.keys()].map(String)\n\n if (hasSameFingerprint(keys)) {\n return\n }\n\n propagateChangeRef.current = false\n\n resetFingerprint(keys)\n dispatch({\n type: 'reset',\n payload: newSelected,\n })\n },\n /**\n * initializer is not relevant for our changes, that's why its ommitted.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.selected, hasSameFingerprint, resetFingerprint]\n )\n\n return { type, selected, select, unselect, toggle, clear }\n }\n}\n\nexport function createSelectable<T extends Selectable>(): {\n SelectableContext: Context<useSelectableReturn<T>>\n useSelectable: (props: useSelectableProps<T>) => useSelectableReturn<T>\n} {\n const SelectableContext = createContext<useSelectableReturn<T>>({} as useSelectableReturn<T>)\n const useSelectable = createUseSelectable<T>()\n\n return { SelectableContext, useSelectable }\n}\n","import React from 'react'\nimport { createSelectable } from 'hooks/useSelectable'\n\nimport type { ToggleGroupProps, ToggleOption } from './ToggleGroup.types'\n\nconst ToggleGroupContext = React.createContext<Pick<ToggleGroupProps, 'scale' | 'disabled'>>({\n scale: 'default',\n disabled: false,\n})\n\nexport const { SelectableContext, useSelectable } = createSelectable<ToggleOption>()\n\nexport default ToggleGroupContext\n","import React, { useContext } from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport ToggleGroupContext, { SelectableContext } from './ToggleGroupContext'\n\nimport type { ToggleGroupOptionProps, ToggleGroupType } from './ToggleGroup.types'\n\nconst ToggleButton = styled(BaseButton)<{ $type: ToggleGroupType }>`\n text-transform: ${token('toggle-text-transform')};\n\n background-color: ${conditional({\n 'toggle-background-color': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color': whenProps({ 'aria-checked': true }),\n })};\n\n border-color: ${conditional({\n 'toggle-single-border-color': whenProps({ $type: 'single', 'aria-checked': false }),\n 'toggle-single-checked-border-color': whenProps({ $type: 'single', 'aria-checked': true }),\n 'toggle-multiple-border-color': whenProps({ $type: 'multiple', 'aria-checked': false }),\n 'toggle-multiple-checked-border-color': whenProps({ $type: 'multiple', 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color': whenProps({ 'aria-checked': true }),\n })};\n\n padding: ${token('space-xs')} ${token('space-s')};\n\n ${hoverable`\n border-color: ${conditional({\n 'toggle-multiple-border-color--hover': whenProps({ $type: 'multiple' }),\n 'toggle-single-border-color--hover': whenProps({ $type: 'single' }),\n })};\n\n background-color: ${conditional({\n 'toggle-background-color--hover': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--hover': whenProps({ 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color--hover': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--hover': whenProps({ 'aria-checked': true }),\n })};\n `}\n\n ${focusable`\n border-color: ${conditional({\n 'toggle-multiple-border-color--focus': whenProps({ $type: 'multiple' }),\n 'toggle-single-border-color--focus': whenProps({ $type: 'single' }),\n })};\n\n background-color: ${conditional({\n 'toggle-background-color--focus': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--focus': whenProps({ 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color--focus': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--focus': whenProps({ 'aria-checked': true }),\n })};\n\n box-shadow: ${token('toggle-box-shadow')};\n outline: ${token('toggle-outline')};\n outline-offset: ${token('toggle-outline-offset')};\n `}\n\n ${activatable`\n border-color: ${conditional({\n 'toggle-multiple-border-color--active': whenProps({ $type: 'multiple' }),\n 'toggle-single-border-color--active': whenProps({ $type: 'single' }),\n })};\n\n background-color: ${conditional({\n 'toggle-background-color--active': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--active': whenProps({ 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color--active': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--active': whenProps({ 'aria-checked': true }),\n })};\n `}\n\n ${disableable`\n background-color: ${conditional({\n 'toggle-background-color--disabled': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--disabled': whenProps({ 'aria-checked': true }),\n })};\n\n border-color: ${conditional({\n 'toggle-single-border-color--disabled': whenProps({ $type: 'single', 'aria-checked': false }),\n 'toggle-single-checked-border-color--disabled': whenProps({\n $type: 'single',\n 'aria-checked': true,\n }),\n 'toggle-multiple-border-color--disabled': whenProps({\n $type: 'multiple',\n 'aria-checked': false,\n }),\n 'toggle-multiple-checked-border-color--disabled': whenProps({\n $type: 'multiple',\n 'aria-checked': true,\n }),\n })};\n\n color: ${conditional({\n 'toggle-color--disabled': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--disabled': whenProps({ 'aria-checked': true }),\n })};\n `}\n`\n\nfunction isMultiple(type: ToggleGroupType) {\n return type === 'multiple'\n}\n\nfunction Toggle({ value, children, disabled, ...others }: ToggleGroupOptionProps): JSX.Element {\n const group = useContext(ToggleGroupContext)\n const selectable = useContext(SelectableContext)\n\n if (isEmpty(selectable)) {\n throw Error('A Toggle options must be rendered inside a ToggleGroup')\n }\n\n const selected = selectable.selected.has(value)\n\n return (\n <ToggleButton\n {...others}\n $type={selectable.type()}\n type=\"button\"\n role={isMultiple(selectable.type()) ? 'checkbox' : 'radio'}\n aria-checked={selected}\n disabled={Boolean(disabled || group.disabled)}\n onClick={() => {\n if (isMultiple(selectable.type())) {\n selectable.toggle({ value })\n } else {\n selectable.select({ value })\n }\n }}\n scale={group.scale}\n >\n {children}\n </ToggleButton>\n )\n}\n\nexport default styled(Toggle)({})\n","import React, { useCallback } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport conditional, { whenProps } from 'tools/conditional'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport toArray from 'utils/toolset/toArray'\nimport Toggle from './Toggle'\nimport ToggleGroupContext, { SelectableContext, useSelectable } from './ToggleGroupContext'\n\nimport type {\n ToggleGroupOptionProps,\n ToggleGroupProps,\n ToggleOption,\n ToggleGroupOptionValue,\n SelectedToggleGroupOptions,\n} from './ToggleGroup.types'\n\nconst Container = styled(Group)<{ $multiple: boolean; $scale: ToggleGroupProps['scale'] }>`\n padding: ${conditional({\n 'toggle-group-multiple-padding': whenProps({ $multiple: true }),\n 'toggle-group-single-padding': whenProps({ $multiple: false }),\n })};\n\n border-color: ${conditional({\n 'toggle-group-multiple-border-color': whenProps({ $multiple: true }),\n 'toggle-group-single-border-color': whenProps({ $multiple: false }),\n })};\n\n border-style: ${conditional({\n 'toggle-group-multiple-border-style': whenProps({ $multiple: true }),\n 'toggle-group-single-border-style': whenProps({ $multiple: false }),\n })};\n\n border-width: ${conditional({\n 'toggle-group-multiple-border-width': whenProps({ $multiple: true }),\n 'toggle-group-single-border-width': whenProps({ $multiple: false }),\n })};\n\n border-radius: ${conditional({\n 'toggle-group-multiple-border-radius': whenProps({ $multiple: true }),\n 'toggle-group-single-border-radius': whenProps({ $multiple: false }),\n })};\n\n &.are-disabled {\n border-color: ${token('toggle-group-border-color--disabled')};\n }\n\n ${Toggle} {\n height: ${conditional({\n 'toggle-single-height': whenProps({ $multiple: false, $scale: 'default' }),\n 'toggle-single-small-height': whenProps({ $multiple: false, $scale: 'small' }),\n 'toggle-multiple-height': whenProps({ $multiple: true, $scale: 'default' }),\n 'toggle-multiple-small-height': whenProps({ $multiple: true, $scale: 'small' }),\n })};\n\n font-size: ${conditional({\n 'toggle-single-font-size': whenProps({ $multiple: false, $scale: 'default' }),\n 'toggle-single-small-font-size': whenProps({ $multiple: false, $scale: 'small' }),\n 'toggle-multiple-font-size': whenProps({ $multiple: true, $scale: 'default' }),\n 'toggle-multiple-small-font-size': whenProps({ $multiple: true, $scale: 'small' }),\n })};\n }\n`\n\nfunction fromValueToSelected(\n value: ToggleGroupOptionValue | ToggleGroupOptionValue[]\n): ToggleOption[] {\n const valueAsArray = toArray(value)\n\n return valueAsArray.map((value) => ({ value }))\n}\n\nfunction fromSelectedToValue(\n selected: SelectedToggleGroupOptions,\n multiple: boolean\n): ToggleGroupOptionValue | ToggleGroupOptionValue[] | null {\n const pairs = Array.from(selected)\n\n if (multiple) {\n const value: ToggleGroupOptionValue[] = []\n for (const [, option] of pairs) {\n value.push(option.value)\n }\n\n return value\n } else {\n if (isEmpty(pairs)) {\n return null\n }\n const [[, option]] = pairs\n return option.value\n }\n}\n\nconst DEFAULT_SELECTED = [] as ToggleGroupOptionValue[]\n\nfunction ToggleGroup(props: ToggleGroupProps): JSX.Element {\n const {\n disabled = false,\n multiple = false,\n scale = 'default',\n id,\n name,\n onChange,\n options,\n children,\n className,\n ...others\n } = props\n const selectable = useSelectable({\n multiple,\n selected: fromValueToSelected(props.value ?? DEFAULT_SELECTED),\n onChange: useCallback(\n function handleSelectionChange(selected) {\n onChange?.({\n target: { id, name: name ?? '', value: fromSelectedToValue(selected, multiple) },\n })\n },\n [id, multiple, name, onChange]\n ),\n })\n\n return (\n <Container\n {...others}\n className={clsx(className, {\n 'are-disabled': disabled,\n })}\n id={id}\n role={multiple ? 'group' : 'radiogroup'}\n align=\"center\"\n space=\"xs\"\n $multiple={multiple}\n $scale={scale}\n >\n <ToggleGroupContext.Provider value={{ scale, disabled }}>\n <SelectableContext.Provider value={selectable}>\n {children ??\n (options || []).map(function renderOption(option: ToggleGroupOptionProps) {\n const { label, value, ...others } = option\n const key = String(value)\n\n return (\n <Toggle\n key={key}\n {...others}\n disabled={Boolean(disabled || option.disabled)}\n value={value}\n >\n {label}\n </Toggle>\n )\n })}\n </SelectableContext.Provider>\n </ToggleGroupContext.Provider>\n </Container>\n )\n}\n\nToggleGroup.Option = Toggle\n\nexport default ToggleGroup\n","import { createContext } from 'react'\n\ninterface TabContextValue {\n id: string\n activeTab: string\n setActiveTab: (name: string) => void\n direction?: 'horizontal' | 'vertical'\n}\n\nexport const TabContext = createContext<TabContextValue>({} as TabContextValue)\n","import React from 'react'\n\nimport getID from 'utils/toolset/getID'\n\nfunction useID(propId?: string): string {\n const [id, setID] = React.useState(() => propId || getID())\n\n React.useEffect(\n function updateID() {\n setID(propId || getID())\n },\n [propId]\n )\n\n return id\n}\n\nexport default useID\n","import React, {\n HTMLAttributes,\n useContext,\n useState,\n useEffect,\n ChangeEvent,\n ReactNode,\n} from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { TabContext } from './TabsContext'\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport disableable from 'styles/disableable'\nimport transition from 'styles/transition'\nimport useID from 'hooks/useID'\n\nimport type { WithDirectionProps, WithActiveProps } from './Tabs.types'\nimport clsx from 'clsx'\n\nconst TabsItemsWrapper = styled.ul`\n display: flex;\n\n padding: 0;\n\n border-bottom-color: ${token('color-neutral-lighter')};\n border-bottom-width: 2px;\n border-bottom-style: solid;\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Children = styled(StyledSpan)`\n flex: 1;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst StyledListItem = styled.li`\n display: flex;\n`\n\nconst StyledLabel = styled.label<WithActiveProps & WithDirectionProps>`\n ${font({\n height: 'font-height-2',\n weight: 'font-weight-bold',\n })}\n ${transition()}\n\n font-size: ${token('font-size-4')};\n text-transform: uppercase;\n text-align: ${conditional({\n center: whenProps({ direction: 'vertical' }),\n justify: whenProps({ direction: 'horizontal' }),\n })};\n\n ${hoverable`\n color: ${token('color-neutral-darker')};\n background-color: ${token('color-neutral-light')}33;\n `}\n\n ${disableable`\n color: ${token('color-neutral-dark')}33;\n background-color: ${token('color-neutral-light')};\n `}\n\n padding: ${token('space-m')} ${token('space-l')};\n display: inline-flex;\n flex-direction: ${conditional({\n row: whenProps({ direction: 'horizontal' }),\n column: whenProps({ direction: 'vertical' }),\n })};\n\n cursor: pointer;\n\n position: relative;\n bottom: -2px;\n\n border-bottom-width: 2px;\n border-bottom-style: solid;\n\n border-color: ${conditional({\n 'color-transparent': whenProps({ active: false }),\n 'color-primary': whenProps({ active: true }),\n })};\n\n color: ${conditional({\n 'color-neutral': whenProps({ active: false }),\n 'neutral-darker': whenProps({ active: true }),\n })};\n\n ${Leading} + ${Children} {\n margin: ${conditional({\n '0': whenProps({ direction: 'horizontal' }),\n 'space-2xs': whenProps({ direction: 'vertical' }),\n })}\n 0 0\n ${conditional({\n 'space-s': whenProps({ direction: 'horizontal' }),\n '0': whenProps({ direction: 'vertical' }),\n })};\n }\n`\n\ntype TabsItemsProps = HTMLAttributes<HTMLUListElement>\n\nfunction TabsItems({ children, ...props }: TabsItemsProps) {\n return (\n <TabsItemsWrapper {...props} role=\"tablist\">\n {children}\n </TabsItemsWrapper>\n )\n}\n\ninterface TabsItemProps extends HTMLAttributes<HTMLInputElement> {\n name: string\n default?: boolean\n leading?: ReactNode\n disabled?: boolean\n}\n\nfunction TabsItem({\n children,\n name,\n default: isDefault,\n className,\n onChange,\n leading,\n disabled = false,\n ...props\n}: TabsItemProps) {\n const { id: tabId, setActiveTab, activeTab, direction } = useContext(TabContext)\n\n const isActive = activeTab === name\n\n function handleSelect(event: ChangeEvent<HTMLInputElement>) {\n setActiveTab(name)\n onChange?.(event)\n }\n\n useEffect(() => {\n if (!activeTab && isDefault) {\n setActiveTab(name)\n }\n }, [activeTab, name, setActiveTab, isDefault])\n\n return (\n <StyledListItem role=\"tab\" aria-selected={isActive ? 'true' : 'false'}>\n <StyledLabel\n className={clsx(\n {\n 'is-disabled': disabled,\n },\n className\n )}\n active={activeTab === name}\n direction={direction}\n >\n <input\n {...props}\n value={name}\n checked={isActive}\n disabled={disabled}\n type=\"radio\"\n name={tabId}\n onChange={handleSelect}\n hidden\n />\n {leading && <Leading>{leading}</Leading>}\n {children && <Children>{children}</Children>}\n </StyledLabel>\n </StyledListItem>\n )\n}\n\ntype PanelsItemsProps = HTMLAttributes<HTMLDivElement>\n\nconst PanelsItemsWrapper = styled.div`\n /* placeholder */\n`\n\nconst PanelsItemWrapper = styled.article`\n display: ${conditional({\n block: whenProps({ 'aria-hidden': false }),\n none: whenProps({ 'aria-hidden': true }),\n })};\n`\n\nfunction PanelsItems({ children, ...props }: PanelsItemsProps) {\n return <PanelsItemsWrapper {...props}>{children}</PanelsItemsWrapper>\n}\n\ninterface PanelsItemProps extends HTMLAttributes<HTMLElement> {\n name: string\n /**\n * Renders the Panel.Item only when is visible\n * @default false\n */\n lazy?: boolean\n}\n\nfunction PanelsItem({ children, name, lazy = false, ...props }: PanelsItemProps) {\n const { activeTab } = useContext(TabContext)\n\n const hidden = activeTab !== name\n\n return (\n <PanelsItemWrapper {...props} role=\"tabpanel\" aria-hidden={hidden}>\n {lazy && hidden ? null : children}\n </PanelsItemWrapper>\n )\n}\n\nexport interface TabsProps extends HTMLAttributes<HTMLElement>, WithDirectionProps {\n activeTab?: string\n onTabChange?: (tab: string) => void\n}\n\nconst TabsWrapper = styled.div`\n ${TabsItemsWrapper} + ${PanelsItemsWrapper} {\n margin: ${token('space-xl')} 0 0 0;\n }\n`\n\n/**\n * @example\n * <Tabs>\n <Tabs.Items>\n <Tabs.Item name=\"tab-1\" default>\n Tabs 1\n </Tabs.Item>\n <Tabs.Item name=\"tab-2\">Tabs 2</Tabs.Item>\n </Tabs.Items>\n <Tabs.Panels>\n <Tabs.Panel name=\"tab-1\">first content</Tabs.Panel>\n <Tabs.Panel name=\"tab-2\">second content</Tabs.Panel>\n </Tabs.Panels>\n * </Tabs>\n */\nfunction Tabs({\n children,\n direction = 'horizontal',\n id: propId,\n activeTab: propTab = '',\n onTabChange,\n ...props\n}: TabsProps): JSX.Element {\n const [activeTab, setActiveTab] = useState(propTab)\n const id = useID(propId)\n\n useEffect(() => {\n if (propTab) {\n setActiveTab(propTab)\n }\n }, [propTab])\n\n useEffect(() => {\n onTabChange?.(activeTab)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTab])\n\n return (\n <TabsWrapper {...props}>\n <TabContext.Provider value={{ activeTab, setActiveTab, id, direction }}>\n {children}\n </TabContext.Provider>\n </TabsWrapper>\n )\n}\n\nTabs.Items = TabsItems\nTabs.Item = TabsItem\nTabs.Panels = PanelsItems\nTabs.Panel = PanelsItem\n\nexport default Tabs\n","import React, { HTMLAttributes, ReactNode } from 'react'\nimport styled from 'styled-components'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\n\nexport type SectionProps = HTMLAttributes<HTMLElement>\n\nconst StyledSection = styled.section`\n ${font({\n height: 'font-height-2',\n })}\n`\n\nconst StyledSectionTitle = styled.section`\n ${font({\n weight: 'font-weight-bold',\n height: 'font-height-2',\n })}\n\n font-size: ${token('font-size-3')};\n color: ${token('color-neutral-darker')};\n\n border-bottom: 2px solid ${token('color-neutral-light')};\n\n padding: ${token('space-s')} ${token('space-xs')};\n margin-bottom: ${token('space-l')};\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Leading = styled(StyledSpan)`\n margin: 0 ${token('button-spacing-x')} 0 0;\n`\n\nexport interface SectionTitleProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode\n leading?: ReactNode\n}\n\nfunction SectionTitle({ children, leading, ...others }: SectionTitleProps) {\n return (\n <StyledSectionTitle data-testid=\"section-title\" {...others}>\n {leading && <Leading>{leading}</Leading>}\n {children}\n </StyledSectionTitle>\n )\n}\n\nfunction Section({ children, ...others }: SectionProps): JSX.Element {\n return (\n <StyledSection data-testid=\"section\" {...others}>\n {children}\n </StyledSection>\n )\n}\n\nSection.Title = SectionTitle\n\nexport default Section\n","/**\n * Add basic CSS style for hide elements\n * @param {boolean} accessible - should keep element visible for screen readers\n * @returns {string}\n */\nfunction hiddenStyle(accessible = false): string {\n if (accessible) {\n return `\n border: 0 !important;\n clip: rect(0 0 0 0) !important;\n clip-path: inset(50%) !important;\n height: 1px !important;\n margin: -1px !important;\n overflow: hidden !important;\n padding: 0 !important;\n position: absolute !important;\n white-space: nowrap !important;\n width: 1px !important;\n pointer-events: none;\n `\n }\n\n return `\n display: none !important;\n opacity: 0 !important;\n `\n}\n\nexport default hiddenStyle\n","import React, { createContext, ReactNode, useState } from 'react'\n\ntype AccordionContextType = [boolean, () => void]\nconst AccordionContext = createContext<AccordionContextType | undefined>(undefined)\n\nfunction AccordionProvider({\n expanded,\n children,\n onExpandedChange,\n initialExpanded = false,\n}: {\n children: ReactNode\n initialExpanded?: boolean\n expanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n}): JSX.Element {\n const [openState, setOpenState] = useState(initialExpanded)\n const open = expanded ?? openState\n\n function toggle() {\n onExpandedChange?.(!open)\n setOpenState(!open)\n }\n\n return <AccordionContext.Provider value={[open, toggle]}>{children}</AccordionContext.Provider>\n}\n\nfunction useAccordionContext(): AccordionContextType {\n const context = React.useContext(AccordionContext)\n if (!context) {\n throw new Error('useAccordionContext must be used within an AccordionProvider')\n }\n return context\n}\n\nexport { AccordionProvider, useAccordionContext }\n","import React, { Fragment } from 'react'\nimport type { PropsWithChildren, HTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\nimport styled from 'styled-components'\nimport { identity, isFunction } from '@loadsmart/utils-function'\n\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport transition from 'styles/transition'\nimport ellipsizable from 'styles/ellipsizable'\nimport hidden from 'styles/hidden'\n\nimport { AccordionProvider, useAccordionContext } from './Accordion.context'\n\nconst StyledWrapper = styled.article<{ open: boolean }>`\n background: ${token('color-neutral-white')};\n border: 1px solid\n ${conditional({\n 'color-neutral-light': whenProps({ open: false }),\n 'color-accent': whenProps({ open: true }),\n })};\n border-radius: ${token('border-radius-s')};\n\n ${hoverable`\n border-color: ${token('color-accent')};\n `}\n`\n\nconst StyledToggle = styled.button<{ open: boolean }>`\n ${font({\n height: 'font-height-2',\n })}\n\n ${transition()}\n\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n\n font-size: ${token('font-size-3')};\n font-weight: ${conditional({\n 'font-weight-regular': whenProps({ open: false }),\n 'font-weight-bold': whenProps({ open: true }),\n })};\n text-align: left;\n\n cursor: pointer;\n\n color: ${token('color-neutral-darker')};\n\n background-color: ${token('color-transparent')};\n border-radius: ${token('border-radius-s')};\n border: none;\n box-sizing: border-box;\n\n padding: ${token('space-s')} ${token('space-m')};\n\n width: 100%;\n\n ${hoverable`\n background: ${token('color-neutral-lighter')};\n `}\n\n ${focusable`\n box-shadow: ${token('shadow-glow-primary')};\n `}\n`\n\nconst StyledContent = styled.section<{ open: boolean }>`\n ${font({\n height: 'font-height-2',\n weight: 'font-weight-medium',\n })}\n\n padding-left: ${conditional({\n '0': whenProps({ open: false }),\n 'space-m': whenProps({ open: true }),\n })};\n padding-right: ${conditional({\n '0': whenProps({ open: false }),\n 'space-m': whenProps({ open: true }),\n })};\n padding-top: ${conditional({\n '0': whenProps({ open: false }),\n 'space-xl': whenProps({ open: true }),\n })};\n padding-bottom: ${conditional({\n '0': whenProps({ open: false }),\n 'space-s': whenProps({ open: true }),\n })};\n\n overflow-x: hidden;\n overflow-y: auto;\n`\n\nconst HiddenInput = styled.input`\n ${hidden()}\n\n &:not(:checked) + ${StyledContent} {\n height: 0;\n }\n\n &:checked + ${StyledContent} {\n height: 100%;\n }\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Leading = styled(StyledSpan)`\n margin: 0 ${token('space-xs')} 0 0;\n`\n\nconst Trailing = styled(StyledSpan)`\n margin: 0 0 0 auto;\n`\n\nconst Children = styled.span`\n pointer-events: none;\n\n ${ellipsizable()}\n`\n\nfunction ToggleIndicator({ open }: { open: boolean }) {\n return <Icon name={open ? 'minus' : 'plus'} size={16} />\n}\n\nfunction AccordionWrapper({\n children,\n ...others\n}: PropsWithChildren<HTMLAttributes<HTMLElement>>): JSX.Element {\n const [open] = useAccordionContext()\n return (\n <StyledWrapper data-testid=\"accordion\" open={open} {...others}>\n {children}\n </StyledWrapper>\n )\n}\n\nexport type AccordionToggleProps = {\n leading?: ReactNode | ((expanded: boolean) => ReactNode)\n trailing?: ReactNode | ((expanded: boolean) => ReactNode)\n}\n\nfunction AccordionToggle({\n leading,\n trailing: propsTrailing,\n children,\n}: PropsWithChildren<AccordionToggleProps>): JSX.Element {\n const [open, toggle] = useAccordionContext()\n\n const trailing = propsTrailing === undefined ? <ToggleIndicator open={open} /> : propsTrailing\n\n return (\n <StyledToggle open={open} onClick={toggle} type=\"button\" data-testid=\"accordion-toggle\">\n {leading && (\n <Leading data-testid=\"accordion-toggle-leading\">\n {isFunction(leading) ? leading(open) : leading}\n </Leading>\n )}\n <Children>{children}</Children>\n {trailing && (\n <Trailing data-testid=\"accordion-toggle-trailing\">\n {isFunction(trailing) ? trailing(open) : trailing}\n </Trailing>\n )}\n </StyledToggle>\n )\n}\n\nexport type AccordionBodyProps = HTMLAttributes<HTMLElement>\n\nfunction AccordionBody({ children, ...props }: PropsWithChildren<AccordionBodyProps>): JSX.Element {\n const [open] = useAccordionContext()\n\n return (\n <Fragment>\n <HiddenInput type=\"checkbox\" checked={open} onChange={identity} />\n <StyledContent\n open={open}\n className={clsx({\n 'is-open': open,\n })}\n aria-hidden={!open ? 'true' : 'false'}\n data-testid=\"accordion-content\"\n {...props}\n >\n {children}\n </StyledContent>\n </Fragment>\n )\n}\n\nexport interface AccordionProps extends HTMLAttributes<HTMLElement> {\n expanded?: boolean\n initialExpanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n}\n\nfunction Accordion({\n children,\n expanded,\n initialExpanded,\n onExpandedChange,\n ...others\n}: AccordionProps): JSX.Element {\n return (\n <AccordionProvider\n expanded={expanded}\n initialExpanded={initialExpanded}\n onExpandedChange={onExpandedChange}\n >\n <AccordionWrapper {...others}>{children}</AccordionWrapper>\n </AccordionProvider>\n )\n}\n\nAccordion.Toggle = AccordionToggle\nAccordion.Body = AccordionBody\n\nexport default Accordion\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React, { ReactElement, useState } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport { Icon as DefaultIcon } from 'components/Icon'\n\nimport { BaseButton } from 'components/Button'\nimport DefaultCloseButton from 'common/CloseButton'\n\nexport interface BannerProps {\n className?: string\n variant?: 'success' | 'danger' | 'warning' | 'neutral'\n icon?: JSX.Element\n scale?: 'default' | 'large'\n title?: string | ReactElement\n description?: string | ReactElement\n onClose?: () => void\n dismissible?: boolean\n}\n\nexport interface BannerActionProps extends BannerProps {\n action?: string\n secondaryAction?: string\n onActionButtonClick?: () => void\n onSecondaryActionButtonClick?: () => void\n}\n\ninterface VariantProps {\n variant?: 'success' | 'danger' | 'warning' | 'neutral'\n}\n\nconst Description = styled.div`\n color: ${token('banner-description-color')};\n font-size: ${token('banner-font-size')};\n line-height: ${token('banner-font-height')};\n text-align: left;\n`\n\nconst Title = styled.div<VariantProps>`\n font-weight: ${token('banner-title-font-weight')};\n font-size: ${token('banner-font-size')};\n line-height: ${token('banner-font-height')};\n text-align: left;\n`\n\nconst TextSection = styled.div<{ $dismissible?: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-items: center;\n padding-right: ${conditional({\n 'space-xl': whenProps({ $dismissible: true }),\n })};\n`\n\nconst StyledBanner = styled.div<Omit<BannerProps, 'dismissible'>>`\n position: relative;\n\n display: flex;\n flex-wrap: ${conditional({\n wrap: whenProps({ scale: 'default' }),\n 'no-wrap': whenProps({ scale: 'large' }),\n })};\n align-items: center;\n min-width: ${token('banner-min-width')};\n\n min-height: ${conditional({\n 'banner-default-height': whenProps({ scale: 'default' }),\n })};\n padding: ${conditional({\n 'banner-default-padding-y': whenProps({ scale: 'default' }),\n 'banner-large-padding': whenProps({ scale: 'large' }),\n })}\n ${conditional({\n 'banner-default-padding-x': whenProps({ scale: 'default' }),\n 'banner-large-padding': whenProps({ scale: 'large' }),\n })};\n\n color: ${conditional({\n 'banner-title-color-success': whenProps({ variant: 'success' }),\n 'banner-title-color-danger': whenProps({ variant: 'danger' }),\n 'banner-title-color-warning': whenProps({ variant: 'warning' }),\n 'banner-title-color-neutral': whenProps({ variant: 'neutral' }),\n })};\n\n background: ${conditional({\n 'banner-background-success': whenProps({ variant: 'success' }),\n 'banner-background-warning': whenProps({ variant: 'warning' }),\n 'banner-background-danger': whenProps({ variant: 'danger' }),\n 'banner-background-neutral': whenProps({ variant: 'neutral' }),\n })};\n\n border-color: ${conditional({\n 'banner-border-color-success': whenProps({ variant: 'success' }),\n 'banner-border-color-warning': whenProps({ variant: 'warning' }),\n 'banner-border-color-danger': whenProps({ variant: 'danger' }),\n 'banner-border-color-neutral': whenProps({ variant: 'neutral' }),\n })};\n border-style: solid;\n border-width: ${token('banner-border-width')};\n\n border-radius: ${token('banner-border-radius')};\n`\n\nexport const CloseButton = styled(DefaultCloseButton)`\n position: absolute;\n top: ${conditional({\n 'banner-default-close-top': whenProps({ scale: 'default' }),\n 'banner-large-close-top': whenProps({ scale: 'large' }),\n })};\n right: ${conditional({\n 'banner-default-close-right': whenProps({ scale: 'default' }),\n 'banner-large-close-right': whenProps({ scale: 'large' }),\n })};\n\n width: ${token('banner-icon-width')};\n height: ${token('banner-icon-height')};\n`\n\nconst IconWrapper = styled.span<{ scale: string }>`\n display: inline-flex;\n align-items: center;\n\n align-self: ${conditional({\n 'banner-default-icon-alignment': whenProps({ scale: 'default' }),\n 'banner-large-icon-alignment': whenProps({ scale: 'large' }),\n })};\n justify-content: center;\n\n margin-right: ${token('banner-icon-margin-right')};\n`\n\nexport const Icon = styled(DefaultIcon)`\n width: ${token('banner-icon-width')};\n height: ${token('banner-icon-height')};\n`\n\nconst Button = styled(BaseButton)`\n min-width: 88px;\n margin-top: ${token('space-s')};\n margin-left: ${conditional({\n '0': whenProps({ variant: 'primary' }),\n 'banner-secondary-button-margin-left': whenProps({ variant: 'secondary' }),\n })};\n\n color: ${conditional({\n 'banner-button-text-color': whenProps({ variant: 'primary' }),\n 'banner-button-background-danger': whenProps({ variant: 'secondary', className: 'danger' }),\n 'banner-button-background-warning': whenProps({ variant: 'secondary', className: 'warning' }),\n 'banner-button-background-neutral': whenProps({ variant: 'secondary', className: 'neutral' }),\n 'banner-button-background-success': whenProps({ variant: 'secondary', className: 'success' }),\n })};\n\n background-color: ${conditional({\n 'banner-button-background-success': whenProps({ variant: 'primary', className: 'success' }),\n 'banner-button-background-danger': whenProps({ variant: 'primary', className: 'danger' }),\n 'banner-button-background-warning': whenProps({ variant: 'primary', className: 'warning' }),\n 'banner-button-background-neutral': whenProps({ variant: 'primary', className: 'neutral' }),\n 'banner-button-background-secondary': whenProps({ variant: 'secondary' }),\n })};\n\n border-color: ${conditional({\n 'banner-button-background-success': whenProps({ className: 'success' }),\n 'banner-button-background-danger': whenProps({ className: 'danger' }),\n 'banner-button-background-warning': whenProps({ className: 'warning' }),\n 'banner-button-background-neutral': whenProps({ className: 'neutral' }),\n })};\n`\nconst InlineButton = styled(Button)`\n flex-shrink: 0;\n align-self: center;\n`\n\nconst ButtonWrapper = styled.div`\n display: flex;\n margin-top: -${token('space-s')};\n margin-right: 0;\n margin-left: auto;\n`\n\nconst LargeButtonWrapper = styled.div`\n display: flex;\n margin-left: 0;\n`\n\nconst TextWrapper = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${token('space-s')};\n`\n\nconst getAlertIcon = (variant: string, scale: string, icon?: JSX.Element) => {\n if (icon) {\n return <IconWrapper scale={scale}>{icon}</IconWrapper>\n }\n\n let iconName = ''\n switch (variant) {\n case 'success':\n iconName = 'check'\n break\n case 'danger':\n case 'warning':\n iconName = 'warning'\n break\n default:\n iconName = 'information'\n }\n\n return (\n <IconWrapper scale={scale}>\n <Icon name={iconName} size={24} />\n </IconWrapper>\n )\n}\n\nfunction Banner({\n scale = 'default',\n variant = 'neutral',\n icon,\n title,\n description,\n onClose,\n dismissible = true,\n ...others\n}: BannerProps) {\n const [visible, setVisible] = useState<boolean>(true)\n\n if (!visible) return null\n\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n <TextWrapper>\n {getAlertIcon(variant, scale, icon)}\n <TextSection $dismissible={dismissible}>\n {scale === 'default' ? (\n React.isValidElement(title) ? (\n title\n ) : (\n <Title variant={variant}>{title}</Title>\n )\n ) : (\n <>\n {React.isValidElement(title) ? title : <Title>{title}</Title>}\n {description &&\n (React.isValidElement(description) ? (\n description\n ) : (\n <Description>{description}</Description>\n ))}\n </>\n )}\n </TextSection>\n </TextWrapper>\n {dismissible && (\n <CloseButton\n scale={scale}\n onClick={() => {\n onClose?.()\n setVisible(false)\n }}\n type=\"button\"\n data-testid=\"close-button\"\n >\n <Icon name=\"close\" size={20} />\n </CloseButton>\n )}\n </StyledBanner>\n )\n}\n\nexport function BannerLarge({\n scale = 'large',\n variant = 'neutral',\n icon,\n title,\n description,\n onClose,\n dismissible = true,\n ...others\n}: BannerProps) {\n const [visible, setVisible] = useState<boolean>(true)\n\n if (!visible) return null\n\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n {getAlertIcon(variant, scale, icon)}\n <TextSection $dismissible={dismissible}>\n {React.isValidElement(title) ? title : <Title>{title}</Title>}\n {React.isValidElement(description) ? description : <Description>{description}</Description>}\n </TextSection>\n {dismissible && (\n <CloseButton\n scale={scale}\n onClick={() => {\n onClose?.()\n setVisible(false)\n }}\n type=\"button\"\n >\n <Icon name=\"close\" size={16} />\n </CloseButton>\n )}\n </StyledBanner>\n )\n}\n\nexport function BannerAction({\n scale = 'default',\n variant = 'neutral',\n icon,\n title,\n action,\n secondaryAction,\n onActionButtonClick,\n onSecondaryActionButtonClick,\n ...others\n}: BannerActionProps): JSX.Element {\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n <TextWrapper>\n {getAlertIcon(variant, scale, icon)}\n <TextSection>\n {React.isValidElement(title) ? title : <Title variant={variant}>{title}</Title>}\n </TextSection>\n </TextWrapper>\n <ButtonWrapper>\n <InlineButton\n scale=\"small\"\n variant=\"primary\"\n className={variant}\n type=\"button\"\n onClick={onActionButtonClick}\n >\n {action}\n </InlineButton>\n {secondaryAction && (\n <InlineButton\n scale=\"small\"\n className={variant}\n variant=\"secondary\"\n type=\"button\"\n onClick={onSecondaryActionButtonClick}\n >\n {secondaryAction}\n </InlineButton>\n )}\n </ButtonWrapper>\n </StyledBanner>\n )\n}\n\nexport function BannerActionLarge({\n scale = 'large',\n variant = 'neutral',\n icon,\n title,\n description,\n action,\n secondaryAction,\n onActionButtonClick,\n onSecondaryActionButtonClick,\n onClose,\n dismissible = false,\n ...others\n}: BannerActionProps) {\n const [visible, setVisible] = useState<boolean>(true)\n\n if (!visible) return null\n\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n {getAlertIcon(variant, scale, icon)}\n <TextSection $dismissible={dismissible}>\n {React.isValidElement(title) ? title : <Title>{title}</Title>}\n {React.isValidElement(description) ? description : <Description>{description}</Description>}\n <LargeButtonWrapper>\n <Button\n scale=\"small\"\n variant=\"primary\"\n className={variant}\n type=\"button\"\n onClick={onActionButtonClick}\n >\n {action}\n </Button>\n {secondaryAction && (\n <Button\n scale=\"small\"\n className={variant}\n variant=\"secondary\"\n type=\"button\"\n onClick={onSecondaryActionButtonClick}\n >\n {secondaryAction}\n </Button>\n )}\n </LargeButtonWrapper>\n </TextSection>\n {dismissible && (\n <CloseButton\n scale={scale}\n onClick={() => {\n onClose?.()\n setVisible(false)\n }}\n >\n <Icon name=\"close\" size={16} />\n </CloseButton>\n )}\n </StyledBanner>\n )\n}\n\nexport default Banner\n","import type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport typography, { TypographyOptions, TypographyVariants } from 'styles/typography'\n\nexport type TextProps = PropsWithChildren<{\n variant?: TypographyVariants\n italic?: TypographyOptions['italic']\n color?: TypographyOptions['color']\n}>\n\nexport default styled.span<TextProps>`\n ${({ variant, italic, color }) => typography(variant, { italic, color })}\n`\n","import React, { PropsWithChildren } from 'react'\nimport ReactDOM from 'react-dom'\nimport styled, { css } from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport { Text } from 'components/Text'\nimport CloseButton from 'common/CloseButton'\nimport rem from 'utils/toolset/rem'\n\ninterface WithScaleProps {\n scale?: 'small' | 'default' | 'large'\n}\n\nexport interface ModalProps extends WithScaleProps {\n className?: string\n id?: string\n open: boolean\n fullscreen?: boolean\n onOverlayClick?: () => void\n}\n\ninterface ModalWrapperProps {\n className?: string\n id?: string\n open: boolean\n fullscreen: boolean\n}\n\ninterface ContentProps extends WithScaleProps {\n fullscreen: boolean\n}\n\nconst ModalWrapper = styled.div<ModalWrapperProps>`\n position: fixed;\n top: 0;\n left: 0;\n\n z-index: ${token('z-index-overlay')};\n\n display: ${conditional({\n flex: whenProps({ open: true }),\n none: whenProps({ open: false }),\n })};\n align-items: center;\n justify-content: center;\n width: 100%;\n\n height: 100%;\n\n background: ${token('modal-overlay-background')};\n`\n\nconst HeaderWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n height: ${token('space-xl')};\n margin-bottom: ${token('space-l')};\n padding-bottom: ${token('space-s')};\n\n border-bottom: 1px solid ${token('color-neutral-light')};\n`\nconst Close = styled(CloseButton).attrs({\n size: 16,\n})`\n position: absolute;\n top: ${rem('36px')};\n right: ${rem('36px')};\n`\n\nconst Content = styled.div<ContentProps>`\n background: white;\n border-radius: ${token('border-radius-s')};\n box-shadow: ${token('shadow-modal')};\n\n padding: ${token('space-xl')};\n\n margin: 0 auto;\n\n position: relative;\n\n outline: none;\n\n z-index: ${token('z-index-modal')};\n\n ${({ fullscreen }) =>\n fullscreen &&\n css`\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100vh;\n `}\n\n ${({ fullscreen }) =>\n !fullscreen &&\n css`\n position: relative;\n left: auto;\n\n width: 80%;\n max-width: ${conditional({\n 'modal-small-max-width': whenProps({ scale: 'small' }),\n 'modal-max-width': whenProps({ scale: 'default' }),\n 'modal-large-max-width': whenProps({ scale: 'large' }),\n })};\n height: auto;\n `}\n`\n\nconst Header = ({ title, children }: PropsWithChildren<{ title: string }>) => {\n return (\n <HeaderWrapper>\n {title && (\n <Text variant=\"heading-md-bold\" color=\"color-neutral-darkest\">\n {title}\n </Text>\n )}\n {children}\n </HeaderWrapper>\n )\n}\n\nfunction Modal({\n scale = 'default',\n children,\n open,\n fullscreen = false,\n onOverlayClick = () => null,\n ...others\n}: PropsWithChildren<ModalProps>): JSX.Element {\n return ReactDOM.createPortal(\n <ModalWrapper\n open={open}\n fullscreen={fullscreen}\n onClick={onOverlayClick}\n data-testid=\"modal-overlay\"\n {...others}\n >\n <Content\n role=\"dialog\"\n aria-modal=\"true\"\n fullscreen={fullscreen}\n scale={scale}\n onClick={(e) => {\n e.stopPropagation()\n }}\n >\n {children}\n </Content>\n </ModalWrapper>,\n document.body\n )\n}\n\nModal.Header = Header\nModal.Close = Close\n\nexport default Modal\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nimport { Modal } from '../Modal'\nimport { Button } from '../Button'\nimport type { ButtonProps } from '../Button'\nimport conditional, { whenProps } from 'tools/conditional'\nimport rem from 'utils/toolset/rem'\n\ninterface WithScaleProps {\n scale?: 'small' | 'default' | 'large'\n}\n\nexport interface DialogProps extends WithScaleProps {\n className?: string\n id?: string\n open: boolean\n children: ReactNode\n onOverlayClick?: () => void\n}\n\nconst Header = styled.h1`\n padding-bottom: ${token('space-s')};\n\n color: ${token('dialog-header-color')};\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('font-size-2')};\n line-height: ${token('font-height-2')};\n text-align: center;\n\n border-bottom: 1px solid ${token('dialog-header-border-color')};\n`\nconst Body = styled.div`\n margin-top: ${token('space-l')};\n margin-bottom: ${token('space-l')};\n\n color: ${token('dialog-body-font-color')};\n font-size: ${token('font-size-4')};\n line-height: ${token('font-height-3')};\n text-align: center;\n`\n\nconst ActionWrapper = styled.div`\n button {\n width: 100%;\n margin-bottom: ${token('space-s')};\n }\n`\n\nconst Close = styled(Modal.Close)`\n top: ${token('space-xl')};\n right: ${rem('36px')};\n`\n\nconst StyledDialogActions = styled.div<{ $scale: string; $direction: string }>`\n display: flex;\n flex-flow: ${conditional({\n 'row-reverse': whenProps({ $direction: 'horizontal' }),\n column: whenProps({ $direction: 'vertical' }),\n })};\n justify-content: ${conditional({\n center: whenProps({ $scale: 'small' }),\n end: whenProps({ $scale: ['default', 'large'] }),\n })};\n\n ${ActionWrapper}:last-child {\n margin-right: ${conditional({\n 'space-m': whenProps({ $direction: 'horizontal' }),\n initial: whenProps({ $direction: 'vertical' }),\n })}};\n }\n`\n\nfunction DialogActions({\n scale = 'default',\n direction = 'vertical',\n children,\n}: {\n scale?: 'small' | 'default' | 'large'\n direction?: 'vertical' | 'horizontal'\n children: ReactNode\n}) {\n return (\n <StyledDialogActions $scale={scale} $direction={direction}>\n {children}\n </StyledDialogActions>\n )\n}\n\nexport interface DialogActionConfirmProps extends Omit<ButtonProps, 'onClick' | 'variant'> {\n onConfirm: () => void\n}\n\nfunction DialogActionConfirm({\n onConfirm = () => void 0,\n children = 'CONFIRM',\n ...others\n}: DialogActionConfirmProps) {\n return (\n <ActionWrapper>\n <Button {...others} onClick={onConfirm} variant=\"primary\">\n {children}\n </Button>\n </ActionWrapper>\n )\n}\n\nexport interface DialogActionCancelProps extends Omit<ButtonProps, 'onClick' | 'variant'> {\n onCancel: () => void\n}\n\nfunction DialogActionCancel({\n onCancel = () => void 0,\n children = 'CANCEL',\n ...others\n}: DialogActionCancelProps) {\n return (\n <ActionWrapper>\n <Button {...others} onClick={onCancel} variant=\"secondary\">\n {children}\n </Button>\n </ActionWrapper>\n )\n}\n\nfunction Dialog({ scale = 'default', open, ...others }: DialogProps): JSX.Element {\n return <Modal open={open} scale={scale} {...others} />\n}\n\nDialog.Header = Header\nDialog.Body = Body\nDialog.ActionConfirm = DialogActionConfirm\nDialog.ActionCancel = DialogActionCancel\nDialog.Actions = DialogActions\nDialog.Close = Close\n\nexport default Dialog\n","import { useCallback, useEffect, useState } from 'react'\n\nexport interface useDialogProps {\n open: boolean\n onOpen?: () => void\n onClose?: () => void\n}\n\nfunction useDialog({ open: openProp, onOpen, onClose }: useDialogProps): {\n open: boolean\n show: () => void\n hide: () => void\n toggle: () => void\n} {\n const [open, setOpen] = useState(openProp)\n\n const show = useCallback(\n function show() {\n setOpen(true)\n onOpen?.()\n },\n [onOpen]\n )\n\n const hide = useCallback(\n function hide() {\n setOpen(false)\n onClose?.()\n },\n [onClose]\n )\n\n const toggle = useCallback(\n function toggle() {\n if (open) {\n hide()\n } else {\n show()\n }\n },\n [hide, open, show]\n )\n\n useEffect(\n function updateState() {\n setOpen(openProp)\n },\n [openProp]\n )\n\n return {\n open,\n show,\n hide,\n toggle,\n }\n}\n\nexport default useDialog\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL <body> scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition, arrow as arrow$2, offset as offset$1, shift as shift$1, limitShift as limitShift$1, flip as flip$1, size as size$1, autoPlacement as autoPlacement$1, hide as hide$1, inline as inline$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => ({\n ...offset$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => ({\n ...shift$1(options),\n options: [options, deps]\n});\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => ({\n ...limitShift$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => ({\n ...flip$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => ({\n ...size$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => ({\n ...autoPlacement$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => ({\n ...hide$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => ({\n ...inline$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => ({\n ...arrow$1(options),\n options: [options, deps]\n});\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n","import React, { CSSProperties, useMemo, useRef } from 'react'\nimport { useFloating, offset, flip, shift, arrow, autoUpdate } from '@floating-ui/react-dom'\nimport type { Placement } from '@floating-ui/react-dom'\n\nimport type {\n PopoverAlign,\n PopoverFloatingProps,\n PopoverPosition,\n PopoverProps,\n PopoverReferenceProps,\n UsePopoverReturn,\n} from './Popover.types'\n\nconst PopoverContext = React.createContext<UsePopoverReturn | undefined>(undefined)\n\nexport function usePopover(): UsePopoverReturn {\n const value = React.useContext(PopoverContext)\n\n if (!value) {\n throw new Error('usePopover must be used within a <Popover> Provider')\n }\n\n return value\n}\n\nfunction Popover(props: PopoverProps): JSX.Element {\n const arrowRef = useRef<HTMLElement | null>(null)\n\n const { position = 'bottom', align = 'start', strategy = 'fixed' } = props\n\n const desiredPlacement: Placement = `${position}${\n align === 'center' ? '' : `-${align}`\n }` as Placement\n\n const floating = useFloating({\n placement: desiredPlacement,\n strategy,\n middleware: [offset(10), flip(), shift(), arrow({ element: arrowRef, padding: 8 })],\n // TODO: FloatingUI docs states that `autoUpdate` is expensive.\n // This should be properly investidated since it's the way to\n // update fixed positions after scrolling.\n whileElementsMounted: autoUpdate,\n })\n\n const [resultPosition = position, resultAlign = align] = floating.placement.split('-') as [\n PopoverPosition,\n PopoverAlign\n ]\n\n const value = useMemo<UsePopoverReturn>(\n () => ({\n strategy,\n register: {\n setReference: floating.refs.setReference,\n setFloating: floating.refs.setFloating,\n setArrow: arrowRef,\n },\n result: {\n floatingStyles: floating.floatingStyles,\n arrow: { top: floating.middlewareData.arrow?.y, left: floating.middlewareData.arrow?.x },\n position: resultPosition,\n align: resultAlign,\n },\n }),\n [\n floating.refs.setFloating,\n floating.middlewareData.arrow?.x,\n floating.middlewareData.arrow?.y,\n floating.refs.setReference,\n floating.floatingStyles,\n resultAlign,\n resultPosition,\n strategy,\n ]\n )\n\n return <PopoverContext.Provider value={value}>{props.children}</PopoverContext.Provider>\n}\n\nfunction PopoverReference({ children, ...others }: PopoverReferenceProps): JSX.Element {\n const { register } = usePopover()\n\n return (\n <div ref={register.setReference} {...others}>\n {children}\n </div>\n )\n}\n\nfunction PopoverFloating({ children, style, ...others }: PopoverFloatingProps): JSX.Element {\n const { register, result } = usePopover()\n\n return (\n <div\n ref={register.setFloating}\n {...others}\n style={{\n ...result.floatingStyles,\n ...style,\n }}\n >\n {children}\n </div>\n )\n}\n\nPopover.Floating = PopoverFloating\nPopover.Reference = PopoverReference\n\nexport default Popover\n","import React, { HTMLAttributes, ReactNode, useCallback, useState } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport focusable from 'styles/focusable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport { Popover, usePopover } from 'components/Popover'\nimport typography from 'styles/typography'\n\nimport type { PopoverAlign, PopoverPosition } from 'components/Popover'\n\nexport enum TooltipPosition {\n Top = 'top',\n Bottom = 'bottom',\n Left = 'left',\n Right = 'right',\n}\n\nexport enum TooltipAlign {\n Start = 'start',\n Center = 'center',\n End = 'end',\n}\n\nexport interface TooltipProps extends HTMLAttributes<HTMLDivElement> {\n message: ReactNode\n scheme?: ColorScheme\n position?: TooltipPosition | PopoverPosition\n align?: TooltipAlign | PopoverAlign\n}\n\ntype ContainerProps = Pick<TooltipProps, 'scheme'>\n\nconst Container = styled.div<ContainerProps>`\n display: inline-block;\n\n position: relative;\n\n cursor: help;\n\n ${focusable`\n outline: ${conditional({\n '$tooltip-outline': whenProps({ scheme: 'light' }),\n '$tooltip-dark-outline': whenProps({ scheme: 'dark' }),\n })};\n `}\n`\n\nconst Bubble = styled(Popover.Floating)`\n ${typography('body')}\n\n white-space: initial;\n\n min-width: ${token('tooltip-min-width')};\n max-width: ${token('tooltip-max-width')};\n width: max-content;\n\n z-index: ${token('z-index-tooltip')};\n\n background: ${token('tooltip-background')};\n box-shadow: ${token('tooltip-shadow')};\n border-radius: ${token('tooltip-border-radius')};\n\n padding: ${token('tooltip-padding-y')} ${token('tooltip-padding-x')};\n\n color: ${token('tooltip-color')};\n font-size: ${token('tooltip-font-size')};\n line-height: ${token('tooltip-font-height')};\n`\n\ntype ArrowProps = Pick<TooltipProps, 'position'> & {\n top?: number\n left?: number\n}\n\nconst StyledArrow = styled.span<ArrowProps>`\n position: absolute;\n\n width: 0;\n height: 0;\n display: block;\n\n background: transparent;\n border-style: solid;\n\n z-index: ${token('z-index-tooltip')};\n\n ${({ top }) => top && `top: ${top}px;`}\n ${({ left }) => left && `left: ${left}px;`}\n\n ${({ position }) =>\n position === 'top' &&\n css`\n bottom: -8px;\n\n border-color: ${token('tooltip-background')} transparent transparent transparent;\n border-width: 12px 10px 0 10px;\n `}\n\n ${({ position }) =>\n position === 'bottom' &&\n css`\n top: -8px;\n\n border-color: transparent transparent ${token('tooltip-background')} transparent;\n border-width: 0 10px 12px 10px;\n `}\n\n ${({ position }) =>\n position === 'left' &&\n css`\n right: -8px;\n\n border-color: transparent transparent transparent ${token('tooltip-background')};\n border-width: 10px 0 10px 12px;\n `}\n\n ${({ position }) =>\n position === 'right' &&\n css`\n left: -8px;\n\n border-color: transparent ${token('tooltip-background')} transparent transparent;\n border-width: 10px 12px 10px 0;\n `}\n`\n\nfunction Arrow() {\n const { register, result } = usePopover()\n\n return (\n <StyledArrow\n ref={(element) => (register.setArrow.current = element)}\n position={result.position}\n top={result.arrow.top}\n left={result.arrow.left}\n />\n )\n}\n\nfunction Tooltip({\n children,\n message,\n scheme,\n position = TooltipPosition.Top,\n align = TooltipAlign.Center,\n ...rest\n}: PropsWithChildren<TooltipProps>): JSX.Element {\n const [visible, setVisible] = useState(false)\n\n const showTooltip = useCallback(() => {\n setVisible(true)\n }, [])\n\n const hideTooltip = useCallback(() => {\n setVisible(false)\n }, [])\n\n return (\n <Container\n {...rest}\n onFocus={showTooltip}\n onBlur={hideTooltip}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n tabIndex={0}\n scheme={scheme}\n >\n <Popover position={position} align={align}>\n {visible && (\n <Bubble role=\"tooltip\">\n {message}\n <Arrow />\n </Bubble>\n )}\n\n <Popover.Reference>{children}</Popover.Reference>\n </Popover>\n </Container>\n )\n}\n\nexport default Tooltip\n","import React, { ReactNode } from 'react'\nimport type { LabelHTMLAttributes } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\nimport { isNil } from '@loadsmart/utils-object'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport ellipsizable from 'styles/ellipsizable'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\n\nimport { Tooltip, TooltipProps } from '../Tooltip'\n\ntype AcceptedType = 'label' | 'div' | 'span'\n\ninterface WithAdditionalProps {\n as?: AcceptedType\n disabled?: boolean\n required?: boolean\n scheme?: ColorScheme\n tip?: ReactNode\n tipProps?: Omit<TooltipProps, 'message'>\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement | HTMLDivElement | HTMLSpanElement>,\n WithAdditionalProps {\n className?: string\n}\n\nconst StyledWrapper = styled.div`\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n\n line-height: ${token('font-height-2')};\n ${disableable()}\n`\n\nconst StyledChildren = styled.span<WithAdditionalProps>`\n display: inline-block;\n\n ${font({\n height: 'label-font-height',\n weight: 'label-font-weight',\n })}\n\n font-size: ${token('label-font-size')};\n color: ${conditional({\n 'label-font-color': whenProps({ scheme: 'light' }),\n 'color-neutral-white': whenProps({ scheme: 'dark' }),\n })};\n ${ellipsizable()}\n`\n\nconst StyledRequired = styled.sup`\n top: 0;\n\n color: ${token('label-required-color')};\n font-size: ${token('label-font-size')};\n`\n\nconst StyledTooltipAnchor = styled.span<WithAdditionalProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n margin: 0 0 0 ${token('label-tooltip-margin-left')};\n\n color: ${conditional({\n 'label-tooltip-font-color': whenProps({ scheme: 'light' }),\n 'label-tooltip-dark-font-color': whenProps({ scheme: 'dark' }),\n })};\n font-weight: ${token('label-tooltip-font-weight')};\n font-size: ${token('label-tooltip-font-size')};\n\n background: ${conditional({\n 'label-tooltip-background-color': whenProps({ scheme: 'light' }),\n 'label-tooltip-dark-background-color': whenProps({ scheme: 'dark' }),\n })};\n border-radius: ${token('border-radius-circle')};\n`\n\nfunction Label({\n as = 'label',\n children,\n className,\n disabled = false,\n required,\n scheme = 'light',\n tip,\n tipProps = {},\n ...others\n}: LabelProps): JSX.Element {\n const tag = String(as || 'label') as AcceptedType\n\n return (\n <StyledWrapper\n data-testid=\"label\"\n as={tag}\n className={clsx(className, {\n 'is-disabled': disabled,\n })}\n {...others}\n >\n <StyledChildren scheme={scheme}>{children}</StyledChildren>\n {required && <StyledRequired>*</StyledRequired>}\n {!isNil(tip) && (\n <Tooltip scheme={scheme} message={tip || ''} {...tipProps}>\n <StyledTooltipAnchor scheme={scheme}>?</StyledTooltipAnchor>\n </Tooltip>\n )}\n </StyledWrapper>\n )\n}\n\nexport default Label\n","export const PAGINATION_ITEM_TYPE = {\n endEllipsis: 'end-ellipsis',\n next: 'next',\n page: 'page',\n previous: 'previous',\n startEllipsis: 'start-ellipsis',\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\n\nimport { BaseButton, IconButton as IconButtonDefault } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\n\nimport type { PaginationItemProps } from './Pagination.types'\nimport { PAGINATION_ITEM_TYPE } from './Pagination.constants'\n\nconst IconButton = styled(IconButtonDefault)`\n margin: ${token('space-xs')};\n`\n\nconst PageButton = styled(BaseButton)`\n background-color: transparent;\n border: none;\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n `}\n\n ${hoverable`\n * {\n text-decoration: underline;\n color: ${token('color-neutral-dark')};\n }\n `}\n\n ${Text} {\n color: ${conditional({\n 'color-accent': whenProps({ 'aria-current': true }),\n })};\n text-decoration: ${conditional({\n underline: whenProps({ 'aria-current': true }),\n })};\n }\n`\n\nconst ICONS_NAME: Record<string, string> = {\n previous: 'caret-left',\n next: 'caret-right',\n}\n\nfunction PaginationItem(props: PaginationItemProps): JSX.Element {\n const { itemType: type, page, ...others } = props\n\n const iconName = ICONS_NAME[type]\n\n if (iconName) {\n return (\n <IconButton {...others} id={iconName} aria-label={`Go to ${type} page`}>\n <Icon name={iconName} size={16} />\n </IconButton>\n )\n }\n\n return (\n <PageButton {...others} aria-label={`Go to page ${page?.toString() ?? ''}`}>\n <Text variant=\"body\">\n {[PAGINATION_ITEM_TYPE.endEllipsis, PAGINATION_ITEM_TYPE.startEllipsis].includes(type)\n ? '...'\n : page}\n </Text>\n </PageButton>\n )\n}\n\nexport default PaginationItem\n","import { PAGINATION_ITEM_TYPE } from './Pagination.constants'\nimport type { PaginationHelperArgs } from './Pagination.types'\n\nexport class PaginationHelper {\n boundaryCount: number\n count: number\n page: number\n siblingCount: number\n\n constructor({ boundaryCount, count, page, siblingCount }: PaginationHelperArgs) {\n this.boundaryCount = boundaryCount\n this.count = count\n this.page = page\n this.siblingCount = siblingCount\n }\n\n range(start: number, end: number): number[] {\n const length = end - start + 1\n return Array.from({ length }, (_, i) => start + i)\n }\n\n getStartPages(): number[] {\n return this.range(1, Math.min(this.boundaryCount, this.count))\n }\n\n getEndPages(): number[] {\n return this.range(\n Math.max(this.count - this.boundaryCount + 1, this.boundaryCount + 1),\n this.count\n )\n }\n\n getSibilingsStart(): number {\n return Math.max(\n Math.min(\n // Natural start\n this.page - this.siblingCount,\n // Lower boundary when page is high\n this.count - this.boundaryCount - this.siblingCount * 2 - 1\n ),\n // Greater than startPages\n this.boundaryCount + 2\n )\n }\n\n getSibilingsEnd(): number {\n const endPages = this.getEndPages()\n\n return Math.min(\n Math.max(\n // Natural end\n this.page + this.siblingCount,\n // Upper boundary when page is low\n this.boundaryCount + this.siblingCount * 2 + 2\n ),\n // Less than endPages\n endPages.length > 0 ? endPages[0] - 2 : this.count - 1\n )\n }\n\n getStartEllipsis(): number[] | string[] {\n const siblingsStart = this.getSibilingsStart()\n\n if (siblingsStart > this.boundaryCount + 2) {\n return [PAGINATION_ITEM_TYPE.startEllipsis]\n }\n\n if (this.boundaryCount + 1 < this.count - this.boundaryCount) {\n return [this.boundaryCount + 1]\n }\n\n return []\n }\n\n getEndEllipsis(): number[] | string[] {\n const siblingsEnd = this.getSibilingsEnd()\n\n if (siblingsEnd < this.count - this.boundaryCount - 1) {\n return [PAGINATION_ITEM_TYPE.endEllipsis]\n }\n\n if (this.count - this.boundaryCount > this.boundaryCount) {\n return [this.count - this.boundaryCount]\n }\n\n return []\n }\n}\n","import { PAGINATION_ITEM_TYPE } from './Pagination.constants'\nimport { PaginationHelper } from './Pagination.helper'\nimport type { usePaginationProps, usePaginationReturn } from './Pagination.types'\n\nfunction usePagination(props: usePaginationProps): usePaginationReturn[] {\n const {\n boundaryCount = 1,\n count,\n disabled = false,\n onChange: handleChange,\n page,\n siblingCount = 1,\n } = props\n\n const paginationHelper = new PaginationHelper({ boundaryCount, count, page, siblingCount })\n\n function handleClick({ page }: { page: number | null }) {\n if (page) {\n handleChange({ page })\n }\n }\n\n const startPages = paginationHelper.getStartPages()\n const endPages = paginationHelper.getEndPages()\n\n const siblingsStart = paginationHelper.getSibilingsStart()\n const siblingsEnd = paginationHelper.getSibilingsEnd()\n\n // Basic list of items to render\n // e.g. itemList = ['previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next']\n const itemList = [\n PAGINATION_ITEM_TYPE.previous,\n ...startPages,\n\n // Start ellipsis\n ...paginationHelper.getStartEllipsis(),\n\n // Sibling pages\n ...paginationHelper.range(siblingsStart, siblingsEnd),\n\n // End ellipsis\n ...paginationHelper.getEndEllipsis(),\n\n ...endPages,\n PAGINATION_ITEM_TYPE.next,\n ]\n\n function getButtonPage(item: string | number): number | null {\n if (typeof item === 'number') {\n return item\n } else {\n switch (item) {\n case PAGINATION_ITEM_TYPE.previous:\n return page - 1\n case PAGINATION_ITEM_TYPE.next:\n return page + 1\n case PAGINATION_ITEM_TYPE.startEllipsis:\n return siblingsStart - 1\n case PAGINATION_ITEM_TYPE.endEllipsis:\n return siblingsEnd + 1\n default:\n return null\n }\n }\n }\n\n function isDisabled(item: string | number): boolean {\n if (item === PAGINATION_ITEM_TYPE.previous) return page <= 1\n if (item === PAGINATION_ITEM_TYPE.next) return page >= count\n\n return false\n }\n\n return itemList.map((item) => {\n const isNumber = typeof item === 'number'\n\n return {\n onClick: () => handleClick({ page: getButtonPage(item) }),\n itemType: isNumber ? PAGINATION_ITEM_TYPE.page : item.toString(),\n page: getButtonPage(item),\n disabled: disabled || isDisabled(item),\n ...(isNumber && { 'aria-current': item === page }),\n }\n })\n}\n\nexport default usePagination\n","import React from 'react'\n\nimport { Layout } from 'components/Layout'\n\nimport PaginationItem from './PaginationItem'\nimport usePagination from './usePagination'\n\nimport type { PaginationProps } from './Pagination.types'\n\nfunction Pagination(props: PaginationProps): JSX.Element {\n const {\n boundaryCount = 1,\n count,\n disabled = false,\n onChange,\n page,\n siblingCount = 1,\n ...others\n } = props\n\n const items = usePagination({ boundaryCount, count, disabled, onChange, page, siblingCount })\n\n return (\n <nav aria-label=\"pagination navigation\" {...others}>\n <Layout.Group space=\"none\" align=\"center\">\n {items.map((item) => (\n <PaginationItem {...item} key={`${item.itemType}${item.page || ''}`} />\n ))}\n </Layout.Group>\n </nav>\n )\n}\n\nexport default Pagination\n","import React, { BaseHTMLAttributes } from 'react'\nimport styled, { css } from 'styled-components'\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport Status from 'utils/types/Status'\n\nconst Bar = styled.div<{ rounded: boolean }>`\n align-items: center;\n display: flex;\n flex-grow: 0;\n flex-shrink: 1;\n\n justify-content: center;\n overflow: hidden;\n width: 100%;\n\n position: relative;\n\n height: ${token('progressbar-height')};\n\n ${({ rounded }) =>\n rounded &&\n css`\n border-radius: ${token('progressbar-height')};\n `}\n`\n\nconst Line = styled.span`\n width: 100%;\n height: 1px;\n\n background: ${token('progressbar-line')};\n background: black;\n`\n\ntype ProgressProps = Pick<ProgressBarProps, 'value' | 'rounded' | 'status'>\nconst Progress = styled.span<ProgressProps>`\n position: absolute;\n top: 0;\n left: 0;\n\n width: ${({ value }) => value}%;\n height: ${token('progressbar-height')};\n\n background: ${conditional({\n 'progressbar-neutral-fill': whenProps({ status: Status.Neutral }),\n 'progressbar-success-fill': whenProps({ status: Status.Success }),\n 'progressbar-warning-fill': whenProps({ status: Status.Warn }),\n 'progressbar-danger-fill': whenProps({ status: Status.Danger }),\n })};\n border-radius: ${conditional({\n ['progressbar-height']: whenProps({ rounded: true }),\n })};\n\n transition: 600ms ease;\n`\n\nexport interface ProgressBarProps extends BaseHTMLAttributes<HTMLDivElement> {\n value?: number\n status?: string\n rounded?: boolean\n showLine?: boolean\n}\n\nexport function ProgressBar({\n value = 60,\n status = Status.Neutral,\n rounded = false,\n showLine = false,\n ...extra\n}: ProgressBarProps): JSX.Element {\n const clampedValue = Math.max(0, Math.min(value, 100))\n\n return (\n <Bar\n role=\"progressBar\"\n aria-valuenow={clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n rounded={rounded}\n {...extra}\n >\n {showLine && <Line />}\n <Progress value={clampedValue} rounded={rounded} status={status} />\n </Bar>\n )\n}\n\nexport default ProgressBar\n","import React, { ChangeEvent, InputHTMLAttributes } from 'react'\nimport clsx from 'clsx'\nimport styled from 'styled-components'\n\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hidden from 'styles/hidden'\nimport hoverable from 'styles/hoverable'\nimport { getToken as token } from 'theming'\n\nimport transition from 'styles/transition'\n\ninterface WithAdditionalProps {\n active?: boolean\n onToggle?: (event: ChangeEvent<HTMLInputElement>) => void\n scale?: 'default' | 'large'\n}\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement>, WithAdditionalProps {\n className?: string\n}\n\nconst SwitchWrapper = styled.label<WithAdditionalProps>`\n ${transition()}\n\n ${font({})};\n\n user-select: none;\n\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n position: relative;\n\n display: inline-flex;\n\n width: ${conditional({\n 'switch-width': whenProps({ scale: 'default' }),\n 'switch-large-width': whenProps({ scale: 'large' }),\n })};\n height: ${conditional({\n 'switch-height': whenProps({ scale: 'default' }),\n 'switch-large-height': whenProps({ scale: 'large' }),\n })};\n\n background-color: ${conditional({\n 'switch-inactive-background-color': whenProps({ active: false }),\n 'switch-active-background-color': whenProps({ active: true }),\n })};\n\n border-radius: ${conditional({\n 'switch-border-radius': whenProps({ scale: 'default' }),\n 'switch-large-border-radius': whenProps({ scale: 'large' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'switch-inactive-background-color--hover': whenProps({ active: false }),\n 'switch-active-background-color--hover': whenProps({ active: true }),\n })};\n `}\n\n ${focusable`\n box-shadow: ${token('switch-box-shadow')};\n outline: ${token('switch-outline')};\n outline-offset: ${token('switch-outline-offset')};\n `}\n\n ${disableable``}\n`\n\nconst Slider = styled.span<WithAdditionalProps>`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n :before {\n position: absolute;\n bottom: ${conditional({\n 'switch-slider-y': whenProps({ scale: 'default', active: false }),\n 'switch-slider-active-y': whenProps({ scale: 'default', active: true }),\n 'switch-slider-large-y': whenProps({ scale: 'large', active: false }),\n 'switch-slider-large-active-y': whenProps({ scale: 'large', active: true }),\n })};\n left: ${conditional({\n 'switch-slider-x': whenProps({ scale: 'default', active: false }),\n 'switch-slider-active-x': whenProps({ scale: 'default', active: true }),\n 'switch-slider-large-x': whenProps({ scale: 'large', active: false }),\n 'switch-slider-large-active-x': whenProps({ scale: 'large', active: true }),\n })};\n\n width: ${conditional({\n 'switch-slider-size': whenProps({ scale: 'default' }),\n 'switch-slider-large-size': whenProps({ scale: 'large' }),\n })};\n\n height: ${conditional({\n 'switch-slider-size': whenProps({ scale: 'default' }),\n 'switch-slider-large-size': whenProps({ scale: 'large' }),\n })};\n\n background-color: ${token('switch-slider-background-color')};\n border-radius: ${token('switch-slider-border-radius')};\n\n ${transition({\n timingFunction: 'ease-out',\n duration: '150ms',\n })}\n\n content: '';\n }\n`\n\nconst HiddenInput = styled.input`\n ${hidden(true)}\n`\n\nconst ActiveIcon = styled(Icon)<WithAdditionalProps>`\n position: absolute;\n top: ${conditional({\n 'switch-icon-active-y': whenProps({ scale: 'default' }),\n 'switch-large-icon-active-y': whenProps({ scale: 'large' }),\n })};\n left: ${conditional({\n 'switch-icon-active-x': whenProps({ scale: 'default' }),\n 'switch-large-icon-active-x': whenProps({ scale: 'large' }),\n })};\n\n width: ${conditional({\n 'switch-icon-width': whenProps({ scale: 'default' }),\n 'switch-large-icon-width': whenProps({ scale: 'large' }),\n })};\n\n height: ${conditional({\n 'switch-icon-height': whenProps({ scale: 'default' }),\n 'switch-large-icon-height': whenProps({ scale: 'large' }),\n })};\n\n color: ${token('switch-icon-color')};\n`\n\nconst InactiveIcon = styled(Icon)<WithAdditionalProps>`\n position: absolute;\n top: ${conditional({\n 'switch-icon-inactive-y': whenProps({ scale: 'default' }),\n 'switch-large-icon-inactive-y': whenProps({ scale: 'large' }),\n })};\n left: ${conditional({\n 'switch-icon-inactive-x': whenProps({ scale: 'default' }),\n 'switch-large-icon-inactive-x': whenProps({ scale: 'large' }),\n })};\n\n width: ${conditional({\n 'switch-icon-width': whenProps({ scale: 'default' }),\n 'switch-large-icon-width': whenProps({ scale: 'large' }),\n })};\n\n height: ${conditional({\n 'switch-icon-height': whenProps({ scale: 'default' }),\n 'switch-large-icon-height': whenProps({ scale: 'large' }),\n })};\n\n color: ${token('switch-icon-color')};\n`\n\nfunction Switch({\n active = false,\n className,\n disabled = false,\n name,\n onToggle,\n scale = 'default',\n ...others\n}: SwitchProps): JSX.Element {\n return (\n <SwitchWrapper\n htmlFor={name}\n title={active ? 'active' : 'inactive'}\n active={active}\n className={clsx(className, {\n 'is-disabled': disabled,\n })}\n scale={scale}\n >\n {active ? (\n <ActiveIcon name=\"check\" scale={scale} data-testid=\"switch-icon-active\" />\n ) : (\n <InactiveIcon name=\"close\" scale={scale} data-testid=\"switch-icon-inactive\" />\n )}\n <Slider active={active} scale={scale} />\n <HiddenInput\n type=\"checkbox\"\n {...others}\n id={name}\n name={name}\n checked={active}\n disabled={disabled}\n onChange={onToggle}\n />\n </SwitchWrapper>\n )\n}\n\nexport default Switch\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\n\nimport { Icon } from 'components/Icon'\n\n// tools\nimport conditional, { whenProps } from 'tools/conditional'\n// styles\nimport typography from 'styles/typography'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport { getToken as token } from 'theming'\n\nimport type { ButtonHTMLAttributes } from 'react'\n\n// interfaces\ninterface WithSizeProps {\n size?: 'small' | 'default' | 'large'\n}\n\ninterface WithVariantProps {\n variant?: 'accent' | 'danger' | 'default' | 'outlined' | 'success' | 'warning'\n}\n\nexport interface TagProps extends React.HTMLAttributes<HTMLElement>, WithSizeProps {\n className?: string\n children?: ReactNode\n disabled?: boolean\n leading?: ReactNode\n removable?: boolean\n variant?: 'accent' | 'danger' | 'default' | 'outlined' | 'success' | 'warning'\n onRemove?: () => void\n getRemoveButtonProps?: () => Partial<ButtonHTMLAttributes<HTMLButtonElement>> & {\n 'data-testid'?: string\n }\n}\n\n// styled elements\nconst StyledTag = styled.span`\n display: inline-flex;\n\n position: relative;\n\n width: auto;\n\n z-index: 0;\n\n ${disableable`\n opacity: ${token('opacity-60')};\n `}\n`\n\nconst StyledSpan = styled.span<TagProps>`\n ${transition()}\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n\n text-decoration: none;\n\n ${typography(\n conditional({\n 'chips-sm': whenProps({ size: 'small' }),\n 'caption-bold': whenProps({ size: 'default' }),\n 'body-bold': whenProps({ size: 'large' }),\n })\n )}\n\n line-height: initial;\n\n text-transform: ${conditional({\n 'tag-transform': whenProps({ size: 'default' }),\n 'tag-small-transform': whenProps({ size: 'small' }),\n 'tag-large-transform': whenProps({ size: 'large' }),\n })};\n\n padding: ${conditional({\n 'tag-small-spacing': whenProps({ size: 'small', removable: (removable) => !removable }),\n 'tag-spacing': whenProps({\n size: (size) => !['small', 'large'].includes(size ?? ''),\n removable: (removable) => !removable,\n }),\n 'tag-large-spacing': whenProps({ size: 'large', removable: (removable) => !removable }),\n 'tag-removable-spacing': whenProps([{ size: (size) => size !== 'small', removable: true }]),\n 'tag-small-removable-spacing': whenProps([{ size: 'small', removable: true }]),\n })};\n\n min-width: ${token('tag-width')};\n height: ${conditional({\n 'tag-height': whenProps({ size: 'default' }),\n 'tag-small-height': whenProps({ size: 'small' }),\n 'tag-large-height': whenProps({ size: 'large' }),\n })};\n\n font-weight: ${conditional({\n 'tag-font-weight': whenProps({ size: 'default' }),\n 'tag-small-font-weight': whenProps({ size: 'small' }),\n 'tag-large-font-weight': whenProps({ size: 'large' }),\n })};\n\n color: ${conditional({\n 'tag-default-color': whenProps({ variant: 'default' }),\n 'tag-outlined-color': whenProps({ variant: 'outlined' }),\n 'tag-accent-color': whenProps({ variant: 'accent' }),\n 'tag-success-color': whenProps({ variant: 'success' }),\n 'tag-warning-color': whenProps({ variant: 'warning' }),\n 'tag-danger-color': whenProps({ variant: 'danger' }),\n })};\n\n background: ${conditional({\n 'tag-default-background': whenProps({ variant: 'default' }),\n 'tag-outlined-background': whenProps({ variant: 'outlined' }),\n 'tag-accent-background': whenProps({ variant: 'accent' }),\n 'tag-success-background': whenProps({ variant: 'success' }),\n 'tag-warning-background': whenProps({ variant: 'warning' }),\n 'tag-danger-background': whenProps({ variant: 'danger' }),\n })};\n\n border-radius: ${token('tag-border-radius')};\n border-width: ${token('tag-border-width')};\n border-style: solid;\n\n border-color: ${conditional({\n 'tag-default-border-color': whenProps({ variant: 'default' }),\n 'tag-outlined-border-color': whenProps({ variant: 'outlined' }),\n 'tag-accent-border-color': whenProps({ variant: 'accent' }),\n 'tag-success-border-color': whenProps({ variant: 'success' }),\n 'tag-warning-border-color': whenProps({ variant: 'warning' }),\n 'tag-danger-border-color': whenProps({ variant: 'danger' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'tag-default-background--hover': whenProps([\n { variant: 'default', removable: true },\n { variant: 'default', href: Boolean },\n ]),\n 'tag-outlined-background--hover': whenProps([\n { variant: 'outlined', removable: true },\n { variant: 'outlined', href: Boolean },\n ]),\n 'tag-accent-background--hover': whenProps([\n { variant: 'accent', removable: true },\n { variant: 'accent', href: Boolean },\n ]),\n 'tag-success-background--hover': whenProps([\n { variant: 'success', removable: true },\n { variant: 'success', href: Boolean },\n ]),\n 'tag-warning-background--hover': whenProps([\n { variant: 'warning', removable: true },\n { variant: 'warning', href: Boolean },\n ]),\n 'tag-danger-background--hover': whenProps([\n { variant: 'danger', removable: true },\n { variant: 'danger', href: Boolean },\n ]),\n })};\n\n border-color: ${conditional({\n 'tag-default-border-color--hover': whenProps([\n { variant: 'default', removable: true },\n { variant: 'default', href: Boolean },\n ]),\n 'tag-outlined-border-color--hover': whenProps([\n { variant: 'outlined', removable: true },\n { variant: 'outlined', href: Boolean },\n ]),\n 'tag-accent-border-color--hover': whenProps([\n { variant: 'accent', removable: true },\n { variant: 'accent', href: Boolean },\n ]),\n 'tag-success-border-color--hover': whenProps([\n { variant: 'success', removable: true },\n { variant: 'success', href: Boolean },\n ]),\n 'tag-warning-border-color--hover': whenProps([\n { variant: 'warning', removable: true },\n { variant: 'warning', href: Boolean },\n ]),\n 'tag-danger-border-color--hover': whenProps([\n { variant: 'danger', removable: true },\n { variant: 'danger', href: Boolean },\n ]),\n })};\n\n color: ${conditional({\n 'tag-default-color--hover': whenProps([\n { variant: 'default', removable: true },\n { variant: 'default', href: Boolean },\n ]),\n 'tag-outlined-color--hover': whenProps([\n { variant: 'outlined', removable: true },\n { variant: 'outlined', href: Boolean },\n ]),\n 'tag-accent-color--hover': whenProps([\n { variant: 'accent', removable: true },\n { variant: 'accent', href: Boolean },\n ]),\n 'tag-success-color--hover': whenProps([\n { variant: 'success', removable: true },\n { variant: 'success', href: Boolean },\n ]),\n 'tag-warning-color--hover': whenProps([\n { variant: 'warning', removable: true },\n { variant: 'warning', href: Boolean },\n ]),\n 'tag-danger-color--hover': whenProps([\n { variant: 'danger', removable: true },\n { variant: 'danger', href: Boolean },\n ]),\n })};\n `}\n\n ${focusable`\n color: ${conditional({\n 'tag-default-color--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-color--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-color--focus': whenProps({ variant: 'accent' }),\n 'tag-success-color--focus': whenProps({ variant: 'success' }),\n 'tag-warning-color--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-color--focus': whenProps({ variant: 'danger' }),\n })};\n background: ${conditional({\n 'tag-default-background--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-background--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-background--focus': whenProps({ variant: 'accent' }),\n 'tag-success-background--focus': whenProps({ variant: 'success' }),\n 'tag-warning-background--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-background--focus': whenProps({ variant: 'danger' }),\n })};\n box-shadow: ${token('tag-box-shadow')};\n outline: ${conditional({\n 'tag-default-outline': whenProps({ variant: 'default' }),\n 'tag-outlined-outline': whenProps({ variant: 'outlined' }),\n 'tag-accent-outline': whenProps({ variant: 'accent' }),\n 'tag-success-outline': whenProps({ variant: 'success' }),\n 'tag-warning-outline': whenProps({ variant: 'warning' }),\n 'tag-danger-outline': whenProps({ variant: 'danger' }),\n })};\n outline-offset: ${token('tag-outline-offset')};\n `}\n\n ${disableable`\n opacity: ${token('opacity-60')};\n `}\n`\n\nconst Leading = styled.span<WithSizeProps>`\n display: ${conditional({\n 'tag-leading-display': whenProps({ size: 'default' }),\n 'tag-small-leading-display': whenProps({ size: 'small' }),\n 'tag-large-leading-display': whenProps({ size: 'large' }),\n })};\n margin: 0 ${token('tag-icon-spacing')} 0 0;\n\n color: currentColor;\n\n fill: currentColor;\n`\n\nconst StyledCloseButton = styled.button<WithSizeProps & WithVariantProps>`\n z-index: 2;\n\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n cursor: pointer;\n\n background: ${token('tag-remove-button-background')};\n border-radius: ${token('tag-remove-button-border-radius')};\n border: 0;\n\n width: ${conditional({\n 'tag-remove-button-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-size': whenProps({ size: 'large' }),\n })};\n\n height: ${conditional({\n 'tag-remove-button-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-size': whenProps({ size: 'large' }),\n })};\n\n padding: 0;\n\n ${disableable`\n opacity: ${token('opacity-60')};\n `}\n\n ${focusable``}\n\n &:focus + ${StyledSpan} {\n color: ${conditional({\n 'tag-default-color--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-color--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-color--focus': whenProps({ variant: 'accent' }),\n 'tag-success-color--focus': whenProps({ variant: 'success' }),\n 'tag-warning-color--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-color--focus': whenProps({ variant: 'danger' }),\n })};\n\n background: ${conditional({\n 'tag-default-background--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-background--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-background--focus': whenProps({ variant: 'accent' }),\n 'tag-success-background--focus': whenProps({ variant: 'success' }),\n 'tag-warning-background--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-background--focus': whenProps({ variant: 'danger' }),\n })};\n box-shadow: ${token('tag-box-shadow')};\n }\n`\n\nconst CloseIcon = styled(Icon)<WithSizeProps & WithVariantProps>`\n width: ${conditional({\n 'tag-remove-button-icon-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-icon-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-icon-size': whenProps({ size: 'large' }),\n })};\n\n height: ${conditional({\n 'tag-remove-button-icon-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-icon-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-icon-size': whenProps({ size: 'large' }),\n })};\n\n color: ${conditional({\n 'tag-default-color': whenProps({ variant: 'default' }),\n 'tag-outlined-color': whenProps({ variant: 'outlined' }),\n 'tag-accent-color': whenProps({ variant: 'accent' }),\n 'tag-success-color': whenProps({ variant: 'success' }),\n 'tag-warning-color': whenProps({ variant: 'warning' }),\n 'tag-danger-color': whenProps({ variant: 'danger' }),\n })};\n\n fill: currentColor;\n`\n\nconst StyledSpacer = styled.span<WithSizeProps>`\n display: inline-block;\n width: ${conditional({\n '0': whenProps({ size: 'small' }),\n 'space-xs': whenProps({ size: 'default' }),\n 'space-s': whenProps({ size: 'large' }),\n })};\n`\n\n// components\nfunction Tag(props: TagProps): JSX.Element {\n const {\n children,\n leading,\n size = 'default',\n onRemove,\n variant,\n removable,\n getRemoveButtonProps,\n disabled = false,\n ...others\n } = props\n\n return (\n <StyledTag>\n <StyledSpan size={size} variant={variant} {...others}>\n {leading && <Leading size={size}>{leading}</Leading>}\n {children}\n {removable && !disabled && (\n <>\n <StyledSpacer aria-hidden=\"true\" size={size} />\n <StyledCloseButton\n type=\"button\"\n {...getRemoveButtonProps?.()}\n size={size}\n onClick={onRemove}\n >\n <CloseIcon name=\"close\" variant={variant} size={size} />\n </StyledCloseButton>\n </>\n )}\n </StyledSpan>\n </StyledTag>\n )\n}\n\nexport default Tag\n","import React, { BaseHTMLAttributes, useEffect, useState } from 'react'\nimport styled from 'styled-components'\n\nimport { Icon } from 'components/Icon'\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport Status from 'utils/types/Status'\n\nimport DefaultCloseButton from 'common/CloseButton'\n\nimport { ProgressBar } from 'components/ProgressBar'\n\ntype ContainerProps = Pick<ToastProps, 'status'>\nconst Container = styled.div<ContainerProps>`\n position: relative;\n\n width: ${token('toast-width')};\n max-width: 100%;\n padding: ${token('toast-padding-y')} ${token('toast-padding-x')};\n overflow: hidden;\n\n color: ${token('toast-font-color')};\n font-weight: ${token('toast-font-weight')};\n font-size: ${token('toast-font-size')};\n line-height: ${token('toast-font-height')};\n\n background: ${conditional({\n 'toast-neutral-background': whenProps({ status: Status.Neutral }),\n 'toast-success-background': whenProps({ status: Status.Success }),\n 'toast-warning-background': whenProps({ status: Status.Warn }),\n 'toast-danger-background': whenProps({ status: Status.Danger }),\n })};\n border-radius: ${token('toast-border-radius')};\n box-shadow: ${token('toast-shadow')};\n`\n\nconst Content = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-around;\n`\n\nconst Leading = styled.span`\n position: absolute;\n`\n\nconst ToastCountDown = styled(ProgressBar)`\n position: absolute;\n bottom: 0;\n left: 0;\n`\nconst CloseButton = styled(DefaultCloseButton)`\n position: absolute;\n\n top: ${token('toast-close-y')};\n right: ${token('toast-close-x')};\n\n color: ${token('color-neutral-white')};\n`\n\nexport interface ToastProps extends BaseHTMLAttributes<HTMLDivElement> {\n message: string\n status?: Status\n timeout?: number\n showIcon?: boolean\n onClose: () => void\n}\n\nconst INTERVAL = 300 //ms\n\nfunction Toast({\n message,\n onClose,\n timeout,\n showIcon = false,\n status = Status.Neutral,\n}: ToastProps): JSX.Element {\n const [count, setCount] = useState(100)\n\n /**\n * this is a quick solution for the progress/countdown effect,\n * we can use requestAnimationFrame or some other library to\n * better implement this in the future\n */\n useEffect(() => {\n if (!timeout) return\n\n const decrementBy = (INTERVAL * 100) / timeout\n const interval = window.setTimeout(() => {\n if (count <= 0) {\n window.clearTimeout(interval)\n onClose()\n } else {\n setCount((value) => value - decrementBy)\n }\n }, INTERVAL)\n\n return () => {\n window.clearTimeout(interval)\n }\n }, [count, onClose, timeout])\n\n return (\n <Container status={status} aria-live=\"polite\" role=\"alert\">\n {showIcon && (\n <Leading>\n <ToastIcon status={status} />\n </Leading>\n )}\n <Content>{message}</Content>\n {Boolean(timeout) && <ToastCountDown value={count} status={status} />}\n {onClose && <CloseButton onClick={onClose} size={14} />}\n </Container>\n )\n}\n\ninterface ToastIconProps {\n status: Status\n}\n\nfunction ToastIcon({ status }: ToastIconProps) {\n let iconName = ''\n\n switch (status) {\n case Status.Success:\n iconName = 'check'\n break\n\n case Status.Warn:\n case Status.Danger:\n iconName = 'warning'\n break\n\n default:\n iconName = 'information'\n }\n\n return <Icon name={iconName} size={20} />\n}\n\nexport default Toast\n","export function check(id: string): void {\n const radioElement = document.getElementById(id) as HTMLInputElement\n\n if (radioElement) {\n radioElement.checked = true\n }\n}\n\nexport function getPanelRadioID(id: number | string): string {\n return `rg-wizard-step-radio-${id}`\n}\n","import React from 'react'\n\nconst StepsContext = React.createContext<string | number>('')\n\nexport default StepsContext\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport transition from 'styles/transition'\n\nimport type { Step } from '../Steps.types'\n\nexport interface StepsProgressProps {\n steps: Array<Step>\n current: number | string\n}\n\nconst StepConnector = styled.span<{ complete: boolean }>`\n position: absolute;\n top: ${conditional({\n 'steps-conector-top': whenProps({ complete: false }),\n 'steps-conector-top--complete': whenProps({ complete: true }),\n })};\n right: calc(-50% + ${token('steps-indicator-size')} / 2);\n left: calc(50% + ${token('steps-indicator-size')} / 2);\n\n z-index: 0;\n\n height: ${conditional({\n 'steps-conector-height': whenProps({ complete: false }),\n 'steps-conector-height--complete': whenProps({ complete: true }),\n })};\n\n background: ${conditional({\n 'steps-progress-step-background-color': whenProps({ complete: false }),\n 'steps-progress-step-background-color--complete': whenProps({ complete: true }),\n })};\n`\n\nconst ProgressStepWrapper = styled.li`\n position: relative;\n\n flex: 1;\n\n text-align: center;\n\n list-style: none;\n\n &:last-child ${StepConnector} {\n display: none;\n }\n`\n\nconst ProgressStepContainer = styled.div`\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n padding: 0 ${token('space-s')};\n`\n\nconst StepIndicator = styled.span<{ current: boolean; complete: boolean }>`\n ${transition()}\n\n ${font({\n weight: 'font-weight-bold',\n height: 'steps-indicator-size',\n })}\n\n font-size: ${token('font-size-4')};\n\n height: ${token('steps-indicator-size')};\n width: ${token('steps-indicator-size')};\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n border-width: 2px;\n border-style: solid;\n border-color: ${conditional({\n 'steps-progress-step-background-color--complete': whenProps([\n { current: true, complete: [true, false] },\n { current: false, complete: true },\n ]),\n 'steps-progress-step-background-color': whenProps({ current: false, complete: false }),\n })};\n border-radius: ${token('border-radius-circle')};\n\n background: ${conditional({\n 'steps-progress-step-background-color--complete': whenProps([\n { current: false, complete: true },\n ]),\n 'color-neutral-white': whenProps([\n { current: true, complete: [true, false] },\n { current: false, complete: false },\n ]),\n })};\n\n color: ${conditional({\n 'steps-progress-step-background-color': whenProps({ current: false, complete: false }),\n 'color-neutral-white': whenProps({ current: false, complete: true }),\n 'steps-progress-step-background-color--complete': whenProps({ current: true }),\n })};\n`\n\nconst StepLabel = styled.span<{ current: boolean; complete: boolean }>`\n ${font({\n height: 'font-height-2',\n })}\n\n position: relative;\n\n font-weight: ${conditional({\n 'font-weight-medium': whenProps({ current: false }),\n 'font-weight-bold': whenProps({ current: true }),\n })};\n\n color: ${conditional({\n 'color-neutral-darker': whenProps([{ current: true }, { current: false, complete: true }]),\n 'color-neutral': whenProps({ current: false, complete: false }),\n })};\n\n font-size: ${token('font-size-4')};\n\n display: flex;\n flex-direction: row;\n\n align-items: center;\n justify-content: center;\n\n text-align: center;\n\n margin: ${token('space-xs')} 0 0 0;\n`\n\nfunction ProgressStep(props: { step: Step; current: boolean; indicator: ReactNode }): JSX.Element {\n const { step, current, indicator } = props\n\n return (\n <ProgressStepWrapper>\n <ProgressStepContainer\n data-testid=\"steps-timeline-entry\"\n className={clsx({\n 'is-current': current,\n 'is-complete': step.complete,\n })}\n >\n <StepIndicator aria-hidden=\"true\" current={current} complete={step.complete}>\n {indicator}\n </StepIndicator>\n\n <StepLabel current={current} complete={step.complete}>\n {step.label}\n </StepLabel>\n\n <StepConnector complete={step.complete} />\n </ProgressStepContainer>\n </ProgressStepWrapper>\n )\n}\n\nexport default ProgressStep\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport ProgressStep from './ProgressStep'\n\nimport type { Step } from '../Steps.types'\n\nexport interface StepsProgressProps {\n steps: Array<Step>\n current: number | string\n}\n\nconst ProgressWrapper = styled.ol<{ steps: Step[] }>`\n position: relative;\n\n display: flex;\n flex-direction: row;\n\n padding: ${token('steps-progress-padding-y')} ${token('steps-progress-padding-x')};\n`\n\nfunction StepsProgress(props: StepsProgressProps): JSX.Element {\n const { steps, current } = props\n\n return (\n <ProgressWrapper steps={steps || []}>\n {(steps || []).map(function renderStep(step, index) {\n const { id } = step\n\n return <ProgressStep key={id} current={current === id} indicator={index + 1} step={step} />\n })}\n </ProgressWrapper>\n )\n}\n\nexport default StepsProgress\n","import React, { Fragment, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { getPanelRadioID } from './Steps.helpers'\nimport { getToken as token } from 'theming'\nimport font from 'styles/font'\nimport hidden from 'styles/hidden'\nimport StepsContext from './StepsContext'\n\nexport interface StepsStepProps {\n id: number | string\n className?: string\n}\n\nconst Selector = styled.input`\n ${hidden(true)}\n`\n\nexport const StepWrapper = styled.article`\n ${font({\n weight: 'font-weight-medium',\n height: 'font-height-2',\n })}\n\n padding: 0 ${token('steps-step-padding-x')} ${token('steps-step-padding-y')};\n\n ${Selector} + & {\n display: none;\n }\n\n ${Selector}:checked + & {\n display: block;\n }\n`\n\nfunction StepsStep({ children, id, ...others }: PropsWithChildren<StepsStepProps>): JSX.Element {\n const StepsID = useContext(StepsContext)\n\n return (\n <Fragment>\n <Selector\n type=\"radio\"\n className=\"visually-hidden\"\n id={getPanelRadioID(id)}\n name={String(StepsID)}\n value={id}\n data-testid=\"panel-radio\"\n tabIndex={-1}\n />\n <StepWrapper data-testid=\"steps-step\" {...others} id={String(id)}>\n {children}\n </StepWrapper>\n </Fragment>\n )\n}\n\nexport default StepsStep\n","import React, { useEffect } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { check, getPanelRadioID } from './Steps.helpers'\nimport { getToken as token } from 'theming'\nimport StepsContext from './StepsContext'\nimport StepsProgress from './ProgressSteps'\nimport StepsStep from './StepsStep'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport type { Step } from './Steps.types'\nexport interface StepsProps {\n current: number | string\n id: number | string\n steps: Array<Step>\n className?: string\n scheme?: ColorScheme\n}\n\nconst StepsWrapper = styled.section`\n display: block;\n width: 100%;\n\n color: ${token('steps-color')};\n`\n\n// TODO: improve by extracting steps props right from children.\nfunction Steps({\n id,\n children,\n current,\n steps,\n ...others\n}: PropsWithChildren<StepsProps>): JSX.Element {\n useEffect(\n function showCurrentStep() {\n check(getPanelRadioID(current))\n },\n [current]\n )\n\n return (\n <StepsWrapper id={String(id)} {...others}>\n <StepsProgress current={current} steps={steps} />\n <StepsContext.Provider value={id}>{children}</StepsContext.Provider>\n </StepsWrapper>\n )\n}\n\nSteps.Step = StepsStep\n\nexport default Steps\n","import { useEffect, useReducer, useRef, Dispatch } from 'react'\n\nimport get from 'utils/toolset/get'\nimport type { Step } from './Steps.types'\n\nexport interface useStepsProps {\n steps: Array<Step>\n current?: number | string\n}\n\ntype State = { current: number | string; steps: Array<Step> }\ntype Action =\n | { type: 'navigate'; payload: { stepID: number | string } }\n | { type: 'next' }\n | { type: 'previous' }\n | { type: 'complete'; payload: { stepID: number | string } }\n | { type: 'reset'; payload: State }\n\nfunction useSteps({ steps, current: currentProp }: useStepsProps): [State, Dispatch<Action>] {\n const stepIndexByID = useRef<Record<number | string, number>>({})\n\n useEffect(\n function initStepIndexByIDMap() {\n stepIndexByID.current = {}\n ;(steps || []).forEach((step, index) => {\n stepIndexByID.current[step.id] = index\n })\n },\n [steps]\n )\n\n const [state, dispatch] = useReducer(reducer, init(steps, currentProp))\n\n function reducer(state: State, action: Action): State {\n const { current } = state\n\n // TODO: improve using object to map each case as individual functions\n switch (action.type) {\n case 'previous': {\n const currentIndex = getStepIndex(current)\n\n if (currentIndex == null) {\n return state\n }\n\n const newCurrentIndex = Math.max(currentIndex - 1, 0)\n\n return {\n ...state,\n current: steps[newCurrentIndex]?.id,\n }\n }\n case 'next': {\n const currentIndex = getStepIndex(current)\n\n if (currentIndex == null) {\n return state\n }\n\n const newCurrentIndex = Math.min(currentIndex + 1, steps.length - 1)\n\n return {\n ...state,\n current: steps[newCurrentIndex]?.id,\n }\n }\n case 'navigate': {\n const { stepID } = action.payload\n const currentIndex = getStepIndex(current)\n const stepIndex = getStepIndex(stepID)\n const step = get(steps, stepIndex)\n\n if (!step) {\n return state\n }\n\n return {\n ...state,\n current: steps[stepIndex]?.id || steps[currentIndex]?.id,\n }\n }\n case 'complete': {\n const { stepID } = action.payload\n const { steps } = state\n\n const stepIndex = getStepIndex(stepID)\n const step = get(steps, stepIndex)\n\n if (!step) {\n return state\n }\n\n return {\n ...state,\n steps: [\n ...steps.slice(0, stepIndex),\n { ...step, complete: true },\n ...steps.slice(stepIndex + 1),\n ],\n }\n }\n case 'reset': {\n const { steps, current } = action.payload\n\n return {\n ...state,\n ...init(steps, current),\n }\n }\n default:\n return state\n }\n }\n\n // TODO: gather step info to feed Steps component\n function init(steps: Array<Step>, current?: number | string): State {\n return {\n current: current || get(steps, '0.id')!,\n steps,\n }\n }\n\n function getStepIndex(stepID: number | string): number {\n return stepIndexByID.current[stepID]\n }\n\n // TODO: write helper functions to abstract inner dispatch mechanism\n return [state, dispatch]\n}\n\nexport default useSteps\n","import React, { ReactNode, HTMLAttributes } from 'react'\n\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\n\nexport interface CardTitleProps extends HTMLAttributes<HTMLElement> {\n leading?: ReactNode\n}\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Leading = styled(StyledSpan)`\n margin-right: ${token('space-xs')};\n`\n\nconst Wrapper = styled.div`\n padding: ${token('card-padding-y')} ${token('card-padding-x')} 0;\n\n color: ${token('card-color')};\n font-weight: ${token('card-title-font-weight')};\n font-size: ${token('card-title-font-size')};\n line-height: ${token('card-title-font-height')};\n`\n\nfunction CardTitle({ children, leading, ...others }: CardTitleProps): JSX.Element {\n return (\n <Wrapper {...others}>\n {leading && <Leading>{leading}</Leading>}\n {children}\n </Wrapper>\n )\n}\n\nexport { Wrapper as CardTitleWrapper }\n\nexport default CardTitle\n","import React, { HTMLAttributes, ReactNode } from 'react'\n\nimport { getToken as token } from 'theming'\nimport CardTitle, { CardTitleWrapper } from './CardTitle'\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport Status from 'utils/types/Status'\nimport styled, { css } from 'styled-components'\n\nexport interface CardProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode\n status?: Status\n flagged?: boolean\n}\n\nconst CardSubtitle = styled.div`\n padding: 0 ${token('card-padding-x')} ${token('card-padding-y')};\n\n color: ${token('card-color')};\n font-weight: ${token('card-subtitle-font-weight')};\n font-size: ${token('card-subtitle-font-size')};\n`\n\nconst CardSeparator = styled.hr`\n display: block;\n height: 1px;\n margin: 0;\n\n border: 0;\n border-bottom: 1px solid ${token('card-separator-background')};\n`\n\nconst CardBody = styled.div`\n padding: ${token('card-padding-y')} ${token('card-padding-x')};\n`\n\nconst Wrapper = styled.div`\n ${font({})}\n\n display: flex;\n flex-direction: row;\n\n color: ${token('card-color')};\n\n ${CardTitleWrapper} + ${CardSubtitle} {\n margin-top: ${token('space-xs')};\n }\n\n ${CardTitleWrapper} + ${CardSeparator} {\n margin-top: ${token('card-padding-y')};\n }\n\n border: 1px solid ${token('card-border-color')};\n border-radius: ${token('card-border-radius')};\n background: ${token('card-background')};\n`\n\nconst Container = styled.div<{ flagged: boolean }>`\n display: flex;\n flex: 1;\n flex-direction: column;\n\n line-height: ${token('card-font-height')};\n\n ${({ flagged }) =>\n flagged &&\n css`\n ${CardSeparator} {\n margin-left: calc(-1 * ${token('space-s')});\n }\n `}\n`\n\nconst Flag = styled.span<{ status: Status }>`\n display: block;\n flex: 0 0 ${token('card-flag-width')};\n\n background: ${conditional({\n 'card-flag-background-neutral': whenProps({ status: Status.Neutral }),\n 'card-flag-background-danger': whenProps({ status: Status.Danger }),\n 'card-flag-background-warning': whenProps({ status: Status.Warn }),\n 'card-flag-background-success': whenProps({ status: Status.Success }),\n })};\n border-radius: ${token('card-border-radius')} 0 0 ${token('card-border-radius')};\n`\n\nfunction Card({\n flagged = false,\n status = Status.Neutral,\n children,\n ...others\n}: CardProps): JSX.Element {\n return (\n <Wrapper {...others}>\n {flagged && <Flag status={status} aria-label={status} />}\n <Container flagged={flagged}>{children}</Container>\n </Wrapper>\n )\n}\n\nCard.Title = CardTitle\nCard.Subtitle = CardSubtitle\nCard.Separator = CardSeparator\nCard.Body = CardBody\n\nexport default Card\n","import { createContext } from 'react'\nimport type { DropdownContextReturn } from './Dropdown.types'\n\nconst DropdownContext = createContext<DropdownContextReturn>({\n disabled: false,\n expandDisabled: false,\n expanded: false,\n toggle: function () {\n // nothing\n },\n})\n\nexport default DropdownContext\n","import React, { forwardRef, useContext } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Popover } from 'components/Popover'\nimport disableable from 'styles/disableable'\nimport DropdownContext from './Dropdown.context'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport useID from 'hooks/useID'\n\nimport type {\n DropdownMenuItemProps,\n DropdownMenuProps,\n DropdownMenuSectionProps,\n} from './Dropdown.types'\n\n/**\n * TODO: add aria-labelledby that should refer to the dropdown label to the role=\"menu\" container.\n * TODO: navigate through items using arrow keys.\n * TODO: add animation for a smooth open/close effect.\n */\n\nconst StyledPopover = styled(Popover.Floating)`\n z-index: ${token('z-index-droplist')};\n\n min-width: 10em;\n\n background: ${token('dropdown-background')};\n border: 1px solid ${token('dropdown-border-color')};\n border-radius: ${token('dropdown-border-radius')};\n box-shadow: ${token('dropdown-shadow')};\n width: max-content;\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n font-size: 1em;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Trailing = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Children = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n padding: ${token('space-s')} 0;\n\n white-space: nowrap;\n`\n\nconst DropdownItemWrapper = styled.button`\n ${transition()}\n\n display: inline-flex;\n justify-content: flex-start;\n align-items: center;\n\n ${font({\n height: 'font-height-3',\n weight: 'font-weight-medium',\n })}\n font-size: ${token('font-size-4')};\n\n min-height: 36px;\n flex: 1 0;\n\n border: none;\n border-radius: ${token('border-radius-s')};\n background: ${token('color-neutral-white')};\n\n color: ${token('color-neutral-darker')};\n\n padding: 0 ${token('space-s')};\n\n margin: 0 ${token('space-s')};\n\n cursor: pointer;\n\n ${hoverable`\n background: ${token('color-neutral-lighter')};\n `}\n\n ${focusable`\n background: ${token('color-neutral-lighter')};\n `}\n\n ${disableable()}\n\n ${Children} {\n flex: 1 0 auto;\n\n text-align: left;\n }\n\n ${Leading}, ${Trailing} {\n flex: 0 1 auto;\n }\n\n ${Leading} + ${Children} {\n margin: 0 0 0 ${token('space-s')};\n }\n\n ${Children} + ${Trailing} {\n margin: 0 0 0 ${token('space-s')};\n }\n`\n\nconst DropdownSectionHeader = styled.strong`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n ${font({\n height: 'font-height-3',\n weight: 'font-weight-bold',\n })}\n\n font-size: ${token('font-size-4')};\n\n margin: 0 ${token('space-s')};\n`\n\nconst DropdownSectionWrapper = styled.div`\n display: flex;\n flex-direction: column;\n`\n\nconst GenericDropdownMenuWrapper = styled.div`\n display: flex;\n flex-direction: column;\n padding: ${token('space-s')} 0;\n\n ${font({\n height: 'font-height-3',\n weight: 'font-weight-medium',\n })}\n\n font-size: ${token('font-size-4')};\n`\n\nconst DropdownMenuWrapper = styled(GenericDropdownMenuWrapper)`\n max-height: 240px;\n overflow-y: auto;\n max-width: 100%;\n width: 100%;\n\n ${DropdownItemWrapper} + ${DropdownItemWrapper},\n ${DropdownSectionHeader} + ${DropdownItemWrapper} {\n margin-top: ${token('space-2xs')};\n }\n\n ${DropdownSectionWrapper} + ${DropdownSectionWrapper} {\n margin: ${token('space-m')} 0 0 0;\n }\n\n ${GenericDropdownMenuWrapper} + &,\n & + ${GenericDropdownMenuWrapper},\n ${GenericDropdownMenuWrapper} + ${GenericDropdownMenuWrapper} {\n border-top: 2px solid ${token('color-neutral-lighter')};\n }\n`\n\nexport const DropdownSeparator = styled.hr.attrs({\n 'aria-hidden': true,\n})`\n display: block;\n height: 2px;\n\n margin: ${token('space-s')} 0;\n\n border: 0;\n border-bottom: 2px solid ${token('card-separator-background')};\n`\n\nexport const DropdownMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(function DropdownMenu(\n props: DropdownMenuProps,\n ref\n): JSX.Element | null {\n const context = useContext(DropdownContext)\n\n if (!context) {\n throw new Error('DropdownMenu must be inside a DropdownContext')\n }\n\n const { children, header, footer, ...others } = props\n const { expanded } = context\n\n if (!expanded) {\n return null\n }\n\n return (\n <StyledPopover role=\"presentation\">\n {header && <GenericDropdownMenuWrapper>{header}</GenericDropdownMenuWrapper>}\n {children && (\n <DropdownMenuWrapper ref={ref} role=\"menu\" data-testid=\"dropdown-menu\" {...others}>\n {children}\n </DropdownMenuWrapper>\n )}\n {footer && <GenericDropdownMenuWrapper>{footer}</GenericDropdownMenuWrapper>}\n </StyledPopover>\n )\n})\n\nexport function DropdownMenuItem(props: DropdownMenuItemProps): JSX.Element {\n const context = useContext(DropdownContext)\n const { leading, children, trailing, onClick, ...others } = props\n const id = useID(others.id)\n\n if (!context) {\n throw new Error('DropdownMenuItem must be inside a DropdownContext')\n }\n\n const { toggle } = context\n\n return (\n <DropdownItemWrapper\n role=\"menuitem\"\n type=\"button\"\n data-testid=\"dropdown-menu-item\"\n {...others}\n aria-labelledby={id}\n onClick={(e) => {\n e.persist()\n\n const shouldKeepOpen = onClick?.(e)\n\n if (!shouldKeepOpen) {\n toggle()\n }\n }}\n >\n {leading && <Leading>{leading}</Leading>}\n <Children id={id}>{children}</Children>\n {trailing && <Trailing>{trailing}</Trailing>}\n </DropdownItemWrapper>\n )\n}\n\nexport function DropdownMenuSection(props: DropdownMenuSectionProps): JSX.Element {\n const { children, header, ...others } = props\n\n return (\n <DropdownSectionWrapper data-testid=\"dropdown-menu-section\" {...others} role=\"presentation\">\n <DropdownSectionHeader>{header}</DropdownSectionHeader>\n {children}\n </DropdownSectionWrapper>\n )\n}\n","import toArray from './toArray'\n\nimport type { KeyboardEvent } from 'react'\n\n// this is merely a helper for key code names\nconst SUPPORTED_KEYS = {\n ALT: 'Alt',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_UP: 'ArrowUp',\n CONTROL: 'Control',\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n SHIFT: 'Shift',\n SPACE: ' ',\n TAB: 'Tab',\n E_LOWERCASE: 'e',\n DOT: '.',\n PLUS: '+',\n MINUS: '-',\n}\n\nexport type SupportedKey = keyof typeof SUPPORTED_KEYS\n\n// Based on https://github.com/downshift-js/downshift/blob/26c93a539dad09e41adba69ddc3a7d7ecccfc8bb/src/utils.js#L285\nexport function getKeyboardKey(e: KeyboardEvent): KeyboardEvent['key'] {\n // IE\n if (e.keyCode >= 37 && e.keyCode <= 40 && e.key.indexOf('Arrow') !== 0) {\n return `Arrow${e.key}`\n }\n\n return e.key\n}\n\nfunction KeyboardKey(e: KeyboardEvent): {\n is(otherKeys: SupportedKey | SupportedKey[]): boolean\n} {\n const key = getKeyboardKey(e)\n\n return {\n is(otherKeys: SupportedKey | SupportedKey[]) {\n const expectedKeys = toArray(otherKeys).map((otherKey) => SUPPORTED_KEYS[otherKey])\n\n return toArray(expectedKeys).includes(key)\n },\n }\n}\n\nexport default KeyboardKey\n","import React, { useCallback, useEffect, useState } from 'react'\n\nimport KeyboardKey from 'utils/toolset/keyboard'\n\nimport type { RefObject } from 'react'\n\nfunction useClickOutside<T extends HTMLElement>(\n container: RefObject<T>,\n callback: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void,\n disabled = false\n): void {\n const [active, setActive] = useState(false)\n\n const getContainer = useCallback(\n function getContainer() {\n return container.current\n },\n [container]\n )\n\n const handleEvent = useCallback(\n function handleEvent(event: MouseEvent | TouchEvent | KeyboardEvent) {\n function hasPressedEsc() {\n return KeyboardKey(event as unknown as React.KeyboardEvent).is('ESCAPE')\n }\n\n if (!getContainer() || disabled) {\n return\n }\n\n const target = event.target as Node\n const hasTarget = getContainer()?.contains(target)\n\n if (!active && hasTarget) {\n setActive(true)\n } else if (active && (!hasTarget || hasPressedEsc())) {\n setActive(false)\n callback(event)\n }\n },\n [active, callback, disabled, getContainer]\n )\n\n useEffect(() => {\n function subscribe() {\n document.addEventListener('mousedown', handleEvent, true)\n document.addEventListener('touchend', handleEvent, true)\n document.addEventListener('keyup', handleEvent)\n }\n\n function unsubscribe() {\n document.removeEventListener('mousedown', handleEvent, true)\n document.removeEventListener('touchend', handleEvent, true)\n document.removeEventListener('keyup', handleEvent)\n }\n\n subscribe()\n\n return () => {\n unsubscribe()\n }\n }, [handleEvent])\n}\n\nexport default useClickOutside\n","import React, { useContext } from 'react'\nimport clsx from 'clsx'\nimport styled, { css } from 'styled-components'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport { BaseButton, SelectorButton, ButtonProps } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Icon as DefaultIcon } from 'components/Icon'\nimport { useFocusWithin } from 'hooks/useFocusWithin'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport DropdownContext from './Dropdown.context'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport typography from 'styles/typography'\n\nimport type { ButtonHTMLAttributes, HTMLAttributes, MouseEvent } from 'react'\nimport type { DropdownTriggerProps, DropdownContextReturn } from './Dropdown.types'\nimport type { IconProps } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport { Popover } from 'components/Popover'\n\n/**\n * TODO: throw an error if context is not available\n */\n\ntype DropdownTriggerWrapperProps = {\n disabled: boolean\n scheme: ColorScheme\n $outlined: boolean\n $scale: DropdownTriggerProps['scale']\n}\n\ntype TriggerButtonProps = ButtonProps & {\n outlined: boolean\n}\n\nconst dropdownExpandedStyle = css`\n &[aria-expanded='true'] {\n color: ${token('dropdown-trigger-expanded-color')};\n }\n`\n\nconst triggerButtonAttrs = (props: { outlined: boolean }) => {\n const outlined = typeof props.outlined === 'boolean' ? props.outlined : true\n if (outlined) {\n return props\n }\n\n return {\n ...props,\n variant: 'tertiary',\n }\n}\n\nconst TriggerButton = styled(\n SelectorButton as React.ForwardRefExoticComponent<TriggerButtonProps>\n).attrs(triggerButtonAttrs)`\n flex: 1;\n\n justify-content: flex-start;\n\n border: none;\n\n height: ${token('dropdown-trigger-height')};\n\n text-transform: ${conditional({\n capitalize: whenProps({ outlined: false, variant: 'tertiary' }),\n uppercase: whenProps({ outlined: true }),\n })};\n\n font-weight: ${conditional({\n 'font-weight-regular': whenProps({ outlined: false }),\n })};\n\n ${hoverable`\n border-color: ${conditional({\n 'color-transparent': whenProps({ outlined: false }),\n })};\n\n font-weight: ${conditional({\n 'font-weight-bold': whenProps({ outlined: false }),\n })};\n\n ${dropdownExpandedStyle}\n `}\n\n ${focusable`\n box-shadow: ${conditional({\n none: whenProps({ outlined: false }),\n })};\n\n background-color: ${conditional({\n 'color-transparent': whenProps({ outlined: false }),\n })};\n\n font-weight: ${conditional({\n 'font-weight-bold': whenProps({ outlined: false }),\n })};\n\n\n ${dropdownExpandedStyle}\n `}\n\n ${({ children, outlined }) => {\n if (outlined === false && typeof children === 'string') {\n return css`\n & > span:first-child {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n\n text-decoration: none;\n }\n\n & > span:first-child::after {\n height: 0;\n overflow: hidden;\n\n font-weight: ${token('font-weight-bold')};\n\n visibility: hidden;\n\n /* @REVIEW: since this is a span descendant of a button\n I'm using the direct value of children the solution inside Link\n relies on data-text attribute */\n\n content: '${children}';\n content: '${children}' / '';\n user-select: none;\n pointer-events: none;\n\n @media speech {\n display: none;\n }\n }\n `\n }\n }}\n`\n\nconst DropdownTriggerWrapper = styled.div<DropdownTriggerWrapperProps>`\n ${transition()}\n\n ${typography(\n conditional({\n 'button-md': whenProps({ $scale: 'default' }),\n 'button-sm': whenProps({ $scale: 'small' }),\n 'button-lg': whenProps({ $scale: 'large' }),\n })\n )}\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n border-radius: ${token('button-border-radius')};\n border-width: ${token('button-border-width')};\n border-style: solid;\n border-color: ${conditional({\n 'dropdown-trigger-border-color': whenProps({ scheme: 'light', $outlined: true }),\n 'dropdown-trigger-dark-border-color': whenProps({ scheme: 'dark', $outlined: true }),\n 'dropdown-trigger-outlined-border-color': whenProps({ $outlined: false }),\n })};\n\n font-size: ${token('font-size-4')};\n\n color: ${token('color-neutral-darker')};\n\n box-sizing: border-box;\n\n flex: 1;\n\n ${hoverable`\n border-color: ${conditional({\n 'button-secondary-border-color--hover': whenProps({ scheme: 'light', $outlined: true }),\n 'button-secondary-dark-border-color--hover': whenProps({\n scheme: 'dark',\n $outlined: true,\n }),\n })};\n `}\n\n ${disableable`\n border-color: ${conditional({\n 'button-secondary-border-color--disabled': whenProps({ scheme: 'light' }),\n 'button-secondary-dark-border-color--disabled': whenProps({\n scheme: 'dark',\n }),\n })};\n `}\n\n ${focusable`\n border-color: ${conditional({\n 'button-primary-border-color--focus': whenProps({ variant: 'primary', $outlined: true }),\n 'button-secondary-border-color--focus': whenProps({ scheme: 'light', $outlined: true }),\n 'button-secondary-dark-border-color--focus': whenProps({\n scheme: 'dark',\n $outlined: true,\n }),\n 'button-warning-border-color--focus': whenProps({ variant: 'warning', $outlined: true }),\n 'button-icon-border-color--focus': whenProps({ variant: 'icon', $outlined: true }),\n 'color-transparent': whenProps({ $outlined: false }),\n })};\n\n box-shadow: ${conditional({ 'dropdown-trigger-box-shadow': whenProps({ $outlined: true }) })};\n outline: ${token('dropdown-trigger-outline')};\n outline-offset: ${token('dropdown-trigger-outline-offset')};\n `}\n\n ${activatable`\n border-color: ${conditional({\n 'button-secondary-border-color--active': whenProps({ scheme: 'light', $outlined: true }),\n 'button-secondary-dark-border-color--active': whenProps({\n scheme: 'dark',\n $outlined: true,\n }),\n })};\n `}\n`\n\nconst TriggerHandle = styled(BaseButton)`\n ${focusable()}\n\n background: ${token('color-transparent')};\n border-radius: 0 ${token('border-radius-s')} ${token('border-radius-s')} 0;\n border: none;\n\n height: ${token('dropdown-trigger-height')};\n`\n\nconst RotatableIcon = styled(DefaultIcon)<{ $rotate: boolean }>`\n ${conditional({\n 'transform: rotate(180deg);': whenProps({ $rotate: true }),\n })}\n`\n\nexport interface DropdownTriggerButtonProps extends DropdownTriggerProps {\n children: DropdownTriggerProps['children'] | ((args: DropdownContextReturn) => React.ReactNode)\n}\n\nfunction Caret(props: Omit<IconProps, 'name'> & { $rotate: boolean }) {\n return <RotatableIcon size={20} {...props} name=\"chevron-down\" />\n}\n\nfunction DropdownTriggerButton(props: DropdownTriggerButtonProps): JSX.Element {\n const contextValue = useContext(DropdownContext)\n const { toggle, disabled, expanded } = contextValue\n const { children, onClick, ...others } = props\n\n function handleClick(e: MouseEvent<HTMLButtonElement>) {\n e.persist()\n\n toggle()\n onClick?.(e)\n }\n\n function renderChildren() {\n if (isFunction(children)) {\n return children(contextValue)\n }\n\n return children\n }\n\n // TODO: add aria-labelledby that should refer to the button and the dropdown label\n return (\n <TriggerButton\n trailing={<Caret $rotate={expanded} />}\n onClick={handleClick}\n {...others}\n type=\"button\"\n aria-haspopup=\"true\"\n aria-expanded={expanded}\n aria-disabled={disabled}\n disabled={disabled}\n >\n {renderChildren()}\n </TriggerButton>\n )\n}\n\nfunction DropdownTriggerHandle(props: ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element {\n const { toggle, expanded, disabled, expandDisabled } = useContext(DropdownContext)\n const { onClick, ...others } = props\n\n function handleClick(e: MouseEvent<HTMLButtonElement>) {\n e.persist()\n\n toggle()\n onClick?.(e)\n }\n\n return (\n <TriggerHandle\n onClick={handleClick}\n data-testid=\"dropdown-trigger-handle\"\n {...others}\n disabled={disabled || expandDisabled}\n type=\"button\"\n tabIndex={-1}\n >\n <Caret $rotate={expanded} />\n </TriggerHandle>\n )\n}\n\nexport interface GenericDropdownTriggerProps extends HTMLAttributes<HTMLDivElement> {\n disabled?: boolean\n scheme?: ColorScheme\n outlined?: boolean\n scale?: DropdownTriggerProps['scale']\n}\n\nexport function GenericDropdownTrigger(props: GenericDropdownTriggerProps): JSX.Element {\n const context = useContext(DropdownContext)\n const { ref, focused } = useFocusWithin<HTMLDivElement>()\n\n if (!context) {\n throw new Error('DropdownTrigger must be inside a DropdownContext')\n }\n\n const { children, className, scheme = 'light', outlined = true, scale, ...others } = props\n const { disabled } = context\n\n return (\n <DropdownTriggerWrapper\n role=\"presentation\"\n {...others}\n ref={ref}\n className={clsx(\n {\n 'is-disabled': disabled,\n 'is-focused': focused,\n },\n className\n )}\n disabled={disabled}\n scheme={scheme}\n $scale={scale}\n $outlined={outlined}\n >\n {children}\n </DropdownTriggerWrapper>\n )\n}\n\nfunction DropdownTrigger(props: DropdownTriggerProps): JSX.Element {\n const { children, className, ...others } = props\n\n return (\n <Popover.Reference>\n <GenericDropdownTrigger className={className} outlined={props.outlined} scale={props.scale}>\n <DropdownTriggerButton {...others} data-text={children}>\n {children}\n </DropdownTriggerButton>\n </GenericDropdownTrigger>\n </Popover.Reference>\n )\n}\n\nDropdownTrigger.Button = DropdownTriggerButton\nDropdownTrigger.Handle = DropdownTriggerHandle\n\nexport default DropdownTrigger\n","import { useCallback, useEffect, useState } from 'react'\n\nimport type { DropdownProps } from './Dropdown.types'\n\nexport interface useDropdownProps {\n expanded: boolean\n toggle: () => void\n}\n\nexport interface GenericDropdownProps extends DropdownProps, useDropdownProps {}\n\nfunction useDropdown({ disabled, expandDisabled }: DropdownProps): {\n expanded: boolean\n toggle: () => void\n expand: () => void\n collapse: () => void\n} {\n const [expanded, setExpanded] = useState(false)\n\n const toggle = useCallback(\n function toggle() {\n if (disabled || expandDisabled) {\n return\n }\n\n setExpanded((isExpanded) => !isExpanded)\n },\n [disabled, expandDisabled]\n )\n\n const expand = useCallback(\n function toggle() {\n if (disabled || expandDisabled) {\n return\n }\n\n setExpanded(true)\n },\n [disabled, expandDisabled]\n )\n\n const collapse = useCallback(\n function toggle() {\n if (disabled || expandDisabled) {\n return\n }\n\n setExpanded(false)\n },\n [disabled, expandDisabled]\n )\n\n useEffect(\n function closeWhenDisabled() {\n if ((disabled || expandDisabled) && expanded) {\n setExpanded(false)\n }\n },\n [disabled, expandDisabled, expanded]\n )\n\n return { expanded, toggle, expand, collapse }\n}\n\nexport default useDropdown\n","import React, { useMemo, useRef } from 'react'\nimport styled from 'styled-components'\n\nimport {\n DropdownMenu,\n DropdownMenuItem,\n DropdownMenuSection,\n DropdownSeparator,\n} from './DropdownMenu'\nimport { useClickOutside } from 'hooks/useClickOutside'\nimport DropdownContext from './Dropdown.context'\nimport DropdownTrigger from './DropdownTrigger'\nimport hidden from 'styles/hidden'\nimport useDropdown from './useDropdown'\nimport { Popover } from 'components/Popover'\n\nimport type { DropdownProps, GenericDropdownProps, DropdownMenuProps } from './Dropdown.types'\nimport type { PopoverAlign } from 'components/Popover'\n\nconst DropdownWrapper = styled.div`\n position: relative;\n`\n\nconst HiddenCloseButton = styled.button.attrs({\n type: 'button',\n tabIndex: -1,\n})`\n ${hidden(true)}\n`\n\nfunction useDeprecatedAlignFromMenu({\n children,\n align,\n}: React.PropsWithChildren<{ align?: PopoverAlign }>): PopoverAlign {\n let result: PopoverAlign | undefined\n\n if (align) {\n return align\n }\n\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<DropdownMenuProps>(child) && child.type === DropdownMenu) {\n result = child.props.align\n }\n })\n\n return (result || align) as PopoverAlign\n}\n\n// TODO: add focus trap here to allow navigating options with keyboard\n\n/**\n * Generic dropdown component that allows composing its pieces as desired.\n *\n * Based on:\n * - https://www.w3.org/TR/2017/REC-wai-aria-1.1-20171214/#menu\n * - https://www.w3.org/WAI/tutorials/menus/application-menus/\n *\n * @param props\n * @returns\n */\nexport function GenericDropdown(props: GenericDropdownProps): JSX.Element {\n const {\n children,\n expanded,\n toggle,\n disabled = false,\n expandDisabled = false,\n onBlur,\n position,\n ...others\n } = props\n const contextValue = useMemo(\n () => ({ expanded, toggle, disabled, expandDisabled }),\n [expanded, toggle, disabled, expandDisabled]\n )\n const ref = useRef(null)\n\n const align = useDeprecatedAlignFromMenu(props)\n\n useClickOutside(\n ref,\n function handleClickOutside(event?: MouseEvent | TouchEvent | KeyboardEvent) {\n onBlur?.(event)\n\n if (!expanded) {\n return\n }\n\n toggle()\n }\n )\n\n return (\n <DropdownWrapper {...others} role=\"menubar\" ref={ref}>\n <DropdownContext.Provider value={contextValue}>\n <HiddenCloseButton disabled={disabled} onClick={toggle}>\n Close\n </HiddenCloseButton>\n <Popover strategy=\"fixed\" position={position} align={align}>\n {children}\n </Popover>\n </DropdownContext.Provider>\n </DropdownWrapper>\n )\n}\n\n/**\n * @example\n <Dropdown>\n <Dropdown.Trigger>Download</Dropdown.Trigger>\n <Dropdown.Menu\n header={<p className=\"px-2\">Header</p>}\n footer={<p className=\"px-2\">A cool footer</p>}\n >\n {[{label: 'Hello', value: 'hi'}, { label: 'World', value: 'planet' }].map(({ label, value }) => (\n <Dropdown.Item\n key={value}\n onClick={() => {\n setMessage(label)\n }}\n >\n {label}\n </Dropdown.Item>\n ))}\n </Dropdown.Menu>\n </Dropdown>\n */\nfunction Dropdown(props: DropdownProps): JSX.Element {\n const dropdownProps = useDropdown(props)\n\n return <GenericDropdown {...props} {...dropdownProps} />\n}\n\nDropdown.Trigger = DropdownTrigger\nDropdown.Menu = DropdownMenu\nDropdown.Section = DropdownMenuSection\nDropdown.Item = DropdownMenuItem\nDropdown.Separator = DropdownSeparator\n\nexport default Dropdown\n","import { createContext } from 'react'\nimport { createSelectable } from 'hooks/useSelectable'\n\nimport type { Option, useSelectReturn } from './Select.types'\n\nconst { SelectableContext, useSelectable } = createSelectable<Option>()\n\nexport { SelectableContext, useSelectable }\n\nconst SelectContext = createContext<useSelectReturn | null>(null)\nexport { SelectContext }\n","/**\n * Helper that returns the plural form if count is different than 1, otherwise the singular one.\n * @example\n * let total = 3\n * `Item${pluralize(total)}` // \"Items\"\n * `Child${pluralize(total, 'ren')}` // \"Children\"\n * `Pe${pluralize(total, 'ople', 'rson')}` // \"People\"\n * `${pluralize(total, 'People', 'Person')}` // \"People\"\n * @param count - total of items\n * @param plural - defaults to \"s\"\n * @param singular - defaults to \"\"\n * @returns plural or singular.\n */\nexport default function pluralize(count: number, plural = 's', singular = ''): string {\n return count !== 1 ? plural : singular\n}\n","import React, { useContext, forwardRef } from 'react'\nimport styled from 'styled-components'\n\nimport { DropdownContext, DropdownTrigger, GenericDropdownTrigger } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { TextField, Trailing } from 'components/TextField'\nimport focusable from 'styles/focusable'\n\nimport type { SelectTriggerProps } from './Select.types'\nimport { isFunction } from '@loadsmart/utils-function'\nimport { usePopover } from 'components/Popover'\n\nconst GenericSelectTrigger = styled(GenericDropdownTrigger)`\n background: ${token('color-neutral-white')};\n`\n\nconst SelectTriggerSearchField = styled(TextField)`\n ${focusable`\n box-shadow: none;\n `}\n\n background-color: transparent;\n\n border: none;\n border-radius: ${token('border-radius-s')} 0 0 ${token('border-radius-s')};\n\n height: ${token('select-trigger-height')};\n\n flex: 1;\n\n ${Trailing} {\n margin: 0 ${token('space-xs')} 0 0;\n }\n`\n\nconst Separator = styled.span`\n height: 100%;\n\n margin: 0;\n\n border-right-color: ${token('color-neutral-light')};\n border-right-width: 1px;\n border-right-style: solid;\n`\n\nconst SelectTrigger = forwardRef<HTMLInputElement, SelectTriggerProps>(function SelectTrigger(\n props: SelectTriggerProps,\n ref\n) {\n const { className, ...others } = props\n const { disabled, expanded, toggle } = useContext(DropdownContext)\n\n const { register } = usePopover()\n\n function handleClick() {\n if (!expanded) {\n toggle()\n }\n }\n\n return (\n <GenericSelectTrigger className={className}>\n <SelectTriggerSearchField\n {...others}\n data-testid=\"select-trigger-search-field\"\n ref={(node) => {\n if (isFunction(ref)) {\n ref(node)\n }\n\n register.setReference(node)\n }}\n type=\"search\"\n disabled={disabled}\n onClick={handleClick}\n />\n <Separator />\n <DropdownTrigger.Handle data-testid=\"select-trigger-handle\" />\n </GenericSelectTrigger>\n )\n})\n\nexport default SelectTrigger\n","import React, { useCallback, useEffect, useRef, useState } from 'react'\n\nimport KeyboardKey, { getKeyboardKey } from 'utils/toolset/keyboard'\nimport isEmpty from 'utils/toolset/isEmpty'\n\nimport type { SupportedKey } from 'utils/toolset/keyboard'\n\nexport interface useFocusTrapProps {\n onActivate?: () => void\n onDeactivate?: () => void\n keys?: SupportedKey[]\n}\n\nfunction getFocusedIndexAfterKeyPress(\n e: React.KeyboardEvent,\n currentFocused: number,\n focusableCounter: number\n): number {\n const keyHandler: Record<React.KeyboardEvent['key'], (e: React.KeyboardEvent) => number> = {\n Tab(e: React.KeyboardEvent): number {\n return e.shiftKey ? -1 : 1\n },\n ArrowUp() {\n return -1\n },\n ArrowDown() {\n return 1\n },\n }\n\n function unknownKey() {\n return 0\n }\n\n const key = getKeyboardKey(e)\n const increment = (keyHandler[key] || unknownKey)(e)\n\n if (currentFocused === -1 && increment === -1) {\n /**\n * Prevent to skip one element when the initial increment is -1\n * and `currentFocused` is -1, we don't .\n * e.g.: focus has just been activated and user presses arrow up.\n */\n return (increment + focusableCounter) % focusableCounter\n }\n\n return (currentFocused + increment + focusableCounter) % focusableCounter\n}\n\nfunction getTabbableDescendants<T extends HTMLElement>(container: T | null) {\n if (container == null) {\n return []\n }\n\n // TODO: add support for other focusable elements\n return Array.from(container.querySelectorAll('button') || [])\n}\n\n/**\n * Custom hook that limits the focusable elements within a container, when activated.\n *\n * Based on https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets.\n *\n * @param {useFocusTrapProps} props\n * @param {RefObject} props.containerRef - Ref to the container that will be the boundary for the focus trap.\n * @param {() => void} props.onActivate - Called when the focus trap is activated.\n * @param {() => void} props.onDeactivate - Called when the focus trap is deactivated.\n * @param {(KeyboardEvent['key'])[]} props.keys - Keys that will move the focus inside\n * the container (The current implementation only track focus for button elements). We current\n * support `Tab`, `ArrowUp`, and `ArrowDown` keys. If not provided, only the `Tab` key will be used.\n * @returns {Object}\n */\nfunction useFocusTrap<T extends HTMLElement>(\n props: useFocusTrapProps\n): {\n containerRef: (container: T | null) => void\n active: boolean\n activate: () => void\n deactivate: () => void\n} {\n const { keys, onActivate, onDeactivate } = props\n\n const [active, setActive] = useState(false)\n const [currentFocused, setCurrentFocused] = useState(-1)\n const mutationObserverRef = useRef<MutationObserver>()\n const [focusableDescendants, setFocusableDescendants] = useState<HTMLElement[]>([])\n\n function subscribeToDOMMutationEvents(container: HTMLElement) {\n mutationObserverRef.current = new MutationObserver(function () {\n setFocusableDescendants(getTabbableDescendants(container))\n })\n\n mutationObserverRef.current.observe(container, { childList: true })\n }\n\n function unsubscribeToDOMMutationEvents() {\n setCurrentFocused(-1)\n if (mutationObserverRef.current) {\n mutationObserverRef.current?.disconnect()\n }\n }\n\n const containerRef = useCallback(function initialize(container: HTMLElement | null) {\n if (container != null) {\n setFocusableDescendants(getTabbableDescendants(container))\n subscribeToDOMMutationEvents(container)\n } else {\n unsubscribeToDOMMutationEvents()\n }\n }, [])\n\n useEffect(function onMount() {\n return function onUnmount() {\n unsubscribeToDOMMutationEvents()\n }\n }, [])\n\n useEffect(\n function subscribeToKeyEvents() {\n function handleKeyDownEvent(evt: KeyboardEvent) {\n /**\n * Brace yourselves for the nasty casting from globalThis.KeyboardEvent, which is\n * the type used in the `addEventListener` callback, to React.KeyboardEvent ¯\\_(ツ)_/¯\n */\n const e = evt as unknown as React.KeyboardEvent\n\n const supportedKeys = [...(keys || ['TAB'])]\n\n if (!KeyboardKey(e).is(supportedKeys) || isEmpty(focusableDescendants)) {\n return\n }\n\n e.preventDefault()\n\n const newCurrentFocused = getFocusedIndexAfterKeyPress(\n e,\n currentFocused,\n focusableDescendants.length\n )\n setCurrentFocused(newCurrentFocused)\n focusableDescendants[newCurrentFocused].focus()\n }\n\n function subscribe() {\n document.addEventListener('keydown', handleKeyDownEvent)\n }\n\n function unsubscribe() {\n document.removeEventListener('keydown', handleKeyDownEvent)\n }\n\n if (active) {\n subscribe()\n }\n\n return function unsubscribeToKeyEvents() {\n unsubscribe()\n }\n },\n [active, keys, currentFocused, focusableDescendants]\n )\n\n const activate = useCallback(\n function activate() {\n setActive(true)\n onActivate?.()\n },\n [onActivate]\n )\n\n const deactivate = useCallback(\n function deactivate() {\n setActive(false)\n onDeactivate?.()\n },\n [onDeactivate]\n )\n\n return {\n containerRef,\n active,\n activate,\n deactivate,\n }\n}\n\nexport default useFocusTrap\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { isObject } from '@loadsmart/utils-object'\nimport { isFunction } from '@loadsmart/utils-function'\n\ninterface Thenable {\n then(): any\n}\n\n// TODO: add this helper to @loadsmart/utils\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isThenable(object: any): object is Thenable {\n return isObject(object) && isFunction((object as Thenable)['then'])\n}\n","import get from 'utils/toolset/get'\n\nimport type { SelectAdapter } from './Select.types'\n\nexport const GenericAdapter: SelectAdapter<unknown> = {\n getKey(o): string {\n return get(o, 'value')!\n },\n getLabel(o): string {\n return get(o, 'label')!\n },\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { GenericAdapter } from './Select.constants'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport toArray from 'utils/toolset/toArray'\n\nimport type { SelectAdapter, SelectValue, Option, Adapters, SelectProps } from './Select.types'\n\nexport function getAdapter(adapters: Adapters, type?: string): SelectAdapter<any> {\n if (type == null) {\n return GenericAdapter\n }\n\n return adapters[type] || GenericAdapter\n}\n\nexport function getValue(selection: SelectValue, multiple?: boolean): Option | Option[] | null {\n const pairs = Array.from(selection)\n\n if (isEmpty(pairs)) {\n return null\n }\n\n if (multiple) {\n const options = []\n for (const [, option] of pairs) {\n options.push(option)\n }\n\n return options\n } else {\n const [[, option]] = pairs\n return option\n }\n}\n\nexport function toSelection(value: SelectProps['value']): Option[] {\n const safeValue = toArray(value || [])\n\n return safeValue.filter((option) => !isEmpty(option))\n}\n\nexport function getDisplayValue(\n adapters: Adapters,\n selection: SelectValue,\n multiple?: boolean\n): string {\n if (selection.size == 0) {\n return ''\n }\n\n if (multiple) {\n return ''\n } else {\n const value = getValue(selection, multiple)\n const adapter = getAdapter(adapters, (value as Option)._type)\n return adapter.getLabel(value) ?? ''\n }\n}\n\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping\nexport function escapeRegExp(value: string): string {\n return String(value || '').replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isFunction } from '@loadsmart/utils-function'\nimport { isNil } from '@loadsmart/utils-object'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport isEmpty from 'utils/toolset/isEmpty'\nimport { useDropdown } from 'components/Dropdown'\nimport { useDidMount } from 'hooks/useDidMount'\nimport { useFocusTrap } from 'hooks/useFocusTrap'\nimport type { SelectableKeyType } from 'hooks/useSelectable'\nimport to from 'utils/toolset/awaitTo'\nimport { isThenable } from 'utils/toolset/isThenable'\nimport toArray from 'utils/toolset/toArray'\nimport { GenericAdapter } from './Select.constants'\nimport { useSelectable } from './Select.context'\nimport {\n escapeRegExp,\n getAdapter,\n getDisplayValue,\n getValue,\n toSelection,\n} from './useSelect.helpers'\n\nimport type { ChangeEvent, FocusEvent } from 'react'\nimport type {\n Adapters,\n GenericOption,\n Option,\n SelectDatasource,\n SelectDatasourceFunction,\n SelectProps,\n SelectStatus,\n SelectValue,\n useSelectReturn,\n} from './Select.types'\n\nasync function getData(datasources: SelectDatasource<any>[], query: string) {\n const regex = new RegExp(escapeRegExp(query), 'i')\n\n const promises = []\n const types: string[] = []\n\n for (const ds of datasources) {\n promises.push(Promise.resolve(ds.fetch({ query, regex })))\n types.push(ds.type)\n }\n\n // We use Promise.allSettled here because Promise.all rejects as soon as one promise fails\n // But we want to continue with the next datasource when one fails.\n const results = await Promise.allSettled(promises)\n\n let items: Option[] = []\n\n results.forEach((result, index) => {\n if (result.status === 'rejected') {\n return\n }\n\n const type = types[index]\n\n items = items.concat(\n (result.value || []).map((item) => {\n return {\n ...item,\n _type: type,\n } as Option\n })\n )\n })\n\n return items\n}\n\nfunction getDatasources(props: SelectProps) {\n function getDatasourceFromOptions(\n options?: GenericOption[] | null\n ): SelectDatasourceFunction<any>[] {\n if (!options) {\n return []\n }\n\n return [\n function useGenericDatasource() {\n return {\n type: 'generic',\n adapter: GenericAdapter,\n fetch: function fetch({ regex }) {\n return options.filter(({ label }) => regex.test(label))\n },\n }\n },\n ]\n }\n\n let datasources: SelectDatasourceFunction<any>[] = []\n\n datasources = datasources.concat(props.datasources || [])\n datasources = datasources.concat(getDatasourceFromOptions(props.options))\n\n return datasources.map((ds) => ds())\n}\n\nfunction extractAdapters(datasources: SelectDatasource<any>[]) {\n return toArray(datasources).reduce((map, ds) => {\n return {\n ...map,\n [ds.type]: ds.adapter,\n }\n }, {})\n}\n\nfunction TriggerOnFocusHandler(e: FocusEvent<HTMLInputElement>) {\n e.target.select()\n}\n\nfunction mapOptions(items: Option[], adapters: Adapters) {\n const options = new Map<SelectableKeyType, Option>()\n\n items.forEach((item) => {\n const adapter = getAdapter(adapters, item._type)\n options.set(adapter.getKey(item), item)\n })\n\n return options\n}\n\nfunction useOptions<T = any>(props: { datasources: SelectDatasource<T>[]; adapters: Adapters }) {\n const { datasources, adapters } = props\n const [options, setOptions] = useState(new Map<SelectableKeyType, Option>())\n const [status, setStatus] = useState<SelectStatus>('idle')\n\n const timeoutRef = useRef<NodeJS.Timeout>()\n\n function cancelPendingFetch() {\n if (timeoutRef.current != null) {\n clearTimeout(timeoutRef.current)\n }\n }\n\n const fetchAfterTimeout = useCallback(\n function fetchAfterTimeout(query: string) {\n cancelPendingFetch()\n /**\n * The `pending-query` status represents that the 'fetching' has been started\n * but it has been debounced and the internal fetch has not yet been called.\n * This is important because at this point the status is not idle\n * as the fetching has already started.\n */\n setStatus('pending-query')\n\n async function fetch() {\n setOptions(new Map<SelectableKeyType, Option>())\n setStatus('querying')\n\n const items = await getData(datasources, query)\n\n setOptions(mapOptions(items, adapters))\n setStatus('queried')\n }\n\n timeoutRef.current = setTimeout(() => void fetch(), 750)\n },\n [adapters, datasources]\n )\n\n const clear = useCallback(function clear() {\n setStatus('idle')\n setOptions(new Map<SelectableKeyType, Option>())\n }, [])\n\n const get = useCallback(\n function get() {\n return Array.from(options.values())\n },\n [options]\n )\n\n const reset = useCallback(\n function reset() {\n clear()\n fetchAfterTimeout('')\n },\n [clear, fetchAfterTimeout]\n )\n\n const getOptionByKey = useCallback(\n function getOptionByKey(key: SelectableKeyType) {\n return options.get(key)\n },\n [options]\n )\n\n useEffect(() => {\n return () => {\n cancelPendingFetch()\n }\n }, [])\n\n return {\n get,\n fetch: fetchAfterTimeout,\n clear,\n status,\n getOptionByKey,\n reset,\n }\n}\n\n// TODO: keep adapter resolution in a single place\n// TODO: prevent state changes after unmount (`useMounted` hook from Alice Frontend)\n/**\n * Based on https://www.w3.org/TR/wai-aria-practices-1.1/examples/combobox/aria1.1pattern/listbox-combo.html\n * @param props\n * @returns\n */\nfunction useSelect(props: SelectProps): useSelectReturn {\n const didMount = useDidMount()\n const {\n multiple,\n onQueryChange,\n onChange,\n onCreate,\n getInputProps,\n id,\n name,\n disabled = false,\n onBlur,\n isValidNewOption = (query: string) => Boolean(query),\n createOptionPosition = 'last',\n } = props\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const datasources = useMemo<SelectDatasource<any>[]>(\n () => getDatasources(props),\n [props.datasources, props.options]\n )\n const adapters = useMemo<Adapters>(() => extractAdapters(datasources), [datasources])\n\n const selectable = useSelectable({\n selected: toSelection(props.value),\n multiple,\n adapters,\n onChange: useCallback(\n function handleSelectionChange(selected: SelectValue) {\n onChange?.({ target: { id, name, value: getValue(selected, multiple) } })\n },\n [id, multiple, name, onChange]\n ),\n })\n\n const triggerRef = useRef<HTMLInputElement>()\n const focusTrap = useFocusTrap({\n keys: ['ARROW_UP', 'ARROW_DOWN'],\n onDeactivate() {\n triggerRef.current?.focus()\n },\n })\n\n const [queryTyped, setQueryTyped] = useState(false)\n const [query, setQuery] = useState<string>(\n getDisplayValue(adapters, selectable.selected, multiple)\n )\n const options = useOptions({ datasources, adapters })\n\n const expandDisabled = useMemo(\n () =>\n !query.length &&\n isEmpty(options.get()) &&\n isEmpty(selectable.selected) &&\n isFunction(isValidNewOption)\n ? !isValidNewOption(query)\n : !isValidNewOption,\n [query, options, selectable.selected, isValidNewOption]\n )\n\n const dropdown = useDropdown({ ...props, expandDisabled })\n\n useEffect(() => {\n if (queryTyped) {\n options.fetch(query)\n dropdown.expand()\n }\n }, [query, queryTyped])\n\n const getSelectableOption = useCallback(\n function getSelectableOption(option: Option) {\n const adapter = getAdapter(adapters, option._type)\n\n const value = adapter.getKey(option)\n const label = adapter.getLabel(option)\n const checked = selectable.selected.has(value)\n\n return { label, value, checked }\n },\n [adapters, selectable.selected]\n )\n\n const getOption = useCallback(\n function getOption(value: SelectableKeyType) {\n let option = options.getOptionByKey(value)\n\n if (!option) {\n option = selectable.selected.get(value)\n }\n\n return option\n },\n [options, selectable.selected]\n )\n\n const toggleOption = useCallback(\n function toggleOption(option: Option) {\n selectable.toggle(option)\n },\n [selectable]\n )\n\n const getDropdownProps = useCallback(\n function getDropdownProps() {\n return {\n toggle: dropdown.toggle,\n expanded: dropdown.expanded,\n onBlur(event?: MouseEvent | TouchEvent | KeyboardEvent) {\n setQueryTyped(false)\n\n if (!multiple) {\n setQuery(getDisplayValue(adapters, selectable.selected, multiple))\n } else {\n setQuery('')\n }\n options.reset()\n onBlur?.(event)\n },\n expandDisabled,\n }\n },\n [\n adapters,\n dropdown.expanded,\n dropdown.toggle,\n multiple,\n options,\n selectable.selected,\n onBlur,\n expandDisabled,\n ]\n )\n\n const getTriggerProps = useCallback(\n function getTriggerProps() {\n return {\n ...getInputProps?.(),\n id,\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n triggerRef.current = node\n }\n },\n value: query,\n onChange(e: ChangeEvent<HTMLInputElement>) {\n const sanitizedValue = e.target.value.replace(/\\s+/, '')\n\n setQueryTyped(sanitizedValue !== '')\n onQueryChange?.(e)\n setQuery(e.target.value)\n },\n onFocus: TriggerOnFocusHandler,\n }\n },\n [id, query, onQueryChange, dropdown, options, selectable.selected]\n )\n\n const getClearProps = useCallback(\n function getClearProps() {\n return {\n onClick() {\n setQueryTyped(false)\n setQuery('')\n selectable.clear()\n options.reset()\n triggerRef.current?.focus()\n },\n }\n },\n [options, selectable]\n )\n\n const getMenuProps = useCallback(\n function getMenuProps() {\n return {\n ref: focusTrap.containerRef,\n role: 'listbox',\n }\n },\n [focusTrap.containerRef]\n )\n\n const getOptionProps = useCallback(\n function getOptionProps({ option }: { option: Option }) {\n const { value, checked, label } = getSelectableOption(option)\n\n return {\n role: 'option',\n 'aria-selected': checked,\n id: String(value),\n onClick() {\n setQueryTyped(false)\n\n if (!multiple) {\n setQueryTyped(false)\n }\n toggleOption(option)\n\n return multiple\n },\n tabIndex: -1,\n }\n },\n [getSelectableOption, toggleOption, multiple]\n )\n\n const getCreatebleProps = useCallback(\n function getCreatebleProps() {\n return {\n onClick: function onClick() {\n async function asyncOnClick() {\n if (!isFunction(onCreate)) return\n\n const onCreateReturn = onCreate(query)\n\n let option\n if (onCreateReturn) {\n if (isThenable(onCreateReturn)) {\n option = await onCreateReturn\n } else {\n option = onCreateReturn\n }\n }\n\n options.fetch(query)\n\n if (option) {\n toggleOption(option)\n }\n }\n\n void asyncOnClick()\n\n return multiple\n },\n tabIndex: -1,\n }\n },\n [multiple, onCreate, query, options, toggleOption]\n )\n\n const isCreatable = useCallback(\n function isCreatable() {\n const findByLabel = (item: Option) =>\n getSelectableOption(item).label.toLocaleLowerCase() === query.toLocaleLowerCase()\n\n function isQueryEqualAnOption() {\n return !isNil(\n [...options.get(), ...Array.from(selectable.selected.values())].find(findByLabel)\n )\n }\n\n function getIsValidNewOption() {\n if (isFunction(isValidNewOption)) {\n return isValidNewOption(query) && !isQueryEqualAnOption()\n }\n\n return isValidNewOption\n }\n\n return isFunction(onCreate) && options.status === 'queried' && getIsValidNewOption()\n },\n [getSelectableOption, isValidNewOption, onCreate, options, query, selectable.selected]\n )\n\n useEffect(\n function onInit() {\n options.fetch('')\n },\n // we just want to load any initial options that a datasource may have available\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [datasources]\n )\n\n useEffect(\n function onDropdownToggle() {\n if (!props.autoFocus && !didMount) {\n return\n }\n if (dropdown.expanded) {\n focusTrap.activate()\n } else {\n focusTrap.deactivate()\n }\n },\n /**\n * We are interested in activating/deactivating our\n * focus trap when the dropdown changes its expanded state.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [dropdown.expanded]\n )\n\n useEffect(\n function updateOnSelectedChange() {\n if (!multiple) {\n setQuery(getDisplayValue(adapters, selectable.selected, multiple))\n }\n },\n [adapters, multiple, selectable.selected]\n )\n\n return {\n status: options.status,\n options: options.get(),\n value: getValue(selectable.selected, multiple),\n query,\n disabled,\n\n selectable,\n\n getMenuProps,\n getSelectableOption,\n getOption,\n getOptionProps,\n getTriggerProps,\n getClearProps,\n getDropdownProps,\n getCreatebleProps,\n isCreatable,\n createOptionPosition,\n }\n}\n\nexport default useSelect\n","import React from 'react'\n\n/**\n * A function that wraps a match into `mark` element to be highlighted.\n * @example\n *\n * @param {string} - label to be split\n * @param {string} - match to be found\n * @returns {ReactNode} - an element with marked match\n */\nexport default function highlightMatch(str: string, match: string): JSX.Element {\n if (str == null || match == null) {\n return <>{str}</>\n }\n\n // the explicit coercion here ensures that we'll be dealing with strings even in vanilla JS code\n const index = String(str).toLowerCase().indexOf(String(match).toLowerCase())\n\n if (index === -1) return <>{str}</>\n\n const pre = str.slice(0, index)\n const mid = str.slice(index, index + match.length)\n const post = str.slice(index + match.length)\n\n return (\n <>\n {pre}\n <mark>{mid}</mark>\n {post}\n </>\n )\n}\n","import React, { HTMLAttributes } from 'react'\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\n\nimport highlightMatch from 'utils/toolset/highlightMatch'\n\nexport type HighlightMatchProps = {\n text: string\n match: string\n} & HTMLAttributes<HTMLSpanElement>\n\nconst HighlightMatchWrapper = styled.span`\n /* highlightMatch splits the label into separate HTML elements, thus we need\n to preserve white-spaces, otherwise the browser wouldn't render them. */\n white-space: pre;\n\n mark {\n color: inherit;\n font-weight: ${token('font-weight-bold')};\n\n background-color: ${token('color-transparent')};\n }\n`\n\nconst HighlightMatch = ({ text, match, ...props }: HighlightMatchProps): JSX.Element => {\n return <HighlightMatchWrapper {...props}>{highlightMatch(text, match)}</HighlightMatchWrapper>\n}\n\nexport default HighlightMatch\n","import React, { useContext } from 'react'\nimport styled from 'styled-components'\n\nimport { Checkbox } from 'components/Checkbox'\nimport { Dropdown } from 'components/Dropdown'\nimport { HighlightMatch } from 'components/HighlightMatch'\nimport { Icon as DefaultIcon } from 'components/Icon'\nimport { Group as DefaultGroup } from 'components/Layout'\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\n\nimport { SelectContext } from './Select.context'\n\nimport type { DropdownMenuItemProps } from 'components/Dropdown'\nimport type { SelectOptionProps } from './Select.types'\n\nconst Group = styled(DefaultGroup).attrs({\n as: 'span',\n})`\n /* placeholder */\n`\n\nconst Icon = styled(DefaultIcon)`\n color: ${token('select-selected-option-check-color')};\n`\n\nconst DefaultSelectOption = styled(Dropdown.Item)<DropdownMenuItemProps>`\n background: ${conditional({\n 'select-selected-option-background-color': whenProps({ 'aria-selected': true }),\n 'color-neutral-white': whenProps({ 'aria-selected': false }),\n })};\n`\n\nfunction SelectOption({\n children,\n value,\n leading,\n trailing,\n ...rest\n}: SelectOptionProps): JSX.Element {\n const select =\n useContext(SelectContext) ||\n (() => {\n throw new Error('Options should be wrapped in a SelectContext')\n })()\n\n const type = select.selectable.type()\n const option = select.getOption(value) || {}\n const { checked, label } = select.getSelectableOption(option)\n\n function renderContent() {\n if (children) return children\n if (checked && type === 'multiple') return label\n\n return <HighlightMatch text={label} match={select.query} />\n }\n\n return (\n <DefaultSelectOption\n {...rest}\n {...select.getOptionProps({ option })}\n leading={\n type === 'multiple' ? (\n <Group align=\"center\" space=\"s\">\n <Checkbox scale=\"small\" defaultChecked={checked} />\n {leading}\n </Group>\n ) : (\n leading\n )\n }\n trailing={type === 'single' ? checked ? <Icon name=\"check\" /> : null : trailing}\n >\n {renderContent()}\n </DefaultSelectOption>\n )\n}\n\nexport default SelectOption\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport type { SelectEmptyProps } from './Select.types'\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n\n box-sizing: border-box;\n margin: 0 ${token('space-s')};\n padding: ${token('space-s')};\n\n color: ${token('color-neutral')};\n\n font-size: 1em;\n line-height: ${token('font-height-3')};\n\n background: ${token('color-transparent')};\n`\n\nfunction SelectEmpty({ children, ...others }: SelectEmptyProps): JSX.Element {\n return <Wrapper {...others}>{children}</Wrapper>\n}\n\nexport default SelectEmpty\n","import React, { useContext } from 'react'\nimport { Dropdown } from 'components/Dropdown'\nimport { SelectContext } from './Select.context'\nimport type { SelectCreatableOptionProps } from './Select.types'\n\nfunction SelectCreatableOption({ children, ...rest }: SelectCreatableOptionProps): JSX.Element {\n const select =\n useContext(SelectContext) ||\n (() => {\n throw new Error('SelectCreatableOption should be wrapped in a SelectContext')\n })()\n\n return (\n <Dropdown.Item {...rest} {...select.getCreatebleProps()}>\n {children || `Add \"${select.query}\"`}\n </Dropdown.Item>\n )\n}\n\nexport default SelectCreatableOption\n","import type { Components, CreatableOptionType } from './Select.types'\nimport SelectCreatableOption from './SelectCreatableOption'\nimport SelectEmpty from './SelectEmpty'\nimport SelectOption from './SelectOption'\n\nconst defaultComponents = {\n Option: SelectOption,\n Empty: SelectEmpty,\n CreatableOption: SelectCreatableOption as CreatableOptionType,\n}\n\nexport function getComponents(components?: Components): Required<Components> {\n return { ...defaultComponents, ...components }\n}\n","import React, { Fragment, forwardRef } from 'react'\nimport styled from 'styled-components'\n\nimport { Dropdown, GenericDropdown } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { SelectableContext, SelectContext } from './Select.context'\nimport { Tag } from 'components/Tag'\nimport { Text } from 'components/Text'\nimport CloseButton from 'common/CloseButton'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport omit from 'utils/toolset/omit'\nimport pluralize from 'utils/toolset/pluralize'\nimport SelectTrigger from './SelectTrigger'\nimport toArray from 'utils/toolset/toArray'\nimport useSelect from './useSelect'\nimport SelectOption from './SelectOption'\nimport SelectEmpty from './SelectEmpty'\nimport SelectCreatableOption from './SelectCreatableOption'\nimport { getComponents } from './components'\n\nimport type { DropdownMenuProps } from 'components/Dropdown'\nimport type {\n SelectProps,\n useSelectReturn,\n SelectStatus,\n Components,\n SelectableOption,\n} from './Select.types'\n\nconst OMITTED_PROPS = [\n 'id',\n 'name',\n 'datasources',\n 'onChange',\n 'onQueryChange',\n 'onCreate',\n 'options',\n 'value',\n]\n\nconst Loading = styled.span`\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n width: 2em;\n\n height: 2em;\n padding: ${token('space-xs')};\n\n font-size: ${token('font-size-3')};\n`\n\nfunction getCommonClearButtonProps() {\n return {\n 'data-testid': 'select-trigger-clear',\n }\n}\n\nconst SelectMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(function SelectMenu(\n props: DropdownMenuProps,\n ref\n): JSX.Element {\n return <Dropdown.Menu ref={ref} {...props} role=\"listbox\" />\n})\n\nfunction ClearMultiple({ select }: { select: useSelectReturn }) {\n const { onClick } = select.getClearProps()\n const total = toArray(select.value).length\n\n return (\n <div data-testid=\"select-trigger-clear-counter\">\n <Tag\n removable\n size=\"default\"\n variant=\"accent\"\n onRemove={onClick}\n title={`${total} selected option${pluralize(total)}`}\n getRemoveButtonProps={getCommonClearButtonProps}\n disabled={select.disabled}\n >\n {total}\n </Tag>\n </div>\n )\n}\n\nconst Divider = styled.hr`\n width: calc(100% - ${token('space-m')});\n height: 1px;\n margin: ${token('space-m')} ${token('space-s')};\n\n background-color: ${token('color-neutral-lighter')};\n border: 0;\n`\n\nconst DividerText = styled(Text)`\n position: absolute;\n top: ${token('space-s')};\n\n padding-right: ${token('space-xs')};\n padding-left: ${token('space-m')};\n\n background-color: ${token('color-neutral-white')};\n`\n\nfunction isQuerying(status: SelectStatus) {\n return ['pending-query', 'querying'].includes(status)\n}\n\ntype SeparatorProps = {\n status: SelectStatus\n after?: unknown[]\n before?: unknown[]\n}\n\nfunction Separator({ status, after = [], before = [] }: SeparatorProps): JSX.Element {\n if (!isQuerying(status)) {\n if (isEmpty(after) && !isEmpty(before)) return <Divider />\n if (isEmpty(after)) return <Fragment />\n }\n\n return (\n <div style={{ position: 'relative' }}>\n <Divider />\n <DividerText variant=\"caption-bold\" color=\"color-neutral-light\">\n {isQuerying(status) ? 'Loading...' : `${after.length} option${pluralize(after.length)}`}\n </DividerText>\n </div>\n )\n}\n\nfunction renderOptionsSingle(select: useSelectReturn, components?: Components): JSX.Element {\n const { Option, Empty, CreatableOption } = getComponents(components)\n const isCreatable = select.isCreatable()\n\n if (isQuerying(select.status) && isEmpty(select.options)) {\n return <SelectEmpty>Loading...</SelectEmpty>\n }\n\n if (isEmpty(select.options)) {\n if (isCreatable) {\n return <CreatableOption />\n }\n\n return <Empty>No results found.</Empty>\n }\n\n return (\n <>\n {select.createOptionPosition === 'first' && isCreatable ? <CreatableOption /> : null}\n {select.options.map((option) => {\n const { value } = select.getSelectableOption(option)\n return <Option key={String(value)} value={value} />\n })}\n {select.createOptionPosition === 'last' && isCreatable ? <CreatableOption /> : null}\n </>\n )\n}\n\nfunction renderOptionsMultiple(select: useSelectReturn, components?: Components): JSX.Element {\n const { Option, Empty, CreatableOption } = getComponents(components)\n const isCreatable = select.isCreatable()\n\n const selectedOptions = Array.from(select.selectable.selected.values()).map((selectable) =>\n select.getSelectableOption(selectable)\n )\n\n const remainingOptions = select.options.reduce((remaining, selectable) => {\n const option = select.getSelectableOption(selectable)\n\n if (option.checked) {\n return remaining\n }\n\n return [...remaining, option]\n }, [] as SelectableOption[])\n\n let remaining = (\n <Fragment>\n {select.createOptionPosition === 'first' && isCreatable ? <CreatableOption /> : null}\n {remainingOptions.map((option) => (\n <Option key={String(option.value)} value={option.value} />\n ))}\n {select.createOptionPosition === 'last' && isCreatable ? <CreatableOption /> : null}\n </Fragment>\n )\n\n if (!isQuerying(select.status) && isEmpty(remainingOptions)) {\n remaining = isCreatable ? <CreatableOption /> : <Empty>No more options.</Empty>\n }\n\n if (!isQuerying(select.status) && isEmpty(select.options)) {\n remaining = isCreatable ? <CreatableOption /> : <Empty>No results found.</Empty>\n }\n\n return (\n <Fragment>\n {selectedOptions.map((option) => (\n <Option key={String(option.value)} value={option.value} />\n ))}\n <Separator status={select.status} before={selectedOptions} after={remainingOptions} />\n {remaining}\n </Fragment>\n )\n}\n\nfunction Select(props: SelectProps): JSX.Element {\n const { multiple, placeholder, components, hideClear = false, ...others } = props\n\n const select = useSelect(props)\n\n function renderOptions() {\n if (multiple) {\n return renderOptionsMultiple(select, components)\n }\n\n return renderOptionsSingle(select, components)\n }\n\n function getTrailing() {\n if (isQuerying(select.status)) {\n return <Loading data-testid=\"select-trigger-loading\">&middot;&middot;&middot;</Loading>\n }\n\n if (!select.value) {\n return null\n }\n\n if (multiple) {\n return <ClearMultiple select={select} />\n }\n\n if (select.disabled || hideClear) {\n return null\n }\n\n return (\n <CloseButton\n size={12}\n {...getCommonClearButtonProps()}\n {...select.getClearProps()}\n type=\"button\"\n />\n )\n }\n\n return (\n <GenericDropdown {...omit(others, OMITTED_PROPS)} {...select.getDropdownProps()}>\n <SelectableContext.Provider value={select.selectable}>\n <SelectTrigger\n {...select.getTriggerProps()}\n trailing={getTrailing()}\n placeholder={placeholder}\n autoComplete=\"off\"\n aria-autocomplete=\"none\"\n />\n <SelectMenu {...select.getMenuProps()}>\n <SelectContext.Provider value={select}>{renderOptions()}</SelectContext.Provider>\n </SelectMenu>\n </SelectableContext.Provider>\n </GenericDropdown>\n )\n}\n\nSelect.Trigger = SelectTrigger\nSelect.Option = SelectOption\nSelect.Empty = SelectEmpty\nSelect.CreatableOption = SelectCreatableOption\n\nexport default Select\n","import { useCallback, useContext } from 'react'\n\nimport { SelectContext } from './Select.context'\nimport type { Option, useSelectExternalReturn } from './Select.types'\n\nexport function useSelectExternal(): useSelectExternalReturn {\n const select =\n useContext(SelectContext) ||\n (() => {\n throw new Error('useSelect should be wrapped in a SelectContext')\n })()\n\n const isChecked = useCallback(\n function isChecked(option: Option) {\n const { checked } = select.getSelectableOption(option)\n return checked\n },\n [select]\n )\n\n return {\n query: select.query,\n getOption: select.getOption,\n isChecked,\n }\n}\n","import React from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { BaseLink } from 'components/Link'\n\nexport type LogoProps = PropsWithChildren<{\n url: string\n className?: string\n}>\n\nconst Container = styled.div`\n padding-right: ${token('space-l')};\n padding-left: ${token('space-l')};\n`\n\nfunction Logo({ className, url, children }: LogoProps): JSX.Element {\n return (\n <Container className={className}>\n <BaseLink href={url}>{children}</BaseLink>\n </Container>\n )\n}\n\nexport default styled(Logo)<LogoProps>({})\n","import { RefObject, useEffect, useLayoutEffect, useReducer, useState } from 'react'\nimport type { CSSProperties } from 'styled-components'\n\nimport { useDidMount } from 'hooks/useDidMount'\n\nfunction updateHeight(set: (value: number) => void, el: HTMLElement | null) {\n if (el) {\n const { height } = el.getBoundingClientRect()\n set(height)\n }\n}\n\nexport type HeightExpansionToggler = {\n expanded: boolean\n toggle: () => void\n height: CSSProperties['height']\n}\n\n/**\n * A React Hook to help you expand or collapse an element by\n * checking its total height and controlling a boolean flag\n * @param {React.RefObject} targetElRef - Ref of the wrapper element\n */\nfunction useHeightExpansionToggler(targetElRef: RefObject<HTMLElement>): HeightExpansionToggler {\n const [state, toggleState] = useReducer((prevState) => !prevState, false)\n const [totalHeight, setTotalHeight] = useState<CSSProperties['height']>(0)\n\n useLayoutEffect(() => {\n updateHeight(setTotalHeight, targetElRef.current)\n }, [targetElRef])\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n updateHeight(setTotalHeight, targetElRef.current)\n })\n\n if (targetElRef.current) {\n observer.observe(targetElRef.current, { childList: true })\n }\n\n return () => observer.disconnect()\n }, [targetElRef])\n\n const mounted = useDidMount()\n const finalHeight = !mounted ? 'auto' : state ? totalHeight : 0\n\n return {\n expanded: state,\n toggle: toggleState,\n height: finalHeight,\n }\n}\n\nexport default useHeightExpansionToggler\n","import React from 'react'\nimport type { ReactNode, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport focusable from 'styles/focusable'\nimport transition from 'styles/transition'\nimport { getToken as token } from 'theming'\nimport rem from 'utils/toolset/rem'\nimport type { MenuLinkProps } from './MenuLink'\n\nexport type MenuBaseItemProps = HTMLAttributes<HTMLElement> & {\n label: string\n leading?: ReactNode\n trailing?: ReactNode\n url?: string\n subItems?: MenuLinkProps[]\n}\n\nconst StyledMenuItem = styled.button`\n ${transition({ duration: '0.25s' })};\n\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: space-between;\n padding: ${token('space-s')} 0;\n padding-right: ${rem('12px')};\n padding-left: ${token('space-l')};\n\n color: ${token('color-neutral-white')};\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('font-size-4')};\n line-height: ${token('font-height-3')};\n\n cursor: pointer;\n\n ${focusable`\n color: ${token('side-navigation-menu-item-color--focus')};\n `}\n`\n\nconst Leading = styled.div`\n display: flex;\n align-items: center;\n padding-right: ${token('space-s')};\n`\n\nconst Flex = styled.div`\n display: flex;\n`\n\nfunction MenuBaseItem({ label, leading, trailing, ...props }: MenuBaseItemProps): JSX.Element {\n return (\n <StyledMenuItem {...props}>\n <Flex>\n {leading && <Leading>{leading}</Leading>}\n {label}\n </Flex>\n {trailing && trailing}\n </StyledMenuItem>\n )\n}\n\nexport default MenuBaseItem\n","import React from 'react'\nimport type { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport hoverable from 'styles/hoverable'\nimport MenuBaseItem from './MenuBaseItem'\n\nconst StyledMenuItem = styled(({ url, ...props }) => (\n <MenuBaseItem as={url ? 'a' : 'button'} {...props} />\n))`\n ${hoverable`\n color: ${token('side-navigation-menu-link-color--hover')};\n `}\n\n ${({ active }) =>\n active\n ? css`\n background-color: ${token('side-navigation-menu-link-background-color--active')};\n box-shadow: inset ${token('space-xs')} 0\n ${token('side-navigation-menu-link-box-shadow-color--active')};\n `\n : ''}\n`\n\nexport type MenuLinkProps = React.HTMLAttributes<HTMLAnchorElement> & {\n label: string\n leading?: ReactNode\n trailing?: ReactNode\n url?: string\n}\n\nfunction MenuLink({ url, ...props }: MenuLinkProps): JSX.Element {\n return <StyledMenuItem href={url} url={url} {...props} role=\"menuitem\" />\n}\n\nexport default styled(MenuLink)({})\n","import React, { Fragment, useRef } from 'react'\nimport type { PropsWithChildren, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\nimport type { CSSProperties } from 'styled-components'\n\nimport { Icon } from 'components/Icon'\nimport { conditional, whenProps, prop } from 'tools/index'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\nimport { useHeightExpansionToggler } from 'hooks/useHeightExpansionToggler'\n\nimport MenuLink from './MenuLink'\nimport MenuBaseItem from './MenuBaseItem'\n\ninterface IExpandable {\n $expanded?: boolean\n $height?: CSSProperties['height']\n}\n\nconst IconWrapper = styled.div`\n display: flex;\n align-items: center;\n margin-left: ${token('space-s')};\n`\n\nconst StyledIcon = styled(Icon)<IExpandable>`\n color: ${token('color-neutral')};\n\n transform: rotate(\n ${conditional({\n '0deg': whenProps({ $expanded: true }),\n '-90deg': whenProps({ $expanded: false }),\n })}\n );\n`\n\nconst ExpandableItems = styled.div<IExpandable>`\n overflow: hidden;\n ${transition({ property: 'height' })}\n\n height: ${prop('$height', 0)}px;\n\n ${MenuLink} {\n padding-left: ${token('space-xl')};\n }\n`\n\nconst ItemsWrapper = styled.div<IExpandable>`\n ${transition()}\n\n opacity: ${conditional({\n 0: whenProps({ $expanded: false }),\n 1: whenProps({ $expanded: true }),\n })};\n\n transform: translateY(\n ${conditional({\n '-10%': whenProps({ $expanded: false }),\n '0%': whenProps({ $expanded: true }),\n })}\n );\n`\n\nexport type MenuExpandableProps = HTMLAttributes<HTMLDivElement> &\n PropsWithChildren<{\n label: string\n }>\n\nfunction MenuExpandable({ label, children, ...props }: MenuExpandableProps): JSX.Element {\n const expandableItemsRef = useRef<HTMLDivElement>(null)\n const { expanded, toggle, height } = useHeightExpansionToggler(expandableItemsRef)\n\n return (\n <div {...props} role=\"none\">\n <MenuBaseItem\n onClick={toggle}\n label={label}\n trailing={\n <IconWrapper>\n <StyledIcon $expanded={expanded} name=\"chevron-down\" size={16} />\n </IconWrapper>\n }\n aria-haspopup=\"true\"\n aria-expanded={expanded}\n />\n <ExpandableItems $height={height} role=\"menu\">\n <ItemsWrapper $expanded={expanded} ref={expandableItemsRef} role=\"presentation\">\n {React.Children.map(children, (child) => {\n if (!child) return Fragment\n\n if (typeof child === 'object' && 'type' in child) {\n return React.cloneElement(child, {\n key: label,\n tabIndex: expanded ? 0 : -1,\n ariaHidden: !expanded,\n })\n }\n\n return child\n })}\n </ItemsWrapper>\n </ExpandableItems>\n </div>\n )\n}\n\nexport default MenuExpandable\n","import type { StyledComponent } from 'styled-components'\n\n/**\n * Helper that returns the plural form if count is different than 1, otherwise the singular one.\n * @example\n * const StyledParent = styled.div``\n * styledCompounds(StyledParent, { Child: (props) => <div /> })\n * <StyledParent.Child />\n * @param StyledComponent - Parent instance of a styled-component\n * @param compounds - Object with compound components\n * @returns Parent component with type-safe accessable compound components\n */\nexport function styledCompounds<\n A extends StyledComponent<React.ComponentType, Record<string, unknown>>,\n B extends Record<string, unknown>\n>(Parent: A, compounds: B): A & B {\n Object.keys(compounds).forEach((key) => {\n // @ts-expect-error StyledComponent is read-only\n Parent[key] = compounds[key]\n })\n return Parent as A & B\n}\n","import React, { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nimport MenuExpandable from './MenuExpandable'\nimport type { MenuExpandableProps } from './MenuExpandable'\nimport MenuLink from './MenuLink'\nimport type { MenuLinkProps } from './MenuLink'\nimport useID from 'hooks/useID'\nimport { styledCompounds } from 'utils/toolset/styledCompounds'\n\nconst MenuTitle = styled.div`\n padding: ${token('space-s')} 0;\n padding-left: ${token('space-l')};\n\n color: ${token('color-neutral')};\n\n font-weight: ${token('side-navigation-menu-title-font-weight')};\n font-size: ${token('side-navigation-menu-title-font-size')};\n line-height: ${token('side-navigation-menu-title-line-height')};\n text-transform: uppercase;\n`\n\nexport interface MenuProps extends React.HTMLAttributes<HTMLDivElement> {\n label?: string\n}\n\nfunction Menu({ label, children, ...props }: MenuProps): JSX.Element {\n const menuId = useID()\n\n return (\n <div role=\"menubar\" aria-labelledby={menuId} {...props}>\n {label && <MenuTitle id={menuId}>{label}</MenuTitle>}\n\n {children}\n </div>\n )\n}\n\ntype MenuItemProps = { active?: boolean } & PropsWithChildren<MenuLinkProps & MenuExpandableProps>\n\nfunction MenuItem(props: MenuItemProps) {\n if (props.children) {\n return <MenuExpandable {...props} />\n }\n\n return <MenuLink {...props} />\n}\n\nconst StyledMenu = styled(Menu)({})\n\nexport default styledCompounds(StyledMenu, { Item: MenuItem, SubItem: MenuLink })\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nconst Line = styled.hr`\n margin: ${token('side-navigation-component-margin-top')} 0;\n\n color: ${token('side-navigation-separator-color')};\n`\n\nexport interface SeparatorProps {\n className?: string\n}\n\nfunction Separator(props: SeparatorProps): JSX.Element {\n return <Line {...props} role=\"separator\" />\n}\n\nexport default Separator\n","import CloseButton from 'common/CloseButton'\nimport type { CloseButtonProps } from 'common/CloseButton'\nimport React, { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nimport { Logo } from './Logo'\nimport { Menu } from './Menu'\nimport { Separator } from './Separator'\n\nconst Container = styled.aside`\n z-index: ${token('z-index-overlay')};\n /* this was needed to force the side-navigation-width inside flex containers */\n flex: 0 0 ${token('side-navigation-width')};\n width: ${token('side-navigation-width')};\n min-height: 100vh;\n padding-top: ${token('space-l')};\n padding-bottom: ${token('space-l')};\n overflow: auto;\n\n background-color: ${token('side-navigation-background-color')};\n\n ${Logo} + * {\n margin-top: ${token('space-xl')};\n }\n\n ${Menu} + ${Menu} {\n margin-top: ${token('space-m')};\n }\n`\n\nexport interface SideNavigationProps {\n className?: string\n children: ReactNode\n}\n\nfunction SideNavigation({ className, children }: SideNavigationProps): JSX.Element {\n return <Container className={className}>{children}</Container>\n}\n\nSideNavigation.Logo = Logo\nSideNavigation.Menu = Menu\nSideNavigation.Separator = Separator\nSideNavigation.CloseButton = styled(CloseButton)<CloseButtonProps>({})\n\nexport default SideNavigation\n","import { useState, useEffect } from 'react'\n\nfunction useWindowSize() {\n const [windowSize, setWindowSize] = useState<{\n width: number\n height: number\n }>({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n\n useEffect(() => {\n function handleResize() {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n }\n\n window.addEventListener('resize', handleResize)\n\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n return windowSize\n}\n\nexport default useWindowSize\n","import { CustomTheme, getToken as token } from 'theming'\nimport { useTheme } from 'styled-components'\nimport useDialog from 'components/Dialog/useDialog'\nimport { useMemo } from 'react'\nimport useWindowResize from 'hooks/useWindowResize'\nimport { BASE_PIXELS } from 'utils/toolset/rem'\n\nexport interface useSideNavigationProps {\n open: boolean\n show: () => void\n hide: () => void\n toggle: () => void\n}\n\nfunction transformInPixels(value: string): number {\n if (value.indexOf('rem') >= 0) {\n return parseFloat(value) * BASE_PIXELS\n }\n\n return parseFloat(value)\n}\n\nfunction useSideNavigation(): useSideNavigationProps {\n const size = useWindowResize()\n const theme = useTheme() as CustomTheme\n\n const shouldOpen = useMemo(() => {\n const breakpoint = token('side-navigation-collapsing-breakpoint', { theme }) as string\n const breakpointInPixels = transformInPixels(breakpoint)\n return size.width > breakpointInPixels\n }, [size])\n\n return useDialog({ open: shouldOpen })\n}\n\nexport default useSideNavigation\n","import type { PropsWithChildren } from 'react'\nimport React, { ReactNode, useEffect, useRef, useState } from 'react'\nimport ReactDOM from 'react-dom'\nimport styled from 'styled-components'\n\nimport transition from 'styles/transition'\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport DefaultCloseButton from 'common/CloseButton'\n\nexport interface DrawerProps {\n children?: ReactNode\n className?: string\n open: boolean\n onClose?: () => void\n onClickOutside?: () => void\n}\n\nconst StyledAside = styled.aside<Pick<DrawerProps, 'open'>>`\n position: fixed;\n top: 0;\n left: 0;\n\n z-index: ${token('z-index-overlay')};\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n\n background: ${token('modal-overlay-background')};\n\n visibility: ${conditional({\n visible: whenProps({ open: true }),\n hidden: whenProps({ open: false }),\n })};\n`\n\nconst CloseButton = styled(DefaultCloseButton)`\n position: absolute;\n top: 32px;\n left: -48px;\n\n background-color: ${token('color-neutral-lighter')};\n`\n\nconst StyledSection = styled.section<Pick<DrawerProps, 'open'>>`\n position: fixed;\n top: 0;\n right: 0;\n\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 40vw;\n height: 100%;\n\n background-color: ${token('color-neutral-lightest')};\n border-radius: ${token('border-radius-s')};\n box-shadow: ${token('shadow-modal')};\n\n transform: ${conditional({\n 'translateX(100%)': whenProps({\n open: false,\n }),\n 'translateX(0px)': whenProps({\n open: true,\n }),\n })};\n\n ${transition({\n property: 'transform',\n duration: '200ms',\n })}\n`\n\nconst StyledHeader = styled.header`\n display: flex;\n align-items: center;\n justify-content: center;\n\n padding: ${token('space-xl')};\n\n color: ${token('color-neutral-darker')};\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('font-size-2')};\n text-align: center;\n\n border-bottom-color: ${token('color-neutral-light')};\n border-bottom-width: 1px;\n border-bottom-style: solid;\n`\n\nconst StyledBody = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n\n padding: ${token('space-xl')};\n\n overflow: auto;\n`\n\nconst StyledFooter = styled.footer`\n display: flex;\n\n padding: ${token('space-xl')};\n\n border-top-color: ${token('color-neutral-light')};\n border-top-width: 1px;\n border-top-style: solid;\n`\n\nexport interface DrawerHeaderProps {\n className?: string\n}\n\nfunction DrawerHeader({\n children,\n className,\n ...others\n}: PropsWithChildren<DrawerHeaderProps>): JSX.Element {\n return (\n <StyledHeader {...others} className={className}>\n {children}\n </StyledHeader>\n )\n}\n\nexport interface DrawerBodyProps {\n className?: string\n}\n\nfunction DrawerBody({\n children,\n className,\n ...others\n}: PropsWithChildren<DrawerHeaderProps>): JSX.Element {\n return (\n <StyledBody {...others} className={className}>\n {children}\n </StyledBody>\n )\n}\n\nexport interface DrawerFooterProps {\n className?: string\n}\n\nfunction DrawerFooter({\n children,\n className,\n ...others\n}: PropsWithChildren<DrawerFooterProps>): JSX.Element {\n return (\n <StyledFooter {...others} className={className}>\n {children}\n </StyledFooter>\n )\n}\n\nfunction Drawer({\n className,\n children,\n open,\n onClose,\n onClickOutside,\n ...others\n}: DrawerProps): JSX.Element {\n const [invisible, setInvisible] = useState(!open)\n const ref = useRef<HTMLElement>(null)\n\n function handleTransitionEnd() {\n if (!open) {\n setInvisible(true)\n }\n }\n\n useEffect(() => {\n if (open) {\n setInvisible(false)\n }\n }, [open])\n\n useEffect(() => {\n const currentRef = ref.current\n\n if (currentRef && onClickOutside) {\n const handleClick = (event: MouseEvent) => {\n const hasClickedOutside = currentRef.isSameNode(event.target as Element)\n\n if (hasClickedOutside) onClickOutside()\n }\n\n currentRef.addEventListener('mouseup', handleClick)\n\n return () => currentRef.removeEventListener('mouseup', handleClick)\n }\n }, [onClickOutside])\n\n return ReactDOM.createPortal(\n <StyledAside open={!invisible} ref={ref}>\n <StyledSection\n {...others}\n className={className}\n open={open}\n onTransitionEnd={handleTransitionEnd}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"drawer\"\n >\n {Boolean(onClose) && <CloseButton onClick={onClose} aria-label=\"close\" />}\n {children}\n </StyledSection>\n </StyledAside>,\n document.body\n )\n}\n\nDrawer.Header = DrawerHeader\nDrawer.Body = DrawerBody\nDrawer.Footer = DrawerFooter\n\nexport default Drawer\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport React, { useCallback, useState, createContext, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport { createSelectable } from 'hooks/useSelectable'\nimport type { Selectable, SelectableState, SelectableKeyType } from 'hooks/useSelectable'\nimport type { useSelectableProps } from 'hooks/useSelectable/useSelectable.types'\n\nexport type TableSelectableRow = Selectable & {\n value?: string | number | boolean\n}\n\nexport type TableSelectionSelectable<T extends Selectable = TableSelectableRow> = Omit<\n useSelectableProps<T>,\n 'onChange'\n> & {\n onChange: (selected: T[]) => void\n}\n\nexport type TableSelectionConfig<T extends Selectable = TableSelectableRow> =\n | boolean\n | Partial<TableSelectionSelectable<T>>\n\nexport interface TableSelectionCore<T extends Selectable = TableSelectableRow> {\n selected?: SelectableState<T>\n config: TableSelectionSelectable<T>\n allRowsAreSelected: boolean\n toggle: (key: T) => void\n toggleAll: () => void\n clear: () => void\n register: (key?: T) => void\n}\n\nfunction getSelectableProps<T extends Selectable = TableSelectableRow>(\n config?: TableSelectionConfig<T>\n): TableSelectionSelectable<T> {\n const defaults: TableSelectionSelectable<T> = {\n multiple: true,\n selected: [],\n onChange() {},\n adapters: {\n generic: {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n getKey: (row) => row.value as string,\n },\n },\n }\n\n if (!config || config === true) return defaults\n\n return {\n ...defaults,\n ...config,\n }\n}\n\nexport function useTableSelectionCore<T extends Selectable>(\n config?: TableSelectionConfig<T>\n): TableSelectionCore<T> {\n const { useSelectable } = createSelectable<T>()\n\n const [registered, setRegistered] = useState<T[]>([])\n\n const selectableProps = getSelectableProps(config)\n\n const { selected, toggle, select, unselect, clear } = useSelectable({\n ...selectableProps,\n onChange(value) {\n return selectableProps.onChange(value ? [...value.values()] : [])\n },\n })\n\n const allRowsAreSelected = selected.size === registered.length\n\n const getKey = useCallback(\n (row: T): SelectableKeyType => {\n const { adapters } = selectableProps\n\n const adapter = adapters?.[row._type || 'generic']\n const key = adapter?.getKey(row) ?? ''\n\n return key\n },\n [selectableProps]\n )\n\n const register = useCallback(\n (row?: T) => {\n if (!row) return\n\n const key = getKey(row)\n\n setRegistered((prev) => {\n const alreadyRegistered = prev.some((prevRow) => getKey(prevRow) === key)\n\n if (alreadyRegistered) {\n return prev\n }\n\n return [...prev, row]\n })\n },\n [getKey]\n )\n\n function toggleAll() {\n if (allRowsAreSelected) {\n registered.forEach((row) => {\n const key = getKey(row)\n\n if (!key) return\n\n unselect(key)\n })\n } else {\n registered.forEach((row) => select(row))\n }\n }\n\n return {\n allRowsAreSelected,\n config: selectableProps,\n selected,\n toggle,\n toggleAll,\n clear,\n register,\n }\n}\n\nexport const TableSelectionContext = createContext<TableSelectionCore>({\n selected: undefined,\n config: {} as TableSelectionSelectable,\n allRowsAreSelected: false,\n toggle() {},\n toggleAll() {},\n clear() {},\n register() {},\n})\n\ntype TableSelectionProviderProps = PropsWithChildren<{\n selection?: TableSelectionConfig\n}>\n\nexport function TableSelectionProvider({\n children,\n selection,\n}: TableSelectionProviderProps): JSX.Element {\n const selectionCore = useTableSelectionCore(selection)\n\n return (\n <TableSelectionContext.Provider value={selectionCore}>\n {children}\n </TableSelectionContext.Provider>\n )\n}\n\nexport function useTableSelection<\n T extends Selectable = TableSelectableRow\n>(): TableSelectionCore<T> {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return useContext(TableSelectionContext)\n}\n\ntype TableSelectionHook<T extends Selectable = TableSelectableRow> = {\n values: T[]\n clear: TableSelectionCore<T>['clear']\n}\n\nexport function useSelection<T extends Selectable = TableSelectableRow>(): TableSelectionHook<T> {\n const { selected, clear } = useTableSelection<T>()\n\n return {\n values: selected ? [...selected.values()] : [],\n clear,\n }\n}\n\nexport function isCellSelected<T extends Selectable>(\n value: T,\n selectedRows: SelectableState<T>,\n config: TableSelectionSelectable<T>\n): boolean {\n const { adapters } = config\n\n const adapter = adapters?.[value._type || 'generic']\n const key = adapter?.getKey(value)\n\n if (!key) return false\n\n return selectedRows.has(key)\n}\n\nexport function useIsCellSelected<T extends Selectable = TableSelectableRow>(value?: T): boolean {\n const { selected, config } = useTableSelection<T>()\n\n if (!value || !selected) return false\n\n return isCellSelected(value, selected, config)\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport { Box as DefaultBox } from 'components/Layout'\nimport type { SortDirection } from './useSortBy.types'\n\nimport type { BoxProps } from 'components/Layout/Box'\n\ninterface TableSortHandleProps extends BoxProps {\n order?: SortDirection | null\n}\n\nconst Box = styled(DefaultBox)`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n\n margin-left: ${token('space-xs')};\n`\n\nfunction TableSortHandle({ order, ...rest }: TableSortHandleProps): JSX.Element | null {\n return (\n <Box {...rest} padding=\"none\">\n <Icon name={order != null ? `sort-${order}` : 'sort'} width=\"0.75em\" height=\"0.85em\" />\n </Box>\n )\n}\n\nexport default TableSortHandle\n","import React, { Children, Fragment, isValidElement, useEffect, useState } from 'react'\nimport styled, { css } from 'styled-components'\nimport type { ReactNode } from 'react'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport { getToken as token } from 'theming'\nimport { conditional, whenProps, prop } from 'tools/index'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport { Checkbox } from 'components/Checkbox'\nimport { Radio } from 'components/Radio'\nimport { Link } from 'components/Link'\nimport { Text } from 'components/Text'\nimport { Dropdown } from 'components/Dropdown'\nimport { Layout } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport { Children as InternalButton } from 'components/Button/Button'\n\nimport {\n isCellSelected,\n TableSelectionProvider,\n useIsCellSelected,\n useSelection,\n useTableSelection,\n} from './Selection'\nimport TableSortHandle from './TableSortHandle'\n\nimport type {\n TableProps,\n TableSectionProps,\n TableRowProps,\n TableCellProps,\n TableCaptionProps,\n TableSelectionProps,\n SelectionCellProps,\n TablePickerItemProps,\n TablePickerProps,\n ExpandableTableRowProps,\n} from './Table.types'\n\nconst StyledTableBody = styled.tbody`\n /* placeholder */\n`\n\nconst StyledTableFoot = styled.tfoot`\n box-shadow: 0 -1px 0 ${token('color-neutral')};\n`\n\nconst StyledTableCaption = styled.caption<{ $position?: 'top' | 'bottom' }>`\n ${conditional({\n ['border-bottom']: whenProps([{ $position: ['top', undefined] }]),\n ['border-top']: whenProps({ $position: 'bottom' }),\n })}: solid 1px ${token('color-neutral-lighter')};\n\n ${conditional({\n ['margin-bottom']: whenProps([{ $position: ['top', undefined] }]),\n ['margin-top']: whenProps({ $position: 'bottom' }),\n })}: ${token('space-m')};\n padding: ${token('space-m')} ${token('space-s')};\n\n text-align: left;\n\n caption-side: ${prop('$position', 'top')};\n background-color: ${token('color-neutral-white')};\n`\n\nconst StyledCell = css<{ alignment?: string }>`\n color: ${token('color-neutral-darker')};\n text-align: ${prop('alignment', 'left')};\n vertical-align: middle;\n`\n\nconst StyledTableCell = styled.td<{ alignment?: string; format?: string }>`\n ${StyledCell}\n\n font-family: ${conditional({\n 'font-family-monospace': whenProps({ format: ['number', 'currency'] }),\n 'font-family-default': whenProps({ format: 'default' }),\n })};\n`\n\nconst StyledTableHeadCell = styled.th<{\n alignment?: string\n clickable: boolean\n}>`\n ${StyledCell}\n\n font-family: ${token('font-family-default')};\n\n font-weight: ${token('font-weight-bold')};\n\n text-transform: capitalize;\n\n cursor: ${conditional({\n pointer: whenProps({ clickable: true }),\n normal: whenProps({ clickable: false }),\n })};\n`\n\nconst StyledTableHead = styled.thead`\n border: 1px solid ${token('color-neutral-lighter')};\n\n ${StyledTableCell} {\n padding: ${token('space-s')};\n\n font-weight: ${token('font-weight-bold')};\n text-transform: capitalize;\n }\n`\n\nconst StyledTableRow = styled.tr<{ selected: boolean; isExpanded: boolean }>`\n ${StyledTableHead} > & {\n background-color: ${token('color-neutral-lightest')};\n }\n\n ${StyledTableFoot} > & {\n background-color: ${token('color-neutral-lightest')};\n }\n\n background-color: ${conditional({\n 'table-row-selected-color': whenProps({ selected: true }),\n 'color-neutral-white': whenProps({ selected: false }),\n })};\n ${hoverable`\n background-color: ${conditional({\n 'table-row-selected-color': whenProps({ selected: true }),\n })} !important;\n `}\n\n border-color: ${token('color-neutral-lighter')};\n border-width: 1px;\n border-top-style: solid;\n border-right-style: solid;\n border-left-style: solid;\n border-bottom-style: ${conditional({\n solid: whenProps({ isExpanded: false }),\n hidden: whenProps({ isExpanded: true }),\n })};\n\n box-shadow: ${conditional({\n '0px 3px 3px 0px #C1CED9': whenProps({ isExpanded: true }),\n none: whenProps({ isExpanded: false }),\n })};\n\n ${StyledTableBody} > & {\n ${hoverable`\n background-color: ${token('color-neutral-lighter')};\n `}\n\n ${focusable`\n box-shadow: inset ${token('shadow-glow-primary')};\n `}\n }\n`\n\nconst StyledExpandableContentRow = styled.tr`\n border-color: ${token('color-neutral-lighter')};\n border-width: 1px;\n border-top-style: hidden;\n border-right-style: solid;\n border-left-style: solid;\n border-bottom-style: solid;\n`\n\nconst StyledTable = styled.table<{ scale?: string }>`\n width: 100%;\n\n white-space: nowrap;\n\n background-color: ${token('color-neutral-lightest')};\n\n border-collapse: collapse;\n\n ${StyledTableBody} ${StyledTableRow} {\n height: ${conditional({\n '24px': whenProps({ scale: 'small' }),\n '48px': whenProps({ scale: 'default' }),\n '80px': whenProps({ scale: 'large' }),\n })};\n }\n\n ${StyledTableHeadCell},\n ${StyledTableCell} {\n padding: ${conditional({\n 'space-xs': whenProps({ scale: 'small' }),\n 'space-s': whenProps({ scale: ['default', 'large'] }),\n })};\n\n font-size: ${conditional({\n 'font-size-5': whenProps({ scale: 'small' }),\n 'font-size-4': whenProps({ scale: ['default', 'large'] }),\n })};\n }\n`\n\nconst RotatableIcon = styled(Icon)<{ $rotate: boolean }>`\n ${conditional({\n 'transform: rotate(90deg);': whenProps({ $rotate: true }),\n })}\n`\n\nfunction Table<T>({\n children,\n selection,\n scale = 'default',\n ...others\n}: TableProps<T>): JSX.Element {\n return (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <TableSelectionProvider selection={selection}>\n <StyledTable scale={scale} {...others}>\n {children}\n </StyledTable>\n </TableSelectionProvider>\n )\n}\n\nconst TableCaptionInner = styled.div<{ $height?: number }>`\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: ${prop('$height', 36)}px;\n`\n\nfunction TableCaption({ children, position, height }: TableCaptionProps): JSX.Element {\n return (\n <StyledTableCaption $position={position}>\n <TableCaptionInner $height={height}>{children}</TableCaptionInner>\n </StyledTableCaption>\n )\n}\n\nfunction TableHead({ children, ...others }: TableSectionProps): JSX.Element {\n return <StyledTableHead {...others}>{children}</StyledTableHead>\n}\n\nfunction TableBody({ children, ...others }: TableSectionProps): JSX.Element {\n return <StyledTableBody {...others}>{children}</StyledTableBody>\n}\n\nfunction TableCell({\n children,\n alignment = 'left',\n format = 'default',\n ...others\n}: TableCellProps): JSX.Element {\n return (\n <StyledTableCell alignment={alignment} format={format} {...others}>\n {children}\n </StyledTableCell>\n )\n}\n\nfunction SelectionCell<T>({ value, ...props }: SelectionCellProps<T>): JSX.Element {\n const { toggle, register, config } = useTableSelection()\n\n const selected = useIsCellSelected(value)\n\n const action = () => toggle(value as T)\n\n useEffect(() => {\n register(value)\n }, [value, register])\n\n if (props.children) {\n return (\n <TableCell>\n {props.children({\n selected,\n toggle: action,\n })}\n </TableCell>\n )\n }\n\n const Input = config.multiple ? Checkbox : Radio\n\n return (\n <TableCell {...props}>\n {value ? <Input checked={selected} scale=\"small\" onChange={action} /> : null}\n </TableCell>\n )\n}\n\nfunction SelectionHeadCell<T>(props: SelectionCellProps<T>): JSX.Element {\n const { allRowsAreSelected, toggleAll, config } = useTableSelection()\n\n const selected = allRowsAreSelected\n const action = () => toggleAll()\n\n if (props.children) {\n return <TableHeadCell {...props}>{props.children({ selected, toggle: action })}</TableHeadCell>\n }\n\n const Input = config.multiple ? Checkbox : Fragment\n\n return (\n <TableHeadCell {...props}>\n <Input checked={selected} scale=\"small\" onChange={action} />\n </TableHeadCell>\n )\n}\n\nfunction TableRow({ children, ...others }: TableRowProps): JSX.Element {\n const selected = useIsRowSelected(children)\n\n return (\n <StyledTableRow {...others} selected={selected} isExpanded={false}>\n {children}\n </StyledTableRow>\n )\n}\n\nfunction ExpandableTableRow({\n expandableContent,\n expanded,\n leading: propsLeading,\n children,\n onExpandedChange,\n initialExpanded = false,\n ...others\n}: ExpandableTableRowProps): JSX.Element {\n const [openState, setOpenState] = useState(initialExpanded)\n\n const selected = useIsRowSelected(children)\n\n const open = expanded ?? openState\n const isExpanded = Boolean(open && expandableContent)\n const colSpan = Array.isArray(children) ? children.length + 1 : 1\n\n let leading: ReactNode = <RotatableIcon name=\"caret-right\" $rotate={open} />\n if (propsLeading) {\n leading = isFunction(propsLeading) ? propsLeading(open) : propsLeading\n }\n\n function toggle() {\n if (!expandableContent) return\n\n onExpandedChange?.(!open)\n setOpenState(!open)\n }\n\n return (\n <>\n <StyledTableRow {...others} onClick={toggle} isExpanded={isExpanded} selected={selected}>\n <TableCell>{expandableContent && leading}</TableCell>\n {children}\n </StyledTableRow>\n {isExpanded && (\n <StyledExpandableContentRow>\n <StyledTableCell colSpan={colSpan}>{expandableContent}</StyledTableCell>\n </StyledExpandableContentRow>\n )}\n </>\n )\n}\n\nfunction TableHeadCell({\n alignment = 'left',\n children,\n onClick,\n ...others\n}: TableCellProps): JSX.Element {\n return (\n <StyledTableHeadCell\n clickable={onClick != null}\n alignment={alignment}\n onClick={onClick}\n {...others}\n >\n <Layout.Group space=\"xs\" align=\"center\">\n {children}\n </Layout.Group>\n </StyledTableHeadCell>\n )\n}\n\nconst ActionsWrapper = styled.div`\n display: flex;\n gap: ${token('space-s')};\n margin-left: auto;\n`\n\nfunction TableSelectionActions({ buttons, children, ...others }: TableSelectionProps): JSX.Element {\n const { values, clear } = useSelection()\n\n return (\n <ActionsWrapper {...others}>\n {values.length > 0 ? (\n <>\n {buttons.map((Action, i) => (\n <Action key={i} values={values} />\n ))}\n <Link\n onClick={(e) => {\n e.preventDefault()\n clear()\n }}\n >\n <Text variant=\"link\">CANCEL</Text>\n </Link>\n </>\n ) : (\n children\n )}\n </ActionsWrapper>\n )\n}\n\nconst StyledPickerTrigger = styled(Dropdown.Trigger.Button)`\n padding: 0;\n\n ${InternalButton} {\n margin: ${token('space-2xs')};\n }\n`\n\nfunction TablePickerItem<T>({\n option,\n checked,\n children,\n ...props\n}: TablePickerItemProps<T>): JSX.Element {\n return (\n <Dropdown.Item\n leading={\n checked ? (\n <Icon name=\"check\" size=\"16\" color=\"neutral-darker\" />\n ) : (\n <Layout.Box padding=\"s\" />\n )\n }\n role=\"option\"\n aria-selected={checked ? 'true' : 'false'}\n {...props}\n >\n {children || (option && (option.option || option.title || option.key)) || 'Column'}\n </Dropdown.Item>\n )\n}\n\nconst TriggerIcon = styled(Icon).attrs({\n name: 'dots-horizontal',\n size: '12',\n color: 'neutral-darker',\n})`\n transform: rotate(90deg);\n`\n\nfunction TablePicker<T>({\n value,\n onChange,\n options,\n align,\n children,\n trigger: propsTrigger,\n ...props\n}: TablePickerProps<T>): JSX.Element {\n return (\n <Dropdown align={align}>\n <StyledPickerTrigger trailing={null} scale=\"small\" {...props}>\n {propsTrigger !== undefined ? (\n ({ expanded }) => (isFunction(propsTrigger) ? propsTrigger(expanded) : propsTrigger)\n ) : (\n <TriggerIcon />\n )}\n </StyledPickerTrigger>\n <Dropdown.Menu role=\"listbox\">\n {children ||\n options?.map((option, i) => (\n <TablePickerItem\n key={i}\n option={option}\n checked={option.key === value?.key}\n onClick={() => onChange?.(option)}\n />\n ))}\n </Dropdown.Menu>\n </Dropdown>\n )\n}\n\nfunction useIsRowSelected(children: ReactNode): boolean {\n const { selected, config } = useTableSelection()\n\n if (!selected) return false\n\n const arrChildren = Children.toArray(children)\n\n const selectionCellChild = arrChildren.find((child) => {\n return isValidElement(child) && child.type === SelectionCell\n })\n\n if (!selectionCellChild) return false\n\n const { value } = (selectionCellChild as React.ReactElement).props as SelectionCellProps\n\n if (!value) return false\n\n return isCellSelected(value, selected, config)\n}\n\nTable.Head = TableHead\nTable.Body = TableBody\nTable.Row = TableRow\nTable.Cell = TableCell\nTable.HeadCell = TableHeadCell\nTable.Foot = StyledTableFoot\nTable.Caption = TableCaption\nTable.Selection = {\n Actions: TableSelectionActions,\n Cell: SelectionCell,\n HeadCell: SelectionHeadCell,\n}\nTable.ExpandableRow = ExpandableTableRow\nTable.SortHandle = TableSortHandle\nTablePicker.Item = TablePickerItem\nTable.Picker = TablePicker\n\nexport { useSelection }\n\nexport default Table\n","import React from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport { BaseLink } from 'components/Link'\nimport styled from 'styled-components'\n\nexport type LogoProps = PropsWithChildren<{\n url: string\n className?: string\n}>\n\nfunction Logo({ url, className, children }: LogoProps): JSX.Element {\n return (\n <BaseLink className={className} href={url}>\n {children}\n </BaseLink>\n )\n}\n\nexport default styled(Logo)<LogoProps>({})\n","import React from 'react'\nimport type { PropsWithChildren, ReactNode, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport { Dropdown, DropdownMenu, DropdownMenuItem, DropdownTrigger } from 'components/Dropdown'\nimport { BaseLink } from 'components/Link'\nimport useID from 'hooks/useID'\nimport ellipsizable from 'styles/ellipsizable'\nimport typography from 'styles/typography'\nimport { Popover } from 'components/Popover'\n\nexport const MenuDropdown = styled(Dropdown)({})\n\nexport const MenuDropdownSeparator = styled.hr`\n margin: ${token('space-s')} ${token('space-m')};\n\n color: ${token('top-navigation-dropdown-separator-color')};\n`\n\nconst MenuDropdownTrigger = styled(DropdownTrigger.Handle)`\n color: ${token('top-navigation-dropdown-trigger-color')};\n`\n\nexport const MenuDropdownLabel = styled.label`\n ${transition()}\n\n align-items: center;\n display: flex;\n\n ${typography('body-bold', { color: 'top-navigation-item-color' })}\n\n cursor: pointer;\n\n ${focusable`\n color: ${token('top-navigation-item-color--hover')};\n `}\n`\n\nconst Ellipsizable = styled.span<{ $max: number }>`\n ${ellipsizable()}\n\n max-width: ${(props) => props.$max}px;\n`\n\nconst IconWrapper = styled.div`\n width: ${token('space-m')};\n`\n\nconst MenuDropdownSubItemLink = styled(BaseLink)`\n align-items: stretch;\n ${typography('body', { color: 'top-navigation-dropdown-subitem-color' })}\n\n ${hoverable`\n text-decoration: none;\n font-weight: inherit;\n `}\n\n ${focusable`\n > * {\n background-color: ${token('color-neutral-lighter')}\n }\n `}\n`\n\ntype MenuDropdownSubItemProps = HTMLAttributes<HTMLElement> & {\n label: string\n url?: string\n icon?: ReactNode\n separator?: boolean\n}\n\nexport function MenuDropdownSubItem({\n icon,\n label,\n url,\n ...rest\n}: MenuDropdownSubItemProps): JSX.Element {\n return url ? (\n <MenuDropdownSubItemLink {...rest} href={url}>\n <DropdownMenuItem tabIndex={-1} leading={<IconWrapper>{icon}</IconWrapper>}>\n {label}\n </DropdownMenuItem>\n </MenuDropdownSubItemLink>\n ) : (\n <DropdownMenuItem leading={<IconWrapper>{icon}</IconWrapper>} {...rest}>\n {label}\n </DropdownMenuItem>\n )\n}\n\nexport type MenuItemDropdownProps = PropsWithChildren<{\n label: string\n}>\n\nfunction MenuItemDropdown(props: MenuItemDropdownProps): JSX.Element {\n const { label, children, ...rest } = props\n const labelId = useID()\n\n return (\n <MenuDropdown align=\"end\" key={label}>\n <Popover.Reference>\n <MenuDropdownLabel>\n <Ellipsizable $max={120} id={labelId}>\n {label}\n </Ellipsizable>\n <MenuDropdownTrigger {...rest} tabIndex={0} aria-labelledby={labelId} />\n </MenuDropdownLabel>\n </Popover.Reference>\n <DropdownMenu>{children}</DropdownMenu>\n </MenuDropdown>\n )\n}\n\nexport { MenuItemDropdown }\n","import React from 'react'\nimport type { ReactNode } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport { BaseLink } from 'components/Link'\nimport conditional, { whenProps } from 'tools/conditional'\nimport typography from 'styles/typography'\n\nconst MenuLink = styled(BaseLink)<{ hasIcon?: boolean }>`\n ${typography('body-bold')}\n\n color: ${conditional({\n 'top-navigation-item-icon-color': whenProps({ hasIcon: true }),\n 'top-navigation-item-color': whenProps({ hasIcon: false }),\n })};\n\n ${hoverable`\n text-decoration: none;\n color: ${token('top-navigation-item-color--hover')};\n `}\n\n ${focusable`\n color: ${token('top-navigation-item-color--hover')};\n `}\n`\n\ntype MenuItemIconProps = {\n label: string\n icon?: ReactNode\n url?: string\n}\n\nexport function MenuItemIcon({ url, icon, label, ...rest }: MenuItemIconProps): JSX.Element {\n if (icon) {\n return (\n <MenuLink {...rest} href={url} hasIcon title={label}>\n {icon}\n </MenuLink>\n )\n }\n\n return (\n <MenuLink {...rest} href={url}>\n {label}\n </MenuLink>\n )\n}\n","import React from 'react'\nimport type { PropsWithChildren, ReactNode, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport {\n MenuItemDropdown,\n MenuDropdown,\n MenuDropdownSubItem,\n MenuDropdownSeparator,\n} from './MenuItemDropdown'\nimport { MenuItemIcon } from './MenuItemIcon'\nimport conditional, { whenProps } from 'tools/conditional'\n\ntype MenuItemProps = HTMLAttributes<HTMLElement> &\n PropsWithChildren<{\n label: string\n icon?: ReactNode\n url?: string\n }>\n\nexport type MenuProps = PropsWithChildren<{\n align?: 'left' | 'right'\n}>\n\nconst MenuContainer = styled.nav<{ $align: MenuProps['align'] }>`\n ${conditional({\n 'margin-left: auto;': whenProps({ $align: 'right' }),\n })}\n\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ${token('space-m')};\n }\n\n & > * + ${MenuDropdown} {\n margin-left: ${token('space-xl')};\n }\n`\n\nfunction MenuItem(props: MenuItemProps): JSX.Element {\n if (props.children) {\n return <MenuItemDropdown {...props} />\n }\n\n return <MenuItemIcon {...props} />\n}\n\nfunction Menu(props: MenuProps): JSX.Element {\n const { align = 'left' } = props\n\n return <MenuContainer $align={align}>{props.children}</MenuContainer>\n}\n\nMenu.Item = MenuItem\nMenu.SubItem = MenuDropdownSubItem\nMenu.Separator = MenuDropdownSeparator\n\nexport default Menu\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\n\nexport type OpenSideNavButtonProps = {\n className?: string\n onClick: () => void\n}\n\nconst Container = styled.button`\n margin-right: ${token('space-2xl')};\n\n background: none;\n border: none;\n cursor: pointer;\n`\n\nfunction OpenSideNavButton({ className, onClick }: OpenSideNavButtonProps): JSX.Element {\n return (\n <Container className={className} onClick={onClick}>\n <Icon name=\"burguer-menu\" size={24} data-testid=\"toggle-sidenav\" />\n </Container>\n )\n}\n\nexport default styled(OpenSideNavButton)<OpenSideNavButtonProps>({})\n","import React from 'react'\nimport type { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Logo } from './Logo'\nimport { Menu } from './Menu'\nimport { MenuDropdownLabel } from './Menu/MenuItemDropdown'\nimport { OpenSideNavButton } from './OpenSideNavButton'\n\n/* We need to remove the 8px padding-right that DropdownTrigger adds (because of\n BaseStyledButton), in order to keep it always 40px to the right, but only when\n it's the last child. DropdownTigger isn't a StyledComponent so we need to use\n MenuDropdownLabel here since it's the one that wraps DropdownTigger */\nconst removeRightPadding = css`\n > :last-child ${MenuDropdownLabel} {\n margin-right: -${token('space-m')};\n }\n`\n\nconst Container = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n height: ${token('top-navigation-height')};\n padding: 0 ${token('space-2xl')};\n\n background-color: ${token('top-navigation-background-color')};\n border-bottom: solid 1px ${token('top-navigation-border-color')};\n\n ${removeRightPadding}\n`\n\nexport interface TopNavigationProps {\n children?: ReactNode\n}\n\nfunction TopNavigation({ children }: TopNavigationProps): JSX.Element {\n return <Container>{children}</Container>\n}\n\nTopNavigation.Logo = Logo\nTopNavigation.Menu = Menu\nTopNavigation.OpenSideNavButton = OpenSideNavButton\n\nexport default TopNavigation\n","import React, { FC, Fragment } from 'react'\nimport styled from 'styled-components'\n\nimport type { EmptyStateWithIconProps } from './EmptyState.types'\n\nimport { Stack, Group } from 'components/Layout'\nimport Text from 'components/Text/Text'\nimport Button from 'components/Button/Button'\n\nconst VerticalWrapper = styled(Stack)`\n text-align: center;\n`\n\nconst EmptyStateWithIcon: FC<EmptyStateWithIconProps> = ({\n variant = 'card',\n icon,\n title,\n action,\n children,\n ...props\n}: EmptyStateWithIconProps) => {\n const isHorizontal = variant === 'horizontal-card'\n const Wrapper = isHorizontal ? Group : VerticalWrapper\n\n return (\n <Wrapper {...props} space={isHorizontal ? 's' : 'xs'} align=\"center\" justify=\"center\">\n {children || (\n <Fragment>\n {icon}\n <Text variant=\"caption-bold\">{title}</Text>\n {action && (\n <Button variant=\"primary\" scale=\"small\" {...action}>\n {action.label}\n </Button>\n )}\n </Fragment>\n )}\n </Wrapper>\n )\n}\n\nexport default EmptyStateWithIcon\n","import React, { FC } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nimport type { IllustrationProps } from './EmptyState.types'\n\nconst Wrapper = styled.div<Pick<IllustrationProps, 'scale'>>`\n & > img:first-of-type,\n SVG:first-of-type {\n height: ${conditional({\n '240px': whenProps({ scale: 'large' }),\n '120px': whenProps({ scale: 'default' }),\n })};\n object-fit: cover;\n }\n`\n\nexport const Illustration: FC<IllustrationProps> = ({\n illustration,\n scale,\n ...props\n}: IllustrationProps) => (\n <Wrapper scale={scale} {...props}>\n {typeof illustration === 'string' ? <img src={illustration} alt=\"\" /> : illustration}\n </Wrapper>\n)\n\nexport default Illustration\n","import React, { FC, Fragment } from 'react'\nimport styled from 'styled-components'\n\nimport { Stack } from 'components/Layout'\nimport Text from 'components/Text/Text'\nimport Button from 'components/Button/Button'\n\nimport type { EmptyStateWithIllustrationProps } from './EmptyState.types'\nimport Illustration from './Illustration'\n\nconst Wrapper = styled(Stack)`\n max-width: 320px;\n\n text-align: center;\n`\n\nconst EmptyStateWithIllustration: FC<EmptyStateWithIllustrationProps> = ({\n variant = 'page',\n illustration,\n title,\n description,\n action,\n children,\n ...props\n}: EmptyStateWithIllustrationProps) => {\n const isPageVariant = variant === 'page'\n\n return (\n <Wrapper {...props} align=\"center\" justify=\"center\" space=\"m\">\n {children || (\n <Fragment>\n {illustration && (\n <Illustration illustration={illustration} scale={isPageVariant ? 'large' : 'default'} />\n )}\n {(title || description) && (\n <Stack space=\"xs\">\n {title && (\n <Text\n variant={isPageVariant ? 'heading-sm-bold' : 'body-bold'}\n color={isPageVariant ? 'color-neutral-darkest' : 'color-neutral-darker'}\n >\n {title}\n </Text>\n )}\n {description && (\n <Text\n data-testid=\"empty-state-description\"\n variant={isPageVariant ? 'body' : 'caption'}\n color=\"color-neutral-darkest\"\n >\n {description}\n </Text>\n )}\n </Stack>\n )}\n {action && (\n <Button\n className=\"empty-state-action\"\n variant=\"primary\"\n scale={isPageVariant ? 'default' : 'small'}\n {...action}\n >\n {action.label}\n </Button>\n )}\n </Fragment>\n )}\n </Wrapper>\n )\n}\n\nexport default EmptyStateWithIllustration\n","import React from 'react'\n\nimport type {\n EmptyStateProps,\n EmptyStateWithIconProps,\n EmptyStateWithIllustrationProps,\n} from './EmptyState.types'\n\nimport EmptyStateWithIcon from './EmptyStateWithIcon'\nimport EmptyStateWithIllustration from './EmptyStateWithIllustration'\nimport Illustration from './Illustration'\n\nconst EmptyState = (props: EmptyStateProps): JSX.Element => {\n if (['card', 'horizontal-card'].includes(props.variant)) {\n return <EmptyStateWithIcon {...(props as EmptyStateWithIconProps)} />\n }\n return <EmptyStateWithIllustration {...(props as EmptyStateWithIllustrationProps)} />\n}\n\nEmptyState.Illustration = Illustration\n\nexport default EmptyState\n","export function aliased<T>(aliasMap: Record<number | string, T>, alias: number | string): T {\n return aliasMap[String(alias).toLowerCase()]\n}\n\nexport const MONTH_BY_ALIAS = {\n 0: 'january',\n jan: 'january',\n january: 'january',\n\n 1: 'february',\n feb: 'february',\n february: 'february',\n\n 2: 'march',\n mar: 'march',\n march: 'march',\n\n 3: 'april',\n apr: 'april',\n april: 'april',\n\n 4: 'may',\n may: 'may',\n\n 5: 'june',\n jun: 'june',\n june: 'june',\n\n 6: 'july',\n jul: 'july',\n july: 'july',\n\n 7: 'august',\n aug: 'august',\n august: 'august',\n\n 8: 'september',\n sep: 'september',\n september: 'september',\n\n 9: 'october',\n oct: 'october',\n october: 'october',\n\n 10: 'november',\n nov: 'november',\n november: 'november',\n\n 11: 'december',\n dec: 'december',\n december: 'december',\n}\n\nexport type CalendarMonthAlias = keyof typeof MONTH_BY_ALIAS\n\nexport type CalendarMonth = {\n name: string\n /**\n * Integer value representing the month, beginning with 0 for January to 11 for December.\n * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date\n */\n index: number\n}\n\nexport const MONTH_BY_NAME: Record<string, CalendarMonth> = {\n january: {\n name: 'January',\n index: 0,\n },\n february: {\n name: 'February',\n index: 1,\n },\n march: {\n name: 'March',\n index: 2,\n },\n april: {\n name: 'April',\n index: 3,\n },\n may: {\n name: 'May',\n index: 4,\n },\n june: {\n name: 'June',\n index: 5,\n },\n july: {\n name: 'July',\n index: 6,\n },\n august: {\n name: 'August',\n index: 7,\n },\n september: {\n name: 'September',\n index: 8,\n },\n october: {\n name: 'October',\n index: 9,\n },\n november: {\n name: 'November',\n index: 10,\n },\n december: {\n name: 'December',\n index: 11,\n },\n}\n\nfunction getMonthByAlias(alias: CalendarMonthAlias): CalendarMonth {\n alias = aliased(MONTH_BY_ALIAS, alias) as CalendarMonthAlias\n\n return MONTH_BY_NAME[alias]\n}\n\nfunction getAllMonths() {\n return (Object.keys(MONTH_BY_NAME) as CalendarMonthAlias[]).map((alias) => {\n return getMonthByAlias(alias)\n })\n}\n\nfunction MonthHelper(alias: CalendarMonthAlias): {\n get(): CalendarMonth\n format(representation?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow'): string\n is(other: CalendarMonthAlias): boolean\n} {\n const month = getMonthByAlias(alias)\n\n return {\n get() {\n return month\n },\n /**\n * Follows same values available in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat.\n * * \"numeric\" (e.g., 3)\n * * \"2-digit\" (e.g., 03)\n * * \"long\" (e.g., March)\n * * \"short\" (e.g., Mar)\n * * \"narrow\" (e.g., M)\n */\n format(representation: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'long') {\n switch (representation) {\n case 'numeric':\n return String(month.index + 1)\n case '2-digit':\n return String(month.index + 1).padStart(2, '0')\n case 'short':\n return month.name.slice(0, 3)\n case 'narrow':\n return month.name.slice(0, 1)\n default:\n return month.name\n }\n },\n is(other: CalendarMonthAlias) {\n return (\n getMonthByAlias(other) != null &&\n aliased(MONTH_BY_ALIAS, alias) === aliased(MONTH_BY_ALIAS, other)\n )\n },\n }\n}\n\nMonthHelper.getAll = getAllMonths\n\nexport default MonthHelper\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport focusable from 'styles/focusable'\nimport disableable from 'styles/disableable'\nimport typography from 'styles/typography'\n\nimport type { ButtonProps } from 'components/Button'\n\nconst Button = styled(BaseButton)`\n user-select: none;\n\n ${typography(\n conditional({\n 'body-bold': whenProps({ 'aria-expanded': true }),\n body: whenProps({ 'aria-expanded': false }),\n })\n )};\n border-color: transparent;\n background-color: transparent;\n\n color: ${token('color-neutral-dark')};\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n `}\n\n ${disableable`\n pointer-events: none;\n opacity: 1;\n `}\n`\n\nconst Caret = styled(Icon)<{ $rotate: boolean }>`\n ${conditional({\n 'transform: rotate(180deg);': whenProps({ $rotate: true }),\n })}\n`\n\nfunction PickerModeToggle(\n props: Omit<ButtonProps & { expanded: boolean }, 'trailing'>\n): JSX.Element {\n const { expanded, disabled, ...others } = props\n\n return (\n <Button\n type=\"button\"\n {...others}\n aria-haspopup=\"true\"\n aria-expanded={expanded}\n disabled={disabled}\n trailing={!disabled && <Caret name=\"chevron-down\" size={16} $rotate={expanded} />}\n />\n )\n}\n\nexport default PickerModeToggle\n","import { isFunction } from '@loadsmart/utils-function'\nimport isEmpty from 'utils/toolset/isEmpty'\n\nexport type DateHelperOptions = {\n normalize?: boolean\n}\n\nexport const DEFAULT_OPTIONS: DateHelperOptions = {\n normalize: true,\n}\n\nexport type InputDate = string | number | Date\n\ntype Unit = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'\ntype Operator = '>=' | '>' | '=' | '<' | '<='\n\nexport type DateConstraint =\n | InputDate\n | [InputDate, InputDate]\n | [null, InputDate]\n | [InputDate, null]\n\nexport type FunctionConstraint = (day: CalendarDate) => boolean\n\nexport type CalendarConstraint = DateConstraint | FunctionConstraint\n\nexport interface CalendarDate {\n /**\n * Get `Date` object representing this date.\n * @returns {Date}\n */\n get(): Date\n /**\n * Get the year using Universal Coordinated Time (UTC).\n * @returns {number}\n */\n getYear(): number\n /**\n * Gets the month using Universal Coordinated Time (UTC).\n * @returns {number}\n */\n getMonth(): number\n /**\n * Get the day-of-the-month, using Universal Coordinated Time (UTC).\n * @returns {number}\n */\n getDate(): number\n /**\n * Get the time value in milliseconds.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getTime(): number\n /**\n * Get the day of the week.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getWeekday(): number\n /**\n * Get the hours value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getHours(): number\n /**\n * Get the minutes value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getMinutes(): number\n /**\n * Get the seconds value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getSeconds(): number\n /**\n * Get the milliseconds value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getMilliseconds(): number\n /**\n * Check if the current date matches **at least one** of the provided constraints.\n *\n * [!] Be aware that all dates in this comparison will be normalized to 12:00:00 (UTC).\n *\n * @param {...CalendarConstraint[]} constraintsArg\n * @returns {boolean}\n */\n matches(...constraints: CalendarConstraint[]): boolean\n /**\n * Set the given `value` to the `unit` property of this instance.\n * This function mutates the internal date instance.\n * @param {Unit} unit\n * @param {number} value\n * @returns {CalendarDate}\n */\n set(unit: Unit, value: number): CalendarDate\n /**\n * Return a copy of this instance, adding the given `value` to the `unit` property.\n * @param {Unit} unit\n * @param {number} value\n * @returns {CalendarDate}\n */\n add(unit: Unit, value: number): CalendarDate\n /**\n * Return a copy of this instance, subtracting the given `value` from the `unit` property.\n * @param {Unit} unit\n * @param {number} value\n * @returns {CalendarDate}\n */\n subtract(unit: Unit, value: number): CalendarDate\n /**\n * Compare this date with the given `other`.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @param {Operator} operator - type of comparison to be performed.\n * @param {CalendarDate} other - Other `CalendarDate` to compare with.\n * @param {Unit} [precision] - notice that the precision increases with the evaluated period, so year < month < day < hour < minute < second < millisecond. Default is 'day'.\n * @return {boolean} comparison result\n */\n is(operator: Operator, other: CalendarDate, precision?: string): boolean\n /**\n * Return this date as a string value in ISO format.\n * @returns {string}\n */\n toString(): string\n}\n\nexport type CalendarDateRange = [CalendarDate | null, CalendarDate | null]\n\n/**\n * Ideally, follow the date/time string formats:\n * * `YYYY-MM-DD`\n * * `YYYY-MM-DDTHH:mm:ss.sssZ`\n * * `YYYY-MM-DDTHH:mm:ss.sss+00:00`\n *\n * `dateArg` is expected to have timezone information or to be UTC.\n *\n * By default, we normalize the input date to 12:00:00 (UTC); this simplifies comparison of dates; be mindful\n * of this when using this helper for time relate logic.\n * You can disable this behavior by passing `options.normalize: false`.\n *\n * @param {InputDate} [dateArg]\n * @return {CalendarDate}\n */\nfunction DateHelper(dateArg?: InputDate, optionsArg = DEFAULT_OPTIONS): CalendarDate {\n const options = { ...DEFAULT_OPTIONS, ...optionsArg }\n const utcDate = (function normalizeToUTC() {\n let date = new Date()\n\n if (dateArg != null) {\n date = new Date(dateArg)\n }\n\n // create a date with local timezone based on the UTC input date\n const utcDate = new Date(\n Date.UTC(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n options.normalize ? 12 : date.getUTCHours(),\n options.normalize ? 0 : date.getUTCMinutes(),\n options.normalize ? 0 : date.getUTCSeconds(),\n options.normalize ? 0 : date.getUTCMilliseconds()\n )\n )\n\n return utcDate\n })()\n\n return {\n get() {\n return utcDate\n },\n getYear() {\n return utcDate.getUTCFullYear()\n },\n getMonth() {\n return utcDate.getUTCMonth()\n },\n getDate() {\n return utcDate.getUTCDate()\n },\n getTime() {\n return utcDate.getTime()\n },\n getWeekday() {\n return utcDate.getUTCDay()\n },\n getHours() {\n return utcDate.getUTCHours()\n },\n getMinutes() {\n return utcDate.getUTCMinutes()\n },\n getSeconds() {\n return utcDate.getUTCSeconds()\n },\n getMilliseconds() {\n return utcDate.getUTCMilliseconds()\n },\n matches(...constraints: CalendarConstraint[]): boolean {\n if (isEmpty(constraints)) {\n return false\n }\n\n const constraintEvaluators = constraints.map(getConstraintEvaluator)\n const date = DateHelper(utcDate)\n\n return constraintEvaluators.some((evaluator) => {\n return evaluator(date)\n })\n },\n add(unit: Unit, value: number) {\n return add(utcDate, unit, value)\n },\n subtract(unit: Unit, value: number) {\n return add(utcDate, unit, -1 * value)\n },\n set(unit: Unit, value: number) {\n const newValue = {\n year: utcDate.getUTCFullYear(),\n month: utcDate.getUTCMonth(),\n day: utcDate.getUTCDate(),\n hour: utcDate.getUTCHours(),\n minute: utcDate.getUTCMinutes(),\n second: utcDate.getUTCSeconds(),\n millisecond: utcDate.getUTCMilliseconds(),\n [unit]: value,\n }\n\n utcDate.setUTCFullYear(newValue.year)\n utcDate.setUTCMonth(newValue.month)\n utcDate.setUTCDate(newValue.day)\n utcDate.setUTCHours(newValue.hour)\n utcDate.setUTCMinutes(newValue.minute)\n utcDate.setUTCSeconds(newValue.second)\n utcDate.setUTCMilliseconds(newValue.millisecond)\n\n return this\n },\n is(operator: Operator, other: CalendarDate, precision?: Unit): boolean {\n function compare(a: number, b: number) {\n let result\n\n switch (operator) {\n case '>=':\n result = a >= b\n break\n case '>':\n result = a > b\n break\n case '<':\n result = a < b\n break\n case '<=':\n result = a <= b\n break\n default:\n result = a === b\n break\n }\n\n return result\n }\n\n return compare(\n getComparableDate(utcDate, precision),\n getComparableDate(other.get(), precision)\n )\n },\n toString(): string {\n return utcDate.toISOString()\n },\n }\n}\n\n/**\n * This method takes a date and a unit of precision and then normalizes the given date based on that precision.\n * The return will be the timestamp of the normalized date\n *\n * @example\n * ```js\n * getComparableDate(new Date('2022-10-13T17:42:19.948Z'), 'hour')) // returns 1665680400000\n *\n * // '2022-10-13T17:42:19.948Z' will be normalized to '2022-10-13T17:00:00.000Z'\n * // 1665680400000 is equal to: new Date('2022-10-13T17:00:00.000Z').getTime()\n * ```\n *\n * @param {Date} date\n * @param {Unit} precision\n * @returns {number}\n */\nexport function getComparableDate(date: Date, precision: Unit = 'day'): number {\n const DATE_ZERO = MIN_SUPPORTED_DATE.toString()\n const COMPARE_TO = {\n year: 4,\n month: 7,\n day: 10,\n hour: 13,\n minute: 16,\n second: 19,\n millisecond: 24,\n }\n const sliceIndex = COMPARE_TO[precision]\n\n if (sliceIndex == null) {\n throw new Error(`precision ${precision} is not supported`)\n }\n\n const normalizedPart = DATE_ZERO.slice(sliceIndex)\n const datePart = date.toISOString().slice(0, sliceIndex)\n const normalizedDate = `${datePart}${normalizedPart}`\n\n return new Date(normalizedDate).getTime()\n}\n\n/**\n * Constraints represent ranges of dates, inclusive in both ends.\n * Returns an array representing the initial and final timestamps (after the transformations applied by `DateHelper`).\n *\n * @example\n * ```js\n * // to represent a range that starts and ends in the same date\n * getConstraintRange(1643371200000) // returns [1643371200000, 1643371200000]\n * getConstraintRange([1643371200000, 1643371200000]) // returns [1643371200000, 1643371200000]\n * getConstraintRange('2022-01-28T12:00:00.000Z') // returns [1643371200000, 1643371200000]\n * getConstraintRange(['2022-01-28T12:00:00.000Z', '2022-01-28T12:00:00.000Z']) // returns [1643371200000, 1643371200000]\n *\n * // to represent a range that starts at one date and ends at another\n * getConstraintRange([1641038400000, 1643371200000]) // returns [1641038400000, 1643371200000]\n * getConstraintRange(['2022-01-01T12:00:00.000Z', '2022-01-28T12:00:00.000Z']) // returns [1641038400000, 1643371200000]\n *\n * // to represent a range that starts at one date and has no end\n * getConstraintRange([1641038400000, null]) // returns [1641038400000, `MAX_SUPPORTED_DATE`]\n * getConstraintRange(['2022-01-01T12:00:00.000Z', null]) // returns [1641038400000, `MAX_SUPPORTED_DATE`]\n *\n * // to represent a range that ends at one date and has no start\n * getConstraintRange([null, 1643371200000]) // returns [0, 1643371200000]\n * getConstraintRange([null, '2022-01-28T12:00:00.000Z']) // returns [0, 1643371200000]\n * ```\n * @param rangeArg\n * @returns\n */\nexport function getConstraintRange(rangeArg: DateConstraint): [number, number] {\n let range: [number, number]\n\n if (!Array.isArray(rangeArg)) {\n const timestamp = DateHelper(rangeArg).getTime()\n range = [timestamp, timestamp]\n } else {\n const rangeStart = rangeArg[0] != null ? DateHelper(rangeArg[0]) : MIN_SUPPORTED_DATE\n const rangeEnd = rangeArg[1] != null ? DateHelper(rangeArg[1]) : MAX_SUPPORTED_DATE\n\n range = [rangeStart.getTime(), rangeEnd.getTime()]\n }\n\n return range\n}\n\n/**\n * Add the given `value` to the provided `unit` of the provided `date`.\n * @param {Date} date - Date where the operation should be performed.\n * @param {Unit} unit - period\n * @param {number} value - value to be added\n * @returns {Date} new date after the operation.\n */\nfunction add(date: Date, unit: Unit, value: number): CalendarDate {\n const increment = {\n year: 0,\n month: 0,\n day: 0,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n [unit]: value,\n }\n\n const newDate = new Date(\n Date.UTC(\n date.getUTCFullYear() + increment.year,\n date.getUTCMonth() + increment.month,\n date.getUTCDate() + increment.day,\n date.getUTCHours() + increment.hour,\n date.getUTCMinutes() + increment.minute,\n date.getUTCSeconds() + increment.second,\n date.getUTCMilliseconds() + increment.millisecond\n )\n )\n\n // Do not normalize the clone since all units must be preserved.\n return DateHelper(newDate, { normalize: false })\n}\n\n/**\n * Wrap range constraint into a function and return a function constraint untouched.\n * @param {CalendarConstraint} constraint\n * @returns {(day: CalendarDate) => boolean}\n */\nexport function getConstraintEvaluator(\n constraint: CalendarConstraint\n): (day: CalendarDate) => boolean {\n if (isFunction(constraint)) {\n return constraint\n }\n\n const [start, end] = getConstraintRange(constraint)\n\n return function matches(day: CalendarDate): boolean {\n if (start > end) {\n throw new InvalidDateConstraintError([start, end])\n }\n\n return start <= day.getTime() && day.getTime() <= end\n }\n}\n\nexport function padded(value: number | string, maxLength = 2): string {\n return String(value).padStart(maxLength, '0')\n}\n\nexport class InvalidDateConstraintError extends Error {\n constructor([start, end]: [number, number]) {\n super(`Invalid constraint: [${start}, ${end}]`)\n }\n}\n\nexport const TODAY = DateHelper()\n\n/**\n * Maximum and minimum supported `Date`.\n * Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps\n */\nexport const MIN_SUPPORTED_DATE = DateHelper(0, { normalize: false })\nexport const MAX_SUPPORTED_DATE = DateHelper(8.64e15 - 1)\n\nexport default DateHelper\n","import { useEffect, useState } from 'react'\n\nimport { useDidMount } from 'hooks/useDidMount'\nimport toArray from 'utils/toolset/toArray'\n\nimport DateHelper, { TODAY } from './Date.helper'\nimport type { useCalendarProps, useCalendarReturn, RenderableMonth } from './Calendar.types'\n\nfunction useCalendar(props: useCalendarProps): useCalendarReturn {\n const { constraints, onSelect, mode = 'single' } = props\n const amountOfMonthsToRender = mode == 'single' ? 1 : 2\n\n const didMount = useDidMount()\n const [selected, setSelected] = useState<ReturnType<typeof getSelectionPair>>(() =>\n getSelectionPair(props.selected)\n )\n const [renderableMonths, setRenderableMonths] = useState<ReturnType<typeof getRenderableMonths>>(\n () => {\n const month = props.month != null ? props.month : TODAY.getMonth()\n const year = props.year != null ? props.year : TODAY.getYear()\n\n return getRenderableMonths(year, month, amountOfMonthsToRender)\n }\n )\n\n /**\n * Set the month to be rendered (or initial month when calendar is in range mode).\n * @param {Object} args\n * @param {number} [args.month] - Initial month to be rendered, if not provided, the current initial month will be used.\n * @param {number} [args.year] - Initial year to be rendered, if not provided, the current initial month will be used.\n */\n function set(args: { month?: number; year?: number }) {\n const [initialMonth] = renderableMonths\n const date = new Date(args.year ?? initialMonth.year, args.month ?? initialMonth.month)\n\n setRenderableMonths(\n getRenderableMonths(date.getFullYear(), date.getMonth(), amountOfMonthsToRender)\n )\n }\n\n /**\n * Select day or day range.\n * @param range `null` to clear selection, selection range start, or an array with selection start and end.\n */\n function select(range: useCalendarProps['selected']) {\n const [start, end] = getSelectionPair(range)\n\n function getSelectionBoundary(boundary?: string | number | null): string | null {\n if (boundary != null) {\n return DateHelper(boundary).toString()\n }\n\n return null\n }\n\n setSelected([start, end])\n\n if (didMount) {\n // prevent calling onSelect when initialized with value\n onSelect?.([getSelectionBoundary(start), getSelectionBoundary(end)])\n }\n }\n\n /**\n * Clear calendar selection.\n */\n function clear() {\n select([null, null])\n }\n\n useEffect(\n function onMonthOrYearPropsChange() {\n set({\n month: props.month,\n year: props.year,\n })\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.month, props.year]\n )\n\n useEffect(\n function onSelectedPropChange() {\n const newSelected = getSelectionPair(props.selected)\n\n if (newSelected[0] != selected[0] || newSelected[1] != selected[1]) {\n setSelected(newSelected)\n }\n },\n // we just intend to update the internal state when the prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.selected]\n )\n\n return {\n mode,\n months: renderableMonths,\n selected,\n constraints: toArray(constraints || []),\n clear,\n set,\n select,\n }\n}\n\nconst DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000\n\n/**\n * Generate the whole grid of days,\n * @param {number} year\n * @param {number }month\n * @returns {RenderableMonth}\n */\nexport function getRenderableMonth(year: number, month: number): RenderableMonth {\n const date = DateHelper(Date.UTC(year, month))\n\n const firstDayOfTheWeek = date.getWeekday()\n const totalDaysInMonth = 32 - new Date(Date.UTC(year, month, 32)).getUTCDate()\n\n const days = []\n\n /**\n * Filling days of previous month.\n * If the month does not start on Sunday, then we need to generate only the days of\n * the previous month to fill out the grid.\n */\n for (let index = firstDayOfTheWeek; index > 0; index--) {\n days.push(DateHelper(date.getTime() - index * DAY_IN_MILLISECONDS))\n }\n\n // Filling days of current month\n for (let index = 0; index < totalDaysInMonth; index++) {\n days.push(DateHelper(date.getTime() + index * DAY_IN_MILLISECONDS))\n }\n\n /**\n * Filling days of next month, just enough to complete the grid.\n */\n for (let index = 0; (firstDayOfTheWeek + totalDaysInMonth + index) % 7 != 0; index++) {\n days.push(DateHelper(date.getTime() + (totalDaysInMonth + index) * DAY_IN_MILLISECONDS))\n }\n\n return {\n month: date.getMonth(),\n year: date.getYear(),\n days,\n }\n}\n\n/**\n *\n * @param {number} year\n * @param {number} month\n * @param {number?} amount - number of months to be generated. Default value is 1.\n * @returns\n */\nexport function getRenderableMonths(\n year: number,\n month: number,\n amount = 1\n): ReturnType<typeof getRenderableMonth>[] {\n if (month < 0 || month > 11) {\n throw new Error(\n 'Invalid month! Please, provide a number between 0 (January) and 11 (December).'\n )\n }\n\n // TODO: validate accepted year range?\n\n const months = new Array<ReturnType<typeof getRenderableMonth>>()\n\n for (let i = 0; i < amount; i++) {\n months.push(getRenderableMonth(year, month + i))\n }\n\n return months\n}\n\nexport function getSelectionPair(\n selected?: null | [string | number | null, string | number | null]\n): [number | null, number | null] {\n const [start, end] = toArray(selected)\n\n return [\n start != null ? DateHelper(start).getTime() : null,\n end != null ? DateHelper(end ?? start).getTime() : null,\n ]\n}\n\nexport default useCalendar\n","export const getOrdinalSuffix = (number: number): 'st' | 'nd' | 'rd' | 'th' => {\n if (number % 10 === 1 && number !== 11) {\n return 'st'\n }\n\n if (number % 10 === 2 && number !== 12) {\n return 'nd'\n }\n\n if (number % 10 === 3 && number !== 13) {\n return 'rd'\n }\n\n return 'th'\n}\n","import { identity } from '@loadsmart/utils-function'\nimport { padded } from './Date.helper'\n\nimport type { CalendarDate } from './Date.helper'\nimport { getOrdinalSuffix } from 'utils/toolset/getOrdinalSuffix'\n\nexport interface DateFormat {\n format(date: CalendarDate): string\n}\n\nconst getTokenValue = (date: CalendarDate, token: string) => {\n const value = DEFAULT_FORMATTERS[token].format(date.get())\n\n return (ADDITIONAL_FORMATTERS[token] || identity)(value)\n}\n\n/**\n * This helpers provides a convenient layer on top of `Intl.DateTimeFormat`,\n * using common tokens (based on `momentjs`) to format dates.\n */\nexport default function DateFormatHelper(format: string): DateFormat {\n const tokens = tokenizer(format)\n\n return {\n format(date: CalendarDate) {\n return tokens\n .map((token, index) => {\n const previousIndex = index - 1\n const previousToken = tokens[previousIndex]\n\n if (token in DEFAULT_FORMATTERS) {\n return getTokenValue(date, token)\n }\n\n if (token in COMPOUND_FORMATTERS && COMPOUND_FORMATTERS[token].valid(previousToken)) {\n return COMPOUND_FORMATTERS[token].format(getTokenValue(date, previousToken))\n }\n\n return token\n })\n .join('')\n },\n }\n}\n\n/**\n * Supported tokens:\n *\n *| | Token | Output |\n *| :----------------------------- | :---- | :---------------------------------------- |\n *| Month | MM | 01, 02, ..., 11, 12 |\n *| | MMM | Jan, Feb, ..., Nov, Dec |\n *| | MMMM | January, February, ..., November,December |\n *| Day of Month | D | 1, 2, ..., 30, 31 |\n *| Day of Month with leading 0 | DD | 01, 02, ..., 30, 31 |\n *| Day of week | ddd | Sun, Mon, ... Fri, Sat |\n *| | dddd | Sunday, Monday, ..., Friday, Saturday |\n *| Year | YYYY | 1970, 1971, ..., 2029, 2030 |\n *| Hour | HH | 00, 01, ..., 22, 23 |\n *| | hh | 00, 01, ..., 11, 12 |\n *| Minute | mm | 01, 02, ..., 58, 59 |\n *| Seconds | ss | 01, 02, ..., 58, 59 |\n *| Post or ante meridiem | a | am, pm |\n *| | A | AM, PM |\n *| Ordinal numbers | o | 1st, 2nd, 3rd, ..., 10th |\n *| Scaped sequence | [] | |\n *\n * @param format\n * @returns\n */\nexport function tokenizer(format: string): string[] {\n function getType(char?: string): string {\n if (\n char != undefined &&\n ['M', 'd', 'D', 'Y', 'H', 'h', 'm', 's', 'A', 'a', 'o'].includes(char)\n ) {\n return 'token'\n }\n\n return 'string'\n }\n\n const tokens: string[] = []\n\n let i = 0\n let prev\n let isEscaping = false\n\n while (i < format.length) {\n const at = Math.max(0, tokens.length - 1)\n\n const char = format.charAt(i)\n i++\n\n if (['[', ']'].includes(char)) {\n isEscaping = char === '['\n } else if (isEscaping) {\n tokens[at] = `${tokens[at] || ''}${char}`\n } else if (prev !== char && [getType(prev), getType(char)].includes('token')) {\n // we just need to start a new piece of string if we found a possible valid token\n tokens.push(char)\n } else {\n tokens[at] = `${tokens[at] || ''}${char}`\n }\n\n prev = char\n }\n\n return tokens\n}\n\n/**\n * TODO: Evaluate the need to add the following pollyfills:\n * - https://formatjs.io/docs/polyfills/intl-datetimeformat/\n * - https://formatjs.io/docs/polyfills/intl-getcanonicallocales/\n * - https://formatjs.io/docs/polyfills/intl-locale/\n * - https://formatjs.io/docs/polyfills/intl-numberformat/\n * - https://formatjs.io/docs/polyfills/intl-pluralrules/\n */\nconst DEFAULT_FORMATTERS: Record<string, Intl.DateTimeFormat> = {\n MM: new Intl.DateTimeFormat('en-US', {\n month: '2-digit',\n }),\n MMM: new Intl.DateTimeFormat('en-US', {\n month: 'short',\n }),\n MMMM: new Intl.DateTimeFormat('en-US', {\n month: 'long',\n }),\n D: new Intl.DateTimeFormat('en-US', {\n day: 'numeric',\n }),\n DD: new Intl.DateTimeFormat('en-US', {\n day: '2-digit',\n }),\n ddd: new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n }),\n dddd: new Intl.DateTimeFormat('en-US', {\n weekday: 'long',\n }),\n YYYY: new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n }),\n HH: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hourCycle: 'h23',\n }),\n hh: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hour12: true,\n }),\n mm: new Intl.DateTimeFormat('en-US', {\n minute: '2-digit',\n hour12: false,\n }),\n ss: new Intl.DateTimeFormat('en-US', {\n second: '2-digit',\n hour12: false,\n }),\n a: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hour12: true,\n }),\n A: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hour12: true,\n }),\n}\n\n/**\n * Apply additional formatting.\n *\n * Padding, for example, is applied in some cases due to [this](https://bugs.chromium.org/p/chromium/issues/detail?id=527926) bug.\n */\nconst ADDITIONAL_FORMATTERS: Record<string, (value: string) => string> = {\n hh: (value: string) => (value ? padded(value.split(/\\s/)[0], 2) : value),\n HH: (value: string) => (value ? padded(value, 2) : value),\n mm: (value: string) => (value ? padded(value, 2) : value),\n ss: (value: string) => (value ? padded(value, 2) : value),\n a: (value: string) => (value ? (value.split(/\\s/)[1] || '').toLowerCase() : value),\n A: (value: string) => (value ? (value.split(/\\s/)[1] || '').toUpperCase() : value),\n}\n\ntype CompoundFormatter = {\n valid: (token: string) => boolean\n format: (value: string) => string\n}\n\nconst COMPOUND_FORMATTERS: Record<string, CompoundFormatter> = {\n o: {\n valid: (token) => new Set(['D', 'DD']).has(token),\n format: (value: string) => getOrdinalSuffix(parseInt(value, 10)),\n },\n}\n","import styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport typography from 'styles/typography'\n\nconst PickerButton = styled(BaseButton)<{\n $status:\n | 'default'\n | 'current-day'\n | 'faded'\n | 'selection-start'\n | 'selection-end'\n | 'selection'\n | 'next-month-day'\n}>`\n ${typography(\n conditional({\n body: whenProps({ $status: ['default', 'faded'] }),\n 'body-bold': whenProps({\n $status: ['current-day', 'selection-start', 'selection', 'selection-end'],\n }),\n })\n )}\n\n user-select: none;\n\n height: 100%;\n\n border-radius: 0;\n\n color: ${conditional({\n 'color-neutral-lighter': whenProps({\n $status: ['selection-start', 'selection', 'selection-end'],\n }),\n 'color-neutral-darker': whenProps({ $status: ['default', 'faded'] }),\n 'color-neutral-dark': whenProps({ $status: 'next-month-day' }),\n 'color-accent': whenProps({ $status: 'current-day' }),\n })};\n\n background: ${conditional({\n 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),\n 'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),\n 'color-neutral': whenProps({ $status: 'selection' }),\n 'color-neutral-lightest': whenProps({ $status: 'current-day' }),\n })};\n\n border-color: ${conditional({\n 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),\n 'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),\n 'color-neutral': whenProps({ $status: 'selection' }),\n 'color-neutral-light': whenProps({ $status: 'current-day' }),\n })};\n\n ${conditional({\n 'opacity: 0.4;': whenProps({ $status: 'faded' }),\n 'opacity: 1;': whenProps({ $status: (status) => status !== 'faded' }),\n })}\n\n padding: ${token('space-xs')} ${token('space-s')};\n\n ${hoverable`\n border-color: ${token('color-neutral')};\n background-color: ${conditional({\n 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),\n 'color-neutral-dark': whenProps({\n $status: ['selection-start', 'selection', 'selection-end'],\n }),\n 'color-neutral-lightest': whenProps({ $status: 'current-day' }),\n })};\n color: ${conditional({\n 'color-neutral-dark': whenProps({ $status: ['default', 'faded'] }),\n 'color-neutral-lightest': whenProps({\n $status: ['selection-start', 'selection', 'selection-end'],\n }),\n })};\n\n font-weight: ${token('font-weight-bold')};\n `}\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n font-weight: ${token('font-weight-bold')};\n `}\n\n ${activatable`\n border-color: ${token('color-neutral')};\n background-color: ${conditional({\n 'color-transparent': whenProps({ 'aria-checked': false }),\n 'color-neutral': whenProps({ 'aria-checked': true }),\n })};\n color: ${conditional({\n 'color-neutral': whenProps({ 'aria-checked': false }),\n 'color-neutral-white': whenProps({ 'aria-checked': true }),\n })};\n `}\n\n ${disableable`\n background-color: ${token('color-transparent')};\n border-color: ${conditional({\n 'color-neutral-darkest': whenProps({ 'aria-checked': true }),\n 'color-transparent': whenProps({ 'aria-checked': false }),\n })};\n\n color: ${token('color-neutral-darker')};\n `}\n\n visibility: ${conditional({\n visible: whenProps({ 'aria-hidden': false }),\n hidden: whenProps({ 'aria-hidden': true }),\n })};\n`\n\nexport default styled(PickerButton)({})\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport { Text as DefaultText } from 'components/Text'\nimport { TODAY } from '../Date.helper'\nimport DateFormatHelper from '../DateFormat.helper'\nimport PickerButton from './PickerButton'\n\nimport type { CalendarDate } from '../Date.helper'\nimport type { CalendarPickerProps, RenderableMonth, useCalendarReturn } from '../Calendar.types'\n\nexport const WEEKDAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nfunction getStatus(calendar: useCalendarReturn, date: CalendarDate) {\n const isPastYearDay =\n date.getYear() < calendar.months[0].year && date.getMonth() > calendar.months[0].month\n\n if (calendar.selected[0] == date.getTime()) {\n return 'selection-start'\n } else if (calendar.selected[1] == date.getTime()) {\n return 'selection-end'\n } else if (\n calendar.selected[0] != null &&\n date.getTime() > calendar.selected[0] &&\n calendar.selected[1] != null &&\n date.getTime() < calendar.selected[1]\n ) {\n return 'selection'\n } else if (\n calendar.mode === 'single' &&\n (isPastYearDay || date.getMonth() < calendar.months[0].month)\n ) {\n return 'faded'\n } else if (calendar.mode === 'single' && date.getMonth() > calendar.months[0].month) {\n return 'next-month-day'\n } else if (date.getTime() == TODAY.getTime()) {\n return 'current-day'\n }\n\n return 'default'\n}\n\nconst Text = styled(DefaultText)`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n user-select: none;\n`\n\nconst Grid = styled.div`\n display: grid;\n grid-gap: ${token('space-2xs')};\n grid-template-rows: 1.25rem repeat(auto-fill, 2.5rem);\n grid-template-columns: repeat(7, 2.5rem);\n`\n\n/**\n * filling days of previous month\n * TODO: supress this for range selection\n */\nfunction CalendarDayPicker({ calendar, onDayClick }: CalendarPickerProps): JSX.Element {\n function renderDaysOfWeek() {\n return WEEKDAYS.map((weekday) => (\n <Text\n key={weekday}\n as=\"abbr\"\n variant=\"chips-sm\"\n color=\"color-neutral\"\n style={{ textDecoration: 'none' }}\n >\n {weekday}\n </Text>\n ))\n }\n\n function renderDaysOfMonth(month: RenderableMonth) {\n const constraints = calendar.constraints || []\n\n return month.days.map((day) => {\n const status = getStatus(calendar, day)\n const formatted = formatter.format(day)\n const isDisabled = day.matches(...constraints)\n\n if (calendar.mode === 'range' && day.getMonth() !== month.month) {\n return <span key={formatted} aria-hidden></span>\n }\n\n return (\n <PickerButton\n key={formatted}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={['selection-start', 'selection', 'selection-end'].includes(status)}\n aria-label={formatted}\n disabled={isDisabled}\n onClick={() => {\n if (!isDisabled && onDayClick) {\n onDayClick(day.getTime())\n }\n }}\n $status={status}\n >\n <time dateTime={day.toString()}>{day.getDate()}</time>\n </PickerButton>\n )\n })\n }\n\n return (\n <Group>\n {calendar.months.map((month) => {\n return (\n <Grid key={`${month.year}${month.month}`} role=\"group\" data-testid=\"calendar-day-picker\">\n {renderDaysOfWeek()}\n {renderDaysOfMonth(month)}\n </Grid>\n )\n })}\n </Group>\n )\n}\n\nexport default CalendarDayPicker\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport MonthHelper from '../Month.helper'\nimport PickerButton from './PickerButton'\n\nimport type { useCalendarReturn, CalendarPickerProps } from '../Calendar.types'\nimport type { CalendarMonth, CalendarMonthAlias } from '../Month.helper'\n\nconst Container = styled.div`\n display: grid;\n grid-auto-rows: 3.75rem;\n grid-gap: ${token('space-2xs')};\n grid-template-columns: repeat(3, 1fr);\n`\n\nfunction getStatus(calendar: useCalendarReturn, month: CalendarMonth) {\n if (calendar.months[0].month == month.index) {\n return 'selection-start'\n }\n\n return 'default'\n}\n\nfunction CalendarMonthPicker({ calendar, mode }: CalendarPickerProps): JSX.Element {\n return (\n <Container role=\"radiogroup\" data-testid=\"calendar-month-picker\">\n {MonthHelper.getAll().map((month) => (\n <PickerButton\n key={month.index}\n type=\"button\"\n role=\"radio\"\n aria-checked={month.index == calendar.months[0].month}\n aria-label={`Select month ${month.name}`}\n onClick={() => {\n calendar.set({ month: month.index })\n mode.dispatch({ type: 'set-mode', payload: 'day-picker' })\n }}\n $status={getStatus(calendar, month)}\n >\n <time dateTime={`${calendar.months[0].year}-${month.index + 1}`}>\n {MonthHelper(month.name as CalendarMonthAlias).format('short')}\n </time>\n </PickerButton>\n ))}\n </Container>\n )\n}\n\nexport default CalendarMonthPicker\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport DefaultPickerButton from './PickerButton'\nimport range from 'utils/toolset/range'\n\nimport type { useCalendarReturn, CalendarPickerProps } from '../Calendar.types'\n\nconst Container = styled.div`\n display: grid;\n grid-auto-rows: 2.875rem;\n grid-gap: ${token('space-2xs')};\n grid-template-columns: repeat(4, 1fr);\n`\n\nconst PickerButton = styled(DefaultPickerButton)`\n block-size: 46px;\n`\n\nfunction getStatus(calendar: useCalendarReturn, year: number) {\n if (calendar.months[0].year == year) {\n return 'selection-start'\n }\n\n return 'default'\n}\n\nfunction CalendarYearPicker({ calendar, mode }: CalendarPickerProps): JSX.Element {\n return (\n <Container role=\"radiogroup\" data-testid=\"calendar-year-picker\">\n {range(2012, 2032).map((year) => (\n <PickerButton\n key={year}\n type=\"button\"\n role=\"radio\"\n aria-checked={year == calendar.months[0].year}\n aria-label={`Select year ${year}`}\n onClick={() => {\n calendar.set({ year })\n mode.dispatch({ type: 'set-mode', payload: 'month-picker' })\n }}\n $status={getStatus(calendar, year)}\n >\n {year}\n </PickerButton>\n ))}\n </Container>\n )\n}\n\nexport default CalendarYearPicker\n","import { useReducer } from 'react'\n\nimport DayPicker from './Pickers/DayPicker'\nimport MonthPicker from './Pickers/MonthPicker'\nimport YearPicker from './Pickers/YearPicker'\n\nimport type {\n PickerMode,\n PickerModeAction,\n usePickerModeProps,\n usePickerModeReturn,\n} from './Calendar.types'\n\nfunction usePickerMode(props?: usePickerModeProps): usePickerModeReturn {\n function reducer(state: PickerMode, action: PickerModeAction) {\n switch (action.type) {\n case 'set-mode':\n return action.payload\n case 'toggle-mode':\n if (state != action.payload) {\n return action.payload\n }\n\n return 'day-picker'\n default:\n return state\n }\n }\n\n const [mode, dispatch] = useReducer(reducer, props?.mode || 'day-picker')\n\n return {\n get() {\n return mode\n },\n is(other: PickerMode) {\n return other != null && other === mode\n },\n dispatch,\n Picker: {\n 'day-picker': DayPicker,\n 'month-picker': MonthPicker,\n 'year-picker': YearPicker,\n }[mode],\n }\n}\n\nexport default usePickerMode\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Group, Stack } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport MonthHelper from './Month.helper'\nimport PickerModeToggle from './PickerModeToggle'\nimport typography from 'styles/typography'\nimport useCalendar from './useCalendar'\nimport usePickerMode from './usePickerMode'\n\nimport type { CalendarMonthAlias } from './Month.helper'\nimport type { CalendarProps, GenericCalendarProps } from './Calendar.types'\n\nconst Container = styled(Stack)`\n ${typography('body')}\n min-width: calc((7 * 2.5rem) + (6 * ${token('space-2xs')}));\n`\n\nconst BorderlessButton = styled(BaseButton)`\n ${typography('body-bold')}\n border-color: transparent;\n background-color: transparent;\n\n color: ${token('color-neutral')};\n\n inline-size: 40px;\n\n visibility: ${conditional({\n visible: whenProps({ 'aria-hidden': false }),\n hidden: whenProps({ 'aria-hidden': true }),\n })};\n\n ${hoverable`\n color: ${token('color-neutral-dark')};\n `}\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n `}\n`\n\n/**\n * Implementation based on\n * * https://medium.com/swlh/build-a-date-picker-in-15mins-using-javascript-react-from-scratch-f6932c77db09\n * * https://codepen.io/zellwk/pen/xNpKwp\n */\nexport function GenericCalendar(props: GenericCalendarProps): JSX.Element {\n const { calendar, onDayClick, onMonthClick, onYearClick, ...others } = props\n const mode = usePickerMode()\n\n const { Picker } = mode\n\n return (\n <Container space=\"xs\" {...others}>\n <Group>\n <BorderlessButton\n type=\"button\"\n aria-label=\"Navigate to previous month\"\n aria-hidden={!mode.is('day-picker')}\n onClick={() => {\n calendar.set({ month: calendar.months[0].month - 1 })\n }}\n >\n <Icon name=\"caret-left\" size={16} />\n </BorderlessButton>\n\n {calendar.months.map((month) => {\n return (\n <Group key={month.month} space=\"xs\" align=\"center\" justify=\"center\" style={{ flex: 1 }}>\n <PickerModeToggle\n aria-label=\"Open month selection\"\n onClick={() => {\n mode.dispatch({ type: 'toggle-mode', payload: 'month-picker' })\n }}\n expanded={mode.is('month-picker')}\n disabled={calendar.mode == 'range'}\n >\n {MonthHelper(month.month as CalendarMonthAlias).format('long')}\n </PickerModeToggle>\n\n <PickerModeToggle\n aria-label=\"Open year selection\"\n onClick={() => {\n mode.dispatch({ type: 'toggle-mode', payload: 'year-picker' })\n }}\n expanded={mode.is('year-picker')}\n disabled={calendar.mode == 'range'}\n >\n {month.year}\n </PickerModeToggle>\n </Group>\n )\n })}\n <BorderlessButton\n type=\"button\"\n aria-label=\"Navigate to next month\"\n aria-hidden={!mode.is('day-picker')}\n onClick={() => {\n calendar.set({ month: calendar.months[0].month + 1 })\n }}\n >\n <Icon name=\"caret-right\" size={16} />\n </BorderlessButton>\n </Group>\n\n <Picker\n calendar={calendar}\n mode={mode}\n onDayClick={onDayClick}\n onMonthClick={onMonthClick}\n onYearClick={onYearClick}\n />\n </Container>\n )\n}\n\nfunction Calendar(props: CalendarProps): JSX.Element {\n const { year, month, selected, constraints, onSelect, mode, ...rest } = props\n const calendar = useCalendar({ year, month, selected, constraints, mode, onSelect })\n\n return <GenericCalendar calendar={calendar} {...rest} />\n}\n\nexport default Calendar\n","import DateFormatHelper from './DateFormat.helper'\nimport DateHelper from './Date.helper'\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nexport function getSelection(\n selection?: number | string | null | [number | string | null, number | string | null]\n): [null | number, null | number] {\n const [start, end] = Array.isArray(selection) ? selection : [selection, selection]\n\n return [\n start != null ? DateHelper(start).getTime() : null,\n end != null ? DateHelper(end).getTime() : null,\n ]\n}\n","import { useEffect, useRef } from 'react'\n\nimport { useDropdown } from 'components/Dropdown'\nimport { TODAY, DateFormatHelper, DateHelper, useCalendar } from 'components/Calendar'\n\nimport { getSelection } from '../Calendar/Calendar.helpers'\n\nimport type { CalendarDate } from 'components/Calendar'\nimport type { DatePickerProps } from './DatePicker.types'\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nexport function formatDate(date?: number | string | null): string {\n if (!date || Number.isNaN(new Date(date).getTime())) {\n return ''\n }\n\n return formatter.format(DateHelper(date))\n}\n\nexport function getInitialCalendarSetup(\n selection: number | string | null | [number | string | null, number | string | null]\n) {\n const [selectionStart] = getSelection(selection)\n\n if (!selectionStart) {\n return {\n month: TODAY.getMonth(),\n year: TODAY.getYear(),\n }\n }\n\n const startDate = DateHelper(selectionStart)\n\n return {\n month: startDate.getMonth(),\n year: startDate.getYear(),\n }\n}\n\nexport function setInputValue(input: HTMLInputElement | null, value: string) {\n if (input != null) {\n input.value = value\n }\n}\n\nexport function getInputValue(input?: HTMLInputElement | null) {\n if (input != null) {\n return input.value\n }\n\n return null\n}\n\nfunction useDatePicker(props: DatePickerProps) {\n const { constraints, disabled, id, name, onChange, value, ...rest } = props\n\n const dropdown = useDropdown({ disabled })\n const calendar = useCalendar({\n mode: 'single',\n constraints,\n onSelect: handleDateSelect,\n })\n\n const inputRef = useRef<HTMLInputElement>()\n\n function handleDateSelect(selection: [string | null, string | null]) {\n if (!inputRef.current) {\n return\n }\n\n const [formattedDate] = getSelection(selection).map(formatDate)\n\n /**\n * This check ensures we will keep the valid date the user typed as-is and, since we're using\n * an uncontrolled input, ensures that the formatting that happens in `getFormattedSelection`\n * will not interfere with cursor position when we set the input value.\n * Bottom line is: if the input already contains the select date, no change is necessary.\n */\n if (formattedDate != formatDate(getInputValue(inputRef.current))) {\n setInputValue(inputRef.current, formattedDate)\n }\n\n onChange?.({ target: { id, name, value: selection[0] } })\n }\n\n function handleDateInputChange(date: CalendarDate) {\n if (date != null) {\n const timestamp = date.getTime()\n\n calendar.select([timestamp, timestamp])\n } else {\n calendar.clear()\n }\n }\n\n function handleDateInputClick() {\n if (!dropdown.expanded) {\n calendar.set(getInitialCalendarSetup(calendar.selected))\n dropdown.toggle()\n }\n }\n\n function handleDayClick(timestamp: number) {\n calendar.select([timestamp, timestamp])\n dropdown.collapse()\n }\n\n function handleClearClick() {\n calendar.clear()\n inputRef.current?.focus()\n }\n\n function getDropdownProps() {\n return {\n disabled,\n toggle: dropdown.toggle,\n expanded: dropdown.expanded,\n onBlur() {\n if (!inputRef.current) {\n return\n }\n\n const [currSelectedDate] = getSelection(calendar.selected).map(formatDate)\n const currInputValue = getInputValue(inputRef.current)\n\n if (currInputValue == currSelectedDate) {\n return\n }\n\n if (!currInputValue) {\n calendar.clear()\n } else {\n setInputValue(inputRef.current, currSelectedDate)\n }\n },\n }\n }\n\n function getCalendarProps() {\n return {\n ...rest.getCalendarProps?.(),\n calendar,\n onDayClick: handleDayClick,\n }\n }\n\n function getInputProps() {\n return {\n ...rest.getInputProps?.(),\n id,\n name,\n disabled,\n onChange: handleDateInputChange,\n onClick: handleDateInputClick,\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n inputRef.current = node\n }\n },\n }\n }\n\n function getClearProps() {\n return {\n onClick: handleClearClick,\n }\n }\n\n useEffect(\n function onValuePropChange() {\n if (!inputRef.current) {\n return\n }\n\n const [newSelection] = getSelection(value)\n const [currSelection] = calendar.selected\n\n if (newSelection != currSelection) {\n setInputValue(inputRef.current, formatDate(newSelection))\n\n calendar.select([newSelection, newSelection])\n calendar.set(getInitialCalendarSetup([newSelection, newSelection]))\n }\n },\n // we just intend to update the selection when the prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [value]\n )\n\n return {\n value: getSelection(calendar.selected).map(formatDate),\n\n getDropdownProps,\n getInputProps,\n getClearProps,\n getCalendarProps,\n }\n}\n\nexport default useDatePicker\n","import React, { useContext, forwardRef } from 'react'\nimport styled from 'styled-components'\n\nimport { DateFormatHelper, DateHelper, GenericCalendar } from 'components/Calendar'\nimport { Dropdown, DropdownContext, GenericDropdown } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport { TextField as DefaultTextField } from 'components/TextField'\nimport CloseButton from 'common/CloseButton'\nimport useDatePicker from './useDatePicker'\nimport { Popover } from 'components/Popover'\n\nimport type { CalendarDate } from 'components/Calendar'\nimport type { ChangeEvent } from 'react'\nimport type { DatePickerProps } from './DatePicker.types'\nimport type { TextFieldProps } from 'components/TextField'\n\n/**\n * https://www.regular-expressions.info/dates.html\n * https://learning.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s04.html#validation-dates-problem\n */\nconst DATE_REGEX = /^(1[0-2]|0?[1-9])\\/(3[01]|[12][0-9]|0?[1-9])\\/(19|20)\\d{2}$/\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nconst TextField = styled(DefaultTextField)`\n & > input {\n width: 10ch;\n }\n`\n\nconst DropdownMenu = styled(Dropdown.Menu)`\n width: max-content;\n min-width: initial;\n max-height: initial;\n padding: ${token('space-m')};\n overflow-y: initial;\n`\n\nexport const ClearButton = styled(CloseButton)`\n width: 1em;\n height: 1em;\n\n margin-left: calc(-1 * ${token('space-s')}); // compensate for input's padding-left\n`\n\ninterface DateInputProps extends Omit<TextFieldProps, 'onChange'> {\n onChange: (date: CalendarDate) => void\n}\n\nexport const DateInput = forwardRef<HTMLInputElement, DateInputProps>(function DateInput(\n props: DateInputProps,\n ref\n): JSX.Element {\n const { onChange, ...rest } = props\n const dropdown = useContext(DropdownContext)\n\n function handleInputChange(event: ChangeEvent<HTMLInputElement>) {\n const {\n target: { value },\n } = event\n\n if (!DATE_REGEX.test(value)) {\n return\n }\n\n onChange(DateHelper(value))\n }\n\n // TODO: use type=\"date\" when IE is no longer in the way\n return (\n <TextField\n placeholder=\"00/00/0000\"\n {...rest}\n ref={ref}\n type=\"text\"\n disabled={dropdown.disabled}\n leading={<Icon name=\"calendar\" />}\n onChange={handleInputChange}\n />\n )\n})\n\nfunction DatePicker(props: DatePickerProps): JSX.Element {\n const {\n id,\n name,\n value,\n onChange,\n disabled,\n constraints,\n getInputProps,\n getCalendarProps,\n placement,\n } = props\n\n const datePicker = useDatePicker({\n constraints,\n disabled,\n id,\n name,\n value,\n onChange,\n getInputProps,\n getCalendarProps,\n })\n\n function renderTrailing() {\n const [currSelectedDate] = datePicker.value\n\n if (!disabled && currSelectedDate) {\n return (\n <ClearButton\n size={12}\n type=\"button\"\n aria-label=\"Clear selection\"\n {...datePicker.getClearProps()}\n />\n )\n }\n\n return null\n }\n\n return (\n <GenericDropdown {...placement} {...datePicker.getDropdownProps()}>\n <Popover.Reference>\n <Group space=\"s\">\n <DateInput trailing={renderTrailing()} {...datePicker.getInputProps()} />\n </Group>\n </Popover.Reference>\n <DropdownMenu>\n <GenericCalendar {...datePicker.getCalendarProps()} />\n </DropdownMenu>\n </GenericDropdown>\n )\n}\n\nexport default DatePicker\n","import { useEffect, useRef } from 'react'\n\nimport { formatDate, getInitialCalendarSetup, getInputValue, setInputValue } from './useDatePicker'\nimport { getSelection } from '../Calendar/Calendar.helpers'\nimport { useCalendar } from 'components/Calendar'\nimport { useDropdown } from 'components/Dropdown'\n\nimport type { CalendarDate } from 'components/Calendar'\nimport type { DateRangePickerProps } from './DatePicker.types'\n\nconst AT_RANGE_START = 0\nconst AT_RANGE_END = 1\n\nfunction useDateRangePicker(props: DateRangePickerProps) {\n const { constraints, disabled, id, name, onChange, value, ...rest } = props\n\n const dropdown = useDropdown({ disabled })\n const calendar = useCalendar({\n mode: 'range',\n constraints,\n onSelect: handleDateSelect,\n })\n\n const inputsRef = useRef<[HTMLInputElement | null, HTMLInputElement | null]>([null, null])\n const currentlyPickingRef = useRef<'range-start' | 'range-end' | 'none'>('none')\n\n function handleDateSelect(selected: [string | null, string | null]) {\n ;[AT_RANGE_START, AT_RANGE_END].forEach((index) => {\n const input = inputsRef.current[index]\n const formattedDate = formatDate(selected[index])\n\n /**\n * This check ensures we will keep the valid date the user typed as-is and, since we're using\n * an uncontrolled input, ensures that the formatting that happens in `formatDate`\n * will not interfere with cursor position when we set the input value.\n * Bottom line is: if the input already contains the select date, no change is necessary.\n */\n if (formattedDate != formatDate(getInputValue(input))) {\n setInputValue(input, formattedDate)\n }\n })\n\n onChange?.({ target: { id, name, value: selected } })\n }\n\n function getDateInputChangeHandler(index: number) {\n return function handleDateInputChange(date: CalendarDate) {\n if (date != null) {\n const timestamp = date.getTime()\n\n const newSelected: typeof calendar.selected = [...calendar.selected]\n newSelected[index] = timestamp\n\n calendar.select(newSelected)\n } else {\n calendar.clear()\n }\n }\n }\n\n function handleDateInputClick() {\n if (!dropdown.expanded) {\n calendar.set(getInitialCalendarSetup(calendar.selected))\n dropdown.toggle()\n }\n }\n\n function handleDayClick(timestamp: number) {\n const [rangeStart, rangeEnd] = calendar.selected\n\n if (currentlyPickingRef.current == 'range-start') {\n if (rangeEnd != null) {\n calendar.select([timestamp, rangeEnd].sort() as [number, number])\n inputsRef.current[AT_RANGE_START]?.focus()\n } else {\n calendar.select([timestamp, rangeEnd])\n inputsRef.current[AT_RANGE_END]?.focus()\n }\n } else if (currentlyPickingRef.current == 'range-end') {\n if (rangeStart != null) {\n calendar.select([rangeStart, timestamp].sort() as [number, number])\n } else {\n calendar.select([rangeStart, timestamp])\n }\n\n inputsRef.current[AT_RANGE_END]?.focus()\n }\n }\n\n function handleClearClick() {\n calendar.clear()\n inputsRef.current[AT_RANGE_START]?.focus()\n }\n\n function handleDropdownBlur() {\n currentlyPickingRef.current = 'none'\n\n if ([AT_RANGE_START, AT_RANGE_END].some((index) => !inputsRef.current[index])) {\n return\n }\n\n if ([AT_RANGE_START, AT_RANGE_END].every((index) => !getInputValue(inputsRef.current[index]))) {\n calendar.clear()\n } else {\n const selected = getSelection(calendar.selected).map(formatDate)\n\n ;[AT_RANGE_START, AT_RANGE_END].forEach((index) => {\n setInputValue(inputsRef.current[index], selected[index])\n })\n }\n }\n\n function handleDoneClick() {\n handleDropdownBlur()\n dropdown.collapse()\n }\n\n function getDropdownProps() {\n return {\n disabled,\n toggle: dropdown.toggle,\n expanded: dropdown.expanded,\n onBlur: handleDropdownBlur,\n }\n }\n\n function getCalendarProps() {\n return {\n ...rest.getCalendarProps?.(),\n calendar,\n onDayClick: handleDayClick,\n }\n }\n\n function getRangeStartInputProps() {\n return {\n ...rest.getRangeStartInputProps?.(),\n id: id != null ? `${id}-start` : id,\n name: name != null ? `${name}-start` : name,\n disabled,\n onChange: getDateInputChangeHandler(AT_RANGE_START),\n onClick: handleDateInputClick,\n onFocus() {\n currentlyPickingRef.current = 'range-start'\n },\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n inputsRef.current[AT_RANGE_START] = node\n }\n },\n }\n }\n\n function getRangeEndInputProps() {\n return {\n ...rest.getRangeEndInputProps?.(),\n id: id != null ? `${id}-end` : id,\n name: name != null ? `${name}-end` : name,\n disabled,\n onChange: getDateInputChangeHandler(AT_RANGE_END),\n onClick: handleDateInputClick,\n onFocus() {\n currentlyPickingRef.current = 'range-end'\n },\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n inputsRef.current[AT_RANGE_END] = node\n }\n },\n }\n }\n\n function getClearProps() {\n return {\n onClick: handleClearClick,\n }\n }\n\n function getDoneProps() {\n return {\n onClick: handleDoneClick,\n }\n }\n\n useEffect(\n function onValuePropChange() {\n if ([AT_RANGE_START, AT_RANGE_END].some((index) => !inputsRef.current[index])) {\n return\n }\n\n const newSelected = getSelection(value)\n const currSelected = calendar.selected\n\n const hasChanged = [AT_RANGE_START, AT_RANGE_END].some((index) => {\n return newSelected[index] != currSelected[index]\n })\n\n if (hasChanged) {\n ;[AT_RANGE_START, AT_RANGE_END].forEach((index) => {\n setInputValue(inputsRef.current[index], formatDate(newSelected[index]))\n })\n\n calendar.select(newSelected)\n calendar.set(getInitialCalendarSetup(newSelected))\n }\n },\n // we just intend to update the selection when the prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [value]\n )\n\n return {\n value: getSelection(calendar.selected).map(formatDate),\n\n getDropdownProps,\n getRangeStartInputProps,\n getRangeEndInputProps,\n getClearProps,\n getCalendarProps,\n getDoneProps,\n }\n}\n\nexport default useDateRangePicker\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { Button } from 'components/Button'\nimport { ClearButton, DateInput } from './DatePicker'\nimport { DateFormatHelper, GenericCalendar } from 'components/Calendar'\nimport { Dropdown, GenericDropdown } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport { Popover } from 'components/Popover'\nimport useDateRangePicker from './useDateRangePicker'\n\nimport type { DateRangePickerProps } from './DatePicker.types'\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nconst DropdownMenu = styled(Dropdown.Menu)`\n width: max-content;\n min-width: initial;\n max-height: initial;\n padding: ${token('space-m')};\n overflow-y: initial;\n`\n\nconst DropdownFooter = styled.div`\n padding-right: ${token('space-m')};\n padding-left: ${token('space-m')};\n`\n\nfunction DateRangePicker(props: DateRangePickerProps): JSX.Element {\n const {\n id,\n name,\n value,\n onChange,\n disabled,\n constraints,\n getRangeStartInputProps,\n getRangeEndInputProps,\n getCalendarProps,\n placement,\n } = props\n\n const dateRangePicker = useDateRangePicker({\n constraints,\n disabled,\n id,\n name,\n value,\n onChange,\n getRangeStartInputProps,\n getRangeEndInputProps,\n getCalendarProps,\n })\n\n function renderRangeEndTrailing() {\n const [currRangeStart, currRangeEnd] = dateRangePicker.value\n\n if (!disabled && (currRangeStart || currRangeEnd)) {\n return (\n <ClearButton\n size={12}\n type=\"button\"\n aria-label=\"Clear selection\"\n {...dateRangePicker.getClearProps()}\n />\n )\n }\n\n return null\n }\n\n function renderDropdownFooter() {\n return (\n <DropdownFooter>\n <Group space=\"s\" justify=\"flex-end\">\n <Button type=\"button\" scale=\"small\" {...dateRangePicker.getClearProps()}>\n Clear\n </Button>\n <Button type=\"button\" scale=\"small\" variant=\"primary\" {...dateRangePicker.getDoneProps()}>\n Done\n </Button>\n </Group>\n </DropdownFooter>\n )\n }\n\n return (\n <GenericDropdown {...placement} {...dateRangePicker.getDropdownProps()}>\n <Popover.Reference>\n <Group space=\"s\">\n <DateInput\n {...dateRangePicker.getRangeStartInputProps()}\n data-testid=\"input-date-range-start\"\n />\n <DateInput\n trailing={renderRangeEndTrailing()}\n {...dateRangePicker.getRangeEndInputProps()}\n data-testid=\"input-date-range-end\"\n />\n </Group>\n </Popover.Reference>\n <DropdownMenu footer={renderDropdownFooter()}>\n <GenericCalendar {...dateRangePicker.getCalendarProps()} />\n </DropdownMenu>\n </GenericDropdown>\n )\n}\n\nexport default DateRangePicker\n","import React from 'react'\n\nimport { TextProps, Text } from 'components/Text'\n\nexport type ErrorMessageProps = Partial<TextProps>\n\nconst ErrorMessage = ({ children, ...props }: ErrorMessageProps) => {\n if (!children) {\n return null\n }\n\n return (\n <Text as=\"p\" variant=\"caption-bold\" color=\"color-danger\" {...props}>\n {children}\n </Text>\n )\n}\n\nexport default ErrorMessage\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport prop from 'tools/prop'\nimport transition from 'styles/transition'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport disableable from 'styles/disableable'\nimport hidden from 'styles/hidden'\n\nimport { StackProps, Stack } from 'components/Layout/Stack'\nimport { Icon } from 'components/Icon'\n\nimport type { DropZoneProps } from './types'\n\nexport const DragDropFileWrapper = styled(Stack)<{ withFileList: boolean }>`\n width: 100%;\n\n & > label + p {\n margin-top: ${conditional({\n 'space-m': whenProps({ withFileList: true }),\n 'space-l': whenProps({ withFileList: false }),\n })};\n }\n`\n\nexport const DropZoneWrapper = styled((props: StackProps) => <Stack as=\"label\" {...props} />)<\n Pick<DropZoneProps, 'disabled' | 'error'>\n>`\n ${transition({ property: 'border-color, box-shadow, opacity' })}\n\n cursor: pointer;\n\n background-color: ${getToken('color-neutral-white')};\n border-radius: ${getToken('border-radius-s')};\n border: 2px dashed;\n border-color: ${conditional({\n 'color-neutral-light': whenProps({ error: false }),\n 'color-danger': whenProps({ disabled: false, error: true }),\n })};\n\n padding: ${getToken('space-l')} ${getToken('space-3xl')};\n\n text-align: center;\n\n ${hoverable`\n border-color: ${conditional({\n 'color-accent': whenProps({ disabled: false, error: false }),\n })};\n `}\n\n ${focusable`\n border-color: ${conditional({\n 'color-accent': whenProps({ disabled: false, error: false }),\n })};\n box-shadow: ${getToken('shadow-glow-primary')};\n `}\n\n ${disableable()}\n`\n\nexport const HiddenInput = styled.input`\n ${hidden()}\n`\n\nexport const UploadIcon = styled(Icon)`\n color: ${getToken('color-neutral')};\n`\n\nexport const FileListUL = styled((props: StackProps) => <Stack as=\"ul\" {...props} />)`\n padding: 0;\n`\n\nexport const Divider = styled.div`\n width: 1px;\n height: 16px;\n\n background-color: ${getToken('color-neutral-darker')};\n`\n","import React from 'react'\n\nimport isEmpty from 'utils/toolset/isEmpty'\n\nimport { useDragDropFileContext } from '../DragDropFile.context'\nimport { DragDropFileWrapper } from '../styles'\nimport type { WrapperProps } from '../types'\n\n/**\n * This is a `Stack` component customized with the needed spacing between the DragDropFile inner components\n */\nconst Wrapper = ({ children, ...props }: WrapperProps) => {\n const { fileList } = useDragDropFileContext()\n\n return (\n <DragDropFileWrapper space=\"l\" withFileList={!isEmpty(fileList)} {...props}>\n {children}\n </DragDropFileWrapper>\n )\n}\n\nexport default Wrapper\n","import React, { useRef, useState, useCallback } from 'react'\nimport clsx from 'clsx'\n\nimport toArray from 'utils/toolset/toArray'\nimport KeyboardKey from 'utils/toolset/keyboard'\nimport pluralize from 'utils/toolset/pluralize'\n\nimport { Text } from 'components/Text'\n\nimport { useDragDropFileContext } from '../DragDropFile.context'\n\nimport { DropZoneWrapper, HiddenInput, UploadIcon } from '../styles'\nimport type { DropZoneProps } from '../types'\n\nconst DropZone = ({\n className,\n hint,\n multiple = false,\n accept,\n disabled = false,\n error = false,\n renderCustomContent,\n ...props\n}: DropZoneProps): JSX.Element => {\n const { onFilesAdded } = useDragDropFileContext()\n\n const inputRef = useRef<HTMLInputElement>(null)\n const [isDragging, setIsDragging] = useState(false)\n\n const onChangeInput = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n onFilesAdded(Array.from(event.currentTarget.files || []))\n },\n [onFilesAdded]\n )\n\n const onKeyPress = useCallback(\n (event: React.KeyboardEvent) => {\n if (!disabled && inputRef.current && KeyboardKey(event).is('ENTER')) {\n inputRef.current.click()\n }\n },\n [disabled, inputRef]\n )\n\n const onDrop = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!disabled) {\n if (isDragging) {\n setIsDragging(false)\n }\n\n onFilesAdded(Array.from(event.dataTransfer.files || []))\n }\n },\n [disabled, isDragging, onFilesAdded]\n )\n\n const onDragStart = useCallback((event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n }, [])\n\n const onDragOver = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n\n if (!disabled && !isDragging) {\n setIsDragging(true)\n }\n },\n [disabled, isDragging]\n )\n\n const onDragLeave = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n\n if (isDragging) {\n setIsDragging(false)\n }\n },\n [isDragging]\n )\n\n const renderDefaultContent = useCallback(\n () => (\n <>\n <UploadIcon name=\"upload\" size={48} />\n <Text variant=\"body\" color=\"color-neutral-darker\">\n {`Drag and drop your ${pluralize(Number(!multiple), 'files', 'file')} here or `}\n <Text as=\"a\" color={disabled ? 'color-neutral' : 'color-accent'} variant=\"body-bold\">\n {`Browse ${pluralize(Number(!multiple), 'Files', 'File')}`}\n </Text>\n </Text>\n {hint && (\n <Text variant=\"caption\" color=\"color-neutral-dark\">\n {hint}\n </Text>\n )}\n </>\n ),\n [multiple, disabled, hint]\n )\n\n return (\n <DropZoneWrapper\n space=\"m\"\n align=\"center\"\n justify=\"center\"\n className={clsx(className, {\n 'is-disabled': disabled,\n 'is-focused': isDragging,\n })}\n disabled={disabled}\n error={error}\n tabIndex={0}\n role=\"button\"\n aria-pressed=\"false\"\n onKeyPress={onKeyPress}\n onDrop={onDrop}\n onDragStart={onDragStart}\n onDragOver={onDragOver}\n onDragLeave={onDragLeave}\n >\n {(renderCustomContent || renderDefaultContent)({ isDragging })}\n <HiddenInput\n onInput={onChangeInput}\n type=\"file\"\n ref={inputRef}\n accept={accept ? toArray(accept).join(',') : undefined}\n disabled={disabled}\n multiple={multiple}\n {...props}\n />\n </DropZoneWrapper>\n )\n}\n\nexport default DropZone\n","export const BYTES_PER_KILOBYTE = 1024\nexport const FILE_SIZE_ABBREVIATIONS = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\nconst formatBytes = (bytes: number, decimals = 2) => {\n const bytesValue = Number(bytes)\n\n if (!bytesValue || bytesValue < 0) {\n return '0B'\n }\n\n const dm = Math.max(0, decimals)\n const unit = Math.floor(Math.log(bytesValue) / Math.log(BYTES_PER_KILOBYTE))\n const unitAbbr = FILE_SIZE_ABBREVIATIONS[Math.min(unit, FILE_SIZE_ABBREVIATIONS.length - 1)]\n\n return `${parseFloat((bytesValue / Math.pow(BYTES_PER_KILOBYTE, unit)).toFixed(dm))}${unitAbbr}`\n}\n\nexport default formatBytes\n","import React from 'react'\n\nimport formatBytes from 'utils/toolset/formatBytes'\n\nimport { Stack, Group } from 'components/Layout'\nimport { Bar } from 'components/Loaders/LoadingBar'\nimport { Button } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\n\nimport type { FileItemProps, FileStatus } from '../types'\nimport { Divider } from '../styles'\n\nconst FileName = ({ file }: Pick<FileItemProps, 'file'>): JSX.Element =>\n file.size ? (\n <Group space=\"m\" align=\"center\">\n <Text variant=\"caption\">{file.name}</Text>\n <Text variant=\"number-sm\">{formatBytes(file.size)}</Text>\n </Group>\n ) : (\n <Text variant=\"caption\">{file.name}</Text>\n )\n\ntype FileActionButtonProps = Pick<FileItemProps, 'onRemove' | 'onRetry' | 'disabled'> & {\n type: 'remove' | 'retry'\n}\n\nconst FileActionButton = ({\n type,\n onRemove,\n onRetry,\n disabled,\n}: FileActionButtonProps): JSX.Element => {\n const { iconName, label, onClick } =\n type === 'remove'\n ? {\n iconName: 'close',\n label: 'REMOVE',\n onClick: onRemove,\n }\n : {\n iconName: 'refresh',\n label: 'RETRY',\n onClick: onRetry,\n }\n\n return (\n <Button\n scale=\"small\"\n variant=\"tertiary\"\n leading={<Icon name={iconName} size={12} />}\n onClick={onClick}\n disabled={disabled}\n >\n {label}\n </Button>\n )\n}\n\nconst LoadingFile = ({ file, ...actionProps }: FileItemProps): JSX.Element => (\n <Stack as=\"li\" space=\"s\">\n <Group align=\"center\" justify=\"space-between\">\n <FileName file={file} />\n <FileActionButton type=\"remove\" {...actionProps} />\n </Group>\n <Bar />\n </Stack>\n)\n\nconst ErrorFile = ({ file, errorMessage, ...actionProps }: FileItemProps): JSX.Element => (\n <Stack as=\"li\" space=\"s\">\n <Group align=\"center\" justify=\"space-between\">\n <Group space=\"s\" align=\"center\">\n <Icon name=\"warning\" size={12} />\n <FileName file={file} />\n </Group>\n {actionProps.onRetry ? (\n <Group space=\"none\" align=\"center\">\n <FileActionButton type=\"retry\" {...actionProps} />\n <Divider />\n <FileActionButton type=\"remove\" {...actionProps} />\n </Group>\n ) : (\n <FileActionButton type=\"remove\" {...actionProps} />\n )}\n </Group>\n {errorMessage && (\n <Text variant=\"caption\" color=\"color-danger\">\n {errorMessage}\n </Text>\n )}\n </Stack>\n)\n\nconst SuccessFile = ({ file, ...actionProps }: FileItemProps): JSX.Element => (\n <Group as=\"li\" align=\"center\" justify=\"space-between\">\n <Group space=\"s\" align=\"center\">\n <Icon name=\"check\" size={12} />\n <FileName file={file} />\n </Group>\n <FileActionButton type=\"remove\" {...actionProps} />\n </Group>\n)\n\nconst FILE_ITEM_BY_STATUS: Record<FileStatus, (props: FileItemProps) => JSX.Element> = {\n loading: LoadingFile,\n error: ErrorFile,\n success: SuccessFile,\n}\n\nconst FileItem = (props: FileItemProps): JSX.Element => {\n const FileItemComponent = FILE_ITEM_BY_STATUS[props.status]\n\n return <FileItemComponent {...props} />\n}\n\nexport default FileItem\n","import React from 'react'\n\nimport isEmpty from 'utils/toolset/isEmpty'\nimport pluralize from 'utils/toolset/pluralize'\n\nimport { Stack } from 'components/Layout'\nimport { Text } from 'components/Text'\n\nimport { useDragDropFileContext } from '../DragDropFile.context'\n\nimport type { FileListProps } from '../types'\nimport { FileListUL } from '../styles'\n\nimport FileItem from './FileItem'\n\nconst FileList = ({ disabled, ...props }: FileListProps): JSX.Element | null => {\n const { fileList, onRemoveFile, onRetryUpload } = useDragDropFileContext()\n\n if (isEmpty(fileList)) {\n return null\n }\n\n const uploadedFiles = fileList.filter((file) => file.status === 'success').length\n\n return (\n <Stack space=\"m\" {...props}>\n <Text variant=\"heading-sm-bold\">{`${uploadedFiles} ${pluralize(\n uploadedFiles,\n 'Files',\n 'File'\n )} uploaded`}</Text>\n <FileListUL space=\"m\">\n {fileList.map((item, index) => (\n <FileItem\n key={`file-${item.file.name}-${index}`}\n disabled={disabled}\n onRemove={() => onRemoveFile(item, index)}\n onRetry={onRetryUpload ? () => onRetryUpload(item, index) : undefined}\n {...item}\n />\n ))}\n </FileListUL>\n </Stack>\n )\n}\n\nexport default FileList\n","import Wrapper from './components/Wrapper'\nimport DropZone from './components/DropZone'\nimport FileList from './components/FileList'\n\nconst DragDropFile = (): null => null\n\nDragDropFile.Wrapper = Wrapper\nDragDropFile.DropZone = DropZone\nDragDropFile.FileList = FileList\n\nexport default DragDropFile\n","import styled from 'styled-components'\nimport { Button } from 'components/Button'\n\nexport const NoPaddingButton = styled(Button).attrs({\n variant: 'tertiary',\n scale: 'small',\n})`\n padding: 0;\n\n > span {\n margin: 0 !important;\n }\n`\n","import React, { ChangeEvent, KeyboardEvent, useEffect, useState } from 'react'\n\nimport { Layout } from 'components/Layout'\nimport { Text } from 'components/Text'\nimport { TextField } from 'components/TextField'\nimport type { TablePaginationActionsProps } from 'components/TablePagination/TablePagination.types'\nimport styled from 'styled-components'\nimport { Icon, IconProps } from 'components/Icon'\nimport Keyboard from 'utils/toolset/keyboard'\nimport { NoPaddingButton } from './TablePagination.styles'\nimport { prop } from 'tools/index'\n\nexport const ActionIcon = styled(Icon).attrs({\n color: 'neutral-darker',\n size: '16',\n})<IconProps & { rotate?: number }>`\n transform: rotate(${prop('rotate', 0)}deg);\n`\n\nfunction TablePaginationActions({\n variant = 'default',\n disabled = false,\n onPageChange,\n page,\n count,\n rowsPerPage,\n}: TablePaginationActionsProps): JSX.Element {\n const totalPages = Math.ceil(count / rowsPerPage)\n const [pageValue, setPageValue] = useState<number | ''>(page + 1)\n const isCompact = variant === 'compact'\n\n useEffect(() => {\n setPageValue(page + 1)\n }, [page])\n\n const handleFirstPageClick = () => {\n onPageChange(0)\n }\n\n const handlePreviousPageClick = () => {\n onPageChange(page - 1)\n }\n\n const handleNextPageClick = () => {\n onPageChange(page + 1)\n }\n\n const handleLastPageClick = () => {\n onPageChange(totalPages - 1)\n }\n\n const publishPageChange = () => {\n if (pageValue && pageValue - 1 !== page) {\n onPageChange(pageValue - 1)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (Keyboard(e).is('ENTER')) {\n publishPageChange()\n }\n }\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (Keyboard(e).is(['E_LOWERCASE', 'DOT', 'MINUS', 'PLUS'])) {\n e.preventDefault()\n }\n }\n\n const handlePageChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.value === '') {\n setPageValue('')\n return\n }\n\n const numberValue = Number(e.target.value)\n\n if (!numberValue || numberValue < 1 || numberValue > totalPages) return\n\n setPageValue(numberValue)\n }\n\n return (\n <Layout.Group space=\"s\" align=\"center\">\n {!isCompact && (\n <NoPaddingButton\n onClick={handleFirstPageClick}\n disabled={page === 0 || disabled}\n title=\"First page\"\n >\n <ActionIcon name=\"caret-right-last\" rotate={180} />\n </NoPaddingButton>\n )}\n <NoPaddingButton\n onClick={handlePreviousPageClick}\n disabled={page === 0 || disabled}\n title=\"Previous page\"\n >\n <ActionIcon name=\"caret-left\" />\n </NoPaddingButton>\n {!isCompact && (\n <>\n <TextField\n type=\"number\"\n min={1}\n max={totalPages}\n disabled={disabled || totalPages === 1}\n onChange={handlePageChange}\n onBlur={publishPageChange}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n scale=\"small\"\n value={count ? pageValue : 0}\n title=\"Page\"\n />\n <Text variant=\"body\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n of{' '}\n <Text variant=\"body-bold\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {totalPages}\n </Text>\n </Text>\n </>\n )}\n <NoPaddingButton\n onClick={handleNextPageClick}\n disabled={page >= totalPages - 1 || disabled}\n title=\"Next page\"\n >\n <ActionIcon name=\"caret-right\" />\n </NoPaddingButton>\n {!isCompact && (\n <NoPaddingButton\n onClick={handleLastPageClick}\n disabled={page >= totalPages - 1 || disabled}\n title=\"Last page\"\n >\n <ActionIcon name=\"caret-right-last\" />\n </NoPaddingButton>\n )}\n </Layout.Group>\n )\n}\n\nexport default TablePaginationActions\n","import React from 'react'\nimport { Text } from 'components/Text'\nimport { Dropdown, DropdownContext } from 'components/Dropdown'\nimport { Layout } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport type { RowsPerPageProps } from './TablePagination.types'\nimport type { ButtonProps } from 'components/Button'\nimport { NoPaddingButton } from './TablePagination.styles'\nimport { Popover } from 'components/Popover'\n\nconst TriggerButton = (props: Omit<ButtonProps, 'scale' | 'variant'>) => {\n const { toggle } = React.useContext(DropdownContext)\n\n return (\n <Popover.Reference>\n <NoPaddingButton data-testid=\"rows-per-page-button\" onClick={toggle} {...props}>\n <Icon name=\"caret-down\" size={16} color=\"neutral-darker\" />\n </NoPaddingButton>\n </Popover.Reference>\n )\n}\n\nfunction RowsPerPage({\n page,\n rowsPerPage,\n onRowsPerPageChange,\n labelRowsPerPage,\n count,\n rowsPerPageOptions,\n disabled = false,\n position = 'bottom',\n align = 'start',\n}: RowsPerPageProps): JSX.Element {\n const getItemsRange = () => {\n if (!count) {\n return 0\n }\n\n const from = page * rowsPerPage + 1\n let to = (page + 1) * rowsPerPage\n\n if (to > count) {\n to = count\n }\n\n return `${from}-${to}`\n }\n\n return (\n <Layout.Group space=\"s\" align=\"center\">\n <Text variant=\"caption\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {labelRowsPerPage}\n </Text>\n <Text variant=\"body\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n <Text variant=\"body-bold\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {getItemsRange()}\n </Text>{' '}\n of{' '}\n <Text variant=\"body-bold\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {count}\n </Text>\n </Text>\n <Dropdown position={position} align={align}>\n <TriggerButton disabled={disabled} />\n <Dropdown.Menu>\n {rowsPerPageOptions.map((option) => (\n <Dropdown.Item\n key={option}\n onClick={() => onRowsPerPageChange(option)}\n trailing={option === rowsPerPage && <Icon name=\"check\" size={20} color=\"accent\" />}\n >\n {option} per page\n </Dropdown.Item>\n ))}\n </Dropdown.Menu>\n </Dropdown>\n </Layout.Group>\n )\n}\n\nexport default RowsPerPage\n","import React from 'react'\n\nimport { Layout } from 'components/Layout'\n\nimport type { TablePaginationProps } from './TablePagination.types'\nimport TablePaginationActions from 'components/TablePagination/TablePaginationActions'\nimport RowsPerPage from 'components/TablePagination/RowsPerPage'\n\nfunction TablePagination(props: TablePaginationProps): JSX.Element {\n const {\n variant = 'default',\n count,\n labelRowsPerPage = 'Rows per page:',\n onPageChange,\n onRowsPerPageChange,\n page,\n rowsPerPage = 50,\n rowsPerPageOptions = [10, 25, 50, 100],\n disabled = false,\n rowsPerPagePlacement,\n ...rest\n } = props\n\n return (\n <Layout.Group space=\"xl\" align=\"center\" justify=\"space-between\" {...rest}>\n <RowsPerPage\n page={page}\n count={count}\n onRowsPerPageChange={onRowsPerPageChange}\n rowsPerPage={rowsPerPage}\n rowsPerPageOptions={rowsPerPageOptions}\n labelRowsPerPage={labelRowsPerPage}\n disabled={disabled || !count}\n position={rowsPerPagePlacement?.position}\n align={rowsPerPagePlacement?.align}\n />\n <TablePaginationActions\n variant={variant}\n page={page}\n onPageChange={onPageChange}\n rowsPerPage={rowsPerPage}\n count={count}\n disabled={disabled || !count}\n />\n </Layout.Group>\n )\n}\n\nexport default TablePagination\n","import styled from 'styled-components'\nimport hiddenStyle from 'styles/hidden'\n\nexport const VisuallyHidden = styled.span`\n ${hiddenStyle(true)}\n`\n"],"names":["transitionStyle","options","property","timingFunction","duration","Wrapper","span","withConfig","displayName","componentId","transition","props","$color","token","UnknownIcon","React","IconFactory","map","getIcon","name","String","toLowerCase","size","width","height","className","color","rest","I","SvgBack","SvgBurgerMenu","SvgCalendar","SvgCaretDown","SvgCaretLeft","SvgCheck","SvgChevronDown","SvgCaretRight","SvgCircle","SvgClose","SvgInformation","SvgMinus","SvgPlus","SvgRefresh","SvgSortAsc","SvgSortDesc","SvgSort","SvgUpload","SvgWarning","SvgDotsHorizontal","SvgCaretRightLast","icons","BurguerMenuIcon","calendar","CalendarIcon","CaretDownIcon","CaretLeftIcon","ChevronRightIcon","ChevronDownIcon","back","BackIcon","check","CheckIcon","circle","CircleIcon","close","CloseIcon","information","InformationIcon","minus","MinusIcon","plus","PlusIcon","refresh","RefreshIcon","sort","SortIcon","SortAscIcon","SortDescIcon","upload","UploadIcon","warning","WarningIcon","DotsHorizontalIcon","CaretRightLastIcon","Icon","interleave","array1","array2","safeArray1","toArray","safeArray2","isEmpty","flatten","element","index","activatableStyle","strings","args","safeStrings","concat","disableableStyle","ellipsizableStyle","focusableStyle","hoverableStyle","fontStyle","weight","family","transform","css","getToken","typographyProperties","fontSize","lineHeight","fontWeight","body","caption","fontFamily","textTransform","link","DEFAULT_VARIANT","getPropertiesByVariant","variant","typography","isFunction","properties","conditional","italic","ANIMATION_DURATION","animation","keyframes","Layer","path","Spinner","title","getSpace","prop","whenProps","GroupContainer","div","center","$align","stretch","$justify","Group","space","justify","align","children","StackContainer","Stack","BoxContainer","left","$textAlign","right","$background","$borderColor","$borderWidth","$borderRadius","Box","background","borderColor","borderRadius","borderWidth","padding","textAlign","SidebarContainer","$reversed","Sidebar","minContentWidth","reversed","sideWidth","SwitcherContainer","Switcher","limit","threshold","GridContainer","Grid","minColumnWidth","Layout","loading","Bar","velocity","LoadingBar","alignment","secondaryTitle","undefined","pulse","Dot","LoadingDots","StyledSpan","rem","Leading","styled","Trailing","Children","ellipsizable","BaseStyledButton","button","$scale","disableable","$loading","StyledButton","$variant","$scheme","hoverable","focusable","activatable","StyledSelector","TextHidden","StyledLoadingDots","attrs","role","ButtonLoadingDots","buttonVariant","remainingProps","loadingDotsVariant","Set","has","ButtonChildrenWrapper","BaseButton","forwardRef","scale","leading","trailing","disabled","others","ref","Button","type","scheme","Caret","SelectorButton","omit","IconButton","CloseButton","BackButton","toVal","mix","k","y","str","clsx","i","tmp","x","SelectorWrapper","StyledLabel","label","font","SelectionWrapper","selector","Check","Selector","input","Checkbox","Fragment","Radio","useFocusWithin","onFocus","onBlur","focused","setFocused","useState","containerRef","useRef","getContainer","current","handleFocus","useCallback","handleBlur","useEffect","addEventListener","removeEventListener","Status","Success","Danger","Warn","Neutral","InputWrapper","status","StyledInput","TextField","useTextField","onChange","onChangeProp","value","valueProp","setValue","e","target","TextareaWrapper","StyledTextarea","textarea","Textarea","objectFromQueryString","qs","key","queryStringFromObject","obj","toCapitalizeFirstLetter_1","toUpperCaseFirstLetter","word","toCapitalizeFirstLetter","toLocaleCapitalizeFirstLetter_1","toLocaleUpperCaseFirstLetter","locale","toLocaleCapitalizeFirstLetter","localeDefined","item","isBlank_1","isBlank","text","trimmedText","exports","objectFromQueryString_1","require$$0","queryStringFromObject_1","require$$1","require$$2","require$$3","require$$4","INSECURE_HREF","checkHref","href","test","checkTarget","rel","sanitizedRel","split","filter","Boolean","add","Array","from","join","useSafeLink","StyledBaseAnchor","a","BaseLink","forwardedRef","StyledAnchor","Link","StyledLink","StyledLi","li","active","getWrappedLabel","url","onClick","isNil","Breadcrumb","StyledWrapper","nav","StyledOl","ol","StyledBackButton","Breadcrumbs","entries","onBack","entry","useDidMount","counter","GenericAdapter","getKey","o","get","createSelectionStrategy","adapters","multiple","context","getAdapter","MultipleSelectionStrategy","SingleSelectionStrategy","init","items","select","Map","newSelection","slice","length","adapter","_type","set","unselect","keys","selection","delete","toggle","clear","MAX_LENGTH","INITIAL_LENGTH","ALPHABET","IDGenerator","maxIDLength","initialIDLength","alphabet","currentLength","filledCharacters","fill","availableIDs","range","reduce","acc","n","Math","pow","Error","newID","at","getID","useFingerprint","knownRef","fingerprint","setFingerprint","getFingerprint","currentFingerprint","update","known","safeItems","newKnown","hasSameItems","Object","resetFingerprint","hasSameFingerprint","otherItems","DEFAULT_ADAPTERS","createUseSelectable","didMount","strategy","useMemo","reducer","state","action","payload","initializer","selected","dispatch","useReducer","identity","propagateChangeRef","newSelected","createSelectable","SelectableContext","createContext","useSelectable","ToggleGroupContext","ToggleButton","$type","isMultiple","Toggle","group","useContext","selectable","Toggle$1","Container","$multiple","fromValueToSelected","valueAsArray","fromSelectedToValue","pairs","option","push","DEFAULT_SELECTED","ToggleGroup","id","Option","TabContext","useID","propId","setID","TabsItemsWrapper","ul","StyledListItem","direction","row","column","TabsItems","TabsItem","default","isDefault","tabId","setActiveTab","activeTab","isActive","handleSelect","event","PanelsItemsWrapper","PanelsItemWrapper","article","block","none","PanelsItems","PanelsItem","lazy","hidden","TabsWrapper","Tabs","propTab","onTabChange","Items","Item","Panels","Panel","StyledSection","section","StyledSectionTitle","SectionTitle","Section","Title","hiddenStyle","accessible","AccordionContext","AccordionProvider","expanded","onExpandedChange","initialExpanded","openState","setOpenState","open","useAccordionContext","StyledToggle","StyledContent","HiddenInput","ToggleIndicator","AccordionWrapper","AccordionToggle","propsTrailing","AccordionBody","Accordion","Body","Description","TextSection","$dismissible","StyledBanner","wrap","DefaultCloseButton","IconWrapper","DefaultIcon","InlineButton","ButtonWrapper","LargeButtonWrapper","TextWrapper","getAlertIcon","icon","iconName","Banner","description","onClose","dismissible","visible","setVisible","isValidElement","BannerLarge","BannerAction","secondaryAction","onActionButtonClick","onSecondaryActionButtonClick","BannerActionLarge","Text$1","ModalWrapper","flex","HeaderWrapper","Close","Content","fullscreen","Header","Text","Modal","onOverlayClick","ReactDOM","createPortal","stopPropagation","document","h1","ActionWrapper","StyledDialogActions","$direction","end","initial","DialogActions","DialogActionConfirm","onConfirm","DialogActionCancel","onCancel","Dialog","ActionConfirm","ActionCancel","Actions","useDialog","openProp","onOpen","setOpen","show","hide","min","max","round","floor","createCoords","v","oppositeSideMap","oppositeAlignmentMap","clamp","start","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignmentAxis","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","getSideList","side","isStart","lr","rl","tb","bt","getOppositeAxisPlacements","flipAlignment","list","expandPaddingObject","getPaddingObject","rectToClientRect","rect","computeCoordsFromPlacement","_ref","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","computePosition","config","middleware","platform","validMiddleware","statefulPlacement","middlewareData","resetCount","fn","nextX","nextY","data","reset","detectOverflow","_await$platform$isEle","elements","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","arrow","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","min$1","offset","shouldAddOffset","alignmentOffset","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflow","overflows","overflowsData","sides","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","resetPlacement","d","b","_overflowsData$filter2","currentSideAxis","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","_middlewareData$offse","diffCoords","shift","limiter","mainAxisCoord","crossAxisCoord","minSide","maxSide","limitedCoords","hasWindow","getNodeName","node","isNode","getWindow","_node$ownerDocument","getDocumentElement","isElement","isHTMLElement","isShadowRoot","isOverflowElement","overflowX","overflowY","display","getComputedStyle","isTableElement","isTopLayer","isContainingBlock","elementOrCss","webkit","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","result","getNearestOverflowAncestor","parentNode","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","top","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","ignoreScrollbarX","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","offsets","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","html","getViewportRect","visualViewport","visualViewportBased","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","cache","cachedResult","el","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingRect","clippingAncestors","firstClippingAncestor","clippingRect","accRect","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","rectsAreEqual","observeMove","onMove","io","timeoutId","root","cleanup","_io","skip","elementRectForRootMargin","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset$1","shift$1","flip$1","arrow$1","mergedOptions","platformWithCache","computePosition$1","useLayoutEffect","deepEqual","getDPR","roundByDPR","dpr","useLatestRef","useFloating","externalReference","externalFloating","whileElementsMounted","setData","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","setReference","referenceRef","setFloating","floatingRef","floatingEl","dataRef","hasWhileElementsMounted","whileElementsMountedRef","platformRef","openRef","fullData","isMountedRef","refs","floatingStyles","initialStyles","isRef","arrow$2","deps","PopoverContext","usePopover","Popover","arrowRef","position","desiredPlacement","resultPosition","resultAlign","register","setArrow","PopoverReference","PopoverFloating","style","Floating","Reference","TooltipPosition","Top","Bottom","Left","Right","TooltipAlign","Start","Center","End","Bubble","StyledArrow","Arrow","Tooltip","message","showTooltip","hideTooltip","StyledChildren","StyledRequired","sup","StyledTooltipAnchor","Label","as","required","tip","tipProps","tag","PAGINATION_ITEM_TYPE","endEllipsis","next","page","previous","startEllipsis","IconButtonDefault","PageButton","underline","ICONS_NAME","PaginationItem","itemType","toString","includes","PaginationHelper","boundaryCount","count","siblingCount","constructor","_","getStartPages","getEndPages","getSibilingsStart","getSibilingsEnd","endPages","getStartEllipsis","siblingsStart","getEndEllipsis","usePagination","handleChange","paginationHelper","handleClick","startPages","siblingsEnd","itemList","getButtonPage","isDisabled","isNumber","Pagination","rounded","Line","Progress","ProgressBar","showLine","extra","clampedValue","SwitchWrapper","Slider","ActiveIcon","InactiveIcon","Switch","onToggle","StyledTag","removable","StyledCloseButton","StyledSpacer","Tag","onRemove","getRemoveButtonProps","ToastCountDown","INTERVAL","Toast","timeout","showIcon","setCount","decrementBy","interval","window","setTimeout","clearTimeout","ToastIcon","radioElement","getElementById","checked","getPanelRadioID","StepsContext","StepConnector","complete","ProgressStepWrapper","ProgressStepContainer","StepIndicator","StepLabel","ProgressStep","step","indicator","ProgressWrapper","StepsProgress","steps","StepWrapper","StepsStep","StepsID","StepsWrapper","Steps","Step","useSteps","currentProp","stepIndexByID","forEach","currentIndex","getStepIndex","newCurrentIndex","stepID","stepIndex","CardTitle","CardSubtitle","CardSeparator","hr","CardBody","CardTitleWrapper","flagged","Flag","Card","Subtitle","Separator","DropdownContext","expandDisabled","StyledPopover","DropdownItemWrapper","DropdownSectionHeader","strong","DropdownSectionWrapper","GenericDropdownMenuWrapper","DropdownMenuWrapper","DropdownSeparator","DropdownMenu","header","footer","DropdownMenuItem","persist","DropdownMenuSection","SUPPORTED_KEYS","ALT","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","CONTROL","ENTER","ESCAPE","SHIFT","SPACE","TAB","E_LOWERCASE","DOT","PLUS","MINUS","getKeyboardKey","keyCode","indexOf","KeyboardKey","is","otherKeys","expectedKeys","otherKey","useClickOutside","container","callback","setActive","handleEvent","hasPressedEsc","hasTarget","contains","subscribe","unsubscribe","dropdownExpandedStyle","triggerButtonAttrs","outlined","TriggerButton","capitalize","uppercase","DropdownTriggerWrapper","$outlined","TriggerHandle","RotatableIcon","$rotate","DropdownTriggerButton","contextValue","renderChildren","DropdownTriggerHandle","GenericDropdownTrigger","DropdownTrigger","Handle","useDropdown","setExpanded","isExpanded","expand","collapse","DropdownWrapper","HiddenCloseButton","tabIndex","useDeprecatedAlignFromMenu","child","GenericDropdown","Dropdown","dropdownProps","Trigger","Menu","SelectContext","pluralize","plural","singular","GenericSelectTrigger","SelectTriggerSearchField","SelectTrigger","getFocusedIndexAfterKeyPress","currentFocused","focusableCounter","keyHandler","Tab","shiftKey","ArrowUp","ArrowDown","unknownKey","increment","getTabbableDescendants","querySelectorAll","useFocusTrap","onActivate","onDeactivate","setCurrentFocused","mutationObserverRef","focusableDescendants","setFocusableDescendants","subscribeToDOMMutationEvents","MutationObserver","observe","childList","unsubscribeToDOMMutationEvents","disconnect","handleKeyDownEvent","evt","supportedKeys","preventDefault","newCurrentFocused","focus","activate","deactivate","isThenable","object","isObject","getLabel","getValue","toSelection","getDisplayValue","escapeRegExp","replace","getData","datasources","query","regex","RegExp","promises","types","ds","Promise","resolve","fetch","results","allSettled","getDatasources","getDatasourceFromOptions","extractAdapters","TriggerOnFocusHandler","mapOptions","useOptions","setOptions","setStatus","timeoutRef","cancelPendingFetch","fetchAfterTimeout","values","getOptionByKey","useSelect","onQueryChange","onCreate","getInputProps","isValidNewOption","createOptionPosition","triggerRef","focusTrap","queryTyped","setQueryTyped","setQuery","dropdown","getSelectableOption","getOption","toggleOption","getDropdownProps","getTriggerProps","sanitizedValue","getClearProps","getMenuProps","getOptionProps","getCreatebleProps","asyncOnClick","onCreateReturn","isCreatable","findByLabel","toLocaleLowerCase","isQueryEqualAnOption","find","getIsValidNewOption","autoFocus","highlightMatch","match","pre","mid","post","HighlightMatchWrapper","HighlightMatch","DefaultGroup","DefaultSelectOption","SelectOption","renderContent","SelectEmpty","SelectCreatableOption","defaultComponents","Empty","CreatableOption","getComponents","components","OMITTED_PROPS","Loading","getCommonClearButtonProps","SelectMenu","ClearMultiple","total","Divider","DividerText","isQuerying","after","before","renderOptionsSingle","renderOptionsMultiple","selectedOptions","remainingOptions","remaining","Select","placeholder","hideClear","renderOptions","getTrailing","useSelectExternal","isChecked","Logo","Logo$3","updateHeight","useHeightExpansionToggler","targetElRef","toggleState","prevState","totalHeight","setTotalHeight","observer","finalHeight","StyledMenuItem","Flex","MenuBaseItem","MenuLink","MenuLink$2","StyledIcon","$expanded","ExpandableItems","ItemsWrapper","MenuExpandable","expandableItemsRef","cloneElement","ariaHidden","styledCompounds","Parent","compounds","MenuTitle","menuId","MenuItem","StyledMenu","SubItem","aside","SideNavigation","useWindowSize","windowSize","setWindowSize","innerWidth","innerHeight","handleResize","transformInPixels","parseFloat","BASE_PIXELS","useSideNavigation","useWindowResize","theme","useTheme","shouldOpen","breakpoint","breakpointInPixels","StyledAside","StyledHeader","StyledBody","StyledFooter","DrawerHeader","DrawerBody","DrawerFooter","Drawer","onClickOutside","invisible","setInvisible","handleTransitionEnd","currentRef","isSameNode","Footer","getSelectableProps","defaults","generic","useTableSelectionCore","registered","setRegistered","selectableProps","allRowsAreSelected","prev","some","prevRow","toggleAll","TableSelectionContext","TableSelectionProvider","selectionCore","useTableSelection","useSelection","isCellSelected","selectedRows","useIsCellSelected","DefaultBox","TableSortHandle","order","StyledTableBody","tbody","StyledTableFoot","tfoot","StyledTableCaption","$position","StyledCell","StyledTableCell","td","format","StyledTableHeadCell","th","pointer","clickable","normal","StyledTableHead","thead","StyledTableRow","tr","solid","StyledExpandableContentRow","StyledTable","table","Table","TableCaptionInner","TableCaption","TableHead","TableBody","TableCell","SelectionCell","Input","SelectionHeadCell","TableHeadCell","TableRow","useIsRowSelected","ExpandableTableRow","expandableContent","propsLeading","colSpan","isArray","ActionsWrapper","TableSelectionActions","buttons","Action","StyledPickerTrigger","InternalButton","TablePickerItem","TriggerIcon","TablePicker","trigger","propsTrigger","selectionCellChild","Head","Row","Cell","HeadCell","Foot","Caption","Selection","ExpandableRow","SortHandle","Picker","Logo$1","MenuDropdown","MenuDropdownSeparator","MenuDropdownTrigger","MenuDropdownLabel","Ellipsizable","$max","MenuDropdownSubItemLink","MenuDropdownSubItem","MenuItemDropdown","labelId","hasIcon","MenuItemIcon","MenuContainer","OpenSideNavButton","OpenSideNavButton$1","removeRightPadding","TopNavigation","VerticalWrapper","EmptyStateWithIcon","isHorizontal","Illustration","illustration","EmptyStateWithIllustration","isPageVariant","EmptyState","aliased","aliasMap","alias","MONTH_BY_ALIAS","jan","january","feb","february","mar","march","apr","april","may","jun","june","jul","july","aug","august","sep","september","oct","october","nov","november","dec","december","MONTH_BY_NAME","getMonthByAlias","getAllMonths","MonthHelper","month","representation","padStart","other","getAll","PickerModeToggle","DEFAULT_OPTIONS","normalize","DateHelper","dateArg","optionsArg","utcDate","date","Date","UTC","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","getYear","getMonth","getDate","getTime","getWeekday","getUTCDay","getHours","getMinutes","getSeconds","getMilliseconds","matches","constraints","constraintEvaluators","getConstraintEvaluator","evaluator","unit","subtract","newValue","year","day","hour","minute","second","millisecond","setUTCFullYear","setUTCMonth","setUTCDate","setUTCHours","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","operator","precision","compare","getComparableDate","toISOString","DATE_ZERO","MIN_SUPPORTED_DATE","sliceIndex","normalizedPart","normalizedDate","getConstraintRange","rangeArg","rangeStart","rangeEnd","MAX_SUPPORTED_DATE","timestamp","newDate","constraint","InvalidDateConstraintError","padded","maxLength","TODAY","useCalendar","onSelect","mode","amountOfMonthsToRender","setSelected","getSelectionPair","renderableMonths","setRenderableMonths","getRenderableMonths","initialMonth","getFullYear","getSelectionBoundary","months","DAY_IN_MILLISECONDS","getRenderableMonth","firstDayOfTheWeek","totalDaysInMonth","days","amount","getOrdinalSuffix","number","getTokenValue","DEFAULT_FORMATTERS","ADDITIONAL_FORMATTERS","DateFormatHelper","tokens","tokenizer","previousIndex","previousToken","COMPOUND_FORMATTERS","valid","getType","char","isEscaping","charAt","MM","Intl","DateTimeFormat","MMM","MMMM","D","DD","ddd","weekday","dddd","YYYY","HH","hourCycle","hh","hour12","mm","ss","A","toUpperCase","parseInt","PickerButton","$status","DefaultPickerButton","WEEKDAYS","formatter","getStatus","isPastYearDay","DefaultText","CalendarDayPicker","onDayClick","renderDaysOfWeek","textDecoration","renderDaysOfMonth","formatted","CalendarMonthPicker","CalendarYearPicker","usePickerMode","DayPicker","MonthPicker","YearPicker","BorderlessButton","GenericCalendar","onMonthClick","onYearClick","Calendar","getSelection","formatDate","Number","isNaN","getInitialCalendarSetup","selectionStart","startDate","setInputValue","getInputValue","useDatePicker","handleDateSelect","inputRef","formattedDate","handleDateInputChange","handleDateInputClick","handleDayClick","handleClearClick","currSelectedDate","currInputValue","getCalendarProps","currSelection","DATE_REGEX","DefaultTextField","ClearButton","DateInput","handleInputChange","DatePicker","datePicker","renderTrailing","AT_RANGE_START","AT_RANGE_END","useDateRangePicker","inputsRef","currentlyPickingRef","getDateInputChangeHandler","handleDropdownBlur","every","handleDoneClick","getRangeStartInputProps","getRangeEndInputProps","getDoneProps","currSelected","DropdownFooter","DateRangePicker","dateRangePicker","renderRangeEndTrailing","currRangeStart","currRangeEnd","renderDropdownFooter","ErrorMessage","DragDropFileWrapper","withFileList","DropZoneWrapper","error","FileListUL","fileList","useDragDropFileContext","DropZone","hint","accept","renderCustomContent","onFilesAdded","isDragging","setIsDragging","onChangeInput","currentTarget","files","onKeyPress","click","onDrop","dataTransfer","onDragStart","onDragOver","onDragLeave","renderDefaultContent","BYTES_PER_KILOBYTE","FILE_SIZE_ABBREVIATIONS","formatBytes","bytes","decimals","bytesValue","dm","log","unitAbbr","toFixed","FileName","file","FileActionButton","onRetry","LoadingFile","actionProps","ErrorFile","errorMessage","SuccessFile","FILE_ITEM_BY_STATUS","success","FileItem","FileItemComponent","FileList","onRemoveFile","onRetryUpload","uploadedFiles","DragDropFile","NoPaddingButton","ActionIcon","TablePaginationActions","onPageChange","rowsPerPage","totalPages","ceil","pageValue","setPageValue","isCompact","handleFirstPageClick","handlePreviousPageClick","handleNextPageClick","handleLastPageClick","publishPageChange","handleKeyUp","Keyboard","handleKeyDown","handlePageChange","numberValue","RowsPerPage","onRowsPerPageChange","labelRowsPerPage","rowsPerPageOptions","getItemsRange","to","TablePagination","rowsPerPagePlacement","VisuallyHidden"],"mappings":"i6BAUA,SAASA,EAAgBC,EAA0C,CAG1D,MAAA;AAAA,2BAEHA,GAASC,UACT,qFAAqF;AAAA,kCAEzDD,GAASE,gBAAkB,8BAA8B;AAAA,2BAChEF,GAASG,UAAY,OAAO;AAAA;AAAA,GAGvD,CCRA,MAAMC,GAAiBC,EAAAA,QAAAA,KAAIC,WAAA,CAAAC,YAAA,UAAAC,YAAA,cAAA,CAAA,EAAA,CAAA,2EAAA,UAAA,sBAAA,EAOrBC,EAAW,CACXR,SAAU,WACZ,CAA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4zC,GAAgB7vD,EAA0C,CAC3D,KAAA,CACJ8G,QAAAA,EAAU,UACV41B,MAAAA,EACA+yB,iBAAAA,EAAmB,iBACnBnB,aAAAA,EACAkB,oBAAAA,EACA3zB,KAAAA,EACA0yB,YAAAA,EAAc,GACdmB,mBAAAA,EAAqB,CAAC,GAAI,GAAI,GAAI,GAAG,EACrCriD,SAAAA,EAAW,GACXyiD,qBAAAA,EACA,GAAG9uD,CAAAA,EACDhB,EAEJ,+BACGuK,GAAO,MAAP,CAAa,MAAM,KAAK,MAAM,SAAS,QAAQ,gBAAgB,GAAIvJ,2BACjEuuD,GACC,CAAA,KAAA1zB,EACA,MAAAa,EACA,oBAAA8yB,EACA,YAAAjB,EACA,mBAAAmB,EACA,iBAAAD,EACA,SAAUpiD,GAAY,CAACqvB,EACvB,SAAUozB,GAAsBz2B,SAChC,MAAOy2B,GAAsBvnD,MAAM,EAErCnI,UAAA,cAACiuD,IACC,QAAAvnD,EACA,KAAA+0B,EACA,aAAAyyB,EACA,YAAAC,EACA,MAAA7xB,EACA,SAAUrvB,GAAY,CAACqvB,EAAM,CAEjC,CAEJ,CC3CaqzB,MAAAA,GAAwBpwD,EAAAA,QAAAA,KAAIC,WAAA,CAAAC,YAAA,iBAAAC,YAAA,aAAA,CAAA,EAAA,CAAA,GAAA,EAAA,EACrCof,GAAY,EAAI,CAAC","x_google_ignoreList":[46,55,56,57,58,59,60,85,86,87,88,89]}
1
+ {"version":3,"file":"index.js","sources":["../src/styles/transition.tsx","../src/components/IconFactory/IconFactory.tsx","../src/components/Icon/assets/back.svg","../src/components/Icon/assets/burger-menu.svg","../src/components/Icon/assets/calendar.svg","../src/components/Icon/assets/caret-down.svg","../src/components/Icon/assets/caret-left.svg","../src/components/Icon/assets/check.svg","../src/components/Icon/assets/chevron-down.svg","../src/components/Icon/assets/caret-right.svg","../src/components/Icon/assets/circle.svg","../src/components/Icon/assets/close.svg","../src/components/Icon/assets/information.svg","../src/components/Icon/assets/minus.svg","../src/components/Icon/assets/plus.svg","../src/components/Icon/assets/refresh.svg","../src/components/Icon/assets/sort-asc.svg","../src/components/Icon/assets/sort-desc.svg","../src/components/Icon/assets/sort.svg","../src/components/Icon/assets/upload.svg","../src/components/Icon/assets/warning.svg","../src/components/Icon/assets/dots-horizontal.svg","../src/components/Icon/assets/caret-right-last.svg","../src/components/Icon/Icon.tsx","../src/utils/toolset/interleave.ts","../src/styles/activatable.tsx","../src/styles/disableable.tsx","../src/styles/ellipsizable.tsx","../src/styles/focusable.tsx","../src/styles/hoverable.tsx","../src/styles/font.tsx","../src/styles/typography.ts","../src/components/Loaders/Spinner.tsx","../src/components/Layout/Layout.utils.ts","../src/components/Layout/Group.tsx","../src/components/Layout/Stack.tsx","../src/components/Layout/Box.tsx","../src/components/Layout/Sidebar.tsx","../src/components/Layout/Switcher.tsx","../src/components/Layout/Grid.tsx","../src/components/Layout/Layout.tsx","../src/components/Loaders/LoadingBar.tsx","../src/components/Loaders/LoadingDots.tsx","../src/components/Button/Button.tsx","../src/common/CloseButton/CloseButton.tsx","../src/common/BackButton/BackButton.tsx","../src/common/SelectionWrapper.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/hooks/useFocusWithin/useFocusWithin.ts","../src/utils/types/Status.ts","../src/components/TextField/TextField.tsx","../src/components/TextField/useTextField.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Link/useSafeLink.ts","../src/components/Link/Link.tsx","../src/components/Breadcrumbs/Breadcrumb.tsx","../src/components/Breadcrumbs/Breadcrumbs.tsx","../src/hooks/useDidMount/useDidMount.ts","../src/hooks/useSelectable/SelectableStrategy.ts","../src/utils/toolset/getID.ts","../src/hooks/useFingerprint/useFingerprint.ts","../src/hooks/useSelectable/useSelectable.ts","../src/components/ToggleGroup/ToggleGroupContext.ts","../src/components/ToggleGroup/Toggle.tsx","../src/components/ToggleGroup/ToggleGroup.tsx","../src/components/Tabs/TabsContext.ts","../src/hooks/useID/useID.ts","../src/components/Tabs/Tabs.tsx","../src/components/Section/Section.tsx","../src/styles/hidden.tsx","../src/components/Accordion/Accordion.context.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Banner/Banner.tsx","../src/components/Text/Text.tsx","../src/components/Modal/Modal.tsx","../src/components/Dialog/Dialog.tsx","../src/components/Dialog/useDialog.tsx","../src/components/Popover/Popover.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Label/Label.tsx","../src/components/Pagination/Pagination.constants.ts","../src/components/Pagination/PaginationItem.tsx","../src/components/Pagination/Pagination.helper.ts","../src/components/Pagination/usePagination.ts","../src/components/Pagination/Pagination.tsx","../src/components/ProgressBar/ProgressBar.tsx","../src/components/Switch/Switch.tsx","../src/components/Tag/Tag.tsx","../src/components/Toast/Toast.tsx","../src/components/Steps/Steps.helpers.ts","../src/components/Steps/StepsContext.ts","../src/components/Steps/ProgressSteps/ProgressStep.tsx","../src/components/Steps/ProgressSteps/ProgressSteps.tsx","../src/components/Steps/StepsStep.tsx","../src/components/Steps/Steps.tsx","../src/components/Steps/useSteps.ts","../src/components/Card/CardTitle.tsx","../src/components/Card/Card.tsx","../src/components/Dropdown/Dropdown.context.ts","../src/components/Dropdown/DropdownMenu.tsx","../src/utils/toolset/keyboard.ts","../src/hooks/useClickOutside/useClickOutside.ts","../src/components/Dropdown/DropdownTrigger.tsx","../src/components/Dropdown/useDropdown.ts","../src/components/Dropdown/Dropdown.tsx","../src/components/Select/Select.context.ts","../src/utils/toolset/pluralize.ts","../src/components/Select/SelectTrigger.tsx","../src/hooks/useFocusTrap/useFocusTrap.ts","../src/utils/toolset/isThenable.ts","../src/components/Select/Select.constants.ts","../src/components/Select/useSelect.helpers.ts","../src/components/Select/useSelect.ts","../src/utils/toolset/highlightMatch.tsx","../src/components/HighlightMatch/HighlightMatch.tsx","../src/components/Select/SelectOption.tsx","../src/components/Select/SelectEmpty.tsx","../src/components/Select/SelectCreatableOption.tsx","../src/components/Select/components.tsx","../src/components/Select/Select.tsx","../src/components/Select/useSelectExternal.ts","../src/components/SideNavigation/Logo/Logo.tsx","../src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.ts","../src/components/SideNavigation/Menu/MenuBaseItem.tsx","../src/components/SideNavigation/Menu/MenuLink.tsx","../src/components/SideNavigation/Menu/MenuExpandable.tsx","../src/utils/toolset/styledCompounds.ts","../src/components/SideNavigation/Menu/Menu.tsx","../src/components/SideNavigation/Separator/Separator.tsx","../src/components/SideNavigation/SideNavigation.tsx","../src/hooks/useWindowResize/useWindowResize.ts","../src/components/SideNavigation/useSideNavigation.ts","../src/components/Drawer/Drawer.tsx","../src/components/Table/Selection.tsx","../src/components/Table/TableSortHandle.tsx","../src/components/Table/Table.tsx","../src/components/TopNavigation/Logo/Logo.tsx","../src/components/TopNavigation/Menu/MenuItemDropdown.tsx","../src/components/TopNavigation/Menu/MenuItemIcon.tsx","../src/components/TopNavigation/Menu/Menu.tsx","../src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx","../src/components/TopNavigation/TopNavigation.tsx","../src/components/EmptyState/EmptyStateWithIcon.tsx","../src/components/EmptyState/Illustration.tsx","../src/components/EmptyState/EmptyStateWithIllustration.tsx","../src/components/EmptyState/EmptyState.tsx","../src/components/Calendar/Month.helper.ts","../src/components/Calendar/PickerModeToggle.tsx","../src/components/Calendar/Date.helper.ts","../src/components/Calendar/useCalendar.ts","../src/utils/toolset/getOrdinalSuffix.ts","../src/components/Calendar/DateFormat.helper.ts","../src/components/Calendar/Pickers/PickerButton.tsx","../src/components/Calendar/Pickers/DayPicker.tsx","../src/components/Calendar/Pickers/MonthPicker.tsx","../src/components/Calendar/Pickers/YearPicker.tsx","../src/components/Calendar/usePickerMode.ts","../src/components/Calendar/Calendar.tsx","../src/components/Calendar/Calendar.helpers.ts","../src/components/DatePicker/useDatePicker.ts","../src/components/DatePicker/DatePicker.tsx","../src/components/DatePicker/useDateRangePicker.ts","../src/components/DatePicker/DateRangePicker.tsx","../src/components/ErrorMessage/ErrorMessage.tsx","../src/components/DragDropFile/styles.tsx","../src/components/DragDropFile/components/Wrapper.tsx","../src/components/DragDropFile/components/DropZone.tsx","../src/utils/toolset/formatBytes.ts","../src/components/DragDropFile/components/FileItem.tsx","../src/components/DragDropFile/components/FileList.tsx","../src/components/DragDropFile/DragDropFile.tsx","../src/components/TablePagination/TablePagination.styles.ts","../src/components/TablePagination/TablePaginationActions.tsx","../src/components/TablePagination/RowsPerPage.tsx","../src/components/TablePagination/TablePagination.tsx","../src/components/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["interface TransitionStyleOptions {\n property?: string\n timingFunction?: string\n duration?: string\n}\n\n/**\n * Add basic CSS style for default transition parameters\n * @returns {string}\n */\nfunction transitionStyle(options?: TransitionStyleOptions): string {\n // TODO: add parameter to type of transition\n\n return `\n transition-property: ${\n options?.property ||\n 'background, border-color, box-shadow, color, fill, left, stroke, transform, opacity'\n };\n transition-timing-function: ${options?.timingFunction || 'cubic-bezier(0.4, 0, 0.2, 1)'};\n transition-duration: ${options?.duration || '450ms'};\n transition-delay: 0ms;\n `\n}\n\nexport default transitionStyle\n","import React, { ReactNode, ComponentType, type ReactElement } from 'react'\nimport styled from 'styled-components'\n\nimport transition from 'styles/transition'\nimport { getToken as token } from 'theming'\n\nimport type { ThemeToken } from 'theming'\n\ntype ThemeColors = keyof {\n [ColorToken in ThemeToken as ColorToken extends `color-${infer Token}`\n ? Token\n : never]: ColorToken\n}\n\nconst Wrapper = styled.span<{ $color?: ThemeColors }>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n &,\n & > svg {\n ${transition({\n property: 'transform',\n })}\n\n /*\n * prop('$color', 'currentColor')\n * Not using the prop helper function since we can't return\n * an evaluated token from it\n */\n color: ${(props) =>\n props.$color ? token(`color-${props.$color}` as ThemeToken, props) : 'currentColor'};\n\n fill: currentColor;\n }\n`\n\nexport interface IconProps<T> {\n name: keyof T\n size?: string | number\n width?: string | number\n height?: string | number\n className?: string\n color?: ThemeColors\n}\n\nexport type IconMapping = Record<string, ReactElement | ((props: never) => ReactElement)>\n\nexport function UnknownIcon(): ReactElement {\n return <span aria-label=\"Unknown icon\">&#9785;</span>\n}\n\nfunction IconFactory(map: IconMapping): ComponentType<IconProps<typeof map>> {\n function getIcon(name: keyof typeof map): ReactNode | null {\n // eslint-disable-next-line no-param-reassign\n name = String(name || '').toLowerCase()\n\n if (!(name in map)) return UnknownIcon\n\n return map[name]\n }\n\n return function Icon(props: IconProps<typeof map>) {\n const { name, size, width = '1em', height = '1em', className, color, ...rest } = props\n\n const I = getIcon(name) as typeof React.Component\n return (\n <Wrapper className={className} $color={color}>\n <I width={size || width} height={size || height} {...rest} />\n </Wrapper>\n )\n }\n}\n\nexport default IconFactory\n","import * as React from \"react\";\nconst SvgBack = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0 0h24v24H0V0z\", fill: \"none\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\" }));\nexport default SvgBack;\n","import * as React from \"react\";\nconst SvgBurgerMenu = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M4 37.6667H44V33.2222H4V37.6667ZM4 26.5556H44V22.1111H4V26.5556ZM4 11V15.4444H44V11H4Z\", fill: \"#313336\" }));\nexport default SvgBurgerMenu;\n","import * as React from \"react\";\nconst SvgCalendar = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0 0h24v24H0V0z\", fill: \"none\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V10h16v11zm0-13H4V5h16v3z\" }));\nexport default SvgCalendar;\n","import * as React from \"react\";\nconst SvgCaretDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M24 30L13 19H35L24 30Z\", clipRule: \"evenodd\" }));\nexport default SvgCaretDown;\n","import * as React from \"react\";\nconst SvgCaretLeft = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M30 42.3848L34.2426 38.1421L20.1005 24L34.2426 9.85786L30 5.61522L15.8579 19.7574L11.6152 24L15.8579 28.2426L30 42.3848Z\" }));\nexport default SvgCaretLeft;\n","import * as React from \"react\";\nconst SvgCheck = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M44.4203 13.3431L40.1777 9.1005L18.9645 30.3137L9.06496 20.4142L4.82232 24.6569L14.7218 34.5563L18.9645 38.799L23.2071 34.5563L44.4203 13.3431Z\" }));\nexport default SvgCheck;\n","import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z\" }));\nexport default SvgChevronDown;\n","import * as React from \"react\";\nconst SvgCaretRight = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M18 5.61522L13.7574 9.85786L27.8995 24L13.7574 38.1421L18 42.3848L32.1421 28.2426L36.3848 24L32.1421 19.7574L18 5.61522Z\" }));\nexport default SvgCaretRight;\n","import * as React from \"react\";\nconst SvgCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 18 18\", ...props }, /* @__PURE__ */ React.createElement(\"circle\", { cx: 9, cy: 9, r: 9, fillRule: \"evenodd\" }));\nexport default SvgCircle;\n","import * as React from \"react\";\nconst SvgClose = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 20 20\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17.0711 4.69671L15.3033 2.92894L10 8.23224L4.6967 2.92894L2.92893 4.69671L8.23223 10L2.92893 15.3033L4.6967 17.0711L10 11.7678L15.3033 17.0711L17.0711 15.3033L11.7678 10L17.0711 4.69671Z\" }));\nexport default SvgClose;\n","import * as React from \"react\";\nconst SvgInformation = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M12 2C6.48625 2 2 6.48625 2 12C2 17.5138 6.48625 22 12 22C17.5138 22 22 17.5138 22 12C22 6.48625 17.5138 2 12 2ZM12 19.2727C11.2473 19.2727 10.6364 18.6618 10.6364 17.9091C10.6364 17.1564 11.2473 16.5455 12 16.5455C12.7527 16.5455 13.3636 17.1564 13.3636 17.9091C13.3636 18.6618 12.7527 19.2727 12 19.2727ZM13.3636 14.2727H10.6364L10.6364 5.18182L13.3636 5.18182L13.3636 14.2727Z\" }));\nexport default SvgInformation;\n","import * as React from \"react\";\nconst SvgMinus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0 0h24v24H0V0z\", fill: \"none\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M19 13H5v-2h14v2z\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgPlus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"rect\", { fill: \"none\", height: 24, width: 24 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6V13z\" }));\nexport default SvgPlus;\n","import * as React from \"react\";\nconst SvgRefresh = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 12 12\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M6.782 1.5a4.499 4.499 0 0 0-4.437 3.785l-.89-.888-.705.705 2.123 2.123 2.12-2.122-.708-.708-.935.935A3.503 3.503 0 0 1 6.782 2.5c1.93 0 3.5 1.57 3.5 3.5s-1.57 3.5-3.5 3.5v1a4.5 4.5 0 0 0 0-9Z\" }));\nexport default SvgRefresh;\n","import * as React from \"react\";\nconst SvgSortAsc = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 10 11\", xmlns: \"http://www.w3.org/2000/svg\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_1\", fill: \"#313336\", d: \"m4.58334,0l4.58332,4.41667l-9.16666,0l4.58334,-4.41667z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }), /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_2\", fill: \"#CACCCF\", d: \"m4.58335,10.83337l-4.58333,-4.4167l9.16664,0l-4.58331,4.4167z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }));\nexport default SvgSortAsc;\n","import * as React from \"react\";\nconst SvgSortDesc = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 10 11\", xmlns: \"http://www.w3.org/2000/svg\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_1\", fill: \"#CACCCF\", d: \"m4.58334,0l4.58332,4.41667l-9.16666,0l4.58334,-4.41667z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }), /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_2\", fill: \"#313336\", d: \"m4.58335,10.83337l-4.58333,-4.4167l9.16664,0l-4.58331,4.4167z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }));\nexport default SvgSortDesc;\n","import * as React from \"react\";\nconst SvgSort = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 10 11\", xmlns: \"http://www.w3.org/2000/svg\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_1\", fill: \"#313336\", d: \"m4.58334,0l4.58332,4.41667l-9.16666,0l4.58334,-4.41667z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }), /* @__PURE__ */ React.createElement(\"path\", { id: \"svg_2\", fill: \"#313336\", d: \"m4.58335,10.83337l-4.58333,-4.4167l9.16664,0l-4.58331,4.4167z\", clipRule: \"evenodd\", fillRule: \"evenodd\" }));\nexport default SvgSort;\n","import * as React from \"react\";\nconst SvgUpload = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M39.0129 20.0894H29.9817V36.097H19.0291V20.0894H9.01953L24.1351 5L39.0129 20.0894ZM9 40V44H39V40H9Z\" }));\nexport default SvgUpload;\n","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { clipRule: \"evenodd\", d: \"M3.79753 20.9444H20.2031C21.1809 20.9444 21.8064 19.9034 21.3454 19.0421L13.142 3.68477C12.655 2.77174 11.3443 2.77174 10.856 3.68477L2.65392 19.0421C2.19415 19.9034 2.8197 20.9444 3.79753 20.9444ZM10.7045 9.30522H13.2948V14.4782H10.7045V9.30522ZM11.9996 15.7715C12.7146 15.7715 13.2948 16.3508 13.2948 17.0647C13.2948 17.7786 12.7146 18.358 11.9996 18.358C11.2847 18.358 10.7045 17.7786 10.7045 17.0647C10.7045 16.3508 11.2847 15.7715 11.9996 15.7715Z\" }));\nexport default SvgWarning;\n","import * as React from \"react\";\nconst SvgDotsHorizontal = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 24a5 5 0 11-10 0 5 5 0 0110 0zm15 0a5 5 0 11-10 0 5 5 0 0110 0zm15 0a5 5 0 11-10 0 5 5 0 0110 0z\", fill: \"currentColor\", fillRule: \"evenodd\" }));\nexport default SvgDotsHorizontal;\n","import * as React from \"react\";\nconst SvgCaretRightLast = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M18.2501 6.38126L14.1842 10.4471L27.7371 24L14.1842 37.5529L18.2501 41.6187L31.803 28.0659L35.8688 24L31.803 19.9341L18.2501 6.38126Z\" }), /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M40.2922 38.375L44.1256 38.375L44.1256 9.625L40.2922 9.625L40.2922 38.375Z\" }));\nexport default SvgCaretRightLast;\n","import { IconFactory } from '../IconFactory'\n\nimport BackIcon from './assets/back.svg'\nimport BurguerMenuIcon from './assets/burger-menu.svg'\nimport CalendarIcon from './assets/calendar.svg'\nimport CaretDownIcon from './assets/caret-down.svg'\nimport CaretLeftIcon from './assets/caret-left.svg'\nimport CheckIcon from './assets/check.svg'\nimport ChevronDownIcon from './assets/chevron-down.svg'\nimport ChevronRightIcon from './assets/caret-right.svg'\nimport CircleIcon from './assets/circle.svg'\nimport CloseIcon from './assets/close.svg'\nimport InformationIcon from './assets/information.svg'\nimport MinusIcon from './assets/minus.svg'\nimport PlusIcon from './assets/plus.svg'\nimport RefreshIcon from './assets/refresh.svg'\nimport SortAscIcon from './assets/sort-asc.svg'\nimport SortDescIcon from './assets/sort-desc.svg'\nimport SortIcon from './assets/sort.svg'\nimport UploadIcon from './assets/upload.svg'\nimport WarningIcon from './assets/warning.svg'\nimport DotsHorizontalIcon from './assets/dots-horizontal.svg'\nimport CaretRightLastIcon from './assets/caret-right-last.svg'\n\nimport type { IconProps as GenericIconProps } from '../IconFactory'\n\nconst icons = {\n 'burguer-menu': BurguerMenuIcon,\n calendar: CalendarIcon,\n 'caret-down': CaretDownIcon,\n 'caret-left': CaretLeftIcon,\n 'caret-right': ChevronRightIcon,\n 'chevron-down': ChevronDownIcon,\n back: BackIcon,\n check: CheckIcon,\n circle: CircleIcon,\n close: CloseIcon,\n information: InformationIcon,\n minus: MinusIcon,\n plus: PlusIcon,\n refresh: RefreshIcon,\n sort: SortIcon,\n 'sort-asc': SortAscIcon,\n 'sort-desc': SortDescIcon,\n upload: UploadIcon,\n warning: WarningIcon,\n 'dots-horizontal': DotsHorizontalIcon,\n 'caret-right-last': CaretRightLastIcon,\n}\n\nconst Icon = IconFactory(icons)\n\nexport type IconProps = GenericIconProps<typeof icons>\n\nexport default Icon\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport flatten from './flatten'\nimport isEmpty from './isEmpty'\nimport toArray from './toArray'\n\n// TODO: add this helper to @loadsmart/utils\n\nfunction interleave<T>(array1: Array<T>, array2: Array<T>): T[] {\n const safeArray1 = toArray(array1)\n const safeArray2 = toArray(array2)\n\n if (isEmpty(safeArray1) && isEmpty(safeArray2)) {\n return []\n } else if (isEmpty(safeArray1)) {\n return safeArray2\n } else if (isEmpty(safeArray2)) {\n return safeArray1\n }\n\n return flatten(safeArray1.map((element, index) => [element, safeArray2[index]]))\n}\n\nexport default interleave\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n\n/**\n * Add basic CSS style wrapping block for `:active` state.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction activatableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Array\n\n return [\n `\n &:enabled:not(.is-disabled) {\n &:active {`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n }\n `,\n ]\n}\n\nexport default activatableStyle\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n\n/**\n * Add basic CSS style wrapping block for `:disabled` state or `.is-disabled` class.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction disableableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Array\n\n return [\n `\n &.is-disabled,\n &:disabled {\n cursor: not-allowed;\n opacity: 0.40;\n\n user-select: none;\n\n &:active {\n pointer-events: none;\n }`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n\n // prevent overlapping the opacity for nested disabled elements\n .is-disabled &.is-disabled,\n .is-disabled &[disabled],\n [disabled] &[disabled],\n [disabled] &.is-disabled {\n opacity: 1 !important;\n }\n `,\n ]\n}\n\nexport default disableableStyle\n","/**\n * Add basic CSS style for ellipsizing the content of an element.\n * Setting `max-width` is a responsability of the caller.\n * @returns {string}\n */\nfunction ellipsizableStyle(): string {\n return `\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n `\n}\n\nexport default ellipsizableStyle\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n/**\n * Add basic CSS style wrapping block for `:active` state.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction focusableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Aray\n\n return [\n `\n outline: none;\n\n &:focus,\n &:focus-within,\n &.is-focused {\n outline: none;`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n `,\n ]\n}\n\nexport default focusableStyle\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport interleave from 'utils/toolset/interleave'\nimport type { InterpolatedStyle } from 'utils/types/InterpolatedStyle'\n\n/**\n * Add basic CSS style wrapping block for `:hover` state; it includes check for non-disabled (`:enabled` or not `.is-disabled`) elements.\n * It returns an array to allow handling of nested interpolation\n * @param {ReadonlyArray<string> | Array<string>} strings - String parts for the interpolation.\n * @param {any[]} args - Interpolated items.\n * @returns {any[]}\n */\nfunction hoverableStyle(\n strings?: ReadonlyArray<string> | Array<string>,\n ...args: any[]\n): InterpolatedStyle {\n const safeStrings = (strings || []).concat() // ReadonlyArray -> Array\n\n return [\n `\n &:not(.is-disabled):not(:disabled) {\n &:hover {`,\n ...(interleave(safeStrings, args) as InterpolatedStyle),\n `\n }\n }\n `,\n ]\n}\n\nexport default hoverableStyle\n","import { css } from 'styled-components'\nimport type { FlattenInterpolation } from 'styled-components'\n\nimport { getToken } from 'theming'\nimport type { ThemedProps, ThemeToken } from 'theming'\n\ninterface FontStyleOptions {\n size?: ThemeToken\n family?: ThemeToken\n weight?: ThemeToken\n height?: ThemeToken\n color?: ThemeToken\n transform?: 'uppercase' | 'none'\n}\n\n/**\n * Add basic CSS style for default font\n * @returns {FlattenInterpolation}\n */\nfunction fontStyle({\n color = 'color-neutral-darkest',\n weight = 'font-weight-regular',\n size = 'font-size-4',\n family = 'font-family-default',\n height = 'font-height-3',\n transform = 'none',\n}: FontStyleOptions): FlattenInterpolation<ThemedProps> {\n return css`\n color: ${getToken(color)};\n font-weight: ${getToken(weight)};\n font-size: ${getToken(size)};\n font-family: ${getToken(family)};\n line-height: ${getToken(height)};\n text-transform: ${transform};\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n `\n}\n\nexport default fontStyle\n","import { css, ThemedStyledProps } from 'styled-components'\nimport type { FlattenInterpolation } from 'styled-components'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport conditional from 'tools/conditional'\nimport type { CustomTheme, ThemeToken } from 'theming'\nimport fontStyle from './font'\n\nexport type TypographyOptions = {\n italic?: boolean\n color?: ThemeToken\n}\n\ntype PropertiesToken = {\n fontSize: ThemeToken\n lineHeight: ThemeToken\n fontWeight: ThemeToken\n fontFamily?: ThemeToken\n textTransform?: 'none' | 'uppercase'\n color?: ThemeToken\n}\n\nexport type TypographyVariants =\n | 'heading-lg'\n | 'heading-md'\n | 'heading-md-bold'\n | 'heading-sm'\n | 'heading-sm-bold'\n | 'body'\n | 'body-bold'\n | 'caption'\n | 'caption-bold'\n | 'number-sm'\n | 'number-md'\n | 'button-sm'\n | 'button-md'\n | 'button-lg'\n | 'table-header-sm'\n | 'table-header-md'\n | 'chips-sm'\n | 'link'\n\ntype TypographyProperties = Record<TypographyVariants, PropertiesToken>\n\nexport const typographyProperties: TypographyProperties = {\n 'heading-lg': {\n fontSize: 'font-size-1',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n },\n 'heading-md': {\n fontSize: 'font-size-2',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n },\n 'heading-md-bold': {\n fontSize: 'font-size-2',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-bold',\n },\n 'heading-sm': {\n fontSize: 'font-size-3',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-medium',\n },\n 'heading-sm-bold': {\n fontSize: 'font-size-3',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n },\n body: {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-medium',\n },\n 'body-bold': {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n },\n caption: {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-medium',\n },\n 'caption-bold': {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n },\n 'number-sm': {\n fontFamily: 'font-family-monospace',\n fontSize: 'font-size-5',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n },\n 'number-md': {\n fontFamily: 'font-family-monospace',\n fontSize: 'font-size-4',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n },\n 'button-sm': {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'button-md': {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'button-lg': {\n fontSize: 'font-size-3',\n lineHeight: 'font-height-1',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'table-header-sm': {\n fontSize: 'font-size-5',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-bold',\n },\n 'table-header-md': {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n 'chips-sm': {\n fontSize: 'font-size-6',\n lineHeight: 'font-height-3',\n fontWeight: 'font-weight-bold',\n textTransform: 'uppercase',\n },\n link: {\n fontSize: 'font-size-4',\n lineHeight: 'font-height-2',\n fontWeight: 'font-weight-medium',\n color: 'color-accent',\n },\n}\n\nconst DEFAULT_VARIANT: TypographyVariants = 'body'\n\nfunction getPropertiesByVariant(variant: TypographyVariants) {\n return variant in typographyProperties\n ? typographyProperties[variant]\n : typographyProperties[DEFAULT_VARIANT]\n}\n\ntype StyledTemplate<P> = FlattenInterpolation<ThemedStyledProps<P, CustomTheme>>\n\n/**\n * Standard styles for screen-rendered text\n * @param {TypographyVariants} variant Name of the variant\n * @param {TypographyOptions} options Add boldness, italics and color\n * @returns {FlattenInterpolation}\n */\nfunction typography<P>(\n variant: TypographyVariants | ((props: P) => string) = DEFAULT_VARIANT,\n options?: TypographyOptions\n): StyledTemplate<P> | ((props: P) => StyledTemplate<P>) {\n if (isFunction(variant)) {\n return ((props: P) => typography(variant(props) as TypographyVariants, options)) as (\n props: P\n ) => StyledTemplate<P>\n }\n\n const properties = getPropertiesByVariant(variant)\n\n return css`\n ${fontStyle({\n family: properties.fontFamily,\n height: properties.lineHeight,\n size: properties.fontSize,\n weight: properties.fontWeight,\n transform: properties.textTransform,\n color: properties.color || options?.color,\n })}\n\n ${conditional({\n 'font-style: italic;': options?.italic,\n })};\n `\n}\n\nexport default typography\n","import React from 'react'\nimport styled, { keyframes } from 'styled-components'\n\nconst ANIMATION_DURATION = 0.8\n\nconst animation = keyframes`\n 0% { opacity: 0 }\n 25% { opacity: 1 }\n 50% { opacity: 0.66 }\n 75% { opacity: 0.33; }\n 100% { opacity: 0 }\n`\n\ninterface LayerProps {\n index: number\n}\n\nconst Layer = styled.path<LayerProps>`\n animation-name: ${animation};\n animation-duration: ${ANIMATION_DURATION}s;\n animation-delay: -${(props) => props.index * (ANIMATION_DURATION / 4)}s;\n animation-iteration-count: infinite;\n`\n\nexport interface SpinnerProps {\n title?: string\n size: number\n}\n\nexport default function Spinner({ title, size, ...props }: SpinnerProps): JSX.Element {\n return (\n <svg\n {...props}\n viewBox=\"0 0 48 48\"\n fillRule=\"evenodd\"\n strokeLinejoin=\"round\"\n strokeMiterlimit=\"2\"\n clipRule=\"evenodd\"\n width={size}\n height={size}\n >\n <title>{title || 'Loading'}</title>\n <g\n id=\"surface1\"\n transform=\"matrix(0.0806777,0,0,0.0806777,0,-9.96047)\"\n fill=\"#33CC60\"\n fillRule=\"nonzero\"\n >\n <Layer\n index={0}\n d=\"M362.176,638.695C366.445,638.695 370.535,637 373.527,633.996L505.332,502.211L224.305,502.211C222.074,502.211 220.066,501.316 218.617,499.855L84.488,633.996C87.395,636.902 91.406,638.695 95.82,638.695L362.176,638.695Z\"\n />\n <Layer\n index={1}\n d=\"M376.164,482.289L512.648,482.289L512.648,217.34C512.648,212.906 510.855,208.898 507.945,205.988L373.809,340.121C375.266,341.578 376.164,343.59 376.164,345.805L376.164,482.289Z\"\n />\n <Layer\n index={2}\n d=\"M500.48,201.746L235.535,201.746L235.535,338.23L372.02,338.23C374.234,338.23 376.246,339.129 377.703,340.586L511.832,206.445C508.926,203.539 504.918,201.746 500.48,201.746Z\"\n />\n <Layer\n index={3}\n d=\"M215.449,495.488L215.449,214.461L83.668,346.262C80.66,349.289 78.965,353.359 78.965,357.625L78.965,623.973C78.965,628.398 80.758,632.406 83.668,635.313L217.805,501.176C216.348,499.715 215.449,497.707 215.449,495.488Z\"\n />\n </g>\n </svg>\n )\n}\n","import { css } from 'styled-components'\n\nimport type { FlattenInterpolation } from 'styled-components'\nimport type { ThemedProps } from 'theming'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nexport const getSpace = (prop: string): FlattenInterpolation<ThemedProps> => css`\n ${conditional({\n 'space-none': whenProps({ [prop]: 'none' }),\n 'space-2xs': whenProps({ [prop]: '2xs' }),\n 'space-xs': whenProps({ [prop]: 'xs' }),\n 'space-s': whenProps({ [prop]: 's' }),\n 'space-m': whenProps({ [prop]: 'm' }),\n 'space-l': whenProps({ [prop]: 'l' }),\n 'space-xl': whenProps({ [prop]: 'xl' }),\n 'space-2xl': whenProps({ [prop]: '2xl' }),\n 'space-3xl': whenProps({ [prop]: '3xl' }),\n })}\n`\n","import React from 'react'\nimport type { HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nimport { getSpace } from './Layout.utils'\nimport type { Spacing, JustifyValue, AlignValue } from './Layout.types'\n\nexport interface GroupProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n justify?: JustifyValue\n align?: AlignValue\n as?: string | React.ComponentType<any>\n}\n\nconst GroupContainer = styled.div<{\n $space: GroupProps['space']\n $justify: GroupProps['justify']\n $align: GroupProps['align']\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${getSpace('$space')};\n\n align-items: ${conditional({\n center: whenProps({ $align: 'center' }),\n 'flex-start': whenProps({ $align: 'flex-start' }),\n 'flex-end': whenProps({ $align: 'flex-end' }),\n stretch: whenProps({ $align: 'stretch' }),\n })};\n\n justify-content: ${conditional({\n center: whenProps({ $justify: 'center' }),\n 'flex-start': whenProps({ $justify: 'flex-start' }),\n 'flex-end': whenProps({ $justify: 'flex-end' }),\n 'space-between': whenProps({ $justify: 'space-between' }),\n 'space-around': whenProps({ $justify: 'space-around' }),\n 'space-evenly': whenProps({ $justify: 'space-evenly' }),\n })};\n`\n\n/**\n * Group layout component.\n * @param {GroupProps} props\n */\nexport function Group(props: GroupProps): JSX.Element {\n const { space = 'm', justify = 'flex-start', align = 'flex-start', children, ...rest } = props\n\n return (\n <GroupContainer $space={space} $justify={justify} $align={align} {...rest}>\n {children}\n </GroupContainer>\n )\n}\n","import React from 'react'\nimport type { HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nimport { getSpace } from './Layout.utils'\nimport type { Spacing, JustifyValue, AlignValue } from './Layout.types'\n\nexport interface StackProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n justify?: JustifyValue\n align?: AlignValue\n as?: string | React.ComponentType<any>\n}\n\nexport const StackContainer = styled.div<{\n $space: StackProps['space']\n $justify: StackProps['justify']\n $align: StackProps['align']\n}>`\n display: flex;\n flex-direction: column;\n\n align-items: ${conditional({\n center: whenProps({ $align: 'center' }),\n 'flex-start': whenProps({ $align: 'flex-start' }),\n 'flex-end': whenProps({ $align: 'flex-end' }),\n stretch: whenProps({ $align: 'stretch' }),\n })};\n\n justify-content: ${conditional({\n center: whenProps({ $justify: 'center' }),\n 'flex-start': whenProps({ $justify: 'flex-start' }),\n 'flex-end': whenProps({ $justify: 'flex-end' }),\n 'space-between': whenProps({ $justify: 'space-between' }),\n 'space-around': whenProps({ $justify: 'space-around' }),\n 'space-evenly': whenProps({ $justify: 'space-evenly' }),\n })};\n\n & > * {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n & > * + * {\n margin-top: ${getSpace('$space')};\n }\n`\n\n/**\n * Stack layout component.\n * @param {StackProps} props\n */\nexport function Stack(props: StackProps): JSX.Element {\n const { space = 'm', justify = 'flex-start', align = 'stretch', children, ...rest } = props\n\n return (\n <StackContainer $space={space} $justify={justify} $align={align} {...rest}>\n {children}\n </StackContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport type { Spacing } from './Layout.types'\nimport { getSpace } from './Layout.utils'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface BoxProps extends HTMLAttributes<HTMLElement> {\n background?: 'transparent' | 'neutral-white' | 'neutral-lighter' | 'neutral-lightest'\n padding?: Spacing\n borderRadius?: 'none' | 's' | 'm' | 'l'\n borderWidth?: 'medium' | 'thin' | 'none'\n borderColor?: 'neutral-darker' | 'neutral-light' | 'neutral-lighter' | 'neutral-white' | 'primary'\n textAlign?: 'left' | 'center' | 'right'\n}\n\nconst BoxContainer = styled.div<{\n $background: BoxProps['background']\n $padding: BoxProps['padding']\n $borderRadius: BoxProps['borderRadius']\n $borderWidth: BoxProps['borderWidth']\n $borderColor: BoxProps['borderColor']\n $textAlign: BoxProps['textAlign']\n}>`\n padding: ${getSpace('$padding')};\n\n color: ${token('color-neutral-darker')};\n\n text-align: ${conditional({\n left: whenProps({ $textAlign: 'left' }),\n center: whenProps({ $textAlign: 'center' }),\n right: whenProps({ $textAlign: 'right' }),\n })};\n\n background-color: ${conditional({\n 'color-transparent': whenProps({ $background: 'transparent' }),\n 'color-neutral-white': whenProps({ $background: 'neutral-white' }),\n 'color-neutral-lighter': whenProps({ $background: 'neutral-lighter' }),\n 'color-neutral-lightest': whenProps({ $background: 'neutral-lightest' }),\n })};\n\n border-color: ${conditional({\n 'color-neutral-darker': whenProps({ $borderColor: 'neutral-darker' }),\n 'color-neutral-light': whenProps({ $borderColor: 'neutral-light' }),\n 'color-neutral-lighter': whenProps({ $borderColor: 'neutral-lighter' }),\n 'color-neutral-white': whenProps({ $borderColor: 'neutral-white' }),\n 'color-primary': whenProps({ $borderColor: 'primary' }),\n })};\n\n border-style: solid;\n\n border-width: ${conditional({\n 'border-width-medium': whenProps({ $borderWidth: 'medium' }),\n 'border-width-thin': whenProps({ $borderWidth: 'thin' }),\n 'border-width-none': whenProps({ $borderWidth: 'none' }),\n })};\n\n border-radius: ${conditional({\n 'border-radius-none': whenProps({ $borderRadius: 'none' }),\n 'border-radius-s': whenProps({ $borderRadius: 's' }),\n 'border-radius-m': whenProps({ $borderRadius: 'm' }),\n 'border-radius-l': whenProps({ $borderRadius: 'l' }),\n })};\n`\n\n/**\n * Box layout component.\n * @param {BoxProps} props\n */\nexport function Box(props: BoxProps): JSX.Element {\n const {\n background = 'transparent',\n borderColor = 'neutral-light',\n borderRadius = 's',\n borderWidth = 'none',\n padding = 'm',\n textAlign = 'left',\n children,\n ...rest\n } = props\n\n return (\n <BoxContainer\n $background={background}\n $borderColor={borderColor}\n $borderRadius={borderRadius}\n $borderWidth={borderWidth}\n $padding={padding}\n $textAlign={textAlign}\n {...rest}\n >\n {children}\n </BoxContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport prop from 'tools/prop'\n\nimport type { Spacing } from './Layout.types'\nimport { getSpace } from './Layout.utils'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface SidebarProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n reversed?: boolean\n sideWidth?: string\n minContentWidth?: string\n}\n\nconst SidebarContainer = styled.div<{\n $space: SidebarProps['space']\n $reversed: SidebarProps['reversed']\n $sideWidth: SidebarProps['sideWidth']\n $minContentWidth: SidebarProps['minContentWidth']\n}>`\n display: flex;\n flex-wrap: wrap;\n\n gap: ${getSpace('$space')};\n\n &\n > ${conditional({\n ':first-child': whenProps({ $reversed: false }),\n ':last-child': whenProps({ $reversed: true }),\n })} {\n flex-basis: ${prop('$sideWidth')};\n flex-grow: 1;\n }\n\n &\n > ${conditional({\n ':first-child': whenProps({ $reversed: true }),\n ':last-child': whenProps({ $reversed: false }),\n })} {\n flex-basis: 0;\n flex-grow: 999;\n min-width: ${prop('$minContentWidth')};\n }\n`\n\n/**\n * Sidebar layout component.\n * @param {SidebarProps} props\n */\nexport function Sidebar(props: SidebarProps): JSX.Element {\n const {\n minContentWidth = '50%',\n reversed = false,\n sideWidth = 'auto',\n space = 'm',\n children,\n ...rest\n } = props\n\n return (\n <SidebarContainer\n $minContentWidth={minContentWidth}\n $reversed={reversed}\n $sideWidth={sideWidth}\n $space={space}\n {...rest}\n >\n {children}\n </SidebarContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport prop from 'tools/prop'\n\nimport type { Spacing } from './Layout.types'\nimport { getSpace } from './Layout.utils'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface SwitcherProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n threshold?: string\n limit?: number\n}\n\nconst SwitcherContainer = styled.div<{\n $space: SwitcherProps['space']\n $threshold: SwitcherProps['threshold']\n $limit: SwitcherProps['limit']\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${getSpace('$space')};\n\n > * {\n flex-basis: calc((${prop('$threshold')} - 100%) * 999);\n flex-grow: 1;\n }\n\n & > :nth-last-child(n + ${prop('$limit')}),\n & > :nth-last-child(n + ${prop('$limit')}) ~ * {\n flex-basis: 100%;\n }\n`\n\n/**\n * Switcher layout component.\n * @param {SwitcherProps} props\n */\nexport function Switcher(props: SwitcherProps): JSX.Element {\n const { limit = 4, space = 's', threshold = '10rem', children, ...rest } = props\n\n return (\n <SwitcherContainer $space={space} $threshold={threshold} $limit={limit + 1} {...rest}>\n {children}\n </SwitcherContainer>\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport prop from 'tools/prop'\n\nimport { getSpace } from 'components/Layout/Layout.utils'\nimport type { Spacing } from './Layout.types'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface GridProps extends HTMLAttributes<HTMLElement> {\n space?: Spacing\n minColumnWidth?: string\n}\n\nconst GridContainer = styled.div<{\n $space: GridProps['space']\n $minColumnWidth: GridProps['minColumnWidth']\n}>`\n display: grid;\n grid-gap: ${getSpace('$space')};\n\n @supports (width: min(${prop('$minColumnWidth')}, 100%)) {\n & {\n grid-template-columns: repeat(auto-fit, minmax(min(${prop('$minColumnWidth')}, 100%), 1fr));\n }\n }\n`\n\n/**\n * Grid layout component.\n * @param {GridProps} props\n */\nexport function Grid(props: GridProps): JSX.Element {\n const { space = 'm', minColumnWidth = '50%', children, ...rest } = props\n\n return (\n <GridContainer $space={space} $minColumnWidth={minColumnWidth} {...rest}>\n {children}\n </GridContainer>\n )\n}\n","import { Group } from './Group'\nimport { Stack } from './Stack'\nimport { Box } from './Box'\nimport { Sidebar } from './Sidebar'\nimport { Switcher } from './Switcher'\nimport { Grid } from './Grid'\n\nconst Layout = (): null => {\n return null\n}\n\nLayout.Group = Group\nLayout.Stack = Stack\nLayout.Box = Box\nLayout.Sidebar = Sidebar\nLayout.Switcher = Switcher\nLayout.Grid = Grid\n\nexport default Layout\n","import { Layout } from 'components/Layout'\nimport React from 'react'\nimport styled, { keyframes } from 'styled-components'\nimport { getToken as token } from 'theming'\n\nconst loading = keyframes` \n from {\n width: 0\n }\n to {\n width: 100%\n } \n`\n\nexport const Bar = styled.div<{ width?: number; velocity?: number }>`\n position: relative;\n\n width: ${({ width }) => (width ? `${width}px` : '100%')};\n height: ${token('space-s')};\n overflow: hidden;\n\n background-color: ${token('color-neutral-light')};\n border-radius: ${token('border-radius-m')};\n\n &:before {\n position: absolute;\n\n display: block;\n width: 100%;\n height: ${token('space-s')};\n\n background-color: ${token('color-primary')};\n\n animation: ${loading} ${({ velocity }) => (velocity && velocity > 0 ? velocity : 2.5)}s linear\n infinite;\n\n content: '';\n }\n`\n\nexport interface LoadingBarProps {\n alignment?: 'left' | 'center' | 'right'\n title?: React.ReactNode\n secondaryTitle?: React.ReactNode\n width?: number | undefined\n velocity?: number | undefined\n}\n\nexport default function LoadingBar({\n alignment,\n title,\n secondaryTitle,\n width = undefined,\n velocity = 2.5,\n}: LoadingBarProps): JSX.Element {\n return (\n <Layout.Box textAlign={alignment}>\n <Layout.Stack space=\"s\">\n {title}\n <Bar width={width} velocity={velocity} />\n {secondaryTitle}\n </Layout.Stack>\n </Layout.Box>\n )\n}\n","import React from 'react'\nimport styled, { keyframes } from 'styled-components'\nimport conditional, { whenProps } from 'tools/conditional'\nimport prop from 'tools/prop'\nimport { getToken as token } from 'theming'\n\nconst pulse = keyframes`\n 50% {\n opacity: 0.2;\n }\n\n 100% {\n opacity: 1;\n }\n`\n\nconst Wrapper = styled.div`\n text-align: center;\n\n div:nth-child(1) {\n animation: ${pulse} 1s infinite ease-in-out -0.2s;\n }\n\n div:nth-child(2) {\n animation: ${pulse} 1s infinite ease-in-out -0.1s;\n }\n\n div:nth-child(3) {\n animation: ${pulse} 1s infinite ease-in-out 0s;\n }\n`\n\ninterface DotProps {\n size?: number\n variant?: 'light' | 'dark'\n}\n\nconst Dot = styled.div<DotProps>`\n display: inline-block;\n width: ${prop('size')}px;\n height: ${prop('size')}px;\n margin: ${token('space-2xs')};\n\n background-color: ${conditional({\n 'color-neutral-white': whenProps({ variant: 'light' }),\n 'color-neutral-dark': whenProps({ variant: 'dark' }),\n })};\n border-radius: ${token('border-radius-circle')};\n`\n\nexport interface LoadingDotsProps {\n size?: number\n variant?: 'dark' | 'light'\n}\n\nexport default function LoadingDots({\n size = 10,\n variant = 'dark',\n ...props\n}: LoadingDotsProps): JSX.Element {\n return (\n <Wrapper role=\"progressbar\" aria-label=\"Loading\" {...props}>\n <Dot size={size} variant={variant} />\n <Dot size={size} variant={variant} />\n <Dot size={size} variant={variant} />\n </Wrapper>\n )\n}\n","import React, { forwardRef } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport ellipsizable from 'styles/ellipsizable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport omit from 'utils/toolset/omit'\nimport rem from 'utils/toolset/rem'\nimport transition from 'styles/transition'\nimport typography from 'styles/typography'\n\nimport { LoadingDots } from 'components/Loaders'\n\nimport type { ButtonHTMLAttributes, ForwardedRef, ReactNode } from 'react'\nimport type { IconProps } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport type { LoadingDotsProps } from 'components/Loaders'\n\nexport type ButtonVariants = 'primary' | 'secondary' | 'warning' | 'icon' | 'tertiary'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n className?: string\n leading?: ReactNode\n scheme?: ColorScheme\n trailing?: ReactNode\n variant?: ButtonVariants\n scale?: 'small' | 'default' | 'large'\n loading?: boolean\n}\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n padding: ${rem('6px')} 0;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Trailing = styled(StyledSpan)`\n /* placeholder */\n`\n\nexport const Children = styled.span<ButtonProps>`\n ${({ children }) =>\n typeof children === 'string'\n ? ellipsizable()\n : `\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n `}\n\n padding: ${rem('6px')} 0;\n`\n\nconst BaseStyledButton = styled.button<{\n $scale: ButtonProps['scale']\n $loading?: ButtonProps['loading']\n}>`\n ${transition()}\n\n ${typography(\n conditional({\n 'button-md': whenProps({ $scale: 'default' }),\n 'button-sm': whenProps({ $scale: 'small' }),\n 'button-lg': whenProps({ $scale: 'large' }),\n })\n )}\n\n box-sizing: border-box;\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n text-transform: uppercase;\n text-align: center;\n\n cursor: pointer;\n\n border-radius: ${token('border-radius-s')};\n border-width: ${token('border-width-thin')};\n border-style: solid;\n border-color: ${token('color-neutral-darker')};\n\n height: ${conditional({\n 'button-height': whenProps({ $scale: 'default' }),\n 'button-small-height': whenProps({ $scale: 'small' }),\n 'button-large-height': whenProps({ $scale: 'large' }),\n })};\n\n padding: 0 8px;\n\n ${disableable()}\n\n ${({ $loading }) =>\n $loading\n ? css`\n pointer-events: none;\n position: relative;\n `\n : ''}\n\n ${Leading} {\n margin: 0 ${token('space-xs')} 0 0;\n }\n\n ${Trailing} {\n margin: 0 0 0 ${token('space-xs')};\n }\n`\n\nconst StyledButton = styled(BaseStyledButton)<{\n $variant: ButtonProps['variant']\n $scale: ButtonProps['scale']\n $scheme: ButtonProps['scheme']\n}>`\n width: ${conditional({\n 'button-width': whenProps({ $variant: ['primary', 'secondary', 'warning', 'tertiary'] }),\n 'button-icon-width': whenProps({ $variant: 'icon', $scale: 'default' }),\n 'button-icon-small-width': whenProps({ $variant: 'icon', $scale: 'small' }),\n 'button-icon-large-width': whenProps({ $variant: 'icon', $scale: 'large' }),\n })};\n\n height: ${conditional({\n 'button-height': whenProps({ $scale: 'default' }),\n 'button-small-height': whenProps({ $scale: 'small' }),\n 'button-large-height': whenProps({ $scale: 'large' }),\n })};\n\n color: ${conditional({\n 'button-primary-color': whenProps({ $variant: 'primary' }),\n 'button-secondary-color': whenProps({ $variant: 'secondary', $scheme: 'light' }),\n 'button-secondary-dark-color': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-color': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color': whenProps({ $variant: 'warning' }),\n 'button-icon-color': whenProps({ $variant: 'icon' }),\n })};\n\n background: ${conditional({\n 'button-primary-background': whenProps({ $variant: 'primary' }),\n 'button-secondary-background': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background': whenProps({\n $variant: 'tertiary',\n }),\n 'button-warning-background': whenProps({ $variant: 'warning' }),\n 'button-icon-background': whenProps({ $variant: 'icon' }),\n })};\n\n border-color: ${conditional({\n 'button-primary-border-color': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color': whenProps({ $variant: 'secondary', $scheme: 'light' }),\n 'button-secondary-dark-border-color': whenProps({ $variant: 'secondary', $scheme: 'dark' }),\n 'button-tertiary-border-color': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color': whenProps({ $variant: 'icon' }),\n })};\n border-radius: ${conditional({\n 'button-border-radius': whenProps({ $variant: ['primary', 'secondary', 'warning'] }),\n 'button-icon-border-radius': whenProps({ $variant: 'icon' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'button-primary-background--hover': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background--hover': whenProps({\n $variant: 'tertiary',\n }),\n 'button-warning-background--hover': whenProps({ $variant: 'warning' }),\n 'button-icon-background--hover': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--hover': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-border-color--hover': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color--hover': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--hover': whenProps({ $variant: 'icon' }),\n })};\n color: ${conditional({\n 'button-primary-color--hover': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--hover': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-color--hover': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color--hover': whenProps({ $variant: 'warning' }),\n 'button-icon-color--hover': whenProps({ $variant: 'icon' }),\n })};\n `}\n\n ${disableable`\n background: ${conditional({\n 'button-primary-background--disabled': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background--disabled': whenProps({ $variant: 'tertiary' }),\n 'button-warning-background--disabled': whenProps({ $variant: 'warning' }),\n 'button-icon-background--disabled': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--disabled': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-border-color--disabled': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color--disabled': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--disabled': whenProps({ $variant: 'icon' }),\n })};\n color: ${conditional({\n 'button-primary-color--disabled': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--disabled': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-color--disabled': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color--disabled': whenProps({ $variant: 'warning' }),\n 'button-icon-color--disabled': whenProps({ $variant: 'icon' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'button-primary-background--focus': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-background--focus': whenProps({ $variant: 'tertiary' }),\n 'button-warning-background--focus': whenProps({ $variant: 'warning' }),\n 'button-icon-background--focus': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--focus': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-tertiary-border-color--focus': whenProps({ $variant: 'tertiary' }),\n 'button-warning-border-color--focus': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--focus': whenProps({ $variant: 'icon' }),\n })};\n color: ${conditional({\n 'button-primary-color--focus': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--focus': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--focus': whenProps({ $variant: 'secondary', $scheme: 'dark' }),\n 'button-tertiary-color--focus': whenProps({ $variant: 'tertiary' }),\n 'button-warning-color--focus': whenProps({ $variant: 'warning' }),\n 'button-icon-color--focus': whenProps({ $variant: 'icon' }),\n })};\n\n box-shadow: ${conditional({\n 'button-primary-box-shadow': whenProps({ $variant: 'primary' }),\n 'button-secondary-box-shadow': whenProps({ $variant: 'secondary' }),\n 'button-warning-box-shadow': whenProps({ $variant: 'warning' }),\n 'button-tertiary-box-shadow': whenProps({ $variant: 'tertiary' }),\n 'button-icon-box-shadow': whenProps({ $variant: 'icon' }),\n })};\n\n outline: ${conditional({\n 'button-primary-outline': whenProps({ $variant: 'primary' }),\n 'button-secondary-outline': whenProps({ $variant: 'secondary' }),\n 'button-tertiary-outline': whenProps({ $variant: 'tertiary' }),\n 'button-warning-outline': whenProps({ $variant: 'warning' }),\n 'button-icon-outline': whenProps({ $variant: 'icon' }),\n })};\n\n outline-offset: ${token('button-outline-offset')};\n `}\n\n ${activatable`\n background: ${conditional({\n 'button-primary-background--active': whenProps({ $variant: 'primary' }),\n 'button-secondary-background--active': whenProps({\n $variant: ['secondary', 'tertiary'],\n $scheme: 'light',\n }),\n 'button-secondary-dark-background--active': whenProps({\n $variant: ['secondary', 'tertiary'],\n $scheme: 'dark',\n }),\n 'button-warning-background--active': whenProps({ $variant: 'warning' }),\n 'button-icon-background--active': whenProps({ $variant: 'icon' }),\n })};\n border-color: ${conditional({\n 'button-primary-border-color--active': whenProps({ $variant: 'primary' }),\n 'button-secondary-border-color--active': whenProps({\n $variant: 'secondary',\n $scheme: 'light',\n }),\n 'button-secondary-dark-border-color--active': whenProps({\n $variant: 'secondary',\n $scheme: 'dark',\n }),\n 'button-warning-border-color--active': whenProps({ $variant: 'warning' }),\n 'button-icon-border-color--active': whenProps({ $variant: 'icon' }),\n 'color-transparent': whenProps({ $variant: 'tertiary' }),\n })};\n color: ${conditional({\n 'button-primary-color--active': whenProps({ $variant: 'primary' }),\n 'button-secondary-color--active': whenProps({\n $variant: ['secondary', 'tertiary'],\n $scheme: 'light',\n }),\n 'button-secondary-dark-color--active': whenProps({ $variant: 'secondary', $scheme: 'dark' }),\n 'button-warning-color--active': whenProps({ $variant: 'warning' }),\n 'button-icon-color--active': whenProps({ $variant: 'icon' }),\n })};\n `}\n\n ${Children} {\n margin: 0 ${token('button-spacing-x')};\n }\n\n ${Leading} {\n margin: 0 0 0 ${token('button-spacing-x')};\n }\n\n ${Trailing} {\n margin: 0 ${token('button-spacing-x')} 0 0;\n }\n`\n\nconst StyledSelector = styled(StyledButton)`\n ${Children} {\n flex: 1;\n }\n\n ${Trailing} {\n margin: 0;\n }\n`\n\nconst TextHidden = styled.span`\n transform: scale(0);\n`\n\n/**\n * Accessible attributes in `LoadingDots` aren't necessary\n * because the `Button` will keep its content, but invisible\n */\nconst StyledLoadingDots = styled(LoadingDots).attrs({\n 'aria-label': undefined,\n role: 'presentation',\n})`\n position: absolute;\n left: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n`\n\nconst ButtonLoadingDots = ({\n buttonVariant = 'secondary',\n ...remainingProps\n}: Omit<LoadingDotsProps, 'variant'> & { buttonVariant?: ButtonVariants }) => {\n const buttonLightVariants = new Set(['secondary', 'warning', 'icon', 'tertiary'])\n /**\n * Change LoadingDots variant between `light` and `dark` to have contrast with Button's variant\n */\n const loadingDotsVariant: 'dark' | 'light' = buttonLightVariants.has(buttonVariant)\n ? 'dark'\n : 'light'\n\n return <StyledLoadingDots {...remainingProps} variant={loadingDotsVariant} />\n}\n\nfunction ButtonChildrenWrapper({\n loading,\n children,\n variant,\n}: Pick<ButtonProps, 'loading' | 'children' | 'variant'>) {\n if (loading) {\n return (\n <>\n <ButtonLoadingDots buttonVariant={variant} />\n <TextHidden>{children}</TextHidden>\n </>\n )\n }\n\n return <>{children}</>\n}\n\nexport const BaseButton = forwardRef<HTMLButtonElement, ButtonProps>(function BaseButton(\n {\n scale = 'default',\n children,\n leading,\n trailing,\n loading,\n disabled,\n variant,\n ...others\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n return (\n <BaseStyledButton\n ref={ref}\n {...others}\n aria-disabled={loading ? 'true' : undefined}\n disabled={disabled}\n $scale={scale}\n $loading={loading}\n >\n <ButtonChildrenWrapper loading={loading} variant={variant}>\n {leading && <Leading aria-hidden=\"true\">{leading}</Leading>}\n <Children loading={loading}>{children}</Children>\n {trailing && <Trailing aria-hidden=\"true\">{trailing}</Trailing>}\n </ButtonChildrenWrapper>\n </BaseStyledButton>\n )\n})\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n scheme = 'light',\n scale = 'default',\n variant = 'secondary',\n children,\n leading,\n trailing,\n disabled,\n loading,\n ...others\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n return (\n <StyledButton\n ref={ref}\n {...others}\n type={type}\n aria-disabled={loading ? 'true' : undefined}\n disabled={disabled}\n $scheme={scheme}\n $scale={scale}\n $variant={variant}\n $loading={loading}\n >\n <ButtonChildrenWrapper loading={loading} variant={variant}>\n {leading && <Leading>{leading}</Leading>}\n <Children>{children}</Children>\n {trailing && <Trailing>{trailing}</Trailing>}\n </ButtonChildrenWrapper>\n </StyledButton>\n )\n})\n\nexport function Caret(props: Omit<IconProps, 'name'>): JSX.Element {\n return <Icon size={20} {...props} name=\"caret-down\" />\n}\n\nexport const SelectorButton = forwardRef<HTMLButtonElement, ButtonProps>(function SelectorButton(\n {\n scheme = 'light',\n scale = 'default',\n type = 'button',\n variant = 'secondary',\n children,\n trailing,\n disabled,\n loading,\n ...others\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n others = omit<ButtonProps>(others, ['leading'])\n\n return (\n <StyledSelector\n ref={ref}\n {...others}\n type={type}\n aria-disabled={loading ? 'true' : undefined}\n disabled={disabled}\n $loading={loading}\n $scheme={scheme}\n $scale={scale}\n $variant={variant}\n >\n <ButtonChildrenWrapper loading={loading} variant={variant}>\n <Children>{children}</Children>\n {trailing && <Trailing>{trailing}</Trailing>}\n </ButtonChildrenWrapper>\n </StyledSelector>\n )\n})\n\nexport type IconButtonProps = Omit<ButtonProps, 'leading' | 'trailing' | 'variant' | 'loading'>\n\nexport const IconButton = forwardRef<HTMLButtonElement, ButtonProps>(function IconButton(\n { scheme = 'light', scale = 'default', type = 'button', children, ...others }: IconButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n others = omit<ButtonProps>(others, ['leading', 'trailing', 'variant'])\n\n return (\n <StyledButton ref={ref} {...others} type={type} $scheme={scheme} $scale={scale} $variant=\"icon\">\n <Children>{children}</Children>\n </StyledButton>\n )\n})\n\nexport default Button\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport focusable from 'styles/focusable'\n\nimport type { ButtonProps } from 'components/Button'\n\nexport interface CloseButtonProps extends ButtonProps {\n size?: string | number\n}\n\nconst Button = styled(BaseButton)`\n border: none;\n border-radius: ${token('border-radius-circle')};\n\n color: ${token('color-neutral-darker')};\n\n background: ${token('color-transparent')};\n\n padding: ${token('space-xs')};\n\n font-size: ${token('font-size-3')};\n\n /*\n * button height is set in the BaseButton component\n * we set width here to ensure a perfectly rounded button\n */\n width: ${conditional({\n 'button-height': whenProps({ scale: 'default' }),\n 'button-small-height': whenProps({ scale: 'small' }),\n 'button-large-height': whenProps({ scale: 'large' }),\n })};\n\n ${focusable`\n box-shadow: ${token('button-icon-box-shadow')};\n\n outline: ${token('button-icon-outline')};\n outline-offset: ${token('button-outline-offset')};\n `}\n`\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction CloseButton({ scale = 'small', size = 16, ...others }: CloseButtonProps): JSX.Element {\n return (\n <Button scale={scale} {...others}>\n <Icon name=\"close\" size={size} />\n </Button>\n )\n}\n\nexport default CloseButton\n","import React from 'react'\n\nimport { IconButton } from 'components/Button'\nimport { Icon } from 'components/Icon'\n\nimport type { ButtonProps } from 'components/Button'\n\nexport type BackButtonProps = Omit<ButtonProps, 'children'>\n\nfunction BackButton({ scale = 'small', ...others }: BackButtonProps): JSX.Element {\n return (\n <IconButton scale={scale} {...others}>\n <Icon name=\"back\" size={16} />\n </IconButton>\n )\n}\n\nexport default BackButton\n","import React, { LabelHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\nimport styled from 'styled-components'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\n\nexport interface SelectionStyleProps {\n scale?: 'small' | 'default'\n scheme?: ColorScheme\n disabled?: boolean\n}\n\nexport interface SelectionWrapperProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n SelectionStyleProps {\n selector: ReactNode\n leading?: ReactNode\n trailing?: ReactNode\n}\n\nconst SelectorWrapper = styled.span`\n position: relative;\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Trailing = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Children = styled.span`\n /* placeholder */\n`\n\nconst StyledLabel = styled.label<SelectionStyleProps>`\n box-sizing: border-box;\n\n ${transition()}\n ${font({\n weight: 'checkbox-font-weight',\n })}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n\n cursor: pointer;\n\n border-radius: ${token('border-radius-s')};\n\n font-size: ${conditional({\n 'checkbox-font-size': whenProps({ scale: 'default' }),\n 'checkbox-small-font-size': whenProps({ scale: 'small' }),\n })};\n\n color: ${conditional({\n 'checkbox-color': whenProps({ scheme: 'light' }),\n 'checkbox-dark-color': whenProps({ scheme: 'dark' }),\n })};\n\n ${Children} {\n margin: 0 ${token('space-xs')};\n }\n\n ${SelectorWrapper} {\n margin: 0 ${token('space-xs')} 0 0;\n }\n\n ${Leading} {\n margin: 0 ${token('space-xs')};\n }\n\n ${Trailing} {\n margin: 0 0 0 ${token('space-xs')};\n }\n\n ${disableable()}\n\n ${focusable`\n outline: ${token('checkbox-selector-outline')};\n outline-offset: ${token('checkbox-selector-outline-offset')};\n `}\n`\n\nfunction SelectionWrapper({\n selector,\n children,\n leading,\n trailing,\n className,\n disabled = false,\n ...others\n}: SelectionWrapperProps): JSX.Element {\n return (\n <StyledLabel\n className={clsx(className, {\n 'is-disabled': disabled,\n })}\n {...others}\n >\n {selector && <SelectorWrapper>{selector}</SelectorWrapper>}\n {leading && <Leading data-testid=\"selection-leading\">{leading}</Leading>}\n <Children>{children}</Children>\n {trailing && <Trailing data-testid=\"selection-trailing\">{trailing}</Trailing>}\n </StyledLabel>\n )\n}\n\nexport default SelectionWrapper\n","import React, { Fragment, InputHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nimport { Icon } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport SelectionWrapper, { SelectionStyleProps } from 'common/SelectionWrapper'\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\n\nexport interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement>, SelectionStyleProps {\n leading?: ReactNode\n scheme?: ColorScheme\n trailing?: ReactNode\n}\n\nconst Check = styled(Icon)<SelectionStyleProps>`\n position: absolute;\n top: 50%;\n\n left: 50%;\n\n transform: translate(-50%, -50%);\n\n pointer-events: none;\n`\n\nconst Selector = styled.input<SelectionStyleProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n\n cursor: pointer;\n\n appearance: none;\n\n outline: none;\n\n color: white;\n\n height: ${token('checkbox-selector-size')};\n width: ${token('checkbox-selector-size')};\n\n border-radius: ${token('checkbox-selector-border-radius')};\n border-width: ${token('button-border-width')};\n border-style: solid;\n\n border-color: ${conditional({\n 'checkbox-selector-border-color': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color': whenProps({ scheme: 'dark' }),\n })};\n\n background: ${conditional({\n 'checkbox-selector-background': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background': whenProps({ scheme: 'dark' }),\n })};\n\n :checked {\n background-color: ${token('checkbox-selector-checked-background')};\n border-color: ${token('checkbox-selector-checked-border-color')};\n }\n\n :checked + ${Check} {\n color: ${token('checkbox-selector-icon-color')};\n }\n\n :not(:checked) + ${Check} {\n color: transparent;\n }\n\n ${disableable`\n background: ${conditional({\n 'checkbox-selector-background--disabled': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background--disabled': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'checkbox-selector-border-color--disabled': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color--disabled': whenProps({ scheme: 'dark' }),\n })};\n :checked {\n background-color: ${token('checkbox-selector-checked-background--disabled')};\n border-color: ${token('checkbox-selector-checked-border-color--disabled')};\n }\n `}\n\n ${hoverable`\n background: ${conditional({\n 'checkbox-selector-background--hover': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background--hover': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'checkbox-selector-border-color--hover': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n\n :checked {\n background-color: ${token('checkbox-selector-checked-background--hover')};\n border-color: ${token('checkbox-selector-checked-border-color--hover')};\n }\n\n :checked + ${Check} {\n color: ${token('checkbox-selector-icon-color')};\n }\n `}\n\n ${focusable`\n background: ${conditional({\n 'checkbox-selector-background--focus': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-background--focus': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'checkbox-selector-border-color--focus': whenProps({ scheme: 'light' }),\n 'checkbox-dark-selector-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n :checked {\n background-color: ${token('checkbox-selector-checked-background--focus')};\n border-color: ${token('checkbox-selector-checked-border-color--focus')};\n }\n :checked + ${Check} {\n color: ${token('checkbox-selector-icon-color')};\n }\n\n box-shadow: ${token('checkbox-selector-box-shadow')};\n `}\n`\n\nfunction Checkbox({\n className,\n disabled,\n children,\n leading,\n trailing,\n scheme = 'light',\n scale = 'default',\n ...others\n}: CheckboxProps): JSX.Element {\n return (\n <SelectionWrapper\n scheme={scheme}\n scale={scale}\n selector={\n <Fragment>\n <Selector\n data-testid=\"selector\"\n {...others}\n scheme={scheme}\n disabled={disabled}\n type=\"checkbox\"\n />\n <Check name=\"check\" size={14} className=\"check\" />\n </Fragment>\n }\n leading={leading}\n trailing={trailing}\n className={clsx({ 'is-disabled': disabled }, className)}\n data-testid=\"checkbox\"\n >\n {children}\n </SelectionWrapper>\n )\n}\n\nexport default Checkbox\n","import React, { Fragment, InputHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nimport { Icon } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport SelectionWrapper, { SelectionStyleProps } from 'common/SelectionWrapper'\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\n\nexport interface RadioProps extends InputHTMLAttributes<HTMLInputElement>, SelectionStyleProps {\n leading?: ReactNode\n scheme?: ColorScheme\n trailing?: ReactNode\n}\n\nconst Check = styled(Icon)<SelectionStyleProps>`\n position: absolute;\n top: 50%;\n\n left: 50%;\n\n width: 10px;\n height: 10px;\n\n transform: translate(-50%, -50%);\n\n pointer-events: none;\n\n fill: currentColor;\n`\n\nconst Selector = styled.input<SelectionStyleProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n\n cursor: pointer;\n\n appearance: none;\n\n outline: none;\n\n color: white;\n\n height: ${token('radio-small-selector-size')};\n width: ${token('radio-small-selector-size')};\n\n border-radius: ${token('radio-selector-border-radius')};\n border-width: ${token('button-border-width')};\n border-style: solid;\n\n background: ${conditional({\n 'radio-selector-background': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background': whenProps({ scheme: 'dark' }),\n })};\n\n &:not(:checked) {\n border-color: ${conditional({\n 'radio-selector-border-color': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color': whenProps({ scheme: 'dark' }),\n })};\n\n + ${Check} {\n color: transparent;\n }\n }\n\n &:checked {\n border-color: ${token('radio-selector-border-color--checked')};\n\n + ${Check} {\n color: ${token('radio-selector-border-color--checked')};\n }\n }\n\n ${disableable`\n background: ${conditional({\n 'radio-selector-background--disabled': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background--disabled': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'radio-selector-border-color--disabled': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color--disabled': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${hoverable`\n background: ${conditional({\n 'radio-selector-background--hover': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background--hover': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'radio-selector-border-color--hover': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'radio-selector-background--focus': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-background--focus': whenProps({ scheme: 'dark' }),\n })};\n border-color: ${conditional({\n 'radio-selector-border-color--focus': whenProps({ scheme: 'light' }),\n 'radio-dark-selector-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n box-shadow: ${token('radio-selector-box-shadow')};\n `}\n`\n\nfunction Radio({\n className,\n disabled,\n children,\n leading,\n trailing,\n scheme = 'light',\n ...others\n}: RadioProps): JSX.Element {\n return (\n <SelectionWrapper\n scheme={scheme}\n selector={\n <Fragment>\n <Selector\n data-testid=\"selector\"\n {...others}\n scheme={scheme}\n disabled={disabled}\n type=\"radio\"\n />\n <Check name=\"circle\" className=\"check\" />\n </Fragment>\n }\n leading={leading}\n trailing={trailing}\n className={clsx({ 'is-disabled': disabled }, className)}\n data-testid=\"radio\"\n >\n {children}\n </SelectionWrapper>\n )\n}\n\nexport default Radio\n","import { useEffect, useState, useCallback, useRef } from 'react'\n\nimport type { RefObject } from 'react'\n\nexport interface useFocusWithinProps {\n onFocus?: () => void\n onBlur?: () => void\n}\n\n/**\n * As CSS's focus-within is not fully supported, this hook\n * helps with identifying focus within elements.\n * @param {Object} props - Hook props\n */\nfunction useFocusWithin<T>(props: useFocusWithinProps = {}): {\n ref: RefObject<T>\n focused: boolean\n} {\n const { onFocus, onBlur } = props\n const [focused, setFocused] = useState(false)\n const containerRef = useRef<T>(null)\n\n function getContainer() {\n return containerRef.current as unknown as HTMLElement\n }\n\n const handleFocus = useCallback(\n function handleFocus() {\n onFocus?.()\n setFocused(true)\n },\n [onFocus]\n )\n\n const handleBlur = useCallback(\n function handleBlur() {\n onBlur?.()\n setFocused(false)\n },\n [onBlur]\n )\n\n useEffect(\n function updateContainerRef() {\n getContainer()?.addEventListener('focusin', handleFocus)\n getContainer()?.addEventListener('focusout', handleBlur)\n\n return function unsubscribe() {\n getContainer()?.removeEventListener('focusin', handleFocus)\n getContainer()?.removeEventListener('focusout', handleBlur)\n }\n },\n [containerRef, handleBlur, handleFocus]\n )\n\n return {\n ref: containerRef,\n focused,\n }\n}\n\nexport default useFocusWithin\n","enum Status {\n Success = 'success',\n Danger = 'danger',\n Warn = 'warn',\n Neutral = 'neutral',\n}\n\nexport default Status\n","import React, { forwardRef } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport { useFocusWithin } from 'hooks/useFocusWithin'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport Status from 'utils/types/Status'\nimport transition from 'styles/transition'\n\nimport type { InputHTMLAttributes, ReactNode } from 'react'\n\ninterface WithAdditionalProps {\n scale?: 'small' | 'default' | 'large'\n status?: Status\n scheme?: ColorScheme\n leading?: ReactNode\n trailing?: ReactNode\n}\n\nexport interface TextFieldProps extends InputHTMLAttributes<HTMLInputElement>, WithAdditionalProps {\n className?: string\n children?: ReactNode\n}\n\nconst InputWrapper = styled.div<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n\n height: ${conditional({\n 'text-field-height': whenProps({ scale: 'default' }),\n 'text-field-small-height': whenProps({ scale: 'small' }),\n 'text-field-large-height': whenProps({ scale: 'large' }),\n })};\n min-width: 0;\n\n ${font({\n height: 'text-field-font-height',\n })}\n\n font-size: ${conditional({\n 'text-field-font-size': whenProps({ scale: 'default' }),\n 'text-field-small-font-size': whenProps({ scale: 'small' }),\n 'text-field-large-font-size': whenProps({ scale: 'large' }),\n })};\n\n border-radius: ${token('text-field-border-radius')};\n border-width: 1px;\n border-style: solid;\n\n background: ${conditional({\n 'text-field-background': whenProps({ scheme: 'light' }),\n 'text-field-dark-background': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'text-field-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'text-field-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'text-field-danger-border-color': whenProps({ status: Status.Danger }),\n 'text-field-success-border-color': whenProps({ status: Status.Success }),\n })};\n\n color: ${conditional({\n 'text-field-color': whenProps({ scheme: 'light' }),\n 'text-field-dark-color': whenProps({ scheme: 'dark' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'text-field-background--hover': whenProps({ scheme: 'light' }),\n 'text-field-dark-background--hover': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'text-field-border-color--hover': whenProps({ scheme: 'light' }),\n 'text-field-dark-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'text-field-background--focus': whenProps({ scheme: 'light' }),\n 'text-field-dark-background--focus': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'text-field-border-color--focus': whenProps({ scheme: 'light' }),\n 'text-field-dark-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n box-shadow: ${conditional({\n 'text-field-box-shadow': whenProps({ scheme: 'light' }),\n 'text-field-dark-box-shadow': whenProps({ scheme: 'dark' }),\n })};\n\n outline: ${token('text-field-outline')};\n outline-offset: ${token('text-field-outline-offset')};\n `}\n\n ${disableable()}\n`\n\nconst StyledSpan = styled.span<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n color: ${conditional({\n 'text-field-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'text-field-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'text-field-danger-border-color': whenProps({ status: Status.Danger }),\n 'text-field-success-border-color': whenProps({ status: Status.Success }),\n })};\n`\n\nexport const Leading = styled(StyledSpan)<WithAdditionalProps>`\n margin: 0 0 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })};\n`\n\nexport const Trailing = styled(StyledSpan)<WithAdditionalProps>`\n margin: 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })}\n 0 0;\n`\n\nconst StyledInput = styled.input<WithAdditionalProps>`\n ${transition()}\n\n ${font({\n height: 'text-field-font-height',\n })}\n\n background: transparent;\n\n padding: ${conditional({\n 'text-field-padding-y': whenProps({ scale: 'default' }),\n 'text-field-small-padding-y': whenProps({ scale: 'small' }),\n 'text-field-large-padding-y': whenProps({ scale: 'large' }),\n })}\n 0;\n\n margin: 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })};\n\n border: none;\n\n flex: 1;\n\n min-width: 0;\n\n ${focusable()}\n ${disableable()}\n\n /* suppress the clear button for IE */\n &[type=\"search\"]::-ms-clear,\n &[type=\"search\"]::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* suppress the clear button for Chromium-based browsers */\n &[type='search']::-webkit-search-decoration,\n &[type='search']::-webkit-search-cancel-button,\n &[type='search']::-webkit-search-results-button,\n &[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n`\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n props: TextFieldProps,\n ref\n): JSX.Element {\n const {\n disabled = false,\n status = Status.Neutral,\n scheme = 'light',\n scale = 'default',\n className,\n leading,\n trailing,\n ...others\n } = props\n const { ref: containerRef, focused } = useFocusWithin<HTMLDivElement>()\n\n return (\n <InputWrapper\n className={clsx(className, {\n 'is-disabled': disabled,\n 'is-focused': focused,\n })}\n scheme={scheme}\n status={status}\n scale={scale}\n ref={containerRef}\n >\n {leading && (\n <Leading status={status} scheme={scheme} scale={scale}>\n {leading}\n </Leading>\n )}\n <StyledInput\n ref={ref}\n type=\"text\"\n data-testid=\"input\"\n {...others}\n scale={scale}\n status={status}\n scheme={scheme}\n leading={leading}\n trailing={trailing}\n disabled={disabled}\n />\n {trailing && (\n <Trailing status={status} scheme={scheme} scale={scale}>\n {trailing}\n </Trailing>\n )}\n </InputWrapper>\n )\n})\n\nexport default TextField\n","import { useCallback, useState } from 'react'\n\nimport type { ChangeEvent } from 'react'\nimport type { TextFieldProps } from './TextField'\n\ntype InputValue = string | number | readonly string[] | undefined\ntype ReturnType = [InputValue, (e: ChangeEvent<HTMLInputElement>) => void]\n\nfunction useTextField({ onChange: onChangeProp, value: valueProp }: TextFieldProps): ReturnType {\n const [value, setValue] = useState(valueProp || '')\n\n const onChange = useCallback(\n function handleChange(e: ChangeEvent<HTMLInputElement>) {\n const {\n target: { value },\n } = e\n setValue(value)\n onChangeProp?.(e)\n },\n [onChangeProp]\n )\n\n return [value, onChange]\n}\n\nexport default useTextField\n","import React, { forwardRef } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport { useFocusWithin } from 'hooks/useFocusWithin'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport Status from 'utils/types/Status'\nimport transition from 'styles/transition'\n\nimport type { TextareaHTMLAttributes, ReactNode } from 'react'\n\ninterface WithAdditionalProps {\n scale?: 'small' | 'default' | 'large'\n status?: Status\n scheme?: ColorScheme\n leading?: ReactNode\n trailing?: ReactNode\n}\n\nexport interface TextareaProps\n extends TextareaHTMLAttributes<HTMLTextAreaElement>,\n WithAdditionalProps {\n className?: string\n children?: ReactNode\n}\n\nconst TextareaWrapper = styled.div<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n\n min-height: ${token('textarea-min-height')};\n\n ${font({\n height: 'textarea-font-height',\n })}\n\n font-size: ${conditional({\n 'textarea-font-size': whenProps({ scale: 'default' }),\n 'textarea-small-font-size': whenProps({ scale: 'small' }),\n 'textarea-large-font-size': whenProps({ scale: 'large' }),\n })};\n\n border-radius: ${token('textarea-border-radius')};\n border-width: 1px;\n border-style: solid;\n\n background: ${conditional({\n 'textarea-background': whenProps({ scheme: 'light' }),\n 'textarea-dark-background': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'textarea-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'textarea-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'textarea-danger-border-color': whenProps({ status: Status.Danger }),\n 'textarea-success-border-color': whenProps({ status: Status.Success }),\n })};\n\n color: ${conditional({\n 'textarea-color': whenProps({ scheme: 'light' }),\n 'textarea-dark-color': whenProps({ scheme: 'dark' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'textarea-background--hover': whenProps({ scheme: 'light' }),\n 'textarea-dark-background--hover': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'textarea-border-color--hover': whenProps({ scheme: 'light' }),\n 'textarea-dark-border-color--hover': whenProps({ scheme: 'dark' }),\n })};\n `}\n\n ${focusable`\n background: ${conditional({\n 'textarea-background--focus': whenProps({ scheme: 'light' }),\n 'textarea-dark-background--focus': whenProps({ scheme: 'dark' }),\n })};\n\n border-color: ${conditional({\n 'textarea-border-color--focus': whenProps({ scheme: 'light' }),\n 'textarea-dark-border-color--focus': whenProps({ scheme: 'dark' }),\n })};\n\n box-shadow: ${conditional({\n 'textarea-box-shadow': whenProps({ scheme: 'light' }),\n 'textarea-dark-box-shadow': whenProps({ scheme: 'dark' }),\n })};\n\n outline: ${token('textarea-outline')};\n outline-offset: ${token('textarea-outline-offset')};\n `}\n\n ${disableable()}\n`\n\nconst StyledSpan = styled.span<WithAdditionalProps>`\n ${transition()}\n\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n color: ${conditional({\n 'textarea-border-color': whenProps({ scheme: 'light', status: Status.Neutral }),\n 'textarea-dark-border-color': whenProps({ scheme: 'dark', status: Status.Neutral }),\n 'textarea-danger-border-color': whenProps({ status: Status.Danger }),\n 'textarea-success-border-color': whenProps({ status: Status.Success }),\n })};\n`\n\nconst Leading = styled(StyledSpan)<WithAdditionalProps>`\n align-items: flex-start;\n\n margin: 0 0 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })};\n\n padding: ${token('space-s')} 0;\n`\n\nconst Trailing = styled(StyledSpan)<WithAdditionalProps>`\n align-items: flex-start;\n\n margin: 0\n ${conditional({\n 'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'text-field-small-padding-x': whenProps({ scale: 'small' }),\n })}\n 0 0;\n\n padding: ${token('space-s')} 0;\n`\n\nconst StyledTextarea = styled.textarea<WithAdditionalProps>`\n ${transition()}\n\n ${font({\n height: 'textarea-font-height',\n })}\n\n background: transparent;\n\n padding: ${conditional({\n 'textarea-padding-y': whenProps({ scale: 'default' }),\n 'textarea-small-padding-y': whenProps({ scale: 'small' }),\n 'textarea-large-padding-y': whenProps({ scale: 'large' }),\n })}\n 0;\n\n margin: 0\n ${conditional({\n 'textarea-padding-x': whenProps({ scale: ['default', 'large'] }),\n 'textarea-small-padding-x': whenProps({ scale: 'small' }),\n })};\n\n border: none;\n\n flex: 1 0 auto;\n\n ${focusable()}\n ${disableable()}\n`\n\nconst Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n props: TextareaProps,\n ref\n): JSX.Element {\n const {\n disabled = false,\n status = Status.Neutral,\n scheme = 'light',\n scale = 'default',\n className,\n leading,\n trailing,\n ...others\n } = props\n const { ref: containerRef, focused } = useFocusWithin<HTMLDivElement>()\n\n return (\n <TextareaWrapper\n className={clsx(className, {\n 'is-disabled': disabled,\n 'is-focused': focused,\n })}\n scheme={scheme}\n scale={scale}\n status={status}\n ref={containerRef}\n >\n {leading && (\n <Leading status={status} scheme={scheme} scale={scale}>\n {leading}\n </Leading>\n )}\n <StyledTextarea\n ref={ref}\n data-testid=\"textarea\"\n {...others}\n scale={scale}\n status={status}\n scheme={scheme}\n leading={leading}\n trailing={trailing}\n disabled={disabled}\n />\n {trailing && (\n <Trailing status={status} scheme={scheme} scale={scale}>\n {trailing}\n </Trailing>\n )}\n </TextareaWrapper>\n )\n})\n\nexport default Textarea\n","import type { AnchorHTMLAttributes } from 'react'\nimport { isBlank } from '@loadsmart/utils-string'\n\nconst INSECURE_HREF = /^javascript:/i\n\nfunction checkHref(props: AnchorHTMLAttributes<HTMLAnchorElement>) {\n const { href, ...others } = props\n\n if (isBlank(href || '')) {\n return props\n }\n\n if (INSECURE_HREF.test(`${href || ''}`)) {\n // security risk, thus, removing it\n return others\n }\n\n return props\n}\n\nfunction checkTarget({ target, rel }: AnchorHTMLAttributes<HTMLAnchorElement>) {\n if (isBlank(target || '')) {\n return { target, rel }\n }\n\n const sanitizedRel = new Set((rel || '').split(/\\s+/).filter(Boolean))\n\n if (target === '_blank') {\n sanitizedRel.add('noopener')\n }\n\n /**\n * To avoid exploitation of the window.opener API, Adding noreferrer,\n * as recommended in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a\n */\n sanitizedRel.add('noreferrer')\n\n return { rel: Array.from(sanitizedRel).join(' '), target }\n}\n\nfunction useSafeLink(\n props: AnchorHTMLAttributes<HTMLAnchorElement>\n): AnchorHTMLAttributes<HTMLAnchorElement> {\n const { rel, target } = checkTarget(props) || {}\n\n return { ...checkHref(props), rel, target }\n}\n\nexport default useSafeLink\n","import React, { forwardRef } from 'react'\nimport type { AnchorHTMLAttributes, ForwardedRef } from 'react'\nimport clsx from 'clsx'\nimport styled, { css } from 'styled-components'\n\nimport useSafeLink from './useSafeLink'\nimport font from 'styles/font'\nimport transition from 'styles/transition'\nimport ellipsizable from 'styles/ellipsizable'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport disableable from 'styles/disableable'\nimport { getToken as token } from 'theming'\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n className?: string\n disabled?: boolean\n}\n\nconst StyledBaseAnchor = styled.a`\n ${font({\n height: 'link-font-height',\n weight: 'link-font-weight',\n })}\n ${transition()}\n\n ${ellipsizable()}\n\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n text-align: center;\n font-size: ${token('link-font-size')};\n color: ${token('color-neutral-darker')};\n text-decoration: none;\n\n min-height: 24px;\n\n border-radius: ${token('border-radius-s')};\n\n ${hoverable`\n text-decoration: underline;\n font-weight: ${token('link-font-weight--hover')};\n `}\n\n ${focusable`\n box-shadow: ${token('link-box-shadow')};\n outline: ${token('link-outline')};\n outline-offset: ${token('link-outline-offset')};\n `}\n\n ${disableable``}\n\n ${({ children }) =>\n 'string' == typeof children &&\n // to prevent layout shift on hover, https://css-tricks.com/bold-on-hover-without-the-layout-shift/\n css`\n &::after {\n height: 0;\n overflow: hidden;\n\n font-weight: ${token('link-font-weight--hover')};\n\n visibility: hidden;\n\n content: attr(data-text);\n content: attr(data-text) / '';\n user-select: none;\n pointer-events: none;\n\n @media speech {\n display: none;\n }\n }\n `}\n`\n\nexport const BaseLink = forwardRef(function BaseLink(\n { disabled = false, ...props }: LinkProps,\n forwardedRef: ForwardedRef<HTMLAnchorElement>\n): JSX.Element {\n const { href = '/', children, className, target = '_self', ...others } = useSafeLink(props)\n\n return (\n <StyledBaseAnchor\n className={clsx(\n {\n 'is-disabled': disabled,\n },\n className\n )}\n href={href}\n target={target}\n {...others}\n ref={forwardedRef}\n data-text={'string' == typeof children ? children : ''}\n data-testid=\"link\"\n >\n {children}\n </StyledBaseAnchor>\n )\n})\n\nconst StyledAnchor = styled(BaseLink)<LinkProps>`\n color: ${token('link-color')};\n`\n\nfunction Link(props: LinkProps): JSX.Element {\n return <StyledAnchor {...props} />\n}\n\nexport default Link\n","import React, { HTMLAttributes } from 'react'\nimport { isNil } from '@loadsmart/utils-object'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\n\nimport { Link } from '../Link'\n\nexport interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {\n active?: boolean\n label: string\n url?: string\n}\n\nconst StyledLink = styled(Link)`\n font-size: ${token('breadcrumbs-font-size')};\n line-height: ${token('breadcrumbs-font-height')};\n`\n\nconst StyledLi = styled.li<BreadcrumbProps>`\n ${font({\n height: 'breadcrumbs-font-height',\n weight: 'breadcrumbs-font-weight',\n })}\n\n position: relative;\n\n display: inline-flex;\n align-items: center;\n\n font-weight: ${conditional({\n 'breadcrumbs-font-weight': whenProps({ active: false }),\n 'breadcrumbs-font-weight--active': whenProps({ active: true }),\n })};\n\n font-size: ${token('breadcrumbs-font-size')};\n line-height: ${token('breadcrumbs-font-height')};\n\n & + & {\n margin: 0 0 0 ${token('breadcrumbs-spacing-x')};\n }\n\n &:not(:only-child):not(:last-child)::after {\n position: absolute;\n left: calc(100% + 14px);\n\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('breadcrumbs-font-size')};\n\n line-height: ${token('breadcrumbs-font-height')};\n\n content: '/';\n }\n`\n\nfunction getWrappedLabel(props: Partial<BreadcrumbProps>) {\n const { url, label, onClick, active, ...rest } = props\n\n if (isNil(url) && !onClick) {\n return label\n }\n\n return (\n <StyledLink\n href={url}\n target=\"_self\"\n onClick={onClick}\n {...(active && { 'aria-current': 'page' })}\n {...rest}\n >\n {label}\n </StyledLink>\n )\n}\n\nfunction Breadcrumb({ active, label, url, ...rest }: BreadcrumbProps): JSX.Element {\n return (\n <StyledLi\n className={clsx({ 'is-active': active })}\n label={label}\n data-testid=\"breadcrumb\"\n active={active}\n >\n {getWrappedLabel({ label, url, active, ...rest })}\n </StyledLi>\n )\n}\n\nexport default Breadcrumb\n","import React, { MouseEvent } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport Breadcrumb, { BreadcrumbProps } from './Breadcrumb'\nimport BackButton from 'common/BackButton'\n\nexport interface BreadcrumbsProps {\n className?: string\n disabled?: boolean\n entries: BreadcrumbProps[]\n onBack?: (e: MouseEvent<HTMLButtonElement>) => void\n}\n\nconst StyledWrapper = styled.nav`\n display: flex;\n flex-direction: row;\n`\n\nconst StyledOl = styled.ol`\n display: flex;\n flex-direction: row;\n margin: 0;\n\n padding: 0;\n\n list-style: none;\n`\n\nconst StyledBackButton = styled(BackButton)`\n margin: 0 ${token('space-m')} 0 0;\n`\n\nfunction Breadcrumbs({ entries = [], onBack, disabled, ...others }: BreadcrumbsProps): JSX.Element {\n return (\n <StyledWrapper aria-label=\"Breadcrumb\" {...others}>\n {onBack && (\n <StyledBackButton\n data-testid=\"breadcrumbs-back\"\n onClick={onBack}\n disabled={disabled}\n aria-label=\"Back to previous page\"\n />\n )}\n\n <StyledOl data-testid=\"breadcrumbs\">\n {entries.map((entry: BreadcrumbProps) => {\n return <Breadcrumb key={entry.label} {...entry} />\n })}\n </StyledOl>\n </StyledWrapper>\n )\n}\nexport default Breadcrumbs\n","import { useRef, useEffect } from 'react'\n\n/**\n * Hook useful to trigger action conditionally based\n * on if the component is mounted.\n * Be aware that your effect, callback, memo, etc cannot list is\n * as a dependency, otherwise it will be triggered at the wrong moment.\n * @returns {boolean} Whether the component is mounted or not.\n */\nfunction useDidMount(): boolean {\n const counter = useRef(0)\n\n useEffect(function onMount() {\n counter.current = 1\n }, [])\n\n return counter.current > 0\n}\n\nexport default useDidMount\n","import get from 'utils/toolset/get'\n\nimport type {\n Selectable,\n SelectableAdapter,\n SelectableKeyType,\n SelectableState,\n SelectableStrategy,\n} from './useSelectable.types'\n\nexport type SelectableStrategyContext<T extends Selectable> = {\n getAdapter: (type?: string) => SelectableAdapter<T>\n}\n\nconst GenericAdapter: SelectableAdapter<unknown> = {\n getKey(o): string {\n return get(o, 'value')!\n },\n}\n\nfunction createSelectionStrategy<T extends Selectable>(props: {\n multiple?: boolean\n adapters: Record<string, SelectableAdapter<T>>\n}): SelectableStrategy<T> {\n const { adapters, multiple } = props\n\n const context: SelectableStrategyContext<T> = {\n getAdapter(type?: string) {\n if (type == null) {\n return GenericAdapter\n }\n\n return adapters[type] || GenericAdapter\n },\n }\n\n if (multiple) {\n return MultipleSelectionStrategy(context)\n }\n\n return SingleSelectionStrategy(context)\n}\n\nexport function SingleSelectionStrategy<T extends Selectable>(\n context: SelectableStrategyContext<T>\n): SelectableStrategy<T> {\n return {\n type() {\n return 'single'\n },\n init(items: T[]) {\n return this.select(items, new Map())\n },\n select(items: T[]) {\n const newSelection = new Map<SelectableKeyType, T>()\n\n for (let i = 0; i < items.slice(0, 1).length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n newSelection.set(adapter.getKey(items[i]), items[i])\n }\n\n return newSelection\n },\n unselect(keys: SelectableKeyType[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < keys.length; i++) {\n newSelection.delete(keys[i])\n }\n\n return newSelection\n },\n toggle(items: T[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>()\n\n for (let i = 0; i < items.slice(0, 1).length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n\n if (!selection.has(adapter.getKey(items[i]))) {\n newSelection.set(adapter.getKey(items[i]), items[i])\n }\n }\n\n return newSelection\n },\n clear() {\n return new Map<SelectableKeyType, T>()\n },\n }\n}\n\nexport function MultipleSelectionStrategy<T extends Selectable>(\n context: SelectableStrategyContext<T>\n): SelectableStrategy<T> {\n return {\n type() {\n return 'multiple'\n },\n init(items: T[]) {\n return this.select(items, new Map<SelectableKeyType, T>())\n },\n select(items: T[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < items.length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n newSelection.set(adapter.getKey(items[i]), items[i])\n }\n\n return newSelection\n },\n unselect(keys: SelectableKeyType[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < keys.length; i++) {\n newSelection.delete(keys[i])\n }\n\n return newSelection\n },\n toggle(items: T[], selection: SelectableState<T>) {\n const newSelection = new Map<SelectableKeyType, T>(selection)\n\n for (let i = 0; i < items.length; i++) {\n const adapter = context.getAdapter(items[i]._type)\n const key = adapter.getKey(items[i])\n\n if (!selection.has(key)) {\n newSelection.set(key, items[i])\n } else {\n newSelection.delete(key)\n }\n }\n\n return newSelection\n },\n clear() {\n return new Map<SelectableKeyType, T>()\n },\n }\n}\n\nexport default createSelectionStrategy\n","import range from './range'\n\nconst MAX_LENGTH = 15\nconst INITIAL_LENGTH = 2\nconst ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-'\n\n/**\n *\n * @param {Object} options - Options\n * @param\n * @returns\n */\nexport function IDGenerator({\n maxIDLength,\n initialIDLength,\n alphabet,\n}: {\n maxIDLength: number\n initialIDLength: number\n alphabet: string\n}): () => string {\n let currentLength = initialIDLength\n\n // eslint-disable-next-line prefer-const\n let filledCharacters = [\n ...(Array(maxIDLength - currentLength).fill(-1) as number[]),\n ...(Array(currentLength).fill(0) as number[]),\n ]\n\n let availableIDs = range(initialIDLength, maxIDLength + 1).reduce(\n // using arrangement with repetition formula\n (acc: number, n: number) => acc + Math.pow(alphabet.length, n),\n 0\n )\n\n return function getID() {\n if (availableIDs == 0) {\n throw new Error(`No more IDs available with the provided alphabet and max length`)\n }\n\n availableIDs--\n const newID = filledCharacters.slice(-1 * currentLength).map((at: number) => alphabet[at])\n\n /**\n * [0, 0, 0, 0]\n * ^ at\n */\n let at = filledCharacters.length\n\n /**\n * move to the left in the `filledCharacters` array if\n * we have surpassed the last possible character in `alphabet`.\n * That means:\n * [0,0,0,(alphabet.length - 1)]\n * Becomes:\n * [0,0,1,0]\n */\n\n do {\n at--\n filledCharacters[at] = (filledCharacters[at] + 1) % alphabet.length\n } while (filledCharacters[at] == 0 && at >= filledCharacters.length - currentLength)\n\n /**\n * if we moved to the left as much as `currentLength` allowed,\n * and we have incremented as many times as we could, for each\n * position so we're back to `0`, due to the module operation,\n * i.e., if `currentLength = 3`, for example:\n *\n * [0, 0, 0, 0]\n * ^ currentLength\n * ^at\n *\n * So we need to increase `currentLength` to start incrementing from there:\n * [0, 0, 0, 0]\n * ^ currentLength\n */\n if (filledCharacters.length - at > currentLength) {\n currentLength++\n }\n\n return `genid-${newID.join('')}`\n }\n}\n\n// this configuration is capable of generating 469172025408063600 different IDs.\nconst getID = IDGenerator({\n maxIDLength: MAX_LENGTH,\n alphabet: ALPHABET,\n initialIDLength: INITIAL_LENGTH,\n})\n\nexport default getID\n","import { useState, useRef } from 'react'\n\nimport getID from 'utils/toolset/getID'\nimport isEmpty from 'utils/toolset/isEmpty'\n\ntype FingerprintAdapter<T> = (item: T) => string\n\n/**\n * This hook helps with stabilizing changes for components that rely on non-primitive props, more specifically, arrays,\n * objects, maps, sets and so on; when we need to update an internal state based on such types of prop, we might run into an infinite loop.\n * By creating a fingerprint - a string that identifies that set of items - we can garantee that the same set of items will\n * always return the same fingerprint, thus, making check for changes more predictable.\n *\n * @param adapter - adapter function that gets a unique identifier for each item in the `items` prop\n * @param items - list of items whose fingerprint should be checked.\n * @returns\n */\nfunction useFingerprint<T>(\n adapter: FingerprintAdapter<T>,\n items: T[]\n): {\n fingerprint: string\n getFingerprint: (items?: T[] | null, insert?: boolean) => string\n resetFingerprint: (items: T[]) => void\n hasSameFingerprint: (otherItems: T[]) => boolean\n} {\n const knownRef = useRef({} as Record<string, T | string>)\n const [fingerprint, setFingerprint] = useState(() => getFingerprint('', items, true))\n\n /**\n * Get a fingerprint based on the sorted items identifiers.\n *\n * @param {string[]} items - array of items\n * @param {boolean} update - update `known` with the provided `items`, if it contains different set of items.\n * @returns {string}\n */\n function getFingerprint(currentFingerprint: string, items?: T[] | null, update = false) {\n const known = knownRef.current\n\n const safeItems = items || []\n\n let newKnown: Record<string, T | string> = {}\n let hasSameItems = Object.keys(known).length === safeItems.length\n\n for (let i = 0; i < safeItems.length; i++) {\n const item = safeItems[i]\n const key = adapter(item)\n\n hasSameItems = hasSameItems && known[key] != null\n\n newKnown = {\n ...newKnown,\n // we associate a previously created or a new random value to compose the fingerprint\n [key]: known[key] ?? getID(),\n }\n }\n\n if (hasSameItems) {\n return currentFingerprint\n }\n\n if (update) {\n knownRef.current = newKnown\n }\n\n const fingerprint = Object.keys(newKnown)\n .sort()\n .reduce((fingerprint, item) => {\n return `${fingerprint}${newKnown[item] as string}`\n }, '')\n\n return fingerprint\n }\n\n return {\n fingerprint,\n getFingerprint(items?: T[] | null, update = false) {\n return getFingerprint(fingerprint, items, update)\n },\n resetFingerprint(items: T[]) {\n setFingerprint(getFingerprint(fingerprint, items, true))\n },\n /**\n * Check if the provided items have the same fingerprint.\n * @param {string[]} otherItems - items\n * @returns {boolean}\n */\n hasSameFingerprint(otherItems: T[]) {\n return fingerprint === getFingerprint(fingerprint, otherItems)\n },\n }\n}\n\nexport default useFingerprint\n","import { createContext, useEffect, useMemo, useReducer, useRef } from 'react'\nimport { identity } from '@loadsmart/utils-function'\n\nimport { useDidMount } from 'hooks/useDidMount'\nimport createSelectionStrategy from './SelectableStrategy'\nimport toArray from 'utils/toolset/toArray'\nimport useFingerprint from 'hooks/useFingerprint'\n\nimport type { Context } from 'react'\nimport type {\n Selectable,\n SelectableAction,\n SelectableKeyType,\n SelectableState,\n SelectableStrategy,\n useSelectableProps,\n useSelectableReturn,\n} from './useSelectable.types'\n\nconst DEFAULT_ADAPTERS = {}\n\n/**\n * Create a generic manager for collection selection.\n * @returns\n */\nfunction createUseSelectable<T extends Selectable>() {\n return function useSelectable(props: useSelectableProps<T>): useSelectableReturn<T> {\n const { adapters, multiple, onChange } = props\n\n const didMount = useDidMount()\n\n const strategy = useMemo<SelectableStrategy<T>>(() => {\n return createSelectionStrategy<T>({\n adapters: adapters || DEFAULT_ADAPTERS,\n multiple: Boolean(multiple),\n })\n }, [adapters, multiple])\n\n function reducer(state: SelectableState<T>, action: SelectableAction<T>) {\n switch (action.type) {\n case 'select':\n return strategy.select(action.payload, state)\n case 'unselect':\n return strategy.unselect(action.payload, state)\n case 'toggle':\n return strategy.toggle(action.payload, state)\n case 'clear':\n return strategy.clear(state)\n case 'reset':\n return action.payload\n }\n }\n\n function initializer() {\n return strategy.init(toArray(props.selected))\n }\n\n const [selected, dispatch] = useReducer(reducer, new Map<SelectableKeyType, T>(), initializer)\n const { resetFingerprint, hasSameFingerprint } = useFingerprint<string>(\n identity,\n [...selected.keys()].map(String)\n )\n const propagateChangeRef = useRef(false)\n\n function type() {\n return strategy.type()\n }\n\n function select(items: T | T[]) {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'select',\n payload: toArray(items),\n })\n }\n\n function unselect(keys: SelectableKeyType | SelectableKeyType[]) {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'unselect',\n payload: toArray(keys),\n })\n }\n\n function toggle(items: T | T[]) {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'toggle',\n payload: toArray(items),\n })\n }\n\n function clear() {\n propagateChangeRef.current = true\n\n dispatch({\n type: 'clear',\n })\n }\n\n useEffect(\n function handleChange() {\n if (didMount && propagateChangeRef.current) {\n onChange?.(selected)\n }\n\n propagateChangeRef.current = false\n },\n /**\n * We don't want to update when didMount or the onChange callback changes, because we're only interested\n * in changes to the selected state.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selected]\n )\n\n useEffect(\n function updateOnSelectedPropChange() {\n const newSelected = initializer()\n const keys = [...newSelected.keys()].map(String)\n\n if (hasSameFingerprint(keys)) {\n return\n }\n\n propagateChangeRef.current = false\n\n resetFingerprint(keys)\n dispatch({\n type: 'reset',\n payload: newSelected,\n })\n },\n /**\n * initializer is not relevant for our changes, that's why its ommitted.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.selected, hasSameFingerprint, resetFingerprint]\n )\n\n return { type, selected, select, unselect, toggle, clear }\n }\n}\n\nexport function createSelectable<T extends Selectable>(): {\n SelectableContext: Context<useSelectableReturn<T>>\n useSelectable: (props: useSelectableProps<T>) => useSelectableReturn<T>\n} {\n const SelectableContext = createContext<useSelectableReturn<T>>({} as useSelectableReturn<T>)\n const useSelectable = createUseSelectable<T>()\n\n return { SelectableContext, useSelectable }\n}\n","import React from 'react'\nimport { createSelectable } from 'hooks/useSelectable'\n\nimport type { ToggleGroupProps, ToggleOption } from './ToggleGroup.types'\n\nconst ToggleGroupContext = React.createContext<Pick<ToggleGroupProps, 'scale' | 'disabled'>>({\n scale: 'default',\n disabled: false,\n})\n\nexport const { SelectableContext, useSelectable } = createSelectable<ToggleOption>()\n\nexport default ToggleGroupContext\n","import React, { useContext } from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport ToggleGroupContext, { SelectableContext } from './ToggleGroupContext'\n\nimport type { ToggleGroupOptionProps, ToggleGroupType } from './ToggleGroup.types'\n\nconst ToggleButton = styled(BaseButton)<{ $type: ToggleGroupType }>`\n text-transform: ${token('toggle-text-transform')};\n\n background-color: ${conditional({\n 'toggle-background-color': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color': whenProps({ 'aria-checked': true }),\n })};\n\n border-color: ${conditional({\n 'toggle-single-border-color': whenProps({ $type: 'single', 'aria-checked': false }),\n 'toggle-single-checked-border-color': whenProps({ $type: 'single', 'aria-checked': true }),\n 'toggle-multiple-border-color': whenProps({ $type: 'multiple', 'aria-checked': false }),\n 'toggle-multiple-checked-border-color': whenProps({ $type: 'multiple', 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color': whenProps({ 'aria-checked': true }),\n })};\n\n padding: ${token('space-xs')} ${token('space-s')};\n\n ${hoverable`\n border-color: ${conditional({\n 'toggle-multiple-border-color--hover': whenProps({ $type: 'multiple' }),\n 'toggle-single-border-color--hover': whenProps({ $type: 'single' }),\n })};\n\n background-color: ${conditional({\n 'toggle-background-color--hover': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--hover': whenProps({ 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color--hover': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--hover': whenProps({ 'aria-checked': true }),\n })};\n `}\n\n ${focusable`\n border-color: ${conditional({\n 'toggle-multiple-border-color--focus': whenProps({ $type: 'multiple' }),\n 'toggle-single-border-color--focus': whenProps({ $type: 'single' }),\n })};\n\n background-color: ${conditional({\n 'toggle-background-color--focus': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--focus': whenProps({ 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color--focus': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--focus': whenProps({ 'aria-checked': true }),\n })};\n\n box-shadow: ${token('toggle-box-shadow')};\n outline: ${token('toggle-outline')};\n outline-offset: ${token('toggle-outline-offset')};\n `}\n\n ${activatable`\n border-color: ${conditional({\n 'toggle-multiple-border-color--active': whenProps({ $type: 'multiple' }),\n 'toggle-single-border-color--active': whenProps({ $type: 'single' }),\n })};\n\n background-color: ${conditional({\n 'toggle-background-color--active': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--active': whenProps({ 'aria-checked': true }),\n })};\n\n color: ${conditional({\n 'toggle-color--active': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--active': whenProps({ 'aria-checked': true }),\n })};\n `}\n\n ${disableable`\n background-color: ${conditional({\n 'toggle-background-color--disabled': whenProps({ 'aria-checked': false }),\n 'toggle-checked-background-color--disabled': whenProps({ 'aria-checked': true }),\n })};\n\n border-color: ${conditional({\n 'toggle-single-border-color--disabled': whenProps({ $type: 'single', 'aria-checked': false }),\n 'toggle-single-checked-border-color--disabled': whenProps({\n $type: 'single',\n 'aria-checked': true,\n }),\n 'toggle-multiple-border-color--disabled': whenProps({\n $type: 'multiple',\n 'aria-checked': false,\n }),\n 'toggle-multiple-checked-border-color--disabled': whenProps({\n $type: 'multiple',\n 'aria-checked': true,\n }),\n })};\n\n color: ${conditional({\n 'toggle-color--disabled': whenProps({ 'aria-checked': false }),\n 'toggle-checked-color--disabled': whenProps({ 'aria-checked': true }),\n })};\n `}\n`\n\nfunction isMultiple(type: ToggleGroupType) {\n return type === 'multiple'\n}\n\nfunction Toggle({ value, children, disabled, ...others }: ToggleGroupOptionProps): JSX.Element {\n const group = useContext(ToggleGroupContext)\n const selectable = useContext(SelectableContext)\n\n if (isEmpty(selectable)) {\n throw Error('A Toggle options must be rendered inside a ToggleGroup')\n }\n\n const selected = selectable.selected.has(value)\n\n return (\n <ToggleButton\n {...others}\n $type={selectable.type()}\n type=\"button\"\n role={isMultiple(selectable.type()) ? 'checkbox' : 'radio'}\n aria-checked={selected}\n disabled={Boolean(disabled || group.disabled)}\n onClick={() => {\n if (isMultiple(selectable.type())) {\n selectable.toggle({ value })\n } else {\n selectable.select({ value })\n }\n }}\n scale={group.scale}\n >\n {children}\n </ToggleButton>\n )\n}\n\nexport default styled(Toggle)({})\n","import React, { useCallback } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport conditional, { whenProps } from 'tools/conditional'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport toArray from 'utils/toolset/toArray'\nimport Toggle from './Toggle'\nimport ToggleGroupContext, { SelectableContext, useSelectable } from './ToggleGroupContext'\n\nimport type {\n ToggleGroupOptionProps,\n ToggleGroupProps,\n ToggleOption,\n ToggleGroupOptionValue,\n SelectedToggleGroupOptions,\n} from './ToggleGroup.types'\n\nconst Container = styled(Group)<{ $multiple: boolean; $scale: ToggleGroupProps['scale'] }>`\n padding: ${conditional({\n 'toggle-group-multiple-padding': whenProps({ $multiple: true }),\n 'toggle-group-single-padding': whenProps({ $multiple: false }),\n })};\n\n border-color: ${conditional({\n 'toggle-group-multiple-border-color': whenProps({ $multiple: true }),\n 'toggle-group-single-border-color': whenProps({ $multiple: false }),\n })};\n\n border-style: ${conditional({\n 'toggle-group-multiple-border-style': whenProps({ $multiple: true }),\n 'toggle-group-single-border-style': whenProps({ $multiple: false }),\n })};\n\n border-width: ${conditional({\n 'toggle-group-multiple-border-width': whenProps({ $multiple: true }),\n 'toggle-group-single-border-width': whenProps({ $multiple: false }),\n })};\n\n border-radius: ${conditional({\n 'toggle-group-multiple-border-radius': whenProps({ $multiple: true }),\n 'toggle-group-single-border-radius': whenProps({ $multiple: false }),\n })};\n\n &.are-disabled {\n border-color: ${token('toggle-group-border-color--disabled')};\n }\n\n ${Toggle} {\n height: ${conditional({\n 'toggle-single-height': whenProps({ $multiple: false, $scale: 'default' }),\n 'toggle-single-small-height': whenProps({ $multiple: false, $scale: 'small' }),\n 'toggle-multiple-height': whenProps({ $multiple: true, $scale: 'default' }),\n 'toggle-multiple-small-height': whenProps({ $multiple: true, $scale: 'small' }),\n })};\n\n font-size: ${conditional({\n 'toggle-single-font-size': whenProps({ $multiple: false, $scale: 'default' }),\n 'toggle-single-small-font-size': whenProps({ $multiple: false, $scale: 'small' }),\n 'toggle-multiple-font-size': whenProps({ $multiple: true, $scale: 'default' }),\n 'toggle-multiple-small-font-size': whenProps({ $multiple: true, $scale: 'small' }),\n })};\n }\n`\n\nfunction fromValueToSelected(\n value: ToggleGroupOptionValue | ToggleGroupOptionValue[]\n): ToggleOption[] {\n const valueAsArray = toArray(value)\n\n return valueAsArray.map((value) => ({ value }))\n}\n\nfunction fromSelectedToValue(\n selected: SelectedToggleGroupOptions,\n multiple: boolean\n): ToggleGroupOptionValue | ToggleGroupOptionValue[] | null {\n const pairs = Array.from(selected)\n\n if (multiple) {\n const value: ToggleGroupOptionValue[] = []\n for (const [, option] of pairs) {\n value.push(option.value)\n }\n\n return value\n } else {\n if (isEmpty(pairs)) {\n return null\n }\n const [[, option]] = pairs\n return option.value\n }\n}\n\nconst DEFAULT_SELECTED = [] as ToggleGroupOptionValue[]\n\nfunction ToggleGroup(props: ToggleGroupProps): JSX.Element {\n const {\n disabled = false,\n multiple = false,\n scale = 'default',\n id,\n name,\n onChange,\n options,\n children,\n className,\n ...others\n } = props\n const selectable = useSelectable({\n multiple,\n selected: fromValueToSelected(props.value ?? DEFAULT_SELECTED),\n onChange: useCallback(\n function handleSelectionChange(selected) {\n onChange?.({\n target: { id, name: name ?? '', value: fromSelectedToValue(selected, multiple) },\n })\n },\n [id, multiple, name, onChange]\n ),\n })\n\n return (\n <Container\n {...others}\n className={clsx(className, {\n 'are-disabled': disabled,\n })}\n id={id}\n role={multiple ? 'group' : 'radiogroup'}\n align=\"center\"\n space=\"xs\"\n $multiple={multiple}\n $scale={scale}\n >\n <ToggleGroupContext.Provider value={{ scale, disabled }}>\n <SelectableContext.Provider value={selectable}>\n {children ??\n (options || []).map(function renderOption(option: ToggleGroupOptionProps) {\n const { label, value, ...others } = option\n const key = String(value)\n\n return (\n <Toggle\n key={key}\n {...others}\n disabled={Boolean(disabled || option.disabled)}\n value={value}\n >\n {label}\n </Toggle>\n )\n })}\n </SelectableContext.Provider>\n </ToggleGroupContext.Provider>\n </Container>\n )\n}\n\nToggleGroup.Option = Toggle\n\nexport default ToggleGroup\n","import { createContext } from 'react'\n\ninterface TabContextValue {\n id: string\n activeTab: string\n setActiveTab: (name: string) => void\n direction?: 'horizontal' | 'vertical'\n}\n\nexport const TabContext = createContext<TabContextValue>({} as TabContextValue)\n","import React from 'react'\n\nimport getID from 'utils/toolset/getID'\n\nfunction useID(propId?: string): string {\n const [id, setID] = React.useState(() => propId || getID())\n\n React.useEffect(\n function updateID() {\n setID(propId || getID())\n },\n [propId]\n )\n\n return id\n}\n\nexport default useID\n","import React, {\n HTMLAttributes,\n useContext,\n useState,\n useEffect,\n ChangeEvent,\n ReactNode,\n} from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { TabContext } from './TabsContext'\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport disableable from 'styles/disableable'\nimport transition from 'styles/transition'\nimport useID from 'hooks/useID'\n\nimport type { WithDirectionProps, WithActiveProps } from './Tabs.types'\nimport clsx from 'clsx'\n\nconst TabsItemsWrapper = styled.ul`\n display: flex;\n\n padding: 0;\n\n border-bottom-color: ${token('color-neutral-lighter')};\n border-bottom-width: 2px;\n border-bottom-style: solid;\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Children = styled(StyledSpan)`\n flex: 1;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst StyledListItem = styled.li`\n display: flex;\n`\n\nconst StyledLabel = styled.label<WithActiveProps & WithDirectionProps>`\n ${font({\n height: 'font-height-2',\n weight: 'font-weight-bold',\n })}\n ${transition()}\n\n font-size: ${token('font-size-4')};\n text-transform: uppercase;\n text-align: ${conditional({\n center: whenProps({ direction: 'vertical' }),\n justify: whenProps({ direction: 'horizontal' }),\n })};\n\n ${hoverable`\n color: ${token('color-neutral-darker')};\n background-color: ${token('color-neutral-light')}33;\n `}\n\n ${disableable`\n color: ${token('color-neutral-dark')}33;\n background-color: ${token('color-neutral-light')};\n `}\n\n padding: ${token('space-m')} ${token('space-l')};\n display: inline-flex;\n flex-direction: ${conditional({\n row: whenProps({ direction: 'horizontal' }),\n column: whenProps({ direction: 'vertical' }),\n })};\n\n cursor: pointer;\n\n position: relative;\n bottom: -2px;\n\n border-bottom-width: 2px;\n border-bottom-style: solid;\n\n border-color: ${conditional({\n 'color-transparent': whenProps({ active: false }),\n 'color-primary': whenProps({ active: true }),\n })};\n\n color: ${conditional({\n 'color-neutral': whenProps({ active: false }),\n 'neutral-darker': whenProps({ active: true }),\n })};\n\n ${Leading} + ${Children} {\n margin: ${conditional({\n '0': whenProps({ direction: 'horizontal' }),\n 'space-2xs': whenProps({ direction: 'vertical' }),\n })}\n 0 0\n ${conditional({\n 'space-s': whenProps({ direction: 'horizontal' }),\n '0': whenProps({ direction: 'vertical' }),\n })};\n }\n`\n\ntype TabsItemsProps = HTMLAttributes<HTMLUListElement>\n\nfunction TabsItems({ children, ...props }: TabsItemsProps) {\n return (\n <TabsItemsWrapper {...props} role=\"tablist\">\n {children}\n </TabsItemsWrapper>\n )\n}\n\ninterface TabsItemProps extends HTMLAttributes<HTMLInputElement> {\n name: string\n default?: boolean\n leading?: ReactNode\n disabled?: boolean\n}\n\nfunction TabsItem({\n children,\n name,\n default: isDefault,\n className,\n onChange,\n leading,\n disabled = false,\n ...props\n}: TabsItemProps) {\n const { id: tabId, setActiveTab, activeTab, direction } = useContext(TabContext)\n\n const isActive = activeTab === name\n\n function handleSelect(event: ChangeEvent<HTMLInputElement>) {\n setActiveTab(name)\n onChange?.(event)\n }\n\n useEffect(() => {\n if (!activeTab && isDefault) {\n setActiveTab(name)\n }\n }, [activeTab, name, setActiveTab, isDefault])\n\n return (\n <StyledListItem role=\"tab\" aria-selected={isActive ? 'true' : 'false'}>\n <StyledLabel\n className={clsx(\n {\n 'is-disabled': disabled,\n },\n className\n )}\n active={activeTab === name}\n direction={direction}\n >\n <input\n {...props}\n value={name}\n checked={isActive}\n disabled={disabled}\n type=\"radio\"\n name={tabId}\n onChange={handleSelect}\n hidden\n />\n {leading && <Leading>{leading}</Leading>}\n {children && <Children>{children}</Children>}\n </StyledLabel>\n </StyledListItem>\n )\n}\n\ntype PanelsItemsProps = HTMLAttributes<HTMLDivElement>\n\nconst PanelsItemsWrapper = styled.div`\n /* placeholder */\n`\n\nconst PanelsItemWrapper = styled.article`\n display: ${conditional({\n block: whenProps({ 'aria-hidden': false }),\n none: whenProps({ 'aria-hidden': true }),\n })};\n`\n\nfunction PanelsItems({ children, ...props }: PanelsItemsProps) {\n return <PanelsItemsWrapper {...props}>{children}</PanelsItemsWrapper>\n}\n\ninterface PanelsItemProps extends HTMLAttributes<HTMLElement> {\n name: string\n /**\n * Renders the Panel.Item only when is visible\n * @default false\n */\n lazy?: boolean\n}\n\nfunction PanelsItem({ children, name, lazy = false, ...props }: PanelsItemProps) {\n const { activeTab } = useContext(TabContext)\n\n const hidden = activeTab !== name\n\n return (\n <PanelsItemWrapper {...props} role=\"tabpanel\" aria-hidden={hidden}>\n {lazy && hidden ? null : children}\n </PanelsItemWrapper>\n )\n}\n\nexport interface TabsProps extends HTMLAttributes<HTMLElement>, WithDirectionProps {\n activeTab?: string\n onTabChange?: (tab: string) => void\n}\n\nconst TabsWrapper = styled.div`\n ${TabsItemsWrapper} + ${PanelsItemsWrapper} {\n margin: ${token('space-xl')} 0 0 0;\n }\n`\n\n/**\n * @example\n * <Tabs>\n <Tabs.Items>\n <Tabs.Item name=\"tab-1\" default>\n Tabs 1\n </Tabs.Item>\n <Tabs.Item name=\"tab-2\">Tabs 2</Tabs.Item>\n </Tabs.Items>\n <Tabs.Panels>\n <Tabs.Panel name=\"tab-1\">first content</Tabs.Panel>\n <Tabs.Panel name=\"tab-2\">second content</Tabs.Panel>\n </Tabs.Panels>\n * </Tabs>\n */\nfunction Tabs({\n children,\n direction = 'horizontal',\n id: propId,\n activeTab: propTab = '',\n onTabChange,\n ...props\n}: TabsProps): JSX.Element {\n const [activeTab, setActiveTab] = useState(propTab)\n const id = useID(propId)\n\n useEffect(() => {\n if (propTab) {\n setActiveTab(propTab)\n }\n }, [propTab])\n\n useEffect(() => {\n onTabChange?.(activeTab)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTab])\n\n return (\n <TabsWrapper {...props}>\n <TabContext.Provider value={{ activeTab, setActiveTab, id, direction }}>\n {children}\n </TabContext.Provider>\n </TabsWrapper>\n )\n}\n\nTabs.Items = TabsItems\nTabs.Item = TabsItem\nTabs.Panels = PanelsItems\nTabs.Panel = PanelsItem\n\nexport default Tabs\n","import React, { HTMLAttributes, ReactNode } from 'react'\nimport styled from 'styled-components'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\n\nexport type SectionProps = HTMLAttributes<HTMLElement>\n\nconst StyledSection = styled.section`\n ${font({\n height: 'font-height-2',\n })}\n`\n\nconst StyledSectionTitle = styled.section`\n ${font({\n weight: 'font-weight-bold',\n height: 'font-height-2',\n })}\n\n font-size: ${token('font-size-3')};\n color: ${token('color-neutral-darker')};\n\n border-bottom: 2px solid ${token('color-neutral-light')};\n\n padding: ${token('space-s')} ${token('space-xs')};\n margin-bottom: ${token('space-l')};\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Leading = styled(StyledSpan)`\n margin: 0 ${token('button-spacing-x')} 0 0;\n`\n\nexport interface SectionTitleProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode\n leading?: ReactNode\n}\n\nfunction SectionTitle({ children, leading, ...others }: SectionTitleProps) {\n return (\n <StyledSectionTitle data-testid=\"section-title\" {...others}>\n {leading && <Leading>{leading}</Leading>}\n {children}\n </StyledSectionTitle>\n )\n}\n\nfunction Section({ children, ...others }: SectionProps): JSX.Element {\n return (\n <StyledSection data-testid=\"section\" {...others}>\n {children}\n </StyledSection>\n )\n}\n\nSection.Title = SectionTitle\n\nexport default Section\n","/**\n * Add basic CSS style for hide elements\n * @param {boolean} accessible - should keep element visible for screen readers\n * @returns {string}\n */\nfunction hiddenStyle(accessible = false): string {\n if (accessible) {\n return `\n border: 0 !important;\n clip: rect(0 0 0 0) !important;\n clip-path: inset(50%) !important;\n height: 1px !important;\n margin: -1px !important;\n overflow: hidden !important;\n padding: 0 !important;\n position: absolute !important;\n white-space: nowrap !important;\n width: 1px !important;\n pointer-events: none;\n `\n }\n\n return `\n display: none !important;\n opacity: 0 !important;\n `\n}\n\nexport default hiddenStyle\n","import React, { createContext, ReactNode, useState } from 'react'\n\ntype AccordionContextType = [boolean, () => void]\nconst AccordionContext = createContext<AccordionContextType | undefined>(undefined)\n\nfunction AccordionProvider({\n expanded,\n children,\n onExpandedChange,\n initialExpanded = false,\n}: {\n children: ReactNode\n initialExpanded?: boolean\n expanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n}): JSX.Element {\n const [openState, setOpenState] = useState(initialExpanded)\n const open = expanded ?? openState\n\n function toggle() {\n onExpandedChange?.(!open)\n setOpenState(!open)\n }\n\n return <AccordionContext.Provider value={[open, toggle]}>{children}</AccordionContext.Provider>\n}\n\nfunction useAccordionContext(): AccordionContextType {\n const context = React.useContext(AccordionContext)\n if (!context) {\n throw new Error('useAccordionContext must be used within an AccordionProvider')\n }\n return context\n}\n\nexport { AccordionProvider, useAccordionContext }\n","import React, { Fragment } from 'react'\nimport type { PropsWithChildren, HTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\nimport styled from 'styled-components'\nimport { identity, isFunction } from '@loadsmart/utils-function'\n\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport transition from 'styles/transition'\nimport ellipsizable from 'styles/ellipsizable'\nimport hidden from 'styles/hidden'\n\nimport { AccordionProvider, useAccordionContext } from './Accordion.context'\n\nconst StyledWrapper = styled.article<{ open: boolean }>`\n background: ${token('color-neutral-white')};\n border: 1px solid\n ${conditional({\n 'color-neutral-light': whenProps({ open: false }),\n 'color-accent': whenProps({ open: true }),\n })};\n border-radius: ${token('border-radius-s')};\n\n ${hoverable`\n border-color: ${token('color-accent')};\n `}\n`\n\nconst StyledToggle = styled.button<{ open: boolean }>`\n ${font({\n height: 'font-height-2',\n })}\n\n ${transition()}\n\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n\n font-size: ${token('font-size-3')};\n font-weight: ${conditional({\n 'font-weight-regular': whenProps({ open: false }),\n 'font-weight-bold': whenProps({ open: true }),\n })};\n text-align: left;\n\n cursor: pointer;\n\n color: ${token('color-neutral-darker')};\n\n background-color: ${token('color-transparent')};\n border-radius: ${token('border-radius-s')};\n border: none;\n box-sizing: border-box;\n\n padding: ${token('space-s')} ${token('space-m')};\n\n width: 100%;\n\n ${hoverable`\n background: ${token('color-neutral-lighter')};\n `}\n\n ${focusable`\n box-shadow: ${token('shadow-glow-primary')};\n `}\n`\n\nconst StyledContent = styled.section<{ open: boolean }>`\n ${font({\n height: 'font-height-2',\n weight: 'font-weight-medium',\n })}\n\n padding-left: ${conditional({\n '0': whenProps({ open: false }),\n 'space-m': whenProps({ open: true }),\n })};\n padding-right: ${conditional({\n '0': whenProps({ open: false }),\n 'space-m': whenProps({ open: true }),\n })};\n padding-top: ${conditional({\n '0': whenProps({ open: false }),\n 'space-xl': whenProps({ open: true }),\n })};\n padding-bottom: ${conditional({\n '0': whenProps({ open: false }),\n 'space-s': whenProps({ open: true }),\n })};\n\n overflow-x: hidden;\n overflow-y: auto;\n`\n\nconst HiddenInput = styled.input`\n ${hidden()}\n\n &:not(:checked) + ${StyledContent} {\n height: 0;\n }\n\n &:checked + ${StyledContent} {\n height: 100%;\n }\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Leading = styled(StyledSpan)`\n margin: 0 ${token('space-xs')} 0 0;\n`\n\nconst Trailing = styled(StyledSpan)`\n margin: 0 0 0 auto;\n`\n\nconst Children = styled.span`\n pointer-events: none;\n\n ${ellipsizable()}\n`\n\nfunction ToggleIndicator({ open }: { open: boolean }) {\n return <Icon name={open ? 'minus' : 'plus'} size={16} />\n}\n\nfunction AccordionWrapper({\n children,\n ...others\n}: PropsWithChildren<HTMLAttributes<HTMLElement>>): JSX.Element {\n const [open] = useAccordionContext()\n return (\n <StyledWrapper data-testid=\"accordion\" open={open} {...others}>\n {children}\n </StyledWrapper>\n )\n}\n\nexport type AccordionToggleProps = {\n leading?: ReactNode | ((expanded: boolean) => ReactNode)\n trailing?: ReactNode | ((expanded: boolean) => ReactNode)\n}\n\nfunction AccordionToggle({\n leading,\n trailing: propsTrailing,\n children,\n}: PropsWithChildren<AccordionToggleProps>): JSX.Element {\n const [open, toggle] = useAccordionContext()\n\n const trailing = propsTrailing === undefined ? <ToggleIndicator open={open} /> : propsTrailing\n\n return (\n <StyledToggle open={open} onClick={toggle} type=\"button\" data-testid=\"accordion-toggle\">\n {leading && (\n <Leading data-testid=\"accordion-toggle-leading\">\n {isFunction(leading) ? leading(open) : leading}\n </Leading>\n )}\n <Children>{children}</Children>\n {trailing && (\n <Trailing data-testid=\"accordion-toggle-trailing\">\n {isFunction(trailing) ? trailing(open) : trailing}\n </Trailing>\n )}\n </StyledToggle>\n )\n}\n\nexport type AccordionBodyProps = HTMLAttributes<HTMLElement>\n\nfunction AccordionBody({ children, ...props }: PropsWithChildren<AccordionBodyProps>): JSX.Element {\n const [open] = useAccordionContext()\n\n return (\n <Fragment>\n <HiddenInput type=\"checkbox\" checked={open} onChange={identity} />\n <StyledContent\n open={open}\n className={clsx({\n 'is-open': open,\n })}\n aria-hidden={!open ? 'true' : 'false'}\n data-testid=\"accordion-content\"\n {...props}\n >\n {children}\n </StyledContent>\n </Fragment>\n )\n}\n\nexport interface AccordionProps extends HTMLAttributes<HTMLElement> {\n expanded?: boolean\n initialExpanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n}\n\nfunction Accordion({\n children,\n expanded,\n initialExpanded,\n onExpandedChange,\n ...others\n}: AccordionProps): JSX.Element {\n return (\n <AccordionProvider\n expanded={expanded}\n initialExpanded={initialExpanded}\n onExpandedChange={onExpandedChange}\n >\n <AccordionWrapper {...others}>{children}</AccordionWrapper>\n </AccordionProvider>\n )\n}\n\nAccordion.Toggle = AccordionToggle\nAccordion.Body = AccordionBody\n\nexport default Accordion\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React, { ReactElement, useState } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport { Icon as DefaultIcon } from 'components/Icon'\n\nimport { BaseButton } from 'components/Button'\nimport DefaultCloseButton from 'common/CloseButton'\n\nexport interface BannerProps {\n className?: string\n variant?: 'success' | 'danger' | 'warning' | 'neutral'\n icon?: JSX.Element\n scale?: 'default' | 'large'\n title?: string | ReactElement\n description?: string | ReactElement\n onClose?: () => void\n dismissible?: boolean\n}\n\nexport interface BannerActionProps extends BannerProps {\n action?: string\n secondaryAction?: string\n onActionButtonClick?: () => void\n onSecondaryActionButtonClick?: () => void\n}\n\ninterface VariantProps {\n variant?: 'success' | 'danger' | 'warning' | 'neutral'\n}\n\nconst Description = styled.div`\n color: ${token('banner-description-color')};\n font-size: ${token('banner-font-size')};\n line-height: ${token('banner-font-height')};\n text-align: left;\n`\n\nconst Title = styled.div<VariantProps>`\n font-weight: ${token('banner-title-font-weight')};\n font-size: ${token('banner-font-size')};\n line-height: ${token('banner-font-height')};\n text-align: left;\n`\n\nconst TextSection = styled.div<{ $dismissible?: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-items: center;\n padding-right: ${conditional({\n 'space-xl': whenProps({ $dismissible: true }),\n })};\n`\n\nconst StyledBanner = styled.div<Omit<BannerProps, 'dismissible'>>`\n position: relative;\n\n display: flex;\n flex-wrap: ${conditional({\n wrap: whenProps({ scale: 'default' }),\n 'no-wrap': whenProps({ scale: 'large' }),\n })};\n align-items: center;\n min-width: ${token('banner-min-width')};\n\n min-height: ${conditional({\n 'banner-default-height': whenProps({ scale: 'default' }),\n })};\n padding: ${conditional({\n 'banner-default-padding-y': whenProps({ scale: 'default' }),\n 'banner-large-padding': whenProps({ scale: 'large' }),\n })}\n ${conditional({\n 'banner-default-padding-x': whenProps({ scale: 'default' }),\n 'banner-large-padding': whenProps({ scale: 'large' }),\n })};\n\n color: ${conditional({\n 'banner-title-color-success': whenProps({ variant: 'success' }),\n 'banner-title-color-danger': whenProps({ variant: 'danger' }),\n 'banner-title-color-warning': whenProps({ variant: 'warning' }),\n 'banner-title-color-neutral': whenProps({ variant: 'neutral' }),\n })};\n\n background: ${conditional({\n 'banner-background-success': whenProps({ variant: 'success' }),\n 'banner-background-warning': whenProps({ variant: 'warning' }),\n 'banner-background-danger': whenProps({ variant: 'danger' }),\n 'banner-background-neutral': whenProps({ variant: 'neutral' }),\n })};\n\n border-color: ${conditional({\n 'banner-border-color-success': whenProps({ variant: 'success' }),\n 'banner-border-color-warning': whenProps({ variant: 'warning' }),\n 'banner-border-color-danger': whenProps({ variant: 'danger' }),\n 'banner-border-color-neutral': whenProps({ variant: 'neutral' }),\n })};\n border-style: solid;\n border-width: ${token('banner-border-width')};\n\n border-radius: ${token('banner-border-radius')};\n`\n\nexport const CloseButton = styled(DefaultCloseButton)`\n position: absolute;\n top: ${conditional({\n 'banner-default-close-top': whenProps({ scale: 'default' }),\n 'banner-large-close-top': whenProps({ scale: 'large' }),\n })};\n right: ${conditional({\n 'banner-default-close-right': whenProps({ scale: 'default' }),\n 'banner-large-close-right': whenProps({ scale: 'large' }),\n })};\n\n width: ${token('banner-icon-width')};\n height: ${token('banner-icon-height')};\n`\n\nconst IconWrapper = styled.span<{ scale: string }>`\n display: inline-flex;\n align-items: center;\n\n align-self: ${conditional({\n 'banner-default-icon-alignment': whenProps({ scale: 'default' }),\n 'banner-large-icon-alignment': whenProps({ scale: 'large' }),\n })};\n justify-content: center;\n\n margin-right: ${token('banner-icon-margin-right')};\n`\n\nexport const Icon = styled(DefaultIcon)`\n width: ${token('banner-icon-width')};\n height: ${token('banner-icon-height')};\n`\n\nconst Button = styled(BaseButton)`\n min-width: 88px;\n margin-top: ${token('space-s')};\n margin-left: ${conditional({\n '0': whenProps({ variant: 'primary' }),\n 'banner-secondary-button-margin-left': whenProps({ variant: 'secondary' }),\n })};\n\n color: ${conditional({\n 'banner-button-text-color': whenProps({ variant: 'primary' }),\n 'banner-button-background-danger': whenProps({ variant: 'secondary', className: 'danger' }),\n 'banner-button-background-warning': whenProps({ variant: 'secondary', className: 'warning' }),\n 'banner-button-background-neutral': whenProps({ variant: 'secondary', className: 'neutral' }),\n 'banner-button-background-success': whenProps({ variant: 'secondary', className: 'success' }),\n })};\n\n background-color: ${conditional({\n 'banner-button-background-success': whenProps({ variant: 'primary', className: 'success' }),\n 'banner-button-background-danger': whenProps({ variant: 'primary', className: 'danger' }),\n 'banner-button-background-warning': whenProps({ variant: 'primary', className: 'warning' }),\n 'banner-button-background-neutral': whenProps({ variant: 'primary', className: 'neutral' }),\n 'banner-button-background-secondary': whenProps({ variant: 'secondary' }),\n })};\n\n border-color: ${conditional({\n 'banner-button-background-success': whenProps({ className: 'success' }),\n 'banner-button-background-danger': whenProps({ className: 'danger' }),\n 'banner-button-background-warning': whenProps({ className: 'warning' }),\n 'banner-button-background-neutral': whenProps({ className: 'neutral' }),\n })};\n`\nconst InlineButton = styled(Button)`\n flex-shrink: 0;\n align-self: center;\n`\n\nconst ButtonWrapper = styled.div`\n display: flex;\n margin-top: -${token('space-s')};\n margin-right: 0;\n margin-left: auto;\n`\n\nconst LargeButtonWrapper = styled.div`\n display: flex;\n margin-left: 0;\n`\n\nconst TextWrapper = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${token('space-s')};\n`\n\nconst getAlertIcon = (variant: string, scale: string, icon?: JSX.Element) => {\n if (icon) {\n return <IconWrapper scale={scale}>{icon}</IconWrapper>\n }\n\n let iconName = ''\n switch (variant) {\n case 'success':\n iconName = 'check'\n break\n case 'danger':\n case 'warning':\n iconName = 'warning'\n break\n default:\n iconName = 'information'\n }\n\n return (\n <IconWrapper scale={scale}>\n <Icon name={iconName} size={24} />\n </IconWrapper>\n )\n}\n\nfunction Banner({\n scale = 'default',\n variant = 'neutral',\n icon,\n title,\n description,\n onClose,\n dismissible = true,\n ...others\n}: BannerProps) {\n const [visible, setVisible] = useState<boolean>(true)\n\n if (!visible) return null\n\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n <TextWrapper>\n {getAlertIcon(variant, scale, icon)}\n <TextSection $dismissible={dismissible}>\n {scale === 'default' ? (\n React.isValidElement(title) ? (\n title\n ) : (\n <Title variant={variant}>{title}</Title>\n )\n ) : (\n <>\n {React.isValidElement(title) ? title : <Title>{title}</Title>}\n {description &&\n (React.isValidElement(description) ? (\n description\n ) : (\n <Description>{description}</Description>\n ))}\n </>\n )}\n </TextSection>\n </TextWrapper>\n {dismissible && (\n <CloseButton\n scale={scale}\n onClick={() => {\n onClose?.()\n setVisible(false)\n }}\n type=\"button\"\n data-testid=\"close-button\"\n >\n <Icon name=\"close\" size={20} />\n </CloseButton>\n )}\n </StyledBanner>\n )\n}\n\nexport function BannerLarge({\n scale = 'large',\n variant = 'neutral',\n icon,\n title,\n description,\n onClose,\n dismissible = true,\n ...others\n}: BannerProps) {\n const [visible, setVisible] = useState<boolean>(true)\n\n if (!visible) return null\n\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n {getAlertIcon(variant, scale, icon)}\n <TextSection $dismissible={dismissible}>\n {React.isValidElement(title) ? title : <Title>{title}</Title>}\n {React.isValidElement(description) ? description : <Description>{description}</Description>}\n </TextSection>\n {dismissible && (\n <CloseButton\n scale={scale}\n onClick={() => {\n onClose?.()\n setVisible(false)\n }}\n type=\"button\"\n >\n <Icon name=\"close\" size={16} />\n </CloseButton>\n )}\n </StyledBanner>\n )\n}\n\nexport function BannerAction({\n scale = 'default',\n variant = 'neutral',\n icon,\n title,\n action,\n secondaryAction,\n onActionButtonClick,\n onSecondaryActionButtonClick,\n ...others\n}: BannerActionProps): JSX.Element {\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n <TextWrapper>\n {getAlertIcon(variant, scale, icon)}\n <TextSection>\n {React.isValidElement(title) ? title : <Title variant={variant}>{title}</Title>}\n </TextSection>\n </TextWrapper>\n <ButtonWrapper>\n <InlineButton\n scale=\"small\"\n variant=\"primary\"\n className={variant}\n type=\"button\"\n onClick={onActionButtonClick}\n >\n {action}\n </InlineButton>\n {secondaryAction && (\n <InlineButton\n scale=\"small\"\n className={variant}\n variant=\"secondary\"\n type=\"button\"\n onClick={onSecondaryActionButtonClick}\n >\n {secondaryAction}\n </InlineButton>\n )}\n </ButtonWrapper>\n </StyledBanner>\n )\n}\n\nexport function BannerActionLarge({\n scale = 'large',\n variant = 'neutral',\n icon,\n title,\n description,\n action,\n secondaryAction,\n onActionButtonClick,\n onSecondaryActionButtonClick,\n onClose,\n dismissible = false,\n ...others\n}: BannerActionProps) {\n const [visible, setVisible] = useState<boolean>(true)\n\n if (!visible) return null\n\n return (\n <StyledBanner {...others} scale={scale} variant={variant}>\n {getAlertIcon(variant, scale, icon)}\n <TextSection $dismissible={dismissible}>\n {React.isValidElement(title) ? title : <Title>{title}</Title>}\n {React.isValidElement(description) ? description : <Description>{description}</Description>}\n <LargeButtonWrapper>\n <Button\n scale=\"small\"\n variant=\"primary\"\n className={variant}\n type=\"button\"\n onClick={onActionButtonClick}\n >\n {action}\n </Button>\n {secondaryAction && (\n <Button\n scale=\"small\"\n className={variant}\n variant=\"secondary\"\n type=\"button\"\n onClick={onSecondaryActionButtonClick}\n >\n {secondaryAction}\n </Button>\n )}\n </LargeButtonWrapper>\n </TextSection>\n {dismissible && (\n <CloseButton\n scale={scale}\n onClick={() => {\n onClose?.()\n setVisible(false)\n }}\n >\n <Icon name=\"close\" size={16} />\n </CloseButton>\n )}\n </StyledBanner>\n )\n}\n\nexport default Banner\n","import type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport typography, { TypographyOptions, TypographyVariants } from 'styles/typography'\n\nexport type TextProps = PropsWithChildren<{\n variant?: TypographyVariants\n italic?: TypographyOptions['italic']\n color?: TypographyOptions['color']\n}>\n\nexport default styled.span<TextProps>`\n ${({ variant, italic, color }) => typography(variant, { italic, color })}\n`\n","import React, { PropsWithChildren } from 'react'\nimport ReactDOM from 'react-dom'\nimport styled, { css } from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport { Text } from 'components/Text'\nimport CloseButton from 'common/CloseButton'\nimport rem from 'utils/toolset/rem'\n\ninterface WithScaleProps {\n scale?: 'small' | 'default' | 'large'\n}\n\nexport interface ModalProps extends WithScaleProps {\n className?: string\n id?: string\n open: boolean\n fullscreen?: boolean\n onOverlayClick?: () => void\n}\n\ninterface ModalWrapperProps {\n className?: string\n id?: string\n open: boolean\n fullscreen: boolean\n}\n\ninterface ContentProps extends WithScaleProps {\n fullscreen: boolean\n}\n\nconst ModalWrapper = styled.div<ModalWrapperProps>`\n position: fixed;\n top: 0;\n left: 0;\n\n z-index: ${token('z-index-overlay')};\n\n display: ${conditional({\n flex: whenProps({ open: true }),\n none: whenProps({ open: false }),\n })};\n align-items: center;\n justify-content: center;\n width: 100%;\n\n height: 100%;\n\n background: ${token('modal-overlay-background')};\n`\n\nconst HeaderWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n height: ${token('space-xl')};\n margin-bottom: ${token('space-l')};\n padding-bottom: ${token('space-s')};\n\n border-bottom: 1px solid ${token('color-neutral-light')};\n`\nconst Close = styled(CloseButton).attrs({\n size: 16,\n})`\n position: absolute;\n top: ${rem('36px')};\n right: ${rem('36px')};\n`\n\nconst Content = styled.div<ContentProps>`\n background: white;\n border-radius: ${token('border-radius-s')};\n box-shadow: ${token('shadow-modal')};\n\n padding: ${token('space-xl')};\n\n margin: 0 auto;\n\n position: relative;\n\n outline: none;\n\n z-index: ${token('z-index-modal')};\n\n ${({ fullscreen }) =>\n fullscreen &&\n css`\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100vh;\n `}\n\n ${({ fullscreen }) =>\n !fullscreen &&\n css`\n position: relative;\n left: auto;\n\n width: 80%;\n max-width: ${conditional({\n 'modal-small-max-width': whenProps({ scale: 'small' }),\n 'modal-max-width': whenProps({ scale: 'default' }),\n 'modal-large-max-width': whenProps({ scale: 'large' }),\n })};\n height: auto;\n `}\n`\n\nconst Header = ({ title, children }: PropsWithChildren<{ title: string }>) => {\n return (\n <HeaderWrapper>\n {title && (\n <Text variant=\"heading-md-bold\" color=\"color-neutral-darkest\">\n {title}\n </Text>\n )}\n {children}\n </HeaderWrapper>\n )\n}\n\nfunction Modal({\n scale = 'default',\n children,\n open,\n fullscreen = false,\n onOverlayClick = () => null,\n ...others\n}: PropsWithChildren<ModalProps>): JSX.Element {\n return ReactDOM.createPortal(\n <ModalWrapper\n open={open}\n fullscreen={fullscreen}\n onClick={onOverlayClick}\n data-testid=\"modal-overlay\"\n {...others}\n >\n <Content\n role=\"dialog\"\n aria-modal=\"true\"\n fullscreen={fullscreen}\n scale={scale}\n onClick={(e) => {\n e.stopPropagation()\n }}\n >\n {children}\n </Content>\n </ModalWrapper>,\n document.body\n )\n}\n\nModal.Header = Header\nModal.Close = Close\n\nexport default Modal\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nimport { Modal } from '../Modal'\nimport { Button } from '../Button'\nimport type { ButtonProps } from '../Button'\nimport conditional, { whenProps } from 'tools/conditional'\nimport rem from 'utils/toolset/rem'\n\ninterface WithScaleProps {\n scale?: 'small' | 'default' | 'large'\n}\n\nexport interface DialogProps extends WithScaleProps {\n className?: string\n id?: string\n open: boolean\n children: ReactNode\n onOverlayClick?: () => void\n}\n\nconst Header = styled.h1`\n padding-bottom: ${token('space-s')};\n\n color: ${token('dialog-header-color')};\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('font-size-2')};\n line-height: ${token('font-height-2')};\n text-align: center;\n\n border-bottom: 1px solid ${token('dialog-header-border-color')};\n`\nconst Body = styled.div`\n margin-top: ${token('space-l')};\n margin-bottom: ${token('space-l')};\n\n color: ${token('dialog-body-font-color')};\n font-size: ${token('font-size-4')};\n line-height: ${token('font-height-3')};\n text-align: center;\n`\n\nconst ActionWrapper = styled.div`\n button {\n width: 100%;\n margin-bottom: ${token('space-s')};\n }\n`\n\nconst Close = styled(Modal.Close)`\n top: ${token('space-xl')};\n right: ${rem('36px')};\n`\n\nconst StyledDialogActions = styled.div<{ $scale: string; $direction: string }>`\n display: flex;\n flex-flow: ${conditional({\n 'row-reverse': whenProps({ $direction: 'horizontal' }),\n column: whenProps({ $direction: 'vertical' }),\n })};\n justify-content: ${conditional({\n center: whenProps({ $scale: 'small' }),\n end: whenProps({ $scale: ['default', 'large'] }),\n })};\n\n ${ActionWrapper}:last-child {\n margin-right: ${conditional({\n 'space-m': whenProps({ $direction: 'horizontal' }),\n initial: whenProps({ $direction: 'vertical' }),\n })}};\n }\n`\n\nfunction DialogActions({\n scale = 'default',\n direction = 'vertical',\n children,\n}: {\n scale?: 'small' | 'default' | 'large'\n direction?: 'vertical' | 'horizontal'\n children: ReactNode\n}) {\n return (\n <StyledDialogActions $scale={scale} $direction={direction}>\n {children}\n </StyledDialogActions>\n )\n}\n\nexport interface DialogActionConfirmProps extends Omit<ButtonProps, 'onClick' | 'variant'> {\n onConfirm: () => void\n}\n\nfunction DialogActionConfirm({\n onConfirm = () => void 0,\n children = 'CONFIRM',\n ...others\n}: DialogActionConfirmProps) {\n return (\n <ActionWrapper>\n <Button {...others} onClick={onConfirm} variant=\"primary\">\n {children}\n </Button>\n </ActionWrapper>\n )\n}\n\nexport interface DialogActionCancelProps extends Omit<ButtonProps, 'onClick' | 'variant'> {\n onCancel: () => void\n}\n\nfunction DialogActionCancel({\n onCancel = () => void 0,\n children = 'CANCEL',\n ...others\n}: DialogActionCancelProps) {\n return (\n <ActionWrapper>\n <Button {...others} onClick={onCancel} variant=\"secondary\">\n {children}\n </Button>\n </ActionWrapper>\n )\n}\n\nfunction Dialog({ scale = 'default', open, ...others }: DialogProps): JSX.Element {\n return <Modal open={open} scale={scale} {...others} />\n}\n\nDialog.Header = Header\nDialog.Body = Body\nDialog.ActionConfirm = DialogActionConfirm\nDialog.ActionCancel = DialogActionCancel\nDialog.Actions = DialogActions\nDialog.Close = Close\n\nexport default Dialog\n","import { useCallback, useEffect, useState } from 'react'\n\nexport interface useDialogProps {\n open: boolean\n onOpen?: () => void\n onClose?: () => void\n}\n\nfunction useDialog({ open: openProp, onOpen, onClose }: useDialogProps): {\n open: boolean\n show: () => void\n hide: () => void\n toggle: () => void\n} {\n const [open, setOpen] = useState(openProp)\n\n const show = useCallback(\n function show() {\n setOpen(true)\n onOpen?.()\n },\n [onOpen]\n )\n\n const hide = useCallback(\n function hide() {\n setOpen(false)\n onClose?.()\n },\n [onClose]\n )\n\n const toggle = useCallback(\n function toggle() {\n if (open) {\n hide()\n } else {\n show()\n }\n },\n [hide, open, show]\n )\n\n useEffect(\n function updateState() {\n setOpen(openProp)\n },\n [openProp]\n )\n\n return {\n open,\n show,\n hide,\n toggle,\n }\n}\n\nexport default useDialog\n","import React, { CSSProperties, useMemo, useRef } from 'react'\nimport { useFloating, offset, flip, shift, arrow, autoUpdate } from '@floating-ui/react-dom'\nimport type { Placement } from '@floating-ui/react-dom'\n\nimport type {\n PopoverAlign,\n PopoverFloatingProps,\n PopoverPosition,\n PopoverProps,\n PopoverReferenceProps,\n UsePopoverReturn,\n} from './Popover.types'\n\nconst PopoverContext = React.createContext<UsePopoverReturn | undefined>(undefined)\n\nexport function usePopover(): UsePopoverReturn {\n const value = React.useContext(PopoverContext)\n\n if (!value) {\n throw new Error('usePopover must be used within a <Popover> Provider')\n }\n\n return value\n}\n\nfunction Popover(props: PopoverProps): JSX.Element {\n const arrowRef = useRef<HTMLElement | null>(null)\n\n const { position = 'bottom', align = 'start', strategy = 'fixed' } = props\n\n const desiredPlacement: Placement = `${position}${\n align === 'center' ? '' : `-${align}`\n }` as Placement\n\n const floating = useFloating({\n placement: desiredPlacement,\n strategy,\n middleware: [offset(10), flip(), shift(), arrow({ element: arrowRef, padding: 8 })],\n // TODO: FloatingUI docs states that `autoUpdate` is expensive.\n // This should be properly investidated since it's the way to\n // update fixed positions after scrolling.\n whileElementsMounted: autoUpdate,\n })\n\n const [resultPosition = position, resultAlign = align] = floating.placement.split('-') as [\n PopoverPosition,\n PopoverAlign\n ]\n\n const value = useMemo<UsePopoverReturn>(\n () => ({\n strategy,\n register: {\n setReference: floating.refs.setReference,\n setFloating: floating.refs.setFloating,\n setArrow: arrowRef,\n },\n result: {\n floatingStyles: floating.floatingStyles,\n arrow: { top: floating.middlewareData.arrow?.y, left: floating.middlewareData.arrow?.x },\n position: resultPosition,\n align: resultAlign,\n },\n }),\n [\n floating.refs.setFloating,\n floating.middlewareData.arrow?.x,\n floating.middlewareData.arrow?.y,\n floating.refs.setReference,\n floating.floatingStyles,\n resultAlign,\n resultPosition,\n strategy,\n ]\n )\n\n return <PopoverContext.Provider value={value}>{props.children}</PopoverContext.Provider>\n}\n\nfunction PopoverReference({ children, ...others }: PopoverReferenceProps): JSX.Element {\n const { register } = usePopover()\n\n return (\n <div ref={register.setReference} {...others}>\n {children}\n </div>\n )\n}\n\nfunction PopoverFloating({ children, style, ...others }: PopoverFloatingProps): JSX.Element {\n const { register, result } = usePopover()\n\n return (\n <div\n ref={register.setFloating}\n {...others}\n style={{\n ...result.floatingStyles,\n ...style,\n }}\n >\n {children}\n </div>\n )\n}\n\nPopover.Floating = PopoverFloating\nPopover.Reference = PopoverReference\n\nexport default Popover\n","import React, { HTMLAttributes, ReactNode, useCallback, useState } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport focusable from 'styles/focusable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport { Popover, usePopover } from 'components/Popover'\nimport typography from 'styles/typography'\n\nimport type { PopoverAlign, PopoverPosition } from 'components/Popover'\n\nexport enum TooltipPosition {\n Top = 'top',\n Bottom = 'bottom',\n Left = 'left',\n Right = 'right',\n}\n\nexport enum TooltipAlign {\n Start = 'start',\n Center = 'center',\n End = 'end',\n}\n\nexport interface TooltipProps extends HTMLAttributes<HTMLDivElement> {\n message: ReactNode\n scheme?: ColorScheme\n position?: TooltipPosition | PopoverPosition\n align?: TooltipAlign | PopoverAlign\n}\n\ntype ContainerProps = Pick<TooltipProps, 'scheme'>\n\nconst Container = styled.div<ContainerProps>`\n display: inline-block;\n\n position: relative;\n\n cursor: help;\n\n ${focusable`\n outline: ${conditional({\n '$tooltip-outline': whenProps({ scheme: 'light' }),\n '$tooltip-dark-outline': whenProps({ scheme: 'dark' }),\n })};\n `}\n`\n\nconst Bubble = styled(Popover.Floating)`\n ${typography('body')}\n\n white-space: initial;\n\n min-width: ${token('tooltip-min-width')};\n max-width: ${token('tooltip-max-width')};\n width: max-content;\n\n z-index: ${token('z-index-tooltip')};\n\n background: ${token('tooltip-background')};\n box-shadow: ${token('tooltip-shadow')};\n border-radius: ${token('tooltip-border-radius')};\n\n padding: ${token('tooltip-padding-y')} ${token('tooltip-padding-x')};\n\n color: ${token('tooltip-color')};\n font-size: ${token('tooltip-font-size')};\n line-height: ${token('tooltip-font-height')};\n`\n\ntype ArrowProps = Pick<TooltipProps, 'position'> & {\n top?: number\n left?: number\n}\n\nconst StyledArrow = styled.span<ArrowProps>`\n position: absolute;\n\n width: 0;\n height: 0;\n display: block;\n\n background: transparent;\n border-style: solid;\n\n z-index: ${token('z-index-tooltip')};\n\n ${({ top }) => top && `top: ${top}px;`}\n ${({ left }) => left && `left: ${left}px;`}\n\n ${({ position }) =>\n position === 'top' &&\n css`\n bottom: -8px;\n\n border-color: ${token('tooltip-background')} transparent transparent transparent;\n border-width: 12px 10px 0 10px;\n `}\n\n ${({ position }) =>\n position === 'bottom' &&\n css`\n top: -8px;\n\n border-color: transparent transparent ${token('tooltip-background')} transparent;\n border-width: 0 10px 12px 10px;\n `}\n\n ${({ position }) =>\n position === 'left' &&\n css`\n right: -8px;\n\n border-color: transparent transparent transparent ${token('tooltip-background')};\n border-width: 10px 0 10px 12px;\n `}\n\n ${({ position }) =>\n position === 'right' &&\n css`\n left: -8px;\n\n border-color: transparent ${token('tooltip-background')} transparent transparent;\n border-width: 10px 12px 10px 0;\n `}\n`\n\nfunction Arrow() {\n const { register, result } = usePopover()\n\n return (\n <StyledArrow\n ref={(element) => (register.setArrow.current = element)}\n position={result.position}\n top={result.arrow.top}\n left={result.arrow.left}\n />\n )\n}\n\nfunction Tooltip({\n children,\n message,\n scheme,\n position = TooltipPosition.Top,\n align = TooltipAlign.Center,\n ...rest\n}: PropsWithChildren<TooltipProps>): JSX.Element {\n const [visible, setVisible] = useState(false)\n\n const showTooltip = useCallback(() => {\n setVisible(true)\n }, [])\n\n const hideTooltip = useCallback(() => {\n setVisible(false)\n }, [])\n\n return (\n <Container\n {...rest}\n onFocus={showTooltip}\n onBlur={hideTooltip}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n tabIndex={0}\n scheme={scheme}\n >\n <Popover position={position} align={align}>\n {visible && (\n <Bubble role=\"tooltip\">\n {message}\n <Arrow />\n </Bubble>\n )}\n\n <Popover.Reference>{children}</Popover.Reference>\n </Popover>\n </Container>\n )\n}\n\nexport default Tooltip\n","import React, { ReactNode } from 'react'\nimport type { LabelHTMLAttributes } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\nimport { isNil } from '@loadsmart/utils-object'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport ellipsizable from 'styles/ellipsizable'\nimport font from 'styles/font'\nimport { getToken as token } from 'theming'\n\nimport { Tooltip, TooltipProps } from '../Tooltip'\n\ntype AcceptedType = 'label' | 'div' | 'span'\n\ninterface WithAdditionalProps {\n as?: AcceptedType\n disabled?: boolean\n required?: boolean\n scheme?: ColorScheme\n tip?: ReactNode\n tipProps?: Omit<TooltipProps, 'message'>\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement | HTMLDivElement | HTMLSpanElement>,\n WithAdditionalProps {\n className?: string\n}\n\nconst StyledWrapper = styled.div`\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n\n line-height: ${token('font-height-2')};\n ${disableable()}\n`\n\nconst StyledChildren = styled.span<WithAdditionalProps>`\n display: inline-block;\n\n ${font({\n height: 'label-font-height',\n weight: 'label-font-weight',\n })}\n\n font-size: ${token('label-font-size')};\n color: ${conditional({\n 'label-font-color': whenProps({ scheme: 'light' }),\n 'color-neutral-white': whenProps({ scheme: 'dark' }),\n })};\n ${ellipsizable()}\n`\n\nconst StyledRequired = styled.sup`\n top: 0;\n\n color: ${token('label-required-color')};\n font-size: ${token('label-font-size')};\n`\n\nconst StyledTooltipAnchor = styled.span<WithAdditionalProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n margin: 0 0 0 ${token('label-tooltip-margin-left')};\n\n color: ${conditional({\n 'label-tooltip-font-color': whenProps({ scheme: 'light' }),\n 'label-tooltip-dark-font-color': whenProps({ scheme: 'dark' }),\n })};\n font-weight: ${token('label-tooltip-font-weight')};\n font-size: ${token('label-tooltip-font-size')};\n\n background: ${conditional({\n 'label-tooltip-background-color': whenProps({ scheme: 'light' }),\n 'label-tooltip-dark-background-color': whenProps({ scheme: 'dark' }),\n })};\n border-radius: ${token('border-radius-circle')};\n`\n\nfunction Label({\n as = 'label',\n children,\n className,\n disabled = false,\n required,\n scheme = 'light',\n tip,\n tipProps = {},\n ...others\n}: LabelProps): JSX.Element {\n const tag = String(as || 'label') as AcceptedType\n\n return (\n <StyledWrapper\n data-testid=\"label\"\n as={tag}\n className={clsx(className, {\n 'is-disabled': disabled,\n })}\n {...others}\n >\n <StyledChildren scheme={scheme}>{children}</StyledChildren>\n {required && <StyledRequired>*</StyledRequired>}\n {!isNil(tip) && (\n <Tooltip scheme={scheme} message={tip || ''} {...tipProps}>\n <StyledTooltipAnchor scheme={scheme}>?</StyledTooltipAnchor>\n </Tooltip>\n )}\n </StyledWrapper>\n )\n}\n\nexport default Label\n","export const PAGINATION_ITEM_TYPE = {\n endEllipsis: 'end-ellipsis',\n next: 'next',\n page: 'page',\n previous: 'previous',\n startEllipsis: 'start-ellipsis',\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\n\nimport { BaseButton, IconButton as IconButtonDefault } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\n\nimport type { PaginationItemProps } from './Pagination.types'\nimport { PAGINATION_ITEM_TYPE } from './Pagination.constants'\n\nconst IconButton = styled(IconButtonDefault)`\n margin: ${token('space-xs')};\n`\n\nconst PageButton = styled(BaseButton)`\n background-color: transparent;\n border: none;\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n `}\n\n ${hoverable`\n * {\n text-decoration: underline;\n color: ${token('color-neutral-dark')};\n }\n `}\n\n ${Text} {\n color: ${conditional({\n 'color-accent': whenProps({ 'aria-current': true }),\n })};\n text-decoration: ${conditional({\n underline: whenProps({ 'aria-current': true }),\n })};\n }\n`\n\nconst ICONS_NAME: Record<string, string> = {\n previous: 'caret-left',\n next: 'caret-right',\n}\n\nfunction PaginationItem(props: PaginationItemProps): JSX.Element {\n const { itemType: type, page, ...others } = props\n\n const iconName = ICONS_NAME[type]\n\n if (iconName) {\n return (\n <IconButton {...others} id={iconName} aria-label={`Go to ${type} page`}>\n <Icon name={iconName} size={16} />\n </IconButton>\n )\n }\n\n return (\n <PageButton {...others} aria-label={`Go to page ${page?.toString() ?? ''}`}>\n <Text variant=\"body\">\n {[PAGINATION_ITEM_TYPE.endEllipsis, PAGINATION_ITEM_TYPE.startEllipsis].includes(type)\n ? '...'\n : page}\n </Text>\n </PageButton>\n )\n}\n\nexport default PaginationItem\n","import { PAGINATION_ITEM_TYPE } from './Pagination.constants'\nimport type { PaginationHelperArgs } from './Pagination.types'\n\nexport class PaginationHelper {\n boundaryCount: number\n count: number\n page: number\n siblingCount: number\n\n constructor({ boundaryCount, count, page, siblingCount }: PaginationHelperArgs) {\n this.boundaryCount = boundaryCount\n this.count = count\n this.page = page\n this.siblingCount = siblingCount\n }\n\n range(start: number, end: number): number[] {\n const length = end - start + 1\n return Array.from({ length }, (_, i) => start + i)\n }\n\n getStartPages(): number[] {\n return this.range(1, Math.min(this.boundaryCount, this.count))\n }\n\n getEndPages(): number[] {\n return this.range(\n Math.max(this.count - this.boundaryCount + 1, this.boundaryCount + 1),\n this.count\n )\n }\n\n getSibilingsStart(): number {\n return Math.max(\n Math.min(\n // Natural start\n this.page - this.siblingCount,\n // Lower boundary when page is high\n this.count - this.boundaryCount - this.siblingCount * 2 - 1\n ),\n // Greater than startPages\n this.boundaryCount + 2\n )\n }\n\n getSibilingsEnd(): number {\n const endPages = this.getEndPages()\n\n return Math.min(\n Math.max(\n // Natural end\n this.page + this.siblingCount,\n // Upper boundary when page is low\n this.boundaryCount + this.siblingCount * 2 + 2\n ),\n // Less than endPages\n endPages.length > 0 ? endPages[0] - 2 : this.count - 1\n )\n }\n\n getStartEllipsis(): number[] | string[] {\n const siblingsStart = this.getSibilingsStart()\n\n if (siblingsStart > this.boundaryCount + 2) {\n return [PAGINATION_ITEM_TYPE.startEllipsis]\n }\n\n if (this.boundaryCount + 1 < this.count - this.boundaryCount) {\n return [this.boundaryCount + 1]\n }\n\n return []\n }\n\n getEndEllipsis(): number[] | string[] {\n const siblingsEnd = this.getSibilingsEnd()\n\n if (siblingsEnd < this.count - this.boundaryCount - 1) {\n return [PAGINATION_ITEM_TYPE.endEllipsis]\n }\n\n if (this.count - this.boundaryCount > this.boundaryCount) {\n return [this.count - this.boundaryCount]\n }\n\n return []\n }\n}\n","import { PAGINATION_ITEM_TYPE } from './Pagination.constants'\nimport { PaginationHelper } from './Pagination.helper'\nimport type { usePaginationProps, usePaginationReturn } from './Pagination.types'\n\nfunction usePagination(props: usePaginationProps): usePaginationReturn[] {\n const {\n boundaryCount = 1,\n count,\n disabled = false,\n onChange: handleChange,\n page,\n siblingCount = 1,\n } = props\n\n const paginationHelper = new PaginationHelper({ boundaryCount, count, page, siblingCount })\n\n function handleClick({ page }: { page: number | null }) {\n if (page) {\n handleChange({ page })\n }\n }\n\n const startPages = paginationHelper.getStartPages()\n const endPages = paginationHelper.getEndPages()\n\n const siblingsStart = paginationHelper.getSibilingsStart()\n const siblingsEnd = paginationHelper.getSibilingsEnd()\n\n // Basic list of items to render\n // e.g. itemList = ['previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next']\n const itemList = [\n PAGINATION_ITEM_TYPE.previous,\n ...startPages,\n\n // Start ellipsis\n ...paginationHelper.getStartEllipsis(),\n\n // Sibling pages\n ...paginationHelper.range(siblingsStart, siblingsEnd),\n\n // End ellipsis\n ...paginationHelper.getEndEllipsis(),\n\n ...endPages,\n PAGINATION_ITEM_TYPE.next,\n ]\n\n function getButtonPage(item: string | number): number | null {\n if (typeof item === 'number') {\n return item\n } else {\n switch (item) {\n case PAGINATION_ITEM_TYPE.previous:\n return page - 1\n case PAGINATION_ITEM_TYPE.next:\n return page + 1\n case PAGINATION_ITEM_TYPE.startEllipsis:\n return siblingsStart - 1\n case PAGINATION_ITEM_TYPE.endEllipsis:\n return siblingsEnd + 1\n default:\n return null\n }\n }\n }\n\n function isDisabled(item: string | number): boolean {\n if (item === PAGINATION_ITEM_TYPE.previous) return page <= 1\n if (item === PAGINATION_ITEM_TYPE.next) return page >= count\n\n return false\n }\n\n return itemList.map((item) => {\n const isNumber = typeof item === 'number'\n\n return {\n onClick: () => handleClick({ page: getButtonPage(item) }),\n itemType: isNumber ? PAGINATION_ITEM_TYPE.page : item.toString(),\n page: getButtonPage(item),\n disabled: disabled || isDisabled(item),\n ...(isNumber && { 'aria-current': item === page }),\n }\n })\n}\n\nexport default usePagination\n","import React from 'react'\n\nimport { Layout } from 'components/Layout'\n\nimport PaginationItem from './PaginationItem'\nimport usePagination from './usePagination'\n\nimport type { PaginationProps } from './Pagination.types'\n\nfunction Pagination(props: PaginationProps): JSX.Element {\n const {\n boundaryCount = 1,\n count,\n disabled = false,\n onChange,\n page,\n siblingCount = 1,\n ...others\n } = props\n\n const items = usePagination({ boundaryCount, count, disabled, onChange, page, siblingCount })\n\n return (\n <nav aria-label=\"pagination navigation\" {...others}>\n <Layout.Group space=\"none\" align=\"center\">\n {items.map((item) => (\n <PaginationItem {...item} key={`${item.itemType}${item.page || ''}`} />\n ))}\n </Layout.Group>\n </nav>\n )\n}\n\nexport default Pagination\n","import React, { BaseHTMLAttributes } from 'react'\nimport styled, { css } from 'styled-components'\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport Status from 'utils/types/Status'\n\nconst Bar = styled.div<{ rounded: boolean }>`\n align-items: center;\n display: flex;\n flex-grow: 0;\n flex-shrink: 1;\n\n justify-content: center;\n overflow: hidden;\n width: 100%;\n\n position: relative;\n\n height: ${token('progressbar-height')};\n\n ${({ rounded }) =>\n rounded &&\n css`\n border-radius: ${token('progressbar-height')};\n `}\n`\n\nconst Line = styled.span`\n width: 100%;\n height: 1px;\n\n background: ${token('progressbar-line')};\n background: black;\n`\n\ntype ProgressProps = Pick<ProgressBarProps, 'value' | 'rounded' | 'status'>\nconst Progress = styled.span<ProgressProps>`\n position: absolute;\n top: 0;\n left: 0;\n\n width: ${({ value }) => value}%;\n height: ${token('progressbar-height')};\n\n background: ${conditional({\n 'progressbar-neutral-fill': whenProps({ status: Status.Neutral }),\n 'progressbar-success-fill': whenProps({ status: Status.Success }),\n 'progressbar-warning-fill': whenProps({ status: Status.Warn }),\n 'progressbar-danger-fill': whenProps({ status: Status.Danger }),\n })};\n border-radius: ${conditional({\n ['progressbar-height']: whenProps({ rounded: true }),\n })};\n\n transition: 600ms ease;\n`\n\nexport interface ProgressBarProps extends BaseHTMLAttributes<HTMLDivElement> {\n value?: number\n status?: string\n rounded?: boolean\n showLine?: boolean\n}\n\nexport function ProgressBar({\n value = 60,\n status = Status.Neutral,\n rounded = false,\n showLine = false,\n ...extra\n}: ProgressBarProps): JSX.Element {\n const clampedValue = Math.max(0, Math.min(value, 100))\n\n return (\n <Bar\n role=\"progressBar\"\n aria-valuenow={clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n rounded={rounded}\n {...extra}\n >\n {showLine && <Line />}\n <Progress value={clampedValue} rounded={rounded} status={status} />\n </Bar>\n )\n}\n\nexport default ProgressBar\n","import React, { ChangeEvent, InputHTMLAttributes } from 'react'\nimport clsx from 'clsx'\nimport styled from 'styled-components'\n\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hidden from 'styles/hidden'\nimport hoverable from 'styles/hoverable'\nimport { getToken as token } from 'theming'\n\nimport transition from 'styles/transition'\n\ninterface WithAdditionalProps {\n active?: boolean\n onToggle?: (event: ChangeEvent<HTMLInputElement>) => void\n scale?: 'default' | 'large'\n}\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement>, WithAdditionalProps {\n className?: string\n}\n\nconst SwitchWrapper = styled.label<WithAdditionalProps>`\n ${transition()}\n\n ${font({})};\n\n user-select: none;\n\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n position: relative;\n\n display: inline-flex;\n\n width: ${conditional({\n 'switch-width': whenProps({ scale: 'default' }),\n 'switch-large-width': whenProps({ scale: 'large' }),\n })};\n height: ${conditional({\n 'switch-height': whenProps({ scale: 'default' }),\n 'switch-large-height': whenProps({ scale: 'large' }),\n })};\n\n background-color: ${conditional({\n 'switch-inactive-background-color': whenProps({ active: false }),\n 'switch-active-background-color': whenProps({ active: true }),\n })};\n\n border-radius: ${conditional({\n 'switch-border-radius': whenProps({ scale: 'default' }),\n 'switch-large-border-radius': whenProps({ scale: 'large' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'switch-inactive-background-color--hover': whenProps({ active: false }),\n 'switch-active-background-color--hover': whenProps({ active: true }),\n })};\n `}\n\n ${focusable`\n box-shadow: ${token('switch-box-shadow')};\n outline: ${token('switch-outline')};\n outline-offset: ${token('switch-outline-offset')};\n `}\n\n ${disableable``}\n`\n\nconst Slider = styled.span<WithAdditionalProps>`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n :before {\n position: absolute;\n bottom: ${conditional({\n 'switch-slider-y': whenProps({ scale: 'default', active: false }),\n 'switch-slider-active-y': whenProps({ scale: 'default', active: true }),\n 'switch-slider-large-y': whenProps({ scale: 'large', active: false }),\n 'switch-slider-large-active-y': whenProps({ scale: 'large', active: true }),\n })};\n left: ${conditional({\n 'switch-slider-x': whenProps({ scale: 'default', active: false }),\n 'switch-slider-active-x': whenProps({ scale: 'default', active: true }),\n 'switch-slider-large-x': whenProps({ scale: 'large', active: false }),\n 'switch-slider-large-active-x': whenProps({ scale: 'large', active: true }),\n })};\n\n width: ${conditional({\n 'switch-slider-size': whenProps({ scale: 'default' }),\n 'switch-slider-large-size': whenProps({ scale: 'large' }),\n })};\n\n height: ${conditional({\n 'switch-slider-size': whenProps({ scale: 'default' }),\n 'switch-slider-large-size': whenProps({ scale: 'large' }),\n })};\n\n background-color: ${token('switch-slider-background-color')};\n border-radius: ${token('switch-slider-border-radius')};\n\n ${transition({\n timingFunction: 'ease-out',\n duration: '150ms',\n })}\n\n content: '';\n }\n`\n\nconst HiddenInput = styled.input`\n ${hidden(true)}\n`\n\nconst ActiveIcon = styled(Icon)<WithAdditionalProps>`\n position: absolute;\n top: ${conditional({\n 'switch-icon-active-y': whenProps({ scale: 'default' }),\n 'switch-large-icon-active-y': whenProps({ scale: 'large' }),\n })};\n left: ${conditional({\n 'switch-icon-active-x': whenProps({ scale: 'default' }),\n 'switch-large-icon-active-x': whenProps({ scale: 'large' }),\n })};\n\n width: ${conditional({\n 'switch-icon-width': whenProps({ scale: 'default' }),\n 'switch-large-icon-width': whenProps({ scale: 'large' }),\n })};\n\n height: ${conditional({\n 'switch-icon-height': whenProps({ scale: 'default' }),\n 'switch-large-icon-height': whenProps({ scale: 'large' }),\n })};\n\n color: ${token('switch-icon-color')};\n`\n\nconst InactiveIcon = styled(Icon)<WithAdditionalProps>`\n position: absolute;\n top: ${conditional({\n 'switch-icon-inactive-y': whenProps({ scale: 'default' }),\n 'switch-large-icon-inactive-y': whenProps({ scale: 'large' }),\n })};\n left: ${conditional({\n 'switch-icon-inactive-x': whenProps({ scale: 'default' }),\n 'switch-large-icon-inactive-x': whenProps({ scale: 'large' }),\n })};\n\n width: ${conditional({\n 'switch-icon-width': whenProps({ scale: 'default' }),\n 'switch-large-icon-width': whenProps({ scale: 'large' }),\n })};\n\n height: ${conditional({\n 'switch-icon-height': whenProps({ scale: 'default' }),\n 'switch-large-icon-height': whenProps({ scale: 'large' }),\n })};\n\n color: ${token('switch-icon-color')};\n`\n\nfunction Switch({\n active = false,\n className,\n disabled = false,\n name,\n onToggle,\n scale = 'default',\n ...others\n}: SwitchProps): JSX.Element {\n return (\n <SwitchWrapper\n htmlFor={name}\n title={active ? 'active' : 'inactive'}\n active={active}\n className={clsx(className, {\n 'is-disabled': disabled,\n })}\n scale={scale}\n >\n {active ? (\n <ActiveIcon name=\"check\" scale={scale} data-testid=\"switch-icon-active\" />\n ) : (\n <InactiveIcon name=\"close\" scale={scale} data-testid=\"switch-icon-inactive\" />\n )}\n <Slider active={active} scale={scale} />\n <HiddenInput\n type=\"checkbox\"\n {...others}\n id={name}\n name={name}\n checked={active}\n disabled={disabled}\n onChange={onToggle}\n />\n </SwitchWrapper>\n )\n}\n\nexport default Switch\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\n\nimport { Icon } from 'components/Icon'\n\n// tools\nimport conditional, { whenProps } from 'tools/conditional'\n// styles\nimport typography from 'styles/typography'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport { getToken as token } from 'theming'\n\nimport type { ButtonHTMLAttributes } from 'react'\n\n// interfaces\ninterface WithSizeProps {\n size?: 'small' | 'default' | 'large'\n}\n\ninterface WithVariantProps {\n variant?: 'accent' | 'danger' | 'default' | 'outlined' | 'success' | 'warning'\n}\n\nexport interface TagProps extends React.HTMLAttributes<HTMLElement>, WithSizeProps {\n className?: string\n children?: ReactNode\n disabled?: boolean\n leading?: ReactNode\n removable?: boolean\n variant?: 'accent' | 'danger' | 'default' | 'outlined' | 'success' | 'warning'\n onRemove?: () => void\n getRemoveButtonProps?: () => Partial<ButtonHTMLAttributes<HTMLButtonElement>> & {\n 'data-testid'?: string\n }\n}\n\n// styled elements\nconst StyledTag = styled.span`\n display: inline-flex;\n\n position: relative;\n\n width: auto;\n\n z-index: 0;\n\n ${disableable`\n opacity: ${token('opacity-60')};\n `}\n`\n\nconst StyledSpan = styled.span<TagProps>`\n ${transition()}\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n\n text-decoration: none;\n\n ${typography(\n conditional({\n 'chips-sm': whenProps({ size: 'small' }),\n 'caption-bold': whenProps({ size: 'default' }),\n 'body-bold': whenProps({ size: 'large' }),\n })\n )}\n\n line-height: initial;\n\n text-transform: ${conditional({\n 'tag-transform': whenProps({ size: 'default' }),\n 'tag-small-transform': whenProps({ size: 'small' }),\n 'tag-large-transform': whenProps({ size: 'large' }),\n })};\n\n padding: ${conditional({\n 'tag-small-spacing': whenProps({ size: 'small', removable: (removable) => !removable }),\n 'tag-spacing': whenProps({\n size: (size) => !['small', 'large'].includes(size ?? ''),\n removable: (removable) => !removable,\n }),\n 'tag-large-spacing': whenProps({ size: 'large', removable: (removable) => !removable }),\n 'tag-removable-spacing': whenProps([{ size: (size) => size !== 'small', removable: true }]),\n 'tag-small-removable-spacing': whenProps([{ size: 'small', removable: true }]),\n })};\n\n min-width: ${token('tag-width')};\n height: ${conditional({\n 'tag-height': whenProps({ size: 'default' }),\n 'tag-small-height': whenProps({ size: 'small' }),\n 'tag-large-height': whenProps({ size: 'large' }),\n })};\n\n font-weight: ${conditional({\n 'tag-font-weight': whenProps({ size: 'default' }),\n 'tag-small-font-weight': whenProps({ size: 'small' }),\n 'tag-large-font-weight': whenProps({ size: 'large' }),\n })};\n\n color: ${conditional({\n 'tag-default-color': whenProps({ variant: 'default' }),\n 'tag-outlined-color': whenProps({ variant: 'outlined' }),\n 'tag-accent-color': whenProps({ variant: 'accent' }),\n 'tag-success-color': whenProps({ variant: 'success' }),\n 'tag-warning-color': whenProps({ variant: 'warning' }),\n 'tag-danger-color': whenProps({ variant: 'danger' }),\n })};\n\n background: ${conditional({\n 'tag-default-background': whenProps({ variant: 'default' }),\n 'tag-outlined-background': whenProps({ variant: 'outlined' }),\n 'tag-accent-background': whenProps({ variant: 'accent' }),\n 'tag-success-background': whenProps({ variant: 'success' }),\n 'tag-warning-background': whenProps({ variant: 'warning' }),\n 'tag-danger-background': whenProps({ variant: 'danger' }),\n })};\n\n border-radius: ${token('tag-border-radius')};\n border-width: ${token('tag-border-width')};\n border-style: solid;\n\n border-color: ${conditional({\n 'tag-default-border-color': whenProps({ variant: 'default' }),\n 'tag-outlined-border-color': whenProps({ variant: 'outlined' }),\n 'tag-accent-border-color': whenProps({ variant: 'accent' }),\n 'tag-success-border-color': whenProps({ variant: 'success' }),\n 'tag-warning-border-color': whenProps({ variant: 'warning' }),\n 'tag-danger-border-color': whenProps({ variant: 'danger' }),\n })};\n\n ${hoverable`\n background: ${conditional({\n 'tag-default-background--hover': whenProps([\n { variant: 'default', removable: true },\n { variant: 'default', href: Boolean },\n ]),\n 'tag-outlined-background--hover': whenProps([\n { variant: 'outlined', removable: true },\n { variant: 'outlined', href: Boolean },\n ]),\n 'tag-accent-background--hover': whenProps([\n { variant: 'accent', removable: true },\n { variant: 'accent', href: Boolean },\n ]),\n 'tag-success-background--hover': whenProps([\n { variant: 'success', removable: true },\n { variant: 'success', href: Boolean },\n ]),\n 'tag-warning-background--hover': whenProps([\n { variant: 'warning', removable: true },\n { variant: 'warning', href: Boolean },\n ]),\n 'tag-danger-background--hover': whenProps([\n { variant: 'danger', removable: true },\n { variant: 'danger', href: Boolean },\n ]),\n })};\n\n border-color: ${conditional({\n 'tag-default-border-color--hover': whenProps([\n { variant: 'default', removable: true },\n { variant: 'default', href: Boolean },\n ]),\n 'tag-outlined-border-color--hover': whenProps([\n { variant: 'outlined', removable: true },\n { variant: 'outlined', href: Boolean },\n ]),\n 'tag-accent-border-color--hover': whenProps([\n { variant: 'accent', removable: true },\n { variant: 'accent', href: Boolean },\n ]),\n 'tag-success-border-color--hover': whenProps([\n { variant: 'success', removable: true },\n { variant: 'success', href: Boolean },\n ]),\n 'tag-warning-border-color--hover': whenProps([\n { variant: 'warning', removable: true },\n { variant: 'warning', href: Boolean },\n ]),\n 'tag-danger-border-color--hover': whenProps([\n { variant: 'danger', removable: true },\n { variant: 'danger', href: Boolean },\n ]),\n })};\n\n color: ${conditional({\n 'tag-default-color--hover': whenProps([\n { variant: 'default', removable: true },\n { variant: 'default', href: Boolean },\n ]),\n 'tag-outlined-color--hover': whenProps([\n { variant: 'outlined', removable: true },\n { variant: 'outlined', href: Boolean },\n ]),\n 'tag-accent-color--hover': whenProps([\n { variant: 'accent', removable: true },\n { variant: 'accent', href: Boolean },\n ]),\n 'tag-success-color--hover': whenProps([\n { variant: 'success', removable: true },\n { variant: 'success', href: Boolean },\n ]),\n 'tag-warning-color--hover': whenProps([\n { variant: 'warning', removable: true },\n { variant: 'warning', href: Boolean },\n ]),\n 'tag-danger-color--hover': whenProps([\n { variant: 'danger', removable: true },\n { variant: 'danger', href: Boolean },\n ]),\n })};\n `}\n\n ${focusable`\n color: ${conditional({\n 'tag-default-color--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-color--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-color--focus': whenProps({ variant: 'accent' }),\n 'tag-success-color--focus': whenProps({ variant: 'success' }),\n 'tag-warning-color--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-color--focus': whenProps({ variant: 'danger' }),\n })};\n background: ${conditional({\n 'tag-default-background--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-background--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-background--focus': whenProps({ variant: 'accent' }),\n 'tag-success-background--focus': whenProps({ variant: 'success' }),\n 'tag-warning-background--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-background--focus': whenProps({ variant: 'danger' }),\n })};\n box-shadow: ${token('tag-box-shadow')};\n outline: ${conditional({\n 'tag-default-outline': whenProps({ variant: 'default' }),\n 'tag-outlined-outline': whenProps({ variant: 'outlined' }),\n 'tag-accent-outline': whenProps({ variant: 'accent' }),\n 'tag-success-outline': whenProps({ variant: 'success' }),\n 'tag-warning-outline': whenProps({ variant: 'warning' }),\n 'tag-danger-outline': whenProps({ variant: 'danger' }),\n })};\n outline-offset: ${token('tag-outline-offset')};\n `}\n\n ${disableable`\n opacity: ${token('opacity-60')};\n `}\n`\n\nconst Leading = styled.span<WithSizeProps>`\n display: ${conditional({\n 'tag-leading-display': whenProps({ size: 'default' }),\n 'tag-small-leading-display': whenProps({ size: 'small' }),\n 'tag-large-leading-display': whenProps({ size: 'large' }),\n })};\n margin: 0 ${token('tag-icon-spacing')} 0 0;\n\n color: currentColor;\n\n fill: currentColor;\n`\n\nconst StyledCloseButton = styled.button<WithSizeProps & WithVariantProps>`\n z-index: 2;\n\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n cursor: pointer;\n\n background: ${token('tag-remove-button-background')};\n border-radius: ${token('tag-remove-button-border-radius')};\n border: 0;\n\n width: ${conditional({\n 'tag-remove-button-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-size': whenProps({ size: 'large' }),\n })};\n\n height: ${conditional({\n 'tag-remove-button-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-size': whenProps({ size: 'large' }),\n })};\n\n padding: 0;\n\n ${disableable`\n opacity: ${token('opacity-60')};\n `}\n\n ${focusable``}\n\n &:focus + ${StyledSpan} {\n color: ${conditional({\n 'tag-default-color--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-color--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-color--focus': whenProps({ variant: 'accent' }),\n 'tag-success-color--focus': whenProps({ variant: 'success' }),\n 'tag-warning-color--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-color--focus': whenProps({ variant: 'danger' }),\n })};\n\n background: ${conditional({\n 'tag-default-background--focus': whenProps({ variant: 'default' }),\n 'tag-outlined-background--focus': whenProps({ variant: 'outlined' }),\n 'tag-accent-background--focus': whenProps({ variant: 'accent' }),\n 'tag-success-background--focus': whenProps({ variant: 'success' }),\n 'tag-warning-background--focus': whenProps({ variant: 'warning' }),\n 'tag-danger-background--focus': whenProps({ variant: 'danger' }),\n })};\n box-shadow: ${token('tag-box-shadow')};\n }\n`\n\nconst CloseIcon = styled(Icon)<WithSizeProps & WithVariantProps>`\n width: ${conditional({\n 'tag-remove-button-icon-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-icon-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-icon-size': whenProps({ size: 'large' }),\n })};\n\n height: ${conditional({\n 'tag-remove-button-icon-size': whenProps({ size: 'default' }),\n 'tag-small-remove-button-icon-size': whenProps({ size: 'small' }),\n 'tag-large-remove-button-icon-size': whenProps({ size: 'large' }),\n })};\n\n color: ${conditional({\n 'tag-default-color': whenProps({ variant: 'default' }),\n 'tag-outlined-color': whenProps({ variant: 'outlined' }),\n 'tag-accent-color': whenProps({ variant: 'accent' }),\n 'tag-success-color': whenProps({ variant: 'success' }),\n 'tag-warning-color': whenProps({ variant: 'warning' }),\n 'tag-danger-color': whenProps({ variant: 'danger' }),\n })};\n\n fill: currentColor;\n`\n\nconst StyledSpacer = styled.span<WithSizeProps>`\n display: inline-block;\n width: ${conditional({\n '0': whenProps({ size: 'small' }),\n 'space-xs': whenProps({ size: 'default' }),\n 'space-s': whenProps({ size: 'large' }),\n })};\n`\n\n// components\nfunction Tag(props: TagProps): JSX.Element {\n const {\n children,\n leading,\n size = 'default',\n onRemove,\n variant,\n removable,\n getRemoveButtonProps,\n disabled = false,\n ...others\n } = props\n\n return (\n <StyledTag>\n <StyledSpan size={size} variant={variant} {...others}>\n {leading && <Leading size={size}>{leading}</Leading>}\n {children}\n {removable && !disabled && (\n <>\n <StyledSpacer aria-hidden=\"true\" size={size} />\n <StyledCloseButton\n type=\"button\"\n {...getRemoveButtonProps?.()}\n size={size}\n onClick={onRemove}\n >\n <CloseIcon name=\"close\" variant={variant} size={size} />\n </StyledCloseButton>\n </>\n )}\n </StyledSpan>\n </StyledTag>\n )\n}\n\nexport default Tag\n","import React, { BaseHTMLAttributes, useEffect, useState } from 'react'\nimport styled from 'styled-components'\n\nimport { Icon } from 'components/Icon'\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport Status from 'utils/types/Status'\n\nimport DefaultCloseButton from 'common/CloseButton'\n\nimport { ProgressBar } from 'components/ProgressBar'\n\ntype ContainerProps = Pick<ToastProps, 'status'>\nconst Container = styled.div<ContainerProps>`\n position: relative;\n\n width: ${token('toast-width')};\n max-width: 100%;\n padding: ${token('toast-padding-y')} ${token('toast-padding-x')};\n overflow: hidden;\n\n color: ${token('toast-font-color')};\n font-weight: ${token('toast-font-weight')};\n font-size: ${token('toast-font-size')};\n line-height: ${token('toast-font-height')};\n\n background: ${conditional({\n 'toast-neutral-background': whenProps({ status: Status.Neutral }),\n 'toast-success-background': whenProps({ status: Status.Success }),\n 'toast-warning-background': whenProps({ status: Status.Warn }),\n 'toast-danger-background': whenProps({ status: Status.Danger }),\n })};\n border-radius: ${token('toast-border-radius')};\n box-shadow: ${token('toast-shadow')};\n`\n\nconst Content = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-around;\n`\n\nconst Leading = styled.span`\n position: absolute;\n`\n\nconst ToastCountDown = styled(ProgressBar)`\n position: absolute;\n bottom: 0;\n left: 0;\n`\nconst CloseButton = styled(DefaultCloseButton)`\n position: absolute;\n\n top: ${token('toast-close-y')};\n right: ${token('toast-close-x')};\n\n color: ${token('color-neutral-white')};\n`\n\nexport interface ToastProps extends BaseHTMLAttributes<HTMLDivElement> {\n message: string\n status?: Status\n timeout?: number\n showIcon?: boolean\n onClose: () => void\n}\n\nconst INTERVAL = 300 //ms\n\nfunction Toast({\n message,\n onClose,\n timeout,\n showIcon = false,\n status = Status.Neutral,\n}: ToastProps): JSX.Element {\n const [count, setCount] = useState(100)\n\n /**\n * this is a quick solution for the progress/countdown effect,\n * we can use requestAnimationFrame or some other library to\n * better implement this in the future\n */\n useEffect(() => {\n if (!timeout) return\n\n const decrementBy = (INTERVAL * 100) / timeout\n const interval = window.setTimeout(() => {\n if (count <= 0) {\n window.clearTimeout(interval)\n onClose()\n } else {\n setCount((value) => value - decrementBy)\n }\n }, INTERVAL)\n\n return () => {\n window.clearTimeout(interval)\n }\n }, [count, onClose, timeout])\n\n return (\n <Container status={status} aria-live=\"polite\" role=\"alert\">\n {showIcon && (\n <Leading>\n <ToastIcon status={status} />\n </Leading>\n )}\n <Content>{message}</Content>\n {Boolean(timeout) && <ToastCountDown value={count} status={status} />}\n {onClose && <CloseButton onClick={onClose} size={14} />}\n </Container>\n )\n}\n\ninterface ToastIconProps {\n status: Status\n}\n\nfunction ToastIcon({ status }: ToastIconProps) {\n let iconName = ''\n\n switch (status) {\n case Status.Success:\n iconName = 'check'\n break\n\n case Status.Warn:\n case Status.Danger:\n iconName = 'warning'\n break\n\n default:\n iconName = 'information'\n }\n\n return <Icon name={iconName} size={20} />\n}\n\nexport default Toast\n","export function check(id: string): void {\n const radioElement = document.getElementById(id) as HTMLInputElement\n\n if (radioElement) {\n radioElement.checked = true\n }\n}\n\nexport function getPanelRadioID(id: number | string): string {\n return `rg-wizard-step-radio-${id}`\n}\n","import React from 'react'\n\nconst StepsContext = React.createContext<string | number>('')\n\nexport default StepsContext\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\nimport clsx from 'clsx'\n\nimport { getToken as token } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport transition from 'styles/transition'\n\nimport type { Step } from '../Steps.types'\n\nexport interface StepsProgressProps {\n steps: Array<Step>\n current: number | string\n}\n\nconst StepConnector = styled.span<{ complete: boolean }>`\n position: absolute;\n top: ${conditional({\n 'steps-conector-top': whenProps({ complete: false }),\n 'steps-conector-top--complete': whenProps({ complete: true }),\n })};\n right: calc(-50% + ${token('steps-indicator-size')} / 2);\n left: calc(50% + ${token('steps-indicator-size')} / 2);\n\n z-index: 0;\n\n height: ${conditional({\n 'steps-conector-height': whenProps({ complete: false }),\n 'steps-conector-height--complete': whenProps({ complete: true }),\n })};\n\n background: ${conditional({\n 'steps-progress-step-background-color': whenProps({ complete: false }),\n 'steps-progress-step-background-color--complete': whenProps({ complete: true }),\n })};\n`\n\nconst ProgressStepWrapper = styled.li`\n position: relative;\n\n flex: 1;\n\n text-align: center;\n\n list-style: none;\n\n &:last-child ${StepConnector} {\n display: none;\n }\n`\n\nconst ProgressStepContainer = styled.div`\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n padding: 0 ${token('space-s')};\n`\n\nconst StepIndicator = styled.span<{ current: boolean; complete: boolean }>`\n ${transition()}\n\n ${font({\n weight: 'font-weight-bold',\n height: 'steps-indicator-size',\n })}\n\n font-size: ${token('font-size-4')};\n\n height: ${token('steps-indicator-size')};\n width: ${token('steps-indicator-size')};\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n border-width: 2px;\n border-style: solid;\n border-color: ${conditional({\n 'steps-progress-step-background-color--complete': whenProps([\n { current: true, complete: [true, false] },\n { current: false, complete: true },\n ]),\n 'steps-progress-step-background-color': whenProps({ current: false, complete: false }),\n })};\n border-radius: ${token('border-radius-circle')};\n\n background: ${conditional({\n 'steps-progress-step-background-color--complete': whenProps([\n { current: false, complete: true },\n ]),\n 'color-neutral-white': whenProps([\n { current: true, complete: [true, false] },\n { current: false, complete: false },\n ]),\n })};\n\n color: ${conditional({\n 'steps-progress-step-background-color': whenProps({ current: false, complete: false }),\n 'color-neutral-white': whenProps({ current: false, complete: true }),\n 'steps-progress-step-background-color--complete': whenProps({ current: true }),\n })};\n`\n\nconst StepLabel = styled.span<{ current: boolean; complete: boolean }>`\n ${font({\n height: 'font-height-2',\n })}\n\n position: relative;\n\n font-weight: ${conditional({\n 'font-weight-medium': whenProps({ current: false }),\n 'font-weight-bold': whenProps({ current: true }),\n })};\n\n color: ${conditional({\n 'color-neutral-darker': whenProps([{ current: true }, { current: false, complete: true }]),\n 'color-neutral': whenProps({ current: false, complete: false }),\n })};\n\n font-size: ${token('font-size-4')};\n\n display: flex;\n flex-direction: row;\n\n align-items: center;\n justify-content: center;\n\n text-align: center;\n\n margin: ${token('space-xs')} 0 0 0;\n`\n\nfunction ProgressStep(props: { step: Step; current: boolean; indicator: ReactNode }): JSX.Element {\n const { step, current, indicator } = props\n\n return (\n <ProgressStepWrapper>\n <ProgressStepContainer\n data-testid=\"steps-timeline-entry\"\n className={clsx({\n 'is-current': current,\n 'is-complete': step.complete,\n })}\n >\n <StepIndicator aria-hidden=\"true\" current={current} complete={step.complete}>\n {indicator}\n </StepIndicator>\n\n <StepLabel current={current} complete={step.complete}>\n {step.label}\n </StepLabel>\n\n <StepConnector complete={step.complete} />\n </ProgressStepContainer>\n </ProgressStepWrapper>\n )\n}\n\nexport default ProgressStep\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport ProgressStep from './ProgressStep'\n\nimport type { Step } from '../Steps.types'\n\nexport interface StepsProgressProps {\n steps: Array<Step>\n current: number | string\n}\n\nconst ProgressWrapper = styled.ol<{ steps: Step[] }>`\n position: relative;\n\n display: flex;\n flex-direction: row;\n\n padding: ${token('steps-progress-padding-y')} ${token('steps-progress-padding-x')};\n`\n\nfunction StepsProgress(props: StepsProgressProps): JSX.Element {\n const { steps, current } = props\n\n return (\n <ProgressWrapper steps={steps || []}>\n {(steps || []).map(function renderStep(step, index) {\n const { id } = step\n\n return <ProgressStep key={id} current={current === id} indicator={index + 1} step={step} />\n })}\n </ProgressWrapper>\n )\n}\n\nexport default StepsProgress\n","import React, { Fragment, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { getPanelRadioID } from './Steps.helpers'\nimport { getToken as token } from 'theming'\nimport font from 'styles/font'\nimport hidden from 'styles/hidden'\nimport StepsContext from './StepsContext'\n\nexport interface StepsStepProps {\n id: number | string\n className?: string\n}\n\nconst Selector = styled.input`\n ${hidden(true)}\n`\n\nexport const StepWrapper = styled.article`\n ${font({\n weight: 'font-weight-medium',\n height: 'font-height-2',\n })}\n\n padding: 0 ${token('steps-step-padding-x')} ${token('steps-step-padding-y')};\n\n ${Selector} + & {\n display: none;\n }\n\n ${Selector}:checked + & {\n display: block;\n }\n`\n\nfunction StepsStep({ children, id, ...others }: PropsWithChildren<StepsStepProps>): JSX.Element {\n const StepsID = useContext(StepsContext)\n\n return (\n <Fragment>\n <Selector\n type=\"radio\"\n className=\"visually-hidden\"\n id={getPanelRadioID(id)}\n name={String(StepsID)}\n value={id}\n data-testid=\"panel-radio\"\n tabIndex={-1}\n />\n <StepWrapper data-testid=\"steps-step\" {...others} id={String(id)}>\n {children}\n </StepWrapper>\n </Fragment>\n )\n}\n\nexport default StepsStep\n","import React, { useEffect } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { check, getPanelRadioID } from './Steps.helpers'\nimport { getToken as token } from 'theming'\nimport StepsContext from './StepsContext'\nimport StepsProgress from './ProgressSteps'\nimport StepsStep from './StepsStep'\n\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport type { Step } from './Steps.types'\nexport interface StepsProps {\n current: number | string\n id: number | string\n steps: Array<Step>\n className?: string\n scheme?: ColorScheme\n}\n\nconst StepsWrapper = styled.section`\n display: block;\n width: 100%;\n\n color: ${token('steps-color')};\n`\n\n// TODO: improve by extracting steps props right from children.\nfunction Steps({\n id,\n children,\n current,\n steps,\n ...others\n}: PropsWithChildren<StepsProps>): JSX.Element {\n useEffect(\n function showCurrentStep() {\n check(getPanelRadioID(current))\n },\n [current]\n )\n\n return (\n <StepsWrapper id={String(id)} {...others}>\n <StepsProgress current={current} steps={steps} />\n <StepsContext.Provider value={id}>{children}</StepsContext.Provider>\n </StepsWrapper>\n )\n}\n\nSteps.Step = StepsStep\n\nexport default Steps\n","import { useEffect, useReducer, useRef, Dispatch } from 'react'\n\nimport get from 'utils/toolset/get'\nimport type { Step } from './Steps.types'\n\nexport interface useStepsProps {\n steps: Array<Step>\n current?: number | string\n}\n\ntype State = { current: number | string; steps: Array<Step> }\ntype Action =\n | { type: 'navigate'; payload: { stepID: number | string } }\n | { type: 'next' }\n | { type: 'previous' }\n | { type: 'complete'; payload: { stepID: number | string } }\n | { type: 'reset'; payload: State }\n\nfunction useSteps({ steps, current: currentProp }: useStepsProps): [State, Dispatch<Action>] {\n const stepIndexByID = useRef<Record<number | string, number>>({})\n\n useEffect(\n function initStepIndexByIDMap() {\n stepIndexByID.current = {}\n ;(steps || []).forEach((step, index) => {\n stepIndexByID.current[step.id] = index\n })\n },\n [steps]\n )\n\n const [state, dispatch] = useReducer(reducer, init(steps, currentProp))\n\n function reducer(state: State, action: Action): State {\n const { current } = state\n\n // TODO: improve using object to map each case as individual functions\n switch (action.type) {\n case 'previous': {\n const currentIndex = getStepIndex(current)\n\n if (currentIndex == null) {\n return state\n }\n\n const newCurrentIndex = Math.max(currentIndex - 1, 0)\n\n return {\n ...state,\n current: steps[newCurrentIndex]?.id,\n }\n }\n case 'next': {\n const currentIndex = getStepIndex(current)\n\n if (currentIndex == null) {\n return state\n }\n\n const newCurrentIndex = Math.min(currentIndex + 1, steps.length - 1)\n\n return {\n ...state,\n current: steps[newCurrentIndex]?.id,\n }\n }\n case 'navigate': {\n const { stepID } = action.payload\n const currentIndex = getStepIndex(current)\n const stepIndex = getStepIndex(stepID)\n const step = get(steps, stepIndex)\n\n if (!step) {\n return state\n }\n\n return {\n ...state,\n current: steps[stepIndex]?.id || steps[currentIndex]?.id,\n }\n }\n case 'complete': {\n const { stepID } = action.payload\n const { steps } = state\n\n const stepIndex = getStepIndex(stepID)\n const step = get(steps, stepIndex)\n\n if (!step) {\n return state\n }\n\n return {\n ...state,\n steps: [\n ...steps.slice(0, stepIndex),\n { ...step, complete: true },\n ...steps.slice(stepIndex + 1),\n ],\n }\n }\n case 'reset': {\n const { steps, current } = action.payload\n\n return {\n ...state,\n ...init(steps, current),\n }\n }\n default:\n return state\n }\n }\n\n // TODO: gather step info to feed Steps component\n function init(steps: Array<Step>, current?: number | string): State {\n return {\n current: current || get(steps, '0.id')!,\n steps,\n }\n }\n\n function getStepIndex(stepID: number | string): number {\n return stepIndexByID.current[stepID]\n }\n\n // TODO: write helper functions to abstract inner dispatch mechanism\n return [state, dispatch]\n}\n\nexport default useSteps\n","import React, { ReactNode, HTMLAttributes } from 'react'\n\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\n\nexport interface CardTitleProps extends HTMLAttributes<HTMLElement> {\n leading?: ReactNode\n}\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n pointer-events: none;\n`\n\nconst Leading = styled(StyledSpan)`\n margin-right: ${token('space-xs')};\n`\n\nconst Wrapper = styled.div`\n padding: ${token('card-padding-y')} ${token('card-padding-x')} 0;\n\n color: ${token('card-color')};\n font-weight: ${token('card-title-font-weight')};\n font-size: ${token('card-title-font-size')};\n line-height: ${token('card-title-font-height')};\n`\n\nfunction CardTitle({ children, leading, ...others }: CardTitleProps): JSX.Element {\n return (\n <Wrapper {...others}>\n {leading && <Leading>{leading}</Leading>}\n {children}\n </Wrapper>\n )\n}\n\nexport { Wrapper as CardTitleWrapper }\n\nexport default CardTitle\n","import React, { HTMLAttributes, ReactNode } from 'react'\n\nimport { getToken as token } from 'theming'\nimport CardTitle, { CardTitleWrapper } from './CardTitle'\nimport conditional, { whenProps } from 'tools/conditional'\nimport font from 'styles/font'\nimport Status from 'utils/types/Status'\nimport styled, { css } from 'styled-components'\n\nexport interface CardProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode\n status?: Status\n flagged?: boolean\n}\n\nconst CardSubtitle = styled.div`\n padding: 0 ${token('card-padding-x')} ${token('card-padding-y')};\n\n color: ${token('card-color')};\n font-weight: ${token('card-subtitle-font-weight')};\n font-size: ${token('card-subtitle-font-size')};\n`\n\nconst CardSeparator = styled.hr`\n display: block;\n height: 1px;\n margin: 0;\n\n border: 0;\n border-bottom: 1px solid ${token('card-separator-background')};\n`\n\nconst CardBody = styled.div`\n padding: ${token('card-padding-y')} ${token('card-padding-x')};\n`\n\nconst Wrapper = styled.div`\n ${font({})}\n\n display: flex;\n flex-direction: row;\n\n color: ${token('card-color')};\n\n ${CardTitleWrapper} + ${CardSubtitle} {\n margin-top: ${token('space-xs')};\n }\n\n ${CardTitleWrapper} + ${CardSeparator} {\n margin-top: ${token('card-padding-y')};\n }\n\n border: 1px solid ${token('card-border-color')};\n border-radius: ${token('card-border-radius')};\n background: ${token('card-background')};\n`\n\nconst Container = styled.div<{ flagged: boolean }>`\n display: flex;\n flex: 1;\n flex-direction: column;\n\n line-height: ${token('card-font-height')};\n\n ${({ flagged }) =>\n flagged &&\n css`\n ${CardSeparator} {\n margin-left: calc(-1 * ${token('space-s')});\n }\n `}\n`\n\nconst Flag = styled.span<{ status: Status }>`\n display: block;\n flex: 0 0 ${token('card-flag-width')};\n\n background: ${conditional({\n 'card-flag-background-neutral': whenProps({ status: Status.Neutral }),\n 'card-flag-background-danger': whenProps({ status: Status.Danger }),\n 'card-flag-background-warning': whenProps({ status: Status.Warn }),\n 'card-flag-background-success': whenProps({ status: Status.Success }),\n })};\n border-radius: ${token('card-border-radius')} 0 0 ${token('card-border-radius')};\n`\n\nfunction Card({\n flagged = false,\n status = Status.Neutral,\n children,\n ...others\n}: CardProps): JSX.Element {\n return (\n <Wrapper {...others}>\n {flagged && <Flag status={status} aria-label={status} />}\n <Container flagged={flagged}>{children}</Container>\n </Wrapper>\n )\n}\n\nCard.Title = CardTitle\nCard.Subtitle = CardSubtitle\nCard.Separator = CardSeparator\nCard.Body = CardBody\n\nexport default Card\n","import { createContext } from 'react'\nimport type { DropdownContextReturn } from './Dropdown.types'\n\nconst DropdownContext = createContext<DropdownContextReturn>({\n disabled: false,\n expandDisabled: false,\n expanded: false,\n toggle: function () {\n // nothing\n },\n})\n\nexport default DropdownContext\n","import React, { forwardRef, useContext } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Popover } from 'components/Popover'\nimport disableable from 'styles/disableable'\nimport DropdownContext from './Dropdown.context'\nimport focusable from 'styles/focusable'\nimport font from 'styles/font'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport useID from 'hooks/useID'\n\nimport type {\n DropdownMenuItemProps,\n DropdownMenuProps,\n DropdownMenuSectionProps,\n} from './Dropdown.types'\n\n/**\n * TODO: add aria-labelledby that should refer to the dropdown label to the role=\"menu\" container.\n * TODO: navigate through items using arrow keys.\n * TODO: add animation for a smooth open/close effect.\n */\n\nconst StyledPopover = styled(Popover.Floating)`\n z-index: ${token('z-index-droplist')};\n\n min-width: 10em;\n\n background: ${token('dropdown-background')};\n border: 1px solid ${token('dropdown-border-color')};\n border-radius: ${token('dropdown-border-radius')};\n box-shadow: ${token('dropdown-shadow')};\n width: max-content;\n`\n\nconst StyledSpan = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n font-size: 1em;\n`\n\nconst Leading = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Trailing = styled(StyledSpan)`\n /* placeholder */\n`\n\nconst Children = styled.span`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n padding: ${token('space-s')} 0;\n\n white-space: nowrap;\n`\n\nconst DropdownItemWrapper = styled.button`\n ${transition()}\n\n display: inline-flex;\n justify-content: flex-start;\n align-items: center;\n\n ${font({\n height: 'font-height-3',\n weight: 'font-weight-medium',\n })}\n font-size: ${token('font-size-4')};\n\n min-height: 36px;\n flex: 1 0;\n\n border: none;\n border-radius: ${token('border-radius-s')};\n background: ${token('color-neutral-white')};\n\n color: ${token('color-neutral-darker')};\n\n padding: 0 ${token('space-s')};\n\n margin: 0 ${token('space-s')};\n\n cursor: pointer;\n\n ${hoverable`\n background: ${token('color-neutral-lighter')};\n `}\n\n ${focusable`\n background: ${token('color-neutral-lighter')};\n `}\n\n ${disableable()}\n\n ${Children} {\n flex: 1 0 auto;\n\n text-align: left;\n }\n\n ${Leading}, ${Trailing} {\n flex: 0 1 auto;\n }\n\n ${Leading} + ${Children} {\n margin: 0 0 0 ${token('space-s')};\n }\n\n ${Children} + ${Trailing} {\n margin: 0 0 0 ${token('space-s')};\n }\n`\n\nconst DropdownSectionHeader = styled.strong`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n ${font({\n height: 'font-height-3',\n weight: 'font-weight-bold',\n })}\n\n font-size: ${token('font-size-4')};\n\n margin: 0 ${token('space-s')};\n`\n\nconst DropdownSectionWrapper = styled.div`\n display: flex;\n flex-direction: column;\n`\n\nconst GenericDropdownMenuWrapper = styled.div`\n display: flex;\n flex-direction: column;\n padding: ${token('space-s')} 0;\n\n ${font({\n height: 'font-height-3',\n weight: 'font-weight-medium',\n })}\n\n font-size: ${token('font-size-4')};\n`\n\nconst DropdownMenuWrapper = styled(GenericDropdownMenuWrapper)`\n max-height: 240px;\n overflow-y: auto;\n max-width: 100%;\n width: 100%;\n\n ${DropdownItemWrapper} + ${DropdownItemWrapper},\n ${DropdownSectionHeader} + ${DropdownItemWrapper} {\n margin-top: ${token('space-2xs')};\n }\n\n ${DropdownSectionWrapper} + ${DropdownSectionWrapper} {\n margin: ${token('space-m')} 0 0 0;\n }\n\n ${GenericDropdownMenuWrapper} + &,\n & + ${GenericDropdownMenuWrapper},\n ${GenericDropdownMenuWrapper} + ${GenericDropdownMenuWrapper} {\n border-top: 2px solid ${token('color-neutral-lighter')};\n }\n`\n\nexport const DropdownSeparator = styled.hr.attrs({\n 'aria-hidden': true,\n})`\n display: block;\n height: 2px;\n\n margin: ${token('space-s')} 0;\n\n border: 0;\n border-bottom: 2px solid ${token('card-separator-background')};\n`\n\nexport const DropdownMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(function DropdownMenu(\n props: DropdownMenuProps,\n ref\n): JSX.Element | null {\n const context = useContext(DropdownContext)\n\n if (!context) {\n throw new Error('DropdownMenu must be inside a DropdownContext')\n }\n\n const { children, header, footer, ...others } = props\n const { expanded } = context\n\n if (!expanded) {\n return null\n }\n\n return (\n <StyledPopover role=\"presentation\">\n {header && <GenericDropdownMenuWrapper>{header}</GenericDropdownMenuWrapper>}\n {children && (\n <DropdownMenuWrapper ref={ref} role=\"menu\" data-testid=\"dropdown-menu\" {...others}>\n {children}\n </DropdownMenuWrapper>\n )}\n {footer && <GenericDropdownMenuWrapper>{footer}</GenericDropdownMenuWrapper>}\n </StyledPopover>\n )\n})\n\nexport function DropdownMenuItem(props: DropdownMenuItemProps): JSX.Element {\n const context = useContext(DropdownContext)\n const { leading, children, trailing, onClick, ...others } = props\n const id = useID(others.id)\n\n if (!context) {\n throw new Error('DropdownMenuItem must be inside a DropdownContext')\n }\n\n const { toggle } = context\n\n return (\n <DropdownItemWrapper\n role=\"menuitem\"\n type=\"button\"\n data-testid=\"dropdown-menu-item\"\n {...others}\n aria-labelledby={id}\n onClick={(e) => {\n e.persist()\n\n const shouldKeepOpen = onClick?.(e)\n\n if (!shouldKeepOpen) {\n toggle()\n }\n }}\n >\n {leading && <Leading>{leading}</Leading>}\n <Children id={id}>{children}</Children>\n {trailing && <Trailing>{trailing}</Trailing>}\n </DropdownItemWrapper>\n )\n}\n\nexport function DropdownMenuSection(props: DropdownMenuSectionProps): JSX.Element {\n const { children, header, ...others } = props\n\n return (\n <DropdownSectionWrapper data-testid=\"dropdown-menu-section\" {...others} role=\"presentation\">\n <DropdownSectionHeader>{header}</DropdownSectionHeader>\n {children}\n </DropdownSectionWrapper>\n )\n}\n","import toArray from './toArray'\n\nimport type { KeyboardEvent } from 'react'\n\n// this is merely a helper for key code names\nconst SUPPORTED_KEYS = {\n ALT: 'Alt',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_UP: 'ArrowUp',\n CONTROL: 'Control',\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n SHIFT: 'Shift',\n SPACE: ' ',\n TAB: 'Tab',\n E_LOWERCASE: 'e',\n DOT: '.',\n PLUS: '+',\n MINUS: '-',\n}\n\nexport type SupportedKey = keyof typeof SUPPORTED_KEYS\n\n// Based on https://github.com/downshift-js/downshift/blob/26c93a539dad09e41adba69ddc3a7d7ecccfc8bb/src/utils.js#L285\nexport function getKeyboardKey(e: KeyboardEvent): KeyboardEvent['key'] {\n // IE\n if (e.keyCode >= 37 && e.keyCode <= 40 && e.key.indexOf('Arrow') !== 0) {\n return `Arrow${e.key}`\n }\n\n return e.key\n}\n\nfunction KeyboardKey(e: KeyboardEvent): {\n is(otherKeys: SupportedKey | SupportedKey[]): boolean\n} {\n const key = getKeyboardKey(e)\n\n return {\n is(otherKeys: SupportedKey | SupportedKey[]) {\n const expectedKeys = toArray(otherKeys).map((otherKey) => SUPPORTED_KEYS[otherKey])\n\n return toArray(expectedKeys).includes(key)\n },\n }\n}\n\nexport default KeyboardKey\n","import React, { useCallback, useEffect, useState } from 'react'\n\nimport KeyboardKey from 'utils/toolset/keyboard'\n\nimport type { RefObject } from 'react'\n\nfunction useClickOutside<T extends HTMLElement>(\n container: RefObject<T>,\n callback: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void,\n disabled = false\n): void {\n const [active, setActive] = useState(false)\n\n const getContainer = useCallback(\n function getContainer() {\n return container.current\n },\n [container]\n )\n\n const handleEvent = useCallback(\n function handleEvent(event: MouseEvent | TouchEvent | KeyboardEvent) {\n function hasPressedEsc() {\n return KeyboardKey(event as unknown as React.KeyboardEvent).is('ESCAPE')\n }\n\n if (!getContainer() || disabled) {\n return\n }\n\n const target = event.target as Node\n const hasTarget = getContainer()?.contains(target)\n\n if (!active && hasTarget) {\n setActive(true)\n } else if (active && (!hasTarget || hasPressedEsc())) {\n setActive(false)\n callback(event)\n }\n },\n [active, callback, disabled, getContainer]\n )\n\n useEffect(() => {\n function subscribe() {\n document.addEventListener('mousedown', handleEvent, true)\n document.addEventListener('touchend', handleEvent, true)\n document.addEventListener('keyup', handleEvent)\n }\n\n function unsubscribe() {\n document.removeEventListener('mousedown', handleEvent, true)\n document.removeEventListener('touchend', handleEvent, true)\n document.removeEventListener('keyup', handleEvent)\n }\n\n subscribe()\n\n return () => {\n unsubscribe()\n }\n }, [handleEvent])\n}\n\nexport default useClickOutside\n","import React, { useContext } from 'react'\nimport clsx from 'clsx'\nimport styled, { css } from 'styled-components'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport { BaseButton, SelectorButton, ButtonProps } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Icon as DefaultIcon } from 'components/Icon'\nimport { useFocusWithin } from 'hooks/useFocusWithin'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport DropdownContext from './Dropdown.context'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport typography from 'styles/typography'\n\nimport type { ButtonHTMLAttributes, HTMLAttributes, MouseEvent } from 'react'\nimport type { DropdownTriggerProps, DropdownContextReturn } from './Dropdown.types'\nimport type { IconProps } from 'components/Icon'\nimport type ColorScheme from 'utils/types/ColorScheme'\nimport { Popover } from 'components/Popover'\n\n/**\n * TODO: throw an error if context is not available\n */\n\ntype DropdownTriggerWrapperProps = {\n disabled: boolean\n scheme: ColorScheme\n $outlined: boolean\n $scale: DropdownTriggerProps['scale']\n}\n\ntype TriggerButtonProps = ButtonProps & {\n outlined: boolean\n}\n\nconst dropdownExpandedStyle = css`\n &[aria-expanded='true'] {\n color: ${token('dropdown-trigger-expanded-color')};\n }\n`\n\nconst triggerButtonAttrs = (props: { outlined: boolean }) => {\n const outlined = typeof props.outlined === 'boolean' ? props.outlined : true\n if (outlined) {\n return props\n }\n\n return {\n ...props,\n variant: 'tertiary',\n }\n}\n\nconst TriggerButton = styled(\n SelectorButton as React.ForwardRefExoticComponent<TriggerButtonProps>\n).attrs(triggerButtonAttrs)`\n flex: 1;\n\n justify-content: flex-start;\n\n border: none;\n\n height: ${token('dropdown-trigger-height')};\n\n text-transform: ${conditional({\n capitalize: whenProps({ outlined: false, variant: 'tertiary' }),\n uppercase: whenProps({ outlined: true }),\n })};\n\n font-weight: ${conditional({\n 'font-weight-regular': whenProps({ outlined: false }),\n })};\n\n ${hoverable`\n border-color: ${conditional({\n 'color-transparent': whenProps({ outlined: false }),\n })};\n\n font-weight: ${conditional({\n 'font-weight-bold': whenProps({ outlined: false }),\n })};\n\n ${dropdownExpandedStyle}\n `}\n\n ${focusable`\n box-shadow: ${conditional({\n none: whenProps({ outlined: false }),\n })};\n\n background-color: ${conditional({\n 'color-transparent': whenProps({ outlined: false }),\n })};\n\n font-weight: ${conditional({\n 'font-weight-bold': whenProps({ outlined: false }),\n })};\n\n\n ${dropdownExpandedStyle}\n `}\n\n ${({ children, outlined }) => {\n if (outlined === false && typeof children === 'string') {\n return css`\n & > span:first-child {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n\n text-decoration: none;\n }\n\n & > span:first-child::after {\n height: 0;\n overflow: hidden;\n\n font-weight: ${token('font-weight-bold')};\n\n visibility: hidden;\n\n /* @REVIEW: since this is a span descendant of a button\n I'm using the direct value of children the solution inside Link\n relies on data-text attribute */\n\n content: '${children}';\n content: '${children}' / '';\n user-select: none;\n pointer-events: none;\n\n @media speech {\n display: none;\n }\n }\n `\n }\n }}\n`\n\nconst DropdownTriggerWrapper = styled.div<DropdownTriggerWrapperProps>`\n ${transition()}\n\n ${typography(\n conditional({\n 'button-md': whenProps({ $scale: 'default' }),\n 'button-sm': whenProps({ $scale: 'small' }),\n 'button-lg': whenProps({ $scale: 'large' }),\n })\n )}\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n border-radius: ${token('button-border-radius')};\n border-width: ${token('button-border-width')};\n border-style: solid;\n border-color: ${conditional({\n 'dropdown-trigger-border-color': whenProps({ scheme: 'light', $outlined: true }),\n 'dropdown-trigger-dark-border-color': whenProps({ scheme: 'dark', $outlined: true }),\n 'dropdown-trigger-outlined-border-color': whenProps({ $outlined: false }),\n })};\n\n font-size: ${token('font-size-4')};\n\n color: ${token('color-neutral-darker')};\n\n box-sizing: border-box;\n\n flex: 1;\n\n ${hoverable`\n border-color: ${conditional({\n 'button-secondary-border-color--hover': whenProps({ scheme: 'light', $outlined: true }),\n 'button-secondary-dark-border-color--hover': whenProps({\n scheme: 'dark',\n $outlined: true,\n }),\n })};\n `}\n\n ${disableable`\n border-color: ${conditional({\n 'button-secondary-border-color--disabled': whenProps({ scheme: 'light' }),\n 'button-secondary-dark-border-color--disabled': whenProps({\n scheme: 'dark',\n }),\n })};\n `}\n\n ${focusable`\n border-color: ${conditional({\n 'button-primary-border-color--focus': whenProps({ variant: 'primary', $outlined: true }),\n 'button-secondary-border-color--focus': whenProps({ scheme: 'light', $outlined: true }),\n 'button-secondary-dark-border-color--focus': whenProps({\n scheme: 'dark',\n $outlined: true,\n }),\n 'button-warning-border-color--focus': whenProps({ variant: 'warning', $outlined: true }),\n 'button-icon-border-color--focus': whenProps({ variant: 'icon', $outlined: true }),\n 'color-transparent': whenProps({ $outlined: false }),\n })};\n\n box-shadow: ${conditional({ 'dropdown-trigger-box-shadow': whenProps({ $outlined: true }) })};\n outline: ${token('dropdown-trigger-outline')};\n outline-offset: ${token('dropdown-trigger-outline-offset')};\n `}\n\n ${activatable`\n border-color: ${conditional({\n 'button-secondary-border-color--active': whenProps({ scheme: 'light', $outlined: true }),\n 'button-secondary-dark-border-color--active': whenProps({\n scheme: 'dark',\n $outlined: true,\n }),\n })};\n `}\n`\n\nconst TriggerHandle = styled(BaseButton)`\n ${focusable()}\n\n background: ${token('color-transparent')};\n border-radius: 0 ${token('border-radius-s')} ${token('border-radius-s')} 0;\n border: none;\n\n height: ${token('dropdown-trigger-height')};\n`\n\nconst RotatableIcon = styled(DefaultIcon)<{ $rotate: boolean }>`\n ${conditional({\n 'transform: rotate(180deg);': whenProps({ $rotate: true }),\n })}\n`\n\nexport interface DropdownTriggerButtonProps extends DropdownTriggerProps {\n children: DropdownTriggerProps['children'] | ((args: DropdownContextReturn) => React.ReactNode)\n}\n\nfunction Caret(props: Omit<IconProps, 'name'> & { $rotate: boolean }) {\n return <RotatableIcon size={20} {...props} name=\"chevron-down\" />\n}\n\nfunction DropdownTriggerButton(props: DropdownTriggerButtonProps): JSX.Element {\n const contextValue = useContext(DropdownContext)\n const { toggle, disabled, expanded } = contextValue\n const { children, onClick, ...others } = props\n\n function handleClick(e: MouseEvent<HTMLButtonElement>) {\n e.persist()\n\n toggle()\n onClick?.(e)\n }\n\n function renderChildren() {\n if (isFunction(children)) {\n return children(contextValue)\n }\n\n return children\n }\n\n // TODO: add aria-labelledby that should refer to the button and the dropdown label\n return (\n <TriggerButton\n trailing={<Caret $rotate={expanded} />}\n onClick={handleClick}\n {...others}\n type=\"button\"\n aria-haspopup=\"true\"\n aria-expanded={expanded}\n aria-disabled={disabled}\n disabled={disabled}\n >\n {renderChildren()}\n </TriggerButton>\n )\n}\n\nfunction DropdownTriggerHandle(props: ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element {\n const { toggle, expanded, disabled, expandDisabled } = useContext(DropdownContext)\n const { onClick, ...others } = props\n\n function handleClick(e: MouseEvent<HTMLButtonElement>) {\n e.persist()\n\n toggle()\n onClick?.(e)\n }\n\n return (\n <TriggerHandle\n onClick={handleClick}\n data-testid=\"dropdown-trigger-handle\"\n {...others}\n disabled={disabled || expandDisabled}\n type=\"button\"\n tabIndex={-1}\n >\n <Caret $rotate={expanded} />\n </TriggerHandle>\n )\n}\n\nexport interface GenericDropdownTriggerProps extends HTMLAttributes<HTMLDivElement> {\n disabled?: boolean\n scheme?: ColorScheme\n outlined?: boolean\n scale?: DropdownTriggerProps['scale']\n}\n\nexport function GenericDropdownTrigger(props: GenericDropdownTriggerProps): JSX.Element {\n const context = useContext(DropdownContext)\n const { ref, focused } = useFocusWithin<HTMLDivElement>()\n\n if (!context) {\n throw new Error('DropdownTrigger must be inside a DropdownContext')\n }\n\n const { children, className, scheme = 'light', outlined = true, scale, ...others } = props\n const { disabled } = context\n\n return (\n <DropdownTriggerWrapper\n role=\"presentation\"\n {...others}\n ref={ref}\n className={clsx(\n {\n 'is-disabled': disabled,\n 'is-focused': focused,\n },\n className\n )}\n disabled={disabled}\n scheme={scheme}\n $scale={scale}\n $outlined={outlined}\n >\n {children}\n </DropdownTriggerWrapper>\n )\n}\n\nfunction DropdownTrigger(props: DropdownTriggerProps): JSX.Element {\n const { children, className, ...others } = props\n\n return (\n <Popover.Reference>\n <GenericDropdownTrigger className={className} outlined={props.outlined} scale={props.scale}>\n <DropdownTriggerButton {...others} data-text={children}>\n {children}\n </DropdownTriggerButton>\n </GenericDropdownTrigger>\n </Popover.Reference>\n )\n}\n\nDropdownTrigger.Button = DropdownTriggerButton\nDropdownTrigger.Handle = DropdownTriggerHandle\n\nexport default DropdownTrigger\n","import { useCallback, useEffect, useState } from 'react'\n\nimport type { DropdownProps } from './Dropdown.types'\n\nexport interface useDropdownProps {\n expanded: boolean\n toggle: () => void\n}\n\nexport interface GenericDropdownProps extends DropdownProps, useDropdownProps {}\n\nfunction useDropdown({ disabled, expandDisabled }: DropdownProps): {\n expanded: boolean\n toggle: () => void\n expand: () => void\n collapse: () => void\n} {\n const [expanded, setExpanded] = useState(false)\n\n const toggle = useCallback(\n function toggle() {\n if (disabled || expandDisabled) {\n return\n }\n\n setExpanded((isExpanded) => !isExpanded)\n },\n [disabled, expandDisabled]\n )\n\n const expand = useCallback(\n function toggle() {\n if (disabled || expandDisabled) {\n return\n }\n\n setExpanded(true)\n },\n [disabled, expandDisabled]\n )\n\n const collapse = useCallback(\n function toggle() {\n if (disabled || expandDisabled) {\n return\n }\n\n setExpanded(false)\n },\n [disabled, expandDisabled]\n )\n\n useEffect(\n function closeWhenDisabled() {\n if ((disabled || expandDisabled) && expanded) {\n setExpanded(false)\n }\n },\n [disabled, expandDisabled, expanded]\n )\n\n return { expanded, toggle, expand, collapse }\n}\n\nexport default useDropdown\n","import React, { useMemo, useRef } from 'react'\nimport styled from 'styled-components'\n\nimport {\n DropdownMenu,\n DropdownMenuItem,\n DropdownMenuSection,\n DropdownSeparator,\n} from './DropdownMenu'\nimport { useClickOutside } from 'hooks/useClickOutside'\nimport DropdownContext from './Dropdown.context'\nimport DropdownTrigger from './DropdownTrigger'\nimport hidden from 'styles/hidden'\nimport useDropdown from './useDropdown'\nimport { Popover } from 'components/Popover'\n\nimport type { DropdownProps, GenericDropdownProps, DropdownMenuProps } from './Dropdown.types'\nimport type { PopoverAlign } from 'components/Popover'\n\nconst DropdownWrapper = styled.div`\n position: relative;\n`\n\nconst HiddenCloseButton = styled.button.attrs({\n type: 'button',\n tabIndex: -1,\n})`\n ${hidden(true)}\n`\n\nfunction useDeprecatedAlignFromMenu({\n children,\n align,\n}: React.PropsWithChildren<{ align?: PopoverAlign }>): PopoverAlign {\n let result: PopoverAlign | undefined\n\n if (align) {\n return align\n }\n\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<DropdownMenuProps>(child) && child.type === DropdownMenu) {\n result = child.props.align\n }\n })\n\n return (result || align) as PopoverAlign\n}\n\n// TODO: add focus trap here to allow navigating options with keyboard\n\n/**\n * Generic dropdown component that allows composing its pieces as desired.\n *\n * Based on:\n * - https://www.w3.org/TR/2017/REC-wai-aria-1.1-20171214/#menu\n * - https://www.w3.org/WAI/tutorials/menus/application-menus/\n *\n * @param props\n * @returns\n */\nexport function GenericDropdown(props: GenericDropdownProps): JSX.Element {\n const {\n children,\n expanded,\n toggle,\n disabled = false,\n expandDisabled = false,\n onBlur,\n position,\n ...others\n } = props\n const contextValue = useMemo(\n () => ({ expanded, toggle, disabled, expandDisabled }),\n [expanded, toggle, disabled, expandDisabled]\n )\n const ref = useRef(null)\n\n const align = useDeprecatedAlignFromMenu(props)\n\n useClickOutside(\n ref,\n function handleClickOutside(event?: MouseEvent | TouchEvent | KeyboardEvent) {\n onBlur?.(event)\n\n if (!expanded) {\n return\n }\n\n toggle()\n }\n )\n\n return (\n <DropdownWrapper {...others} role=\"menubar\" ref={ref}>\n <DropdownContext.Provider value={contextValue}>\n <HiddenCloseButton disabled={disabled} onClick={toggle}>\n Close\n </HiddenCloseButton>\n <Popover strategy=\"fixed\" position={position} align={align}>\n {children}\n </Popover>\n </DropdownContext.Provider>\n </DropdownWrapper>\n )\n}\n\n/**\n * @example\n <Dropdown>\n <Dropdown.Trigger>Download</Dropdown.Trigger>\n <Dropdown.Menu\n header={<p className=\"px-2\">Header</p>}\n footer={<p className=\"px-2\">A cool footer</p>}\n >\n {[{label: 'Hello', value: 'hi'}, { label: 'World', value: 'planet' }].map(({ label, value }) => (\n <Dropdown.Item\n key={value}\n onClick={() => {\n setMessage(label)\n }}\n >\n {label}\n </Dropdown.Item>\n ))}\n </Dropdown.Menu>\n </Dropdown>\n */\nfunction Dropdown(props: DropdownProps): JSX.Element {\n const dropdownProps = useDropdown(props)\n\n return <GenericDropdown {...props} {...dropdownProps} />\n}\n\nDropdown.Trigger = DropdownTrigger\nDropdown.Menu = DropdownMenu\nDropdown.Section = DropdownMenuSection\nDropdown.Item = DropdownMenuItem\nDropdown.Separator = DropdownSeparator\n\nexport default Dropdown\n","import { createContext } from 'react'\nimport { createSelectable } from 'hooks/useSelectable'\n\nimport type { Option, useSelectReturn } from './Select.types'\n\nconst { SelectableContext, useSelectable } = createSelectable<Option>()\n\nexport { SelectableContext, useSelectable }\n\nconst SelectContext = createContext<useSelectReturn | null>(null)\nexport { SelectContext }\n","/**\n * Helper that returns the plural form if count is different than 1, otherwise the singular one.\n * @example\n * let total = 3\n * `Item${pluralize(total)}` // \"Items\"\n * `Child${pluralize(total, 'ren')}` // \"Children\"\n * `Pe${pluralize(total, 'ople', 'rson')}` // \"People\"\n * `${pluralize(total, 'People', 'Person')}` // \"People\"\n * @param count - total of items\n * @param plural - defaults to \"s\"\n * @param singular - defaults to \"\"\n * @returns plural or singular.\n */\nexport default function pluralize(count: number, plural = 's', singular = ''): string {\n return count !== 1 ? plural : singular\n}\n","import React, { useContext, forwardRef } from 'react'\nimport styled from 'styled-components'\n\nimport { DropdownContext, DropdownTrigger, GenericDropdownTrigger } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { TextField, Trailing } from 'components/TextField'\nimport focusable from 'styles/focusable'\n\nimport type { SelectTriggerProps } from './Select.types'\nimport { isFunction } from '@loadsmart/utils-function'\nimport { usePopover } from 'components/Popover'\n\nconst GenericSelectTrigger = styled(GenericDropdownTrigger)`\n background: ${token('color-neutral-white')};\n`\n\nconst SelectTriggerSearchField = styled(TextField)`\n ${focusable`\n box-shadow: none;\n `}\n\n background-color: transparent;\n\n border: none;\n border-radius: ${token('border-radius-s')} 0 0 ${token('border-radius-s')};\n\n height: ${token('select-trigger-height')};\n\n flex: 1;\n\n ${Trailing} {\n margin: 0 ${token('space-xs')} 0 0;\n }\n`\n\nconst Separator = styled.span`\n height: 100%;\n\n margin: 0;\n\n border-right-color: ${token('color-neutral-light')};\n border-right-width: 1px;\n border-right-style: solid;\n`\n\nconst SelectTrigger = forwardRef<HTMLInputElement, SelectTriggerProps>(function SelectTrigger(\n props: SelectTriggerProps,\n ref\n) {\n const { className, ...others } = props\n const { disabled, expanded, toggle } = useContext(DropdownContext)\n\n const { register } = usePopover()\n\n function handleClick() {\n if (!expanded) {\n toggle()\n }\n }\n\n return (\n <GenericSelectTrigger className={className}>\n <SelectTriggerSearchField\n {...others}\n data-testid=\"select-trigger-search-field\"\n ref={(node) => {\n if (isFunction(ref)) {\n ref(node)\n }\n\n register.setReference(node)\n }}\n type=\"search\"\n disabled={disabled}\n onClick={handleClick}\n />\n <Separator />\n <DropdownTrigger.Handle data-testid=\"select-trigger-handle\" />\n </GenericSelectTrigger>\n )\n})\n\nexport default SelectTrigger\n","import React, { useCallback, useEffect, useRef, useState } from 'react'\n\nimport KeyboardKey, { getKeyboardKey } from 'utils/toolset/keyboard'\nimport isEmpty from 'utils/toolset/isEmpty'\n\nimport type { SupportedKey } from 'utils/toolset/keyboard'\n\nexport interface useFocusTrapProps {\n onActivate?: () => void\n onDeactivate?: () => void\n keys?: SupportedKey[]\n}\n\nfunction getFocusedIndexAfterKeyPress(\n e: React.KeyboardEvent,\n currentFocused: number,\n focusableCounter: number\n): number {\n const keyHandler: Record<React.KeyboardEvent['key'], (e: React.KeyboardEvent) => number> = {\n Tab(e: React.KeyboardEvent): number {\n return e.shiftKey ? -1 : 1\n },\n ArrowUp() {\n return -1\n },\n ArrowDown() {\n return 1\n },\n }\n\n function unknownKey() {\n return 0\n }\n\n const key = getKeyboardKey(e)\n const increment = (keyHandler[key] || unknownKey)(e)\n\n if (currentFocused === -1 && increment === -1) {\n /**\n * Prevent to skip one element when the initial increment is -1\n * and `currentFocused` is -1, we don't .\n * e.g.: focus has just been activated and user presses arrow up.\n */\n return (increment + focusableCounter) % focusableCounter\n }\n\n return (currentFocused + increment + focusableCounter) % focusableCounter\n}\n\nfunction getTabbableDescendants<T extends HTMLElement>(container: T | null) {\n if (container == null) {\n return []\n }\n\n // TODO: add support for other focusable elements\n return Array.from(container.querySelectorAll('button') || [])\n}\n\n/**\n * Custom hook that limits the focusable elements within a container, when activated.\n *\n * Based on https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets.\n *\n * @param {useFocusTrapProps} props\n * @param {RefObject} props.containerRef - Ref to the container that will be the boundary for the focus trap.\n * @param {() => void} props.onActivate - Called when the focus trap is activated.\n * @param {() => void} props.onDeactivate - Called when the focus trap is deactivated.\n * @param {(KeyboardEvent['key'])[]} props.keys - Keys that will move the focus inside\n * the container (The current implementation only track focus for button elements). We current\n * support `Tab`, `ArrowUp`, and `ArrowDown` keys. If not provided, only the `Tab` key will be used.\n * @returns {Object}\n */\nfunction useFocusTrap<T extends HTMLElement>(\n props: useFocusTrapProps\n): {\n containerRef: (container: T | null) => void\n active: boolean\n activate: () => void\n deactivate: () => void\n} {\n const { keys, onActivate, onDeactivate } = props\n\n const [active, setActive] = useState(false)\n const [currentFocused, setCurrentFocused] = useState(-1)\n const mutationObserverRef = useRef<MutationObserver>()\n const [focusableDescendants, setFocusableDescendants] = useState<HTMLElement[]>([])\n\n function subscribeToDOMMutationEvents(container: HTMLElement) {\n mutationObserverRef.current = new MutationObserver(function () {\n setFocusableDescendants(getTabbableDescendants(container))\n })\n\n mutationObserverRef.current.observe(container, { childList: true })\n }\n\n function unsubscribeToDOMMutationEvents() {\n setCurrentFocused(-1)\n if (mutationObserverRef.current) {\n mutationObserverRef.current?.disconnect()\n }\n }\n\n const containerRef = useCallback(function initialize(container: HTMLElement | null) {\n if (container != null) {\n setFocusableDescendants(getTabbableDescendants(container))\n subscribeToDOMMutationEvents(container)\n } else {\n unsubscribeToDOMMutationEvents()\n }\n }, [])\n\n useEffect(function onMount() {\n return function onUnmount() {\n unsubscribeToDOMMutationEvents()\n }\n }, [])\n\n useEffect(\n function subscribeToKeyEvents() {\n function handleKeyDownEvent(evt: KeyboardEvent) {\n /**\n * Brace yourselves for the nasty casting from globalThis.KeyboardEvent, which is\n * the type used in the `addEventListener` callback, to React.KeyboardEvent ¯\\_(ツ)_/¯\n */\n const e = evt as unknown as React.KeyboardEvent\n\n const supportedKeys = [...(keys || ['TAB'])]\n\n if (!KeyboardKey(e).is(supportedKeys) || isEmpty(focusableDescendants)) {\n return\n }\n\n e.preventDefault()\n\n const newCurrentFocused = getFocusedIndexAfterKeyPress(\n e,\n currentFocused,\n focusableDescendants.length\n )\n setCurrentFocused(newCurrentFocused)\n focusableDescendants[newCurrentFocused].focus()\n }\n\n function subscribe() {\n document.addEventListener('keydown', handleKeyDownEvent)\n }\n\n function unsubscribe() {\n document.removeEventListener('keydown', handleKeyDownEvent)\n }\n\n if (active) {\n subscribe()\n }\n\n return function unsubscribeToKeyEvents() {\n unsubscribe()\n }\n },\n [active, keys, currentFocused, focusableDescendants]\n )\n\n const activate = useCallback(\n function activate() {\n setActive(true)\n onActivate?.()\n },\n [onActivate]\n )\n\n const deactivate = useCallback(\n function deactivate() {\n setActive(false)\n onDeactivate?.()\n },\n [onDeactivate]\n )\n\n return {\n containerRef,\n active,\n activate,\n deactivate,\n }\n}\n\nexport default useFocusTrap\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { isObject } from '@loadsmart/utils-object'\nimport { isFunction } from '@loadsmart/utils-function'\n\ninterface Thenable {\n then(): any\n}\n\n// TODO: add this helper to @loadsmart/utils\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isThenable(object: any): object is Thenable {\n return isObject(object) && isFunction((object as Thenable)['then'])\n}\n","import get from 'utils/toolset/get'\n\nimport type { SelectAdapter } from './Select.types'\n\nexport const GenericAdapter: SelectAdapter<unknown> = {\n getKey(o): string {\n return get(o, 'value')!\n },\n getLabel(o): string {\n return get(o, 'label')!\n },\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { GenericAdapter } from './Select.constants'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport toArray from 'utils/toolset/toArray'\n\nimport type { SelectAdapter, SelectValue, Option, Adapters, SelectProps } from './Select.types'\n\nexport function getAdapter(adapters: Adapters, type?: string): SelectAdapter<any> {\n if (type == null) {\n return GenericAdapter\n }\n\n return adapters[type] || GenericAdapter\n}\n\nexport function getValue(selection: SelectValue, multiple?: boolean): Option | Option[] | null {\n const pairs = Array.from(selection)\n\n if (isEmpty(pairs)) {\n return null\n }\n\n if (multiple) {\n const options = []\n for (const [, option] of pairs) {\n options.push(option)\n }\n\n return options\n } else {\n const [[, option]] = pairs\n return option\n }\n}\n\nexport function toSelection(value: SelectProps['value']): Option[] {\n const safeValue = toArray(value || [])\n\n return safeValue.filter((option) => !isEmpty(option))\n}\n\nexport function getDisplayValue(\n adapters: Adapters,\n selection: SelectValue,\n multiple?: boolean\n): string {\n if (selection.size == 0) {\n return ''\n }\n\n if (multiple) {\n return ''\n } else {\n const value = getValue(selection, multiple)\n const adapter = getAdapter(adapters, (value as Option)._type)\n return adapter.getLabel(value) ?? ''\n }\n}\n\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping\nexport function escapeRegExp(value: string): string {\n return String(value || '').replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isFunction } from '@loadsmart/utils-function'\nimport { isNil } from '@loadsmart/utils-object'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport isEmpty from 'utils/toolset/isEmpty'\nimport { useDropdown } from 'components/Dropdown'\nimport { useDidMount } from 'hooks/useDidMount'\nimport { useFocusTrap } from 'hooks/useFocusTrap'\nimport type { SelectableKeyType } from 'hooks/useSelectable'\nimport to from 'utils/toolset/awaitTo'\nimport { isThenable } from 'utils/toolset/isThenable'\nimport toArray from 'utils/toolset/toArray'\nimport { GenericAdapter } from './Select.constants'\nimport { useSelectable } from './Select.context'\nimport {\n escapeRegExp,\n getAdapter,\n getDisplayValue,\n getValue,\n toSelection,\n} from './useSelect.helpers'\n\nimport type { ChangeEvent, FocusEvent } from 'react'\nimport type {\n Adapters,\n GenericOption,\n Option,\n SelectDatasource,\n SelectDatasourceFunction,\n SelectProps,\n SelectStatus,\n SelectValue,\n useSelectReturn,\n} from './Select.types'\n\nasync function getData(datasources: SelectDatasource<any>[], query: string) {\n const regex = new RegExp(escapeRegExp(query), 'i')\n\n const promises = []\n const types: string[] = []\n\n for (const ds of datasources) {\n promises.push(Promise.resolve(ds.fetch({ query, regex })))\n types.push(ds.type)\n }\n\n // We use Promise.allSettled here because Promise.all rejects as soon as one promise fails\n // But we want to continue with the next datasource when one fails.\n const results = await Promise.allSettled(promises)\n\n let items: Option[] = []\n\n results.forEach((result, index) => {\n if (result.status === 'rejected') {\n return\n }\n\n const type = types[index]\n\n items = items.concat(\n (result.value || []).map((item) => {\n return {\n ...item,\n _type: type,\n } as Option\n })\n )\n })\n\n return items\n}\n\nfunction getDatasources(props: SelectProps) {\n function getDatasourceFromOptions(\n options?: GenericOption[] | null\n ): SelectDatasourceFunction<any>[] {\n if (!options) {\n return []\n }\n\n return [\n function useGenericDatasource() {\n return {\n type: 'generic',\n adapter: GenericAdapter,\n fetch: function fetch({ regex }) {\n return options.filter(({ label }) => regex.test(label))\n },\n }\n },\n ]\n }\n\n let datasources: SelectDatasourceFunction<any>[] = []\n\n datasources = datasources.concat(props.datasources || [])\n datasources = datasources.concat(getDatasourceFromOptions(props.options))\n\n return datasources.map((ds) => ds())\n}\n\nfunction extractAdapters(datasources: SelectDatasource<any>[]) {\n return toArray(datasources).reduce((map, ds) => {\n return {\n ...map,\n [ds.type]: ds.adapter,\n }\n }, {})\n}\n\nfunction TriggerOnFocusHandler(e: FocusEvent<HTMLInputElement>) {\n e.target.select()\n}\n\nfunction mapOptions(items: Option[], adapters: Adapters) {\n const options = new Map<SelectableKeyType, Option>()\n\n items.forEach((item) => {\n const adapter = getAdapter(adapters, item._type)\n options.set(adapter.getKey(item), item)\n })\n\n return options\n}\n\nfunction useOptions<T = any>(props: { datasources: SelectDatasource<T>[]; adapters: Adapters }) {\n const { datasources, adapters } = props\n const [options, setOptions] = useState(new Map<SelectableKeyType, Option>())\n const [status, setStatus] = useState<SelectStatus>('idle')\n\n const timeoutRef = useRef<NodeJS.Timeout>()\n\n function cancelPendingFetch() {\n if (timeoutRef.current != null) {\n clearTimeout(timeoutRef.current)\n }\n }\n\n const fetchAfterTimeout = useCallback(\n function fetchAfterTimeout(query: string) {\n cancelPendingFetch()\n /**\n * The `pending-query` status represents that the 'fetching' has been started\n * but it has been debounced and the internal fetch has not yet been called.\n * This is important because at this point the status is not idle\n * as the fetching has already started.\n */\n setStatus('pending-query')\n\n async function fetch() {\n setOptions(new Map<SelectableKeyType, Option>())\n setStatus('querying')\n\n const items = await getData(datasources, query)\n\n setOptions(mapOptions(items, adapters))\n setStatus('queried')\n }\n\n timeoutRef.current = setTimeout(() => void fetch(), 750)\n },\n [adapters, datasources]\n )\n\n const clear = useCallback(function clear() {\n setStatus('idle')\n setOptions(new Map<SelectableKeyType, Option>())\n }, [])\n\n const get = useCallback(\n function get() {\n return Array.from(options.values())\n },\n [options]\n )\n\n const reset = useCallback(\n function reset() {\n clear()\n fetchAfterTimeout('')\n },\n [clear, fetchAfterTimeout]\n )\n\n const getOptionByKey = useCallback(\n function getOptionByKey(key: SelectableKeyType) {\n return options.get(key)\n },\n [options]\n )\n\n useEffect(() => {\n return () => {\n cancelPendingFetch()\n }\n }, [])\n\n return {\n get,\n fetch: fetchAfterTimeout,\n clear,\n status,\n getOptionByKey,\n reset,\n }\n}\n\n// TODO: keep adapter resolution in a single place\n// TODO: prevent state changes after unmount (`useMounted` hook from Alice Frontend)\n/**\n * Based on https://www.w3.org/TR/wai-aria-practices-1.1/examples/combobox/aria1.1pattern/listbox-combo.html\n * @param props\n * @returns\n */\nfunction useSelect(props: SelectProps): useSelectReturn {\n const didMount = useDidMount()\n const {\n multiple,\n onQueryChange,\n onChange,\n onCreate,\n getInputProps,\n id,\n name,\n disabled = false,\n onBlur,\n isValidNewOption = (query: string) => Boolean(query),\n createOptionPosition = 'last',\n } = props\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const datasources = useMemo<SelectDatasource<any>[]>(\n () => getDatasources(props),\n [props.datasources, props.options]\n )\n const adapters = useMemo<Adapters>(() => extractAdapters(datasources), [datasources])\n\n const selectable = useSelectable({\n selected: toSelection(props.value),\n multiple,\n adapters,\n onChange: useCallback(\n function handleSelectionChange(selected: SelectValue) {\n onChange?.({ target: { id, name, value: getValue(selected, multiple) } })\n },\n [id, multiple, name, onChange]\n ),\n })\n\n const triggerRef = useRef<HTMLInputElement>()\n const focusTrap = useFocusTrap({\n keys: ['ARROW_UP', 'ARROW_DOWN'],\n onDeactivate() {\n triggerRef.current?.focus()\n },\n })\n\n const [queryTyped, setQueryTyped] = useState(false)\n const [query, setQuery] = useState<string>(\n getDisplayValue(adapters, selectable.selected, multiple)\n )\n const options = useOptions({ datasources, adapters })\n\n const expandDisabled = useMemo(\n () =>\n !query.length &&\n isEmpty(options.get()) &&\n isEmpty(selectable.selected) &&\n isFunction(isValidNewOption)\n ? !isValidNewOption(query)\n : !isValidNewOption,\n [query, options, selectable.selected, isValidNewOption]\n )\n\n const dropdown = useDropdown({ ...props, expandDisabled })\n\n useEffect(() => {\n if (queryTyped) {\n options.fetch(query)\n dropdown.expand()\n }\n }, [query, queryTyped])\n\n const getSelectableOption = useCallback(\n function getSelectableOption(option: Option) {\n const adapter = getAdapter(adapters, option._type)\n\n const value = adapter.getKey(option)\n const label = adapter.getLabel(option)\n const checked = selectable.selected.has(value)\n\n return { label, value, checked }\n },\n [adapters, selectable.selected]\n )\n\n const getOption = useCallback(\n function getOption(value: SelectableKeyType) {\n let option = options.getOptionByKey(value)\n\n if (!option) {\n option = selectable.selected.get(value)\n }\n\n return option\n },\n [options, selectable.selected]\n )\n\n const toggleOption = useCallback(\n function toggleOption(option: Option) {\n selectable.toggle(option)\n },\n [selectable]\n )\n\n const getDropdownProps = useCallback(\n function getDropdownProps() {\n return {\n toggle: dropdown.toggle,\n expanded: dropdown.expanded,\n onBlur(event?: MouseEvent | TouchEvent | KeyboardEvent) {\n setQueryTyped(false)\n\n if (!multiple) {\n setQuery(getDisplayValue(adapters, selectable.selected, multiple))\n } else {\n setQuery('')\n }\n options.reset()\n onBlur?.(event)\n },\n expandDisabled,\n }\n },\n [\n adapters,\n dropdown.expanded,\n dropdown.toggle,\n multiple,\n options,\n selectable.selected,\n onBlur,\n expandDisabled,\n ]\n )\n\n const getTriggerProps = useCallback(\n function getTriggerProps() {\n return {\n ...getInputProps?.(),\n id,\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n triggerRef.current = node\n }\n },\n value: query,\n onChange(e: ChangeEvent<HTMLInputElement>) {\n const sanitizedValue = e.target.value.replace(/\\s+/, '')\n\n setQueryTyped(sanitizedValue !== '')\n onQueryChange?.(e)\n setQuery(e.target.value)\n },\n onFocus: TriggerOnFocusHandler,\n }\n },\n [id, query, onQueryChange, dropdown, options, selectable.selected]\n )\n\n const getClearProps = useCallback(\n function getClearProps() {\n return {\n onClick() {\n setQueryTyped(false)\n setQuery('')\n selectable.clear()\n options.reset()\n triggerRef.current?.focus()\n },\n }\n },\n [options, selectable]\n )\n\n const getMenuProps = useCallback(\n function getMenuProps() {\n return {\n ref: focusTrap.containerRef,\n role: 'listbox',\n }\n },\n [focusTrap.containerRef]\n )\n\n const getOptionProps = useCallback(\n function getOptionProps({ option }: { option: Option }) {\n const { value, checked, label } = getSelectableOption(option)\n\n return {\n role: 'option',\n 'aria-selected': checked,\n id: String(value),\n onClick() {\n setQueryTyped(false)\n\n if (!multiple) {\n setQueryTyped(false)\n }\n toggleOption(option)\n\n return multiple\n },\n tabIndex: -1,\n }\n },\n [getSelectableOption, toggleOption, multiple]\n )\n\n const getCreatebleProps = useCallback(\n function getCreatebleProps() {\n return {\n onClick: function onClick() {\n async function asyncOnClick() {\n if (!isFunction(onCreate)) return\n\n const onCreateReturn = onCreate(query)\n\n let option\n if (onCreateReturn) {\n if (isThenable(onCreateReturn)) {\n option = await onCreateReturn\n } else {\n option = onCreateReturn\n }\n }\n\n options.fetch(query)\n\n if (option) {\n toggleOption(option)\n }\n }\n\n void asyncOnClick()\n\n return multiple\n },\n tabIndex: -1,\n }\n },\n [multiple, onCreate, query, options, toggleOption]\n )\n\n const isCreatable = useCallback(\n function isCreatable() {\n const findByLabel = (item: Option) =>\n getSelectableOption(item).label.toLocaleLowerCase() === query.toLocaleLowerCase()\n\n function isQueryEqualAnOption() {\n return !isNil(\n [...options.get(), ...Array.from(selectable.selected.values())].find(findByLabel)\n )\n }\n\n function getIsValidNewOption() {\n if (isFunction(isValidNewOption)) {\n return isValidNewOption(query) && !isQueryEqualAnOption()\n }\n\n return isValidNewOption\n }\n\n return isFunction(onCreate) && options.status === 'queried' && getIsValidNewOption()\n },\n [getSelectableOption, isValidNewOption, onCreate, options, query, selectable.selected]\n )\n\n useEffect(\n function onInit() {\n options.fetch('')\n },\n // we just want to load any initial options that a datasource may have available\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [datasources]\n )\n\n useEffect(\n function onDropdownToggle() {\n if (!props.autoFocus && !didMount) {\n return\n }\n if (dropdown.expanded) {\n focusTrap.activate()\n } else {\n focusTrap.deactivate()\n }\n },\n /**\n * We are interested in activating/deactivating our\n * focus trap when the dropdown changes its expanded state.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [dropdown.expanded]\n )\n\n useEffect(\n function updateOnSelectedChange() {\n if (!multiple) {\n setQuery(getDisplayValue(adapters, selectable.selected, multiple))\n }\n },\n [adapters, multiple, selectable.selected]\n )\n\n return {\n status: options.status,\n options: options.get(),\n value: getValue(selectable.selected, multiple),\n query,\n disabled,\n\n selectable,\n\n getMenuProps,\n getSelectableOption,\n getOption,\n getOptionProps,\n getTriggerProps,\n getClearProps,\n getDropdownProps,\n getCreatebleProps,\n isCreatable,\n createOptionPosition,\n }\n}\n\nexport default useSelect\n","import React from 'react'\n\n/**\n * A function that wraps a match into `mark` element to be highlighted.\n * @example\n *\n * @param {string} - label to be split\n * @param {string} - match to be found\n * @returns {ReactNode} - an element with marked match\n */\nexport default function highlightMatch(str: string, match: string): JSX.Element {\n if (str == null || match == null) {\n return <>{str}</>\n }\n\n // the explicit coercion here ensures that we'll be dealing with strings even in vanilla JS code\n const index = String(str).toLowerCase().indexOf(String(match).toLowerCase())\n\n if (index === -1) return <>{str}</>\n\n const pre = str.slice(0, index)\n const mid = str.slice(index, index + match.length)\n const post = str.slice(index + match.length)\n\n return (\n <>\n {pre}\n <mark>{mid}</mark>\n {post}\n </>\n )\n}\n","import React, { HTMLAttributes } from 'react'\nimport styled from 'styled-components'\nimport { getToken as token } from 'theming'\n\nimport highlightMatch from 'utils/toolset/highlightMatch'\n\nexport type HighlightMatchProps = {\n text: string\n match: string\n} & HTMLAttributes<HTMLSpanElement>\n\nconst HighlightMatchWrapper = styled.span`\n /* highlightMatch splits the label into separate HTML elements, thus we need\n to preserve white-spaces, otherwise the browser wouldn't render them. */\n white-space: pre;\n\n mark {\n color: inherit;\n font-weight: ${token('font-weight-bold')};\n\n background-color: ${token('color-transparent')};\n }\n`\n\nconst HighlightMatch = ({ text, match, ...props }: HighlightMatchProps): JSX.Element => {\n return <HighlightMatchWrapper {...props}>{highlightMatch(text, match)}</HighlightMatchWrapper>\n}\n\nexport default HighlightMatch\n","import React, { useContext } from 'react'\nimport styled from 'styled-components'\n\nimport { Checkbox } from 'components/Checkbox'\nimport { Dropdown } from 'components/Dropdown'\nimport { HighlightMatch } from 'components/HighlightMatch'\nimport { Icon as DefaultIcon } from 'components/Icon'\nimport { Group as DefaultGroup } from 'components/Layout'\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\n\nimport { SelectContext } from './Select.context'\n\nimport type { DropdownMenuItemProps } from 'components/Dropdown'\nimport type { SelectOptionProps } from './Select.types'\n\nconst Group = styled(DefaultGroup).attrs({\n as: 'span',\n})`\n /* placeholder */\n`\n\nconst Icon = styled(DefaultIcon)`\n color: ${token('select-selected-option-check-color')};\n`\n\nconst DefaultSelectOption = styled(Dropdown.Item)<DropdownMenuItemProps>`\n background: ${conditional({\n 'select-selected-option-background-color': whenProps({ 'aria-selected': true }),\n 'color-neutral-white': whenProps({ 'aria-selected': false }),\n })};\n`\n\nfunction SelectOption({\n children,\n value,\n leading,\n trailing,\n ...rest\n}: SelectOptionProps): JSX.Element {\n const select =\n useContext(SelectContext) ||\n (() => {\n throw new Error('Options should be wrapped in a SelectContext')\n })()\n\n const type = select.selectable.type()\n const option = select.getOption(value) || {}\n const { checked, label } = select.getSelectableOption(option)\n\n function renderContent() {\n if (children) return children\n if (checked && type === 'multiple') return label\n\n return <HighlightMatch text={label} match={select.query} />\n }\n\n return (\n <DefaultSelectOption\n {...rest}\n {...select.getOptionProps({ option })}\n leading={\n type === 'multiple' ? (\n <Group align=\"center\" space=\"s\">\n <Checkbox scale=\"small\" defaultChecked={checked} />\n {leading}\n </Group>\n ) : (\n leading\n )\n }\n trailing={type === 'single' ? checked ? <Icon name=\"check\" /> : null : trailing}\n >\n {renderContent()}\n </DefaultSelectOption>\n )\n}\n\nexport default SelectOption\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport type { SelectEmptyProps } from './Select.types'\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n\n box-sizing: border-box;\n margin: 0 ${token('space-s')};\n padding: ${token('space-s')};\n\n color: ${token('color-neutral')};\n\n font-size: 1em;\n line-height: ${token('font-height-3')};\n\n background: ${token('color-transparent')};\n`\n\nfunction SelectEmpty({ children, ...others }: SelectEmptyProps): JSX.Element {\n return <Wrapper {...others}>{children}</Wrapper>\n}\n\nexport default SelectEmpty\n","import React, { useContext } from 'react'\nimport { Dropdown } from 'components/Dropdown'\nimport { SelectContext } from './Select.context'\nimport type { SelectCreatableOptionProps } from './Select.types'\n\nfunction SelectCreatableOption({ children, ...rest }: SelectCreatableOptionProps): JSX.Element {\n const select =\n useContext(SelectContext) ||\n (() => {\n throw new Error('SelectCreatableOption should be wrapped in a SelectContext')\n })()\n\n return (\n <Dropdown.Item {...rest} {...select.getCreatebleProps()}>\n {children || `Add \"${select.query}\"`}\n </Dropdown.Item>\n )\n}\n\nexport default SelectCreatableOption\n","import type { Components, CreatableOptionType } from './Select.types'\nimport SelectCreatableOption from './SelectCreatableOption'\nimport SelectEmpty from './SelectEmpty'\nimport SelectOption from './SelectOption'\n\nconst defaultComponents = {\n Option: SelectOption,\n Empty: SelectEmpty,\n CreatableOption: SelectCreatableOption as CreatableOptionType,\n}\n\nexport function getComponents(components?: Components): Required<Components> {\n return { ...defaultComponents, ...components }\n}\n","import React, { Fragment, forwardRef } from 'react'\nimport styled from 'styled-components'\n\nimport { Dropdown, GenericDropdown } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { SelectableContext, SelectContext } from './Select.context'\nimport { Tag } from 'components/Tag'\nimport { Text } from 'components/Text'\nimport CloseButton from 'common/CloseButton'\nimport isEmpty from 'utils/toolset/isEmpty'\nimport omit from 'utils/toolset/omit'\nimport pluralize from 'utils/toolset/pluralize'\nimport SelectTrigger from './SelectTrigger'\nimport toArray from 'utils/toolset/toArray'\nimport useSelect from './useSelect'\nimport SelectOption from './SelectOption'\nimport SelectEmpty from './SelectEmpty'\nimport SelectCreatableOption from './SelectCreatableOption'\nimport { getComponents } from './components'\n\nimport type { DropdownMenuProps } from 'components/Dropdown'\nimport type {\n SelectProps,\n useSelectReturn,\n SelectStatus,\n Components,\n SelectableOption,\n} from './Select.types'\n\nconst OMITTED_PROPS = [\n 'id',\n 'name',\n 'datasources',\n 'onChange',\n 'onQueryChange',\n 'onCreate',\n 'options',\n 'value',\n]\n\nconst Loading = styled.span`\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n width: 2em;\n\n height: 2em;\n padding: ${token('space-xs')};\n\n font-size: ${token('font-size-3')};\n`\n\nfunction getCommonClearButtonProps() {\n return {\n 'data-testid': 'select-trigger-clear',\n }\n}\n\nconst SelectMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(function SelectMenu(\n props: DropdownMenuProps,\n ref\n): JSX.Element {\n return <Dropdown.Menu ref={ref} {...props} role=\"listbox\" />\n})\n\nfunction ClearMultiple({ select }: { select: useSelectReturn }) {\n const { onClick } = select.getClearProps()\n const total = toArray(select.value).length\n\n return (\n <div data-testid=\"select-trigger-clear-counter\">\n <Tag\n removable\n size=\"default\"\n variant=\"accent\"\n onRemove={onClick}\n title={`${total} selected option${pluralize(total)}`}\n getRemoveButtonProps={getCommonClearButtonProps}\n disabled={select.disabled}\n >\n {total}\n </Tag>\n </div>\n )\n}\n\nconst Divider = styled.hr`\n width: calc(100% - ${token('space-m')});\n height: 1px;\n margin: ${token('space-m')} ${token('space-s')};\n\n background-color: ${token('color-neutral-lighter')};\n border: 0;\n`\n\nconst DividerText = styled(Text)`\n position: absolute;\n top: ${token('space-s')};\n\n padding-right: ${token('space-xs')};\n padding-left: ${token('space-m')};\n\n background-color: ${token('color-neutral-white')};\n`\n\nfunction isQuerying(status: SelectStatus) {\n return ['pending-query', 'querying'].includes(status)\n}\n\ntype SeparatorProps = {\n status: SelectStatus\n after?: unknown[]\n before?: unknown[]\n}\n\nfunction Separator({ status, after = [], before = [] }: SeparatorProps): JSX.Element {\n if (!isQuerying(status)) {\n if (isEmpty(after) && !isEmpty(before)) return <Divider />\n if (isEmpty(after)) return <Fragment />\n }\n\n return (\n <div style={{ position: 'relative' }}>\n <Divider />\n <DividerText variant=\"caption-bold\" color=\"color-neutral-light\">\n {isQuerying(status) ? 'Loading...' : `${after.length} option${pluralize(after.length)}`}\n </DividerText>\n </div>\n )\n}\n\nfunction renderOptionsSingle(select: useSelectReturn, components?: Components): JSX.Element {\n const { Option, Empty, CreatableOption } = getComponents(components)\n const isCreatable = select.isCreatable()\n\n if (isQuerying(select.status) && isEmpty(select.options)) {\n return <SelectEmpty>Loading...</SelectEmpty>\n }\n\n if (isEmpty(select.options)) {\n if (isCreatable) {\n return <CreatableOption />\n }\n\n return <Empty>No results found.</Empty>\n }\n\n return (\n <>\n {select.createOptionPosition === 'first' && isCreatable ? <CreatableOption /> : null}\n {select.options.map((option) => {\n const { value } = select.getSelectableOption(option)\n return <Option key={String(value)} value={value} />\n })}\n {select.createOptionPosition === 'last' && isCreatable ? <CreatableOption /> : null}\n </>\n )\n}\n\nfunction renderOptionsMultiple(select: useSelectReturn, components?: Components): JSX.Element {\n const { Option, Empty, CreatableOption } = getComponents(components)\n const isCreatable = select.isCreatable()\n\n const selectedOptions = Array.from(select.selectable.selected.values()).map((selectable) =>\n select.getSelectableOption(selectable)\n )\n\n const remainingOptions = select.options.reduce((remaining, selectable) => {\n const option = select.getSelectableOption(selectable)\n\n if (option.checked) {\n return remaining\n }\n\n return [...remaining, option]\n }, [] as SelectableOption[])\n\n let remaining = (\n <Fragment>\n {select.createOptionPosition === 'first' && isCreatable ? <CreatableOption /> : null}\n {remainingOptions.map((option) => (\n <Option key={String(option.value)} value={option.value} />\n ))}\n {select.createOptionPosition === 'last' && isCreatable ? <CreatableOption /> : null}\n </Fragment>\n )\n\n if (!isQuerying(select.status) && isEmpty(remainingOptions)) {\n remaining = isCreatable ? <CreatableOption /> : <Empty>No more options.</Empty>\n }\n\n if (!isQuerying(select.status) && isEmpty(select.options)) {\n remaining = isCreatable ? <CreatableOption /> : <Empty>No results found.</Empty>\n }\n\n return (\n <Fragment>\n {selectedOptions.map((option) => (\n <Option key={String(option.value)} value={option.value} />\n ))}\n <Separator status={select.status} before={selectedOptions} after={remainingOptions} />\n {remaining}\n </Fragment>\n )\n}\n\nfunction Select(props: SelectProps): JSX.Element {\n const { multiple, placeholder, components, hideClear = false, ...others } = props\n\n const select = useSelect(props)\n\n function renderOptions() {\n if (multiple) {\n return renderOptionsMultiple(select, components)\n }\n\n return renderOptionsSingle(select, components)\n }\n\n function getTrailing() {\n if (isQuerying(select.status)) {\n return <Loading data-testid=\"select-trigger-loading\">&middot;&middot;&middot;</Loading>\n }\n\n if (!select.value) {\n return null\n }\n\n if (multiple) {\n return <ClearMultiple select={select} />\n }\n\n if (select.disabled || hideClear) {\n return null\n }\n\n return (\n <CloseButton\n size={12}\n {...getCommonClearButtonProps()}\n {...select.getClearProps()}\n type=\"button\"\n />\n )\n }\n\n return (\n <GenericDropdown {...omit(others, OMITTED_PROPS)} {...select.getDropdownProps()}>\n <SelectableContext.Provider value={select.selectable}>\n <SelectTrigger\n {...select.getTriggerProps()}\n trailing={getTrailing()}\n placeholder={placeholder}\n autoComplete=\"off\"\n aria-autocomplete=\"none\"\n />\n <SelectMenu {...select.getMenuProps()}>\n <SelectContext.Provider value={select}>{renderOptions()}</SelectContext.Provider>\n </SelectMenu>\n </SelectableContext.Provider>\n </GenericDropdown>\n )\n}\n\nSelect.Trigger = SelectTrigger\nSelect.Option = SelectOption\nSelect.Empty = SelectEmpty\nSelect.CreatableOption = SelectCreatableOption\n\nexport default Select\n","import { useCallback, useContext } from 'react'\n\nimport { SelectContext } from './Select.context'\nimport type { Option, useSelectExternalReturn } from './Select.types'\n\nexport function useSelectExternal(): useSelectExternalReturn {\n const select =\n useContext(SelectContext) ||\n (() => {\n throw new Error('useSelect should be wrapped in a SelectContext')\n })()\n\n const isChecked = useCallback(\n function isChecked(option: Option) {\n const { checked } = select.getSelectableOption(option)\n return checked\n },\n [select]\n )\n\n return {\n query: select.query,\n getOption: select.getOption,\n isChecked,\n }\n}\n","import React from 'react'\nimport type { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { BaseLink } from 'components/Link'\n\nexport type LogoProps = PropsWithChildren<{\n url: string\n className?: string\n}>\n\nconst Container = styled.div`\n padding-right: ${token('space-l')};\n padding-left: ${token('space-l')};\n`\n\nfunction Logo({ className, url, children }: LogoProps): JSX.Element {\n return (\n <Container className={className}>\n <BaseLink href={url}>{children}</BaseLink>\n </Container>\n )\n}\n\nexport default styled(Logo)<LogoProps>({})\n","import { RefObject, useEffect, useLayoutEffect, useReducer, useState } from 'react'\nimport type { CSSProperties } from 'styled-components'\n\nimport { useDidMount } from 'hooks/useDidMount'\n\nfunction updateHeight(set: (value: number) => void, el: HTMLElement | null) {\n if (el) {\n const { height } = el.getBoundingClientRect()\n set(height)\n }\n}\n\nexport type HeightExpansionToggler = {\n expanded: boolean\n toggle: () => void\n height: CSSProperties['height']\n}\n\n/**\n * A React Hook to help you expand or collapse an element by\n * checking its total height and controlling a boolean flag\n * @param {React.RefObject} targetElRef - Ref of the wrapper element\n */\nfunction useHeightExpansionToggler(targetElRef: RefObject<HTMLElement>): HeightExpansionToggler {\n const [state, toggleState] = useReducer((prevState) => !prevState, false)\n const [totalHeight, setTotalHeight] = useState<CSSProperties['height']>(0)\n\n useLayoutEffect(() => {\n updateHeight(setTotalHeight, targetElRef.current)\n }, [targetElRef])\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n updateHeight(setTotalHeight, targetElRef.current)\n })\n\n if (targetElRef.current) {\n observer.observe(targetElRef.current, { childList: true })\n }\n\n return () => observer.disconnect()\n }, [targetElRef])\n\n const mounted = useDidMount()\n const finalHeight = !mounted ? 'auto' : state ? totalHeight : 0\n\n return {\n expanded: state,\n toggle: toggleState,\n height: finalHeight,\n }\n}\n\nexport default useHeightExpansionToggler\n","import React from 'react'\nimport type { ReactNode, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport focusable from 'styles/focusable'\nimport transition from 'styles/transition'\nimport { getToken as token } from 'theming'\nimport rem from 'utils/toolset/rem'\nimport type { MenuLinkProps } from './MenuLink'\n\nexport type MenuBaseItemProps = HTMLAttributes<HTMLElement> & {\n label: string\n leading?: ReactNode\n trailing?: ReactNode\n url?: string\n subItems?: MenuLinkProps[]\n}\n\nconst StyledMenuItem = styled.button`\n ${transition({ duration: '0.25s' })};\n\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: space-between;\n padding: ${token('space-s')} 0;\n padding-right: ${rem('12px')};\n padding-left: ${token('space-l')};\n\n color: ${token('color-neutral-white')};\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('font-size-4')};\n line-height: ${token('font-height-3')};\n\n cursor: pointer;\n\n ${focusable`\n color: ${token('side-navigation-menu-item-color--focus')};\n `}\n`\n\nconst Leading = styled.div`\n display: flex;\n align-items: center;\n padding-right: ${token('space-s')};\n`\n\nconst Flex = styled.div`\n display: flex;\n`\n\nfunction MenuBaseItem({ label, leading, trailing, ...props }: MenuBaseItemProps): JSX.Element {\n return (\n <StyledMenuItem {...props}>\n <Flex>\n {leading && <Leading>{leading}</Leading>}\n {label}\n </Flex>\n {trailing && trailing}\n </StyledMenuItem>\n )\n}\n\nexport default MenuBaseItem\n","import React from 'react'\nimport type { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport hoverable from 'styles/hoverable'\nimport MenuBaseItem from './MenuBaseItem'\n\nconst StyledMenuItem = styled(({ url, ...props }) => (\n <MenuBaseItem as={url ? 'a' : 'button'} {...props} />\n))`\n ${hoverable`\n color: ${token('side-navigation-menu-link-color--hover')};\n `}\n\n ${({ active }) =>\n active\n ? css`\n background-color: ${token('side-navigation-menu-link-background-color--active')};\n box-shadow: inset ${token('space-xs')} 0\n ${token('side-navigation-menu-link-box-shadow-color--active')};\n `\n : ''}\n`\n\nexport type MenuLinkProps = React.HTMLAttributes<HTMLAnchorElement> & {\n label: string\n leading?: ReactNode\n trailing?: ReactNode\n url?: string\n}\n\nfunction MenuLink({ url, ...props }: MenuLinkProps): JSX.Element {\n return <StyledMenuItem href={url} url={url} {...props} role=\"menuitem\" />\n}\n\nexport default styled(MenuLink)({})\n","import React, { Fragment, useRef } from 'react'\nimport type { PropsWithChildren, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\nimport type { CSSProperties } from 'styled-components'\n\nimport { Icon } from 'components/Icon'\nimport { conditional, whenProps, prop } from 'tools/index'\nimport { getToken as token } from 'theming'\nimport transition from 'styles/transition'\nimport { useHeightExpansionToggler } from 'hooks/useHeightExpansionToggler'\n\nimport MenuLink from './MenuLink'\nimport MenuBaseItem from './MenuBaseItem'\n\ninterface IExpandable {\n $expanded?: boolean\n $height?: CSSProperties['height']\n}\n\nconst IconWrapper = styled.div`\n display: flex;\n align-items: center;\n margin-left: ${token('space-s')};\n`\n\nconst StyledIcon = styled(Icon)<IExpandable>`\n color: ${token('color-neutral')};\n\n transform: rotate(\n ${conditional({\n '0deg': whenProps({ $expanded: true }),\n '-90deg': whenProps({ $expanded: false }),\n })}\n );\n`\n\nconst ExpandableItems = styled.div<IExpandable>`\n overflow: hidden;\n ${transition({ property: 'height' })}\n\n height: ${prop('$height', 0)}px;\n\n ${MenuLink} {\n padding-left: ${token('space-xl')};\n }\n`\n\nconst ItemsWrapper = styled.div<IExpandable>`\n ${transition()}\n\n opacity: ${conditional({\n 0: whenProps({ $expanded: false }),\n 1: whenProps({ $expanded: true }),\n })};\n\n transform: translateY(\n ${conditional({\n '-10%': whenProps({ $expanded: false }),\n '0%': whenProps({ $expanded: true }),\n })}\n );\n`\n\nexport type MenuExpandableProps = HTMLAttributes<HTMLDivElement> &\n PropsWithChildren<{\n label: string\n }>\n\nfunction MenuExpandable({ label, children, ...props }: MenuExpandableProps): JSX.Element {\n const expandableItemsRef = useRef<HTMLDivElement>(null)\n const { expanded, toggle, height } = useHeightExpansionToggler(expandableItemsRef)\n\n return (\n <div {...props} role=\"none\">\n <MenuBaseItem\n onClick={toggle}\n label={label}\n trailing={\n <IconWrapper>\n <StyledIcon $expanded={expanded} name=\"chevron-down\" size={16} />\n </IconWrapper>\n }\n aria-haspopup=\"true\"\n aria-expanded={expanded}\n />\n <ExpandableItems $height={height} role=\"menu\">\n <ItemsWrapper $expanded={expanded} ref={expandableItemsRef} role=\"presentation\">\n {React.Children.map(children, (child) => {\n if (!child) return Fragment\n\n if (typeof child === 'object' && 'type' in child) {\n return React.cloneElement(child, {\n key: label,\n tabIndex: expanded ? 0 : -1,\n ariaHidden: !expanded,\n })\n }\n\n return child\n })}\n </ItemsWrapper>\n </ExpandableItems>\n </div>\n )\n}\n\nexport default MenuExpandable\n","import type { StyledComponent } from 'styled-components'\n\n/**\n * Helper that returns the plural form if count is different than 1, otherwise the singular one.\n * @example\n * const StyledParent = styled.div``\n * styledCompounds(StyledParent, { Child: (props) => <div /> })\n * <StyledParent.Child />\n * @param StyledComponent - Parent instance of a styled-component\n * @param compounds - Object with compound components\n * @returns Parent component with type-safe accessable compound components\n */\nexport function styledCompounds<\n A extends StyledComponent<React.ComponentType, Record<string, unknown>>,\n B extends Record<string, unknown>\n>(Parent: A, compounds: B): A & B {\n Object.keys(compounds).forEach((key) => {\n // @ts-expect-error StyledComponent is read-only\n Parent[key] = compounds[key]\n })\n return Parent as A & B\n}\n","import React, { PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nimport MenuExpandable from './MenuExpandable'\nimport type { MenuExpandableProps } from './MenuExpandable'\nimport MenuLink from './MenuLink'\nimport type { MenuLinkProps } from './MenuLink'\nimport useID from 'hooks/useID'\nimport { styledCompounds } from 'utils/toolset/styledCompounds'\n\nconst MenuTitle = styled.div`\n padding: ${token('space-s')} 0;\n padding-left: ${token('space-l')};\n\n color: ${token('color-neutral')};\n\n font-weight: ${token('side-navigation-menu-title-font-weight')};\n font-size: ${token('side-navigation-menu-title-font-size')};\n line-height: ${token('side-navigation-menu-title-line-height')};\n text-transform: uppercase;\n`\n\nexport interface MenuProps extends React.HTMLAttributes<HTMLDivElement> {\n label?: string\n}\n\nfunction Menu({ label, children, ...props }: MenuProps): JSX.Element {\n const menuId = useID()\n\n return (\n <div role=\"menubar\" aria-labelledby={menuId} {...props}>\n {label && <MenuTitle id={menuId}>{label}</MenuTitle>}\n\n {children}\n </div>\n )\n}\n\ntype MenuItemProps = { active?: boolean } & PropsWithChildren<MenuLinkProps & MenuExpandableProps>\n\nfunction MenuItem(props: MenuItemProps) {\n if (props.children) {\n return <MenuExpandable {...props} />\n }\n\n return <MenuLink {...props} />\n}\n\nconst StyledMenu = styled(Menu)({})\n\nexport default styledCompounds(StyledMenu, { Item: MenuItem, SubItem: MenuLink })\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nconst Line = styled.hr`\n margin: ${token('side-navigation-component-margin-top')} 0;\n\n color: ${token('side-navigation-separator-color')};\n`\n\nexport interface SeparatorProps {\n className?: string\n}\n\nfunction Separator(props: SeparatorProps): JSX.Element {\n return <Line {...props} role=\"separator\" />\n}\n\nexport default Separator\n","import CloseButton from 'common/CloseButton'\nimport type { CloseButtonProps } from 'common/CloseButton'\nimport React, { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\n\nimport { Logo } from './Logo'\nimport { Menu } from './Menu'\nimport { Separator } from './Separator'\n\nconst Container = styled.aside`\n z-index: ${token('z-index-overlay')};\n /* this was needed to force the side-navigation-width inside flex containers */\n flex: 0 0 ${token('side-navigation-width')};\n width: ${token('side-navigation-width')};\n min-height: 100vh;\n padding-top: ${token('space-l')};\n padding-bottom: ${token('space-l')};\n overflow: auto;\n\n background-color: ${token('side-navigation-background-color')};\n\n ${Logo} + * {\n margin-top: ${token('space-xl')};\n }\n\n ${Menu} + ${Menu} {\n margin-top: ${token('space-m')};\n }\n`\n\nexport interface SideNavigationProps {\n className?: string\n children: ReactNode\n}\n\nfunction SideNavigation({ className, children }: SideNavigationProps): JSX.Element {\n return <Container className={className}>{children}</Container>\n}\n\nSideNavigation.Logo = Logo\nSideNavigation.Menu = Menu\nSideNavigation.Separator = Separator\nSideNavigation.CloseButton = styled(CloseButton)<CloseButtonProps>({})\n\nexport default SideNavigation\n","import { useState, useEffect } from 'react'\n\nfunction useWindowSize() {\n const [windowSize, setWindowSize] = useState<{\n width: number\n height: number\n }>({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n\n useEffect(() => {\n function handleResize() {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n }\n\n window.addEventListener('resize', handleResize)\n\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n return windowSize\n}\n\nexport default useWindowSize\n","import { CustomTheme, getToken as token } from 'theming'\nimport { useTheme } from 'styled-components'\nimport useDialog from 'components/Dialog/useDialog'\nimport { useMemo } from 'react'\nimport useWindowResize from 'hooks/useWindowResize'\nimport { BASE_PIXELS } from 'utils/toolset/rem'\n\nexport interface useSideNavigationProps {\n open: boolean\n show: () => void\n hide: () => void\n toggle: () => void\n}\n\nfunction transformInPixels(value: string): number {\n if (value.indexOf('rem') >= 0) {\n return parseFloat(value) * BASE_PIXELS\n }\n\n return parseFloat(value)\n}\n\nfunction useSideNavigation(): useSideNavigationProps {\n const size = useWindowResize()\n const theme = useTheme() as CustomTheme\n\n const shouldOpen = useMemo(() => {\n const breakpoint = token('side-navigation-collapsing-breakpoint', { theme }) as string\n const breakpointInPixels = transformInPixels(breakpoint)\n return size.width > breakpointInPixels\n }, [size])\n\n return useDialog({ open: shouldOpen })\n}\n\nexport default useSideNavigation\n","import type { PropsWithChildren } from 'react'\nimport React, { ReactNode, useEffect, useRef, useState } from 'react'\nimport ReactDOM from 'react-dom'\nimport styled from 'styled-components'\n\nimport transition from 'styles/transition'\nimport conditional, { whenProps } from 'tools/conditional'\nimport { getToken as token } from 'theming'\nimport DefaultCloseButton from 'common/CloseButton'\n\nexport interface DrawerProps {\n children?: ReactNode\n className?: string\n open: boolean\n onClose?: () => void\n onClickOutside?: () => void\n}\n\nconst StyledAside = styled.aside<Pick<DrawerProps, 'open'>>`\n position: fixed;\n top: 0;\n left: 0;\n\n z-index: ${token('z-index-overlay')};\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n\n background: ${token('modal-overlay-background')};\n\n visibility: ${conditional({\n visible: whenProps({ open: true }),\n hidden: whenProps({ open: false }),\n })};\n`\n\nconst CloseButton = styled(DefaultCloseButton)`\n position: absolute;\n top: 32px;\n left: -48px;\n\n background-color: ${token('color-neutral-lighter')};\n`\n\nconst StyledSection = styled.section<Pick<DrawerProps, 'open'>>`\n position: fixed;\n top: 0;\n right: 0;\n\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 40vw;\n height: 100%;\n\n background-color: ${token('color-neutral-lightest')};\n border-radius: ${token('border-radius-s')};\n box-shadow: ${token('shadow-modal')};\n\n transform: ${conditional({\n 'translateX(100%)': whenProps({\n open: false,\n }),\n 'translateX(0px)': whenProps({\n open: true,\n }),\n })};\n\n ${transition({\n property: 'transform',\n duration: '200ms',\n })}\n`\n\nconst StyledHeader = styled.header`\n display: flex;\n align-items: center;\n justify-content: center;\n\n padding: ${token('space-xl')};\n\n color: ${token('color-neutral-darker')};\n font-weight: ${token('font-weight-bold')};\n font-size: ${token('font-size-2')};\n text-align: center;\n\n border-bottom-color: ${token('color-neutral-light')};\n border-bottom-width: 1px;\n border-bottom-style: solid;\n`\n\nconst StyledBody = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n\n padding: ${token('space-xl')};\n\n overflow: auto;\n`\n\nconst StyledFooter = styled.footer`\n display: flex;\n\n padding: ${token('space-xl')};\n\n border-top-color: ${token('color-neutral-light')};\n border-top-width: 1px;\n border-top-style: solid;\n`\n\nexport interface DrawerHeaderProps {\n className?: string\n}\n\nfunction DrawerHeader({\n children,\n className,\n ...others\n}: PropsWithChildren<DrawerHeaderProps>): JSX.Element {\n return (\n <StyledHeader {...others} className={className}>\n {children}\n </StyledHeader>\n )\n}\n\nexport interface DrawerBodyProps {\n className?: string\n}\n\nfunction DrawerBody({\n children,\n className,\n ...others\n}: PropsWithChildren<DrawerHeaderProps>): JSX.Element {\n return (\n <StyledBody {...others} className={className}>\n {children}\n </StyledBody>\n )\n}\n\nexport interface DrawerFooterProps {\n className?: string\n}\n\nfunction DrawerFooter({\n children,\n className,\n ...others\n}: PropsWithChildren<DrawerFooterProps>): JSX.Element {\n return (\n <StyledFooter {...others} className={className}>\n {children}\n </StyledFooter>\n )\n}\n\nfunction Drawer({\n className,\n children,\n open,\n onClose,\n onClickOutside,\n ...others\n}: DrawerProps): JSX.Element {\n const [invisible, setInvisible] = useState(!open)\n const ref = useRef<HTMLElement>(null)\n\n function handleTransitionEnd() {\n if (!open) {\n setInvisible(true)\n }\n }\n\n useEffect(() => {\n if (open) {\n setInvisible(false)\n }\n }, [open])\n\n useEffect(() => {\n const currentRef = ref.current\n\n if (currentRef && onClickOutside) {\n const handleClick = (event: MouseEvent) => {\n const hasClickedOutside = currentRef.isSameNode(event.target as Element)\n\n if (hasClickedOutside) onClickOutside()\n }\n\n currentRef.addEventListener('mouseup', handleClick)\n\n return () => currentRef.removeEventListener('mouseup', handleClick)\n }\n }, [onClickOutside])\n\n return ReactDOM.createPortal(\n <StyledAside open={!invisible} ref={ref}>\n <StyledSection\n {...others}\n className={className}\n open={open}\n onTransitionEnd={handleTransitionEnd}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"drawer\"\n >\n {Boolean(onClose) && <CloseButton onClick={onClose} aria-label=\"close\" />}\n {children}\n </StyledSection>\n </StyledAside>,\n document.body\n )\n}\n\nDrawer.Header = DrawerHeader\nDrawer.Body = DrawerBody\nDrawer.Footer = DrawerFooter\n\nexport default Drawer\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport React, { useCallback, useState, createContext, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport { createSelectable } from 'hooks/useSelectable'\nimport type { Selectable, SelectableState, SelectableKeyType } from 'hooks/useSelectable'\nimport type { useSelectableProps } from 'hooks/useSelectable/useSelectable.types'\n\nexport type TableSelectableRow = Selectable & {\n value?: string | number | boolean\n}\n\nexport type TableSelectionSelectable<T extends Selectable = TableSelectableRow> = Omit<\n useSelectableProps<T>,\n 'onChange'\n> & {\n onChange: (selected: T[]) => void\n}\n\nexport type TableSelectionConfig<T extends Selectable = TableSelectableRow> =\n | boolean\n | Partial<TableSelectionSelectable<T>>\n\nexport interface TableSelectionCore<T extends Selectable = TableSelectableRow> {\n selected?: SelectableState<T>\n config: TableSelectionSelectable<T>\n allRowsAreSelected: boolean\n toggle: (key: T) => void\n toggleAll: () => void\n clear: () => void\n register: (key?: T) => void\n}\n\nfunction getSelectableProps<T extends Selectable = TableSelectableRow>(\n config?: TableSelectionConfig<T>\n): TableSelectionSelectable<T> {\n const defaults: TableSelectionSelectable<T> = {\n multiple: true,\n selected: [],\n onChange() {},\n adapters: {\n generic: {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n getKey: (row) => row.value as string,\n },\n },\n }\n\n if (!config || config === true) return defaults\n\n return {\n ...defaults,\n ...config,\n }\n}\n\nexport function useTableSelectionCore<T extends Selectable>(\n config?: TableSelectionConfig<T>\n): TableSelectionCore<T> {\n const { useSelectable } = createSelectable<T>()\n\n const [registered, setRegistered] = useState<T[]>([])\n\n const selectableProps = getSelectableProps(config)\n\n const { selected, toggle, select, unselect, clear } = useSelectable({\n ...selectableProps,\n onChange(value) {\n return selectableProps.onChange(value ? [...value.values()] : [])\n },\n })\n\n const allRowsAreSelected = selected.size === registered.length\n\n const getKey = useCallback(\n (row: T): SelectableKeyType => {\n const { adapters } = selectableProps\n\n const adapter = adapters?.[row._type || 'generic']\n const key = adapter?.getKey(row) ?? ''\n\n return key\n },\n [selectableProps]\n )\n\n const register = useCallback(\n (row?: T) => {\n if (!row) return\n\n const key = getKey(row)\n\n setRegistered((prev) => {\n const alreadyRegistered = prev.some((prevRow) => getKey(prevRow) === key)\n\n if (alreadyRegistered) {\n return prev\n }\n\n return [...prev, row]\n })\n },\n [getKey]\n )\n\n function toggleAll() {\n if (allRowsAreSelected) {\n registered.forEach((row) => {\n const key = getKey(row)\n\n if (!key) return\n\n unselect(key)\n })\n } else {\n registered.forEach((row) => select(row))\n }\n }\n\n return {\n allRowsAreSelected,\n config: selectableProps,\n selected,\n toggle,\n toggleAll,\n clear,\n register,\n }\n}\n\nexport const TableSelectionContext = createContext<TableSelectionCore>({\n selected: undefined,\n config: {} as TableSelectionSelectable,\n allRowsAreSelected: false,\n toggle() {},\n toggleAll() {},\n clear() {},\n register() {},\n})\n\ntype TableSelectionProviderProps = PropsWithChildren<{\n selection?: TableSelectionConfig\n}>\n\nexport function TableSelectionProvider({\n children,\n selection,\n}: TableSelectionProviderProps): JSX.Element {\n const selectionCore = useTableSelectionCore(selection)\n\n return (\n <TableSelectionContext.Provider value={selectionCore}>\n {children}\n </TableSelectionContext.Provider>\n )\n}\n\nexport function useTableSelection<\n T extends Selectable = TableSelectableRow\n>(): TableSelectionCore<T> {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return useContext(TableSelectionContext)\n}\n\ntype TableSelectionHook<T extends Selectable = TableSelectableRow> = {\n values: T[]\n clear: TableSelectionCore<T>['clear']\n}\n\nexport function useSelection<T extends Selectable = TableSelectableRow>(): TableSelectionHook<T> {\n const { selected, clear } = useTableSelection<T>()\n\n return {\n values: selected ? [...selected.values()] : [],\n clear,\n }\n}\n\nexport function isCellSelected<T extends Selectable>(\n value: T,\n selectedRows: SelectableState<T>,\n config: TableSelectionSelectable<T>\n): boolean {\n const { adapters } = config\n\n const adapter = adapters?.[value._type || 'generic']\n const key = adapter?.getKey(value)\n\n if (!key) return false\n\n return selectedRows.has(key)\n}\n\nexport function useIsCellSelected<T extends Selectable = TableSelectableRow>(value?: T): boolean {\n const { selected, config } = useTableSelection<T>()\n\n if (!value || !selected) return false\n\n return isCellSelected(value, selected, config)\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport { Box as DefaultBox } from 'components/Layout'\nimport type { SortDirection } from './useSortBy.types'\n\nimport type { BoxProps } from 'components/Layout/Box'\n\ninterface TableSortHandleProps extends BoxProps {\n order?: SortDirection | null\n}\n\nconst Box = styled(DefaultBox)`\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n\n margin-left: ${token('space-xs')};\n`\n\nfunction TableSortHandle({ order, ...rest }: TableSortHandleProps): JSX.Element | null {\n return (\n <Box {...rest} padding=\"none\">\n <Icon name={order != null ? `sort-${order}` : 'sort'} width=\"0.75em\" height=\"0.85em\" />\n </Box>\n )\n}\n\nexport default TableSortHandle\n","import React, { Children, Fragment, isValidElement, useEffect, useState } from 'react'\nimport styled, { css } from 'styled-components'\nimport type { ReactNode } from 'react'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport { getToken as token } from 'theming'\nimport { conditional, whenProps, prop } from 'tools/index'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport { Checkbox } from 'components/Checkbox'\nimport { Radio } from 'components/Radio'\nimport { Link } from 'components/Link'\nimport { Text } from 'components/Text'\nimport { Dropdown } from 'components/Dropdown'\nimport { Layout } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport { Children as InternalButton } from 'components/Button/Button'\n\nimport {\n isCellSelected,\n TableSelectionProvider,\n useIsCellSelected,\n useSelection,\n useTableSelection,\n} from './Selection'\nimport TableSortHandle from './TableSortHandle'\n\nimport type {\n TableProps,\n TableSectionProps,\n TableRowProps,\n TableCellProps,\n TableCaptionProps,\n TableSelectionProps,\n SelectionCellProps,\n TablePickerItemProps,\n TablePickerProps,\n ExpandableTableRowProps,\n} from './Table.types'\n\nconst StyledTableBody = styled.tbody`\n /* placeholder */\n`\n\nconst StyledTableFoot = styled.tfoot`\n box-shadow: 0 -1px 0 ${token('color-neutral')};\n`\n\nconst StyledTableCaption = styled.caption<{ $position?: 'top' | 'bottom' }>`\n ${conditional({\n ['border-bottom']: whenProps([{ $position: ['top', undefined] }]),\n ['border-top']: whenProps({ $position: 'bottom' }),\n })}: solid 1px ${token('color-neutral-lighter')};\n\n ${conditional({\n ['margin-bottom']: whenProps([{ $position: ['top', undefined] }]),\n ['margin-top']: whenProps({ $position: 'bottom' }),\n })}: ${token('space-m')};\n padding: ${token('space-m')} ${token('space-s')};\n\n text-align: left;\n\n caption-side: ${prop('$position', 'top')};\n background-color: ${token('color-neutral-white')};\n`\n\nconst StyledCell = css<{ alignment?: string }>`\n color: ${token('color-neutral-darker')};\n text-align: ${prop('alignment', 'left')};\n vertical-align: middle;\n`\n\nconst StyledTableCell = styled.td<{ alignment?: string; format?: string }>`\n ${StyledCell}\n\n font-family: ${conditional({\n 'font-family-monospace': whenProps({ format: ['number', 'currency'] }),\n 'font-family-default': whenProps({ format: 'default' }),\n })};\n`\n\nconst StyledTableHeadCell = styled.th<{\n alignment?: string\n clickable: boolean\n}>`\n ${StyledCell}\n\n font-family: ${token('font-family-default')};\n\n font-weight: ${token('font-weight-bold')};\n\n text-transform: capitalize;\n\n cursor: ${conditional({\n pointer: whenProps({ clickable: true }),\n normal: whenProps({ clickable: false }),\n })};\n`\n\nconst StyledTableHead = styled.thead`\n border: 1px solid ${token('color-neutral-lighter')};\n\n ${StyledTableCell} {\n padding: ${token('space-s')};\n\n font-weight: ${token('font-weight-bold')};\n text-transform: capitalize;\n }\n`\n\nconst StyledTableRow = styled.tr<{ selected: boolean; isExpanded: boolean }>`\n ${StyledTableHead} > & {\n background-color: ${token('color-neutral-lightest')};\n }\n\n ${StyledTableFoot} > & {\n background-color: ${token('color-neutral-lightest')};\n }\n\n background-color: ${conditional({\n 'table-row-selected-color': whenProps({ selected: true }),\n 'color-neutral-white': whenProps({ selected: false }),\n })};\n ${hoverable`\n background-color: ${conditional({\n 'table-row-selected-color': whenProps({ selected: true }),\n })} !important;\n `}\n\n border-color: ${token('color-neutral-lighter')};\n border-width: 1px;\n border-top-style: solid;\n border-right-style: solid;\n border-left-style: solid;\n border-bottom-style: ${conditional({\n solid: whenProps({ isExpanded: false }),\n hidden: whenProps({ isExpanded: true }),\n })};\n\n box-shadow: ${conditional({\n '0px 3px 3px 0px #C1CED9': whenProps({ isExpanded: true }),\n none: whenProps({ isExpanded: false }),\n })};\n\n ${StyledTableBody} > & {\n ${hoverable`\n background-color: ${token('color-neutral-lighter')};\n `}\n\n ${focusable`\n box-shadow: inset ${token('shadow-glow-primary')};\n `}\n }\n`\n\nconst StyledExpandableContentRow = styled.tr`\n border-color: ${token('color-neutral-lighter')};\n border-width: 1px;\n border-top-style: hidden;\n border-right-style: solid;\n border-left-style: solid;\n border-bottom-style: solid;\n`\n\nconst StyledTable = styled.table<{ scale?: string }>`\n width: 100%;\n\n white-space: nowrap;\n\n background-color: ${token('color-neutral-lightest')};\n\n border-collapse: collapse;\n\n ${StyledTableBody} ${StyledTableRow} {\n height: ${conditional({\n '24px': whenProps({ scale: 'small' }),\n '48px': whenProps({ scale: 'default' }),\n '80px': whenProps({ scale: 'large' }),\n })};\n }\n\n ${StyledTableHeadCell},\n ${StyledTableCell} {\n padding: ${conditional({\n 'space-xs': whenProps({ scale: 'small' }),\n 'space-s': whenProps({ scale: ['default', 'large'] }),\n })};\n\n font-size: ${conditional({\n 'font-size-5': whenProps({ scale: 'small' }),\n 'font-size-4': whenProps({ scale: ['default', 'large'] }),\n })};\n }\n`\n\nconst RotatableIcon = styled(Icon)<{ $rotate: boolean }>`\n ${conditional({\n 'transform: rotate(90deg);': whenProps({ $rotate: true }),\n })}\n`\n\nfunction Table<T>({\n children,\n selection,\n scale = 'default',\n ...others\n}: TableProps<T>): JSX.Element {\n return (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <TableSelectionProvider selection={selection}>\n <StyledTable scale={scale} {...others}>\n {children}\n </StyledTable>\n </TableSelectionProvider>\n )\n}\n\nconst TableCaptionInner = styled.div<{ $height?: number }>`\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: ${prop('$height', 36)}px;\n`\n\nfunction TableCaption({ children, position, height }: TableCaptionProps): JSX.Element {\n return (\n <StyledTableCaption $position={position}>\n <TableCaptionInner $height={height}>{children}</TableCaptionInner>\n </StyledTableCaption>\n )\n}\n\nfunction TableHead({ children, ...others }: TableSectionProps): JSX.Element {\n return <StyledTableHead {...others}>{children}</StyledTableHead>\n}\n\nfunction TableBody({ children, ...others }: TableSectionProps): JSX.Element {\n return <StyledTableBody {...others}>{children}</StyledTableBody>\n}\n\nfunction TableCell({\n children,\n alignment = 'left',\n format = 'default',\n ...others\n}: TableCellProps): JSX.Element {\n return (\n <StyledTableCell alignment={alignment} format={format} {...others}>\n {children}\n </StyledTableCell>\n )\n}\n\nfunction SelectionCell<T>({ value, ...props }: SelectionCellProps<T>): JSX.Element {\n const { toggle, register, config } = useTableSelection()\n\n const selected = useIsCellSelected(value)\n\n const action = () => toggle(value as T)\n\n useEffect(() => {\n register(value)\n }, [value, register])\n\n if (props.children) {\n return (\n <TableCell>\n {props.children({\n selected,\n toggle: action,\n })}\n </TableCell>\n )\n }\n\n const Input = config.multiple ? Checkbox : Radio\n\n return (\n <TableCell {...props}>\n {value ? <Input checked={selected} scale=\"small\" onChange={action} /> : null}\n </TableCell>\n )\n}\n\nfunction SelectionHeadCell<T>(props: SelectionCellProps<T>): JSX.Element {\n const { allRowsAreSelected, toggleAll, config } = useTableSelection()\n\n const selected = allRowsAreSelected\n const action = () => toggleAll()\n\n if (props.children) {\n return <TableHeadCell {...props}>{props.children({ selected, toggle: action })}</TableHeadCell>\n }\n\n const Input = config.multiple ? Checkbox : Fragment\n\n return (\n <TableHeadCell {...props}>\n <Input checked={selected} scale=\"small\" onChange={action} />\n </TableHeadCell>\n )\n}\n\nfunction TableRow({ children, ...others }: TableRowProps): JSX.Element {\n const selected = useIsRowSelected(children)\n\n return (\n <StyledTableRow {...others} selected={selected} isExpanded={false}>\n {children}\n </StyledTableRow>\n )\n}\n\nfunction ExpandableTableRow({\n expandableContent,\n expanded,\n leading: propsLeading,\n children,\n onExpandedChange,\n initialExpanded = false,\n ...others\n}: ExpandableTableRowProps): JSX.Element {\n const [openState, setOpenState] = useState(initialExpanded)\n\n const selected = useIsRowSelected(children)\n\n const open = expanded ?? openState\n const isExpanded = Boolean(open && expandableContent)\n const colSpan = Array.isArray(children) ? children.length + 1 : 1\n\n let leading: ReactNode = <RotatableIcon name=\"caret-right\" $rotate={open} />\n if (propsLeading) {\n leading = isFunction(propsLeading) ? propsLeading(open) : propsLeading\n }\n\n function toggle() {\n if (!expandableContent) return\n\n onExpandedChange?.(!open)\n setOpenState(!open)\n }\n\n return (\n <>\n <StyledTableRow {...others} onClick={toggle} isExpanded={isExpanded} selected={selected}>\n <TableCell>{expandableContent && leading}</TableCell>\n {children}\n </StyledTableRow>\n {isExpanded && (\n <StyledExpandableContentRow>\n <StyledTableCell colSpan={colSpan}>{expandableContent}</StyledTableCell>\n </StyledExpandableContentRow>\n )}\n </>\n )\n}\n\nfunction TableHeadCell({\n alignment = 'left',\n children,\n onClick,\n ...others\n}: TableCellProps): JSX.Element {\n return (\n <StyledTableHeadCell\n clickable={onClick != null}\n alignment={alignment}\n onClick={onClick}\n {...others}\n >\n <Layout.Group space=\"xs\" align=\"center\">\n {children}\n </Layout.Group>\n </StyledTableHeadCell>\n )\n}\n\nconst ActionsWrapper = styled.div`\n display: flex;\n gap: ${token('space-s')};\n margin-left: auto;\n`\n\nfunction TableSelectionActions({ buttons, children, ...others }: TableSelectionProps): JSX.Element {\n const { values, clear } = useSelection()\n\n return (\n <ActionsWrapper {...others}>\n {values.length > 0 ? (\n <>\n {buttons.map((Action, i) => (\n <Action key={i} values={values} />\n ))}\n <Link\n onClick={(e) => {\n e.preventDefault()\n clear()\n }}\n >\n <Text variant=\"link\">CANCEL</Text>\n </Link>\n </>\n ) : (\n children\n )}\n </ActionsWrapper>\n )\n}\n\nconst StyledPickerTrigger = styled(Dropdown.Trigger.Button)`\n padding: 0;\n\n ${InternalButton} {\n margin: ${token('space-2xs')};\n }\n`\n\nfunction TablePickerItem<T>({\n option,\n checked,\n children,\n ...props\n}: TablePickerItemProps<T>): JSX.Element {\n return (\n <Dropdown.Item\n leading={\n checked ? (\n <Icon name=\"check\" size=\"16\" color=\"neutral-darker\" />\n ) : (\n <Layout.Box padding=\"s\" />\n )\n }\n role=\"option\"\n aria-selected={checked ? 'true' : 'false'}\n {...props}\n >\n {children || (option && (option.option || option.title || option.key)) || 'Column'}\n </Dropdown.Item>\n )\n}\n\nconst TriggerIcon = styled(Icon).attrs({\n name: 'dots-horizontal',\n size: '12',\n color: 'neutral-darker',\n})`\n transform: rotate(90deg);\n`\n\nfunction TablePicker<T>({\n value,\n onChange,\n options,\n align,\n children,\n trigger: propsTrigger,\n ...props\n}: TablePickerProps<T>): JSX.Element {\n return (\n <Dropdown align={align}>\n <StyledPickerTrigger trailing={null} scale=\"small\" {...props}>\n {propsTrigger !== undefined ? (\n ({ expanded }) => (isFunction(propsTrigger) ? propsTrigger(expanded) : propsTrigger)\n ) : (\n <TriggerIcon />\n )}\n </StyledPickerTrigger>\n <Dropdown.Menu role=\"listbox\">\n {children ||\n options?.map((option, i) => (\n <TablePickerItem\n key={i}\n option={option}\n checked={option.key === value?.key}\n onClick={() => onChange?.(option)}\n />\n ))}\n </Dropdown.Menu>\n </Dropdown>\n )\n}\n\nfunction useIsRowSelected(children: ReactNode): boolean {\n const { selected, config } = useTableSelection()\n\n if (!selected) return false\n\n const arrChildren = Children.toArray(children)\n\n const selectionCellChild = arrChildren.find((child) => {\n return isValidElement(child) && child.type === SelectionCell\n })\n\n if (!selectionCellChild) return false\n\n const { value } = (selectionCellChild as React.ReactElement).props as SelectionCellProps\n\n if (!value) return false\n\n return isCellSelected(value, selected, config)\n}\n\nTable.Head = TableHead\nTable.Body = TableBody\nTable.Row = TableRow\nTable.Cell = TableCell\nTable.HeadCell = TableHeadCell\nTable.Foot = StyledTableFoot\nTable.Caption = TableCaption\nTable.Selection = {\n Actions: TableSelectionActions,\n Cell: SelectionCell,\n HeadCell: SelectionHeadCell,\n}\nTable.ExpandableRow = ExpandableTableRow\nTable.SortHandle = TableSortHandle\nTablePicker.Item = TablePickerItem\nTable.Picker = TablePicker\n\nexport { useSelection }\n\nexport default Table\n","import React from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport { BaseLink } from 'components/Link'\nimport styled from 'styled-components'\n\nexport type LogoProps = PropsWithChildren<{\n url: string\n className?: string\n}>\n\nfunction Logo({ url, className, children }: LogoProps): JSX.Element {\n return (\n <BaseLink className={className} href={url}>\n {children}\n </BaseLink>\n )\n}\n\nexport default styled(Logo)<LogoProps>({})\n","import React from 'react'\nimport type { PropsWithChildren, ReactNode, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport transition from 'styles/transition'\nimport { Dropdown, DropdownMenu, DropdownMenuItem, DropdownTrigger } from 'components/Dropdown'\nimport { BaseLink } from 'components/Link'\nimport useID from 'hooks/useID'\nimport ellipsizable from 'styles/ellipsizable'\nimport typography from 'styles/typography'\nimport { Popover } from 'components/Popover'\n\nexport const MenuDropdown = styled(Dropdown)({})\n\nexport const MenuDropdownSeparator = styled.hr`\n margin: ${token('space-s')} ${token('space-m')};\n\n color: ${token('top-navigation-dropdown-separator-color')};\n`\n\nconst MenuDropdownTrigger = styled(DropdownTrigger.Handle)`\n color: ${token('top-navigation-dropdown-trigger-color')};\n`\n\nexport const MenuDropdownLabel = styled.label`\n ${transition()}\n\n align-items: center;\n display: flex;\n\n ${typography('body-bold', { color: 'top-navigation-item-color' })}\n\n cursor: pointer;\n\n ${focusable`\n color: ${token('top-navigation-item-color--hover')};\n `}\n`\n\nconst Ellipsizable = styled.span<{ $max: number }>`\n ${ellipsizable()}\n\n max-width: ${(props) => props.$max}px;\n`\n\nconst IconWrapper = styled.div`\n width: ${token('space-m')};\n`\n\nconst MenuDropdownSubItemLink = styled(BaseLink)`\n align-items: stretch;\n ${typography('body', { color: 'top-navigation-dropdown-subitem-color' })}\n\n ${hoverable`\n text-decoration: none;\n font-weight: inherit;\n `}\n\n ${focusable`\n > * {\n background-color: ${token('color-neutral-lighter')}\n }\n `}\n`\n\ntype MenuDropdownSubItemProps = HTMLAttributes<HTMLElement> & {\n label: string\n url?: string\n icon?: ReactNode\n separator?: boolean\n}\n\nexport function MenuDropdownSubItem({\n icon,\n label,\n url,\n ...rest\n}: MenuDropdownSubItemProps): JSX.Element {\n return url ? (\n <MenuDropdownSubItemLink {...rest} href={url}>\n <DropdownMenuItem tabIndex={-1} leading={<IconWrapper>{icon}</IconWrapper>}>\n {label}\n </DropdownMenuItem>\n </MenuDropdownSubItemLink>\n ) : (\n <DropdownMenuItem leading={<IconWrapper>{icon}</IconWrapper>} {...rest}>\n {label}\n </DropdownMenuItem>\n )\n}\n\nexport type MenuItemDropdownProps = PropsWithChildren<{\n label: string\n}>\n\nfunction MenuItemDropdown(props: MenuItemDropdownProps): JSX.Element {\n const { label, children, ...rest } = props\n const labelId = useID()\n\n return (\n <MenuDropdown align=\"end\" key={label}>\n <Popover.Reference>\n <MenuDropdownLabel>\n <Ellipsizable $max={120} id={labelId}>\n {label}\n </Ellipsizable>\n <MenuDropdownTrigger {...rest} tabIndex={0} aria-labelledby={labelId} />\n </MenuDropdownLabel>\n </Popover.Reference>\n <DropdownMenu>{children}</DropdownMenu>\n </MenuDropdown>\n )\n}\n\nexport { MenuItemDropdown }\n","import React from 'react'\nimport type { ReactNode } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport { BaseLink } from 'components/Link'\nimport conditional, { whenProps } from 'tools/conditional'\nimport typography from 'styles/typography'\n\nconst MenuLink = styled(BaseLink)<{ hasIcon?: boolean }>`\n ${typography('body-bold')}\n\n color: ${conditional({\n 'top-navigation-item-icon-color': whenProps({ hasIcon: true }),\n 'top-navigation-item-color': whenProps({ hasIcon: false }),\n })};\n\n ${hoverable`\n text-decoration: none;\n color: ${token('top-navigation-item-color--hover')};\n `}\n\n ${focusable`\n color: ${token('top-navigation-item-color--hover')};\n `}\n`\n\ntype MenuItemIconProps = {\n label: string\n icon?: ReactNode\n url?: string\n}\n\nexport function MenuItemIcon({ url, icon, label, ...rest }: MenuItemIconProps): JSX.Element {\n if (icon) {\n return (\n <MenuLink {...rest} href={url} hasIcon title={label}>\n {icon}\n </MenuLink>\n )\n }\n\n return (\n <MenuLink {...rest} href={url}>\n {label}\n </MenuLink>\n )\n}\n","import React from 'react'\nimport type { PropsWithChildren, ReactNode, HTMLAttributes } from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport {\n MenuItemDropdown,\n MenuDropdown,\n MenuDropdownSubItem,\n MenuDropdownSeparator,\n} from './MenuItemDropdown'\nimport { MenuItemIcon } from './MenuItemIcon'\nimport conditional, { whenProps } from 'tools/conditional'\n\ntype MenuItemProps = HTMLAttributes<HTMLElement> &\n PropsWithChildren<{\n label: string\n icon?: ReactNode\n url?: string\n }>\n\nexport type MenuProps = PropsWithChildren<{\n align?: 'left' | 'right'\n}>\n\nconst MenuContainer = styled.nav<{ $align: MenuProps['align'] }>`\n ${conditional({\n 'margin-left: auto;': whenProps({ $align: 'right' }),\n })}\n\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ${token('space-m')};\n }\n\n & > * + ${MenuDropdown} {\n margin-left: ${token('space-xl')};\n }\n`\n\nfunction MenuItem(props: MenuItemProps): JSX.Element {\n if (props.children) {\n return <MenuItemDropdown {...props} />\n }\n\n return <MenuItemIcon {...props} />\n}\n\nfunction Menu(props: MenuProps): JSX.Element {\n const { align = 'left' } = props\n\n return <MenuContainer $align={align}>{props.children}</MenuContainer>\n}\n\nMenu.Item = MenuItem\nMenu.SubItem = MenuDropdownSubItem\nMenu.Separator = MenuDropdownSeparator\n\nexport default Menu\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\n\nexport type OpenSideNavButtonProps = {\n className?: string\n onClick: () => void\n}\n\nconst Container = styled.button`\n margin-right: ${token('space-2xl')};\n\n background: none;\n border: none;\n cursor: pointer;\n`\n\nfunction OpenSideNavButton({ className, onClick }: OpenSideNavButtonProps): JSX.Element {\n return (\n <Container className={className} onClick={onClick}>\n <Icon name=\"burguer-menu\" size={24} data-testid=\"toggle-sidenav\" />\n </Container>\n )\n}\n\nexport default styled(OpenSideNavButton)<OpenSideNavButtonProps>({})\n","import React from 'react'\nimport type { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Logo } from './Logo'\nimport { Menu } from './Menu'\nimport { MenuDropdownLabel } from './Menu/MenuItemDropdown'\nimport { OpenSideNavButton } from './OpenSideNavButton'\n\n/* We need to remove the 8px padding-right that DropdownTrigger adds (because of\n BaseStyledButton), in order to keep it always 40px to the right, but only when\n it's the last child. DropdownTigger isn't a StyledComponent so we need to use\n MenuDropdownLabel here since it's the one that wraps DropdownTigger */\nconst removeRightPadding = css`\n > :last-child ${MenuDropdownLabel} {\n margin-right: -${token('space-m')};\n }\n`\n\nconst Container = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n height: ${token('top-navigation-height')};\n padding: 0 ${token('space-2xl')};\n\n background-color: ${token('top-navigation-background-color')};\n border-bottom: solid 1px ${token('top-navigation-border-color')};\n\n ${removeRightPadding}\n`\n\nexport interface TopNavigationProps {\n children?: ReactNode\n}\n\nfunction TopNavigation({ children }: TopNavigationProps): JSX.Element {\n return <Container>{children}</Container>\n}\n\nTopNavigation.Logo = Logo\nTopNavigation.Menu = Menu\nTopNavigation.OpenSideNavButton = OpenSideNavButton\n\nexport default TopNavigation\n","import React, { FC, Fragment } from 'react'\nimport styled from 'styled-components'\n\nimport type { EmptyStateWithIconProps } from './EmptyState.types'\n\nimport { Stack, Group } from 'components/Layout'\nimport Text from 'components/Text/Text'\nimport Button from 'components/Button/Button'\n\nconst VerticalWrapper = styled(Stack)`\n text-align: center;\n`\n\nconst EmptyStateWithIcon: FC<EmptyStateWithIconProps> = ({\n variant = 'card',\n icon,\n title,\n action,\n children,\n ...props\n}: EmptyStateWithIconProps) => {\n const isHorizontal = variant === 'horizontal-card'\n const Wrapper = isHorizontal ? Group : VerticalWrapper\n\n return (\n <Wrapper {...props} space={isHorizontal ? 's' : 'xs'} align=\"center\" justify=\"center\">\n {children || (\n <Fragment>\n {icon}\n <Text variant=\"caption-bold\">{title}</Text>\n {action && (\n <Button variant=\"primary\" scale=\"small\" {...action}>\n {action.label}\n </Button>\n )}\n </Fragment>\n )}\n </Wrapper>\n )\n}\n\nexport default EmptyStateWithIcon\n","import React, { FC } from 'react'\nimport styled from 'styled-components'\n\nimport conditional, { whenProps } from 'tools/conditional'\n\nimport type { IllustrationProps } from './EmptyState.types'\n\nconst Wrapper = styled.div<Pick<IllustrationProps, 'scale'>>`\n & > img:first-of-type,\n SVG:first-of-type {\n height: ${conditional({\n '240px': whenProps({ scale: 'large' }),\n '120px': whenProps({ scale: 'default' }),\n })};\n object-fit: cover;\n }\n`\n\nexport const Illustration: FC<IllustrationProps> = ({\n illustration,\n scale,\n ...props\n}: IllustrationProps) => (\n <Wrapper scale={scale} {...props}>\n {typeof illustration === 'string' ? <img src={illustration} alt=\"\" /> : illustration}\n </Wrapper>\n)\n\nexport default Illustration\n","import React, { FC, Fragment } from 'react'\nimport styled from 'styled-components'\n\nimport { Stack } from 'components/Layout'\nimport Text from 'components/Text/Text'\nimport Button from 'components/Button/Button'\n\nimport type { EmptyStateWithIllustrationProps } from './EmptyState.types'\nimport Illustration from './Illustration'\n\nconst Wrapper = styled(Stack)`\n max-width: 320px;\n\n text-align: center;\n`\n\nconst EmptyStateWithIllustration: FC<EmptyStateWithIllustrationProps> = ({\n variant = 'page',\n illustration,\n title,\n description,\n action,\n children,\n ...props\n}: EmptyStateWithIllustrationProps) => {\n const isPageVariant = variant === 'page'\n\n return (\n <Wrapper {...props} align=\"center\" justify=\"center\" space=\"m\">\n {children || (\n <Fragment>\n {illustration && (\n <Illustration illustration={illustration} scale={isPageVariant ? 'large' : 'default'} />\n )}\n {(title || description) && (\n <Stack space=\"xs\">\n {title && (\n <Text\n variant={isPageVariant ? 'heading-sm-bold' : 'body-bold'}\n color={isPageVariant ? 'color-neutral-darkest' : 'color-neutral-darker'}\n >\n {title}\n </Text>\n )}\n {description && (\n <Text\n data-testid=\"empty-state-description\"\n variant={isPageVariant ? 'body' : 'caption'}\n color=\"color-neutral-darkest\"\n >\n {description}\n </Text>\n )}\n </Stack>\n )}\n {action && (\n <Button\n className=\"empty-state-action\"\n variant=\"primary\"\n scale={isPageVariant ? 'default' : 'small'}\n {...action}\n >\n {action.label}\n </Button>\n )}\n </Fragment>\n )}\n </Wrapper>\n )\n}\n\nexport default EmptyStateWithIllustration\n","import React from 'react'\n\nimport type {\n EmptyStateProps,\n EmptyStateWithIconProps,\n EmptyStateWithIllustrationProps,\n} from './EmptyState.types'\n\nimport EmptyStateWithIcon from './EmptyStateWithIcon'\nimport EmptyStateWithIllustration from './EmptyStateWithIllustration'\nimport Illustration from './Illustration'\n\nconst EmptyState = (props: EmptyStateProps): JSX.Element => {\n if (['card', 'horizontal-card'].includes(props.variant)) {\n return <EmptyStateWithIcon {...(props as EmptyStateWithIconProps)} />\n }\n return <EmptyStateWithIllustration {...(props as EmptyStateWithIllustrationProps)} />\n}\n\nEmptyState.Illustration = Illustration\n\nexport default EmptyState\n","export function aliased<T>(aliasMap: Record<number | string, T>, alias: number | string): T {\n return aliasMap[String(alias).toLowerCase()]\n}\n\nexport const MONTH_BY_ALIAS = {\n 0: 'january',\n jan: 'january',\n january: 'january',\n\n 1: 'february',\n feb: 'february',\n february: 'february',\n\n 2: 'march',\n mar: 'march',\n march: 'march',\n\n 3: 'april',\n apr: 'april',\n april: 'april',\n\n 4: 'may',\n may: 'may',\n\n 5: 'june',\n jun: 'june',\n june: 'june',\n\n 6: 'july',\n jul: 'july',\n july: 'july',\n\n 7: 'august',\n aug: 'august',\n august: 'august',\n\n 8: 'september',\n sep: 'september',\n september: 'september',\n\n 9: 'october',\n oct: 'october',\n october: 'october',\n\n 10: 'november',\n nov: 'november',\n november: 'november',\n\n 11: 'december',\n dec: 'december',\n december: 'december',\n}\n\nexport type CalendarMonthAlias = keyof typeof MONTH_BY_ALIAS\n\nexport type CalendarMonth = {\n name: string\n /**\n * Integer value representing the month, beginning with 0 for January to 11 for December.\n * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date\n */\n index: number\n}\n\nexport const MONTH_BY_NAME: Record<string, CalendarMonth> = {\n january: {\n name: 'January',\n index: 0,\n },\n february: {\n name: 'February',\n index: 1,\n },\n march: {\n name: 'March',\n index: 2,\n },\n april: {\n name: 'April',\n index: 3,\n },\n may: {\n name: 'May',\n index: 4,\n },\n june: {\n name: 'June',\n index: 5,\n },\n july: {\n name: 'July',\n index: 6,\n },\n august: {\n name: 'August',\n index: 7,\n },\n september: {\n name: 'September',\n index: 8,\n },\n october: {\n name: 'October',\n index: 9,\n },\n november: {\n name: 'November',\n index: 10,\n },\n december: {\n name: 'December',\n index: 11,\n },\n}\n\nfunction getMonthByAlias(alias: CalendarMonthAlias): CalendarMonth {\n alias = aliased(MONTH_BY_ALIAS, alias) as CalendarMonthAlias\n\n return MONTH_BY_NAME[alias]\n}\n\nfunction getAllMonths() {\n return (Object.keys(MONTH_BY_NAME) as CalendarMonthAlias[]).map((alias) => {\n return getMonthByAlias(alias)\n })\n}\n\nfunction MonthHelper(alias: CalendarMonthAlias): {\n get(): CalendarMonth\n format(representation?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow'): string\n is(other: CalendarMonthAlias): boolean\n} {\n const month = getMonthByAlias(alias)\n\n return {\n get() {\n return month\n },\n /**\n * Follows same values available in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat.\n * * \"numeric\" (e.g., 3)\n * * \"2-digit\" (e.g., 03)\n * * \"long\" (e.g., March)\n * * \"short\" (e.g., Mar)\n * * \"narrow\" (e.g., M)\n */\n format(representation: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'long') {\n switch (representation) {\n case 'numeric':\n return String(month.index + 1)\n case '2-digit':\n return String(month.index + 1).padStart(2, '0')\n case 'short':\n return month.name.slice(0, 3)\n case 'narrow':\n return month.name.slice(0, 1)\n default:\n return month.name\n }\n },\n is(other: CalendarMonthAlias) {\n return (\n getMonthByAlias(other) != null &&\n aliased(MONTH_BY_ALIAS, alias) === aliased(MONTH_BY_ALIAS, other)\n )\n },\n }\n}\n\nMonthHelper.getAll = getAllMonths\n\nexport default MonthHelper\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport focusable from 'styles/focusable'\nimport disableable from 'styles/disableable'\nimport typography from 'styles/typography'\n\nimport type { ButtonProps } from 'components/Button'\n\nconst Button = styled(BaseButton)`\n user-select: none;\n\n ${typography(\n conditional({\n 'body-bold': whenProps({ 'aria-expanded': true }),\n body: whenProps({ 'aria-expanded': false }),\n })\n )};\n border-color: transparent;\n background-color: transparent;\n\n color: ${token('color-neutral-dark')};\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n `}\n\n ${disableable`\n pointer-events: none;\n opacity: 1;\n `}\n`\n\nconst Caret = styled(Icon)<{ $rotate: boolean }>`\n ${conditional({\n 'transform: rotate(180deg);': whenProps({ $rotate: true }),\n })}\n`\n\nfunction PickerModeToggle(\n props: Omit<ButtonProps & { expanded: boolean }, 'trailing'>\n): JSX.Element {\n const { expanded, disabled, ...others } = props\n\n return (\n <Button\n type=\"button\"\n {...others}\n aria-haspopup=\"true\"\n aria-expanded={expanded}\n disabled={disabled}\n trailing={!disabled && <Caret name=\"chevron-down\" size={16} $rotate={expanded} />}\n />\n )\n}\n\nexport default PickerModeToggle\n","import { isFunction } from '@loadsmart/utils-function'\nimport isEmpty from 'utils/toolset/isEmpty'\n\nexport type DateHelperOptions = {\n normalize?: boolean\n}\n\nexport const DEFAULT_OPTIONS: DateHelperOptions = {\n normalize: true,\n}\n\nexport type InputDate = string | number | Date\n\ntype Unit = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'\ntype Operator = '>=' | '>' | '=' | '<' | '<='\n\nexport type DateConstraint =\n | InputDate\n | [InputDate, InputDate]\n | [null, InputDate]\n | [InputDate, null]\n\nexport type FunctionConstraint = (day: CalendarDate) => boolean\n\nexport type CalendarConstraint = DateConstraint | FunctionConstraint\n\nexport interface CalendarDate {\n /**\n * Get `Date` object representing this date.\n * @returns {Date}\n */\n get(): Date\n /**\n * Get the year using Universal Coordinated Time (UTC).\n * @returns {number}\n */\n getYear(): number\n /**\n * Gets the month using Universal Coordinated Time (UTC).\n * @returns {number}\n */\n getMonth(): number\n /**\n * Get the day-of-the-month, using Universal Coordinated Time (UTC).\n * @returns {number}\n */\n getDate(): number\n /**\n * Get the time value in milliseconds.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getTime(): number\n /**\n * Get the day of the week.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getWeekday(): number\n /**\n * Get the hours value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getHours(): number\n /**\n * Get the minutes value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getMinutes(): number\n /**\n * Get the seconds value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getSeconds(): number\n /**\n * Get the milliseconds value.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @returns {number}\n */\n getMilliseconds(): number\n /**\n * Check if the current date matches **at least one** of the provided constraints.\n *\n * [!] Be aware that all dates in this comparison will be normalized to 12:00:00 (UTC).\n *\n * @param {...CalendarConstraint[]} constraintsArg\n * @returns {boolean}\n */\n matches(...constraints: CalendarConstraint[]): boolean\n /**\n * Set the given `value` to the `unit` property of this instance.\n * This function mutates the internal date instance.\n * @param {Unit} unit\n * @param {number} value\n * @returns {CalendarDate}\n */\n set(unit: Unit, value: number): CalendarDate\n /**\n * Return a copy of this instance, adding the given `value` to the `unit` property.\n * @param {Unit} unit\n * @param {number} value\n * @returns {CalendarDate}\n */\n add(unit: Unit, value: number): CalendarDate\n /**\n * Return a copy of this instance, subtracting the given `value` from the `unit` property.\n * @param {Unit} unit\n * @param {number} value\n * @returns {CalendarDate}\n */\n subtract(unit: Unit, value: number): CalendarDate\n /**\n * Compare this date with the given `other`.\n *\n * [!] Be aware that it might be normalized to 12:00:00 (UTC), if you did not call the helper with\n * `options.normalize: false`.\n *\n * @param {Operator} operator - type of comparison to be performed.\n * @param {CalendarDate} other - Other `CalendarDate` to compare with.\n * @param {Unit} [precision] - notice that the precision increases with the evaluated period, so year < month < day < hour < minute < second < millisecond. Default is 'day'.\n * @return {boolean} comparison result\n */\n is(operator: Operator, other: CalendarDate, precision?: string): boolean\n /**\n * Return this date as a string value in ISO format.\n * @returns {string}\n */\n toString(): string\n}\n\nexport type CalendarDateRange = [CalendarDate | null, CalendarDate | null]\n\n/**\n * Ideally, follow the date/time string formats:\n * * `YYYY-MM-DD`\n * * `YYYY-MM-DDTHH:mm:ss.sssZ`\n * * `YYYY-MM-DDTHH:mm:ss.sss+00:00`\n *\n * `dateArg` is expected to have timezone information or to be UTC.\n *\n * By default, we normalize the input date to 12:00:00 (UTC); this simplifies comparison of dates; be mindful\n * of this when using this helper for time relate logic.\n * You can disable this behavior by passing `options.normalize: false`.\n *\n * @param {InputDate} [dateArg]\n * @return {CalendarDate}\n */\nfunction DateHelper(dateArg?: InputDate, optionsArg = DEFAULT_OPTIONS): CalendarDate {\n const options = { ...DEFAULT_OPTIONS, ...optionsArg }\n const utcDate = (function normalizeToUTC() {\n let date = new Date()\n\n if (dateArg != null) {\n date = new Date(dateArg)\n }\n\n // create a date with local timezone based on the UTC input date\n const utcDate = new Date(\n Date.UTC(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n options.normalize ? 12 : date.getUTCHours(),\n options.normalize ? 0 : date.getUTCMinutes(),\n options.normalize ? 0 : date.getUTCSeconds(),\n options.normalize ? 0 : date.getUTCMilliseconds()\n )\n )\n\n return utcDate\n })()\n\n return {\n get() {\n return utcDate\n },\n getYear() {\n return utcDate.getUTCFullYear()\n },\n getMonth() {\n return utcDate.getUTCMonth()\n },\n getDate() {\n return utcDate.getUTCDate()\n },\n getTime() {\n return utcDate.getTime()\n },\n getWeekday() {\n return utcDate.getUTCDay()\n },\n getHours() {\n return utcDate.getUTCHours()\n },\n getMinutes() {\n return utcDate.getUTCMinutes()\n },\n getSeconds() {\n return utcDate.getUTCSeconds()\n },\n getMilliseconds() {\n return utcDate.getUTCMilliseconds()\n },\n matches(...constraints: CalendarConstraint[]): boolean {\n if (isEmpty(constraints)) {\n return false\n }\n\n const constraintEvaluators = constraints.map(getConstraintEvaluator)\n const date = DateHelper(utcDate)\n\n return constraintEvaluators.some((evaluator) => {\n return evaluator(date)\n })\n },\n add(unit: Unit, value: number) {\n return add(utcDate, unit, value)\n },\n subtract(unit: Unit, value: number) {\n return add(utcDate, unit, -1 * value)\n },\n set(unit: Unit, value: number) {\n const newValue = {\n year: utcDate.getUTCFullYear(),\n month: utcDate.getUTCMonth(),\n day: utcDate.getUTCDate(),\n hour: utcDate.getUTCHours(),\n minute: utcDate.getUTCMinutes(),\n second: utcDate.getUTCSeconds(),\n millisecond: utcDate.getUTCMilliseconds(),\n [unit]: value,\n }\n\n utcDate.setUTCFullYear(newValue.year)\n utcDate.setUTCMonth(newValue.month)\n utcDate.setUTCDate(newValue.day)\n utcDate.setUTCHours(newValue.hour)\n utcDate.setUTCMinutes(newValue.minute)\n utcDate.setUTCSeconds(newValue.second)\n utcDate.setUTCMilliseconds(newValue.millisecond)\n\n return this\n },\n is(operator: Operator, other: CalendarDate, precision?: Unit): boolean {\n function compare(a: number, b: number) {\n let result\n\n switch (operator) {\n case '>=':\n result = a >= b\n break\n case '>':\n result = a > b\n break\n case '<':\n result = a < b\n break\n case '<=':\n result = a <= b\n break\n default:\n result = a === b\n break\n }\n\n return result\n }\n\n return compare(\n getComparableDate(utcDate, precision),\n getComparableDate(other.get(), precision)\n )\n },\n toString(): string {\n return utcDate.toISOString()\n },\n }\n}\n\n/**\n * This method takes a date and a unit of precision and then normalizes the given date based on that precision.\n * The return will be the timestamp of the normalized date\n *\n * @example\n * ```js\n * getComparableDate(new Date('2022-10-13T17:42:19.948Z'), 'hour')) // returns 1665680400000\n *\n * // '2022-10-13T17:42:19.948Z' will be normalized to '2022-10-13T17:00:00.000Z'\n * // 1665680400000 is equal to: new Date('2022-10-13T17:00:00.000Z').getTime()\n * ```\n *\n * @param {Date} date\n * @param {Unit} precision\n * @returns {number}\n */\nexport function getComparableDate(date: Date, precision: Unit = 'day'): number {\n const DATE_ZERO = MIN_SUPPORTED_DATE.toString()\n const COMPARE_TO = {\n year: 4,\n month: 7,\n day: 10,\n hour: 13,\n minute: 16,\n second: 19,\n millisecond: 24,\n }\n const sliceIndex = COMPARE_TO[precision]\n\n if (sliceIndex == null) {\n throw new Error(`precision ${precision} is not supported`)\n }\n\n const normalizedPart = DATE_ZERO.slice(sliceIndex)\n const datePart = date.toISOString().slice(0, sliceIndex)\n const normalizedDate = `${datePart}${normalizedPart}`\n\n return new Date(normalizedDate).getTime()\n}\n\n/**\n * Constraints represent ranges of dates, inclusive in both ends.\n * Returns an array representing the initial and final timestamps (after the transformations applied by `DateHelper`).\n *\n * @example\n * ```js\n * // to represent a range that starts and ends in the same date\n * getConstraintRange(1643371200000) // returns [1643371200000, 1643371200000]\n * getConstraintRange([1643371200000, 1643371200000]) // returns [1643371200000, 1643371200000]\n * getConstraintRange('2022-01-28T12:00:00.000Z') // returns [1643371200000, 1643371200000]\n * getConstraintRange(['2022-01-28T12:00:00.000Z', '2022-01-28T12:00:00.000Z']) // returns [1643371200000, 1643371200000]\n *\n * // to represent a range that starts at one date and ends at another\n * getConstraintRange([1641038400000, 1643371200000]) // returns [1641038400000, 1643371200000]\n * getConstraintRange(['2022-01-01T12:00:00.000Z', '2022-01-28T12:00:00.000Z']) // returns [1641038400000, 1643371200000]\n *\n * // to represent a range that starts at one date and has no end\n * getConstraintRange([1641038400000, null]) // returns [1641038400000, `MAX_SUPPORTED_DATE`]\n * getConstraintRange(['2022-01-01T12:00:00.000Z', null]) // returns [1641038400000, `MAX_SUPPORTED_DATE`]\n *\n * // to represent a range that ends at one date and has no start\n * getConstraintRange([null, 1643371200000]) // returns [0, 1643371200000]\n * getConstraintRange([null, '2022-01-28T12:00:00.000Z']) // returns [0, 1643371200000]\n * ```\n * @param rangeArg\n * @returns\n */\nexport function getConstraintRange(rangeArg: DateConstraint): [number, number] {\n let range: [number, number]\n\n if (!Array.isArray(rangeArg)) {\n const timestamp = DateHelper(rangeArg).getTime()\n range = [timestamp, timestamp]\n } else {\n const rangeStart = rangeArg[0] != null ? DateHelper(rangeArg[0]) : MIN_SUPPORTED_DATE\n const rangeEnd = rangeArg[1] != null ? DateHelper(rangeArg[1]) : MAX_SUPPORTED_DATE\n\n range = [rangeStart.getTime(), rangeEnd.getTime()]\n }\n\n return range\n}\n\n/**\n * Add the given `value` to the provided `unit` of the provided `date`.\n * @param {Date} date - Date where the operation should be performed.\n * @param {Unit} unit - period\n * @param {number} value - value to be added\n * @returns {Date} new date after the operation.\n */\nfunction add(date: Date, unit: Unit, value: number): CalendarDate {\n const increment = {\n year: 0,\n month: 0,\n day: 0,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n [unit]: value,\n }\n\n const newDate = new Date(\n Date.UTC(\n date.getUTCFullYear() + increment.year,\n date.getUTCMonth() + increment.month,\n date.getUTCDate() + increment.day,\n date.getUTCHours() + increment.hour,\n date.getUTCMinutes() + increment.minute,\n date.getUTCSeconds() + increment.second,\n date.getUTCMilliseconds() + increment.millisecond\n )\n )\n\n // Do not normalize the clone since all units must be preserved.\n return DateHelper(newDate, { normalize: false })\n}\n\n/**\n * Wrap range constraint into a function and return a function constraint untouched.\n * @param {CalendarConstraint} constraint\n * @returns {(day: CalendarDate) => boolean}\n */\nexport function getConstraintEvaluator(\n constraint: CalendarConstraint\n): (day: CalendarDate) => boolean {\n if (isFunction(constraint)) {\n return constraint\n }\n\n const [start, end] = getConstraintRange(constraint)\n\n return function matches(day: CalendarDate): boolean {\n if (start > end) {\n throw new InvalidDateConstraintError([start, end])\n }\n\n return start <= day.getTime() && day.getTime() <= end\n }\n}\n\nexport function padded(value: number | string, maxLength = 2): string {\n return String(value).padStart(maxLength, '0')\n}\n\nexport class InvalidDateConstraintError extends Error {\n constructor([start, end]: [number, number]) {\n super(`Invalid constraint: [${start}, ${end}]`)\n }\n}\n\nexport const TODAY = DateHelper()\n\n/**\n * Maximum and minimum supported `Date`.\n * Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps\n */\nexport const MIN_SUPPORTED_DATE = DateHelper(0, { normalize: false })\nexport const MAX_SUPPORTED_DATE = DateHelper(8.64e15 - 1)\n\nexport default DateHelper\n","import { useEffect, useState } from 'react'\n\nimport { useDidMount } from 'hooks/useDidMount'\nimport toArray from 'utils/toolset/toArray'\n\nimport DateHelper, { TODAY } from './Date.helper'\nimport type { useCalendarProps, useCalendarReturn, RenderableMonth } from './Calendar.types'\n\nfunction useCalendar(props: useCalendarProps): useCalendarReturn {\n const { constraints, onSelect, mode = 'single' } = props\n const amountOfMonthsToRender = mode == 'single' ? 1 : 2\n\n const didMount = useDidMount()\n const [selected, setSelected] = useState<ReturnType<typeof getSelectionPair>>(() =>\n getSelectionPair(props.selected)\n )\n const [renderableMonths, setRenderableMonths] = useState<ReturnType<typeof getRenderableMonths>>(\n () => {\n const month = props.month != null ? props.month : TODAY.getMonth()\n const year = props.year != null ? props.year : TODAY.getYear()\n\n return getRenderableMonths(year, month, amountOfMonthsToRender)\n }\n )\n\n /**\n * Set the month to be rendered (or initial month when calendar is in range mode).\n * @param {Object} args\n * @param {number} [args.month] - Initial month to be rendered, if not provided, the current initial month will be used.\n * @param {number} [args.year] - Initial year to be rendered, if not provided, the current initial month will be used.\n */\n function set(args: { month?: number; year?: number }) {\n const [initialMonth] = renderableMonths\n const date = new Date(args.year ?? initialMonth.year, args.month ?? initialMonth.month)\n\n setRenderableMonths(\n getRenderableMonths(date.getFullYear(), date.getMonth(), amountOfMonthsToRender)\n )\n }\n\n /**\n * Select day or day range.\n * @param range `null` to clear selection, selection range start, or an array with selection start and end.\n */\n function select(range: useCalendarProps['selected']) {\n const [start, end] = getSelectionPair(range)\n\n function getSelectionBoundary(boundary?: string | number | null): string | null {\n if (boundary != null) {\n return DateHelper(boundary).toString()\n }\n\n return null\n }\n\n setSelected([start, end])\n\n if (didMount) {\n // prevent calling onSelect when initialized with value\n onSelect?.([getSelectionBoundary(start), getSelectionBoundary(end)])\n }\n }\n\n /**\n * Clear calendar selection.\n */\n function clear() {\n select([null, null])\n }\n\n useEffect(\n function onMonthOrYearPropsChange() {\n set({\n month: props.month,\n year: props.year,\n })\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.month, props.year]\n )\n\n useEffect(\n function onSelectedPropChange() {\n const newSelected = getSelectionPair(props.selected)\n\n if (newSelected[0] != selected[0] || newSelected[1] != selected[1]) {\n setSelected(newSelected)\n }\n },\n // we just intend to update the internal state when the prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.selected]\n )\n\n return {\n mode,\n months: renderableMonths,\n selected,\n constraints: toArray(constraints || []),\n clear,\n set,\n select,\n }\n}\n\nconst DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000\n\n/**\n * Generate the whole grid of days,\n * @param {number} year\n * @param {number }month\n * @returns {RenderableMonth}\n */\nexport function getRenderableMonth(year: number, month: number): RenderableMonth {\n const date = DateHelper(Date.UTC(year, month))\n\n const firstDayOfTheWeek = date.getWeekday()\n const totalDaysInMonth = 32 - new Date(Date.UTC(year, month, 32)).getUTCDate()\n\n const days = []\n\n /**\n * Filling days of previous month.\n * If the month does not start on Sunday, then we need to generate only the days of\n * the previous month to fill out the grid.\n */\n for (let index = firstDayOfTheWeek; index > 0; index--) {\n days.push(DateHelper(date.getTime() - index * DAY_IN_MILLISECONDS))\n }\n\n // Filling days of current month\n for (let index = 0; index < totalDaysInMonth; index++) {\n days.push(DateHelper(date.getTime() + index * DAY_IN_MILLISECONDS))\n }\n\n /**\n * Filling days of next month, just enough to complete the grid.\n */\n for (let index = 0; (firstDayOfTheWeek + totalDaysInMonth + index) % 7 != 0; index++) {\n days.push(DateHelper(date.getTime() + (totalDaysInMonth + index) * DAY_IN_MILLISECONDS))\n }\n\n return {\n month: date.getMonth(),\n year: date.getYear(),\n days,\n }\n}\n\n/**\n *\n * @param {number} year\n * @param {number} month\n * @param {number?} amount - number of months to be generated. Default value is 1.\n * @returns\n */\nexport function getRenderableMonths(\n year: number,\n month: number,\n amount = 1\n): ReturnType<typeof getRenderableMonth>[] {\n if (month < 0 || month > 11) {\n throw new Error(\n 'Invalid month! Please, provide a number between 0 (January) and 11 (December).'\n )\n }\n\n // TODO: validate accepted year range?\n\n const months = new Array<ReturnType<typeof getRenderableMonth>>()\n\n for (let i = 0; i < amount; i++) {\n months.push(getRenderableMonth(year, month + i))\n }\n\n return months\n}\n\nexport function getSelectionPair(\n selected?: null | [string | number | null, string | number | null]\n): [number | null, number | null] {\n const [start, end] = toArray(selected)\n\n return [\n start != null ? DateHelper(start).getTime() : null,\n end != null ? DateHelper(end ?? start).getTime() : null,\n ]\n}\n\nexport default useCalendar\n","export const getOrdinalSuffix = (number: number): 'st' | 'nd' | 'rd' | 'th' => {\n if (number % 10 === 1 && number !== 11) {\n return 'st'\n }\n\n if (number % 10 === 2 && number !== 12) {\n return 'nd'\n }\n\n if (number % 10 === 3 && number !== 13) {\n return 'rd'\n }\n\n return 'th'\n}\n","import { identity } from '@loadsmart/utils-function'\nimport { padded } from './Date.helper'\n\nimport type { CalendarDate } from './Date.helper'\nimport { getOrdinalSuffix } from 'utils/toolset/getOrdinalSuffix'\n\nexport interface DateFormat {\n format(date: CalendarDate): string\n}\n\nconst getTokenValue = (date: CalendarDate, token: string) => {\n const value = DEFAULT_FORMATTERS[token].format(date.get())\n\n return (ADDITIONAL_FORMATTERS[token] || identity)(value)\n}\n\n/**\n * This helpers provides a convenient layer on top of `Intl.DateTimeFormat`,\n * using common tokens (based on `momentjs`) to format dates.\n */\nexport default function DateFormatHelper(format: string): DateFormat {\n const tokens = tokenizer(format)\n\n return {\n format(date: CalendarDate) {\n return tokens\n .map((token, index) => {\n const previousIndex = index - 1\n const previousToken = tokens[previousIndex]\n\n if (token in DEFAULT_FORMATTERS) {\n return getTokenValue(date, token)\n }\n\n if (token in COMPOUND_FORMATTERS && COMPOUND_FORMATTERS[token].valid(previousToken)) {\n return COMPOUND_FORMATTERS[token].format(getTokenValue(date, previousToken))\n }\n\n return token\n })\n .join('')\n },\n }\n}\n\n/**\n * Supported tokens:\n *\n *| | Token | Output |\n *| :----------------------------- | :---- | :---------------------------------------- |\n *| Month | MM | 01, 02, ..., 11, 12 |\n *| | MMM | Jan, Feb, ..., Nov, Dec |\n *| | MMMM | January, February, ..., November,December |\n *| Day of Month | D | 1, 2, ..., 30, 31 |\n *| Day of Month with leading 0 | DD | 01, 02, ..., 30, 31 |\n *| Day of week | ddd | Sun, Mon, ... Fri, Sat |\n *| | dddd | Sunday, Monday, ..., Friday, Saturday |\n *| Year | YYYY | 1970, 1971, ..., 2029, 2030 |\n *| Hour | HH | 00, 01, ..., 22, 23 |\n *| | hh | 00, 01, ..., 11, 12 |\n *| Minute | mm | 01, 02, ..., 58, 59 |\n *| Seconds | ss | 01, 02, ..., 58, 59 |\n *| Post or ante meridiem | a | am, pm |\n *| | A | AM, PM |\n *| Ordinal numbers | o | 1st, 2nd, 3rd, ..., 10th |\n *| Scaped sequence | [] | |\n *\n * @param format\n * @returns\n */\nexport function tokenizer(format: string): string[] {\n function getType(char?: string): string {\n if (\n char != undefined &&\n ['M', 'd', 'D', 'Y', 'H', 'h', 'm', 's', 'A', 'a', 'o'].includes(char)\n ) {\n return 'token'\n }\n\n return 'string'\n }\n\n const tokens: string[] = []\n\n let i = 0\n let prev\n let isEscaping = false\n\n while (i < format.length) {\n const at = Math.max(0, tokens.length - 1)\n\n const char = format.charAt(i)\n i++\n\n if (['[', ']'].includes(char)) {\n isEscaping = char === '['\n } else if (isEscaping) {\n tokens[at] = `${tokens[at] || ''}${char}`\n } else if (prev !== char && [getType(prev), getType(char)].includes('token')) {\n // we just need to start a new piece of string if we found a possible valid token\n tokens.push(char)\n } else {\n tokens[at] = `${tokens[at] || ''}${char}`\n }\n\n prev = char\n }\n\n return tokens\n}\n\n/**\n * TODO: Evaluate the need to add the following pollyfills:\n * - https://formatjs.io/docs/polyfills/intl-datetimeformat/\n * - https://formatjs.io/docs/polyfills/intl-getcanonicallocales/\n * - https://formatjs.io/docs/polyfills/intl-locale/\n * - https://formatjs.io/docs/polyfills/intl-numberformat/\n * - https://formatjs.io/docs/polyfills/intl-pluralrules/\n */\nconst DEFAULT_FORMATTERS: Record<string, Intl.DateTimeFormat> = {\n MM: new Intl.DateTimeFormat('en-US', {\n month: '2-digit',\n }),\n MMM: new Intl.DateTimeFormat('en-US', {\n month: 'short',\n }),\n MMMM: new Intl.DateTimeFormat('en-US', {\n month: 'long',\n }),\n D: new Intl.DateTimeFormat('en-US', {\n day: 'numeric',\n }),\n DD: new Intl.DateTimeFormat('en-US', {\n day: '2-digit',\n }),\n ddd: new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n }),\n dddd: new Intl.DateTimeFormat('en-US', {\n weekday: 'long',\n }),\n YYYY: new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n }),\n HH: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hourCycle: 'h23',\n }),\n hh: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hour12: true,\n }),\n mm: new Intl.DateTimeFormat('en-US', {\n minute: '2-digit',\n hour12: false,\n }),\n ss: new Intl.DateTimeFormat('en-US', {\n second: '2-digit',\n hour12: false,\n }),\n a: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hour12: true,\n }),\n A: new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n hour12: true,\n }),\n}\n\n/**\n * Apply additional formatting.\n *\n * Padding, for example, is applied in some cases due to [this](https://bugs.chromium.org/p/chromium/issues/detail?id=527926) bug.\n */\nconst ADDITIONAL_FORMATTERS: Record<string, (value: string) => string> = {\n hh: (value: string) => (value ? padded(value.split(/\\s/)[0], 2) : value),\n HH: (value: string) => (value ? padded(value, 2) : value),\n mm: (value: string) => (value ? padded(value, 2) : value),\n ss: (value: string) => (value ? padded(value, 2) : value),\n a: (value: string) => (value ? (value.split(/\\s/)[1] || '').toLowerCase() : value),\n A: (value: string) => (value ? (value.split(/\\s/)[1] || '').toUpperCase() : value),\n}\n\ntype CompoundFormatter = {\n valid: (token: string) => boolean\n format: (value: string) => string\n}\n\nconst COMPOUND_FORMATTERS: Record<string, CompoundFormatter> = {\n o: {\n valid: (token) => new Set(['D', 'DD']).has(token),\n format: (value: string) => getOrdinalSuffix(parseInt(value, 10)),\n },\n}\n","import styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport activatable from 'styles/activatable'\nimport conditional, { whenProps } from 'tools/conditional'\nimport disableable from 'styles/disableable'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport typography from 'styles/typography'\n\nconst PickerButton = styled(BaseButton)<{\n $status:\n | 'default'\n | 'current-day'\n | 'faded'\n | 'selection-start'\n | 'selection-end'\n | 'selection'\n | 'next-month-day'\n}>`\n ${typography(\n conditional({\n body: whenProps({ $status: ['default', 'faded'] }),\n 'body-bold': whenProps({\n $status: ['current-day', 'selection-start', 'selection', 'selection-end'],\n }),\n })\n )}\n\n user-select: none;\n\n height: 100%;\n\n border-radius: 0;\n\n color: ${conditional({\n 'color-neutral-lighter': whenProps({\n $status: ['selection-start', 'selection', 'selection-end'],\n }),\n 'color-neutral-darker': whenProps({ $status: ['default', 'faded'] }),\n 'color-neutral-dark': whenProps({ $status: 'next-month-day' }),\n 'color-accent': whenProps({ $status: 'current-day' }),\n })};\n\n background: ${conditional({\n 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),\n 'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),\n 'color-neutral': whenProps({ $status: 'selection' }),\n 'color-neutral-lightest': whenProps({ $status: 'current-day' }),\n })};\n\n border-color: ${conditional({\n 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),\n 'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),\n 'color-neutral': whenProps({ $status: 'selection' }),\n 'color-neutral-light': whenProps({ $status: 'current-day' }),\n })};\n\n ${conditional({\n 'opacity: 0.4;': whenProps({ $status: 'faded' }),\n 'opacity: 1;': whenProps({ $status: (status) => status !== 'faded' }),\n })}\n\n padding: ${token('space-xs')} ${token('space-s')};\n\n ${hoverable`\n border-color: ${token('color-neutral')};\n background-color: ${conditional({\n 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),\n 'color-neutral-dark': whenProps({\n $status: ['selection-start', 'selection', 'selection-end'],\n }),\n 'color-neutral-lightest': whenProps({ $status: 'current-day' }),\n })};\n color: ${conditional({\n 'color-neutral-dark': whenProps({ $status: ['default', 'faded'] }),\n 'color-neutral-lightest': whenProps({\n $status: ['selection-start', 'selection', 'selection-end'],\n }),\n })};\n\n font-weight: ${token('font-weight-bold')};\n `}\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n font-weight: ${token('font-weight-bold')};\n `}\n\n ${activatable`\n border-color: ${token('color-neutral')};\n background-color: ${conditional({\n 'color-transparent': whenProps({ 'aria-checked': false }),\n 'color-neutral': whenProps({ 'aria-checked': true }),\n })};\n color: ${conditional({\n 'color-neutral': whenProps({ 'aria-checked': false }),\n 'color-neutral-white': whenProps({ 'aria-checked': true }),\n })};\n `}\n\n ${disableable`\n background-color: ${token('color-transparent')};\n border-color: ${conditional({\n 'color-neutral-darkest': whenProps({ 'aria-checked': true }),\n 'color-transparent': whenProps({ 'aria-checked': false }),\n })};\n\n color: ${token('color-neutral-darker')};\n `}\n\n visibility: ${conditional({\n visible: whenProps({ 'aria-hidden': false }),\n hidden: whenProps({ 'aria-hidden': true }),\n })};\n`\n\nexport default styled(PickerButton)({})\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport { Text as DefaultText } from 'components/Text'\nimport { TODAY } from '../Date.helper'\nimport DateFormatHelper from '../DateFormat.helper'\nimport PickerButton from './PickerButton'\n\nimport type { CalendarDate } from '../Date.helper'\nimport type { CalendarPickerProps, RenderableMonth, useCalendarReturn } from '../Calendar.types'\n\nexport const WEEKDAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nfunction getStatus(calendar: useCalendarReturn, date: CalendarDate) {\n const isPastYearDay =\n date.getYear() < calendar.months[0].year && date.getMonth() > calendar.months[0].month\n\n if (calendar.selected[0] == date.getTime()) {\n return 'selection-start'\n } else if (calendar.selected[1] == date.getTime()) {\n return 'selection-end'\n } else if (\n calendar.selected[0] != null &&\n date.getTime() > calendar.selected[0] &&\n calendar.selected[1] != null &&\n date.getTime() < calendar.selected[1]\n ) {\n return 'selection'\n } else if (\n calendar.mode === 'single' &&\n (isPastYearDay || date.getMonth() < calendar.months[0].month)\n ) {\n return 'faded'\n } else if (calendar.mode === 'single' && date.getMonth() > calendar.months[0].month) {\n return 'next-month-day'\n } else if (date.getTime() == TODAY.getTime()) {\n return 'current-day'\n }\n\n return 'default'\n}\n\nconst Text = styled(DefaultText)`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n user-select: none;\n`\n\nconst Grid = styled.div`\n display: grid;\n grid-gap: ${token('space-2xs')};\n grid-template-rows: 1.25rem repeat(auto-fill, 2.5rem);\n grid-template-columns: repeat(7, 2.5rem);\n`\n\n/**\n * filling days of previous month\n * TODO: supress this for range selection\n */\nfunction CalendarDayPicker({ calendar, onDayClick }: CalendarPickerProps): JSX.Element {\n function renderDaysOfWeek() {\n return WEEKDAYS.map((weekday) => (\n <Text\n key={weekday}\n as=\"abbr\"\n variant=\"chips-sm\"\n color=\"color-neutral\"\n style={{ textDecoration: 'none' }}\n >\n {weekday}\n </Text>\n ))\n }\n\n function renderDaysOfMonth(month: RenderableMonth) {\n const constraints = calendar.constraints || []\n\n return month.days.map((day) => {\n const status = getStatus(calendar, day)\n const formatted = formatter.format(day)\n const isDisabled = day.matches(...constraints)\n\n if (calendar.mode === 'range' && day.getMonth() !== month.month) {\n return <span key={formatted} aria-hidden></span>\n }\n\n return (\n <PickerButton\n key={formatted}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={['selection-start', 'selection', 'selection-end'].includes(status)}\n aria-label={formatted}\n disabled={isDisabled}\n onClick={() => {\n if (!isDisabled && onDayClick) {\n onDayClick(day.getTime())\n }\n }}\n $status={status}\n >\n <time dateTime={day.toString()}>{day.getDate()}</time>\n </PickerButton>\n )\n })\n }\n\n return (\n <Group>\n {calendar.months.map((month) => {\n return (\n <Grid key={`${month.year}${month.month}`} role=\"group\" data-testid=\"calendar-day-picker\">\n {renderDaysOfWeek()}\n {renderDaysOfMonth(month)}\n </Grid>\n )\n })}\n </Group>\n )\n}\n\nexport default CalendarDayPicker\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport MonthHelper from '../Month.helper'\nimport PickerButton from './PickerButton'\n\nimport type { useCalendarReturn, CalendarPickerProps } from '../Calendar.types'\nimport type { CalendarMonth, CalendarMonthAlias } from '../Month.helper'\n\nconst Container = styled.div`\n display: grid;\n grid-auto-rows: 3.75rem;\n grid-gap: ${token('space-2xs')};\n grid-template-columns: repeat(3, 1fr);\n`\n\nfunction getStatus(calendar: useCalendarReturn, month: CalendarMonth) {\n if (calendar.months[0].month == month.index) {\n return 'selection-start'\n }\n\n return 'default'\n}\n\nfunction CalendarMonthPicker({ calendar, mode }: CalendarPickerProps): JSX.Element {\n return (\n <Container role=\"radiogroup\" data-testid=\"calendar-month-picker\">\n {MonthHelper.getAll().map((month) => (\n <PickerButton\n key={month.index}\n type=\"button\"\n role=\"radio\"\n aria-checked={month.index == calendar.months[0].month}\n aria-label={`Select month ${month.name}`}\n onClick={() => {\n calendar.set({ month: month.index })\n mode.dispatch({ type: 'set-mode', payload: 'day-picker' })\n }}\n $status={getStatus(calendar, month)}\n >\n <time dateTime={`${calendar.months[0].year}-${month.index + 1}`}>\n {MonthHelper(month.name as CalendarMonthAlias).format('short')}\n </time>\n </PickerButton>\n ))}\n </Container>\n )\n}\n\nexport default CalendarMonthPicker\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken as token } from 'theming'\nimport DefaultPickerButton from './PickerButton'\nimport range from 'utils/toolset/range'\n\nimport type { useCalendarReturn, CalendarPickerProps } from '../Calendar.types'\n\nconst Container = styled.div`\n display: grid;\n grid-auto-rows: 2.875rem;\n grid-gap: ${token('space-2xs')};\n grid-template-columns: repeat(4, 1fr);\n`\n\nconst PickerButton = styled(DefaultPickerButton)`\n block-size: 46px;\n`\n\nfunction getStatus(calendar: useCalendarReturn, year: number) {\n if (calendar.months[0].year == year) {\n return 'selection-start'\n }\n\n return 'default'\n}\n\nfunction CalendarYearPicker({ calendar, mode }: CalendarPickerProps): JSX.Element {\n return (\n <Container role=\"radiogroup\" data-testid=\"calendar-year-picker\">\n {range(2012, 2032).map((year) => (\n <PickerButton\n key={year}\n type=\"button\"\n role=\"radio\"\n aria-checked={year == calendar.months[0].year}\n aria-label={`Select year ${year}`}\n onClick={() => {\n calendar.set({ year })\n mode.dispatch({ type: 'set-mode', payload: 'month-picker' })\n }}\n $status={getStatus(calendar, year)}\n >\n {year}\n </PickerButton>\n ))}\n </Container>\n )\n}\n\nexport default CalendarYearPicker\n","import { useReducer } from 'react'\n\nimport DayPicker from './Pickers/DayPicker'\nimport MonthPicker from './Pickers/MonthPicker'\nimport YearPicker from './Pickers/YearPicker'\n\nimport type {\n PickerMode,\n PickerModeAction,\n usePickerModeProps,\n usePickerModeReturn,\n} from './Calendar.types'\n\nfunction usePickerMode(props?: usePickerModeProps): usePickerModeReturn {\n function reducer(state: PickerMode, action: PickerModeAction) {\n switch (action.type) {\n case 'set-mode':\n return action.payload\n case 'toggle-mode':\n if (state != action.payload) {\n return action.payload\n }\n\n return 'day-picker'\n default:\n return state\n }\n }\n\n const [mode, dispatch] = useReducer(reducer, props?.mode || 'day-picker')\n\n return {\n get() {\n return mode\n },\n is(other: PickerMode) {\n return other != null && other === mode\n },\n dispatch,\n Picker: {\n 'day-picker': DayPicker,\n 'month-picker': MonthPicker,\n 'year-picker': YearPicker,\n }[mode],\n }\n}\n\nexport default usePickerMode\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { BaseButton } from 'components/Button'\nimport { getToken as token } from 'theming'\nimport { Group, Stack } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport conditional, { whenProps } from 'tools/conditional'\nimport focusable from 'styles/focusable'\nimport hoverable from 'styles/hoverable'\nimport MonthHelper from './Month.helper'\nimport PickerModeToggle from './PickerModeToggle'\nimport typography from 'styles/typography'\nimport useCalendar from './useCalendar'\nimport usePickerMode from './usePickerMode'\n\nimport type { CalendarMonthAlias } from './Month.helper'\nimport type { CalendarProps, GenericCalendarProps } from './Calendar.types'\n\nconst Container = styled(Stack)`\n ${typography('body')}\n min-width: calc((7 * 2.5rem) + (6 * ${token('space-2xs')}));\n`\n\nconst BorderlessButton = styled(BaseButton)`\n ${typography('body-bold')}\n border-color: transparent;\n background-color: transparent;\n\n color: ${token('color-neutral')};\n\n inline-size: 40px;\n\n visibility: ${conditional({\n visible: whenProps({ 'aria-hidden': false }),\n hidden: whenProps({ 'aria-hidden': true }),\n })};\n\n ${hoverable`\n color: ${token('color-neutral-dark')};\n `}\n\n ${focusable`\n box-shadow: ${token('button-primary-outline')};\n `}\n`\n\n/**\n * Implementation based on\n * * https://medium.com/swlh/build-a-date-picker-in-15mins-using-javascript-react-from-scratch-f6932c77db09\n * * https://codepen.io/zellwk/pen/xNpKwp\n */\nexport function GenericCalendar(props: GenericCalendarProps): JSX.Element {\n const { calendar, onDayClick, onMonthClick, onYearClick, ...others } = props\n const mode = usePickerMode()\n\n const { Picker } = mode\n\n return (\n <Container space=\"xs\" {...others}>\n <Group>\n <BorderlessButton\n type=\"button\"\n aria-label=\"Navigate to previous month\"\n aria-hidden={!mode.is('day-picker')}\n onClick={() => {\n calendar.set({ month: calendar.months[0].month - 1 })\n }}\n >\n <Icon name=\"caret-left\" size={16} />\n </BorderlessButton>\n\n {calendar.months.map((month) => {\n return (\n <Group key={month.month} space=\"xs\" align=\"center\" justify=\"center\" style={{ flex: 1 }}>\n <PickerModeToggle\n aria-label=\"Open month selection\"\n onClick={() => {\n mode.dispatch({ type: 'toggle-mode', payload: 'month-picker' })\n }}\n expanded={mode.is('month-picker')}\n disabled={calendar.mode == 'range'}\n >\n {MonthHelper(month.month as CalendarMonthAlias).format('long')}\n </PickerModeToggle>\n\n <PickerModeToggle\n aria-label=\"Open year selection\"\n onClick={() => {\n mode.dispatch({ type: 'toggle-mode', payload: 'year-picker' })\n }}\n expanded={mode.is('year-picker')}\n disabled={calendar.mode == 'range'}\n >\n {month.year}\n </PickerModeToggle>\n </Group>\n )\n })}\n <BorderlessButton\n type=\"button\"\n aria-label=\"Navigate to next month\"\n aria-hidden={!mode.is('day-picker')}\n onClick={() => {\n calendar.set({ month: calendar.months[0].month + 1 })\n }}\n >\n <Icon name=\"caret-right\" size={16} />\n </BorderlessButton>\n </Group>\n\n <Picker\n calendar={calendar}\n mode={mode}\n onDayClick={onDayClick}\n onMonthClick={onMonthClick}\n onYearClick={onYearClick}\n />\n </Container>\n )\n}\n\nfunction Calendar(props: CalendarProps): JSX.Element {\n const { year, month, selected, constraints, onSelect, mode, ...rest } = props\n const calendar = useCalendar({ year, month, selected, constraints, mode, onSelect })\n\n return <GenericCalendar calendar={calendar} {...rest} />\n}\n\nexport default Calendar\n","import DateFormatHelper from './DateFormat.helper'\nimport DateHelper from './Date.helper'\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nexport function getSelection(\n selection?: number | string | null | [number | string | null, number | string | null]\n): [null | number, null | number] {\n const [start, end] = Array.isArray(selection) ? selection : [selection, selection]\n\n return [\n start != null ? DateHelper(start).getTime() : null,\n end != null ? DateHelper(end).getTime() : null,\n ]\n}\n","import { useEffect, useRef } from 'react'\n\nimport { useDropdown } from 'components/Dropdown'\nimport { TODAY, DateFormatHelper, DateHelper, useCalendar } from 'components/Calendar'\n\nimport { getSelection } from '../Calendar/Calendar.helpers'\n\nimport type { CalendarDate } from 'components/Calendar'\nimport type { DatePickerProps } from './DatePicker.types'\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nexport function formatDate(date?: number | string | null): string {\n if (!date || Number.isNaN(new Date(date).getTime())) {\n return ''\n }\n\n return formatter.format(DateHelper(date))\n}\n\nexport function getInitialCalendarSetup(\n selection: number | string | null | [number | string | null, number | string | null]\n) {\n const [selectionStart] = getSelection(selection)\n\n if (!selectionStart) {\n return {\n month: TODAY.getMonth(),\n year: TODAY.getYear(),\n }\n }\n\n const startDate = DateHelper(selectionStart)\n\n return {\n month: startDate.getMonth(),\n year: startDate.getYear(),\n }\n}\n\nexport function setInputValue(input: HTMLInputElement | null, value: string) {\n if (input != null) {\n input.value = value\n }\n}\n\nexport function getInputValue(input?: HTMLInputElement | null) {\n if (input != null) {\n return input.value\n }\n\n return null\n}\n\nfunction useDatePicker(props: DatePickerProps) {\n const { constraints, disabled, id, name, onChange, value, ...rest } = props\n\n const dropdown = useDropdown({ disabled })\n const calendar = useCalendar({\n mode: 'single',\n constraints,\n onSelect: handleDateSelect,\n })\n\n const inputRef = useRef<HTMLInputElement>()\n\n function handleDateSelect(selection: [string | null, string | null]) {\n if (!inputRef.current) {\n return\n }\n\n const [formattedDate] = getSelection(selection).map(formatDate)\n\n /**\n * This check ensures we will keep the valid date the user typed as-is and, since we're using\n * an uncontrolled input, ensures that the formatting that happens in `getFormattedSelection`\n * will not interfere with cursor position when we set the input value.\n * Bottom line is: if the input already contains the select date, no change is necessary.\n */\n if (formattedDate != formatDate(getInputValue(inputRef.current))) {\n setInputValue(inputRef.current, formattedDate)\n }\n\n onChange?.({ target: { id, name, value: selection[0] } })\n }\n\n function handleDateInputChange(date: CalendarDate) {\n if (date != null) {\n const timestamp = date.getTime()\n\n calendar.select([timestamp, timestamp])\n } else {\n calendar.clear()\n }\n }\n\n function handleDateInputClick() {\n if (!dropdown.expanded) {\n calendar.set(getInitialCalendarSetup(calendar.selected))\n dropdown.toggle()\n }\n }\n\n function handleDayClick(timestamp: number) {\n calendar.select([timestamp, timestamp])\n dropdown.collapse()\n }\n\n function handleClearClick() {\n calendar.clear()\n inputRef.current?.focus()\n }\n\n function getDropdownProps() {\n return {\n disabled,\n toggle: dropdown.toggle,\n expanded: dropdown.expanded,\n onBlur() {\n if (!inputRef.current) {\n return\n }\n\n const [currSelectedDate] = getSelection(calendar.selected).map(formatDate)\n const currInputValue = getInputValue(inputRef.current)\n\n if (currInputValue == currSelectedDate) {\n return\n }\n\n if (!currInputValue) {\n calendar.clear()\n } else {\n setInputValue(inputRef.current, currSelectedDate)\n }\n },\n }\n }\n\n function getCalendarProps() {\n return {\n ...rest.getCalendarProps?.(),\n calendar,\n onDayClick: handleDayClick,\n }\n }\n\n function getInputProps() {\n return {\n ...rest.getInputProps?.(),\n id,\n name,\n disabled,\n onChange: handleDateInputChange,\n onClick: handleDateInputClick,\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n inputRef.current = node\n }\n },\n }\n }\n\n function getClearProps() {\n return {\n onClick: handleClearClick,\n }\n }\n\n useEffect(\n function onValuePropChange() {\n if (!inputRef.current) {\n return\n }\n\n const [newSelection] = getSelection(value)\n const [currSelection] = calendar.selected\n\n if (newSelection != currSelection) {\n setInputValue(inputRef.current, formatDate(newSelection))\n\n calendar.select([newSelection, newSelection])\n calendar.set(getInitialCalendarSetup([newSelection, newSelection]))\n }\n },\n // we just intend to update the selection when the prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [value]\n )\n\n return {\n value: getSelection(calendar.selected).map(formatDate),\n\n getDropdownProps,\n getInputProps,\n getClearProps,\n getCalendarProps,\n }\n}\n\nexport default useDatePicker\n","import React, { useContext, forwardRef } from 'react'\nimport styled from 'styled-components'\n\nimport { DateFormatHelper, DateHelper, GenericCalendar } from 'components/Calendar'\nimport { Dropdown, DropdownContext, GenericDropdown } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport { TextField as DefaultTextField } from 'components/TextField'\nimport CloseButton from 'common/CloseButton'\nimport useDatePicker from './useDatePicker'\nimport { Popover } from 'components/Popover'\n\nimport type { CalendarDate } from 'components/Calendar'\nimport type { ChangeEvent } from 'react'\nimport type { DatePickerProps } from './DatePicker.types'\nimport type { TextFieldProps } from 'components/TextField'\n\n/**\n * https://www.regular-expressions.info/dates.html\n * https://learning.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s04.html#validation-dates-problem\n */\nconst DATE_REGEX = /^(1[0-2]|0?[1-9])\\/(3[01]|[12][0-9]|0?[1-9])\\/(19|20)\\d{2}$/\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nconst TextField = styled(DefaultTextField)`\n & > input {\n width: 10ch;\n }\n`\n\nconst DropdownMenu = styled(Dropdown.Menu)`\n width: max-content;\n min-width: initial;\n max-height: initial;\n padding: ${token('space-m')};\n overflow-y: initial;\n`\n\nexport const ClearButton = styled(CloseButton)`\n width: 1em;\n height: 1em;\n\n margin-left: calc(-1 * ${token('space-s')}); // compensate for input's padding-left\n`\n\ninterface DateInputProps extends Omit<TextFieldProps, 'onChange'> {\n onChange: (date: CalendarDate) => void\n}\n\nexport const DateInput = forwardRef<HTMLInputElement, DateInputProps>(function DateInput(\n props: DateInputProps,\n ref\n): JSX.Element {\n const { onChange, ...rest } = props\n const dropdown = useContext(DropdownContext)\n\n function handleInputChange(event: ChangeEvent<HTMLInputElement>) {\n const {\n target: { value },\n } = event\n\n if (!DATE_REGEX.test(value)) {\n return\n }\n\n onChange(DateHelper(value))\n }\n\n // TODO: use type=\"date\" when IE is no longer in the way\n return (\n <TextField\n placeholder=\"00/00/0000\"\n {...rest}\n ref={ref}\n type=\"text\"\n disabled={dropdown.disabled}\n leading={<Icon name=\"calendar\" />}\n onChange={handleInputChange}\n />\n )\n})\n\nfunction DatePicker(props: DatePickerProps): JSX.Element {\n const {\n id,\n name,\n value,\n onChange,\n disabled,\n constraints,\n getInputProps,\n getCalendarProps,\n placement,\n } = props\n\n const datePicker = useDatePicker({\n constraints,\n disabled,\n id,\n name,\n value,\n onChange,\n getInputProps,\n getCalendarProps,\n })\n\n function renderTrailing() {\n const [currSelectedDate] = datePicker.value\n\n if (!disabled && currSelectedDate) {\n return (\n <ClearButton\n size={12}\n type=\"button\"\n aria-label=\"Clear selection\"\n {...datePicker.getClearProps()}\n />\n )\n }\n\n return null\n }\n\n return (\n <GenericDropdown {...placement} {...datePicker.getDropdownProps()}>\n <Popover.Reference>\n <Group space=\"s\">\n <DateInput trailing={renderTrailing()} {...datePicker.getInputProps()} />\n </Group>\n </Popover.Reference>\n <DropdownMenu>\n <GenericCalendar {...datePicker.getCalendarProps()} />\n </DropdownMenu>\n </GenericDropdown>\n )\n}\n\nexport default DatePicker\n","import { useEffect, useRef } from 'react'\n\nimport { formatDate, getInitialCalendarSetup, getInputValue, setInputValue } from './useDatePicker'\nimport { getSelection } from '../Calendar/Calendar.helpers'\nimport { useCalendar } from 'components/Calendar'\nimport { useDropdown } from 'components/Dropdown'\n\nimport type { CalendarDate } from 'components/Calendar'\nimport type { DateRangePickerProps } from './DatePicker.types'\n\nconst AT_RANGE_START = 0\nconst AT_RANGE_END = 1\n\nfunction useDateRangePicker(props: DateRangePickerProps) {\n const { constraints, disabled, id, name, onChange, value, ...rest } = props\n\n const dropdown = useDropdown({ disabled })\n const calendar = useCalendar({\n mode: 'range',\n constraints,\n onSelect: handleDateSelect,\n })\n\n const inputsRef = useRef<[HTMLInputElement | null, HTMLInputElement | null]>([null, null])\n const currentlyPickingRef = useRef<'range-start' | 'range-end' | 'none'>('none')\n\n function handleDateSelect(selected: [string | null, string | null]) {\n ;[AT_RANGE_START, AT_RANGE_END].forEach((index) => {\n const input = inputsRef.current[index]\n const formattedDate = formatDate(selected[index])\n\n /**\n * This check ensures we will keep the valid date the user typed as-is and, since we're using\n * an uncontrolled input, ensures that the formatting that happens in `formatDate`\n * will not interfere with cursor position when we set the input value.\n * Bottom line is: if the input already contains the select date, no change is necessary.\n */\n if (formattedDate != formatDate(getInputValue(input))) {\n setInputValue(input, formattedDate)\n }\n })\n\n onChange?.({ target: { id, name, value: selected } })\n }\n\n function getDateInputChangeHandler(index: number) {\n return function handleDateInputChange(date: CalendarDate) {\n if (date != null) {\n const timestamp = date.getTime()\n\n const newSelected: typeof calendar.selected = [...calendar.selected]\n newSelected[index] = timestamp\n\n calendar.select(newSelected)\n } else {\n calendar.clear()\n }\n }\n }\n\n function handleDateInputClick() {\n if (!dropdown.expanded) {\n calendar.set(getInitialCalendarSetup(calendar.selected))\n dropdown.toggle()\n }\n }\n\n function handleDayClick(timestamp: number) {\n const [rangeStart, rangeEnd] = calendar.selected\n\n if (currentlyPickingRef.current == 'range-start') {\n if (rangeEnd != null) {\n calendar.select([timestamp, rangeEnd].sort() as [number, number])\n inputsRef.current[AT_RANGE_START]?.focus()\n } else {\n calendar.select([timestamp, rangeEnd])\n inputsRef.current[AT_RANGE_END]?.focus()\n }\n } else if (currentlyPickingRef.current == 'range-end') {\n if (rangeStart != null) {\n calendar.select([rangeStart, timestamp].sort() as [number, number])\n } else {\n calendar.select([rangeStart, timestamp])\n }\n\n inputsRef.current[AT_RANGE_END]?.focus()\n }\n }\n\n function handleClearClick() {\n calendar.clear()\n inputsRef.current[AT_RANGE_START]?.focus()\n }\n\n function handleDropdownBlur() {\n currentlyPickingRef.current = 'none'\n\n if ([AT_RANGE_START, AT_RANGE_END].some((index) => !inputsRef.current[index])) {\n return\n }\n\n if ([AT_RANGE_START, AT_RANGE_END].every((index) => !getInputValue(inputsRef.current[index]))) {\n calendar.clear()\n } else {\n const selected = getSelection(calendar.selected).map(formatDate)\n\n ;[AT_RANGE_START, AT_RANGE_END].forEach((index) => {\n setInputValue(inputsRef.current[index], selected[index])\n })\n }\n }\n\n function handleDoneClick() {\n handleDropdownBlur()\n dropdown.collapse()\n }\n\n function getDropdownProps() {\n return {\n disabled,\n toggle: dropdown.toggle,\n expanded: dropdown.expanded,\n onBlur: handleDropdownBlur,\n }\n }\n\n function getCalendarProps() {\n return {\n ...rest.getCalendarProps?.(),\n calendar,\n onDayClick: handleDayClick,\n }\n }\n\n function getRangeStartInputProps() {\n return {\n ...rest.getRangeStartInputProps?.(),\n id: id != null ? `${id}-start` : id,\n name: name != null ? `${name}-start` : name,\n disabled,\n onChange: getDateInputChangeHandler(AT_RANGE_START),\n onClick: handleDateInputClick,\n onFocus() {\n currentlyPickingRef.current = 'range-start'\n },\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n inputsRef.current[AT_RANGE_START] = node\n }\n },\n }\n }\n\n function getRangeEndInputProps() {\n return {\n ...rest.getRangeEndInputProps?.(),\n id: id != null ? `${id}-end` : id,\n name: name != null ? `${name}-end` : name,\n disabled,\n onChange: getDateInputChangeHandler(AT_RANGE_END),\n onClick: handleDateInputClick,\n onFocus() {\n currentlyPickingRef.current = 'range-end'\n },\n ref(node: HTMLInputElement | null) {\n if (node != null) {\n inputsRef.current[AT_RANGE_END] = node\n }\n },\n }\n }\n\n function getClearProps() {\n return {\n onClick: handleClearClick,\n }\n }\n\n function getDoneProps() {\n return {\n onClick: handleDoneClick,\n }\n }\n\n useEffect(\n function onValuePropChange() {\n if ([AT_RANGE_START, AT_RANGE_END].some((index) => !inputsRef.current[index])) {\n return\n }\n\n const newSelected = getSelection(value)\n const currSelected = calendar.selected\n\n const hasChanged = [AT_RANGE_START, AT_RANGE_END].some((index) => {\n return newSelected[index] != currSelected[index]\n })\n\n if (hasChanged) {\n ;[AT_RANGE_START, AT_RANGE_END].forEach((index) => {\n setInputValue(inputsRef.current[index], formatDate(newSelected[index]))\n })\n\n calendar.select(newSelected)\n calendar.set(getInitialCalendarSetup(newSelected))\n }\n },\n // we just intend to update the selection when the prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [value]\n )\n\n return {\n value: getSelection(calendar.selected).map(formatDate),\n\n getDropdownProps,\n getRangeStartInputProps,\n getRangeEndInputProps,\n getClearProps,\n getCalendarProps,\n getDoneProps,\n }\n}\n\nexport default useDateRangePicker\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { Button } from 'components/Button'\nimport { ClearButton, DateInput } from './DatePicker'\nimport { DateFormatHelper, GenericCalendar } from 'components/Calendar'\nimport { Dropdown, GenericDropdown } from 'components/Dropdown'\nimport { getToken as token } from 'theming'\nimport { Group } from 'components/Layout'\nimport { Popover } from 'components/Popover'\nimport useDateRangePicker from './useDateRangePicker'\n\nimport type { DateRangePickerProps } from './DatePicker.types'\n\nexport const formatter = DateFormatHelper('MM/DD/YYYY')\n\nconst DropdownMenu = styled(Dropdown.Menu)`\n width: max-content;\n min-width: initial;\n max-height: initial;\n padding: ${token('space-m')};\n overflow-y: initial;\n`\n\nconst DropdownFooter = styled.div`\n padding-right: ${token('space-m')};\n padding-left: ${token('space-m')};\n`\n\nfunction DateRangePicker(props: DateRangePickerProps): JSX.Element {\n const {\n id,\n name,\n value,\n onChange,\n disabled,\n constraints,\n getRangeStartInputProps,\n getRangeEndInputProps,\n getCalendarProps,\n placement,\n } = props\n\n const dateRangePicker = useDateRangePicker({\n constraints,\n disabled,\n id,\n name,\n value,\n onChange,\n getRangeStartInputProps,\n getRangeEndInputProps,\n getCalendarProps,\n })\n\n function renderRangeEndTrailing() {\n const [currRangeStart, currRangeEnd] = dateRangePicker.value\n\n if (!disabled && (currRangeStart || currRangeEnd)) {\n return (\n <ClearButton\n size={12}\n type=\"button\"\n aria-label=\"Clear selection\"\n {...dateRangePicker.getClearProps()}\n />\n )\n }\n\n return null\n }\n\n function renderDropdownFooter() {\n return (\n <DropdownFooter>\n <Group space=\"s\" justify=\"flex-end\">\n <Button type=\"button\" scale=\"small\" {...dateRangePicker.getClearProps()}>\n Clear\n </Button>\n <Button type=\"button\" scale=\"small\" variant=\"primary\" {...dateRangePicker.getDoneProps()}>\n Done\n </Button>\n </Group>\n </DropdownFooter>\n )\n }\n\n return (\n <GenericDropdown {...placement} {...dateRangePicker.getDropdownProps()}>\n <Popover.Reference>\n <Group space=\"s\">\n <DateInput\n {...dateRangePicker.getRangeStartInputProps()}\n data-testid=\"input-date-range-start\"\n />\n <DateInput\n trailing={renderRangeEndTrailing()}\n {...dateRangePicker.getRangeEndInputProps()}\n data-testid=\"input-date-range-end\"\n />\n </Group>\n </Popover.Reference>\n <DropdownMenu footer={renderDropdownFooter()}>\n <GenericCalendar {...dateRangePicker.getCalendarProps()} />\n </DropdownMenu>\n </GenericDropdown>\n )\n}\n\nexport default DateRangePicker\n","import React from 'react'\n\nimport { TextProps, Text } from 'components/Text'\n\nexport type ErrorMessageProps = Partial<TextProps>\n\nconst ErrorMessage = ({ children, ...props }: ErrorMessageProps) => {\n if (!children) {\n return null\n }\n\n return (\n <Text as=\"p\" variant=\"caption-bold\" color=\"color-danger\" {...props}>\n {children}\n </Text>\n )\n}\n\nexport default ErrorMessage\n","import React from 'react'\nimport styled from 'styled-components'\n\nimport { getToken } from 'theming'\nimport conditional, { whenProps } from 'tools/conditional'\nimport prop from 'tools/prop'\nimport transition from 'styles/transition'\nimport hoverable from 'styles/hoverable'\nimport focusable from 'styles/focusable'\nimport disableable from 'styles/disableable'\nimport hidden from 'styles/hidden'\n\nimport { StackProps, Stack } from 'components/Layout/Stack'\nimport { Icon } from 'components/Icon'\n\nimport type { DropZoneProps } from './types'\n\nexport const DragDropFileWrapper = styled(Stack)<{ withFileList: boolean }>`\n width: 100%;\n\n & > label + p {\n margin-top: ${conditional({\n 'space-m': whenProps({ withFileList: true }),\n 'space-l': whenProps({ withFileList: false }),\n })};\n }\n`\n\nexport const DropZoneWrapper = styled((props: StackProps) => <Stack as=\"label\" {...props} />)<\n Pick<DropZoneProps, 'disabled' | 'error'>\n>`\n ${transition({ property: 'border-color, box-shadow, opacity' })}\n\n cursor: pointer;\n\n background-color: ${getToken('color-neutral-white')};\n border-radius: ${getToken('border-radius-s')};\n border: 2px dashed;\n border-color: ${conditional({\n 'color-neutral-light': whenProps({ error: false }),\n 'color-danger': whenProps({ disabled: false, error: true }),\n })};\n\n padding: ${getToken('space-l')} ${getToken('space-3xl')};\n\n text-align: center;\n\n ${hoverable`\n border-color: ${conditional({\n 'color-accent': whenProps({ disabled: false, error: false }),\n })};\n `}\n\n ${focusable`\n border-color: ${conditional({\n 'color-accent': whenProps({ disabled: false, error: false }),\n })};\n box-shadow: ${getToken('shadow-glow-primary')};\n `}\n\n ${disableable()}\n`\n\nexport const HiddenInput = styled.input`\n ${hidden()}\n`\n\nexport const UploadIcon = styled(Icon)`\n color: ${getToken('color-neutral')};\n`\n\nexport const FileListUL = styled((props: StackProps) => <Stack as=\"ul\" {...props} />)`\n padding: 0;\n`\n\nexport const Divider = styled.div`\n width: 1px;\n height: 16px;\n\n background-color: ${getToken('color-neutral-darker')};\n`\n","import React from 'react'\n\nimport isEmpty from 'utils/toolset/isEmpty'\n\nimport { useDragDropFileContext } from '../DragDropFile.context'\nimport { DragDropFileWrapper } from '../styles'\nimport type { WrapperProps } from '../types'\n\n/**\n * This is a `Stack` component customized with the needed spacing between the DragDropFile inner components\n */\nconst Wrapper = ({ children, ...props }: WrapperProps) => {\n const { fileList } = useDragDropFileContext()\n\n return (\n <DragDropFileWrapper space=\"l\" withFileList={!isEmpty(fileList)} {...props}>\n {children}\n </DragDropFileWrapper>\n )\n}\n\nexport default Wrapper\n","import React, { useRef, useState, useCallback } from 'react'\nimport clsx from 'clsx'\n\nimport toArray from 'utils/toolset/toArray'\nimport KeyboardKey from 'utils/toolset/keyboard'\nimport pluralize from 'utils/toolset/pluralize'\n\nimport { Text } from 'components/Text'\n\nimport { useDragDropFileContext } from '../DragDropFile.context'\n\nimport { DropZoneWrapper, HiddenInput, UploadIcon } from '../styles'\nimport type { DropZoneProps } from '../types'\n\nconst DropZone = ({\n className,\n hint,\n multiple = false,\n accept,\n disabled = false,\n error = false,\n renderCustomContent,\n ...props\n}: DropZoneProps): JSX.Element => {\n const { onFilesAdded } = useDragDropFileContext()\n\n const inputRef = useRef<HTMLInputElement>(null)\n const [isDragging, setIsDragging] = useState(false)\n\n const onChangeInput = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n onFilesAdded(Array.from(event.currentTarget.files || []))\n },\n [onFilesAdded]\n )\n\n const onKeyPress = useCallback(\n (event: React.KeyboardEvent) => {\n if (!disabled && inputRef.current && KeyboardKey(event).is('ENTER')) {\n inputRef.current.click()\n }\n },\n [disabled, inputRef]\n )\n\n const onDrop = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!disabled) {\n if (isDragging) {\n setIsDragging(false)\n }\n\n onFilesAdded(Array.from(event.dataTransfer.files || []))\n }\n },\n [disabled, isDragging, onFilesAdded]\n )\n\n const onDragStart = useCallback((event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n }, [])\n\n const onDragOver = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n\n if (!disabled && !isDragging) {\n setIsDragging(true)\n }\n },\n [disabled, isDragging]\n )\n\n const onDragLeave = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n\n if (isDragging) {\n setIsDragging(false)\n }\n },\n [isDragging]\n )\n\n const renderDefaultContent = useCallback(\n () => (\n <>\n <UploadIcon name=\"upload\" size={48} />\n <Text variant=\"body\" color=\"color-neutral-darker\">\n {`Drag and drop your ${pluralize(Number(!multiple), 'files', 'file')} here or `}\n <Text as=\"a\" color={disabled ? 'color-neutral' : 'color-accent'} variant=\"body-bold\">\n {`Browse ${pluralize(Number(!multiple), 'Files', 'File')}`}\n </Text>\n </Text>\n {hint && (\n <Text variant=\"caption\" color=\"color-neutral-dark\">\n {hint}\n </Text>\n )}\n </>\n ),\n [multiple, disabled, hint]\n )\n\n return (\n <DropZoneWrapper\n space=\"m\"\n align=\"center\"\n justify=\"center\"\n className={clsx(className, {\n 'is-disabled': disabled,\n 'is-focused': isDragging,\n })}\n disabled={disabled}\n error={error}\n tabIndex={0}\n role=\"button\"\n aria-pressed=\"false\"\n onKeyPress={onKeyPress}\n onDrop={onDrop}\n onDragStart={onDragStart}\n onDragOver={onDragOver}\n onDragLeave={onDragLeave}\n >\n {(renderCustomContent || renderDefaultContent)({ isDragging })}\n <HiddenInput\n onInput={onChangeInput}\n type=\"file\"\n ref={inputRef}\n accept={accept ? toArray(accept).join(',') : undefined}\n disabled={disabled}\n multiple={multiple}\n {...props}\n />\n </DropZoneWrapper>\n )\n}\n\nexport default DropZone\n","export const BYTES_PER_KILOBYTE = 1024\nexport const FILE_SIZE_ABBREVIATIONS = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\nconst formatBytes = (bytes: number, decimals = 2) => {\n const bytesValue = Number(bytes)\n\n if (!bytesValue || bytesValue < 0) {\n return '0B'\n }\n\n const dm = Math.max(0, decimals)\n const unit = Math.floor(Math.log(bytesValue) / Math.log(BYTES_PER_KILOBYTE))\n const unitAbbr = FILE_SIZE_ABBREVIATIONS[Math.min(unit, FILE_SIZE_ABBREVIATIONS.length - 1)]\n\n return `${parseFloat((bytesValue / Math.pow(BYTES_PER_KILOBYTE, unit)).toFixed(dm))}${unitAbbr}`\n}\n\nexport default formatBytes\n","import React from 'react'\n\nimport formatBytes from 'utils/toolset/formatBytes'\n\nimport { Stack, Group } from 'components/Layout'\nimport { Bar } from 'components/Loaders/LoadingBar'\nimport { Button } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\n\nimport type { FileItemProps, FileStatus } from '../types'\nimport { Divider } from '../styles'\n\nconst FileName = ({ file }: Pick<FileItemProps, 'file'>): JSX.Element =>\n file.size ? (\n <Group space=\"m\" align=\"center\">\n <Text variant=\"caption\">{file.name}</Text>\n <Text variant=\"number-sm\">{formatBytes(file.size)}</Text>\n </Group>\n ) : (\n <Text variant=\"caption\">{file.name}</Text>\n )\n\ntype FileActionButtonProps = Pick<FileItemProps, 'onRemove' | 'onRetry' | 'disabled'> & {\n type: 'remove' | 'retry'\n}\n\nconst FileActionButton = ({\n type,\n onRemove,\n onRetry,\n disabled,\n}: FileActionButtonProps): JSX.Element => {\n const { iconName, label, onClick } =\n type === 'remove'\n ? {\n iconName: 'close',\n label: 'REMOVE',\n onClick: onRemove,\n }\n : {\n iconName: 'refresh',\n label: 'RETRY',\n onClick: onRetry,\n }\n\n return (\n <Button\n scale=\"small\"\n variant=\"tertiary\"\n leading={<Icon name={iconName} size={12} />}\n onClick={onClick}\n disabled={disabled}\n >\n {label}\n </Button>\n )\n}\n\nconst LoadingFile = ({ file, ...actionProps }: FileItemProps): JSX.Element => (\n <Stack as=\"li\" space=\"s\">\n <Group align=\"center\" justify=\"space-between\">\n <FileName file={file} />\n <FileActionButton type=\"remove\" {...actionProps} />\n </Group>\n <Bar />\n </Stack>\n)\n\nconst ErrorFile = ({ file, errorMessage, ...actionProps }: FileItemProps): JSX.Element => (\n <Stack as=\"li\" space=\"s\">\n <Group align=\"center\" justify=\"space-between\">\n <Group space=\"s\" align=\"center\">\n <Icon name=\"warning\" size={12} />\n <FileName file={file} />\n </Group>\n {actionProps.onRetry ? (\n <Group space=\"none\" align=\"center\">\n <FileActionButton type=\"retry\" {...actionProps} />\n <Divider />\n <FileActionButton type=\"remove\" {...actionProps} />\n </Group>\n ) : (\n <FileActionButton type=\"remove\" {...actionProps} />\n )}\n </Group>\n {errorMessage && (\n <Text variant=\"caption\" color=\"color-danger\">\n {errorMessage}\n </Text>\n )}\n </Stack>\n)\n\nconst SuccessFile = ({ file, ...actionProps }: FileItemProps): JSX.Element => (\n <Group as=\"li\" align=\"center\" justify=\"space-between\">\n <Group space=\"s\" align=\"center\">\n <Icon name=\"check\" size={12} />\n <FileName file={file} />\n </Group>\n <FileActionButton type=\"remove\" {...actionProps} />\n </Group>\n)\n\nconst FILE_ITEM_BY_STATUS: Record<FileStatus, (props: FileItemProps) => JSX.Element> = {\n loading: LoadingFile,\n error: ErrorFile,\n success: SuccessFile,\n}\n\nconst FileItem = (props: FileItemProps): JSX.Element => {\n const FileItemComponent = FILE_ITEM_BY_STATUS[props.status]\n\n return <FileItemComponent {...props} />\n}\n\nexport default FileItem\n","import React from 'react'\n\nimport isEmpty from 'utils/toolset/isEmpty'\nimport pluralize from 'utils/toolset/pluralize'\n\nimport { Stack } from 'components/Layout'\nimport { Text } from 'components/Text'\n\nimport { useDragDropFileContext } from '../DragDropFile.context'\n\nimport type { FileListProps } from '../types'\nimport { FileListUL } from '../styles'\n\nimport FileItem from './FileItem'\n\nconst FileList = ({ disabled, ...props }: FileListProps): JSX.Element | null => {\n const { fileList, onRemoveFile, onRetryUpload } = useDragDropFileContext()\n\n if (isEmpty(fileList)) {\n return null\n }\n\n const uploadedFiles = fileList.filter((file) => file.status === 'success').length\n\n return (\n <Stack space=\"m\" {...props}>\n <Text variant=\"heading-sm-bold\">{`${uploadedFiles} ${pluralize(\n uploadedFiles,\n 'Files',\n 'File'\n )} uploaded`}</Text>\n <FileListUL space=\"m\">\n {fileList.map((item, index) => (\n <FileItem\n key={`file-${item.file.name}-${index}`}\n disabled={disabled}\n onRemove={() => onRemoveFile(item, index)}\n onRetry={onRetryUpload ? () => onRetryUpload(item, index) : undefined}\n {...item}\n />\n ))}\n </FileListUL>\n </Stack>\n )\n}\n\nexport default FileList\n","import Wrapper from './components/Wrapper'\nimport DropZone from './components/DropZone'\nimport FileList from './components/FileList'\n\nconst DragDropFile = (): null => null\n\nDragDropFile.Wrapper = Wrapper\nDragDropFile.DropZone = DropZone\nDragDropFile.FileList = FileList\n\nexport default DragDropFile\n","import styled from 'styled-components'\nimport { Button } from 'components/Button'\n\nexport const NoPaddingButton = styled(Button).attrs({\n variant: 'tertiary',\n scale: 'small',\n})`\n padding: 0;\n\n > span {\n margin: 0 !important;\n }\n`\n","import React, { ChangeEvent, KeyboardEvent, useEffect, useState } from 'react'\n\nimport { Layout } from 'components/Layout'\nimport { Text } from 'components/Text'\nimport { TextField } from 'components/TextField'\nimport type { TablePaginationActionsProps } from 'components/TablePagination/TablePagination.types'\nimport styled from 'styled-components'\nimport { Icon, IconProps } from 'components/Icon'\nimport Keyboard from 'utils/toolset/keyboard'\nimport { NoPaddingButton } from './TablePagination.styles'\nimport { prop } from 'tools/index'\n\nexport const ActionIcon = styled(Icon).attrs({\n color: 'neutral-darker',\n size: '16',\n})<IconProps & { rotate?: number }>`\n transform: rotate(${prop('rotate', 0)}deg);\n`\n\nfunction TablePaginationActions({\n variant = 'default',\n disabled = false,\n onPageChange,\n page,\n count,\n rowsPerPage,\n}: TablePaginationActionsProps): JSX.Element {\n const totalPages = Math.ceil(count / rowsPerPage)\n const [pageValue, setPageValue] = useState<number | ''>(page + 1)\n const isCompact = variant === 'compact'\n\n useEffect(() => {\n setPageValue(page + 1)\n }, [page])\n\n const handleFirstPageClick = () => {\n onPageChange(0)\n }\n\n const handlePreviousPageClick = () => {\n onPageChange(page - 1)\n }\n\n const handleNextPageClick = () => {\n onPageChange(page + 1)\n }\n\n const handleLastPageClick = () => {\n onPageChange(totalPages - 1)\n }\n\n const publishPageChange = () => {\n if (pageValue && pageValue - 1 !== page) {\n onPageChange(pageValue - 1)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (Keyboard(e).is('ENTER')) {\n publishPageChange()\n }\n }\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (Keyboard(e).is(['E_LOWERCASE', 'DOT', 'MINUS', 'PLUS'])) {\n e.preventDefault()\n }\n }\n\n const handlePageChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.value === '') {\n setPageValue('')\n return\n }\n\n const numberValue = Number(e.target.value)\n\n if (!numberValue || numberValue < 1 || numberValue > totalPages) return\n\n setPageValue(numberValue)\n }\n\n return (\n <Layout.Group space=\"s\" align=\"center\">\n {!isCompact && (\n <NoPaddingButton\n onClick={handleFirstPageClick}\n disabled={page === 0 || disabled}\n title=\"First page\"\n >\n <ActionIcon name=\"caret-right-last\" rotate={180} />\n </NoPaddingButton>\n )}\n <NoPaddingButton\n onClick={handlePreviousPageClick}\n disabled={page === 0 || disabled}\n title=\"Previous page\"\n >\n <ActionIcon name=\"caret-left\" />\n </NoPaddingButton>\n {!isCompact && (\n <>\n <TextField\n type=\"number\"\n min={1}\n max={totalPages}\n disabled={disabled || totalPages === 1}\n onChange={handlePageChange}\n onBlur={publishPageChange}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n scale=\"small\"\n value={count ? pageValue : 0}\n title=\"Page\"\n />\n <Text variant=\"body\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n of{' '}\n <Text variant=\"body-bold\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {totalPages}\n </Text>\n </Text>\n </>\n )}\n <NoPaddingButton\n onClick={handleNextPageClick}\n disabled={page >= totalPages - 1 || disabled}\n title=\"Next page\"\n >\n <ActionIcon name=\"caret-right\" />\n </NoPaddingButton>\n {!isCompact && (\n <NoPaddingButton\n onClick={handleLastPageClick}\n disabled={page >= totalPages - 1 || disabled}\n title=\"Last page\"\n >\n <ActionIcon name=\"caret-right-last\" />\n </NoPaddingButton>\n )}\n </Layout.Group>\n )\n}\n\nexport default TablePaginationActions\n","import React from 'react'\nimport { Text } from 'components/Text'\nimport { Dropdown, DropdownContext } from 'components/Dropdown'\nimport { Layout } from 'components/Layout'\nimport { Icon } from 'components/Icon'\nimport type { RowsPerPageProps } from './TablePagination.types'\nimport type { ButtonProps } from 'components/Button'\nimport { NoPaddingButton } from './TablePagination.styles'\nimport { Popover } from 'components/Popover'\n\nconst TriggerButton = (props: Omit<ButtonProps, 'scale' | 'variant'>) => {\n const { toggle } = React.useContext(DropdownContext)\n\n return (\n <Popover.Reference>\n <NoPaddingButton data-testid=\"rows-per-page-button\" onClick={toggle} {...props}>\n <Icon name=\"caret-down\" size={16} color=\"neutral-darker\" />\n </NoPaddingButton>\n </Popover.Reference>\n )\n}\n\nfunction RowsPerPage({\n page,\n rowsPerPage,\n onRowsPerPageChange,\n labelRowsPerPage,\n count,\n rowsPerPageOptions,\n disabled = false,\n position = 'bottom',\n align = 'start',\n}: RowsPerPageProps): JSX.Element {\n const getItemsRange = () => {\n if (!count) {\n return 0\n }\n\n const from = page * rowsPerPage + 1\n let to = (page + 1) * rowsPerPage\n\n if (to > count) {\n to = count\n }\n\n return `${from}-${to}`\n }\n\n return (\n <Layout.Group space=\"s\" align=\"center\">\n <Text variant=\"caption\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {labelRowsPerPage}\n </Text>\n <Text variant=\"body\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n <Text variant=\"body-bold\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {getItemsRange()}\n </Text>{' '}\n of{' '}\n <Text variant=\"body-bold\" color={disabled ? 'color-neutral' : 'color-neutral-dark'}>\n {count}\n </Text>\n </Text>\n <Dropdown position={position} align={align}>\n <TriggerButton disabled={disabled} />\n <Dropdown.Menu>\n {rowsPerPageOptions.map((option) => (\n <Dropdown.Item\n key={option}\n onClick={() => onRowsPerPageChange(option)}\n trailing={option === rowsPerPage && <Icon name=\"check\" size={20} color=\"accent\" />}\n >\n {option} per page\n </Dropdown.Item>\n ))}\n </Dropdown.Menu>\n </Dropdown>\n </Layout.Group>\n )\n}\n\nexport default RowsPerPage\n","import React from 'react'\n\nimport { Layout } from 'components/Layout'\n\nimport type { TablePaginationProps } from './TablePagination.types'\nimport TablePaginationActions from 'components/TablePagination/TablePaginationActions'\nimport RowsPerPage from 'components/TablePagination/RowsPerPage'\n\nfunction TablePagination(props: TablePaginationProps): JSX.Element {\n const {\n variant = 'default',\n count,\n labelRowsPerPage = 'Rows per page:',\n onPageChange,\n onRowsPerPageChange,\n page,\n rowsPerPage = 50,\n rowsPerPageOptions = [10, 25, 50, 100],\n disabled = false,\n rowsPerPagePlacement,\n ...rest\n } = props\n\n return (\n <Layout.Group space=\"xl\" align=\"center\" justify=\"space-between\" {...rest}>\n <RowsPerPage\n page={page}\n count={count}\n onRowsPerPageChange={onRowsPerPageChange}\n rowsPerPage={rowsPerPage}\n rowsPerPageOptions={rowsPerPageOptions}\n labelRowsPerPage={labelRowsPerPage}\n disabled={disabled || !count}\n position={rowsPerPagePlacement?.position}\n align={rowsPerPagePlacement?.align}\n />\n <TablePaginationActions\n variant={variant}\n page={page}\n onPageChange={onPageChange}\n rowsPerPage={rowsPerPage}\n count={count}\n disabled={disabled || !count}\n />\n </Layout.Group>\n )\n}\n\nexport default TablePagination\n","import styled from 'styled-components'\nimport hiddenStyle from 'styles/hidden'\n\nexport const VisuallyHidden = styled.span`\n ${hiddenStyle(true)}\n`\n"],"names":["transitionStyle","options","property","timingFunction","duration","Wrapper","span","withConfig","displayName","componentId","transition","props","$color","token","UnknownIcon","React","IconFactory","map","getIcon","name","String","toLowerCase","size","width","height","className","color","rest","I","SvgBack","SvgBurgerMenu","SvgCalendar","SvgCaretDown","SvgCaretLeft","SvgCheck","SvgChevronDown","SvgCaretRight","SvgCircle","SvgClose","SvgInformation","SvgMinus","SvgPlus","SvgRefresh","SvgSortAsc","SvgSortDesc","SvgSort","SvgUpload","SvgWarning","SvgDotsHorizontal","SvgCaretRightLast","icons","BurguerMenuIcon","calendar","CalendarIcon","CaretDownIcon","CaretLeftIcon","ChevronRightIcon","ChevronDownIcon","back","BackIcon","check","CheckIcon","circle","CircleIcon","close","CloseIcon","information","InformationIcon","minus","MinusIcon","plus","PlusIcon","refresh","RefreshIcon","sort","SortIcon","SortAscIcon","SortDescIcon","upload","UploadIcon","warning","WarningIcon","DotsHorizontalIcon","CaretRightLastIcon","Icon","interleave","array1","array2","safeArray1","toArray","safeArray2","isEmpty","flatten","element","index","activatableStyle","strings","args","safeStrings","concat","disableableStyle","ellipsizableStyle","focusableStyle","hoverableStyle","fontStyle","weight","family","transform","css","getToken","typographyProperties","fontSize","lineHeight","fontWeight","body","caption","fontFamily","textTransform","link","DEFAULT_VARIANT","getPropertiesByVariant","variant","typography","isFunction","properties","conditional","italic","ANIMATION_DURATION","animation","keyframes","Layer","path","Spinner","title","getSpace","prop","whenProps","GroupContainer","div","center","$align","stretch","$justify","Group","space","justify","align","children","StackContainer","Stack","BoxContainer","left","$textAlign","right","$background","$borderColor","$borderWidth","$borderRadius","Box","background","borderColor","borderRadius","borderWidth","padding","textAlign","SidebarContainer","$reversed","Sidebar","minContentWidth","reversed","sideWidth","SwitcherContainer","Switcher","limit","threshold","GridContainer","Grid","minColumnWidth","Layout","loading","Bar","velocity","LoadingBar","alignment","secondaryTitle","undefined","pulse","Dot","LoadingDots","StyledSpan","rem","Leading","styled","Trailing","Children","ellipsizable","BaseStyledButton","button","$scale","disableable","$loading","StyledButton","$variant","$scheme","hoverable","focusable","activatable","StyledSelector","TextHidden","StyledLoadingDots","attrs","role","ButtonLoadingDots","buttonVariant","remainingProps","loadingDotsVariant","Set","has","ButtonChildrenWrapper","BaseButton","forwardRef","scale","leading","trailing","disabled","others","ref","Button","type","scheme","Caret","SelectorButton","omit","IconButton","CloseButton","BackButton","SelectorWrapper","StyledLabel","label","font","SelectionWrapper","selector","clsx","Check","Selector","input","Checkbox","Fragment","Radio","useFocusWithin","onFocus","onBlur","focused","setFocused","useState","containerRef","useRef","getContainer","current","handleFocus","useCallback","handleBlur","useEffect","addEventListener","removeEventListener","Status","Success","Danger","Warn","Neutral","InputWrapper","status","StyledInput","TextField","useTextField","onChange","onChangeProp","value","valueProp","setValue","e","target","TextareaWrapper","StyledTextarea","textarea","Textarea","INSECURE_HREF","checkHref","href","isBlank","test","checkTarget","rel","sanitizedRel","split","filter","Boolean","add","Array","from","join","useSafeLink","StyledBaseAnchor","a","BaseLink","forwardedRef","StyledAnchor","Link","StyledLink","StyledLi","li","active","getWrappedLabel","url","onClick","isNil","Breadcrumb","StyledWrapper","nav","StyledOl","ol","StyledBackButton","Breadcrumbs","entries","onBack","entry","useDidMount","counter","GenericAdapter","getKey","o","get","createSelectionStrategy","adapters","multiple","context","getAdapter","MultipleSelectionStrategy","SingleSelectionStrategy","init","items","select","Map","newSelection","i","slice","length","adapter","_type","set","unselect","keys","selection","delete","toggle","clear","key","MAX_LENGTH","INITIAL_LENGTH","ALPHABET","IDGenerator","maxIDLength","initialIDLength","alphabet","currentLength","filledCharacters","fill","availableIDs","range","reduce","acc","n","Math","pow","Error","newID","at","getID","useFingerprint","knownRef","fingerprint","setFingerprint","getFingerprint","currentFingerprint","update","known","safeItems","newKnown","hasSameItems","Object","item","resetFingerprint","hasSameFingerprint","otherItems","DEFAULT_ADAPTERS","createUseSelectable","didMount","strategy","useMemo","reducer","state","action","payload","initializer","selected","dispatch","useReducer","identity","propagateChangeRef","newSelected","createSelectable","SelectableContext","createContext","useSelectable","ToggleGroupContext","ToggleButton","$type","isMultiple","Toggle","group","useContext","selectable","Toggle$1","Container","$multiple","fromValueToSelected","valueAsArray","fromSelectedToValue","pairs","option","push","DEFAULT_SELECTED","ToggleGroup","id","Option","TabContext","useID","propId","setID","TabsItemsWrapper","ul","StyledListItem","direction","row","column","TabsItems","TabsItem","default","isDefault","tabId","setActiveTab","activeTab","isActive","handleSelect","event","PanelsItemsWrapper","PanelsItemWrapper","article","block","none","PanelsItems","PanelsItem","lazy","hidden","TabsWrapper","Tabs","propTab","onTabChange","Items","Item","Panels","Panel","StyledSection","section","StyledSectionTitle","SectionTitle","Section","Title","hiddenStyle","accessible","AccordionContext","AccordionProvider","expanded","onExpandedChange","initialExpanded","openState","setOpenState","open","useAccordionContext","StyledToggle","StyledContent","HiddenInput","ToggleIndicator","AccordionWrapper","AccordionToggle","propsTrailing","AccordionBody","Accordion","Body","Description","TextSection","$dismissible","StyledBanner","wrap","DefaultCloseButton","IconWrapper","DefaultIcon","InlineButton","ButtonWrapper","LargeButtonWrapper","TextWrapper","getAlertIcon","icon","iconName","Banner","description","onClose","dismissible","visible","setVisible","isValidElement","BannerLarge","BannerAction","secondaryAction","onActionButtonClick","onSecondaryActionButtonClick","BannerActionLarge","Text$1","ModalWrapper","flex","HeaderWrapper","Close","Content","fullscreen","Header","Text","Modal","onOverlayClick","ReactDOM","createPortal","stopPropagation","document","h1","ActionWrapper","StyledDialogActions","$direction","end","initial","DialogActions","DialogActionConfirm","onConfirm","DialogActionCancel","onCancel","Dialog","ActionConfirm","ActionCancel","Actions","useDialog","openProp","onOpen","setOpen","show","hide","PopoverContext","usePopover","Popover","arrowRef","position","desiredPlacement","floating","useFloating","placement","middleware","offset","flip","shift","arrow","whileElementsMounted","autoUpdate","resultPosition","resultAlign","register","setReference","refs","setFloating","setArrow","result","floatingStyles","top","middlewareData","y","x","PopoverReference","PopoverFloating","style","Floating","Reference","TooltipPosition","Top","Bottom","Left","Right","TooltipAlign","Start","Center","End","Bubble","StyledArrow","Arrow","Tooltip","message","showTooltip","hideTooltip","StyledChildren","StyledRequired","sup","StyledTooltipAnchor","Label","as","required","tip","tipProps","tag","PAGINATION_ITEM_TYPE","endEllipsis","next","page","previous","startEllipsis","IconButtonDefault","PageButton","underline","ICONS_NAME","PaginationItem","itemType","toString","includes","PaginationHelper","boundaryCount","count","siblingCount","constructor","start","_","getStartPages","min","getEndPages","max","getSibilingsStart","getSibilingsEnd","endPages","getStartEllipsis","siblingsStart","getEndEllipsis","usePagination","handleChange","paginationHelper","handleClick","startPages","siblingsEnd","itemList","getButtonPage","isDisabled","isNumber","Pagination","rounded","Line","Progress","ProgressBar","showLine","extra","clampedValue","SwitchWrapper","Slider","ActiveIcon","InactiveIcon","Switch","onToggle","StyledTag","removable","StyledCloseButton","StyledSpacer","Tag","onRemove","getRemoveButtonProps","ToastCountDown","INTERVAL","Toast","timeout","showIcon","setCount","decrementBy","interval","window","setTimeout","clearTimeout","ToastIcon","radioElement","getElementById","checked","getPanelRadioID","StepsContext","StepConnector","complete","ProgressStepWrapper","ProgressStepContainer","StepIndicator","StepLabel","ProgressStep","step","indicator","ProgressWrapper","StepsProgress","steps","StepWrapper","StepsStep","StepsID","StepsWrapper","Steps","Step","useSteps","currentProp","stepIndexByID","forEach","currentIndex","getStepIndex","newCurrentIndex","stepID","stepIndex","CardTitle","CardSubtitle","CardSeparator","hr","CardBody","CardTitleWrapper","flagged","Flag","Card","Subtitle","Separator","DropdownContext","expandDisabled","StyledPopover","DropdownItemWrapper","DropdownSectionHeader","strong","DropdownSectionWrapper","GenericDropdownMenuWrapper","DropdownMenuWrapper","DropdownSeparator","DropdownMenu","header","footer","DropdownMenuItem","persist","DropdownMenuSection","SUPPORTED_KEYS","ALT","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","CONTROL","ENTER","ESCAPE","SHIFT","SPACE","TAB","E_LOWERCASE","DOT","PLUS","MINUS","getKeyboardKey","keyCode","indexOf","KeyboardKey","is","otherKeys","expectedKeys","otherKey","useClickOutside","container","callback","setActive","handleEvent","hasPressedEsc","hasTarget","contains","subscribe","unsubscribe","dropdownExpandedStyle","triggerButtonAttrs","outlined","TriggerButton","capitalize","uppercase","DropdownTriggerWrapper","$outlined","TriggerHandle","RotatableIcon","$rotate","DropdownTriggerButton","contextValue","renderChildren","DropdownTriggerHandle","GenericDropdownTrigger","DropdownTrigger","Handle","useDropdown","setExpanded","isExpanded","expand","collapse","DropdownWrapper","HiddenCloseButton","tabIndex","useDeprecatedAlignFromMenu","child","GenericDropdown","Dropdown","dropdownProps","Trigger","Menu","SelectContext","pluralize","plural","singular","GenericSelectTrigger","SelectTriggerSearchField","SelectTrigger","node","getFocusedIndexAfterKeyPress","currentFocused","focusableCounter","keyHandler","Tab","shiftKey","ArrowUp","ArrowDown","unknownKey","increment","getTabbableDescendants","querySelectorAll","useFocusTrap","onActivate","onDeactivate","setCurrentFocused","mutationObserverRef","focusableDescendants","setFocusableDescendants","subscribeToDOMMutationEvents","MutationObserver","observe","childList","unsubscribeToDOMMutationEvents","disconnect","handleKeyDownEvent","evt","supportedKeys","preventDefault","newCurrentFocused","focus","activate","deactivate","isThenable","object","isObject","getLabel","getValue","toSelection","getDisplayValue","escapeRegExp","replace","getData","datasources","query","regex","RegExp","promises","types","ds","Promise","resolve","fetch","results","allSettled","getDatasources","getDatasourceFromOptions","extractAdapters","TriggerOnFocusHandler","mapOptions","useOptions","setOptions","setStatus","timeoutRef","cancelPendingFetch","fetchAfterTimeout","values","reset","getOptionByKey","useSelect","onQueryChange","onCreate","getInputProps","isValidNewOption","createOptionPosition","triggerRef","focusTrap","queryTyped","setQueryTyped","setQuery","dropdown","getSelectableOption","getOption","toggleOption","getDropdownProps","getTriggerProps","sanitizedValue","getClearProps","getMenuProps","getOptionProps","getCreatebleProps","asyncOnClick","onCreateReturn","isCreatable","findByLabel","toLocaleLowerCase","isQueryEqualAnOption","find","getIsValidNewOption","autoFocus","highlightMatch","str","match","pre","mid","post","HighlightMatchWrapper","HighlightMatch","text","DefaultGroup","DefaultSelectOption","SelectOption","renderContent","SelectEmpty","SelectCreatableOption","defaultComponents","Empty","CreatableOption","getComponents","components","OMITTED_PROPS","Loading","getCommonClearButtonProps","SelectMenu","ClearMultiple","total","Divider","DividerText","isQuerying","after","before","renderOptionsSingle","renderOptionsMultiple","selectedOptions","remainingOptions","remaining","Select","placeholder","hideClear","renderOptions","getTrailing","useSelectExternal","isChecked","Logo","Logo$3","updateHeight","el","getBoundingClientRect","useHeightExpansionToggler","targetElRef","toggleState","prevState","totalHeight","setTotalHeight","useLayoutEffect","observer","finalHeight","StyledMenuItem","Flex","MenuBaseItem","MenuLink","MenuLink$2","StyledIcon","$expanded","ExpandableItems","ItemsWrapper","MenuExpandable","expandableItemsRef","cloneElement","ariaHidden","styledCompounds","Parent","compounds","MenuTitle","menuId","MenuItem","StyledMenu","SubItem","aside","SideNavigation","useWindowSize","windowSize","setWindowSize","innerWidth","innerHeight","handleResize","transformInPixels","parseFloat","BASE_PIXELS","useSideNavigation","useWindowResize","theme","useTheme","shouldOpen","breakpoint","breakpointInPixels","StyledAside","StyledHeader","StyledBody","StyledFooter","DrawerHeader","DrawerBody","DrawerFooter","Drawer","onClickOutside","invisible","setInvisible","handleTransitionEnd","currentRef","isSameNode","Footer","getSelectableProps","config","defaults","generic","useTableSelectionCore","registered","setRegistered","selectableProps","allRowsAreSelected","prev","some","prevRow","toggleAll","TableSelectionContext","TableSelectionProvider","selectionCore","useTableSelection","useSelection","isCellSelected","selectedRows","useIsCellSelected","DefaultBox","TableSortHandle","order","StyledTableBody","tbody","StyledTableFoot","tfoot","StyledTableCaption","$position","StyledCell","StyledTableCell","td","format","StyledTableHeadCell","th","pointer","clickable","normal","StyledTableHead","thead","StyledTableRow","tr","solid","StyledExpandableContentRow","StyledTable","table","Table","TableCaptionInner","TableCaption","TableHead","TableBody","TableCell","SelectionCell","Input","SelectionHeadCell","TableHeadCell","TableRow","useIsRowSelected","ExpandableTableRow","expandableContent","propsLeading","colSpan","isArray","ActionsWrapper","TableSelectionActions","buttons","Action","StyledPickerTrigger","InternalButton","TablePickerItem","TriggerIcon","TablePicker","trigger","propsTrigger","selectionCellChild","Head","Row","Cell","HeadCell","Foot","Caption","Selection","ExpandableRow","SortHandle","Picker","Logo$1","MenuDropdown","MenuDropdownSeparator","MenuDropdownTrigger","MenuDropdownLabel","Ellipsizable","$max","MenuDropdownSubItemLink","MenuDropdownSubItem","MenuItemDropdown","labelId","hasIcon","MenuItemIcon","MenuContainer","OpenSideNavButton","OpenSideNavButton$1","removeRightPadding","TopNavigation","VerticalWrapper","EmptyStateWithIcon","isHorizontal","Illustration","illustration","EmptyStateWithIllustration","isPageVariant","EmptyState","aliased","aliasMap","alias","MONTH_BY_ALIAS","jan","january","feb","february","mar","march","apr","april","may","jun","june","jul","july","aug","august","sep","september","oct","october","nov","november","dec","december","MONTH_BY_NAME","getMonthByAlias","getAllMonths","MonthHelper","month","representation","padStart","other","getAll","PickerModeToggle","DEFAULT_OPTIONS","normalize","DateHelper","dateArg","optionsArg","utcDate","date","Date","UTC","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","getYear","getMonth","getDate","getTime","getWeekday","getUTCDay","getHours","getMinutes","getSeconds","getMilliseconds","matches","constraints","constraintEvaluators","getConstraintEvaluator","evaluator","unit","subtract","newValue","year","day","hour","minute","second","millisecond","setUTCFullYear","setUTCMonth","setUTCDate","setUTCHours","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","operator","precision","compare","b","getComparableDate","toISOString","DATE_ZERO","MIN_SUPPORTED_DATE","sliceIndex","normalizedPart","normalizedDate","getConstraintRange","rangeArg","rangeStart","rangeEnd","MAX_SUPPORTED_DATE","timestamp","newDate","constraint","InvalidDateConstraintError","padded","maxLength","TODAY","useCalendar","onSelect","mode","amountOfMonthsToRender","setSelected","getSelectionPair","renderableMonths","setRenderableMonths","getRenderableMonths","initialMonth","getFullYear","getSelectionBoundary","boundary","months","DAY_IN_MILLISECONDS","getRenderableMonth","firstDayOfTheWeek","totalDaysInMonth","days","amount","getOrdinalSuffix","number","getTokenValue","DEFAULT_FORMATTERS","ADDITIONAL_FORMATTERS","DateFormatHelper","tokens","tokenizer","previousIndex","previousToken","COMPOUND_FORMATTERS","valid","getType","char","isEscaping","charAt","MM","Intl","DateTimeFormat","MMM","MMMM","D","DD","ddd","weekday","dddd","YYYY","HH","hourCycle","hh","hour12","mm","ss","A","toUpperCase","parseInt","PickerButton","$status","DefaultPickerButton","WEEKDAYS","formatter","getStatus","isPastYearDay","DefaultText","CalendarDayPicker","onDayClick","renderDaysOfWeek","textDecoration","renderDaysOfMonth","formatted","CalendarMonthPicker","CalendarYearPicker","usePickerMode","DayPicker","MonthPicker","YearPicker","BorderlessButton","GenericCalendar","onMonthClick","onYearClick","Calendar","getSelection","formatDate","Number","isNaN","getInitialCalendarSetup","selectionStart","startDate","setInputValue","getInputValue","useDatePicker","handleDateSelect","inputRef","formattedDate","handleDateInputChange","handleDateInputClick","handleDayClick","handleClearClick","currSelectedDate","currInputValue","getCalendarProps","currSelection","DATE_REGEX","DefaultTextField","ClearButton","DateInput","handleInputChange","DatePicker","datePicker","renderTrailing","AT_RANGE_START","AT_RANGE_END","useDateRangePicker","inputsRef","currentlyPickingRef","getDateInputChangeHandler","handleDropdownBlur","every","handleDoneClick","getRangeStartInputProps","getRangeEndInputProps","getDoneProps","currSelected","DropdownFooter","DateRangePicker","dateRangePicker","renderRangeEndTrailing","currRangeStart","currRangeEnd","renderDropdownFooter","ErrorMessage","DragDropFileWrapper","withFileList","DropZoneWrapper","error","FileListUL","fileList","useDragDropFileContext","DropZone","hint","accept","renderCustomContent","onFilesAdded","isDragging","setIsDragging","onChangeInput","currentTarget","files","onKeyPress","click","onDrop","dataTransfer","onDragStart","onDragOver","onDragLeave","renderDefaultContent","BYTES_PER_KILOBYTE","FILE_SIZE_ABBREVIATIONS","formatBytes","bytes","decimals","bytesValue","dm","floor","log","unitAbbr","toFixed","FileName","file","FileActionButton","onRetry","LoadingFile","actionProps","ErrorFile","errorMessage","SuccessFile","FILE_ITEM_BY_STATUS","success","FileItem","FileItemComponent","FileList","onRemoveFile","onRetryUpload","uploadedFiles","DragDropFile","NoPaddingButton","ActionIcon","TablePaginationActions","onPageChange","rowsPerPage","totalPages","ceil","pageValue","setPageValue","isCompact","handleFirstPageClick","handlePreviousPageClick","handleNextPageClick","handleLastPageClick","publishPageChange","handleKeyUp","Keyboard","handleKeyDown","handlePageChange","numberValue","RowsPerPage","onRowsPerPageChange","labelRowsPerPage","rowsPerPageOptions","getItemsRange","to","TablePagination","rowsPerPagePlacement","VisuallyHidden"],"mappings":"slCAUA,SAASA,EAAgBC,EAA0C,CAG1D,MAAA;AAAA,2BAEHA,GAASC,UACT,qFAAqF;AAAA,kCAEzDD,GAASE,gBAAkB,8BAA8B;AAAA,2BAChEF,GAASG,UAAY,OAAO;AAAA;AAAA,GAGvD,CCRA,MAAMC,GAAiBC,EAAAA,QAAAA,KAAIC,WAAA,CAAAC,YAAA,UAAAC,YAAA,cAAA,CAAA,EAAA,CAAA,2EAAA,UAAA,sBAAA,EAOrBC,EAAW,CACXR,SAAU,WACZ,CAAC,EAQCS,GAAAA,EAAMC,OAASC,EAAAA,SAAM,SAASF,EAAMC,MAAM,GAAkBD,CAAK,EAAI,cAAc,EAiBlF,SAASG,IAA4B,CAC1C,O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