@procore/core-react 12.25.0 → 12.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.d.ts +9 -10
- package/dist/Avatar/Avatar.js.map +1 -1
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.d.ts +2 -2
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.d.ts +15 -15
- package/dist/Banner/Banner.js.map +1 -1
- package/dist/Banner/Banner.styles.d.ts +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js.map +1 -1
- package/dist/Box/Box.d.ts +1 -2
- package/dist/Box/Box.js.map +1 -1
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +3 -4
- 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/Button/Button.types.d.ts +2 -3
- package/dist/Button/Button.types.js.map +1 -1
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.d.ts +1 -2
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/Checkbox.types.d.ts +1 -2
- package/dist/Checkbox/Checkbox.types.js.map +1 -1
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.d.ts +2 -3
- package/dist/ContactItem/ContactItem.js.map +1 -1
- package/dist/ContactItem/ContactItem.styles.d.ts +5 -5
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.d.ts +4 -4
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.js.map +1 -1
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DateInput/DateInput.types.d.ts +2 -2
- package/dist/DateInput/DateInput.types.js.map +1 -1
- package/dist/DetailPage/DetailPage.d.ts +1 -1
- package/dist/DetailPage/DetailPage.styles.d.ts +4 -4
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.d.ts +1 -1
- package/dist/Dropdown/Dropdown.styles.d.ts +2 -2
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.helpers.js +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.helpers.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/DropdownFlyout/DropdownFlyout.types.d.ts +4 -4
- package/dist/DropdownFlyout/DropdownFlyout.types.js.map +1 -1
- package/dist/Dropzone/Dropzone.d.ts +2 -3
- package/dist/Dropzone/Dropzone.js +1 -2
- package/dist/Dropzone/Dropzone.js.map +1 -1
- package/dist/Dropzone/Dropzone.styles.d.ts +6 -6
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.d.ts +6 -6
- package/dist/EmptyState/EmptyState.js.map +1 -1
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.d.ts +1 -2
- package/dist/FileList/FileList.js.map +1 -1
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerModal.d.ts +1 -2
- package/dist/FileSelect/FileExplorer/FileExplorerModal.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.d.ts +2 -2
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.d.ts +3 -4
- package/dist/FileSelect/FileSelect.js.map +1 -1
- package/dist/FileSelect/FileSelect.styles.d.ts +2 -2
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelect.types.d.ts +1 -2
- package/dist/FileSelect/FileSelect.types.js.map +1 -1
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.d.ts +1 -2
- package/dist/FileSelect/FileTokenList/FileTokenList.js.map +1 -1
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.d.ts +2 -2
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.d.ts +1 -2
- package/dist/FileSelect/GridSource/GridSource.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.styles.d.ts +6 -6
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.d.ts +1 -1
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.d.ts +2 -2
- package/dist/FileSelect/SourceItem/SourceItem.js.map +1 -1
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.js.map +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +7 -7
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/ThumbnailList/ThumbnailList.types.d.ts +2 -2
- package/dist/FileSelect/ThumbnailList/ThumbnailList.types.js.map +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.d.ts +1 -2
- package/dist/FileSelect/TreeSource/TreeSource.js.map +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.d.ts +1 -2
- package/dist/FileToken/FileToken.js +17 -18
- package/dist/FileToken/FileToken.js.map +1 -1
- package/dist/FileToken/FileToken.styles.js +9 -9
- package/dist/FileToken/FileToken.styles.js.map +1 -1
- package/dist/FileToken/FileToken.types.d.ts +22 -0
- package/dist/FileToken/FileToken.types.js.map +1 -1
- package/dist/FileToken/FileTokenInner.d.ts +3 -0
- package/dist/FileToken/FileTokenInner.js +25 -0
- package/dist/FileToken/FileTokenInner.js.map +1 -0
- package/dist/FilterToken/FilterToken.d.ts +3 -4
- package/dist/FilterToken/FilterToken.js.map +1 -1
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/Flex/Flex.d.ts +1 -2
- package/dist/Flex/Flex.js.map +1 -1
- package/dist/FlexList/FlexList.d.ts +1 -2
- package/dist/FlexList/FlexList.js.map +1 -1
- package/dist/FlexList/FlexList.styles.d.ts +2 -2
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.d.ts +2 -2
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.js.map +1 -1
- package/dist/GhostPlaceholder/GhostPlaceholder.js +9 -0
- package/dist/GhostPlaceholder/GhostPlaceholder.js.map +1 -1
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/Grid/Grid.types.d.ts +4 -4
- package/dist/Grid/Grid.types.js.map +1 -1
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.d.ts +1 -2
- package/dist/Input/Input.js.map +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Input/Input.types.d.ts +2 -2
- package/dist/Input/Input.types.js.map +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/Link/Link.types.d.ts +2 -2
- package/dist/Link/Link.types.js.map +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/Menu/Menu.d.ts +8 -9
- package/dist/Menu/Menu.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.d.ts +8 -9
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.d.ts +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/MenuImperative/MenuImperative.types.d.ts +2 -2
- package/dist/MenuImperative/MenuImperative.types.js.map +1 -1
- package/dist/Modal/Modal.d.ts +7 -6
- package/dist/Modal/Modal.js +47 -11
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.d.ts +4 -4
- package/dist/Modal/Modal.styles.js +15 -14
- package/dist/Modal/Modal.styles.js.map +1 -1
- package/dist/Modal/Modal.types.d.ts +6 -4
- package/dist/Modal/Modal.types.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.d.ts +2 -2
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/NextTile/NextTile.types.d.ts +3 -3
- package/dist/NextTile/NextTile.types.js.map +1 -1
- package/dist/Notation/Notation.d.ts +1 -2
- package/dist/Notation/Notation.js +1 -1
- package/dist/Notation/Notation.js.map +1 -1
- package/dist/NumberInput/NumberInput.js +5 -2
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.styles.d.ts +2 -2
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageLayout/PageLayout.d.ts +2 -2
- package/dist/PageLayout/PageLayout.js.map +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageLayout/PageLayout.types.d.ts +3 -3
- package/dist/PageLayout/PageLayout.types.js.map +1 -1
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.d.ts +4 -4
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.d.ts +6 -4
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.d.ts +6 -6
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.d.ts +6 -7
- package/dist/Panel/Panel.js +22 -8
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Panel/Panel.styles.d.ts +5 -5
- package/dist/Panel/Panel.styles.js +16 -15
- package/dist/Panel/Panel.styles.js.map +1 -1
- package/dist/Panel/Panel.types.d.ts +14 -5
- package/dist/Panel/Panel.types.js.map +1 -1
- package/dist/Pill/Pill.js +15 -7
- package/dist/Pill/Pill.js.map +1 -1
- package/dist/Pill/Pill.styles.d.ts +3 -0
- package/dist/Pill/Pill.styles.js +7 -3
- package/dist/Pill/Pill.styles.js.map +1 -1
- package/dist/Pill/Pill.types.d.ts +1 -1
- package/dist/Pill/Pill.types.js.map +1 -1
- package/dist/PillSelect/PillSelect.js.map +1 -1
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.d.ts +1 -2
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/Popover/Popover.styles.js +4 -4
- package/dist/Popover/Popover.styles.js.map +1 -1
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/ProgressBar/ProgressBar.types.d.ts +2 -2
- package/dist/ProgressBar/ProgressBar.types.js.map +1 -1
- 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/Section/Section.js +6 -5
- package/dist/Section/Section.js.map +1 -1
- package/dist/Section/Section.styles.d.ts +5 -5
- package/dist/Section/Section.styles.js +9 -8
- package/dist/Section/Section.styles.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/SegmentedController/SegmentedController.types.d.ts +2 -2
- package/dist/SegmentedController/SegmentedController.types.js.map +1 -1
- package/dist/Select/Select.styles.d.ts +2 -2
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.d.ts +1 -1
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Semantic/Semantic.types.d.ts +1 -2
- package/dist/Semantic/Semantic.types.js.map +1 -1
- package/dist/SettingsPage/SettingsPage.d.ts +1 -1
- package/dist/Slider/Slider.styles.d.ts +2 -2
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Slider/Slider.types.d.ts +2 -2
- package/dist/Slider/Slider.types.js.map +1 -1
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.d.ts +0 -1
- package/dist/SplitViewCard/SplitViewCard.js +29 -26
- package/dist/SplitViewCard/SplitViewCard.js.map +1 -1
- package/dist/SplitViewCard/SplitViewCard.styles.js +10 -9
- package/dist/SplitViewCard/SplitViewCard.styles.js.map +1 -1
- package/dist/SplitViewCard/SplitViewCard.types.d.ts +11 -0
- package/dist/SplitViewCard/SplitViewCard.types.js.map +1 -1
- package/dist/SplitViewCard/SplitViewCardInternal.context.d.ts +2 -2
- package/dist/SplitViewCard/SplitViewCardInternal.context.js +4 -1
- package/dist/SplitViewCard/SplitViewCardInternal.context.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.components.d.ts +4 -3
- package/dist/SuperSelect/SuperSelect.components.js +5 -1
- package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.d.ts +2 -2
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.d.ts +6 -6
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/SuperSelect/SuperSelect.types.d.ts +3 -2
- package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.d.ts +1 -1
- package/dist/SuperSelect/useSuperSelect.js +28 -1
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/Switch/Switch.d.ts +1 -2
- package/dist/Switch/Switch.js.map +1 -1
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Switch/Switch.types.d.ts +2 -2
- package/dist/Switch/Switch.types.js.map +1 -1
- package/dist/Table/Table.d.ts +34 -35
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/Table.styles.d.ts +6 -6
- package/dist/Table/Table.styles.js +28 -28
- package/dist/Table/Table.types.d.ts +1 -2
- package/dist/Table/Table.types.js.map +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/TableShelf/TableShelf.d.ts +12 -13
- package/dist/TableShelf/TableShelf.js.map +1 -1
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.d.ts +4 -5
- package/dist/Tabs/Tabs.js.map +1 -1
- package/dist/Tabs/Tabs.styles.d.ts +2 -2
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.js +9 -6
- package/dist/Tearsheet/Tearsheet.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.styles.d.ts +2 -2
- package/dist/Tearsheet/Tearsheet.styles.js +7 -6
- package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
- package/dist/TextArea/TextArea.d.ts +1 -2
- package/dist/TextArea/TextArea.js.map +1 -1
- package/dist/TextArea/TextArea.styles.js +4 -4
- package/dist/TextArea/TextArea.styles.js.map +1 -1
- package/dist/TextArea/TextArea.types.d.ts +2 -2
- package/dist/TextArea/TextArea.types.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.d.ts +1 -2
- package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/TextEditorOutput/index.d.ts +1 -0
- package/dist/TextEditorOutput/index.js.map +1 -1
- package/dist/TextInput/TextInput.d.ts +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.d.ts +6 -7
- package/dist/Thumbnail/Thumbnail.hooks.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.styles.d.ts +2 -2
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/Thumbnail/index.d.ts +1 -1
- package/dist/Thumbnail/index.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.d.ts +1 -2
- package/dist/ThumbnailGrid/ThumbnailGrid.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +9 -9
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.d.ts +15 -15
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.d.ts +1 -1
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Tile/Tile.types.d.ts +4 -4
- package/dist/Tile/Tile.types.js.map +1 -1
- package/dist/Title/Title.d.ts +5 -6
- package/dist/Title/Title.js.map +1 -1
- package/dist/Title/Title.styles.d.ts +3 -3
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Title/Title.types.d.ts +2 -2
- package/dist/Title/Title.types.js.map +1 -1
- package/dist/Toast/Toast.d.ts +4 -5
- package/dist/Toast/Toast.js.map +1 -1
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/ToggleButton/ToggleButton.types.d.ts +1 -2
- package/dist/ToggleButton/ToggleButton.types.js.map +1 -1
- package/dist/Token/Token.d.ts +5 -4
- package/dist/Token/Token.js +37 -10
- package/dist/Token/Token.js.map +1 -1
- package/dist/Token/Token.styles.d.ts +3 -7
- package/dist/Token/Token.styles.js +8 -8
- package/dist/Token/Token.styles.js.map +1 -1
- package/dist/Token/Token.types.d.ts +4 -0
- package/dist/Token/Token.types.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.d.ts +6 -7
- package/dist/ToolHeader/ToolHeader.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.styles.d.ts +6 -6
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Tree/Tree.types.d.ts +2 -3
- package/dist/Tree/Tree.types.js.map +1 -1
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.d.ts +1 -2
- package/dist/Typography/Typography.js.map +1 -1
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/ClickOutside.js +8 -4
- package/dist/_hooks/ClickOutside.js.map +1 -1
- package/dist/_locales/de-DE.json +1 -1
- package/dist/_locales/en-AU.json +1 -1
- package/dist/_locales/en-CA.json +1 -1
- package/dist/_locales/en-GB.json +1 -1
- package/dist/_locales/en.json +1 -1
- package/dist/_locales/es-ES.json +1 -1
- package/dist/_locales/es.json +1 -1
- package/dist/_locales/fr-CA.json +1 -1
- package/dist/_locales/fr-FR.json +1 -1
- package/dist/_locales/is-IS.json +1 -1
- package/dist/_locales/it-IT.json +1 -1
- package/dist/_locales/ja-JP.json +1 -1
- package/dist/_locales/pl-PL.json +1 -1
- package/dist/_locales/pseudo.json +1 -1
- package/dist/_locales/pt-BR.json +1 -1
- package/dist/_locales/th-TH.json +1 -1
- package/dist/_locales/zh-SG.json +1 -1
- package/dist/_locales/zh-TW.json +1 -1
- package/dist/_styles/mixins.js +1 -1
- package/dist/_styles/mixins.js.map +1 -1
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- 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 +13 -13
- 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 +8 -18
- 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 +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- 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 +739 -759
- 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 +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -31
- 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 +54 -54
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- 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 +32 -32
- package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -56
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +51 -29
- package/dist/_typedoc/Pill/Pill.types.json +4 -4
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- 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 +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +60 -60
- 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 +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +34 -12
- package/dist/_typedoc/Switch/Switch.types.json +1 -32
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- 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 +4 -4
- package/dist/_typedoc/Token/Token.types.json +30 -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 +86 -86
- 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/dist/_utils/slotify.d.ts +1 -2
- package/dist/_utils/slotify.js.map +1 -1
- package/dist/_utils/types.d.ts +16 -18
- package/dist/_utils/types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillSelect.js","names":["Check","React","Pill","Select","Tooltip","OverflowObserver","PillSelectCheckedContainer","PillSelectLabel","PillSelectLabelWrapper","PillSelectOptionWrapper","emptyArr","defaultGetId","option","id","defaultGetLabel","label","defaultGetGroup","groupId","defaultGetSuggested","suggested","defaultGetColor","color","PillSelectOption","forwardRef","_ref","ref","selected","props","_objectWithoutProperties","_excluded","createElement","Option","_extends","size","PillSelectOptGroup","OptGroup","PillSelect","_ref2","afterHide_","afterHide","afterShow_","afterShow","_ref2$getColor","getColor","_ref2$getGroup","getGroup","_ref2$getId","getId","_ref2$getLabel","getLabel","_ref2$getSuggested","getSuggested","_ref2$groupGetId","groupGetId","_ref2$groupGetLabel","groupGetLabel","optgroups","_ref2$options","options","value","_excluded2","_React$useMemo","useMemo","optionsByGroup","map","optgroup","filter","_ref3","length","_React$useState","useState","_React$useState2","_slicedToArray","isOpened","setIsOpened","useCallback","_ref4","isOverflowing","pill","showTooltip","disabled","trigger","overlay","_ref5","Fragment","key","displayName"],"sources":["../../src/PillSelect/PillSelect.tsx"],"sourcesContent":["import { Check } from '@procore/core-icons/dist'\nimport React from 'react'\nimport { Pill } from '../Pill/Pill'\nimport { Select } from '../Select/Select'\nimport { Tooltip } from '../Tooltip/Tooltip'\nimport { OverflowObserver } from '../_hooks/OverflowObserver'\nimport type { DivAttributes } from '../_utils/types'\nimport {\n PillSelectCheckedContainer,\n PillSelectLabel,\n PillSelectLabelWrapper,\n PillSelectOptionWrapper,\n} from './PillSelect.styles'\nimport type {\n PillOptGroup,\n PillOption,\n PillOptionProps,\n PillSelectProps,\n} from './PillSelect.types'\n\nconst emptyArr: Array<any> = []\n\nfunction defaultGetId(option: PillOption | PillOptGroup) {\n return option.id\n}\n\nfunction defaultGetLabel(option: PillOption | PillOptGroup) {\n return option.label\n}\n\nfunction defaultGetGroup(option: PillOption) {\n return option.groupId\n}\n\nfunction defaultGetSuggested(option: PillOption) {\n return option.suggested\n}\n\nexport function defaultGetColor(option: PillOption) {\n return option.color\n}\n\nconst PillSelectOption = React.forwardRef<HTMLDivElement, PillOptionProps>(\n function PillSelectOption({ color, label, selected, ...props }, ref) {\n return (\n <Select.Option selected={selected} {...props} ref={ref}>\n <PillSelectOptionWrapper>\n <Pill color={color}>{label}</Pill>\n <PillSelectCheckedContainer>\n {selected && <Check size=\"sm\" />}\n </PillSelectCheckedContainer>\n </PillSelectOptionWrapper>\n </Select.Option>\n )\n }\n)\n\nconst PillSelectOptGroup = React.forwardRef<HTMLDivElement, DivAttributes>(\n function PillSelectOptGroup(props, ref) {\n return <Select.OptGroup {...props} ref={ref} />\n }\n)\n\n/**\n\n Pill Selects are used when you need a user to select between one of several\n options that are shown as pills. Often this will be a status, such as marking\n an item “closed”, “draft”, etc.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-pillselect--demo)\n\n @see [Design Guidelines](https://design.procore.com/pill-select)\n\n */\nexport const PillSelect = React.forwardRef<\n HTMLDivElement,\n PillSelectProps<any, any>\n>(function PillSelect(\n {\n afterHide: afterHide_,\n afterShow: afterShow_,\n getColor = defaultGetColor,\n getGroup = defaultGetGroup,\n getId = defaultGetId,\n getLabel = defaultGetLabel,\n getSuggested = defaultGetSuggested,\n groupGetId = defaultGetId,\n groupGetLabel = defaultGetLabel,\n optgroups,\n options = emptyArr,\n value,\n ...props\n },\n ref\n) {\n const { color, id, label } = React.useMemo(() => {\n if (!value) {\n return {}\n }\n return {\n color: getColor(value),\n id: getId(value),\n label: getLabel(value),\n }\n }, [getColor, getId, getLabel, value])\n\n const optionsByGroup = React.useMemo(\n () =>\n optgroups\n ?.map((optgroup) => ({\n optgroup,\n options: options.filter(\n (option) => getGroup(option) === groupGetId(optgroup)\n ),\n }))\n .filter(({ options }) => options.length),\n [options, optgroups, groupGetId, getGroup]\n )\n\n const [isOpened, setIsOpened] = React.useState(false)\n\n const afterShow = React.useCallback(() => {\n setIsOpened(true)\n afterShow_?.()\n }, [afterShow_])\n\n const afterHide = React.useCallback(() => {\n setIsOpened(false)\n afterHide_?.()\n }, [afterHide_])\n\n return (\n <Select\n afterHide={afterHide}\n afterShow={afterShow}\n label={\n label ? (\n <OverflowObserver>\n {({ isOverflowing, ref }) => {\n const pill = (\n <PillSelectLabel color={color} ref={ref}>\n {label}\n </PillSelectLabel>\n )\n\n const showTooltip = isOverflowing && !isOpened\n\n return (\n <PillSelectLabelWrapper disabled={props.disabled}>\n {showTooltip ? (\n <Tooltip trigger=\"hover\" overlay={label}>\n {pill}\n </Tooltip>\n ) : (\n pill\n )}\n </PillSelectLabelWrapper>\n )\n }}\n </OverflowObserver>\n ) : null\n }\n {...props}\n ref={ref}\n >\n {optionsByGroup ? (\n optionsByGroup.map(({ optgroup, options }) => (\n <React.Fragment key={groupGetId(optgroup)}>\n <PillSelectOptGroup key={groupGetId(optgroup)}>\n {groupGetLabel(optgroup)}\n </PillSelectOptGroup>\n {options.map((option) => (\n <PillSelectOption\n key={getId(option)}\n color={getColor(option)}\n label={getLabel(option)}\n selected={getId(option) === id}\n suggested={getSuggested(option)}\n value={option}\n />\n ))}\n </React.Fragment>\n ))\n ) : (\n <>\n {options.map((option) => (\n <PillSelectOption\n key={getId(option)}\n color={getColor(option)}\n label={getLabel(option)}\n selected={getId(option) === id}\n suggested={getSuggested(option)}\n value={option}\n />\n ))}\n </>\n )}\n </Select>\n )\n})\n\nPillSelect.displayName = 'PillSelect'\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,KAAK,QAAQ,0BAA0B;AAChD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SACEC,0BAA0B,EAC1BC,eAAe,EACfC,sBAAsB,EACtBC,uBAAuB,QAClB,qBAAqB;AAQ5B,IAAMC,QAAoB,GAAG,EAAE;AAE/B,SAASC,YAAYA,CAACC,MAAiC,EAAE;EACvD,OAAOA,MAAM,CAACC,EAAE;AAClB;AAEA,SAASC,eAAeA,CAACF,MAAiC,EAAE;EAC1D,OAAOA,MAAM,CAACG,KAAK;AACrB;AAEA,SAASC,eAAeA,CAACJ,MAAkB,EAAE;EAC3C,OAAOA,MAAM,CAACK,OAAO;AACvB;AAEA,SAASC,mBAAmBA,CAACN,MAAkB,EAAE;EAC/C,OAAOA,MAAM,CAACO,SAAS;AACzB;AAEA,OAAO,SAASC,eAAeA,CAACR,MAAkB,EAAE;EAClD,OAAOA,MAAM,CAACS,KAAK;AACrB;AAEA,IAAMC,gBAAgB,gBAAGrB,KAAK,CAACsB,UAAU,CACvC,SAASD,gBAAgBA,CAAAE,IAAA,EAAuCC,GAAG,EAAE;EAAA,IAAzCJ,KAAK,GAAAG,IAAA,CAALH,KAAK;IAAEN,KAAK,GAAAS,IAAA,CAALT,KAAK;IAAEW,QAAQ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,KAAK,EAAEkC,QAAQ,CAACrC,MAAM,CAAE;QACxBc,QAAQ,EAAEqB,KAAK,CAACnC,MAAM,CAAC,KAAKC,EAAG;QAC/BM,SAAS,EAAEgC,YAAY,CAACvC,MAAM,CAAE;QAChC+C,KAAK,EAAE/C;MAAO,CACf,CAAC;IAAA,CACH,CACa,CAAC;EAAA,CAClB,CAAC,gBAEFX,KAAA,CAAA6B,aAAA,CAAA7B,KAAA,CAAAmF,QAAA,QACG1B,OAAO,CAACM,GAAG,CAAC,UAACpD,MAAM;IAAA,oBAClBX,KAAA,CAAA6B,aAAA,CAACR,gBAAgB;MACf+D,GAAG,EAAEtC,KAAK,CAACnC,MAAM,CAAE;MACnBS,KAAK,EAAEsB,QAAQ,CAAC/B,MAAM,CAAE;MACxBG,KAAK,EAAEkC,QAAQ,CAACrC,MAAM,CAAE;MACxBc,QAAQ,EAAEqB,KAAK,CAACnC,MAAM,CAAC,KAAKC,EAAG;MAC/BM,SAAS,EAAEgC,YAAY,CAACvC,MAAM,CAAE;MAChC+C,KAAK,EAAE/C;IAAO,CACf,CAAC;EAAA,CACH,CACD,CAEE,CAAC;AAEb,CAAC,CAAC;AAEFwB,UAAU,CAACkD,WAAW,GAAG,YAAY"}
|
|
1
|
+
{"version":3,"file":"PillSelect.js","names":["Check","React","Pill","Select","Tooltip","OverflowObserver","PillSelectCheckedContainer","PillSelectLabel","PillSelectLabelWrapper","PillSelectOptionWrapper","emptyArr","defaultGetId","option","id","defaultGetLabel","label","defaultGetGroup","groupId","defaultGetSuggested","suggested","defaultGetColor","color","PillSelectOption","forwardRef","_ref","ref","selected","props","_objectWithoutProperties","_excluded","createElement","Option","_extends","size","PillSelectOptGroup","OptGroup","PillSelect","_ref2","afterHide_","afterHide","afterShow_","afterShow","_ref2$getColor","getColor","_ref2$getGroup","getGroup","_ref2$getId","getId","_ref2$getLabel","getLabel","_ref2$getSuggested","getSuggested","_ref2$groupGetId","groupGetId","_ref2$groupGetLabel","groupGetLabel","optgroups","_ref2$options","options","value","_excluded2","_React$useMemo","useMemo","optionsByGroup","map","optgroup","filter","_ref3","length","_React$useState","useState","_React$useState2","_slicedToArray","isOpened","setIsOpened","useCallback","_ref4","isOverflowing","pill","showTooltip","disabled","trigger","overlay","_ref5","Fragment","key","displayName"],"sources":["../../src/PillSelect/PillSelect.tsx"],"sourcesContent":["import { Check } from '@procore/core-icons/dist'\nimport React from 'react'\nimport { Pill } from '../Pill/Pill'\nimport { Select } from '../Select/Select'\nimport { Tooltip } from '../Tooltip/Tooltip'\nimport { OverflowObserver } from '../_hooks/OverflowObserver'\nimport {\n PillSelectCheckedContainer,\n PillSelectLabel,\n PillSelectLabelWrapper,\n PillSelectOptionWrapper,\n} from './PillSelect.styles'\nimport type {\n PillOptGroup,\n PillOption,\n PillOptionProps,\n PillSelectProps,\n} from './PillSelect.types'\n\nconst emptyArr: Array<any> = []\n\nfunction defaultGetId(option: PillOption | PillOptGroup) {\n return option.id\n}\n\nfunction defaultGetLabel(option: PillOption | PillOptGroup) {\n return option.label\n}\n\nfunction defaultGetGroup(option: PillOption) {\n return option.groupId\n}\n\nfunction defaultGetSuggested(option: PillOption) {\n return option.suggested\n}\n\nexport function defaultGetColor(option: PillOption) {\n return option.color\n}\n\nconst PillSelectOption = React.forwardRef<HTMLDivElement, PillOptionProps>(\n function PillSelectOption({ color, label, selected, ...props }, ref) {\n return (\n <Select.Option selected={selected} {...props} ref={ref}>\n <PillSelectOptionWrapper>\n <Pill color={color}>{label}</Pill>\n <PillSelectCheckedContainer>\n {selected && <Check size=\"sm\" />}\n </PillSelectCheckedContainer>\n </PillSelectOptionWrapper>\n </Select.Option>\n )\n }\n)\n\nconst PillSelectOptGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(function PillSelectOptGroup(props, ref) {\n return <Select.OptGroup {...props} ref={ref} />\n})\n\n/**\n\n Pill Selects are used when you need a user to select between one of several\n options that are shown as pills. Often this will be a status, such as marking\n an item “closed”, “draft”, etc.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-pillselect--demo)\n\n @see [Design Guidelines](https://design.procore.com/pill-select)\n\n */\nexport const PillSelect = React.forwardRef<\n HTMLDivElement,\n PillSelectProps<any, any>\n>(function PillSelect(\n {\n afterHide: afterHide_,\n afterShow: afterShow_,\n getColor = defaultGetColor,\n getGroup = defaultGetGroup,\n getId = defaultGetId,\n getLabel = defaultGetLabel,\n getSuggested = defaultGetSuggested,\n groupGetId = defaultGetId,\n groupGetLabel = defaultGetLabel,\n optgroups,\n options = emptyArr,\n value,\n ...props\n },\n ref\n) {\n const { color, id, label } = React.useMemo(() => {\n if (!value) {\n return {}\n }\n return {\n color: getColor(value),\n id: getId(value),\n label: getLabel(value),\n }\n }, [getColor, getId, getLabel, value])\n\n const optionsByGroup = React.useMemo(\n () =>\n optgroups\n ?.map((optgroup) => ({\n optgroup,\n options: options.filter(\n (option) => getGroup(option) === groupGetId(optgroup)\n ),\n }))\n .filter(({ options }) => options.length),\n [options, optgroups, groupGetId, getGroup]\n )\n\n const [isOpened, setIsOpened] = React.useState(false)\n\n const afterShow = React.useCallback(() => {\n setIsOpened(true)\n afterShow_?.()\n }, [afterShow_])\n\n const afterHide = React.useCallback(() => {\n setIsOpened(false)\n afterHide_?.()\n }, [afterHide_])\n\n return (\n <Select\n afterHide={afterHide}\n afterShow={afterShow}\n label={\n label ? (\n <OverflowObserver>\n {({ isOverflowing, ref }) => {\n const pill = (\n <PillSelectLabel color={color} ref={ref}>\n {label}\n </PillSelectLabel>\n )\n\n const showTooltip = isOverflowing && !isOpened\n\n return (\n <PillSelectLabelWrapper disabled={props.disabled}>\n {showTooltip ? (\n <Tooltip trigger=\"hover\" overlay={label}>\n {pill}\n </Tooltip>\n ) : (\n pill\n )}\n </PillSelectLabelWrapper>\n )\n }}\n </OverflowObserver>\n ) : null\n }\n {...props}\n ref={ref}\n >\n {optionsByGroup ? (\n optionsByGroup.map(({ optgroup, options }) => (\n <React.Fragment key={groupGetId(optgroup)}>\n <PillSelectOptGroup key={groupGetId(optgroup)}>\n {groupGetLabel(optgroup)}\n </PillSelectOptGroup>\n {options.map((option) => (\n <PillSelectOption\n key={getId(option)}\n color={getColor(option)}\n label={getLabel(option)}\n selected={getId(option) === id}\n suggested={getSuggested(option)}\n value={option}\n />\n ))}\n </React.Fragment>\n ))\n ) : (\n <>\n {options.map((option) => (\n <PillSelectOption\n key={getId(option)}\n color={getColor(option)}\n label={getLabel(option)}\n selected={getId(option) === id}\n suggested={getSuggested(option)}\n value={option}\n />\n ))}\n </>\n )}\n </Select>\n )\n})\n\nPillSelect.displayName = 'PillSelect'\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,KAAK,QAAQ,0BAA0B;AAChD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SACEC,0BAA0B,EAC1BC,eAAe,EACfC,sBAAsB,EACtBC,uBAAuB,QAClB,qBAAqB;AAQ5B,IAAMC,QAAoB,GAAG,EAAE;AAE/B,SAASC,YAAYA,CAACC,MAAiC,EAAE;EACvD,OAAOA,MAAM,CAACC,EAAE;AAClB;AAEA,SAASC,eAAeA,CAACF,MAAiC,EAAE;EAC1D,OAAOA,MAAM,CAACG,KAAK;AACrB;AAEA,SAASC,eAAeA,CAACJ,MAAkB,EAAE;EAC3C,OAAOA,MAAM,CAACK,OAAO;AACvB;AAEA,SAASC,mBAAmBA,CAACN,MAAkB,EAAE;EAC/C,OAAOA,MAAM,CAACO,SAAS;AACzB;AAEA,OAAO,SAASC,eAAeA,CAACR,MAAkB,EAAE;EAClD,OAAOA,MAAM,CAACS,KAAK;AACrB;AAEA,IAAMC,gBAAgB,gBAAGrB,KAAK,CAACsB,UAAU,CACvC,SAASD,gBAAgBA,CAAAE,IAAA,EAA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A,CAACR,gBAAgB;QACf+D,GAAG,EAAEtC,KAAK,CAACnC,MAAM,CAAE;QACnBS,KAAK,EAAEsB,QAAQ,CAAC/B,MAAM,CAAE;QACxBG,KAAK,EAAEkC,QAAQ,CAACrC,MAAM,CAAE;QACxBc,QAAQ,EAAEqB,KAAK,CAACnC,MAAM,CAAC,KAAKC,EAAG;QAC/BM,SAAS,EAAEgC,YAAY,CAACvC,MAAM,CAAE;QAChC+C,KAAK,EAAE/C;MAAO,CACf,CAAC;IAAA,CACH,CACa,CAAC;EAAA,CAClB,CAAC,gBAEFX,KAAA,CAAA6B,aAAA,CAAA7B,KAAA,CAAAmF,QAAA,QACG1B,OAAO,CAACM,GAAG,CAAC,UAACpD,MAAM;IAAA,oBAClBX,KAAA,CAAA6B,aAAA,CAACR,gBAAgB;MACf+D,GAAG,EAAEtC,KAAK,CAACnC,MAAM,CAAE;MACnBS,KAAK,EAAEsB,QAAQ,CAAC/B,MAAM,CAAE;MACxBG,KAAK,EAAEkC,QAAQ,CAACrC,MAAM,CAAE;MACxBc,QAAQ,EAAEqB,KAAK,CAACnC,MAAM,CAAC,KAAKC,EAAG;MAC/BM,SAAS,EAAEgC,YAAY,CAACvC,MAAM,CAAE;MAChC+C,KAAK,EAAE/C;IAAO,CACf,CAAC;EAAA,CACH,CACD,CAEE,CAAC;AAEb,CAAC,CAAC;AAEFwB,UAAU,CAACkD,WAAW,GAAG,YAAY"}
|
|
@@ -6,19 +6,19 @@ import { spacing } from '../_styles/spacing';
|
|
|
6
6
|
var checkedIconPlaceholderWidth = 32;
|
|
7
7
|
export var PillSelectOptionWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "PillSelectOptionWrapper",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_25_2__sc-1ai2ze0-0"
|
|
10
10
|
})(["display:flex;align-items:center;justify-content:space-between;"]);
|
|
11
11
|
export var PillSelectCheckedContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "PillSelectCheckedContainer",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_25_2__sc-1ai2ze0-1"
|
|
14
14
|
})(["align-items:center;color:", ";display:inline-flex;padding-left:", "px;width:", "px;"], colors.blue50, spacing.sm, checkedIconPlaceholderWidth);
|
|
15
15
|
export var PillSelectLabel = /*#__PURE__*/styled(Pill).withConfig({
|
|
16
16
|
displayName: "PillSelectLabel",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_25_2__sc-1ai2ze0-2"
|
|
18
18
|
})(["", ""], getEllipsis);
|
|
19
19
|
export var PillSelectLabelWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
20
20
|
displayName: "PillSelectLabelWrapper",
|
|
21
|
-
componentId: "core-
|
|
21
|
+
componentId: "core-12_25_2__sc-1ai2ze0-3"
|
|
22
22
|
})(["display:flex;max-width:100%;pointer-events:auto;", ""], function (_ref) {
|
|
23
23
|
var disabled = _ref.disabled;
|
|
24
24
|
return disabled && css(["pointer-events:none;"]);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { DivAttributes } from '../_utils/types';
|
|
3
2
|
import type { PopoverContentProps, PopoverProps, PopoverRole } from './Popover.types';
|
|
4
3
|
declare function PopoverInner<Role extends PopoverRole>({ children, initialIsVisible, restoreFocusOnHide, placement, overlay, overlayRef, role, ...props }: PopoverProps<Role>, ref: React.ForwardedRef<HTMLElement>): React.JSX.Element;
|
|
5
4
|
/**
|
|
@@ -23,6 +22,6 @@ declare function PopoverInner<Role extends PopoverRole>({ children, initialIsVis
|
|
|
23
22
|
|
|
24
23
|
*/
|
|
25
24
|
export declare const Popover: (<Role extends PopoverRole>(props: PopoverProps<Role>) => ReturnType<typeof PopoverInner>) & {
|
|
26
|
-
Content: React.ForwardRefExoticComponent<
|
|
25
|
+
Content: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
26
|
};
|
|
28
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","names":["React","OverlayTrigger","addSubcomponents","isReactElement","StyledPopover","StyledPopoverContent","Content","forwardRef","_ref","ref","children","_ref$block","block","_ref$fluid","fluid","_ref$placement","placement","props","_objectWithoutProperties","_excluded","createElement","_extends","$block","$fluid","$placement","PopoverInner","_ref2","_ref2$initialIsVisibl","initialIsVisible","_ref2$restoreFocusOnH","restoreFocusOnHide","_ref2$placement","overlay","overlayRef","role","_excluded2","overlayNode","cloneElement","Fragment","_objectSpread","shrinkOverlay","arrow","Popover_","displayName","Popover"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import React from 'react'\nimport { OverlayTrigger } from '../OverlayTrigger/OverlayTrigger'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport { isReactElement } from '../_utils/isReactElement'\nimport
|
|
1
|
+
{"version":3,"file":"Popover.js","names":["React","OverlayTrigger","addSubcomponents","isReactElement","StyledPopover","StyledPopoverContent","Content","forwardRef","_ref","ref","children","_ref$block","block","_ref$fluid","fluid","_ref$placement","placement","props","_objectWithoutProperties","_excluded","createElement","_extends","$block","$fluid","$placement","PopoverInner","_ref2","_ref2$initialIsVisibl","initialIsVisible","_ref2$restoreFocusOnH","restoreFocusOnHide","_ref2$placement","overlay","overlayRef","role","_excluded2","overlayNode","cloneElement","Fragment","_objectSpread","shrinkOverlay","arrow","Popover_","displayName","Popover"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import React from 'react'\nimport { OverlayTrigger } from '../OverlayTrigger/OverlayTrigger'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport { isReactElement } from '../_utils/isReactElement'\nimport { StyledPopover, StyledPopoverContent } from './Popover.styles'\nimport type {\n PopoverContentProps,\n PopoverProps,\n PopoverRole,\n} from './Popover.types'\n\nconst Content = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & PopoverContentProps\n>(function Content(\n { children, block = false, fluid = false, placement = 'top', ...props },\n ref\n) {\n return (\n <StyledPopover ref={ref}>\n <StyledPopoverContent\n {...props}\n $block={block}\n $fluid={fluid}\n $placement={placement}\n >\n {children}\n </StyledPopoverContent>\n </StyledPopover>\n )\n})\n\nfunction PopoverInner<Role extends PopoverRole>(\n {\n children,\n initialIsVisible = false,\n restoreFocusOnHide = false,\n placement = 'top',\n overlay,\n overlayRef,\n role,\n ...props\n }: PopoverProps<Role>,\n ref: React.ForwardedRef<HTMLElement>\n) {\n const overlayNode = isReactElement(overlay) ? (\n React.cloneElement(overlay, { placement })\n ) : (\n <React.Fragment />\n )\n\n return (\n <OverlayTrigger\n {...{\n ...props,\n initialIsVisible,\n overlay: overlayNode,\n placement,\n role,\n ref,\n restoreFocusOnHide,\n shrinkOverlay: true,\n arrow: true,\n overlayRef,\n }}\n >\n {children}\n </OverlayTrigger>\n )\n}\n\nconst Popover_ = React.forwardRef(PopoverInner) as <Role extends PopoverRole>(\n props: PopoverProps<Role>\n) => ReturnType<typeof PopoverInner>\n\n// @ts-expect-error\nPopover_.displayName = 'Popover'\n\nContent.displayName = 'Popover.Content'\n\n/**\n\n We use popovers to display more of an item’s information or details on hover.\n This may be used to show additional fields in an item’s form that aren’t shown\n by default in the UI. Oftentimes, there will be a visual queue to indicate that\n more information is available.\n\n Do not use popovers to display large amounts of information, perform data\n entry, or use as a replacement for an overflow, menu, or modal.\n\n If you want to show descriptive / educational information about an item,\n use a tooltip.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-popover--demo)\n\n @see [Design Guidelines](https://design.procore.com/popover)\n\n*/\nexport const Popover = addSubcomponents({ Content }, Popover_)\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,cAAc,QAAQ,0BAA0B;AACzD,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AP,KAAA,CAAVO,UAAU;IACVC,IAAI,GAAAR,KAAA,CAAJQ,IAAI;IACDjB,KAAK,GAAAC,wBAAA,CAAAQ,KAAA,EAAAS,UAAA;EAIV,IAAMC,WAAW,GAAGjC,cAAc,CAAC6B,OAAO,CAAC,gBACzChC,KAAK,CAACqC,YAAY,CAACL,OAAO,EAAE;IAAEhB,SAAS,EAATA;EAAU,CAAC,CAAC,gBAE1ChB,KAAA,CAAAoB,aAAA,CAACpB,KAAK,CAACsC,QAAQ,MAAE,CAClB;EAED,oBACEtC,KAAA,CAAAoB,aAAA,CAACnB,cAAc,EAAAsC,aAAA,CAAAA,aAAA,KAERtB,KAAK;IACRW,gBAAgB,EAAhBA,gBAAgB;IAChBI,OAAO,EAAEI,WAAW;IACpBpB,SAAS,EAATA,SAAS;IACTkB,IAAI,EAAJA,IAAI;IACJzB,GAAG,EAAHA,GAAG;IACHqB,kBAAkB,EAAlBA,kBAAkB;IAClBU,aAAa,EAAE,IAAI;IACnBC,KAAK,EAAE,IAAI;IACXR,UAAU,EAAVA;EAAU,IAGXvB,QACa,CAAC;AAErB;AAEA,IAAMgC,QAAQ,gBAAG1C,KAAK,CAACO,UAAU,CAACkB,YAAY,CAEV;;AAEpC;AACAiB,QAAQ,CAACC,WAAW,GAAG,SAAS;AAEhCrC,OAAO,CAACqC,WAAW,GAAG,iBAAiB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,OAAO,GAAG1C,gBAAgB,CAAC;EAAEI,OAAO,EAAPA;AAAQ,CAAC,EAAEoC,QAAQ,CAAC"}
|
|
@@ -5,8 +5,8 @@ import { getShadow } from '../_styles/shadows';
|
|
|
5
5
|
export var popoverArrowSize = 6;
|
|
6
6
|
export var StyledPopoverContent = /*#__PURE__*/styled.span.withConfig({
|
|
7
7
|
displayName: "StyledPopoverContent",
|
|
8
|
-
componentId: "core-
|
|
9
|
-
})(["background-color:", ";border-radius:
|
|
8
|
+
componentId: "core-12_25_2__sc-1cd0ihn-0"
|
|
9
|
+
})(["background-color:", ";border-radius:inherit;color:", ";display:inline-block;max-width:250px;position:relative;", ""], colors.white, colors.gray15, function (_ref) {
|
|
10
10
|
var $block = _ref.$block,
|
|
11
11
|
$fluid = _ref.$fluid;
|
|
12
12
|
if ($block || $fluid) {
|
|
@@ -15,6 +15,6 @@ export var StyledPopoverContent = /*#__PURE__*/styled.span.withConfig({
|
|
|
15
15
|
});
|
|
16
16
|
export var StyledPopover = /*#__PURE__*/styled.div.withConfig({
|
|
17
17
|
displayName: "StyledPopover",
|
|
18
|
-
componentId: "core-
|
|
19
|
-
})(["display:inline-block;", " & + [data-overlay-arrow]{background:", ";}"], getShadow(3), colors.white);
|
|
18
|
+
componentId: "core-12_25_2__sc-1cd0ihn-1"
|
|
19
|
+
})(["display:inline-block;border-radius:", "px;", " & + [data-overlay-arrow]{background:", ";}"], borderRadius.md, getShadow(3), colors.white);
|
|
20
20
|
//# sourceMappingURL=Popover.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.styles.js","names":["styled","css","borderRadius","colors","getShadow","popoverArrowSize","StyledPopoverContent","span","withConfig","displayName","componentId","white","
|
|
1
|
+
{"version":3,"file":"Popover.styles.js","names":["styled","css","borderRadius","colors","getShadow","popoverArrowSize","StyledPopoverContent","span","withConfig","displayName","componentId","white","gray15","_ref","$block","$fluid","StyledPopover","div","md"],"sources":["../../src/Popover/Popover.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getShadow } from '../_styles/shadows'\nimport type { Placement } from '../_utils/placement'\n\nexport const popoverArrowSize = 6\n\ninterface StyledPopoverProps {\n $block: boolean\n $fluid: boolean\n $placement: Placement\n}\n\nexport const StyledPopoverContent = styled.span<StyledPopoverProps>`\n background-color: ${colors.white};\n border-radius: inherit;\n\n color: ${colors.gray15};\n display: inline-block;\n max-width: 250px;\n position: relative;\n\n ${({ $block, $fluid }) => {\n if ($block || $fluid) {\n return css`\n max-width: none;\n `\n }\n }}\n`\n\nexport const StyledPopover = styled.div`\n display: inline-block;\n border-radius: ${borderRadius.md}px;\n ${getShadow(3)}\n\n & + [data-overlay-arrow] {\n background: ${colors.white};\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,SAAS,QAAQ,oBAAoB;AAG9C,OAAO,IAAMC,gBAAgB,GAAG,CAAC;AAQjC,OAAO,IAAMC,oBAAoB,gBAAGN,MAAM,CAACO,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2HACzBP,MAAM,CAACQ,KAAK,EAGvBR,MAAM,CAACS,MAAM,EAKpB,UAAAC,IAAA,EAAwB;EAAA,IAArBC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;EACjB,IAAID,MAAM,IAAIC,MAAM,EAAE;IACpB,OAAOd,GAAG;EAGZ;AACF,CAAC,CACF;AAED,OAAO,IAAMe,aAAa,gBAAGhB,MAAM,CAACiB,GAAG,CAAAT,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kGAEpBR,YAAY,CAACgB,EAAE,EAC9Bd,SAAS,CAAC,CAAC,CAAC,EAGED,MAAM,CAACQ,KAAK,CAE7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
export var StyledPortal = /*#__PURE__*/styled.div.withConfig({
|
|
3
3
|
displayName: "StyledPortal",
|
|
4
|
-
componentId: "core-
|
|
4
|
+
componentId: "core-12_25_2__sc-15o1h2-0"
|
|
5
5
|
})(["left:0;pointer-events:none;position:fixed;top:0;> *{pointer-events:all;}"]);
|
|
6
6
|
//# sourceMappingURL=Portal.styles.js.map
|
|
@@ -7,11 +7,11 @@ var animationDelay = '300ms';
|
|
|
7
7
|
var fadeIn = /*#__PURE__*/keyframes(["from{opacity:1;}to{opacity:0;}"]);
|
|
8
8
|
export var StyledProgressBarLoader = /*#__PURE__*/styled(Loader).withConfig({
|
|
9
9
|
displayName: "StyledProgressBarLoader",
|
|
10
|
-
componentId: "core-
|
|
10
|
+
componentId: "core-12_25_2__sc-vdy2wl-0"
|
|
11
11
|
})([""]);
|
|
12
12
|
export var StyledProgressBar = /*#__PURE__*/styled.div.withConfig({
|
|
13
13
|
displayName: "StyledProgressBar",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_25_2__sc-vdy2wl-1"
|
|
15
15
|
})(["overflow:hidden;position:relative;display:block;height:", "px;background-color:", ";border-radius:", "px;margin:", "px 0;transition:background-color 0s linear;", " ", ""], loaderGridUnit, function (_ref) {
|
|
16
16
|
var $complete = _ref.$complete;
|
|
17
17
|
return $complete ? colors.blue50 : colors.gray94;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { LoaderProps } from '../Loader/Loader.types';
|
|
2
|
-
import type { DivAttributes } from '../_utils/types';
|
|
3
3
|
declare type ValueTextRender = (props: {
|
|
4
4
|
value: number;
|
|
5
5
|
}) => string;
|
|
6
|
-
export interface ProgressBarProps extends LoaderProps, Omit<
|
|
6
|
+
export interface ProgressBarProps extends LoaderProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'aria-valuetext' | 'role'> {
|
|
7
7
|
/**
|
|
8
8
|
* @a11y Assistive technologies often present the value of `aria-valuenow` as a percentage.
|
|
9
9
|
* If this would not be accurate, use this property to make the progress bar value understandable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.types.js","names":[],"sources":["../../src/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { LoaderProps } from '../Loader/Loader.types'\
|
|
1
|
+
{"version":3,"file":"ProgressBar.types.js","names":[],"sources":["../../src/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { LoaderProps } from '../Loader/Loader.types'\n\ntype ValueTextRender = (props: { value: number }) => string\n\n// TODO: add required 'aria-label' when closer to the major version\nexport interface ProgressBarProps\n extends LoaderProps,\n Omit<React.HTMLAttributes<HTMLDivElement>, 'aria-valuetext' | 'role'> {\n /**\n * @a11y Assistive technologies often present the value of `aria-valuenow` as a percentage.\n * If this would not be accurate, use this property to make the progress bar value understandable.\n *\n * @since 11.8.0\n */\n ['aria-valuetext']?: string | ValueTextRender\n}\n"],"mappings":""}
|
|
@@ -9,7 +9,7 @@ export var dataQa = {
|
|
|
9
9
|
var radioButtonSize = 20;
|
|
10
10
|
export var StyledRadioButton = /*#__PURE__*/styled.label.withConfig({
|
|
11
11
|
displayName: "StyledRadioButton",
|
|
12
|
-
componentId: "core-
|
|
12
|
+
componentId: "core-12_25_2__sc-nd95zs-0"
|
|
13
13
|
})(["color:", ";display:flex;position:relative;vertical-align:middle;& + &{margin-top:", "px;}", " ", ""], colors.gray15, spacing.md, function (_ref) {
|
|
14
14
|
var $error = _ref.$error;
|
|
15
15
|
return $error && css(["", ":before,", ":checked:not(:disabled) + ", ":before{border-color:", ";}", ":checked:disabled + ", ":before{border-color:", ";}"], StyledRadioButtonLabel, StyledRadioButtonInput, StyledRadioButtonLabel, colors.red50, StyledRadioButtonInput, StyledRadioButtonLabel, colors.gray85);
|
|
@@ -19,10 +19,10 @@ export var StyledRadioButton = /*#__PURE__*/styled.label.withConfig({
|
|
|
19
19
|
});
|
|
20
20
|
export var StyledRadioButtonLabel = /*#__PURE__*/styled.span.withConfig({
|
|
21
21
|
displayName: "StyledRadioButtonLabel",
|
|
22
|
-
componentId: "core-
|
|
22
|
+
componentId: "core-12_25_2__sc-nd95zs-1"
|
|
23
23
|
})(["", ";cursor:default;display:flex;&:before{background:", ";border-radius:100%;border:2px solid ", ";content:'';display:inline-block;flex:0;height:", "px;min-width:", "px;width:", "px;}"], getTypographyIntent('body'), colors.white, colors.gray70, radioButtonSize, radioButtonSize, radioButtonSize);
|
|
24
24
|
export var StyledRadioButtonInput = /*#__PURE__*/styled.input.withConfig({
|
|
25
25
|
displayName: "StyledRadioButtonInput",
|
|
26
|
-
componentId: "core-
|
|
26
|
+
componentId: "core-12_25_2__sc-nd95zs-2"
|
|
27
27
|
})(["left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;&:focus:not(:checked),&[data-qa=", "]:not(:checked){&:not(:disabled) + ", ":before{", "}}&:focus:checked:not(:disabled),&[data-qa=", "]:checked:not(:disabled){+ ", ":before{box-shadow:0 0 0 2px ", ";}}&:checked + ", ":before{border:6px solid ", ";}&:disabled + ", ":before{border-color:", ";}&:disabled:checked + ", ":before{border-color:", ";}"], dataQa.focused, StyledRadioButtonLabel, getFocus(), dataQa.focused, StyledRadioButtonLabel, colors.blue40, StyledRadioButtonLabel, colors.blue50, StyledRadioButtonLabel, colors.gray85, StyledRadioButtonLabel, colors.blue85);
|
|
28
28
|
//# sourceMappingURL=RadioButton.styles.js.map
|
|
@@ -5,7 +5,7 @@ import { colors } from '../_styles/colors';
|
|
|
5
5
|
import { spacing } from '../_styles/spacing';
|
|
6
6
|
export var StyledRequiredMark = /*#__PURE__*/styled.span.withConfig({
|
|
7
7
|
displayName: "StyledRequiredMark",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_25_2__sc-bja1ql-0"
|
|
9
9
|
})(["color:", ";", ""], colors.red50, function (_ref) {
|
|
10
10
|
var $showLabel = _ref.$showLabel;
|
|
11
11
|
if ($showLabel) {
|
|
@@ -15,10 +15,10 @@ export var StyledRequiredMark = /*#__PURE__*/styled.span.withConfig({
|
|
|
15
15
|
});
|
|
16
16
|
export var StyledRequiredContainer = /*#__PURE__*/styled.span.withConfig({
|
|
17
17
|
displayName: "StyledRequiredContainer",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_25_2__sc-bja1ql-1"
|
|
19
19
|
})(["", " ", " > &{margin-left:", "px;}"], getTypographyIntent('small'), StyledCheckboxLabel, spacing.xs);
|
|
20
20
|
export var StyledRequiredText = /*#__PURE__*/styled.span.withConfig({
|
|
21
21
|
displayName: "StyledRequiredText",
|
|
22
|
-
componentId: "core-
|
|
22
|
+
componentId: "core-12_25_2__sc-bja1ql-2"
|
|
23
23
|
})(["font-style:italic;color:", ";margin-left:4px;"], colors.gray45);
|
|
24
24
|
//# sourceMappingURL=Required.styles.js.map
|
|
@@ -33,22 +33,22 @@ export function getSearchInputStyles() {
|
|
|
33
33
|
}
|
|
34
34
|
export var StyledInput = /*#__PURE__*/styled.input.withConfig({
|
|
35
35
|
displayName: "StyledInput",
|
|
36
|
-
componentId: "core-
|
|
36
|
+
componentId: "core-12_25_2__sc-3j8khv-0"
|
|
37
37
|
})(["", ""], getSearchInputStyles);
|
|
38
38
|
var StyledButton = /*#__PURE__*/styled(Button).withConfig({
|
|
39
39
|
displayName: "StyledButton",
|
|
40
|
-
componentId: "core-
|
|
40
|
+
componentId: "core-12_25_2__sc-3j8khv-1"
|
|
41
41
|
})(["position:absolute;top:", "px;"], buttonTop);
|
|
42
42
|
export var StyledSearchButton = /*#__PURE__*/styled(StyledButton).withConfig({
|
|
43
43
|
displayName: "StyledSearchButton",
|
|
44
|
-
componentId: "core-
|
|
44
|
+
componentId: "core-12_25_2__sc-3j8khv-2"
|
|
45
45
|
})([""]);
|
|
46
46
|
export var StyledClearButton = /*#__PURE__*/styled(StyledButton).withConfig({
|
|
47
47
|
displayName: "StyledClearButton",
|
|
48
|
-
componentId: "core-
|
|
48
|
+
componentId: "core-12_25_2__sc-3j8khv-3"
|
|
49
49
|
})([""]);
|
|
50
50
|
export var StyledSearch = /*#__PURE__*/styled.div.withConfig({
|
|
51
51
|
displayName: "StyledSearch",
|
|
52
|
-
componentId: "core-
|
|
52
|
+
componentId: "core-12_25_2__sc-3j8khv-4"
|
|
53
53
|
})(["position:relative;width:100%;", "{padding-right:", "px;}", "{right:", "px;}", "{right:", "px;}"], StyledInput, inputRight, StyledSearchButton, searchRight, StyledClearButton, clearRight);
|
|
54
54
|
//# sourceMappingURL=Search.styles.js.map
|
package/dist/Section/Section.js
CHANGED
|
@@ -15,13 +15,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
15
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
16
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
-
import { ChevronDown, ChevronRight } from '@procore/core-icons
|
|
18
|
+
import { ChevronDown, ChevronRight } from '@procore/core-icons';
|
|
19
19
|
import cx from 'classnames';
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import { ulid } from 'ulid';
|
|
22
|
-
import { Button } from '../Button
|
|
22
|
+
import { Button } from '../Button';
|
|
23
23
|
import { getHeadingComponent } from '../Semantic/Semantic';
|
|
24
|
-
import { Title } from '../Title
|
|
24
|
+
import { Title } from '../Title';
|
|
25
25
|
import { sectionClassnames, StyledSection, StyledSectionBanner, StyledSectionCollapseHeading, StyledSectionContentRegion, StyledSectionHeader, StyledSectionInner, StyledTitle } from './Section.styles';
|
|
26
26
|
var isFunction = function isFunction(obj) {
|
|
27
27
|
return typeof obj === 'function';
|
|
@@ -123,7 +123,7 @@ export var Section = /*#__PURE__*/React.forwardRef(function Section(_ref3, ref)
|
|
|
123
123
|
onClick: toggleOpen,
|
|
124
124
|
variant: "tertiary"
|
|
125
125
|
})) : null, /*#__PURE__*/React.createElement(StyledTitle, null, /*#__PURE__*/React.createElement(Title.Text, null, heading && /*#__PURE__*/React.createElement(Heading, {
|
|
126
|
-
"aria-hidden": expandId
|
|
126
|
+
"aria-hidden": !!expandId,
|
|
127
127
|
id: headingTextId
|
|
128
128
|
// Pass level since Heading component renders
|
|
129
129
|
// under the incremented (level + 1) LevelProvider.
|
|
@@ -136,7 +136,8 @@ export var Section = /*#__PURE__*/React.forwardRef(function Section(_ref3, ref)
|
|
|
136
136
|
"aria-hidden": !open,
|
|
137
137
|
"aria-labelledby": heading ? headingTextId : undefined,
|
|
138
138
|
id: contentRegionId,
|
|
139
|
-
role:
|
|
139
|
+
role: heading ? 'region' : undefined,
|
|
140
|
+
tabIndex: open ? 0 : -1,
|
|
140
141
|
$closed: expandClosed,
|
|
141
142
|
$noHeader: !hasHeader
|
|
142
143
|
}, open ? children : null))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","names":["ChevronDown","ChevronRight","cx","React","ulid","Button","getHeadingComponent","Title","sectionClassnames","StyledSection","StyledSectionBanner","StyledSectionCollapseHeading","StyledSectionContentRegion","StyledSectionHeader","StyledSectionInner","StyledTitle","isFunction","obj","LevelContext","createContext","SectionContext","open","setSection","toggleSection","Heading","_ref","level_","level","props","_objectWithoutProperties","_excluded","useContext","H","createElement","SectionProvider","_ref2","children","_React$useState","useState","_React$useState2","_slicedToArray","setSectionsOpen","id","prev","_objectSpread","_defineProperty","Provider","value","Section","forwardRef","_ref3","ref","actions","banner","className","expandId","heading","_ref3$initialIsOpen","initialIsOpen","pills","subtext","assets","_excluded2","sections","toggleOpen","useCallback","useEffect","undefined","_React$useMemo","useMemo","contentRegionId","concat","headingTextId","expandClosed","divide","hasHeader","_extends","levelAnonymous","role","icon","onClick","variant","Text","Subtext","Pills","Actions","Assets","$closed","$noHeader","displayName"],"sources":["../../src/Section/Section.tsx"],"sourcesContent":["import { ChevronDown, ChevronRight } from '@procore/core-icons/dist'\nimport cx from 'classnames'\nimport React from 'react'\nimport { ulid } from 'ulid'\nimport { Button } from '../Button/Button'\nimport { getHeadingComponent } from '../Semantic/Semantic'\nimport type { HeadingProps } from '../Semantic/Semantic.types'\nimport { Title } from '../Title/Title'\nimport {\n sectionClassnames,\n StyledSection,\n StyledSectionBanner,\n StyledSectionCollapseHeading,\n StyledSectionContentRegion,\n StyledSectionHeader,\n StyledSectionInner,\n StyledTitle,\n} from './Section.styles'\nimport type {\n SectionContextAPI,\n SectionProps,\n SectionProviderProps,\n} from './Section.types'\n\nconst isFunction = (obj: unknown): boolean => typeof obj === 'function'\n\n// Header levels start at level 2\nexport const LevelContext = React.createContext(2)\n\nconst SectionContext = React.createContext<SectionContextAPI>({\n open: {},\n setSection: () => {},\n toggleSection: () => {},\n})\n\nexport function Heading({\n level: level_,\n ...props\n}: HeadingProps & { level?: number }) {\n const level = React.useContext(LevelContext)\n const H = getHeadingComponent(level_ || level)\n return <H {...props} />\n}\n\nexport const SectionProvider = ({ children }: SectionProviderProps) => {\n const [open, setSectionsOpen] = React.useState<{\n [key: string]: boolean\n }>({})\n\n const toggleSection: SectionContextAPI['toggleSection'] = (id) =>\n setSectionsOpen((prev) => ({\n ...prev,\n [id]: !prev[id],\n }))\n\n const setSection: SectionContextAPI['setSection'] = (id, open) =>\n setSectionsOpen((prev) => ({\n ...prev,\n [id]: open,\n }))\n\n return (\n <SectionContext.Provider\n value={{\n open,\n toggleSection,\n setSection,\n }}\n >\n {children}\n </SectionContext.Provider>\n )\n}\n/**\n * @deprecatedSince 11\n * @deprecated Intended for internal library development. See Panel.Section or DetailPage.Section\n */\nexport const Section = React.forwardRef<HTMLDivElement, SectionProps>(\n function Section(\n {\n actions,\n banner,\n children,\n className,\n expandId,\n heading,\n initialIsOpen = true,\n pills,\n subtext,\n assets,\n ...props\n },\n ref\n ) {\n const level = React.useContext(LevelContext)\n\n const sections = React.useContext(SectionContext)\n const toggleOpen = React.useCallback(() => {\n if (expandId) {\n sections.toggleSection(expandId)\n }\n }, [expandId])\n const open = expandId ? sections.open[expandId] : true\n\n React.useEffect(() => {\n if (expandId && open === undefined) {\n sections.setSection(expandId, initialIsOpen)\n }\n }, [])\n\n const { contentRegionId, headingTextId } = React.useMemo(() => {\n return {\n contentRegionId: `content-${ulid()}`,\n headingTextId: `heading-${ulid()}`,\n }\n }, [])\n\n const expandClosed = !open || !children\n const divide = level >= 3 || !heading\n const hasHeader = heading || actions\n\n return (\n <LevelContext.Provider value={level + 1}>\n <StyledSection\n ref={ref}\n className={cx(className, {\n [sectionClassnames.divide]: divide,\n [sectionClassnames.levelAnonymous]: !heading,\n [sectionClassnames.level(level)]: heading && level,\n })}\n {...props}\n >\n <StyledSectionInner>\n {banner && <StyledSectionBanner>{banner}</StyledSectionBanner>}\n\n {hasHeader ? (\n <StyledSectionHeader>\n {expandId ? (\n <StyledSectionCollapseHeading\n aria-labelledby={headingTextId}\n aria-level={level}\n role=\"heading\"\n >\n <Button\n aria-controls={contentRegionId}\n aria-expanded={open}\n aria-labelledby={headingTextId}\n icon={open ? <ChevronDown /> : <ChevronRight />}\n onClick={toggleOpen}\n variant=\"tertiary\"\n />\n </StyledSectionCollapseHeading>\n ) : null}\n <StyledTitle>\n <Title.Text>\n {heading && (\n <Heading\n aria-hidden={expandId ? true : false}\n id={headingTextId}\n // Pass level since Heading component renders\n // under the incremented (level + 1) LevelProvider.\n // Alternative, render Heading as a variable outside of return.\n level={level}\n >\n {heading}\n </Heading>\n )}\n </Title.Text>\n <Title.Subtext>{subtext}</Title.Subtext>\n <Title.Pills>{pills}</Title.Pills>\n <Title.Actions>\n {isFunction(actions)\n ? (actions as Function)({ open })\n : actions}\n </Title.Actions>\n <Title.Assets>{assets}</Title.Assets>\n </StyledTitle>\n </StyledSectionHeader>\n ) : null}\n <StyledSectionContentRegion\n aria-hidden={!open}\n aria-labelledby={heading ? headingTextId : undefined}\n id={contentRegionId}\n role=\"region\"\n $closed={expandClosed}\n $noHeader={!hasHeader}\n >\n {open ? children : null}\n </StyledSectionContentRegion>\n </StyledSectionInner>\n </StyledSection>\n </LevelContext.Provider>\n )\n }\n)\n\nSection.displayName = 'Section'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAASA,WAAW,EAAEC,YAAY,QAAQ,0BAA0B;AACpE,OAAOC,EAAE,MAAM,YAAY;AAC3B,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,MAAM;AAC3B,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,mBAAmB,QAAQ,sBAAsB;AAE1D,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SACEC,iBAAiB,EACjBC,aAAa,EACbC,mBAAmB,EACnBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,mBAAmB,EACnBC,kBAAkB,EAClBC,WAAW,QACN,kBAAkB;AAOzB,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,GAAY;EAAA,OAAc,OAAOA,GAAG,KAAK,UAAU;AAAA;;AAEvE;AACA,OAAO,IAAMC,YAAY,gBAAGf,KAAK,CAACgB,aAAa,CAAC,CAAC,CAAC;AAElD,IAAMC,cAAc,gBAAGjB,KAAK,CAACgB,aAAa,CAAoB;EAC5DE,IAAI,EAAE,CAAC,CAAC;EACRC,UAAU,EAAE,SAAZA,UAAUA,CAAA,EAAQ,CAAC,CAAC;EACpBC,aAAa,EAAE,SAAfA,aAAaA,CAAA,EAAQ,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,SAASC,OAAOA,CAAAC,IAAA,EAGe;EAAA,IAF7BC,MAAM,GAAAD,IAAA,CAAbE,KAAK;IACFC,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAER,IAAMH,KAAK,GAAGxB,KAAK,CAAC4B,UAAU,CAACb,YAAY,CAAC;EAC5C,IAAMc,CAAC,GAAG1B,mBAAmB,CAACoB,MAAM,IAAIC,KAAK,CAAC;EAC9C,oBAAOxB,KAAA,CAAA8B,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ChevronRight","cx","React","ulid","Button","getHeadingComponent","Title","sectionClassnames","StyledSection","StyledSectionBanner","StyledSectionCollapseHeading","StyledSectionContentRegion","StyledSectionHeader","StyledSectionInner","StyledTitle","isFunction","obj","LevelContext","createContext","SectionContext","open","setSection","toggleSection","Heading","_ref","level_","level","props","_objectWithoutProperties","_excluded","useContext","H","createElement","SectionProvider","_ref2","children","_React$useState","useState","_React$useState2","_slicedToArray","setSectionsOpen","id","prev","_objectSpread","_defineProperty","Provider","value","Section","forwardRef","_ref3","ref","actions","banner","className","expandId","heading","_ref3$initialIsOpen","initialIsOpen","pills","subtext","assets","_excluded2","sections","toggleOpen","useCallback","useEffect","undefined","_React$useMemo","useMemo","contentRegionId","concat","headingTextId","expandClosed","divide","hasHeader","_extends","levelAnonymous","role","icon","onClick","variant","Text","Subtext","Pills","Actions","Assets","tabIndex","$closed","$noHeader","displayName"],"sources":["../../src/Section/Section.tsx"],"sourcesContent":["import { ChevronDown, ChevronRight } from '@procore/core-icons'\nimport cx from 'classnames'\nimport React from 'react'\nimport { ulid } from 'ulid'\nimport { Button } from '../Button'\nimport { getHeadingComponent } from '../Semantic/Semantic'\nimport type { HeadingProps } from '../Semantic/Semantic.types'\nimport { Title } from '../Title'\nimport {\n sectionClassnames,\n StyledSection,\n StyledSectionBanner,\n StyledSectionCollapseHeading,\n StyledSectionContentRegion,\n StyledSectionHeader,\n StyledSectionInner,\n StyledTitle,\n} from './Section.styles'\nimport type {\n SectionContextAPI,\n SectionProps,\n SectionProviderProps,\n} from './Section.types'\n\nconst isFunction = (obj: unknown): boolean => typeof obj === 'function'\n\n// Header levels start at level 2\nexport const LevelContext = React.createContext(2)\n\nconst SectionContext = React.createContext<SectionContextAPI>({\n open: {},\n setSection: () => {},\n toggleSection: () => {},\n})\n\nexport function Heading({\n level: level_,\n ...props\n}: HeadingProps & { level?: number }) {\n const level = React.useContext(LevelContext)\n const H = getHeadingComponent(level_ || level)\n return <H {...props} />\n}\n\nexport const SectionProvider = ({ children }: SectionProviderProps) => {\n const [open, setSectionsOpen] = React.useState<{\n [key: string]: boolean\n }>({})\n\n const toggleSection: SectionContextAPI['toggleSection'] = (id) =>\n setSectionsOpen((prev) => ({\n ...prev,\n [id]: !prev[id],\n }))\n\n const setSection: SectionContextAPI['setSection'] = (id, open) =>\n setSectionsOpen((prev) => ({\n ...prev,\n [id]: open,\n }))\n\n return (\n <SectionContext.Provider\n value={{\n open,\n toggleSection,\n setSection,\n }}\n >\n {children}\n </SectionContext.Provider>\n )\n}\n/**\n * @deprecatedSince 11\n * @deprecated Intended for internal library development. See Panel.Section or DetailPage.Section\n */\nexport const Section = React.forwardRef<HTMLDivElement, SectionProps>(\n function Section(\n {\n actions,\n banner,\n children,\n className,\n expandId,\n heading,\n initialIsOpen = true,\n pills,\n subtext,\n assets,\n ...props\n },\n ref\n ) {\n const level = React.useContext(LevelContext)\n\n const sections = React.useContext(SectionContext)\n const toggleOpen = React.useCallback(() => {\n if (expandId) {\n sections.toggleSection(expandId)\n }\n }, [expandId])\n const open = expandId ? sections.open[expandId] : true\n\n React.useEffect(() => {\n if (expandId && open === undefined) {\n sections.setSection(expandId, initialIsOpen)\n }\n }, [])\n\n const { contentRegionId, headingTextId } = React.useMemo(() => {\n return {\n contentRegionId: `content-${ulid()}`,\n headingTextId: `heading-${ulid()}`,\n }\n }, [])\n\n const expandClosed = !open || !children\n const divide = level >= 3 || !heading\n const hasHeader = heading || actions\n\n return (\n <LevelContext.Provider value={level + 1}>\n <StyledSection\n ref={ref}\n className={cx(className, {\n [sectionClassnames.divide]: divide,\n [sectionClassnames.levelAnonymous]: !heading,\n [sectionClassnames.level(level)]: heading && level,\n })}\n {...props}\n >\n <StyledSectionInner>\n {banner && <StyledSectionBanner>{banner}</StyledSectionBanner>}\n\n {hasHeader ? (\n <StyledSectionHeader>\n {expandId ? (\n <StyledSectionCollapseHeading\n aria-labelledby={headingTextId}\n aria-level={level}\n role=\"heading\"\n >\n <Button\n aria-controls={contentRegionId}\n aria-expanded={open}\n aria-labelledby={headingTextId}\n icon={open ? <ChevronDown /> : <ChevronRight />}\n onClick={toggleOpen}\n variant=\"tertiary\"\n />\n </StyledSectionCollapseHeading>\n ) : null}\n <StyledTitle>\n <Title.Text>\n {heading && (\n <Heading\n aria-hidden={!!expandId}\n id={headingTextId}\n // Pass level since Heading component renders\n // under the incremented (level + 1) LevelProvider.\n // Alternative, render Heading as a variable outside of return.\n level={level}\n >\n {heading}\n </Heading>\n )}\n </Title.Text>\n <Title.Subtext>{subtext}</Title.Subtext>\n <Title.Pills>{pills}</Title.Pills>\n <Title.Actions>\n {isFunction(actions)\n ? (actions as Function)({ open })\n : actions}\n </Title.Actions>\n <Title.Assets>{assets}</Title.Assets>\n </StyledTitle>\n </StyledSectionHeader>\n ) : null}\n <StyledSectionContentRegion\n aria-hidden={!open}\n aria-labelledby={heading ? headingTextId : undefined}\n id={contentRegionId}\n role={heading ? 'region' : undefined}\n tabIndex={open ? 0 : -1}\n $closed={expandClosed}\n $noHeader={!hasHeader}\n >\n {open ? children : null}\n </StyledSectionContentRegion>\n </StyledSectionInner>\n </StyledSection>\n </LevelContext.Provider>\n )\n }\n)\n\nSection.displayName = 'Section'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAASA,WAAW,EAAEC,YAAY,QAAQ,qBAAqB;AAC/D,OAAOC,EAAE,MAAM,YAAY;AAC3B,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,MAAM;AAC3B,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,mBAAmB,QAAQ,sBAAsB;AAE1D,SAASC,KAAK,QAAQ,UAAU;AAChC,SACEC,iBAAiB,EACjBC,aAAa,EACbC,mBAAmB,EACnBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,mBAAmB,EACnBC,kBAAkB,EAClBC,WAAW,QACN,kBAAkB;AAOzB,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,GAAY;EAAA,OAAc,OAAOA,GAAG,KAAK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ACXrE,UAAU,CAACoC,OAAO,CAAC,GACfA,OAAO,CAAc;IAAE/B,IAAI,EAAJA;EAAK,CAAC,CAAC,GAC/B+B,OACS,CAAC,eAChBjD,KAAA,CAAA8B,aAAA,CAAC1B,KAAK,CAAC+E,MAAM,QAAEzB,MAAqB,CACzB,CACM,CAAC,GACpB,IAAI,eACR1D,KAAA,CAAA8B,aAAA,CAACrB,0BAA0B;IACzB,eAAa,CAACS,IAAK;IACnB,mBAAiBmC,OAAO,GAAGgB,aAAa,GAAGL,SAAU;IACrDzB,EAAE,EAAE4B,eAAgB;IACpBQ,IAAI,EAAEtB,OAAO,GAAG,QAAQ,GAAGW,SAAU;IACrCoB,QAAQ,EAAElE,IAAI,GAAG,CAAC,GAAG,CAAC,CAAE;IACxBmE,OAAO,EAAEf,YAAa;IACtBgB,SAAS,EAAE,CAACd;EAAU,GAErBtD,IAAI,GAAGe,QAAQ,GAAG,IACO,CACV,CACP,CACM,CAAC;AAE5B,CACF,CAAC;AAEDY,OAAO,CAAC0C,WAAW,GAAG,SAAS"}
|
|
@@ -16,9 +16,9 @@ export declare const StyledSectionHeader: import("styled-components/dist/types")
|
|
|
16
16
|
export declare const StyledTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("..").TitleProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
17
17
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
18
|
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("..").TitleProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
19
|
-
Pills: import("react").ForwardRefExoticComponent<import("
|
|
20
|
-
Text: import("react").ForwardRefExoticComponent<import("
|
|
21
|
-
Subtext: import("react").ForwardRefExoticComponent<import("
|
|
22
|
-
Actions: import("react").ForwardRefExoticComponent<import("
|
|
23
|
-
Assets: import("react").ForwardRefExoticComponent<import("
|
|
19
|
+
Pills: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Text: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
Subtext: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
Actions: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
Assets: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("../Title/Title.types").TitleAssetsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
24
|
}, keyof import("react").Component<any, {}, any>>;
|
|
@@ -2,18 +2,19 @@ import styled, { css } from 'styled-components';
|
|
|
2
2
|
import { StyledFormRow } from '../Form/Form.styles';
|
|
3
3
|
import { Title } from '../Title/Title';
|
|
4
4
|
import { colors } from '../_styles/colors';
|
|
5
|
+
import { getFocus } from '../_styles/mixins';
|
|
5
6
|
import { spacing } from '../_styles/spacing';
|
|
6
7
|
export var StyledSectionBanner = /*#__PURE__*/styled.div.withConfig({
|
|
7
8
|
displayName: "StyledSectionBanner",
|
|
8
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_25_2__sc-1lxbrwv-0"
|
|
9
10
|
})(["margin-bottom:", "px;> * + *{margin-top:", "px;}"], spacing.sm, spacing.sm);
|
|
10
11
|
export var StyledSectionInner = /*#__PURE__*/styled.div.withConfig({
|
|
11
12
|
displayName: "StyledSectionInner",
|
|
12
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_25_2__sc-1lxbrwv-1"
|
|
13
14
|
})([""]);
|
|
14
15
|
export var StyledSectionCollapseHeading = /*#__PURE__*/styled.div.withConfig({
|
|
15
16
|
displayName: "StyledSectionCollapseHeading",
|
|
16
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_25_2__sc-1lxbrwv-2"
|
|
17
18
|
})(["align-self:flex-start;margin-right:", "px;"], spacing.sm);
|
|
18
19
|
export var sectionClassnames = {
|
|
19
20
|
divide: 'section--divide',
|
|
@@ -24,12 +25,12 @@ export var sectionClassnames = {
|
|
|
24
25
|
};
|
|
25
26
|
export var StyledSection = /*#__PURE__*/styled.div.withConfig({
|
|
26
27
|
displayName: "StyledSection",
|
|
27
|
-
componentId: "core-
|
|
28
|
+
componentId: "core-12_25_2__sc-1lxbrwv-3"
|
|
28
29
|
})(["padding-left:", "px;padding-right:", "px;padding-bottom:", "px;& > ", "{padding-top:", "px;}&.", "{& > ", "{border-top:1px solid ", ";}}&:first-child > ", "{border-top:0;}& &{padding-left:0;padding-right:0;&:first-child > ", "{border-top:1px solid ", ";}&:last-child{padding-bottom:0;}}", ":last-of-type{margin-bottom:", "px;}", " + &&&{padding-top:", "px;}"], spacing.lg, spacing.lg, spacing.lg, StyledSectionInner, spacing.lg, sectionClassnames.divide, StyledSectionInner, colors.gray85, StyledSectionInner, StyledSectionInner, colors.gray85, StyledFormRow, spacing.lg * -1, StyledFormRow, spacing.xs);
|
|
29
30
|
export var StyledSectionContentRegion = /*#__PURE__*/styled.div.withConfig({
|
|
30
31
|
displayName: "StyledSectionContentRegion",
|
|
31
|
-
componentId: "core-
|
|
32
|
-
})(["padding-top:", "px
|
|
32
|
+
componentId: "core-12_25_2__sc-1lxbrwv-4"
|
|
33
|
+
})(["padding-top:", "px;&:focus-visible{", "}", " ", " & > :not(", ") + ", "{padding-top:", "px;}", " ", " &:last-of-type{padding-bottom:0;}"], spacing.sm, getFocus(), function (_ref) {
|
|
33
34
|
var $closed = _ref.$closed;
|
|
34
35
|
return $closed && css(["padding-top:0;"]);
|
|
35
36
|
}, function (_ref2) {
|
|
@@ -38,10 +39,10 @@ export var StyledSectionContentRegion = /*#__PURE__*/styled.div.withConfig({
|
|
|
38
39
|
}, StyledSection, StyledSection, spacing.xl, StyledSection, StyledSection);
|
|
39
40
|
export var StyledSectionHeader = /*#__PURE__*/styled.div.withConfig({
|
|
40
41
|
displayName: "StyledSectionHeader",
|
|
41
|
-
componentId: "core-
|
|
42
|
+
componentId: "core-12_25_2__sc-1lxbrwv-5"
|
|
42
43
|
})(["align-items:center;display:flex;min-height:36px;word-break:break-word;"]);
|
|
43
44
|
export var StyledTitle = /*#__PURE__*/styled(Title).withConfig({
|
|
44
45
|
displayName: "StyledTitle",
|
|
45
|
-
componentId: "core-
|
|
46
|
+
componentId: "core-12_25_2__sc-1lxbrwv-6"
|
|
46
47
|
})(["width:100%;"]);
|
|
47
48
|
//# sourceMappingURL=Section.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.styles.js","names":["styled","css","StyledFormRow","Title","colors","spacing","StyledSectionBanner","div","withConfig","displayName","componentId","sm","StyledSectionInner","StyledSectionCollapseHeading","sectionClassnames","divide","levelAnonymous","level","num","concat","StyledSection","lg","gray85","xs","StyledSectionContentRegion","_ref","$closed","_ref2","$noHeader","xl","StyledSectionHeader","StyledTitle"],"sources":["../../src/Section/Section.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { StyledFormRow } from '../Form/Form.styles'\nimport { Title } from '../Title/Title'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\nexport const StyledSectionBanner = styled.div`\n margin-bottom: ${spacing.sm}px;\n\n > * + * {\n margin-top: ${spacing.sm}px;\n }\n`\n\nexport const StyledSectionInner = styled.div``\n\nexport const StyledSectionCollapseHeading = styled.div`\n align-self: flex-start;\n margin-right: ${spacing.sm}px;\n`\n\nexport const sectionClassnames = {\n divide: 'section--divide',\n levelAnonymous: 'section--level-anon',\n level: (num: number) => `section--level-${num}`,\n}\n\nexport const StyledSection = styled.div`\n padding-left: ${spacing.lg}px;\n padding-right: ${spacing.lg}px;\n padding-bottom: ${spacing.lg}px;\n\n & > ${StyledSectionInner} {\n padding-top: ${spacing.lg}px;\n }\n\n // horizontal divider\n &.${sectionClassnames.divide} {\n & > ${StyledSectionInner} {\n border-top: 1px solid ${colors.gray85};\n }\n }\n\n // if leading, no horizontal divider\n &:first-child > ${StyledSectionInner} {\n border-top: 0;\n }\n\n & & {\n padding-left: 0;\n padding-right: 0;\n\n // if leading in nested, add the division back\n &:first-child > ${StyledSectionInner} {\n border-top: 1px solid ${colors.gray85};\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n }\n\n // form rows have trailing space for error message\n ${StyledFormRow}:last-of-type {\n margin-bottom: ${spacing.lg * -1}px;\n }\n\n // form rows have trailing space for error message\n ${StyledFormRow} + &&& {\n padding-top: ${spacing.xs}px;\n }\n`\n\nexport const StyledSectionContentRegion = styled.div<{\n $closed: boolean\n $noHeader: boolean\n}>`\n padding-top: ${spacing.sm}px;\n\n ${({ $closed }) =>\n $closed &&\n css`\n padding-top: 0;\n `}\n\n ${({ $noHeader }) =>\n $noHeader &&\n css`\n padding-top: 0;\n `}\n\n // if a nested section isn't first\n // Section\n // P\n // Section <-- space above\n & > :not(${StyledSection}) + ${StyledSection} {\n padding-top: ${spacing.xl}px;\n }\n\n // nested sections, the last one doesn't need more trailing space\n ${StyledSection} ${StyledSection} &:last-of-type {\n padding-bottom: 0;\n }\n`\n\nexport const StyledSectionHeader = styled.div`\n align-items: center;\n display: flex;\n // min-height on header for alignment:\n // - when heading line height is less than the collapse button height\n // - when heading line height is less than the button size it will shift\n // the heading text when the section is opened and buttons appear\n min-height: 36px;\n word-break: break-word;\n`\n\nexport const StyledTitle = styled(Title)`\n width: 100%;\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,OAAO,IAAMC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"Section.styles.js","names":["styled","css","StyledFormRow","Title","colors","getFocus","spacing","StyledSectionBanner","div","withConfig","displayName","componentId","sm","StyledSectionInner","StyledSectionCollapseHeading","sectionClassnames","divide","levelAnonymous","level","num","concat","StyledSection","lg","gray85","xs","StyledSectionContentRegion","_ref","$closed","_ref2","$noHeader","xl","StyledSectionHeader","StyledTitle"],"sources":["../../src/Section/Section.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { StyledFormRow } from '../Form/Form.styles'\nimport { Title } from '../Title/Title'\nimport { colors } from '../_styles/colors'\nimport { getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\n\nexport const StyledSectionBanner = styled.div`\n margin-bottom: ${spacing.sm}px;\n\n > * + * {\n margin-top: ${spacing.sm}px;\n }\n`\n\nexport const StyledSectionInner = styled.div``\n\nexport const StyledSectionCollapseHeading = styled.div`\n align-self: flex-start;\n margin-right: ${spacing.sm}px;\n`\n\nexport const sectionClassnames = {\n divide: 'section--divide',\n levelAnonymous: 'section--level-anon',\n level: (num: number) => `section--level-${num}`,\n}\n\nexport const StyledSection = styled.div`\n padding-left: ${spacing.lg}px;\n padding-right: ${spacing.lg}px;\n padding-bottom: ${spacing.lg}px;\n\n & > ${StyledSectionInner} {\n padding-top: ${spacing.lg}px;\n }\n\n // horizontal divider\n &.${sectionClassnames.divide} {\n & > ${StyledSectionInner} {\n border-top: 1px solid ${colors.gray85};\n }\n }\n\n // if leading, no horizontal divider\n &:first-child > ${StyledSectionInner} {\n border-top: 0;\n }\n\n & & {\n padding-left: 0;\n padding-right: 0;\n\n // if leading in nested, add the division back\n &:first-child > ${StyledSectionInner} {\n border-top: 1px solid ${colors.gray85};\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n }\n\n // form rows have trailing space for error message\n ${StyledFormRow}:last-of-type {\n margin-bottom: ${spacing.lg * -1}px;\n }\n\n // form rows have trailing space for error message\n ${StyledFormRow} + &&& {\n padding-top: ${spacing.xs}px;\n }\n`\n\nexport const StyledSectionContentRegion = styled.div<{\n $closed: boolean\n $noHeader: boolean\n}>`\n padding-top: ${spacing.sm}px;\n\n &:focus-visible {\n ${getFocus()}\n }\n\n ${({ $closed }) =>\n $closed &&\n css`\n padding-top: 0;\n `}\n\n ${({ $noHeader }) =>\n $noHeader &&\n css`\n padding-top: 0;\n `}\n\n // if a nested section isn't first\n // Section\n // P\n // Section <-- space above\n & > :not(${StyledSection}) + ${StyledSection} {\n padding-top: ${spacing.xl}px;\n }\n\n // nested sections, the last one doesn't need more trailing space\n ${StyledSection} ${StyledSection} &:last-of-type {\n padding-bottom: 0;\n }\n`\n\nexport const StyledSectionHeader = styled.div`\n align-items: center;\n display: flex;\n // min-height on header for alignment:\n // - when heading line height is less than the collapse button height\n // - when heading line height is less than the button size it will shift\n // the heading text when the section is opened and buttons appear\n min-height: 36px;\n word-break: break-word;\n`\n\nexport const StyledTitle = styled(Title)`\n width: 100%;\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,OAAO,IAAMC,mBAAmB,gBAAGP,MAAM,CAACQ,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yDAC1BL,OAAO,CAACM,EAAE,EAGXN,OAAO,CAACM,EAAE,CAE3B;AAED,OAAO,IAAMC,kBAAkB,gBAAGb,MAAM,CAACQ,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE;AAE9C,OAAO,IAAMG,4BAA4B,gBAAGd,MAAM,CAACQ,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mDAEpCL,OAAO,CAACM,EAAE,CAC3B;AAED,OAAO,IAAMG,iBAAiB,GAAG;EAC/BC,M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CAAAM,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mBAEvC"}
|
|
@@ -5,7 +5,7 @@ import { colors } from '../_styles/colors';
|
|
|
5
5
|
import { spacing } from '../_styles/spacing';
|
|
6
6
|
export var StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
7
7
|
displayName: "StyledContainer",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_25_2__sc-ocai3-0"
|
|
9
9
|
})(["align-items:center;display:", ";height:36px;justify-content:center;width:", ";"], function (_ref) {
|
|
10
10
|
var $block = _ref.$block;
|
|
11
11
|
return $block ? 'flex' : 'inline-flex';
|
|
@@ -15,7 +15,7 @@ export var StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
15
15
|
});
|
|
16
16
|
export var StyledSegment = /*#__PURE__*/styled.label.withConfig({
|
|
17
17
|
displayName: "StyledSegment",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_25_2__sc-ocai3-1"
|
|
19
19
|
})(["align-items:center;border-radius:0;border:1px solid ", ";cursor:pointer;display:flex;flex:1 1 auto;height:100%;justify-content:center;min-width:0;outline:0;padding:0 ", "px;position:relative;background-color:", ";color:", ";&:hover{background-color:", ";border-color:", ";color:", ";}", " ", ";"], colors.gray85, spacing.md, colors.white, colors.gray45, colors.gray94, colors.gray85, colors.gray45, function (_ref3) {
|
|
20
20
|
var _ref3$$focused = _ref3.$focused,
|
|
21
21
|
$focused = _ref3$$focused === void 0 ? false : _ref3$$focused;
|
|
@@ -37,10 +37,10 @@ export var StyledSegment = /*#__PURE__*/styled.label.withConfig({
|
|
|
37
37
|
});
|
|
38
38
|
export var StyledSegmentDisabledInteractiveWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
39
39
|
displayName: "StyledSegmentDisabledInteractiveWrapper",
|
|
40
|
-
componentId: "core-
|
|
40
|
+
componentId: "core-12_25_2__sc-ocai3-2"
|
|
41
41
|
})(["display:flex;flex:1 1 auto;min-width:0;height:100%;margin-right:-1px;&:first-child ", "{border-bottom-left-radius:", "px;border-top-left-radius:", "px;}&:last-child ", "{border-bottom-right-radius:", "px;border-top-right-radius:", "px;}"], StyledSegment, borderRadius.md, borderRadius.md, StyledSegment, borderRadius.md, borderRadius.md);
|
|
42
42
|
export var StyledLabel = /*#__PURE__*/styled.span.withConfig({
|
|
43
43
|
displayName: "StyledLabel",
|
|
44
|
-
componentId: "core-
|
|
44
|
+
componentId: "core-12_25_2__sc-ocai3-3"
|
|
45
45
|
})(["", ";display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"], getTypographyIntent('body'));
|
|
46
46
|
//# sourceMappingURL=SegmentedController.styles.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Placement, Props } from '../_utils/types';
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated Please use the `active` and `disabled` props
|
|
5
5
|
* @deprecatedSince 11
|
|
@@ -9,7 +9,7 @@ export declare const segmentedControllerSegmentVariant: {
|
|
|
9
9
|
readonly disabled: "disabled";
|
|
10
10
|
readonly none: "";
|
|
11
11
|
};
|
|
12
|
-
export interface SegmentedControllerProps extends Props, Omit<
|
|
12
|
+
export interface SegmentedControllerProps extends Props, Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
13
13
|
/**
|
|
14
14
|
* The segment is active
|
|
15
15
|
* @since 10.19.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedController.types.js","names":["segmentedControllerSegmentVariant","active","disabled","none"],"sources":["../../src/SegmentedController/SegmentedController.types.ts"],"sourcesContent":["import type React from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"SegmentedController.types.js","names":["segmentedControllerSegmentVariant","active","disabled","none"],"sources":["../../src/SegmentedController/SegmentedController.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { Placement, Props } from '../_utils/types'\n\n/**\n * @deprecated Please use the `active` and `disabled` props\n * @deprecatedSince 11\n */\nexport const segmentedControllerSegmentVariant = {\n active: 'active',\n disabled: 'disabled',\n none: '',\n} as const\n\nexport interface SegmentedControllerProps\n extends Props,\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /**\n * The segment is active\n * @since 10.19.0\n * @deprecated The property is not used anywhere\n * @deprecatedSince 12.18.0\n * */\n active?: number\n\n /**\n * The segment controller is block sized\n * @since 10.19.0\n */\n block?: boolean\n\n /**\n * Disables all segments in the controller\n * @since 10.19.0\n */\n disabled?: boolean\n\n /**\n * A callback to be called when the radio group value changes\n * @since 10.19.0\n */\n onChange?: (selected: number) => void\n\n /**\n * @deprecated Please use the `block` prop\n * @deprecatedSince 11\n * @since 10.19.0\n */\n variant?: 'block' | ''\n}\n\nexport interface SegmentedControllerSegmentProps extends Props {\n /**\n * The segment is active\n * @since 10.19.0\n * @deprecated Use `selected` instead\n * @deprecatedSince 12.18.0\n */\n active?: boolean\n\n /**\n * Is the segment disabled\n * @since 10.19.0\n */\n disabled?: boolean\n\n /**\n * To change the tooltip placement\n * @since 10.19.0\n */\n placement?: Placement\n\n /**\n * The segment is selected\n * @since 12.18.0\n * */\n selected?: boolean\n\n /**\n * The tooltip we want to display on hover\n * @since 10.19.0\n */\n tooltip?: React.ReactNode\n\n /**\n * A number to be used as radio input value\n * @internal\n * @since 11.3.0\n */\n internalIndex?: number\n}\n\nexport interface SegmentedControllerTooltipProps extends Props {\n /**\n * @since 10.19.0\n */\n overlay?: any\n /**\n * @since 10.19.0\n */\n placement: Placement\n}\n"],"mappings":"AAGA;AACA;AACA;AACA;AACA,OAAO,IAAMA,iCAAiC,GAAG;EAC/CC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE;AACR,CAAU"}
|
|
@@ -4,9 +4,9 @@ export declare const dataQa: {
|
|
|
4
4
|
hovered: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const tableSelectClassName = "select--table";
|
|
7
|
-
export declare const StyledSelectMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("
|
|
7
|
+
export declare const StyledSelectMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("react").HTMLAttributes<HTMLDivElement> & import("../Card").CardProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
8
8
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
-
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("
|
|
9
|
+
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("../Card").CardProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
10
10
|
export declare const StyledSelectButtonLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
11
|
$hoverable: boolean;
|
|
12
12
|
}>> & string;
|