@procore/core-react 12.14.0 → 12.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/Banner/Banner.js +3 -3
- package/dist/Banner/Banner.js.map +1 -1
- package/dist/Banner/Banner.styles.d.ts +3 -3
- package/dist/Banner/Banner.styles.js +16 -16
- package/dist/Banner/Banner.styles.js.map +1 -1
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +5 -2
- package/dist/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.js +1 -1
- package/dist/DateInput/DateInput.js.map +1 -1
- package/dist/DateInput/DateInput.styles.d.ts +1 -1
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DateInput/DateInput.styles.js.map +1 -1
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/DetailPageTemplate/DetailPageTemplate.d.ts +11 -0
- package/dist/DetailPageTemplate/DetailPageTemplate.js +38 -0
- package/dist/DetailPageTemplate/DetailPageTemplate.js.map +1 -0
- package/dist/DetailPageTemplate/DetailPageTemplate.types.d.ts +13 -0
- package/dist/DetailPageTemplate/DetailPageTemplate.types.js +2 -0
- package/dist/DetailPageTemplate/DetailPageTemplate.types.js.map +1 -0
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/Dropdown/Dropdown.types.d.ts +5 -11
- package/dist/Dropdown/Dropdown.types.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/DropdownFlyout/DropdownFlyout.types.d.ts +12 -14
- package/dist/DropdownFlyout/DropdownFlyout.types.js.map +1 -1
- package/dist/Dropzone/Dropzone.js +3 -2
- package/dist/Dropzone/Dropzone.js.map +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/Dropzone/Dropzone.types.d.ts +22 -20
- package/dist/Dropzone/Dropzone.types.js.map +1 -1
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.js +3 -3
- package/dist/FileSelect/GridSource/GridSource.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.styles.d.ts +3 -3
- package/dist/FileSelect/GridSource/GridSource.styles.js +12 -12
- package/dist/FileSelect/GridSource/GridSource.styles.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.types.d.ts +14 -23
- package/dist/FileSelect/GridSource/GridSource.types.js.map +1 -1
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/LocalSource/LocalSource.types.d.ts +43 -47
- package/dist/FileSelect/LocalSource/LocalSource.types.js.map +1 -1
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.types.d.ts +3 -1
- package/dist/FileSelect/TreeSource/TreeSource.types.js.map +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +2 -2
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.js +12 -7
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/Form.types.d.ts +55 -67
- package/dist/Form/Form.types.js.map +1 -1
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.js +8 -5
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.js +2 -2
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.d.ts +2 -2
- package/dist/Modal/Modal.styles.js +17 -17
- package/dist/Modal/Modal.styles.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/MultiSelect/MultiSelect.types.d.ts +22 -15
- package/dist/MultiSelect/MultiSelect.types.js.map +1 -1
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.js +2 -2
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.styles.d.ts +2 -2
- package/dist/NumberInput/NumberInput.styles.js +11 -11
- package/dist/NumberInput/NumberInput.styles.js.map +1 -1
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageHeaderTemplate/PageHeaderTemplate.js +5 -6
- package/dist/PageHeaderTemplate/PageHeaderTemplate.js.map +1 -1
- package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.js +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +2 -2
- package/dist/Pill/Pill.types.d.ts +3 -1
- package/dist/Pill/Pill.types.js.map +1 -1
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Search/Search.types.d.ts +4 -2
- package/dist/Search/Search.types.js.map +1 -1
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.js +6 -3
- package/dist/Select/Select.js.map +1 -1
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Select/Select.types.d.ts +9 -1
- package/dist/Select/Select.types.js.map +1 -1
- package/dist/Semantic/Semantic.d.ts +3 -7
- package/dist/Semantic/Semantic.js +14 -2
- package/dist/Semantic/Semantic.js.map +1 -1
- package/dist/Semantic/Semantic.styles.d.ts +3 -3
- package/dist/Semantic/Semantic.styles.js +11 -11
- package/dist/Semantic/Semantic.styles.js.map +1 -1
- package/dist/Semantic/Semantic.types.d.ts +5 -0
- package/dist/Semantic/Semantic.types.js.map +1 -1
- package/dist/SettingsPageTemplate/SettingsPageTemplate.d.ts +7 -0
- package/dist/SettingsPageTemplate/SettingsPageTemplate.js +34 -0
- package/dist/SettingsPageTemplate/SettingsPageTemplate.js.map +1 -0
- package/dist/SettingsPageTemplate/SettingsPageTemplate.types.d.ts +9 -0
- package/dist/SettingsPageTemplate/SettingsPageTemplate.types.js +2 -0
- package/dist/SettingsPageTemplate/SettingsPageTemplate.types.js.map +1 -0
- package/dist/Slider/Slider.js +2 -2
- package/dist/Slider/Slider.js.map +1 -1
- package/dist/Slider/Slider.styles.d.ts +2 -2
- package/dist/Slider/Slider.styles.js +9 -9
- package/dist/Slider/Slider.styles.js.map +1 -1
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/Spinner/Spinner.types.d.ts +2 -5
- package/dist/Spinner/Spinner.types.js.map +1 -1
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +12 -9
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.js +25 -10
- package/dist/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/Thumbnail/Thumbnail.types.d.ts +2 -3
- package/dist/Thumbnail/Thumbnail.types.js.map +1 -1
- package/dist/Thumbnail/ThumbnailCaption.js +2 -2
- package/dist/Thumbnail/ThumbnailCaption.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/TieredSelect/TieredSelect.types.d.ts +64 -40
- package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Tile/Tile.types.d.ts +1 -1
- package/dist/Tile/Tile.types.js.map +1 -1
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/ToggleButton/ToggleButton.types.d.ts +1 -1
- package/dist/ToggleButton/ToggleButton.types.js.map +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.d.ts +5 -0
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.js +44 -0
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.js.map +1 -0
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.types.d.ts +7 -0
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.types.js +2 -0
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.types.js.map +1 -0
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.js +3 -3
- package/dist/Tree/Tree.js.map +1 -1
- package/dist/Tree/Tree.styles.d.ts +9 -3
- package/dist/Tree/Tree.styles.js +23 -15
- package/dist/Tree/Tree.styles.js.map +1 -1
- package/dist/Tree/Tree.types.d.ts +40 -19
- package/dist/Tree/Tree.types.js.map +1 -1
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.js +1 -1
- package/dist/Typography/Typography.js.map +1 -1
- package/dist/Typography/Typography.styles.d.ts +2 -1
- package/dist/Typography/Typography.styles.js +3 -3
- package/dist/Typography/Typography.styles.js.map +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +12 -12
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +35 -35
- package/dist/_typedoc/Dropzone/Dropzone.types.json +53 -53
- package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +42 -42
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +30 -30
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +27 -27
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +1015 -975
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +54 -54
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +4 -4
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +35 -35
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
- package/dist/_typedoc/PageLayout/PageLayout.types.json +28 -28
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +28 -28
- package/dist/_typedoc/Pill/Pill.types.json +4 -4
- package/dist/_typedoc/PillSelect/PillSelect.types.json +58 -48
- package/dist/_typedoc/Popover/Popover.types.json +14 -14
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +22 -22
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
- package/dist/_typedoc/Select/Select.types.json +78 -58
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +11 -11
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
- package/dist/_typedoc/Switch/Switch.types.json +3 -3
- package/dist/_typedoc/Table/Table.types.json +112 -102
- package/dist/_typedoc/Tabs/Tabs.types.json +19 -19
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +16 -16
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +13 -13
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +23 -23
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +56 -56
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +44 -44
- package/dist/_typedoc/Tile/Tile.types.json +32 -32
- package/dist/_typedoc/Title/Title.types.json +1 -1
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +6 -6
- package/dist/_typedoc/Token/Token.types.json +4 -4
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +110 -110
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.styles.js","names":["Warning","styled","css","Card","StyledSection","StyledSectionInner","Typography","getTypographyIntent","colors","spacing","fadeInClassName","fadeOutClassName","modalMaxWidth","modalPixelGutter","xl","modalPixelWidths","sm","md","lg","compactModalFullscreenMaxHeight","screenWidthPixelBreakpoints","mobile","small","min","max","large","StyledModal","div","withConfig","displayName","componentId","StyledModalButtons","StyledModalContainer","_ref","$compact","_ref2","$placement","_ref3","$width","StyledModalBody","StyledModalFooter","xxl","gray15","_ref4","noSideSpacing","_ref5","_ref6","isOverflowingY","gray85","StyledModalFooterSummary","StyledModalContent","_ref7","_ref7$$compact","StyledModalFooterNotation","StyledModalHeader","gray10","_ref8","$isBodyScrolled","_ref9","spacings","concat","StyledModalHeading","_ref10","_ref11","_ref12","StyledModalCancel","StyledModalScrim","StyledModalWarningIcon","yellow40","gray98"],"sources":["../../src/Modal/Modal.styles.ts"],"sourcesContent":["import { Warning } from '@procore/core-icons'\nimport styled, { css } from 'styled-components'\nimport { Card } from '../Card/Card'\nimport { StyledSection, StyledSectionInner } from '../Section/Section.styles'\nimport { Typography } from '../Typography/Typography'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\nimport type { ModalPlacement, ModalWidth } from './Modal.types'\n\nexport const fadeInClassName = 'fade-in'\nexport const fadeOutClassName = 'fade-out'\nexport const modalMaxWidth = '640px'\nexport const modalPixelGutter = spacing.xl\nexport const modalPixelWidths = {\n sm: 432,\n md: 688,\n lg: 1152,\n xl: 1920,\n}\n\nconst compactModalFullscreenMaxHeight = 940\nconst screenWidthPixelBreakpoints = {\n mobile: {\n small: {\n min: 0,\n max: 439,\n },\n large: {\n min: 440,\n max: 767,\n },\n },\n}\n\nexport const StyledModal = styled.div`\n display: flex;\n height: 100vh;\n position: absolute;\n opacity: 0;\n transition: 0.3s opacity ease;\n width: 100vw;\n z-index: 0;\n\n &.${fadeInClassName} {\n opacity: 1;\n }\n\n &.${fadeOutClassName} {\n opacity: 0;\n }\n`\n\nexport const StyledModalButtons = styled.div`\n display: flex;\n flex: 0 0 auto;\n margin-left: ${spacing.lg}px;\n\n > * + * {\n margin-left: ${spacing.sm}px;\n }\n`\n\nexport const StyledModalContainer = styled(Card)<{\n $compact: boolean\n $placement: ModalPlacement\n $width?: ModalWidth\n}>`\n display: flex;\n flex-direction: row;\n position: absolute;\n z-index: 2;\n\n ${({ $compact }) => {\n if (!$compact) {\n return ''\n }\n\n return css`\n @media (max-width: ${screenWidthPixelBreakpoints.mobile.small\n .max}px) and (max-height: ${compactModalFullscreenMaxHeight}px) {\n border-radius: 0;\n height: 100vh;\n width: 100vw;\n }\n @media (min-width: ${screenWidthPixelBreakpoints.mobile.large\n .min}px) and (max-width: ${screenWidthPixelBreakpoints.mobile.large\n .max}px) {\n max-height: calc(100vh - 24px);\n width: 416px;\n }\n @media (min-height: ${compactModalFullscreenMaxHeight + 1}px) {\n height: 916px;\n max-width: 100vw;\n }\n `\n }}\n\n ${({ $placement }) => {\n if ($placement === 'top') {\n return css`\n top: 5vh;\n `\n }\n\n return css`\n top: 50vh;\n transform: translateY(-50%);\n `\n }}\n\n ${({ $width, $placement }) => {\n if ($width) {\n return css`\n left: ${modalPixelGutter}px;\n right: ${modalPixelGutter}px;\n margin-left: auto;\n margin-right: auto;\n max-width: ${modalPixelWidths[$width]}px;\n\n // TODO deprecated, moving width up. delete line in breaking change\n ${StyledModalBody} {\n max-width: none;\n }\n `\n }\n // TODO deprecated, uses new centering, required width\n return css`\n left: 50vw;\n transform: translateX(-50%)\n ${$placement === 'center' && 'translateY(-50%)'};\n `\n }}\n`\n\nexport const StyledModalFooter = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n flex-wrap: wrap;\n justify-content: flex-end;\n padding: ${spacing.xl}px ${spacing.xxl}px ${spacing.xxl}px;\n`\n\nexport const StyledModalBody = styled.div<{\n $compact: boolean\n isOverflowingY: boolean\n noSideSpacing: boolean\n}>`\n ${getTypographyIntent('body')}\n\n box-sizing: border-box;\n color: ${colors.gray15};\n display: flex;\n flex-direction: column;\n overflow: auto;\n ${({ noSideSpacing }) => {\n return css`\n padding: ${spacing.xl}px ${noSideSpacing ? 0 : spacing.xxl}px;\n `\n }}\n\n ${({ $compact }) => {\n if (!$compact) {\n // TODO deprecated, moving width up. delete line in breaking change\n return css`\n max-width: ${modalMaxWidth};\n `\n }\n\n return css`\n padding: 8px 16px;\n `\n }}\n\n > ${StyledSection} {\n padding-left: 0;\n padding-right: 0;\n\n &:first-child > ${StyledSectionInner} {\n padding-top: 0;\n }\n }\n\n ${({ isOverflowingY }) =>\n isOverflowingY &&\n css`\n & + ${StyledModalFooter} {\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: ${colors.gray85};\n ${StyledModalFooterSummary} {\n border-top: none;\n }\n }\n `}\n`\n\nexport const StyledModalContent = styled.div<{ $compact?: boolean }>`\n display: flex;\n flex-direction: column;\n max-height: 90vh;\n overflow: hidden;\n width: 100%;\n\n ${({ $compact = false }) => {\n if (!$compact) {\n return ''\n }\n\n return css`\n max-height: unset;\n `\n }}\n`\n\nexport const StyledModalFooterNotation = styled(Typography)`\n flex-grow: 1;\n`\n\nexport const StyledModalHeader = styled.div<{\n $compact: boolean\n $isBodyScrolled: boolean\n}>`\n align-items: flex-start;\n color: ${colors.gray10};\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${({ $compact, $isBodyScrolled }) => {\n if ($compact) {\n return css`\n border-bottom: 1px solid ${colors.gray85};\n `\n }\n\n return css`\n border-bottom: 1px solid\n ${$isBodyScrolled ? colors.gray85 : 'transparent'};\n `\n }}\n\n ${({ $compact }) => {\n let spacings = `${spacing.xl}px ${spacing.xxl}px`\n\n if ($compact) {\n spacings = `${spacing.md}px ${spacing.lg}px`\n }\n\n return css`\n padding: ${spacings};\n `\n }}\n`\n\nexport const StyledModalHeading = styled.div<{ $compact: boolean }>`\n ${({ $compact }) => getTypographyIntent($compact ? 'h3' : 'h2')}\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n min-height: 36px;\n padding-right: ${({ $compact }) => ($compact ? 36 : spacing.lg)}px;\n\n ${({ $compact }) => {\n if (!$compact) {\n return ''\n }\n\n return css`\n min-height: unset;\n `\n }}\n`\n\nexport const StyledModalCancel = styled.div`\n flex: 0 0 auto;\n`\n\nexport const StyledModalScrim = styled.div`\n background: hsla(200, 8%, 10%, 0.6);\n height: 100vh;\n left: 0;\n position: absolute;\n top: 0;\n width: 100vw;\n z-index: 1;\n`\n\nexport const StyledModalWarningIcon = styled(Warning)`\n color: ${colors.yellow40};\n margin-right: ${spacing.sm}px;\n`\nexport const StyledModalFooterSummary = styled.div`\n ${getTypographyIntent('small')}\n border-top: 1px solid ${colors.gray85};\n border-bottom: 1px solid ${colors.gray85};\n padding: ${spacing.md}px ${spacing.xxl}px;\n color: ${colors.gray15};\n font-style: italic;\n background-color: ${colors.gray98};\n margin: -${spacing.xl}px -${spacing.xxl}px ${spacing.xl}px -${spacing.xxl}px;\n flex: 1 1 100%;\n`\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,qBAAqB;AAC7C,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,2BAA2B;AAC7E,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,mBAAmB,QAAQ,iCAAiC;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AA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wCAC1CtB,MAAM,CAAC4D,QAAQ,EACR3D,OAAO,CAACO,EAAE,CAC3B;AACD,OAAO,IAAMiC,wBAAwB,gBAAGhD,MAAM,CAAC0B,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kMAC9CvB,mBAAmB,CAAC,OAAO,CAAC,EACNC,MAAM,CAACwC,MAAM,EACVxC,MAAM,CAACwC,MAAM,EAC7BvC,OAAO,CAACQ,EAAE,EAAMR,OAAO,CAACgC,GAAG,EAC7BjC,MAAM,CAACkC,MAAM,EAEFlC,MAAM,CAAC6D,MAAM,EACtB5D,OAAO,CAACK,EAAE,EAAOL,OAAO,CAACgC,GAAG,EAAMhC,OAAO,CAACK,EAAE,EAAOL,OAAO,CAACgC,GAAG,CAE1E"}
|
|
1
|
+
{"version":3,"file":"Modal.styles.js","names":["Warning","styled","css","Card","StyledSection","StyledSectionInner","Typography","getTypographyIntent","colors","spacing","fadeInClassName","fadeOutClassName","modalMaxWidth","modalPixelGutter","xl","modalPixelWidths","sm","md","lg","compactModalFullscreenMaxHeight","screenWidthPixelBreakpoints","mobile","small","min","max","large","StyledModal","div","withConfig","displayName","componentId","StyledModalButtons","StyledModalContainer","_ref","$compact","_ref2","$placement","_ref3","$width","StyledModalBody","StyledModalFooter","xxl","gray15","_ref4","$noSideSpacing","_ref5","_ref6","$isOverflowingY","gray85","StyledModalFooterSummary","StyledModalContent","_ref7","_ref7$$compact","StyledModalFooterNotation","StyledModalHeader","gray10","_ref8","$isBodyScrolled","_ref9","spacings","concat","StyledModalHeading","_ref10","_ref11","_ref12","StyledModalCancel","StyledModalScrim","StyledModalWarningIcon","yellow40","gray98"],"sources":["../../src/Modal/Modal.styles.ts"],"sourcesContent":["import { Warning } from '@procore/core-icons'\nimport styled, { css } from 'styled-components'\nimport { Card } from '../Card/Card'\nimport { StyledSection, StyledSectionInner } from '../Section/Section.styles'\nimport { Typography } from '../Typography/Typography'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\nimport type { ModalPlacement, ModalWidth } from './Modal.types'\n\nexport const fadeInClassName = 'fade-in'\nexport const fadeOutClassName = 'fade-out'\nexport const modalMaxWidth = '640px'\nexport const modalPixelGutter = spacing.xl\nexport const modalPixelWidths = {\n sm: 432,\n md: 688,\n lg: 1152,\n xl: 1920,\n}\n\nconst compactModalFullscreenMaxHeight = 940\nconst screenWidthPixelBreakpoints = {\n mobile: {\n small: {\n min: 0,\n max: 439,\n },\n large: {\n min: 440,\n max: 767,\n },\n },\n}\n\nexport const StyledModal = styled.div`\n display: flex;\n height: 100vh;\n position: absolute;\n opacity: 0;\n transition: 0.3s opacity ease;\n width: 100vw;\n z-index: 0;\n\n &.${fadeInClassName} {\n opacity: 1;\n }\n\n &.${fadeOutClassName} {\n opacity: 0;\n }\n`\n\nexport const StyledModalButtons = styled.div`\n display: flex;\n flex: 0 0 auto;\n margin-left: ${spacing.lg}px;\n\n > * + * {\n margin-left: ${spacing.sm}px;\n }\n`\n\nexport const StyledModalContainer = styled(Card)<{\n $compact: boolean\n $placement: ModalPlacement\n $width?: ModalWidth\n}>`\n display: flex;\n flex-direction: row;\n position: absolute;\n z-index: 2;\n\n ${({ $compact }) => {\n if (!$compact) {\n return ''\n }\n\n return css`\n @media (max-width: ${screenWidthPixelBreakpoints.mobile.small\n .max}px) and (max-height: ${compactModalFullscreenMaxHeight}px) {\n border-radius: 0;\n height: 100vh;\n width: 100vw;\n }\n @media (min-width: ${screenWidthPixelBreakpoints.mobile.large\n .min}px) and (max-width: ${screenWidthPixelBreakpoints.mobile.large\n .max}px) {\n max-height: calc(100vh - 24px);\n width: 416px;\n }\n @media (min-height: ${compactModalFullscreenMaxHeight + 1}px) {\n height: 916px;\n max-width: 100vw;\n }\n `\n }}\n\n ${({ $placement }) => {\n if ($placement === 'top') {\n return css`\n top: 5vh;\n `\n }\n\n return css`\n top: 50vh;\n transform: translateY(-50%);\n `\n }}\n\n ${({ $width, $placement }) => {\n if ($width) {\n return css`\n left: ${modalPixelGutter}px;\n right: ${modalPixelGutter}px;\n margin-left: auto;\n margin-right: auto;\n max-width: ${modalPixelWidths[$width]}px;\n\n // TODO deprecated, moving width up. delete line in breaking change\n ${StyledModalBody} {\n max-width: none;\n }\n `\n }\n // TODO deprecated, uses new centering, required width\n return css`\n left: 50vw;\n transform: translateX(-50%)\n ${$placement === 'center' && 'translateY(-50%)'};\n `\n }}\n`\n\nexport const StyledModalFooter = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n flex-wrap: wrap;\n justify-content: flex-end;\n padding: ${spacing.xl}px ${spacing.xxl}px ${spacing.xxl}px;\n`\n\nexport const StyledModalBody = styled.div<{\n $compact: boolean\n $isOverflowingY: boolean\n $noSideSpacing: boolean\n}>`\n ${getTypographyIntent('body')}\n\n box-sizing: border-box;\n color: ${colors.gray15};\n display: flex;\n flex-direction: column;\n overflow: auto;\n ${({ $noSideSpacing }) => {\n return css`\n padding: ${spacing.xl}px ${$noSideSpacing ? 0 : spacing.xxl}px;\n `\n }}\n\n ${({ $compact }) => {\n if (!$compact) {\n // TODO deprecated, moving width up. delete line in breaking change\n return css`\n max-width: ${modalMaxWidth};\n `\n }\n\n return css`\n padding: 8px 16px;\n `\n }}\n\n > ${StyledSection} {\n padding-left: 0;\n padding-right: 0;\n\n &:first-child > ${StyledSectionInner} {\n padding-top: 0;\n }\n }\n\n ${({ $isOverflowingY }) =>\n $isOverflowingY &&\n css`\n & + ${StyledModalFooter} {\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: ${colors.gray85};\n ${StyledModalFooterSummary} {\n border-top: none;\n }\n }\n `}\n`\n\nexport const StyledModalContent = styled.div<{ $compact?: boolean }>`\n display: flex;\n flex-direction: column;\n max-height: 90vh;\n overflow: hidden;\n width: 100%;\n\n ${({ $compact = false }) => {\n if (!$compact) {\n return ''\n }\n\n return css`\n max-height: unset;\n `\n }}\n`\n\nexport const StyledModalFooterNotation = styled(Typography)`\n flex-grow: 1;\n`\n\nexport const StyledModalHeader = styled.div<{\n $compact: boolean\n $isBodyScrolled: boolean\n}>`\n align-items: flex-start;\n color: ${colors.gray10};\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${({ $compact, $isBodyScrolled }) => {\n if ($compact) {\n return css`\n border-bottom: 1px solid ${colors.gray85};\n `\n }\n\n return css`\n border-bottom: 1px solid\n ${$isBodyScrolled ? colors.gray85 : 'transparent'};\n `\n }}\n\n ${({ $compact }) => {\n let spacings = `${spacing.xl}px ${spacing.xxl}px`\n\n if ($compact) {\n spacings = `${spacing.md}px ${spacing.lg}px`\n }\n\n return css`\n padding: ${spacings};\n `\n }}\n`\n\nexport const StyledModalHeading = styled.div<{ $compact: boolean }>`\n ${({ $compact }) => getTypographyIntent($compact ? 'h3' : 'h2')}\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n min-height: 36px;\n padding-right: ${({ $compact }) => ($compact ? 36 : spacing.lg)}px;\n\n ${({ $compact }) => {\n if (!$compact) {\n return ''\n }\n\n return css`\n min-height: unset;\n `\n }}\n`\n\nexport const StyledModalCancel = styled.div`\n flex: 0 0 auto;\n`\n\nexport const StyledModalScrim = styled.div`\n background: hsla(200, 8%, 10%, 0.6);\n height: 100vh;\n left: 0;\n position: absolute;\n top: 0;\n width: 100vw;\n z-index: 1;\n`\n\nexport const StyledModalWarningIcon = styled(Warning)`\n color: ${colors.yellow40};\n margin-right: ${spacing.sm}px;\n`\nexport const StyledModalFooterSummary = styled.div`\n ${getTypographyIntent('small')}\n border-top: 1px solid ${colors.gray85};\n border-bottom: 1px solid ${colors.gray85};\n padding: ${spacing.md}px ${spacing.xxl}px;\n color: ${colors.gray15};\n font-style: italic;\n background-color: ${colors.gray98};\n margin: -${spacing.xl}px -${spacing.xxl}px ${spacing.xl}px -${spacing.xxl}px;\n flex: 1 1 100%;\n`\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,qBAA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,WAAA;AAAA,sBAE1C;AAED,OAAO,IAAMoC,gBAAgB,gBAAGjE,MAAM,CAAC0B,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0GAQzC;AAED,OAAO,IAAMqC,sBAAsB,gBAAGlE,MAAM,CAACD,OAAO,CAAC,CAAA4B,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wCAC1CtB,MAAM,CAAC4D,QAAQ,EACR3D,OAAO,CAACO,EAAE,CAC3B;AACD,OAAO,IAAMiC,wBAAwB,gBAAGhD,MAAM,CAAC0B,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kMAC9CvB,mBAAmB,CAAC,OAAO,CAAC,EACNC,MAAM,CAACwC,MAAM,EACVxC,MAAM,CAACwC,MAAM,EAC7BvC,OAAO,CAACQ,EAAE,EAAMR,OAAO,CAACgC,GAAG,EAC7BjC,MAAM,CAACkC,MAAM,EAEFlC,MAAM,CAAC6D,MAAM,EACtB5D,OAAO,CAACK,EAAE,EAAOL,OAAO,CAACgC,GAAG,EAAMhC,OAAO,CAACK,EAAE,EAAOL,OAAO,CAACgC,GAAG,CAE1E"}
|
|
@@ -6,26 +6,26 @@ import { getFocus } from '../_styles/mixins';
|
|
|
6
6
|
import { spacing } from '../_styles/spacing';
|
|
7
7
|
export var StyledMultiSelectValues = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledMultiSelectValues",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_15_0__sc-s9ym9q-0"
|
|
10
10
|
})(["display:flex;flex-wrap:wrap;margin-bottom:2px;margin-left:", "px;margin-right:", "px;margin-top:2px;min-width:0;width:100%;"], spacing.md, spacing.xs);
|
|
11
11
|
export var StyledMultiSelectToken = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledMultiSelectToken",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_15_0__sc-s9ym9q-1"
|
|
14
14
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:0 1 auto;> div{max-width:178px;width:100%;}"], spacing.xs);
|
|
15
15
|
export var StyledMultiSelectSearchInput = /*#__PURE__*/styled.input.withConfig({
|
|
16
16
|
displayName: "StyledMultiSelectSearchInput",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_15_0__sc-s9ym9q-2"
|
|
18
18
|
})(["background-color:transparent;border-width:0;font-family:inherit;padding:0;height:24px;width:100%;", " ", " &::-ms-clear{display:none;}&:focus{box-shadow:none;outline:none;}&::placeholder{color:", ";}"], getTypographyIntent('body'), function (_ref) {
|
|
19
19
|
var $isNavigatingTokens = _ref.$isNavigatingTokens;
|
|
20
20
|
return $isNavigatingTokens && css(["color:transparent;"]);
|
|
21
21
|
}, colors.gray45);
|
|
22
22
|
export var StyledMultiSelectSearch = /*#__PURE__*/styled.div.withConfig({
|
|
23
23
|
displayName: "StyledMultiSelectSearch",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_15_0__sc-s9ym9q-3"
|
|
25
25
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:1;max-width:100%;min-width:24px;"], spacing.xs);
|
|
26
26
|
export var StyledMultiSelectSearchIcon = /*#__PURE__*/styled.div.withConfig({
|
|
27
27
|
displayName: "StyledMultiSelectSearchIcon",
|
|
28
|
-
componentId: "core-
|
|
28
|
+
componentId: "core-12_15_0__sc-s9ym9q-4"
|
|
29
29
|
})(["align-items:center;align-self:flex-start;display:flex;height:34px;justify-content:flex-end;margin-left:", "px;margin-right:", "px;min-width:40px;width:40px;"], spacing.xs, spacing.md);
|
|
30
30
|
export var StyledMultiSelectClearIcon = StyledSelectClearIcon;
|
|
31
31
|
export var StyledMultiSelectArrowContainer = StyledSelectArrowContainer;
|
|
@@ -33,7 +33,7 @@ export var StyledMultiSelectArrow = StyledSelectArrow;
|
|
|
33
33
|
export var StyledMultiSelectMenu = StyledSelectMenu;
|
|
34
34
|
export var StyledMultiSelectButton = /*#__PURE__*/styled(StyledSelectButton).withConfig({
|
|
35
35
|
displayName: "StyledMultiSelectButton",
|
|
36
|
-
componentId: "core-
|
|
36
|
+
componentId: "core-12_15_0__sc-s9ym9q-5"
|
|
37
37
|
})(["height:auto;padding:0;white-space:normal;&:focus-within{", "}", ""], getFocus(), function (_ref2) {
|
|
38
38
|
var $emptyValue = _ref2.$emptyValue;
|
|
39
39
|
return $emptyValue && css(["", "{cursor:pointer;}"], StyledMultiSelectSearchInput);
|
|
@@ -242,29 +242,34 @@ export interface MultiSelectProps {
|
|
|
242
242
|
*/
|
|
243
243
|
beforeShow?: OverlayTriggerProps['beforeShow'];
|
|
244
244
|
/**
|
|
245
|
-
* Callback for each entry in
|
|
246
|
-
*
|
|
247
|
-
*
|
|
245
|
+
* Callback for each entry in `options` to define relation to group in `groups`
|
|
246
|
+
* ```
|
|
247
|
+
* (option: OptionItem) => React.ReactNode
|
|
248
|
+
* ```
|
|
248
249
|
* @since 10.19.0
|
|
249
250
|
*/
|
|
250
251
|
getGroup?: MultiSelectConfig['getGroup'];
|
|
251
252
|
/**
|
|
252
|
-
* Callback for each entry in
|
|
253
|
-
*
|
|
254
|
-
*
|
|
253
|
+
* Callback for each entry in `options` for keying and optimizations
|
|
254
|
+
* ```
|
|
255
|
+
* (option: OptionItem) => number | string
|
|
256
|
+
* ```
|
|
255
257
|
* @since 10.19.0
|
|
256
258
|
*/
|
|
257
259
|
getId?: MultiSelectConfig['getId'];
|
|
258
260
|
/**
|
|
259
|
-
* Callback for each entry in
|
|
260
|
-
*
|
|
261
|
-
*
|
|
261
|
+
* Callback for each entry in `options` to generate the token label.
|
|
262
|
+
* ```
|
|
263
|
+
* (option: OptionItem) => string
|
|
264
|
+
* ```
|
|
262
265
|
* @since 10.19.0
|
|
263
266
|
*/
|
|
264
267
|
getLabel?: MultiSelectConfig['getLabel'];
|
|
265
268
|
/**
|
|
266
269
|
* Callback for when a user types into the multiselect input
|
|
267
|
-
|
|
270
|
+
* ```
|
|
271
|
+
* (event: KeyboardEvent) => void
|
|
272
|
+
* ```
|
|
268
273
|
* @since 10.19.0
|
|
269
274
|
*/
|
|
270
275
|
onSearch?: MultiSelectConfig['onSearch'];
|
|
@@ -306,8 +311,10 @@ export interface MultiSelectProps {
|
|
|
306
311
|
*/
|
|
307
312
|
error?: boolean;
|
|
308
313
|
/**
|
|
309
|
-
* Callback for rendering header for each entry in
|
|
310
|
-
*
|
|
314
|
+
* Callback for rendering header for each entry in `groups`
|
|
315
|
+
* ```
|
|
316
|
+
* (group: GroupItem) => React.ReactNode
|
|
317
|
+
* ```
|
|
311
318
|
* @since 10.19.0
|
|
312
319
|
*/
|
|
313
320
|
groupHeaderRenderer?: (group: GroupItem) => React.ReactNode;
|
|
@@ -349,9 +356,9 @@ export interface MultiSelectProps {
|
|
|
349
356
|
tabIndex?: number;
|
|
350
357
|
/**
|
|
351
358
|
* Callback for rendering each selected value
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
359
|
+
* ```
|
|
360
|
+
* (props: TokenRendererProps) => React.ReactNode
|
|
361
|
+
* ```
|
|
355
362
|
* @since 10.19.0
|
|
356
363
|
*/
|
|
357
364
|
tokenRenderer?: (props: MultiSelectTokenRendererProps) => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.types.js","names":[],"sources":["../../src/MultiSelect/MultiSelect.types.ts"],"sourcesContent":["import type { DropdownPlacement } from '../Dropdown/Dropdown.types'\nimport type {\n MenuProps,\n MenuRef,\n Selection,\n} from '../MenuImperative/MenuImperative.types'\nimport type { OverlayTriggerProps } from '../OverlayTrigger'\n\nexport type ChangeEvent = React.ChangeEvent<HTMLInputElement>\n\nexport type OptionItem = any\n\nexport interface MultiSelectOptionProps {\n /**\n * @since 10.19.0\n */\n children?: React.ReactNode\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n selected?: boolean\n /**\n * @since 10.19.0\n */\n suggested?: boolean\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n value: OptionItem\n}\n\nexport interface MultiSelectOptionRendererProps extends MultiSelectOptionProps {\n /**\n * @since 10.19.0\n */\n getId: MultiSelectConfig['getId']\n\n /**\n * @since 10.19.0\n */\n getLabel: MultiSelectConfig['getLabel']\n /**\n * @since 10.19.0\n */\n qa: QaTags\n}\n\nexport interface GroupItem {\n /**\n * @since 10.19.0\n */\n id: string\n /**\n * @since 10.19.0\n */\n label: string\n}\n\nexport interface GroupHeader extends GroupItem {\n /**\n * @since 10.19.0\n */\n isGroupHeader: boolean\n}\n\nexport interface MultiSelectConfig {\n /**\n * @since 10.19.0\n */\n getGroup: (option: OptionItem) => number | string\n /**\n * @since 10.19.0\n */\n getId: (option: OptionItem) => number | string\n /**\n * @since 10.19.0\n */\n getLabel: (option: OptionItem) => string\n /**\n * @since 10.19.0\n */\n menuRef: React.RefObject<MenuRef>\n /**\n * @since 10.19.0\n */\n onChange?: (value: OptionItem[], event?: Event) => void\n /**\n * @since 10.19.0\n */\n onSearch?: (e: ChangeEvent) => void\n /**\n * @since 10.19.0\n */\n onSelect?: (selection: Selection) => void\n /**\n * @since 10.19.0\n */\n optgroups?: GroupItem[]\n /**\n * @since 10.19.0\n */\n options: OptionItem[]\n /**\n * @since 10.19.0\n */\n value: OptionItem[]\n}\n\nexport interface MultiSelectHook {\n /**\n * @since 10.19.0\n */\n ids: Set<number | string>\n /**\n * @since 10.19.0\n */\n index: number | null\n /**\n * @since 10.19.0\n */\n menuRef: React.RefObject<MenuRef>\n /**\n * @since 10.19.0\n */\n options: (OptionItem | GroupHeader)[]\n /**\n * @since 10.19.0\n */\n search: string\n /**\n * @since 10.19.0\n */\n clearToken: () => void\n /**\n * @since 10.19.0\n */\n decrementToken: () => void\n /**\n * @since 10.19.0\n */\n incrementToken: () => void\n /**\n * @since 10.19.0\n */\n onSearch: (e: React.ChangeEvent<HTMLInputElement>) => void\n /**\n * @since 10.19.0\n */\n onSelect: (selection: Selection) => void\n /**\n * @since 10.19.0\n */\n removeToken: (index: number) => void\n /**\n * @since 10.19.0\n */\n domHandlers: {\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void\n }\n}\n\nexport interface GroupedOptionsProps {\n /**\n * @since 10.19.0\n */\n multiselect: MultiSelectHook\n /**\n * @since 10.19.0\n */\n groupHeaderRenderer: (group: GroupItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n optionRenderer: (\n option: OptionItem,\n props: MultiSelectOptionRendererProps\n ) => React.ReactNode\n /**\n * @since 10.19.0\n */\n getId: MultiSelectConfig['getId']\n /**\n * @since 10.19.0\n */\n getLabel: MultiSelectConfig['getLabel']\n /**\n * @since 10.19.0\n */\n isOptionDisabled: (option: OptionItem) => boolean\n /**\n * @since 10.19.0\n */\n qa: QaTags\n}\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n option?: (option: OptionItem) => string\n /**\n * @since 10.19.0\n */\n token?: (option: OptionItem) => string\n /**\n * @since 10.19.0\n */\n tokenClear?: (option: OptionItem) => string\n}\n\nexport interface MultiSelectTokenRendererProps {\n /**\n * @since 10.19.0\n */\n focused: boolean\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n option: OptionItem\n /**\n * @since 10.19.0\n */\n removeToken: () => void\n /**\n * @since 10.19.0\n */\n getLabel: (opt: OptionItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n qa: QaTags\n}\n\nexport interface MultiSelectProps {\n /**\n * @since 10.19.0\n */\n afterHide?: OverlayTriggerProps['afterHide']\n /**\n * @since 10.19.0\n */\n afterShow?: OverlayTriggerProps['afterShow']\n /**\n * @since 10.19.0\n */\n beforeHide?: OverlayTriggerProps['beforeHide']\n /**\n * @since 10.19.0\n */\n beforeShow?: OverlayTriggerProps['beforeShow']\n\n /**\n * Callback for each entry in
|
|
1
|
+
{"version":3,"file":"MultiSelect.types.js","names":[],"sources":["../../src/MultiSelect/MultiSelect.types.ts"],"sourcesContent":["import type { DropdownPlacement } from '../Dropdown/Dropdown.types'\nimport type {\n MenuProps,\n MenuRef,\n Selection,\n} from '../MenuImperative/MenuImperative.types'\nimport type { OverlayTriggerProps } from '../OverlayTrigger'\n\nexport type ChangeEvent = React.ChangeEvent<HTMLInputElement>\n\nexport type OptionItem = any\n\nexport interface MultiSelectOptionProps {\n /**\n * @since 10.19.0\n */\n children?: React.ReactNode\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n selected?: boolean\n /**\n * @since 10.19.0\n */\n suggested?: boolean\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n value: OptionItem\n}\n\nexport interface MultiSelectOptionRendererProps extends MultiSelectOptionProps {\n /**\n * @since 10.19.0\n */\n getId: MultiSelectConfig['getId']\n\n /**\n * @since 10.19.0\n */\n getLabel: MultiSelectConfig['getLabel']\n /**\n * @since 10.19.0\n */\n qa: QaTags\n}\n\nexport interface GroupItem {\n /**\n * @since 10.19.0\n */\n id: string\n /**\n * @since 10.19.0\n */\n label: string\n}\n\nexport interface GroupHeader extends GroupItem {\n /**\n * @since 10.19.0\n */\n isGroupHeader: boolean\n}\n\nexport interface MultiSelectConfig {\n /**\n * @since 10.19.0\n */\n getGroup: (option: OptionItem) => number | string\n /**\n * @since 10.19.0\n */\n getId: (option: OptionItem) => number | string\n /**\n * @since 10.19.0\n */\n getLabel: (option: OptionItem) => string\n /**\n * @since 10.19.0\n */\n menuRef: React.RefObject<MenuRef>\n /**\n * @since 10.19.0\n */\n onChange?: (value: OptionItem[], event?: Event) => void\n /**\n * @since 10.19.0\n */\n onSearch?: (e: ChangeEvent) => void\n /**\n * @since 10.19.0\n */\n onSelect?: (selection: Selection) => void\n /**\n * @since 10.19.0\n */\n optgroups?: GroupItem[]\n /**\n * @since 10.19.0\n */\n options: OptionItem[]\n /**\n * @since 10.19.0\n */\n value: OptionItem[]\n}\n\nexport interface MultiSelectHook {\n /**\n * @since 10.19.0\n */\n ids: Set<number | string>\n /**\n * @since 10.19.0\n */\n index: number | null\n /**\n * @since 10.19.0\n */\n menuRef: React.RefObject<MenuRef>\n /**\n * @since 10.19.0\n */\n options: (OptionItem | GroupHeader)[]\n /**\n * @since 10.19.0\n */\n search: string\n /**\n * @since 10.19.0\n */\n clearToken: () => void\n /**\n * @since 10.19.0\n */\n decrementToken: () => void\n /**\n * @since 10.19.0\n */\n incrementToken: () => void\n /**\n * @since 10.19.0\n */\n onSearch: (e: React.ChangeEvent<HTMLInputElement>) => void\n /**\n * @since 10.19.0\n */\n onSelect: (selection: Selection) => void\n /**\n * @since 10.19.0\n */\n removeToken: (index: number) => void\n /**\n * @since 10.19.0\n */\n domHandlers: {\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void\n }\n}\n\nexport interface GroupedOptionsProps {\n /**\n * @since 10.19.0\n */\n multiselect: MultiSelectHook\n /**\n * @since 10.19.0\n */\n groupHeaderRenderer: (group: GroupItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n optionRenderer: (\n option: OptionItem,\n props: MultiSelectOptionRendererProps\n ) => React.ReactNode\n /**\n * @since 10.19.0\n */\n getId: MultiSelectConfig['getId']\n /**\n * @since 10.19.0\n */\n getLabel: MultiSelectConfig['getLabel']\n /**\n * @since 10.19.0\n */\n isOptionDisabled: (option: OptionItem) => boolean\n /**\n * @since 10.19.0\n */\n qa: QaTags\n}\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n option?: (option: OptionItem) => string\n /**\n * @since 10.19.0\n */\n token?: (option: OptionItem) => string\n /**\n * @since 10.19.0\n */\n tokenClear?: (option: OptionItem) => string\n}\n\nexport interface MultiSelectTokenRendererProps {\n /**\n * @since 10.19.0\n */\n focused: boolean\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n option: OptionItem\n /**\n * @since 10.19.0\n */\n removeToken: () => void\n /**\n * @since 10.19.0\n */\n getLabel: (opt: OptionItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n qa: QaTags\n}\n\nexport interface MultiSelectProps {\n /**\n * @since 10.19.0\n */\n afterHide?: OverlayTriggerProps['afterHide']\n /**\n * @since 10.19.0\n */\n afterShow?: OverlayTriggerProps['afterShow']\n /**\n * @since 10.19.0\n */\n beforeHide?: OverlayTriggerProps['beforeHide']\n /**\n * @since 10.19.0\n */\n beforeShow?: OverlayTriggerProps['beforeShow']\n\n /**\n * Callback for each entry in `options` to define relation to group in `groups`\n * ```\n * (option: OptionItem) => React.ReactNode\n * ```\n * @since 10.19.0\n */\n getGroup?: MultiSelectConfig['getGroup']\n\n /**\n * Callback for each entry in `options` for keying and optimizations\n * ```\n * (option: OptionItem) => number | string\n * ```\n * @since 10.19.0\n */\n getId?: MultiSelectConfig['getId']\n\n /**\n * Callback for each entry in `options` to generate the token label.\n * ```\n * (option: OptionItem) => string\n * ```\n * @since 10.19.0\n */\n getLabel?: MultiSelectConfig['getLabel']\n\n /**\n * Callback for when a user types into the multiselect input\n * ```\n * (event: KeyboardEvent) => void\n * ```\n * @since 10.19.0\n */\n onSearch?: MultiSelectConfig['onSearch']\n\n /**\n * Array of available option groups\n */\n optgroups?: MultiSelectConfig['optgroups']\n\n /**\n * Array of available options\n * @since 10.19.0\n */\n options?: MultiSelectConfig['options']\n\n /**\n * @since 10.19.0\n */\n onScrollBottom?: MenuProps['onScrollBottom']\n\n /**\n * @since 10.19.0\n */\n block?: boolean\n\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n isOptionDisabled?: (option: OptionItem) => boolean\n /**\n * @since 10.19.0\n */\n emptyMessage?: string\n /**\n * @since 10.19.0\n */\n error?: boolean\n\n /**\n * Callback for rendering header for each entry in `groups`\n * ```\n * (group: GroupItem) => React.ReactNode\n * ```\n * @since 10.19.0\n */\n groupHeaderRenderer?: (group: GroupItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n loading?: boolean\n /**\n * @since 10.19.0\n */\n onBlur?: React.SelectHTMLAttributes<HTMLDivElement>['onBlur']\n /**\n * @since 10.19.0\n */\n onChange?: (value: OptionItem[], event?: Event) => void\n /**\n * @since 10.19.0\n */\n onFocus?: React.SelectHTMLAttributes<HTMLDivElement>['onFocus']\n /**\n * @since 10.19.0\n */\n optionRenderer?: (\n option: OptionItem,\n props?: MultiSelectOptionRendererProps\n ) => React.ReactNode\n /**\n * @since 10.19.0\n */\n placeholder?: string\n /**\n * @since 10.19.0\n */\n placement?: DropdownPlacement\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n /**\n * @since 10.19.0\n */\n tabIndex?: number\n /**\n * Callback for rendering each selected value\n * ```\n * (props: TokenRendererProps) => React.ReactNode\n * ```\n * @since 10.19.0\n */\n tokenRenderer?: (props: MultiSelectTokenRendererProps) => React.ReactNode\n\n /**\n * Array of the currently selected values\n * @since 10.19.0\n */\n value?: OptionItem[]\n\n /**\n * @since 10.29.0\n */\n footer?: React.ReactNode\n\n /**\n * @since 11.4.0\n */\n ['aria-labelledby']?: string\n}\n"],"mappings":""}
|
|
@@ -6,14 +6,14 @@ export var optionMinHeight = 32;
|
|
|
6
6
|
export var defaultMenuHeight = 64;
|
|
7
7
|
export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledOptions",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_15_0__sc-3o6zya-0"
|
|
10
10
|
})([""]);
|
|
11
11
|
export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledItem",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_15_0__sc-3o6zya-1"
|
|
14
14
|
})(["", ";padding:", "px ", "px;cursor:pointer;list-style-type:none;"], getTypographyIntent('body'), spacing.xs, spacing.md);
|
|
15
15
|
export var StyledGroup = /*#__PURE__*/styled.div.withConfig({
|
|
16
16
|
displayName: "StyledGroup",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_15_0__sc-3o6zya-2"
|
|
18
18
|
})(["", ";padding:", "px ", "px ", "px;font-weight:", ";background:white;list-style-type:none;"], getTypographyIntent('body'), spacing.md, spacing.md, spacing.xs, typographyWeights.semibold);
|
|
19
19
|
//# sourceMappingURL=NextMenu.styles.js.map
|
|
@@ -14,7 +14,7 @@ var variantColorMap = {
|
|
|
14
14
|
};
|
|
15
15
|
var StyledNotation = /*#__PURE__*/styled.i.withConfig({
|
|
16
16
|
displayName: "StyledNotation",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_15_0__sc-160q1m6-0"
|
|
18
18
|
})(["", " color:", ";font-style:italic;"], getTypographyIntent('small'), function (_ref) {
|
|
19
19
|
var variant = _ref.variant;
|
|
20
20
|
return variant ? colors[variantColorMap[variant]] : colors.gray15;
|
|
@@ -384,7 +384,7 @@ export var NumberInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
384
384
|
_onBlur(e);
|
|
385
385
|
};
|
|
386
386
|
return /*#__PURE__*/React.createElement(StyledWrapper, {
|
|
387
|
-
hasIncrementer: hasIncrementer,
|
|
387
|
+
$hasIncrementer: hasIncrementer,
|
|
388
388
|
"data-qa": qa === null || qa === void 0 ? void 0 : qa.wrapper
|
|
389
389
|
}, /*#__PURE__*/React.createElement(StyledInput, _extends({
|
|
390
390
|
value: inputValue,
|
|
@@ -404,7 +404,7 @@ export var NumberInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
404
404
|
})), prefix && /*#__PURE__*/React.createElement(StyledPrefix, {
|
|
405
405
|
disabled: disabled
|
|
406
406
|
}, prefix), suffix && /*#__PURE__*/React.createElement(StyledSuffix, {
|
|
407
|
-
withIncrementer: hasIncrementer,
|
|
407
|
+
$withIncrementer: hasIncrementer,
|
|
408
408
|
disabled: disabled
|
|
409
409
|
}, suffix), hasIncrementer && /*#__PURE__*/React.createElement(StyledIncrementerWrapper, null, /*#__PURE__*/React.createElement(StyledIncrementerButton, {
|
|
410
410
|
"aria-hidden": "true",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","names":["formatCurrencyToParts","findIndex","React","useI18nContext","spacing","mergeRefs","defaultCurrencyFillDecimalScale","defaultCurrencyInputPrefix","useNumberFormat","usePrevious","addonRootFontFamily","addonRootFontSize","addonRootPadding","inputDefaultXPadding","StyledIncrementerButton","StyledIncrementerWrapper","StyledInput","StyledPrefix","StyledSuffix","StyledWrapper","backspaceKey","commaKey","controlKey","copyKey","defaultLocale","deleteKey","emptyString","format","getNewCursorPosition","getSeparators","highlightAllKey","identicalLocales","identifyPressedKey","maxDigitLength","metaKeyIdentifier","minus","numericKeypadKey","periodKey","prepareValueToFormatting","toFixed","unformat","noop","PlusIcon","createElement","width","height","viewBox","xmlns","d","MinusIcon","NumberInput","forwardRef","_ref","ref","_ref$decimalScale","decimalScale","defaultValue","_ref$disabled","disabled","_ref$error","error","_ref$fillDecimalScale","fillDecimalScale","_onChange","onChange","_ref$onKeyDown","onKeyDown","_onKeyDown","_ref$onBlur","onBlur","_onBlur","_ref$prefix","prefix","readOnly","_ref$step","step","style","_ref$suffix","suffix","value","qa","props","_objectWithoutProperties","_excluded","I18n","contextLocale","locale","inputRef","useRef","_useNumberFormat","verifiedDecimalScale","fillDecimalScaleOnBlur","fixedDecimalScale","formatValue","getValueLengthInfo","isControlled","undefined","isControlledWithoutOnChangeHandlerAndReadOnlyAttribute","hasIncrementer","_React$useMemo","useMemo","group","decimal","decimalSeparatorKey","inputPadding","fontContext","concat","element","document","context","getContext","font","extraBasePadding","suffixPadding","Math","ceil","measureText","getRightPadding","xl","left","right","getValueChange","useCallback","_unformat","parsedNumber","isNaN","externalOnChange","_React$useState","useState","_React$useState2","_slicedToArray","inputValue","setInputValue","_React$useState3","_React$useState4","prevValue","setPrevValue","_React$useState5","selectionStart","selectionEnd","selection","_React$useState6","prevCursorPosition","setPrevCursorPosition","_React$useState7","_React$useState8","pressedKey","setPressedKey","prevLocale","useLayoutEffect","formattedValue","console","useEffect","prev","newValue","_inputRef$current","displayValue","current","lastChar","length","lastCharIsPending","includes","decimals","split","lastDecimalIsZero","onlyMinusDisplayed","getNewValueAndCursorPosition","preparedValue","newCursorPosition","adjustCursor","newPosition","_inputRef$current2","setSelectionRange","setTimeout","_inputRef$current3","makeStep","down","arguments","getSignificantPrecision","fraction","reversedFraction","reverse","indexOfLastSignificantFractionDigit","i","slice","_unformat2","_unformat3","stepFraction","prevValuePrecision","prevValueSignificantPrecision","rawStepPrecision","rawStepPrecisionExceedsDecimalScale","stepPrecision","warn","diff","precision","max","significantPrecision","calculated","_getValueLengthInfo","isSafeLength","isSafeIntegerLength","rejectStepByLengthLimit","formatted","internalOnKeyDown","e","ctrlKey","metaKey","key","_e$target","target","preserveDecimalSeparator","decimalBackspaced","decimalDeleted","nonReplacingKeys","decimalReplacedAsSelection","preserveDecimal","base","shift","cursorPosition","preventDefault","isDecimalSeparatorPreserved","_getValueLengthInfo2","safeIntegerLength","integerLength","fractionLength","decimalSeparatorCanNotBeRemoved","handleIncrementer","internalOnChange","inputType","nativeEvent","_getNewValueAndCursor","internalOnBlur","_unformat4","integer","shouldValueBeCleared","shouldIntegerPartBeFilled","isDecimalSeparatorRedundant","isDecimalScaleNotFilled","shouldDecimalScaleBeFilled","getNewValue","numberOfZerosToPad","Array","from","_","join","replace","RegExp","wrapper","_extends","inputMode","_objectSpread","paddingLeft","paddingRight","withIncrementer","type","tabIndex","increment","onClick","decrement","displayName","getCurrencyProps","_decimalScale","symbol","currencyIsoCode","currencyDisplay","_parts$find","_parts$find2","currencyOptions","parts","formatterDecimalScale","find","part","placement","object","currencyIsoSymbol","toString","currencyProps","CurrencyInput","_ref2","_ref2$fillDecimalScal","_ref2$prefix","_excluded2"],"sources":["../../src/NumberInput/NumberInput.tsx"],"sourcesContent":["import type {\n CurrencyDisplay,\n CurrencyOptions,\n} from '@procore/globalization-toolkit'\nimport { formatCurrencyToParts } from '@procore/globalization-toolkit'\nimport { findIndex } from 'ramda'\nimport React from 'react'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { spacing } from '../_styles/spacing'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport {\n defaultCurrencyFillDecimalScale,\n defaultCurrencyInputPrefix,\n} from './NumberInput.constants'\nimport { useNumberFormat, usePrevious } from './NumberInput.hooks'\nimport {\n addonRootFontFamily,\n addonRootFontSize,\n addonRootPadding,\n inputDefaultXPadding,\n StyledIncrementerButton,\n StyledIncrementerWrapper,\n StyledInput,\n StyledPrefix,\n StyledSuffix,\n StyledWrapper,\n} from './NumberInput.styles'\nimport type {\n CurrencyInputProps,\n CurrencyProps,\n CursorPosition,\n NumberInputProps,\n PressedKey,\n} from './NumberInput.types'\nimport {\n backspaceKey,\n commaKey,\n controlKey,\n copyKey,\n defaultLocale,\n deleteKey,\n emptyString,\n format,\n getNewCursorPosition,\n getSeparators,\n highlightAllKey,\n identicalLocales,\n identifyPressedKey,\n maxDigitLength,\n metaKeyIdentifier,\n minus,\n numericKeypadKey,\n periodKey,\n prepareValueToFormatting,\n toFixed,\n unformat,\n} from './NumberInput.utils'\n\nfunction noop() {}\n\nconst PlusIcon = () => (\n <svg\n width=\"8\"\n height=\"8\"\n viewBox=\"0 0 8 8\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M4.5 0H3.5V3.5H0V4.5H3.5V8H4.5V4.5H8V3.5H4.5V0Z\" />\n </svg>\n)\n\nconst MinusIcon = () => (\n <svg\n width=\"8\"\n height=\"2\"\n viewBox=\"0 0 8 2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M4.5 0.5H3.5H0V1.5H3.5H4.5H8V0.5H4.5Z\" />\n </svg>\n)\n\n/**\n\n The number input allows users to add numbers to a given form or table.\n The currency input will be used for data with a monetary value.\n Both components allow characters 0-9, periods, and commas. In order to avoid\n the loss of precision, the number length is limited by 15 digits.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-numberinput--demo-number-input)\n\n @see [Design Guidelines](https://design.procore.com/number-and-currency-input)\n\n */\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n (\n {\n decimalScale = true,\n defaultValue,\n disabled = false,\n error = false,\n fillDecimalScale = 'none',\n onChange: _onChange,\n onKeyDown: _onKeyDown = noop,\n onBlur: _onBlur = noop,\n prefix = emptyString,\n readOnly,\n step = 0,\n style,\n suffix = emptyString,\n value,\n qa,\n ...props\n },\n ref\n ) => {\n const I18n = useI18nContext()\n const contextLocale = I18n.locale || defaultLocale\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n const {\n decimalScale: verifiedDecimalScale,\n fillDecimalScaleOnBlur,\n fixedDecimalScale,\n formatValue,\n getValueLengthInfo,\n locale,\n } = useNumberFormat({\n decimalScale,\n fillDecimalScale,\n locale: contextLocale,\n })\n\n const isControlled = value !== undefined\n const isControlledWithoutOnChangeHandlerAndReadOnlyAttribute =\n isControlled && !_onChange && !readOnly\n const hasIncrementer = step > 0 && !readOnly\n\n const { group, decimal } = React.useMemo(\n () => getSeparators(locale),\n [locale]\n )\n const decimalSeparatorKey = React.useMemo(() => {\n return decimal === periodKey ? periodKey : commaKey\n }, [decimal])\n\n const inputPadding = React.useMemo((): {\n left: number\n right: number | null\n } => {\n const fontContext = `${addonRootFontSize} \"${addonRootFontFamily}\"`\n\n if (prefix || suffix) {\n const element = document.createElement('canvas')\n const context = element?.getContext('2d')\n\n if (context) {\n context.font = fontContext\n\n const extraBasePadding = inputDefaultXPadding + addonRootPadding\n\n const suffixPadding =\n extraBasePadding + Math.ceil(context.measureText(suffix).width)\n\n const getRightPadding = () => {\n if (hasIncrementer && suffix) {\n return suffixPadding + spacing.xl\n }\n if (suffix) {\n return suffixPadding\n }\n return null\n }\n\n return {\n left: prefix\n ? extraBasePadding + Math.ceil(context.measureText(prefix).width)\n : inputDefaultXPadding,\n right: getRightPadding(),\n }\n }\n }\n\n return {\n left: inputDefaultXPadding,\n right: null,\n }\n }, [prefix, suffix, hasIncrementer])\n\n const getValueChange = React.useCallback(\n (value: string) => {\n const { parsedNumber } = unformat(locale, value)\n return {\n value,\n parsedNumber: isNaN(parsedNumber) ? null : parsedNumber,\n }\n },\n [locale]\n )\n\n const externalOnChange = React.useCallback(\n (value: string) => _onChange && _onChange(getValueChange(value)),\n [_onChange, getValueChange]\n )\n\n const [inputValue, setInputValue] = React.useState(\n formatValue(defaultValue)\n )\n const [prevValue, setPrevValue] = React.useState(\n isControlled ? formatValue(value) : inputValue\n )\n const [prevCursorPosition, setPrevCursorPosition] =\n React.useState<CursorPosition>({\n selectionStart: 0,\n selectionEnd: 0,\n selection: emptyString,\n })\n const [pressedKey, setPressedKey] = React.useState()\n const prevLocale = usePrevious(locale)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n React.useLayoutEffect(() => {\n const formattedValue = formatValue(value)\n if (isControlled && inputValue !== formattedValue) {\n setInputValue(formattedValue)\n }\n\n if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) {\n console.error(\n `Warning: Failed prop type: You provided a \\`value\\` prop to a form field without an \\`onChange\\` handler.\n This will render a read-only field. If the field should be mutable use \\`defaultValue\\`.\n Otherwise, set either \\`onChange\\` or \\`readOnly\\`.`\n )\n }\n }, [value])\n\n React.useEffect(() => {\n if (prevLocale && !identicalLocales(prevLocale, locale)) {\n setInputValue((prev) => {\n const newValue = formatValue(unformat(prevLocale, prev).parsedNumber)\n externalOnChange(newValue)\n return newValue\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [prevLocale, formatValue])\n\n React.useLayoutEffect(() => {\n const displayValue = inputRef.current?.value || ''\n if (!_onChange || !displayValue) {\n return\n }\n const formattedValue = formatValue(value)\n\n if (displayValue !== formattedValue) {\n const lastChar = displayValue[displayValue.length - 1]\n const lastCharIsPending = [periodKey, commaKey].includes(lastChar)\n\n const decimals = displayValue.split(decimal)[1] || ''\n const lastDecimalIsZero =\n decimals && decimals[decimals.length - 1] === '0'\n\n const onlyMinusDisplayed = displayValue === minus\n\n // a client state and display mismatch is only valid when\n if (lastCharIsPending || lastDecimalIsZero || onlyMinusDisplayed) {\n return\n }\n\n // otherwise sync display with client state\n setInputValue(formattedValue)\n }\n })\n\n const getNewValueAndCursorPosition = (\n value: string,\n pressedKey: PressedKey\n ) => {\n const preparedValue = prepareValueToFormatting(\n decimal,\n decimalSeparatorKey,\n group,\n pressedKey,\n prevCursorPosition,\n prevValue,\n verifiedDecimalScale,\n value\n )\n const newValue = formatValue(preparedValue)\n\n return {\n newValue,\n newCursorPosition: getNewCursorPosition(\n decimal,\n decimalSeparatorKey,\n group,\n newValue,\n pressedKey,\n prevCursorPosition,\n prevValue,\n value,\n verifiedDecimalScale,\n locale,\n fillDecimalScale\n ),\n }\n }\n\n const adjustCursor = (newPosition: number) => {\n inputRef.current?.setSelectionRange(newPosition, newPosition)\n // Mobile Chrome adjustment\n setTimeout(\n () => inputRef.current?.setSelectionRange(newPosition, newPosition),\n 0\n )\n }\n\n const makeStep = (down = false) => {\n const getSignificantPrecision = (fraction: string) => {\n const reversedFraction = fraction.split(emptyString).reverse()\n const indexOfLastSignificantFractionDigit = findIndex(\n (i) => i !== '0',\n reversedFraction\n )\n\n return indexOfLastSignificantFractionDigit > -1\n ? reversedFraction.slice(indexOfLastSignificantFractionDigit).length\n : 0\n }\n\n const { parsedNumber, fraction } = unformat(locale, inputValue)\n const { fraction: stepFraction } = unformat(locale, step)\n\n const prevValuePrecision = fraction.length || 0\n const prevValueSignificantPrecision = getSignificantPrecision(fraction)\n const rawStepPrecision = stepFraction.length || 0\n const rawStepPrecisionExceedsDecimalScale =\n rawStepPrecision > verifiedDecimalScale\n const stepPrecision = rawStepPrecisionExceedsDecimalScale\n ? verifiedDecimalScale\n : rawStepPrecision\n\n if (rawStepPrecisionExceedsDecimalScale) {\n console.warn(\n `WARNING: Step's value was rounded since its scale (${rawStepPrecision}) exceeds the decimal scale (${verifiedDecimalScale}).`\n )\n }\n\n const diff = toFixed(step, stepPrecision) * (down ? -1 : 1)\n const precision = Math.max(\n stepPrecision,\n fixedDecimalScale ? verifiedDecimalScale : prevValuePrecision\n )\n const significantPrecision = Math.max(\n prevValueSignificantPrecision,\n stepPrecision\n )\n const calculated = inputValue\n ? ((parsedNumber || 0) + diff).toFixed(significantPrecision)\n : diff\n\n const { isSafeLength, isSafeIntegerLength } = getValueLengthInfo(\n calculated,\n true\n )\n\n const rejectStepByLengthLimit = !isSafeLength || !isSafeIntegerLength\n\n if (rejectStepByLengthLimit) {\n console.warn(\n `WARNING: Incrementer's step was not fulfilled since result oversteps input ${maxDigitLength}-digit limit and can't be presented without a loss of precision.`\n )\n return\n }\n\n const formatted = format(locale, precision, 'always', calculated, true)\n\n setInputValue(formatted)\n externalOnChange(formatted)\n }\n\n const internalOnKeyDown = (e: any) => {\n const {\n ctrlKey,\n metaKey,\n key,\n target: { value, selectionStart, selectionEnd },\n } = e\n\n const selection = value.slice(selectionStart, selectionEnd)\n\n setPressedKey(key)\n setPrevCursorPosition({\n selectionStart,\n selectionEnd,\n selection,\n })\n setPrevValue(value)\n\n const preserveDecimalSeparator = () => {\n const decimalBackspaced =\n !selection &&\n [backspaceKey].includes(key) &&\n value[selectionEnd - 1] === decimal\n\n const decimalDeleted =\n !selection &&\n [deleteKey, numericKeypadKey].includes(key) &&\n value[selectionEnd] === decimal\n\n const nonReplacingKeys =\n [metaKeyIdentifier, controlKey, highlightAllKey, copyKey].includes(\n key\n ) &&\n (ctrlKey || metaKey)\n\n const decimalReplacedAsSelection =\n selection &&\n selection.includes(decimal) &&\n selection.length < value.length &&\n !nonReplacingKeys\n\n const preserveDecimal =\n decimalBackspaced || decimalDeleted || decimalReplacedAsSelection\n\n if (preserveDecimal) {\n const base = decimalReplacedAsSelection\n ? selectionStart\n : selectionEnd\n\n const shift = (decimalBackspaced && -1) || (decimalDeleted && 1) || 0\n\n const cursorPosition = base + shift\n\n e.preventDefault()\n adjustCursor(cursorPosition)\n }\n }\n\n const isDecimalSeparatorPreserved = () => {\n const { safeIntegerLength, integerLength, fractionLength } =\n getValueLengthInfo(value)\n\n const decimalSeparatorCanNotBeRemoved =\n safeIntegerLength - integerLength < fractionLength\n\n return (\n (fillDecimalScaleOnBlur && decimalSeparatorCanNotBeRemoved) ||\n fixedDecimalScale\n )\n }\n\n if (isDecimalSeparatorPreserved()) {\n preserveDecimalSeparator()\n }\n\n const handleIncrementer = () => {\n switch (key) {\n case 'ArrowUp':\n case 'Up':\n e.preventDefault()\n makeStep()\n break\n case 'ArrowDown':\n case 'Down':\n e.preventDefault()\n makeStep(true)\n break\n }\n }\n\n if (hasIncrementer) {\n handleIncrementer()\n }\n\n _onKeyDown(e)\n }\n\n const internalOnChange = (e: any) => {\n if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) return\n\n const {\n target: { value },\n nativeEvent: { inputType },\n } = e\n\n const { newValue, newCursorPosition } = getNewValueAndCursorPosition(\n value,\n identifyPressedKey(\n decimalSeparatorKey,\n inputType,\n pressedKey,\n prevValue,\n value\n )\n )\n // Prevent cursor flickering\n e.target.value = newValue\n\n setInputValue(newValue)\n adjustCursor(newCursorPosition)\n\n if (newValue !== prevValue) {\n externalOnChange(newValue)\n }\n }\n\n const internalOnBlur = (e: any) => {\n const { integer, fraction } = unformat(locale, inputValue)\n\n const shouldValueBeCleared =\n inputValue === minus ||\n inputValue === decimal ||\n inputValue === `${minus}${decimal}`\n const shouldIntegerPartBeFilled =\n fraction.length > 0 && (integer === emptyString || integer === minus)\n const isDecimalSeparatorRedundant =\n verifiedDecimalScale > 0 &&\n inputValue[inputValue.length - 1] === decimal &&\n !fillDecimalScaleOnBlur\n const isDecimalScaleNotFilled = verifiedDecimalScale - fraction.length > 0\n const shouldDecimalScaleBeFilled =\n fillDecimalScaleOnBlur && isDecimalScaleNotFilled\n\n if (\n shouldValueBeCleared ||\n shouldIntegerPartBeFilled ||\n isDecimalSeparatorRedundant ||\n shouldDecimalScaleBeFilled\n ) {\n const getNewValue = () => {\n if (shouldValueBeCleared) {\n return emptyString\n }\n if (shouldIntegerPartBeFilled) {\n const numberOfZerosToPad = verifiedDecimalScale - fraction.length\n return `${integer}0${decimal}${\n shouldDecimalScaleBeFilled\n ? fraction.concat(\n Array.from({ length: numberOfZerosToPad }, (_) => '0').join(\n emptyString\n )\n )\n : fraction\n }`\n }\n if (isDecimalSeparatorRedundant) {\n return inputValue.replace(\n new RegExp(`[${decimal}]`, 'g'),\n emptyString\n )\n }\n if (shouldDecimalScaleBeFilled) {\n return format(locale, verifiedDecimalScale, 'always', inputValue)\n }\n\n return inputValue\n }\n const newValue = getNewValue()\n setInputValue(newValue)\n externalOnChange(newValue)\n }\n\n _onBlur(e)\n }\n\n return (\n <StyledWrapper hasIncrementer={hasIncrementer} data-qa={qa?.wrapper}>\n <StyledInput\n value={inputValue}\n disabled={disabled}\n error={error}\n onKeyDown={internalOnKeyDown}\n onChange={internalOnChange}\n onBlur={internalOnBlur}\n inputMode=\"numeric\"\n readOnly={readOnly}\n style={{\n ...style,\n ...{\n paddingLeft: `${inputPadding.left}px`,\n paddingRight: `${inputPadding.right}px`,\n },\n }}\n {...props}\n ref={mergeRefs(ref, inputRef)}\n />\n {prefix && <StyledPrefix disabled={disabled}>{prefix}</StyledPrefix>}\n {suffix && (\n <StyledSuffix withIncrementer={hasIncrementer} disabled={disabled}>\n {suffix}\n </StyledSuffix>\n )}\n {hasIncrementer && (\n <StyledIncrementerWrapper>\n <StyledIncrementerButton\n aria-hidden=\"true\"\n type=\"button\"\n disabled={disabled}\n tabIndex={-1}\n data-qa={qa?.increment}\n onClick={() => makeStep()}\n >\n <PlusIcon />\n </StyledIncrementerButton>\n <StyledIncrementerButton\n aria-hidden=\"true\"\n type=\"button\"\n disabled={disabled}\n tabIndex={-1}\n data-qa={qa?.decrement}\n onClick={() => makeStep(true)}\n >\n <MinusIcon />\n </StyledIncrementerButton>\n </StyledIncrementerWrapper>\n )}\n </StyledWrapper>\n )\n }\n)\n\nNumberInput.displayName = 'NumberInput'\n\nexport const getCurrencyProps = (\n locale: string,\n _decimalScale: NumberInputProps['decimalScale'],\n symbol?: string,\n currencyIsoCode?: string,\n currencyDisplay?: CurrencyDisplay\n): CurrencyProps => {\n const currencyOptions: CurrencyOptions = {\n locale,\n currencyIsoCode: currencyIsoCode || 'USD',\n currencyDisplay: currencyDisplay || 'narrowSymbol',\n }\n const parts = formatCurrencyToParts(1, currencyOptions)\n\n const formatterDecimalScale =\n parts.find((part) => part.type === 'fraction')?.value.length || 0\n const decimalScale = _decimalScale || formatterDecimalScale\n\n const placement =\n parts.findIndex((object) => {\n return object.type === 'currency'\n }) <\n parts.findIndex((part) => {\n return part.type === 'integer'\n })\n ? 'prefix'\n : 'suffix'\n\n const currencyIsoSymbol = currencyIsoCode\n ? parts.find((part) => part.type === 'currency')?.value.toString()\n : undefined\n\n const currencyProps: CurrencyProps =\n placement === 'prefix'\n ? {\n decimalScale: decimalScale as NumberInputProps['decimalScale'],\n prefix: currencyIsoSymbol || symbol || '',\n }\n : {\n decimalScale: decimalScale as NumberInputProps['decimalScale'],\n suffix: currencyIsoSymbol || symbol || '',\n }\n\n return currencyProps\n}\n\nexport const CurrencyInput = React.forwardRef<\n HTMLInputElement,\n CurrencyInputProps\n>(\n (\n {\n currencyDisplay,\n currencyIsoCode,\n decimalScale: _decimalScale,\n fillDecimalScale = defaultCurrencyFillDecimalScale,\n prefix = defaultCurrencyInputPrefix,\n suffix,\n ...props\n },\n ref\n ) => {\n const I18n = useI18nContext()\n const contextLocale = props.locale || I18n.locale || defaultLocale\n\n const currencyProps: CurrencyProps = getCurrencyProps(\n contextLocale as string,\n _decimalScale,\n prefix || suffix,\n currencyIsoCode,\n currencyDisplay\n )\n\n return (\n <NumberInput\n fillDecimalScale={fillDecimalScale}\n {...props}\n {...currencyProps}\n ref={ref}\n />\n )\n }\n)\n\nCurrencyInput.displayName = 'CurrencyInput'\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,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AAff,eAAe;IACDF,aAAa,GAAAiB,KAAA,CAA3BhO,YAAY;IAAAiO,qBAAA,GAAAD,KAAA,CACZzN,gBAAgB;IAAhBA,gBAAgB,GAAA0N,qBAAA,cAAGlR,+BAA+B,GAAAkR,qBAAA;IAAAC,YAAA,GAAAF,KAAA,CAClD/M,MAAM;IAANA,MAAM,GAAAiN,YAAA,cAAGlR,0BAA0B,GAAAkR,YAAA;IACnC3M,MAAM,GAAAyM,KAAA,CAANzM,MAAM;IACHG,KAAK,GAAAC,wBAAA,CAAAqM,KAAA,EAAAG,UAAA;EAIV,IAAMtM,IAAI,GAAGjF,cAAc,CAAC,CAAC;EAC7B,IAAMkF,aAAa,GAAGJ,KAAK,CAACK,MAAM,IAAIF,IAAI,CAACE,MAAM,IAAI9D,aAAa;EAElE,IAAM6P,aAA4B,GAAGhB,gBAAgB,CACnDhL,aAAa,EACbiL,aAAa,EACb9L,MAAM,IAAIM,MAAM,EAChB0L,eAAe,EACfC,eACF,CAAC;EAED,oBACEvQ,KAAA,CAAAyC,aAAA,CAACO,WAAW,EAAAuM,QAAA;IACV3L,gBAAgB,EAAEA;EAAiB,GAC/BmB,KAAK,EACLoM,aAAa;IACjBhO,GAAG,EAAEA;EAAI,EACV,CAAC;AAEN,CACF,CAAC;AAEDiO,aAAa,CAAClB,WAAW,GAAG,eAAe"}
|
|
1
|
+
{"version":3,"file":"NumberInput.js","names":["formatCurrencyToParts","findIndex","React","useI18nContext","spacing","mergeRefs","defaultCurrencyFillDecimalScale","defaultCurrencyInputPrefix","useNumberFormat","usePrevious","addonRootFontFamily","addonRootFontSize","addonRootPadding","inputDefaultXPadding","StyledIncrementerButton","StyledIncrementerWrapper","StyledInput","StyledPrefix","StyledSuffix","StyledWrapper","backspaceKey","commaKey","controlKey","copyKey","defaultLocale","deleteKey","emptyString","format","getNewCursorPosition","getSeparators","highlightAllKey","identicalLocales","identifyPressedKey","maxDigitLength","metaKeyIdentifier","minus","numericKeypadKey","periodKey","prepareValueToFormatting","toFixed","unformat","noop","PlusIcon","createElement","width","height","viewBox","xmlns","d","MinusIcon","NumberInput","forwardRef","_ref","ref","_ref$decimalScale","decimalScale","defaultValue","_ref$disabled","disabled","_ref$error","error","_ref$fillDecimalScale","fillDecimalScale","_onChange","onChange","_ref$onKeyDown","onKeyDown","_onKeyDown","_ref$onBlur","onBlur","_onBlur","_ref$prefix","prefix","readOnly","_ref$step","step","style","_ref$suffix","suffix","value","qa","props","_objectWithoutProperties","_excluded","I18n","contextLocale","locale","inputRef","useRef","_useNumberFormat","verifiedDecimalScale","fillDecimalScaleOnBlur","fixedDecimalScale","formatValue","getValueLengthInfo","isControlled","undefined","isControlledWithoutOnChangeHandlerAndReadOnlyAttribute","hasIncrementer","_React$useMemo","useMemo","group","decimal","decimalSeparatorKey","inputPadding","fontContext","concat","element","document","context","getContext","font","extraBasePadding","suffixPadding","Math","ceil","measureText","getRightPadding","xl","left","right","getValueChange","useCallback","_unformat","parsedNumber","isNaN","externalOnChange","_React$useState","useState","_React$useState2","_slicedToArray","inputValue","setInputValue","_React$useState3","_React$useState4","prevValue","setPrevValue","_React$useState5","selectionStart","selectionEnd","selection","_React$useState6","prevCursorPosition","setPrevCursorPosition","_React$useState7","_React$useState8","pressedKey","setPressedKey","prevLocale","useLayoutEffect","formattedValue","console","useEffect","prev","newValue","_inputRef$current","displayValue","current","lastChar","length","lastCharIsPending","includes","decimals","split","lastDecimalIsZero","onlyMinusDisplayed","getNewValueAndCursorPosition","preparedValue","newCursorPosition","adjustCursor","newPosition","_inputRef$current2","setSelectionRange","setTimeout","_inputRef$current3","makeStep","down","arguments","getSignificantPrecision","fraction","reversedFraction","reverse","indexOfLastSignificantFractionDigit","i","slice","_unformat2","_unformat3","stepFraction","prevValuePrecision","prevValueSignificantPrecision","rawStepPrecision","rawStepPrecisionExceedsDecimalScale","stepPrecision","warn","diff","precision","max","significantPrecision","calculated","_getValueLengthInfo","isSafeLength","isSafeIntegerLength","rejectStepByLengthLimit","formatted","internalOnKeyDown","e","ctrlKey","metaKey","key","_e$target","target","preserveDecimalSeparator","decimalBackspaced","decimalDeleted","nonReplacingKeys","decimalReplacedAsSelection","preserveDecimal","base","shift","cursorPosition","preventDefault","isDecimalSeparatorPreserved","_getValueLengthInfo2","safeIntegerLength","integerLength","fractionLength","decimalSeparatorCanNotBeRemoved","handleIncrementer","internalOnChange","inputType","nativeEvent","_getNewValueAndCursor","internalOnBlur","_unformat4","integer","shouldValueBeCleared","shouldIntegerPartBeFilled","isDecimalSeparatorRedundant","isDecimalScaleNotFilled","shouldDecimalScaleBeFilled","getNewValue","numberOfZerosToPad","Array","from","_","join","replace","RegExp","$hasIncrementer","wrapper","_extends","inputMode","_objectSpread","paddingLeft","paddingRight","$withIncrementer","type","tabIndex","increment","onClick","decrement","displayName","getCurrencyProps","_decimalScale","symbol","currencyIsoCode","currencyDisplay","_parts$find","_parts$find2","currencyOptions","parts","formatterDecimalScale","find","part","placement","object","currencyIsoSymbol","toString","currencyProps","CurrencyInput","_ref2","_ref2$fillDecimalScal","_ref2$prefix","_excluded2"],"sources":["../../src/NumberInput/NumberInput.tsx"],"sourcesContent":["import type {\n CurrencyDisplay,\n CurrencyOptions,\n} from '@procore/globalization-toolkit'\nimport { formatCurrencyToParts } from '@procore/globalization-toolkit'\nimport { findIndex } from 'ramda'\nimport React from 'react'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { spacing } from '../_styles/spacing'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport {\n defaultCurrencyFillDecimalScale,\n defaultCurrencyInputPrefix,\n} from './NumberInput.constants'\nimport { useNumberFormat, usePrevious } from './NumberInput.hooks'\nimport {\n addonRootFontFamily,\n addonRootFontSize,\n addonRootPadding,\n inputDefaultXPadding,\n StyledIncrementerButton,\n StyledIncrementerWrapper,\n StyledInput,\n StyledPrefix,\n StyledSuffix,\n StyledWrapper,\n} from './NumberInput.styles'\nimport type {\n CurrencyInputProps,\n CurrencyProps,\n CursorPosition,\n NumberInputProps,\n PressedKey,\n} from './NumberInput.types'\nimport {\n backspaceKey,\n commaKey,\n controlKey,\n copyKey,\n defaultLocale,\n deleteKey,\n emptyString,\n format,\n getNewCursorPosition,\n getSeparators,\n highlightAllKey,\n identicalLocales,\n identifyPressedKey,\n maxDigitLength,\n metaKeyIdentifier,\n minus,\n numericKeypadKey,\n periodKey,\n prepareValueToFormatting,\n toFixed,\n unformat,\n} from './NumberInput.utils'\n\nfunction noop() {}\n\nconst PlusIcon = () => (\n <svg\n width=\"8\"\n height=\"8\"\n viewBox=\"0 0 8 8\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M4.5 0H3.5V3.5H0V4.5H3.5V8H4.5V4.5H8V3.5H4.5V0Z\" />\n </svg>\n)\n\nconst MinusIcon = () => (\n <svg\n width=\"8\"\n height=\"2\"\n viewBox=\"0 0 8 2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M4.5 0.5H3.5H0V1.5H3.5H4.5H8V0.5H4.5Z\" />\n </svg>\n)\n\n/**\n\n The number input allows users to add numbers to a given form or table.\n The currency input will be used for data with a monetary value.\n Both components allow characters 0-9, periods, and commas. In order to avoid\n the loss of precision, the number length is limited by 15 digits.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-numberinput--demo-number-input)\n\n @see [Design Guidelines](https://design.procore.com/number-and-currency-input)\n\n */\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n (\n {\n decimalScale = true,\n defaultValue,\n disabled = false,\n error = false,\n fillDecimalScale = 'none',\n onChange: _onChange,\n onKeyDown: _onKeyDown = noop,\n onBlur: _onBlur = noop,\n prefix = emptyString,\n readOnly,\n step = 0,\n style,\n suffix = emptyString,\n value,\n qa,\n ...props\n },\n ref\n ) => {\n const I18n = useI18nContext()\n const contextLocale = I18n.locale || defaultLocale\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n const {\n decimalScale: verifiedDecimalScale,\n fillDecimalScaleOnBlur,\n fixedDecimalScale,\n formatValue,\n getValueLengthInfo,\n locale,\n } = useNumberFormat({\n decimalScale,\n fillDecimalScale,\n locale: contextLocale,\n })\n\n const isControlled = value !== undefined\n const isControlledWithoutOnChangeHandlerAndReadOnlyAttribute =\n isControlled && !_onChange && !readOnly\n const hasIncrementer = step > 0 && !readOnly\n\n const { group, decimal } = React.useMemo(\n () => getSeparators(locale),\n [locale]\n )\n const decimalSeparatorKey = React.useMemo(() => {\n return decimal === periodKey ? periodKey : commaKey\n }, [decimal])\n\n const inputPadding = React.useMemo((): {\n left: number\n right: number | null\n } => {\n const fontContext = `${addonRootFontSize} \"${addonRootFontFamily}\"`\n\n if (prefix || suffix) {\n const element = document.createElement('canvas')\n const context = element?.getContext('2d')\n\n if (context) {\n context.font = fontContext\n\n const extraBasePadding = inputDefaultXPadding + addonRootPadding\n\n const suffixPadding =\n extraBasePadding + Math.ceil(context.measureText(suffix).width)\n\n const getRightPadding = () => {\n if (hasIncrementer && suffix) {\n return suffixPadding + spacing.xl\n }\n if (suffix) {\n return suffixPadding\n }\n return null\n }\n\n return {\n left: prefix\n ? extraBasePadding + Math.ceil(context.measureText(prefix).width)\n : inputDefaultXPadding,\n right: getRightPadding(),\n }\n }\n }\n\n return {\n left: inputDefaultXPadding,\n right: null,\n }\n }, [prefix, suffix, hasIncrementer])\n\n const getValueChange = React.useCallback(\n (value: string) => {\n const { parsedNumber } = unformat(locale, value)\n return {\n value,\n parsedNumber: isNaN(parsedNumber) ? null : parsedNumber,\n }\n },\n [locale]\n )\n\n const externalOnChange = React.useCallback(\n (value: string) => _onChange && _onChange(getValueChange(value)),\n [_onChange, getValueChange]\n )\n\n const [inputValue, setInputValue] = React.useState(\n formatValue(defaultValue)\n )\n const [prevValue, setPrevValue] = React.useState(\n isControlled ? formatValue(value) : inputValue\n )\n const [prevCursorPosition, setPrevCursorPosition] =\n React.useState<CursorPosition>({\n selectionStart: 0,\n selectionEnd: 0,\n selection: emptyString,\n })\n const [pressedKey, setPressedKey] = React.useState()\n const prevLocale = usePrevious(locale)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n React.useLayoutEffect(() => {\n const formattedValue = formatValue(value)\n if (isControlled && inputValue !== formattedValue) {\n setInputValue(formattedValue)\n }\n\n if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) {\n console.error(\n `Warning: Failed prop type: You provided a \\`value\\` prop to a form field without an \\`onChange\\` handler.\n This will render a read-only field. If the field should be mutable use \\`defaultValue\\`.\n Otherwise, set either \\`onChange\\` or \\`readOnly\\`.`\n )\n }\n }, [value])\n\n React.useEffect(() => {\n if (prevLocale && !identicalLocales(prevLocale, locale)) {\n setInputValue((prev) => {\n const newValue = formatValue(unformat(prevLocale, prev).parsedNumber)\n externalOnChange(newValue)\n return newValue\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [prevLocale, formatValue])\n\n React.useLayoutEffect(() => {\n const displayValue = inputRef.current?.value || ''\n if (!_onChange || !displayValue) {\n return\n }\n const formattedValue = formatValue(value)\n\n if (displayValue !== formattedValue) {\n const lastChar = displayValue[displayValue.length - 1]\n const lastCharIsPending = [periodKey, commaKey].includes(lastChar)\n\n const decimals = displayValue.split(decimal)[1] || ''\n const lastDecimalIsZero =\n decimals && decimals[decimals.length - 1] === '0'\n\n const onlyMinusDisplayed = displayValue === minus\n\n // a client state and display mismatch is only valid when\n if (lastCharIsPending || lastDecimalIsZero || onlyMinusDisplayed) {\n return\n }\n\n // otherwise sync display with client state\n setInputValue(formattedValue)\n }\n })\n\n const getNewValueAndCursorPosition = (\n value: string,\n pressedKey: PressedKey\n ) => {\n const preparedValue = prepareValueToFormatting(\n decimal,\n decimalSeparatorKey,\n group,\n pressedKey,\n prevCursorPosition,\n prevValue,\n verifiedDecimalScale,\n value\n )\n const newValue = formatValue(preparedValue)\n\n return {\n newValue,\n newCursorPosition: getNewCursorPosition(\n decimal,\n decimalSeparatorKey,\n group,\n newValue,\n pressedKey,\n prevCursorPosition,\n prevValue,\n value,\n verifiedDecimalScale,\n locale,\n fillDecimalScale\n ),\n }\n }\n\n const adjustCursor = (newPosition: number) => {\n inputRef.current?.setSelectionRange(newPosition, newPosition)\n // Mobile Chrome adjustment\n setTimeout(\n () => inputRef.current?.setSelectionRange(newPosition, newPosition),\n 0\n )\n }\n\n const makeStep = (down = false) => {\n const getSignificantPrecision = (fraction: string) => {\n const reversedFraction = fraction.split(emptyString).reverse()\n const indexOfLastSignificantFractionDigit = findIndex(\n (i) => i !== '0',\n reversedFraction\n )\n\n return indexOfLastSignificantFractionDigit > -1\n ? reversedFraction.slice(indexOfLastSignificantFractionDigit).length\n : 0\n }\n\n const { parsedNumber, fraction } = unformat(locale, inputValue)\n const { fraction: stepFraction } = unformat(locale, step)\n\n const prevValuePrecision = fraction.length || 0\n const prevValueSignificantPrecision = getSignificantPrecision(fraction)\n const rawStepPrecision = stepFraction.length || 0\n const rawStepPrecisionExceedsDecimalScale =\n rawStepPrecision > verifiedDecimalScale\n const stepPrecision = rawStepPrecisionExceedsDecimalScale\n ? verifiedDecimalScale\n : rawStepPrecision\n\n if (rawStepPrecisionExceedsDecimalScale) {\n console.warn(\n `WARNING: Step's value was rounded since its scale (${rawStepPrecision}) exceeds the decimal scale (${verifiedDecimalScale}).`\n )\n }\n\n const diff = toFixed(step, stepPrecision) * (down ? -1 : 1)\n const precision = Math.max(\n stepPrecision,\n fixedDecimalScale ? verifiedDecimalScale : prevValuePrecision\n )\n const significantPrecision = Math.max(\n prevValueSignificantPrecision,\n stepPrecision\n )\n const calculated = inputValue\n ? ((parsedNumber || 0) + diff).toFixed(significantPrecision)\n : diff\n\n const { isSafeLength, isSafeIntegerLength } = getValueLengthInfo(\n calculated,\n true\n )\n\n const rejectStepByLengthLimit = !isSafeLength || !isSafeIntegerLength\n\n if (rejectStepByLengthLimit) {\n console.warn(\n `WARNING: Incrementer's step was not fulfilled since result oversteps input ${maxDigitLength}-digit limit and can't be presented without a loss of precision.`\n )\n return\n }\n\n const formatted = format(locale, precision, 'always', calculated, true)\n\n setInputValue(formatted)\n externalOnChange(formatted)\n }\n\n const internalOnKeyDown = (e: any) => {\n const {\n ctrlKey,\n metaKey,\n key,\n target: { value, selectionStart, selectionEnd },\n } = e\n\n const selection = value.slice(selectionStart, selectionEnd)\n\n setPressedKey(key)\n setPrevCursorPosition({\n selectionStart,\n selectionEnd,\n selection,\n })\n setPrevValue(value)\n\n const preserveDecimalSeparator = () => {\n const decimalBackspaced =\n !selection &&\n [backspaceKey].includes(key) &&\n value[selectionEnd - 1] === decimal\n\n const decimalDeleted =\n !selection &&\n [deleteKey, numericKeypadKey].includes(key) &&\n value[selectionEnd] === decimal\n\n const nonReplacingKeys =\n [metaKeyIdentifier, controlKey, highlightAllKey, copyKey].includes(\n key\n ) &&\n (ctrlKey || metaKey)\n\n const decimalReplacedAsSelection =\n selection &&\n selection.includes(decimal) &&\n selection.length < value.length &&\n !nonReplacingKeys\n\n const preserveDecimal =\n decimalBackspaced || decimalDeleted || decimalReplacedAsSelection\n\n if (preserveDecimal) {\n const base = decimalReplacedAsSelection\n ? selectionStart\n : selectionEnd\n\n const shift = (decimalBackspaced && -1) || (decimalDeleted && 1) || 0\n\n const cursorPosition = base + shift\n\n e.preventDefault()\n adjustCursor(cursorPosition)\n }\n }\n\n const isDecimalSeparatorPreserved = () => {\n const { safeIntegerLength, integerLength, fractionLength } =\n getValueLengthInfo(value)\n\n const decimalSeparatorCanNotBeRemoved =\n safeIntegerLength - integerLength < fractionLength\n\n return (\n (fillDecimalScaleOnBlur && decimalSeparatorCanNotBeRemoved) ||\n fixedDecimalScale\n )\n }\n\n if (isDecimalSeparatorPreserved()) {\n preserveDecimalSeparator()\n }\n\n const handleIncrementer = () => {\n switch (key) {\n case 'ArrowUp':\n case 'Up':\n e.preventDefault()\n makeStep()\n break\n case 'ArrowDown':\n case 'Down':\n e.preventDefault()\n makeStep(true)\n break\n }\n }\n\n if (hasIncrementer) {\n handleIncrementer()\n }\n\n _onKeyDown(e)\n }\n\n const internalOnChange = (e: any) => {\n if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) return\n\n const {\n target: { value },\n nativeEvent: { inputType },\n } = e\n\n const { newValue, newCursorPosition } = getNewValueAndCursorPosition(\n value,\n identifyPressedKey(\n decimalSeparatorKey,\n inputType,\n pressedKey,\n prevValue,\n value\n )\n )\n // Prevent cursor flickering\n e.target.value = newValue\n\n setInputValue(newValue)\n adjustCursor(newCursorPosition)\n\n if (newValue !== prevValue) {\n externalOnChange(newValue)\n }\n }\n\n const internalOnBlur = (e: any) => {\n const { integer, fraction } = unformat(locale, inputValue)\n\n const shouldValueBeCleared =\n inputValue === minus ||\n inputValue === decimal ||\n inputValue === `${minus}${decimal}`\n const shouldIntegerPartBeFilled =\n fraction.length > 0 && (integer === emptyString || integer === minus)\n const isDecimalSeparatorRedundant =\n verifiedDecimalScale > 0 &&\n inputValue[inputValue.length - 1] === decimal &&\n !fillDecimalScaleOnBlur\n const isDecimalScaleNotFilled = verifiedDecimalScale - fraction.length > 0\n const shouldDecimalScaleBeFilled =\n fillDecimalScaleOnBlur && isDecimalScaleNotFilled\n\n if (\n shouldValueBeCleared ||\n shouldIntegerPartBeFilled ||\n isDecimalSeparatorRedundant ||\n shouldDecimalScaleBeFilled\n ) {\n const getNewValue = () => {\n if (shouldValueBeCleared) {\n return emptyString\n }\n if (shouldIntegerPartBeFilled) {\n const numberOfZerosToPad = verifiedDecimalScale - fraction.length\n return `${integer}0${decimal}${\n shouldDecimalScaleBeFilled\n ? fraction.concat(\n Array.from({ length: numberOfZerosToPad }, (_) => '0').join(\n emptyString\n )\n )\n : fraction\n }`\n }\n if (isDecimalSeparatorRedundant) {\n return inputValue.replace(\n new RegExp(`[${decimal}]`, 'g'),\n emptyString\n )\n }\n if (shouldDecimalScaleBeFilled) {\n return format(locale, verifiedDecimalScale, 'always', inputValue)\n }\n\n return inputValue\n }\n const newValue = getNewValue()\n setInputValue(newValue)\n externalOnChange(newValue)\n }\n\n _onBlur(e)\n }\n\n return (\n <StyledWrapper $hasIncrementer={hasIncrementer} data-qa={qa?.wrapper}>\n <StyledInput\n value={inputValue}\n disabled={disabled}\n error={error}\n onKeyDown={internalOnKeyDown}\n onChange={internalOnChange}\n onBlur={internalOnBlur}\n inputMode=\"numeric\"\n readOnly={readOnly}\n style={{\n ...style,\n ...{\n paddingLeft: `${inputPadding.left}px`,\n paddingRight: `${inputPadding.right}px`,\n },\n }}\n {...props}\n ref={mergeRefs(ref, inputRef)}\n />\n {prefix && <StyledPrefix disabled={disabled}>{prefix}</StyledPrefix>}\n {suffix && (\n <StyledSuffix $withIncrementer={hasIncrementer} disabled={disabled}>\n {suffix}\n </StyledSuffix>\n )}\n {hasIncrementer && (\n <StyledIncrementerWrapper>\n <StyledIncrementerButton\n aria-hidden=\"true\"\n type=\"button\"\n disabled={disabled}\n tabIndex={-1}\n data-qa={qa?.increment}\n onClick={() => makeStep()}\n >\n <PlusIcon />\n </StyledIncrementerButton>\n <StyledIncrementerButton\n aria-hidden=\"true\"\n type=\"button\"\n disabled={disabled}\n tabIndex={-1}\n data-qa={qa?.decrement}\n onClick={() => makeStep(true)}\n >\n <MinusIcon />\n </StyledIncrementerButton>\n </StyledIncrementerWrapper>\n )}\n </StyledWrapper>\n )\n }\n)\n\nNumberInput.displayName = 'NumberInput'\n\nexport const getCurrencyProps = (\n locale: string,\n _decimalScale: NumberInputProps['decimalScale'],\n symbol?: string,\n currencyIsoCode?: string,\n currencyDisplay?: CurrencyDisplay\n): CurrencyProps => {\n const currencyOptions: CurrencyOptions = {\n locale,\n currencyIsoCode: currencyIsoCode || 'USD',\n currencyDisplay: currencyDisplay || 'narrowSymbol',\n }\n const parts = formatCurrencyToParts(1, currencyOptions)\n\n const formatterDecimalScale =\n parts.find((part) => part.type === 'fraction')?.value.length || 0\n const decimalScale = _decimalScale || formatterDecimalScale\n\n const placement =\n parts.findIndex((object) => {\n return object.type === 'currency'\n }) <\n parts.findIndex((part) => {\n return part.type === 'integer'\n })\n ? 'prefix'\n : 'suffix'\n\n const currencyIsoSymbol = currencyIsoCode\n ? parts.find((part) => part.type === 'currency')?.value.toString()\n : undefined\n\n const currencyProps: CurrencyProps =\n placement === 'prefix'\n ? {\n decimalScale: decimalScale as NumberInputProps['decimalScale'],\n prefix: currencyIsoSymbol || symbol || '',\n }\n : {\n decimalScale: decimalScale as NumberInputProps['decimalScale'],\n suffix: currencyIsoSymbol || symbol || '',\n }\n\n return currencyProps\n}\n\nexport const CurrencyInput = React.forwardRef<\n HTMLInputElement,\n CurrencyInputProps\n>(\n (\n {\n currencyDisplay,\n currencyIsoCode,\n decimalScale: _decimalScale,\n fillDecimalScale = defaultCurrencyFillDecimalScale,\n prefix = defaultCurrencyInputPrefix,\n suffix,\n ...props\n },\n ref\n ) => {\n const I18n = useI18nContext()\n const contextLocale = props.locale || I18n.locale || defaultLocale\n\n const currencyProps: CurrencyProps = getCurrencyProps(\n contextLocale as string,\n _decimalScale,\n prefix || suffix,\n currencyIsoCode,\n currencyDisplay\n )\n\n return (\n <NumberInput\n fillDecimalScale={fillDecimalScale}\n {...props}\n {...currencyProps}\n ref={ref}\n />\n )\n }\n)\n\nCurrencyInput.displayName = 'CurrencyInput'\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,SAASA,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,SAAS,QAAQ,OAAO;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SACEC,+BAA+B,EAC/BC,0BAA0B,QACrB,yBAAyB;AAChC,SAASC,eAAe,EAAEC,WAAW,QAAQ,qBAAqB;AAClE,SACEC,mBAAmB,EACnBC,iBAAiB,EACjBC,gBAAgB,EAChBC,oBAAoB,EACpBC,uBAAuB,EACvBC,wBAAwB,EACxBC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,aAAa,QACR,sBAAsB;AAQ7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AI,CAACE,MAAM,IAAI9D,aAAa;EAElE,IAAM8P,aAA4B,GAAGhB,gBAAgB,CACnDjL,aAAa,EACbkL,aAAa,EACb/L,MAAM,IAAIM,MAAM,EAChB2L,eAAe,EACfC,eACF,CAAC;EAED,oBACExQ,KAAA,CAAAyC,aAAA,CAACO,WAAW,EAAAwM,QAAA;IACV5L,gBAAgB,EAAEA;EAAiB,GAC/BmB,KAAK,EACLqM,aAAa;IACjBjO,GAAG,EAAEA;EAAI,EACV,CAAC;AAEN,CACF,CAAC;AAEDkO,aAAa,CAAClB,WAAW,GAAG,eAAe"}
|
|
@@ -9,11 +9,11 @@ export declare const StyledPrefix: import("styled-components").StyledComponent<"
|
|
|
9
9
|
export declare const StyledSuffix: import("styled-components").StyledComponent<"span", any, {
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
} & {
|
|
12
|
-
withIncrementer: boolean;
|
|
12
|
+
$withIncrementer: boolean;
|
|
13
13
|
}, never>;
|
|
14
14
|
export declare const StyledIncrementerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
15
|
export declare const StyledIncrementerButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
16
16
|
export declare const StyledInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").InputAttributes & import("..").InputProps & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
17
17
|
export declare const StyledWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
18
|
-
hasIncrementer: boolean;
|
|
18
|
+
$hasIncrementer: boolean;
|
|
19
19
|
}, never>;
|
|
@@ -12,39 +12,39 @@ var inputBgColor = colors.white;
|
|
|
12
12
|
var inputBorder = "".concat(colors.gray70, " solid 1px");
|
|
13
13
|
var StyledRootAddon = /*#__PURE__*/styled.span.withConfig({
|
|
14
14
|
displayName: "StyledRootAddon",
|
|
15
|
-
componentId: "core-
|
|
15
|
+
componentId: "core-12_15_0__sc-1782nvg-0"
|
|
16
16
|
})(["display:inline-flex;align-items:center;height:100%;position:absolute;top:0;color:", ";", ";"], function (_ref) {
|
|
17
17
|
var disabled = _ref.disabled;
|
|
18
18
|
return disabled ? colors.gray70 : colors.gray45;
|
|
19
19
|
}, getTypographyIntent('body'));
|
|
20
20
|
export var StyledPrefix = /*#__PURE__*/styled(StyledRootAddon).withConfig({
|
|
21
21
|
displayName: "StyledPrefix",
|
|
22
|
-
componentId: "core-
|
|
22
|
+
componentId: "core-12_15_0__sc-1782nvg-1"
|
|
23
23
|
})(["left:", "px;"], spacing.md);
|
|
24
24
|
export var StyledSuffix = /*#__PURE__*/styled(StyledRootAddon).withConfig({
|
|
25
25
|
displayName: "StyledSuffix",
|
|
26
|
-
componentId: "core-
|
|
26
|
+
componentId: "core-12_15_0__sc-1782nvg-2"
|
|
27
27
|
})(["right:", "px;"], function (_ref2) {
|
|
28
|
-
var withIncrementer = _ref2
|
|
29
|
-
return withIncrementer ? spacing.md + incrementerWidth : spacing.md;
|
|
28
|
+
var $withIncrementer = _ref2.$withIncrementer;
|
|
29
|
+
return $withIncrementer ? spacing.md + incrementerWidth : spacing.md;
|
|
30
30
|
});
|
|
31
31
|
export var StyledIncrementerWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
32
32
|
displayName: "StyledIncrementerWrapper",
|
|
33
|
-
componentId: "core-
|
|
33
|
+
componentId: "core-12_15_0__sc-1782nvg-3"
|
|
34
34
|
})(["display:flex;flex-direction:column;position:absolute;top:1px;right:1px;height:100%;"]);
|
|
35
35
|
export var StyledIncrementerButton = /*#__PURE__*/styled.button.withConfig({
|
|
36
36
|
displayName: "StyledIncrementerButton",
|
|
37
|
-
componentId: "core-
|
|
37
|
+
componentId: "core-12_15_0__sc-1782nvg-4"
|
|
38
38
|
})(["display:inline-flex;justify-content:center;align-items:center;width:", "px;height:calc(50% - 1px);border:none;border-radius:0px;outline:none;background-color:", ";padding:0;cursor:pointer;&:first-child,&:last-child{border-left:", ";&:disabled{border-color:", ";background-color:", ";}}&:first-child{border-top-right-radius:2px;}&:last-child{border-top:", ";border-bottom-right-radius:2px;}svg{fill:", ";}&:hover{svg{fill:", ";}}&:disabled{cursor:default;svg{fill:", ";}}"], incrementerWidth, inputBgColor, inputBorder, colors.gray70, colors.gray94, inputBorder, colors.gray45, colors.gray10, colors.gray70);
|
|
39
39
|
export var StyledInput = /*#__PURE__*/styled(Input).withConfig({
|
|
40
40
|
displayName: "StyledInput",
|
|
41
|
-
componentId: "core-
|
|
41
|
+
componentId: "core-12_15_0__sc-1782nvg-5"
|
|
42
42
|
})([""]);
|
|
43
43
|
export var StyledWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
44
44
|
displayName: "StyledWrapper",
|
|
45
|
-
componentId: "core-
|
|
45
|
+
componentId: "core-12_15_0__sc-1782nvg-6"
|
|
46
46
|
})(["position:relative;", ""], function (_ref3) {
|
|
47
|
-
var hasIncrementer = _ref3
|
|
48
|
-
return hasIncrementer && css(["", "{padding-right:", "px;}"], StyledInput, spacing.md + incrementerWidth);
|
|
47
|
+
var $hasIncrementer = _ref3.$hasIncrementer;
|
|
48
|
+
return $hasIncrementer && css(["", "{padding-right:", "px;}"], StyledInput, spacing.md + incrementerWidth);
|
|
49
49
|
});
|
|
50
50
|
//# sourceMappingURL=NumberInput.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.styles.js","names":["styled","css","Input","getTypographyIntent","colors","spacing","addonRootFontSize","addonRootFontFamily","addonRootPadding","sm","inputDefaultXPadding","md","incrementerWidth","inputBgColor","white","inputBorder","concat","gray70","StyledRootAddon","span","withConfig","displayName","componentId","_ref","disabled","gray45","StyledPrefix","StyledSuffix","_ref2","withIncrementer","StyledIncrementerWrapper","div","StyledIncrementerButton","button","gray94","gray10","StyledInput","StyledWrapper","_ref3","hasIncrementer"],"sources":["../../src/NumberInput/NumberInput.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { Input } from '../Input/Input'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\nexport const addonRootFontSize = '14px'\nexport const addonRootFontFamily = 'inherit'\nexport const addonRootPadding = spacing.sm\nexport const inputDefaultXPadding = spacing.md\n\nconst incrementerWidth = 24\nconst inputBgColor = colors.white\nconst inputBorder = `${colors.gray70} solid 1px`\n\nconst StyledRootAddon = styled.span<{ disabled: boolean }>`\n display: inline-flex;\n align-items: center;\n height: 100%;\n position: absolute;\n top: 0;\n color: ${({ disabled }) => (disabled ? colors.gray70 : colors.gray45)};\n ${getTypographyIntent('body')};\n`\n\nexport const StyledPrefix = styled(StyledRootAddon)`\n left: ${spacing.md}px;\n`\n\nexport const StyledSuffix = styled(StyledRootAddon)<{\n withIncrementer: boolean\n}>`\n right: ${({ withIncrementer }) =>\n withIncrementer ? spacing.md + incrementerWidth : spacing.md}px;\n`\n\nexport const StyledIncrementerWrapper = styled.div`\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 1px;\n right: 1px;\n height: 100%;\n`\n\nexport const StyledIncrementerButton = styled.button`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: ${incrementerWidth}px;\n height: calc(50% - 1px);\n border: none;\n border-radius: 0px;\n outline: none;\n background-color: ${inputBgColor};\n padding: 0;\n cursor: pointer;\n\n &:first-child,\n &:last-child {\n border-left: ${inputBorder};\n\n &:disabled {\n border-color: ${colors.gray70};\n background-color: ${colors.gray94};\n }\n }\n\n &:first-child {\n border-top-right-radius: 2px;\n }\n\n &:last-child {\n border-top: ${inputBorder};\n border-bottom-right-radius: 2px;\n }\n\n svg {\n fill: ${colors.gray45};\n }\n\n &:hover {\n svg {\n fill: ${colors.gray10};\n }\n }\n\n &:disabled {\n cursor: default;\n\n svg {\n fill: ${colors.gray70};\n }\n }\n`\n\nexport const StyledInput = styled(Input)``\n\nexport const StyledWrapper = styled.div<{\n hasIncrementer: boolean\n}>`\n position: relative;\n ${({ hasIncrementer }) =>\n hasIncrementer &&\n css`\n ${StyledInput} {\n padding-right: ${spacing.md + incrementerWidth}px;\n }\n `}\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,OAAO,IAAMC,iBAAiB,GAAG,MAAM;AACvC,OAAO,IAAMC,mBAAmB,GAAG,SAAS;AAC5C,OAAO,IAAMC,gBAAgB,GAAGH,OAAO,CAACI,EAAE;AAC1C,OAAO,IAAMC,oBAAoB,GAAGL,OAAO,CAACM,EAAE;AAE9C,IAAMC,gBAAgB,GAAG,EAAE;AAC3B,IAAMC,YAAY,GAAGT,MAAM,CAACU,KAAK;AACjC,IAAMC,WAAW,MAAAC,MAAA,CAAMZ,MAAM,CAACa,MAAM,eAAY;AAEhD,IAAMC,eAAe,gBAAGlB,MAAM,CAACmB,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oGAMxB,UAAAC,IAAA;EAAA,IAAGC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAAA,OAAQA,QAAQ,GAAGpB,MAAM,CAACa,MAAM,GAAGb,MAAM,CAACqB,MAAM;AAAA,CAAC,EACnEtB,mBAAmB,CAAC,MAAM,CAAC,CAC9B;AAED,OAAO,IAAMuB,YAAY,gBAAG1B,MAAM,CAACkB,eAAe,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qBACzCjB,OAAO,CAACM,EAAE,CACnB;AAED,OAAO,IAAMgB,YAAY,gBAAG3B,MAAM,CAACkB,eAAe,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,sBAGxC,UAAAM,KAAA;EAAA,IAAGC,
|
|
1
|
+
{"version":3,"file":"NumberInput.styles.js","names":["styled","css","Input","getTypographyIntent","colors","spacing","addonRootFontSize","addonRootFontFamily","addonRootPadding","sm","inputDefaultXPadding","md","incrementerWidth","inputBgColor","white","inputBorder","concat","gray70","StyledRootAddon","span","withConfig","displayName","componentId","_ref","disabled","gray45","StyledPrefix","StyledSuffix","_ref2","$withIncrementer","StyledIncrementerWrapper","div","StyledIncrementerButton","button","gray94","gray10","StyledInput","StyledWrapper","_ref3","$hasIncrementer"],"sources":["../../src/NumberInput/NumberInput.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { Input } from '../Input/Input'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\nexport const addonRootFontSize = '14px'\nexport const addonRootFontFamily = 'inherit'\nexport const addonRootPadding = spacing.sm\nexport const inputDefaultXPadding = spacing.md\n\nconst incrementerWidth = 24\nconst inputBgColor = colors.white\nconst inputBorder = `${colors.gray70} solid 1px`\n\nconst StyledRootAddon = styled.span<{ disabled: boolean }>`\n display: inline-flex;\n align-items: center;\n height: 100%;\n position: absolute;\n top: 0;\n color: ${({ disabled }) => (disabled ? colors.gray70 : colors.gray45)};\n ${getTypographyIntent('body')};\n`\n\nexport const StyledPrefix = styled(StyledRootAddon)`\n left: ${spacing.md}px;\n`\n\nexport const StyledSuffix = styled(StyledRootAddon)<{\n $withIncrementer: boolean\n}>`\n right: ${({ $withIncrementer }) =>\n $withIncrementer ? spacing.md + incrementerWidth : spacing.md}px;\n`\n\nexport const StyledIncrementerWrapper = styled.div`\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 1px;\n right: 1px;\n height: 100%;\n`\n\nexport const StyledIncrementerButton = styled.button`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: ${incrementerWidth}px;\n height: calc(50% - 1px);\n border: none;\n border-radius: 0px;\n outline: none;\n background-color: ${inputBgColor};\n padding: 0;\n cursor: pointer;\n\n &:first-child,\n &:last-child {\n border-left: ${inputBorder};\n\n &:disabled {\n border-color: ${colors.gray70};\n background-color: ${colors.gray94};\n }\n }\n\n &:first-child {\n border-top-right-radius: 2px;\n }\n\n &:last-child {\n border-top: ${inputBorder};\n border-bottom-right-radius: 2px;\n }\n\n svg {\n fill: ${colors.gray45};\n }\n\n &:hover {\n svg {\n fill: ${colors.gray10};\n }\n }\n\n &:disabled {\n cursor: default;\n\n svg {\n fill: ${colors.gray70};\n }\n }\n`\n\nexport const StyledInput = styled(Input)``\n\nexport const StyledWrapper = styled.div<{\n $hasIncrementer: boolean\n}>`\n position: relative;\n ${({ $hasIncrementer }) =>\n $hasIncrementer &&\n css`\n ${StyledInput} {\n padding-right: ${spacing.md + incrementerWidth}px;\n }\n `}\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,OAAO,IAAMC,iBAAiB,GAAG,MAAM;AACvC,OAAO,IAAMC,mBAAmB,GAAG,SAAS;AAC5C,OAAO,IAAMC,gBAAgB,GAAGH,OAAO,CAACI,EAAE;AAC1C,OAAO,IAAMC,oBAAoB,GAAGL,OAAO,CAACM,EAAE;AAE9C,IAAMC,gBAAgB,GAAG,EAAE;AAC3B,IAAMC,YAAY,GAAGT,MAAM,CAACU,KAAK;AACjC,IAAMC,WAAW,MAAAC,MAAA,CAAMZ,MAAM,CAACa,MAAM,eAAY;AAEhD,IAAMC,eAAe,gBAAGlB,MAAM,CAACmB,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oGAMxB,UAAAC,IAAA;EAAA,IAAGC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAAA,OAAQA,QAAQ,GAAGpB,MAAM,CAACa,MAAM,GAAGb,MAAM,CAACqB,MAAM;AAAA,CAAC,EACnEtB,mBAAmB,CAAC,MAAM,CAAC,CAC9B;AAED,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6 +2,6 @@ import styled from 'styled-components';
|
|
|
2
2
|
export var arrowSize = 8;
|
|
3
3
|
export var StyledArrow = /*#__PURE__*/styled.div.withConfig({
|
|
4
4
|
displayName: "StyledArrow",
|
|
5
|
-
componentId: "core-
|
|
5
|
+
componentId: "core-12_15_0__sc-1epxw7u-0"
|
|
6
6
|
})(["position:absolute;background:inherit;width:", "px;height:", "px;transform:rotate(45deg);"], arrowSize, arrowSize);
|
|
7
7
|
//# sourceMappingURL=OverlayArrow.styles.js.map
|