@procore/core-react 12.17.1 → 12.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/Avatar/Avatar.types.d.ts +1 -1
- package/dist/Avatar/Avatar.types.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.js +7 -7
- package/dist/AvatarStack/AvatarStack.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.styles.d.ts +4 -4
- package/dist/AvatarStack/AvatarStack.styles.js +10 -10
- package/dist/AvatarStack/AvatarStack.styles.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.types.d.ts +2 -0
- package/dist/AvatarStack/AvatarStack.types.js.map +1 -1
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.js +8 -2
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.js +0 -1
- package/dist/Checkbox/Checkbox.js.map +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.hooks.js +4 -4
- package/dist/Dropzone/Dropzone.hooks.js.map +1 -1
- package/dist/Dropzone/Dropzone.js +44 -45
- package/dist/Dropzone/Dropzone.js.map +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/Dropzone/Dropzone.utils.d.ts +2 -0
- package/dist/Dropzone/Dropzone.utils.js +3 -0
- package/dist/Dropzone/Dropzone.utils.js.map +1 -1
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +2 -2
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.js +4 -1
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/MultiSelect/MultiSelect.js +7 -1
- package/dist/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +2 -2
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.js +4 -1
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/Popover/Popover.styles.d.ts +2 -1
- package/dist/Popover/Popover.styles.js +5 -4
- package/dist/Popover/Popover.styles.js.map +1 -1
- package/dist/Popover/Popover.types.d.ts +6 -0
- package/dist/Popover/Popover.types.js.map +1 -1
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Search/Search.types.d.ts +12 -2
- package/dist/Search/Search.types.js.map +1 -1
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.js +1 -1
- package/dist/Select/Select.js.map +1 -1
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/SuperSelect/SuperSelect.types.d.ts +1 -0
- package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.d.ts +1 -1
- package/dist/SuperSelect/useSuperSelect.js +9 -5
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.js +4 -1
- package/dist/Tearsheet/Tearsheet.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.styles.d.ts +1 -0
- package/dist/Tearsheet/Tearsheet.styles.js +8 -7
- package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.types.d.ts +9 -0
- package/dist/Tearsheet/Tearsheet.types.js.map +1 -1
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- 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.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/I18n.d.ts +80 -0
- package/dist/_locales/de-DE.json +15 -10
- package/dist/_locales/en-AU.json +19 -14
- package/dist/_locales/en-CA.json +17 -12
- package/dist/_locales/en-GB.json +17 -12
- package/dist/_locales/en.json +15 -10
- package/dist/_locales/es-ES.json +15 -10
- package/dist/_locales/es.json +15 -10
- package/dist/_locales/fr-CA.json +15 -10
- package/dist/_locales/fr-FR.json +15 -10
- package/dist/_locales/is-IS.json +15 -10
- package/dist/_locales/ja-JP.json +15 -10
- package/dist/_locales/pl-PL.json +15 -10
- package/dist/_locales/pseudo.json +15 -10
- package/dist/_locales/pt-BR.json +15 -10
- package/dist/_locales/th-TH.json +15 -10
- package/dist/_locales/zh-SG.json +15 -10
- package/dist/_typedoc/Avatar/Avatar.types.json +22 -22
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +27 -25
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +12 -12
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
- package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
- package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +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 +741 -741
- 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 +4 -4
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
- package/dist/_typedoc/PageLayout/PageLayout.types.json +29 -29
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +28 -28
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +27 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +35 -21
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
- package/dist/_typedoc/Select/Select.types.json +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 +12 -12
- package/dist/_typedoc/Switch/Switch.types.json +3 -3
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +19 -19
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +32 -18
- 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 +30 -30
- 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 +4 -4
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +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/_typedoc/deprecations.json +1 -1
- package/package.json +1 -1
package/dist/Card/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","names":["React","useDeprecation","StyledCardContainer","Card","forwardRef","_ref","ref","children","level","_ref$shadowStrength","shadowStrength","variant","props","_objectWithoutProperties","_excluded","when","oldThing","newThing","createElement","_extends","$level","$shadowStrength","$variant","displayName"],"sources":["../../src/Card/Card.tsx"],"sourcesContent":["import React from 'react'\nimport { useDeprecation } from '../_hooks/Deprecation'\nimport type { DivAttributes } from '../_utils/types'\nimport { StyledCardContainer } from './Card.styles'\nimport type { CardProps } from './Card.types'\n\n/**\n\n We use cards to display information that is grouped together.\n Cards may contain rich media, text, buttons, and other functionality.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-card--demo)\n\n @see [Design Guidelines](https://design.procore.com/card)\n\n */\nexport const Card = React.forwardRef<HTMLDivElement, DivAttributes & CardProps>(\n function Card(\n {
|
|
1
|
+
{"version":3,"file":"Card.js","names":["React","useDeprecation","StyledCardContainer","Card","forwardRef","_ref","ref","children","level","_ref$shadowStrength","shadowStrength","variant","ariaOrientation","role","props","_objectWithoutProperties","_excluded","when","oldThing","newThing","roleAttributes","createElement","_extends","$level","$shadowStrength","$variant","displayName"],"sources":["../../src/Card/Card.tsx"],"sourcesContent":["import React from 'react'\nimport { useDeprecation } from '../_hooks/Deprecation'\nimport type { DivAttributes } from '../_utils/types'\nimport { StyledCardContainer } from './Card.styles'\nimport type { CardProps } from './Card.types'\n\n/**\n\n We use cards to display information that is grouped together.\n Cards may contain rich media, text, buttons, and other functionality.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-card--demo)\n\n @see [Design Guidelines](https://design.procore.com/card)\n\n */\nexport const Card = React.forwardRef<HTMLDivElement, DivAttributes & CardProps>(\n function Card(\n {\n children,\n level,\n shadowStrength = 1,\n variant,\n 'aria-orientation': ariaOrientation,\n role,\n ...props\n },\n ref\n ) {\n useDeprecation({\n when: level,\n oldThing: 'level',\n newThing: 'shadowStrength',\n })\n\n const roleAttributes =\n role && role !== 'none' && role !== 'presentation'\n ? { role, 'aria-orientation': ariaOrientation }\n : {}\n\n return (\n <StyledCardContainer\n {...props}\n {...roleAttributes}\n $level={level}\n $shadowStrength={shadowStrength}\n $variant={variant}\n ref={ref}\n >\n {children}\n </StyledCardContainer>\n )\n }\n)\n\nCard.displayName = 'Card'\n"],"mappings":";;;;AAAA,OAAOA,KAAK,M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{ getShadow } from '../_styles/shadows';
|
|
5
5
|
export var StyledCardContainer = /*#__PURE__*/styled.div.withConfig({
|
|
6
6
|
displayName: "StyledCardContainer",
|
|
7
|
-
componentId: "core-
|
|
7
|
+
componentId: "core-12_17_3__sc-2fii7b-0"
|
|
8
8
|
})(["background-color:", ";border-radius:", "px;transition:box-shadow 0.2s ease-in-out;", " ", ""], colors.white, borderRadius.md, function (_ref) {
|
|
9
9
|
var $level = _ref.$level,
|
|
10
10
|
$shadowStrength = _ref.$shadowStrength;
|
|
@@ -51,7 +51,6 @@ export var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(_ref, ref)
|
|
|
51
51
|
className: className,
|
|
52
52
|
style: style
|
|
53
53
|
}, /*#__PURE__*/React.createElement(StyledCheckboxInput, _extends({}, props, fieldProps, {
|
|
54
|
-
"aria-checked": indeterminate ? 'mixed' : checked,
|
|
55
54
|
type: "checkbox",
|
|
56
55
|
checked: checked,
|
|
57
56
|
$error: error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","names":["useLabel","React","Required","StyledCheckboxContainer","StyledCheckboxInput","StyledCheckboxLabel","StyledCheckboxLabelWrapper","StyledFakeCheckboxInput","StyledFakeCheckboxLabel","CheckboxTooltip","Checkbox","forwardRef","_ref","ref","checked","children","className","_ref$error","error","_ref$indeterminate","indeterminate","style","requiredMark","tooltip","props","_objectWithoutProperties","_excluded","_useLabel","_objectSpread","label","fieldProps","labelProps","createElement","_extends","type","$error","$indeterminate","$hasLabel","Boolean","overlay","displayName","FakeCheckbox","_ref2","_ref2$checked","_ref2$disabled","disabled","_ref2$error","_ref2$indeterminate","_excluded2","$checked","$disabled"],"sources":["../../src/Checkbox/Checkbox.tsx"],"sourcesContent":["import { useLabel } from '@react-aria/label'\nimport React from 'react'\nimport { Required } from '../Required/Required'\nimport {\n StyledCheckboxContainer,\n StyledCheckboxInput,\n StyledCheckboxLabel,\n StyledCheckboxLabelWrapper,\n StyledFakeCheckboxInput,\n StyledFakeCheckboxLabel,\n} from './Checkbox.styles'\nimport type { CheckboxProps } from './Checkbox.types'\nimport { CheckboxTooltip } from './CheckboxTooltip'\n\n/**\n\n\n We use checkboxes to provide users with the ability to either select or\n deselect multiple values from a list of options (e.g. items on list pages),\n or to select or deselect a single option (e.g. settings on configure pages).\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-checkbox--demo)\n\n @see [Design Guidelines](https://design.procore.com/checkbox)\n\n */\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(\n {\n checked,\n children,\n className,\n error = false,\n indeterminate = false,\n style,\n requiredMark,\n tooltip,\n ...props\n },\n ref\n ) {\n const { fieldProps, labelProps } = useLabel({\n ...props,\n // to always generate labelProps, so checkbox icon can be clickable for empty labels\n label: true,\n })\n return (\n <StyledCheckboxContainer className={className} style={style}>\n <StyledCheckboxInput\n {...props}\n {...fieldProps}\n
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":["useLabel","React","Required","StyledCheckboxContainer","StyledCheckboxInput","StyledCheckboxLabel","StyledCheckboxLabelWrapper","StyledFakeCheckboxInput","StyledFakeCheckboxLabel","CheckboxTooltip","Checkbox","forwardRef","_ref","ref","checked","children","className","_ref$error","error","_ref$indeterminate","indeterminate","style","requiredMark","tooltip","props","_objectWithoutProperties","_excluded","_useLabel","_objectSpread","label","fieldProps","labelProps","createElement","_extends","type","$error","$indeterminate","$hasLabel","Boolean","overlay","displayName","FakeCheckbox","_ref2","_ref2$checked","_ref2$disabled","disabled","_ref2$error","_ref2$indeterminate","_excluded2","$checked","$disabled"],"sources":["../../src/Checkbox/Checkbox.tsx"],"sourcesContent":["import { useLabel } from '@react-aria/label'\nimport React from 'react'\nimport { Required } from '../Required/Required'\nimport {\n StyledCheckboxContainer,\n StyledCheckboxInput,\n StyledCheckboxLabel,\n StyledCheckboxLabelWrapper,\n StyledFakeCheckboxInput,\n StyledFakeCheckboxLabel,\n} from './Checkbox.styles'\nimport type { CheckboxProps } from './Checkbox.types'\nimport { CheckboxTooltip } from './CheckboxTooltip'\n\n/**\n\n\n We use checkboxes to provide users with the ability to either select or\n deselect multiple values from a list of options (e.g. items on list pages),\n or to select or deselect a single option (e.g. settings on configure pages).\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-checkbox--demo)\n\n @see [Design Guidelines](https://design.procore.com/checkbox)\n\n */\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(\n {\n checked,\n children,\n className,\n error = false,\n indeterminate = false,\n style,\n requiredMark,\n tooltip,\n ...props\n },\n ref\n ) {\n const { fieldProps, labelProps } = useLabel({\n ...props,\n // to always generate labelProps, so checkbox icon can be clickable for empty labels\n label: true,\n })\n return (\n <StyledCheckboxContainer className={className} style={style}>\n <StyledCheckboxInput\n {...props}\n {...fieldProps}\n type=\"checkbox\"\n checked={checked}\n $error={error}\n $indeterminate={indeterminate}\n ref={ref}\n />\n <StyledCheckboxLabelWrapper $hasLabel={Boolean(children)}>\n <StyledCheckboxLabel {...labelProps}>\n {children}\n {requiredMark && <Required />}\n </StyledCheckboxLabel>\n {tooltip && <CheckboxTooltip overlay={tooltip} />}\n </StyledCheckboxLabelWrapper>\n </StyledCheckboxContainer>\n )\n }\n)\n\nCheckbox.displayName = 'Checkbox'\n\n/**\n * This checkbox was created to be used as a non-interactive Checkbox component\n * for VoiceOver inside MenuImperative.CheckboxItem.\n *\n * @since 11.3.0\n */\n\nexport const FakeCheckbox = React.forwardRef<\n HTMLDivElement,\n Omit<CheckboxProps, 'requiredMark' | 'tooltip'>\n>(function FakeCheckbox(\n {\n checked = false,\n children,\n className,\n disabled = false,\n error = false,\n indeterminate = false,\n style,\n ...props\n },\n ref\n) {\n return (\n <StyledCheckboxContainer className={className} style={style}>\n <StyledFakeCheckboxInput\n {...props}\n $checked={checked}\n $disabled={disabled}\n $error={error}\n $indeterminate={indeterminate}\n ref={ref}\n />\n <StyledFakeCheckboxLabel $checked={checked} $disabled={disabled}>\n {children}\n </StyledFakeCheckboxLabel>\n </StyledCheckboxContainer>\n )\n})\n\nFakeCheckbox.displayName = 'FakeCheckbox'\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SACEC,uBAAuB,EACvBC,mBAAmB,EACnBC,mBAAmB,EACnBC,0BAA0B,EAC1BC,uBAAuB,EACvBC,uBAAuB,QAClB,mBAAmB;AAE1B,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,QAAQ,gBAAGT,KAAK,CAACU,UAAU,CACtC,SAASD,QAAQA,CAAAE,IAAA,EAYfC,GAAG,EACH;EAAA,IAXEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAAC,UAAA,GAAAL,IAAA,CACTM,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,KAAK,GAAAA,UAAA;IAAAE,kBAAA,GAAAP,IAAA,CACbQ,aAAa;IAAbA,aAAa,GAAAD,kBAAA,cAAG,KAAK,GAAAA,kBAAA;IACrBE,KAAK,GAAAT,IAAA,CAALS,KAAK;IACLC,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,OAAO,GAAAX,IAAA,CAAPW,OAAO;IACJC,KAAK,GAAAC,wBAAA,CAAAb,IAAA,EAAAc,SAAA;EAIV,IAAAC,SAAA,GAAmC3B,QAAQ,CAAA4B,aAAA,CAAAA,aAAA,KACtCJ,KAAK;MACR;MACAK,KAAK,EAAE;IAAI,EACZ,CAAC;IAJMC,UAAU,GAAAH,SAAA,CAAVG,UAAU;IAAEC,UAAU,GAAAJ,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AALA,KAAK,GAAA4B,WAAA,cAAG,KAAK,GAAAA,WAAA;IAAAC,mBAAA,GAAAL,KAAA,CACbtB,aAAa;IAAbA,aAAa,GAAA2B,mBAAA,cAAG,KAAK,GAAAA,mBAAA;IACrB1B,KAAK,GAAAqB,KAAA,CAALrB,KAAK;IACFG,KAAK,GAAAC,wBAAA,CAAAiB,KAAA,EAAAM,UAAA;EAIV,oBACE/C,KAAA,CAAA+B,aAAA,CAAC7B,uBAAuB;IAACa,SAAS,EAAEA,SAAU;IAACK,KAAK,EAAEA;EAAM,gBAC1DpB,KAAA,CAAA+B,aAAA,CAACzB,uBAAuB,EAAA0B,QAAA,KAClBT,KAAK;IACTyB,QAAQ,EAAEnC,OAAQ;IAClBoC,SAAS,EAAEL,QAAS;IACpBV,MAAM,EAAEjB,KAAM;IACdkB,cAAc,EAAEhB,aAAc;IAC9BP,GAAG,EAAEA;EAAI,EACV,CAAC,eACFZ,KAAA,CAAA+B,aAAA,CAACxB,uBAAuB;IAACyC,QAAQ,EAAEnC,OAAQ;IAACoC,SAAS,EAAEL;EAAS,GAC7D9B,QACsB,CACF,CAAC;AAE9B,CAAC,CAAC;AAEF0B,YAAY,CAACD,WAAW,GAAG,cAAc"}
|
|
@@ -9,7 +9,7 @@ export var dataQa = {
|
|
|
9
9
|
export var checkboxSize = 20;
|
|
10
10
|
export var StyledCheckboxContainer = /*#__PURE__*/styled.div.withConfig({
|
|
11
11
|
displayName: "StyledCheckboxContainer",
|
|
12
|
-
componentId: "core-
|
|
12
|
+
componentId: "core-12_17_3__sc-u63tye-0"
|
|
13
13
|
})(["color:", ";display:block;position:relative;& + &{margin-top:", "px;}"], colors.gray15, spacing.md);
|
|
14
14
|
function StyledIndeterminate() {
|
|
15
15
|
return css(["background-color:", ";content:'';height:2px;left:5px;position:absolute;top:9px;width:10px;border:none;"], colors.white);
|
|
@@ -48,18 +48,18 @@ function StyledFakeIndeterminate() {
|
|
|
48
48
|
}
|
|
49
49
|
export var StyledCheckboxLabelWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
50
50
|
displayName: "StyledCheckboxLabelWrapper",
|
|
51
|
-
componentId: "core-
|
|
51
|
+
componentId: "core-12_17_3__sc-u63tye-1"
|
|
52
52
|
})(["padding-left:", "px;min-height:", "px;position:relative;", ""], function (_ref) {
|
|
53
53
|
var $hasLabel = _ref.$hasLabel;
|
|
54
54
|
return $hasLabel ? checkboxSize + spacing.md : checkboxSize;
|
|
55
55
|
}, checkboxSize, getTypographyIntent('body'));
|
|
56
56
|
export var StyledCheckboxLabel = /*#__PURE__*/styled.label.withConfig({
|
|
57
57
|
displayName: "StyledCheckboxLabel",
|
|
58
|
-
componentId: "core-
|
|
58
|
+
componentId: "core-12_17_3__sc-u63tye-2"
|
|
59
59
|
})(["user-select:none;&:before{background-color:", ";border-radius:2px;border:2px solid ", ";content:'';display:inline-block;height:", "px;width:", "px;min-width:", "px;top:0;left:0;position:absolute;}"], colors.white, colors.gray70, checkboxSize, checkboxSize, checkboxSize);
|
|
60
60
|
export var StyledCheckboxInput = /*#__PURE__*/styled.input.withConfig({
|
|
61
61
|
displayName: "StyledCheckboxInput",
|
|
62
|
-
componentId: "core-
|
|
62
|
+
componentId: "core-12_17_3__sc-u63tye-3"
|
|
63
63
|
})(["left:0;opacity:0;position:absolute;top:0;&:disabled:checked + ", " > ", ":before{background-color:", ";border-color:", ";}&:disabled + ", " > ", ":before{background-color:", ";border-color:", ";}", " &:checked + ", " > ", "{&:before{background-color:", ";border-color:", ";color:", ";}&:after{", "}}&:focus:not(:disabled),&[data-qa=", "]:not(:disabled){+ ", " > ", ":before{", "}}", ""], StyledCheckboxLabelWrapper, StyledCheckboxLabel, colors.blue85, colors.blue85, StyledCheckboxLabelWrapper, StyledCheckboxLabel, function (_ref2) {
|
|
64
64
|
var $indeterminate = _ref2.$indeterminate;
|
|
65
65
|
return $indeterminate ? colors.gray85 : colors.white;
|
|
@@ -83,7 +83,7 @@ export var StyledCheckboxInput = /*#__PURE__*/styled.input.withConfig({
|
|
|
83
83
|
});
|
|
84
84
|
export var StyledFakeCheckboxLabel = /*#__PURE__*/styled.span.withConfig({
|
|
85
85
|
displayName: "StyledFakeCheckboxLabel",
|
|
86
|
-
componentId: "core-
|
|
86
|
+
componentId: "core-12_17_3__sc-u63tye-4"
|
|
87
87
|
})(["", " display:block;min-height:", "px;padding-left:", "px;position:relative;user-select:none;cursor:pointer;", ""], getTypographyIntent('body'), checkboxSize, function (_ref7) {
|
|
88
88
|
var children = _ref7.children;
|
|
89
89
|
return children ? checkboxSize + spacing.md : checkboxSize;
|
|
@@ -99,7 +99,7 @@ export var StyledFakeCheckboxLabel = /*#__PURE__*/styled.span.withConfig({
|
|
|
99
99
|
});
|
|
100
100
|
export var StyledFakeCheckboxInput = /*#__PURE__*/styled.div.withConfig({
|
|
101
101
|
displayName: "StyledFakeCheckboxInput",
|
|
102
|
-
componentId: "core-
|
|
102
|
+
componentId: "core-12_17_3__sc-u63tye-5"
|
|
103
103
|
})(["width:", "px;height:", "px;border-radius:2px;border:2px solid ", ";position:absolute;", " ", " ", " ", ""], checkboxSize, checkboxSize, colors.gray70, function (_ref9) {
|
|
104
104
|
var $checked = _ref9.$checked,
|
|
105
105
|
$disabled = _ref9.$disabled,
|
|
@@ -21,6 +21,6 @@ export var CheckboxTooltip = function CheckboxTooltip(props) {
|
|
|
21
21
|
};
|
|
22
22
|
var StyledCheckboxTooltipIcon = /*#__PURE__*/styled(Help).withConfig({
|
|
23
23
|
displayName: "StyledCheckboxTooltipIcon",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_17_3__sc-1qa1ncf-0"
|
|
25
25
|
})(["margin-left:", "px;color:", ";vertical-align:middle;&:focus-visible{border-radius:50%;", " outline-offset:0;}"], spacing.sm, colors.gray45, getGapOutlineFocus);
|
|
26
26
|
//# sourceMappingURL=CheckboxTooltip.js.map
|
|
@@ -7,23 +7,23 @@ import { getLineClamp } from '../_styles/mixins';
|
|
|
7
7
|
import { spacing } from '../_styles/spacing';
|
|
8
8
|
export var ContactItemAvatarWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
9
9
|
displayName: "ContactItemAvatarWrapper",
|
|
10
|
-
componentId: "core-
|
|
10
|
+
componentId: "core-12_17_3__sc-1c4z9pn-0"
|
|
11
11
|
})(["display:inline-flex;align-self:flex-start;"]);
|
|
12
12
|
export var ContactItemAvatar = /*#__PURE__*/styled(Avatar).withConfig({
|
|
13
13
|
displayName: "ContactItemAvatar",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_17_3__sc-1c4z9pn-1"
|
|
15
15
|
})(["cursor:inherit;font-weight:", ";"], typographyWeights.bold);
|
|
16
16
|
export var ContactItemTextWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
17
17
|
displayName: "ContactItemTextWrapper",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_17_3__sc-1c4z9pn-2"
|
|
19
19
|
})(["overflow:hidden;margin-left:", "px;"], spacing.sm);
|
|
20
20
|
export var ContactItemText = /*#__PURE__*/styled(Typography).withConfig({
|
|
21
21
|
displayName: "ContactItemText",
|
|
22
|
-
componentId: "core-
|
|
22
|
+
componentId: "core-12_17_3__sc-1c4z9pn-3"
|
|
23
23
|
})(["display:flex;", ""], getLineClamp());
|
|
24
24
|
export var ContactItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
25
25
|
displayName: "ContactItemWrapper",
|
|
26
|
-
componentId: "core-
|
|
26
|
+
componentId: "core-12_17_3__sc-1c4z9pn-4"
|
|
27
27
|
})(["display:flex;flex-direction:row;align-items:center;padding:", "px ", "px ", "px ", "px;", " ", " ", ""], spacing.sm, spacing.lg, spacing.sm, spacing.sm, function (_ref) {
|
|
28
28
|
var $disabled = _ref.$disabled,
|
|
29
29
|
$clickable = _ref.$clickable;
|
|
@@ -5,10 +5,10 @@ import { mediaIE11Hack } from '../_styles/media';
|
|
|
5
5
|
import { spacing } from '../_styles/spacing';
|
|
6
6
|
export var StyledContent = /*#__PURE__*/styled(Box).withConfig({
|
|
7
7
|
displayName: "StyledContent",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_17_3__sc-10y57gh-0"
|
|
9
9
|
})(["> * + *,> * + h1,> * + h2,> * + h3,> * + h4,> * + p,> * + ul,> * + ol{margin-top:", "px;}> ", " + *{margin-top:0;}> ", ",> ", " > ", ",> ", "{", "{min-height:0;margin-bottom:", "px;}&:last-child ", "{margin-bottom:0;}}"], spacing.lg, StyledFormRow, StyledFormRow, StyledForm, StyledFormRow, StyledFormRow, StyledFormFieldBanner, spacing.md, StyledFormFieldBanner);
|
|
10
10
|
export var StyledActions = /*#__PURE__*/styled(Box).withConfig({
|
|
11
11
|
displayName: "StyledActions",
|
|
12
|
-
componentId: "core-
|
|
12
|
+
componentId: "core-12_17_3__sc-10y57gh-1"
|
|
13
13
|
})(["display:flex;justify-content:flex-end;gap:", "px;@media ", "{& > * + *{margin-left:", "px;}}"], spacing.sm, mediaIE11Hack, spacing.sm);
|
|
14
14
|
//# sourceMappingURL=Content.styles.js.map
|
|
@@ -14,15 +14,15 @@ var inputHeight = 36; // TODO one-off
|
|
|
14
14
|
var disabledCss = /*#__PURE__*/css(["background-color:", ";color:", ";border-width:1px;border-style:solid;border-color:", ";pointer-events:none;svg{color:", ";}"], colors.gray94, colors.gray45, colors.gray70, colors.gray45);
|
|
15
15
|
export var StyledCalendar = /*#__PURE__*/styled(Calendar).withConfig({
|
|
16
16
|
displayName: "StyledCalendar",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_17_3__sc-w10btf-0"
|
|
18
18
|
})(["color:", ";"], colors.gray45);
|
|
19
19
|
export var StyledDateSegmentsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
20
20
|
displayName: "StyledDateSegmentsContainer",
|
|
21
|
-
componentId: "core-
|
|
21
|
+
componentId: "core-12_17_3__sc-w10btf-1"
|
|
22
22
|
})(["min-width:104px;display:flex;gap:", "px;"], spacing.xs);
|
|
23
23
|
export var StyledDateInputSegment = /*#__PURE__*/styled.div.withConfig({
|
|
24
24
|
displayName: "StyledDateInputSegment",
|
|
25
|
-
componentId: "core-
|
|
25
|
+
componentId: "core-12_17_3__sc-w10btf-2"
|
|
26
26
|
})(["", " outline:none;text-align:center;&:focus{background-color:", ";}&::selection{background-color:transparent;}&[data-placeholder='true']{color:", ";}"], getTypographyIntent('body'), colors.blue96, function (_ref) {
|
|
27
27
|
var disabled = _ref.disabled;
|
|
28
28
|
return disabled ? colors.gray70 : colors.gray45;
|
|
@@ -31,15 +31,15 @@ export var StyledDateInputDelimiter = /*#__PURE__*/styled.span.attrs(function (p
|
|
|
31
31
|
return _defineProperty({}, 'data-qa-table-visible', props.visible);
|
|
32
32
|
}).withConfig({
|
|
33
33
|
displayName: "StyledDateInputDelimiter",
|
|
34
|
-
componentId: "core-
|
|
34
|
+
componentId: "core-12_17_3__sc-w10btf-3"
|
|
35
35
|
})(["", " user-select:none;"], getTypographyIntent('body'));
|
|
36
36
|
export var StyledDateInputIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
37
37
|
displayName: "StyledDateInputIconContainer",
|
|
38
|
-
componentId: "core-
|
|
38
|
+
componentId: "core-12_17_3__sc-w10btf-4"
|
|
39
39
|
})(["display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;margin:0 0 0 ", "px;height:24px;width:24px;"], spacing.xs);
|
|
40
40
|
export var StyledDateInput = /*#__PURE__*/styled.div.withConfig({
|
|
41
41
|
displayName: "StyledDateInput",
|
|
42
|
-
componentId: "core-
|
|
42
|
+
componentId: "core-12_17_3__sc-w10btf-5"
|
|
43
43
|
})(["align-items:center;border-color:", ";border-radius:4px;border-style:solid;border-width:1px;display:inline-flex;flex-direction:row;height:", "px;justify-content:center;padding:0 ", "px 0 ", "px;&::placeholder{color:", ";}", " &:focus-within,&[data-qa=", "]{", ";}&:disabled{", "}", " ", ""], colors.gray70, inputHeight, spacing.xs, spacing.sm, colors.gray45, function (_ref3) {
|
|
44
44
|
var error = _ref3.error;
|
|
45
45
|
return !error && css(["&:hover,&[data-qa=", "]{border-color:", ";}"], dataQa.hovered, colors.gray45);
|
|
@@ -8,32 +8,32 @@ import { colors } from '../_styles/colors';
|
|
|
8
8
|
import { spacing } from '../_styles/spacing';
|
|
9
9
|
export var StyledDetailPage = /*#__PURE__*/styled.div.withConfig({
|
|
10
10
|
displayName: "StyledDetailPage",
|
|
11
|
-
componentId: "core-
|
|
11
|
+
componentId: "core-12_17_3__sc-cytnlo-0"
|
|
12
12
|
})(["background-color:", ";height:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:space-between;"], colors.gray96);
|
|
13
13
|
export var StyledDetailPageBody = /*#__PURE__*/styled.div.withConfig({
|
|
14
14
|
displayName: "StyledDetailPageBody",
|
|
15
|
-
componentId: "core-
|
|
15
|
+
componentId: "core-12_17_3__sc-cytnlo-1"
|
|
16
16
|
})(["padding-bottom:", "px;"], spacing.xl);
|
|
17
17
|
export var StyledDetailPageFooterNotation = /*#__PURE__*/styled.div.withConfig({
|
|
18
18
|
displayName: "StyledDetailPageFooterNotation",
|
|
19
|
-
componentId: "core-
|
|
19
|
+
componentId: "core-12_17_3__sc-cytnlo-2"
|
|
20
20
|
})(["flex-grow:1;z-index:1;"]);
|
|
21
21
|
export var StyledDetailPageFooter = /*#__PURE__*/styled(Page.Footer).withConfig({
|
|
22
22
|
displayName: "StyledDetailPageFooter",
|
|
23
|
-
componentId: "core-
|
|
23
|
+
componentId: "core-12_17_3__sc-cytnlo-3"
|
|
24
24
|
})(["display:flex;padding:", "px 0;background-color:", ";justify-content:center;"], spacing.lg, colors.white);
|
|
25
25
|
export var StyledDetailPageFooterActions = /*#__PURE__*/styled(Box).withConfig({
|
|
26
26
|
displayName: "StyledDetailPageFooterActions",
|
|
27
|
-
componentId: "core-
|
|
27
|
+
componentId: "core-12_17_3__sc-cytnlo-4"
|
|
28
28
|
})(["", ""], getActions());
|
|
29
29
|
var maxFooterContentWidth = 1920;
|
|
30
30
|
export var StyledDetailPageFooterContent = /*#__PURE__*/styled.div.withConfig({
|
|
31
31
|
displayName: "StyledDetailPageFooterContent",
|
|
32
|
-
componentId: "core-
|
|
32
|
+
componentId: "core-12_17_3__sc-cytnlo-5"
|
|
33
33
|
})(["width:100%;align-items:center;display:flex;justify-content:flex-end;padding:0 ", "px;max-width:", "px;"], spacing.xl, maxFooterContentWidth);
|
|
34
34
|
var detailPageCardBorderRadius = 8;
|
|
35
35
|
export var StyledDetailPageCard = /*#__PURE__*/styled(Card).withConfig({
|
|
36
36
|
displayName: "StyledDetailPageCard",
|
|
37
|
-
componentId: "core-
|
|
37
|
+
componentId: "core-12_17_3__sc-cytnlo-6"
|
|
38
38
|
})(["width:100%;border-radius:", "px;margin-top:", "px;margin-bottom:", "px;& + &{margin-top:", "px;}&:first-child{margin-top:0;}&:last-child{margin-bottom:", "px;}& > ", "{padding:", "px ", "px 0 ", "px;max-width:100%;&:empty{padding:0;}}& > ", " + ", " > ", "{border-top:0;}> .", ":first-child + .", ",> ", " + .", " + .", "{margin-top:", "px;}"], detailPageCardBorderRadius, spacing.lg, spacing.sm, spacing.sm, spacing.lg, StyledPageBanner, spacing.lg, spacing.lg, spacing.lg, StyledPageBanner, StyledSection, StyledSectionInner, sectionClassnames.levelAnonymous, sectionClassnames.level(2), StyledPageBanner, sectionClassnames.levelAnonymous, sectionClassnames.level(2), spacing.xxl * -1);
|
|
39
39
|
//# sourceMappingURL=DetailPage.styles.js.map
|
|
@@ -5,15 +5,15 @@ import { Card } from '../Card/Card';
|
|
|
5
5
|
import { Spinner } from '../Spinner/Spinner';
|
|
6
6
|
export var StyledDropdownMenu = /*#__PURE__*/styled(Card).withConfig({
|
|
7
7
|
displayName: "StyledDropdownMenu",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_17_3__sc-ufsy2q-0"
|
|
9
9
|
})(["display:flex;max-height:40vh;max-width:248px;min-width:inherit;"]);
|
|
10
10
|
export var StyledDropdownSpinner = /*#__PURE__*/styled(Spinner).withConfig({
|
|
11
11
|
displayName: "StyledDropdownSpinner",
|
|
12
|
-
componentId: "core-
|
|
12
|
+
componentId: "core-12_17_3__sc-ufsy2q-1"
|
|
13
13
|
})(["margin:0 6px;"]);
|
|
14
14
|
export var StyledDropdownButton = /*#__PURE__*/styled(Button).withConfig({
|
|
15
15
|
displayName: "StyledDropdownButton",
|
|
16
|
-
componentId: "core-
|
|
16
|
+
componentId: "core-12_17_3__sc-ufsy2q-2"
|
|
17
17
|
})(["pointer-events:", ";", ""], function (_ref) {
|
|
18
18
|
var disabled = _ref.disabled,
|
|
19
19
|
$loading = _ref.$loading;
|
|
@@ -6,18 +6,18 @@ import { getEllipsis } from '../_styles/mixins';
|
|
|
6
6
|
import { spacing } from '../_styles/spacing';
|
|
7
7
|
export var StyledDropdownFlyout = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledDropdownFlyout",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_17_3__sc-1i79jsg-0"
|
|
10
10
|
})(["display:flex;flex-wrap:wrap;flex-direction:column;width:100%;max-height:855px;padding:", "px 0;"], spacing.sm);
|
|
11
11
|
export var StyledDropdownFlyoutItem = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledDropdownFlyoutItem",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_17_3__sc-1i79jsg-1"
|
|
14
14
|
})(["display:flex;justify-content:space-between;cursor:pointer;width:100%;padding:", "px ", "px;color:", ";", " &[data-highlighted='true'],&:hover{background-color:", ";}"], spacing.xs, spacing.lg, colors.gray20, getTypographyIntent('body'), colors.gray96);
|
|
15
15
|
export var StyledDropdownFlyoutLabel = /*#__PURE__*/styled.span.withConfig({
|
|
16
16
|
displayName: "StyledDropdownFlyoutLabel",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_17_3__sc-1i79jsg-2"
|
|
18
18
|
})(["", ""], getEllipsis());
|
|
19
19
|
export var StyledDropdownFlyoutExpandIcon = /*#__PURE__*/styled.span.withConfig({
|
|
20
20
|
displayName: "StyledDropdownFlyoutExpandIcon",
|
|
21
|
-
componentId: "core-
|
|
21
|
+
componentId: "core-12_17_3__sc-1i79jsg-3"
|
|
22
22
|
})(["position:relative;display:inline-flex;align-self:center;flex-shrink:0;margin-left:", "px;white-space:nowrap;", ""], spacing.lg, arrowRight(4, 'black'));
|
|
23
23
|
//# sourceMappingURL=DropdownFlyout.styles.js.map
|
|
@@ -25,7 +25,7 @@ import { partition } from '../_utils/partition';
|
|
|
25
25
|
import { MultipleErrors } from './Dropzone';
|
|
26
26
|
import { StyledErrorBannerDetails } from './Dropzone.styles';
|
|
27
27
|
import { dropErrors, fileRejectionReason } from './Dropzone.types';
|
|
28
|
-
import { isZeroSize } from './Dropzone.utils';
|
|
28
|
+
import { getFileDetail, isZeroSize } from './Dropzone.utils';
|
|
29
29
|
var oneDropAtATimeRejectionReason = 'one-drop-at-a-time';
|
|
30
30
|
var dropErrorsByReason = (_dropErrorsByReason = {}, _defineProperty(_dropErrorsByReason, fileRejectionReason.maxFiles, dropErrors.fileAmount), _defineProperty(_dropErrorsByReason, fileRejectionReason.maxFileSize, dropErrors.maxFileSize), _defineProperty(_dropErrorsByReason, fileRejectionReason.minFileSize, dropErrors.minFileSize), _defineProperty(_dropErrorsByReason, fileRejectionReason.fileType, dropErrors.fileType), _dropErrorsByReason);
|
|
31
31
|
var getSizeInMB = function getSizeInMB(maxSize) {
|
|
@@ -77,10 +77,10 @@ export var useDropzone = function useDropzone() {
|
|
|
77
77
|
};
|
|
78
78
|
var dropErrorReducer = function dropErrorReducer(state, action) {
|
|
79
79
|
var rejectedFiles = /*#__PURE__*/React.createElement(StyledErrorBannerDetails, null, fileRejections.map(function (_ref2) {
|
|
80
|
-
var
|
|
80
|
+
var file = _ref2.file;
|
|
81
81
|
return /*#__PURE__*/React.createElement("li", {
|
|
82
|
-
key: name
|
|
83
|
-
},
|
|
82
|
+
key: file.name
|
|
83
|
+
}, getFileDetail(file));
|
|
84
84
|
}));
|
|
85
85
|
var title = I18n.t('core.dropzone.errorTitle');
|
|
86
86
|
switch (action) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropzone.hooks.js","names":["React","useDropzone","useDropzoneBase","useI18nContext","partition","MultipleErrors","StyledErrorBannerDetails","dropErrors","fileRejectionReason","isZeroSize","oneDropAtATimeRejectionReason","dropErrorsByReason","_dropErrorsByReason","_defineProperty","maxFiles","fileAmount","maxFileSize","minFileSize","fileType","getSizeInMB","maxSize","_ref","arguments","length","undefined","_ref$value","value","_ref$disabled","disabled","_ref$multiple","multiple","_ref$noClick","noClick","_ref$noKeyboard","noKeyboard","onDragEnter","onDragOver","onDragLeave","onDropRejected","minSize","_ref$maxFileNumber","maxFileNumber","Infinity","_onDrop","onDrop","onDropAccepted","props","_objectWithoutProperties","_excluded","I18n","_React$useState","useState","_React$useState2","_slicedToArray","acceptedFiles","setAcceptedFiles","_React$useState3","_React$useState4","fileRejections","setFileRejections","maxFilesRemaining","defaultDropError","type","reset","title","message","dropErrorReducer","state","action","rejectedFiles","createElement","map","_ref2","name","file","key","t","oneFileAtATime","body","sizeInMegabytes","multipleErrors","_objectSpread","withOneDropAtATimeError","errors","code","_React$useReducer","useReducer","_React$useReducer2","dropError","dispatchDropError","useCallback","event","droppedFiles","concat","_toConsumableArray","rej","allFilesWithRejections","_ref3","i","_partition","_ref4","_partition2","actualAcceptedFiles_","actualRejectedFiles","actualAcceptedFiles","_ref5","errorCodes","flatMap","rejection","error","hasMultipleErrors","Set","size","_useDropzoneBase","getRootProps","getInputProps","isDragActive","isFileDialogActive","isDragReject","isFocused","isDragAccept","draggedFiles","open","rootRef","inputRef","dragError","useMemo","getFileTypeError","count","getFileAmountError","fileLimit","amountError"],"sources":["../../src/Dropzone/Dropzone.hooks.tsx"],"sourcesContent":["import React from 'react'\nimport type { DropEvent, DropzoneOptions } from 'react-dropzone'\nimport { useDropzone as useDropzoneBase } from 'react-dropzone'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { partition } from '../_utils/partition'\nimport { MultipleErrors } from './Dropzone'\nimport { StyledErrorBannerDetails } from './Dropzone.styles'\nimport type {\n DropError,\n DropErrorType,\n DropzoneHookProps,\n DropzoneHookState,\n FileRejection,\n FileRejectionReason,\n} from './Dropzone.types'\nimport { dropErrors, fileRejectionReason } from './Dropzone.types'\nimport { isZeroSize } from './Dropzone.utils'\n\nconst oneDropAtATimeRejectionReason = 'one-drop-at-a-time'\n\nconst dropErrorsByReason: Record<FileRejectionReason, DropErrorType> = {\n [fileRejectionReason.maxFiles]: dropErrors.fileAmount,\n [fileRejectionReason.maxFileSize]: dropErrors.maxFileSize,\n [fileRejectionReason.minFileSize]: dropErrors.minFileSize,\n [fileRejectionReason.fileType]: dropErrors.fileType,\n}\n\nconst getSizeInMB = (maxSize: number): number => maxSize / 10e5\n\n/**\n * WARNING:\n * Use ACCEPT prop carefully, because mime type determination is not reliable across platforms.\n * Details: https://github.com/react-dropzone/react-dropzone/tree/master/examples/accept#browser-limitations\n */\nexport const useDropzone = ({\n value = [],\n disabled = false,\n multiple = false,\n noClick = true,\n noKeyboard = true,\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDropRejected,\n maxFileSize: maxSize,\n minFileSize: minSize,\n maxFileNumber = Infinity,\n onDrop: _onDrop,\n onDropAccepted,\n ...props\n}: DropzoneHookProps = {}): DropzoneHookState => {\n const I18n = useI18nContext()\n const [acceptedFiles, setAcceptedFiles] = React.useState<File[]>([])\n const [fileRejections, setFileRejections] = React.useState<FileRejection[]>(\n []\n )\n\n const maxFilesRemaining = maxFileNumber - value.length\n\n const defaultDropError = {\n type: dropErrors.reset,\n title: '',\n message: '',\n }\n\n const dropErrorReducer = (\n state: DropError,\n action: DropErrorType\n ): DropError => {\n const rejectedFiles = (\n <StyledErrorBannerDetails>\n {fileRejections.map(({ file: { name } }) => (\n <li key={name}>{name}</li>\n ))}\n </StyledErrorBannerDetails>\n )\n const title = I18n.t('core.dropzone.errorTitle')\n\n switch (action) {\n case dropErrors.oneFileAtATime:\n return {\n type: dropErrors.oneFileAtATime,\n title: '',\n message: I18n.t('core.dropzone.oneFileAtATimeError'),\n }\n case dropErrors.fileAmount:\n return {\n type: dropErrors.fileAmount,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileNumberError', {\n maxFiles: maxFileNumber,\n }),\n body: rejectedFiles,\n }\n case dropErrors.fileType:\n return {\n type: dropErrors.fileType,\n title,\n message: I18n.t('core.dropzone.standaloneUnsupportedFileTypeError'),\n body: rejectedFiles,\n }\n case dropErrors.maxFileSize:\n return {\n type: dropErrors.maxFileSize,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileSizeError', {\n sizeInMegabytes: getSizeInMB(maxSize as number),\n }),\n body: rejectedFiles,\n }\n case dropErrors.minFileSize:\n const message = isZeroSize(minSize)\n ? I18n.t('core.dropzone.standaloneZeroFileSizeError')\n : I18n.t('core.dropzone.standaloneMinFileSizeError', {\n sizeInMegabytes: getSizeInMB(minSize as number),\n })\n\n return {\n type: dropErrors.minFileSize,\n title,\n message,\n body: rejectedFiles,\n }\n case dropErrors.multipleErrors:\n return {\n type: dropErrors.multipleErrors,\n title,\n message: I18n.t('core.dropzone.multipleErrorsMessage'),\n body: (\n <MultipleErrors\n fileRejections={fileRejections}\n maxFiles={maxFileNumber}\n maxSize={maxSize}\n minSize={minSize}\n />\n ),\n }\n case dropErrors.reset:\n return { ...defaultDropError }\n default:\n return state\n }\n }\n\n const withOneDropAtATimeError = (file: File) => ({\n file,\n errors: [\n {\n message: I18n.t('core.dropzone.oneDropAtATimeError'),\n code: oneDropAtATimeRejectionReason as FileRejectionReason,\n },\n ],\n })\n\n const [dropError, dispatchDropError] = React.useReducer<\n React.Reducer<DropError, DropErrorType>\n >(dropErrorReducer, { ...defaultDropError })\n\n const onDrop: DropzoneOptions['onDrop'] = React.useCallback(\n (\n acceptedFiles: File[],\n rejectedFiles: FileRejection[],\n event: DropEvent\n ) => {\n dispatchDropError(dropErrors.reset)\n\n const droppedFiles = [\n ...acceptedFiles,\n ...rejectedFiles.map((rej) => rej.file),\n ]\n if (!multiple && droppedFiles.length > 1) {\n dispatchDropError(dropErrors.oneFileAtATime)\n onDropRejected?.(droppedFiles.map(withOneDropAtATimeError), event)\n return\n }\n\n const allFilesWithRejections = [\n ...acceptedFiles.map((file) => ({ file, errors: [] })),\n ...rejectedFiles,\n ].map(({ file, errors }, i) => ({\n file,\n errors:\n i < maxFilesRemaining\n ? errors\n : [...errors, { message: '', code: fileRejectionReason.maxFiles }],\n }))\n\n const [actualAcceptedFiles_, actualRejectedFiles] =\n partition<FileRejection>(\n ({ errors }) => errors.length === 0,\n allFilesWithRejections\n )\n\n const actualAcceptedFiles = actualAcceptedFiles_.map(({ file }) => file)\n\n _onDrop?.(actualAcceptedFiles, actualRejectedFiles, event)\n\n setAcceptedFiles(actualAcceptedFiles)\n setFileRejections(actualRejectedFiles)\n\n if (actualAcceptedFiles.length) {\n onDropAccepted?.(actualAcceptedFiles, event)\n }\n\n if (actualRejectedFiles.length) {\n onDropRejected?.(actualRejectedFiles, event)\n }\n\n const errorCodes = actualRejectedFiles\n .flatMap((rejection) => rejection.errors)\n .map((error) => error.code)\n const hasMultipleErrors = new Set([...errorCodes]).size > 1\n\n if (hasMultipleErrors) {\n dispatchDropError(dropErrors.multipleErrors)\n } else {\n dispatchDropError(dropErrorsByReason[errorCodes[0]])\n }\n },\n [_onDrop, maxFilesRemaining, onDropRejected, onDropAccepted, multiple]\n )\n\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n open,\n rootRef,\n inputRef,\n } = useDropzoneBase({\n ...props,\n disabled,\n minSize,\n maxSize,\n multiple,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n noClick,\n noKeyboard,\n })\n\n const dragError = React.useMemo(() => {\n const getFileTypeError = () => {\n return isDragReject\n ? I18n.t('core.dropzone.incorrectFileTypeMessage', {\n count: draggedFiles.length,\n })\n : ''\n }\n\n const getFileAmountError = () => {\n const fileLimit = multiple ? maxFilesRemaining : 1\n\n const amountError = multiple\n ? I18n.t('core.dropzone.invalidAmountAttachments', {\n count: maxFileNumber,\n })\n : I18n.t('core.dropzone.incorrectFileNumber')\n\n return draggedFiles.length > fileLimit ? amountError : ''\n }\n\n return getFileAmountError() || getFileTypeError()\n }, [\n I18n,\n draggedFiles.length,\n maxFilesRemaining,\n isDragReject,\n maxFileNumber,\n multiple,\n ])\n\n return {\n getRootProps,\n getInputProps,\n\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n acceptedFiles,\n fileRejections,\n\n open,\n rootRef,\n inputRef,\n\n multiple,\n dragError,\n dropError,\n dispatchDropError,\n disabled,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,IAAIC,eAAe,QAAQ,gBAAgB;AAC/D,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,cAAc,QAAQ,YAAY;AAC3C,SAASC,wBAAwB,QAAQ,mBAAmB;AAS5D,SAASC,UAAU,EAAEC,mBAAmB,QAAQ,kBAAkB;AAClE,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,IAAMC,6BAA6B,GAAG,oBAAoB;AAE1D,IAAMC,kBAA8D,IAAAC,mBAAA,OAAAC,eAAA,CAAAD,mBAAA,EACjEJ,mBAAmB,CAACM,QAAQ,EAAGP,UAAU,CAACQ,UAAU,GAAAF,eAAA,CAAAD,mBAAA,EACpDJ,mBAAmB,CAACQ,WAAW,EAAGT,UAAU,CAACS,WAAW,GAAAH,eAAA,CAAAD,mBAAA,EACxDJ,mBAAmB,CAACS,WAAW,EAAGV,UAAU,CAACU,WAAW,GAAAJ,eAAA,CAAAD,mBAAA,EACx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AAC,EAAE,CACD9E,IAAI,EACJwE,YAAY,CAAClG,MAAM,EACnBqC,iBAAiB,EACjB0D,YAAY,EACZ7E,aAAa,EACbX,QAAQ,CACT,CAAC;EAEF,OAAO;IACLoF,YAAY,EAAZA,YAAY;IACZC,aAAa,EAAbA,aAAa;IAEbC,YAAY,EAAZA,YAAY;IACZC,kBAAkB,EAAlBA,kBAAkB;IAClBC,YAAY,EAAZA,YAAY;IACZC,SAAS,EAATA,SAAS;IACTC,YAAY,EAAZA,YAAY;IACZC,YAAY,EAAZA,YAAY;IACZnE,aAAa,EAAbA,aAAa;IACbI,cAAc,EAAdA,cAAc;IAEdgE,IAAI,EAAJA,IAAI;IACJC,OAAO,EAAPA,OAAO;IACPC,QAAQ,EAARA,QAAQ;IAER9F,QAAQ,EAARA,QAAQ;IACR+F,SAAS,EAATA,SAAS;IACTrC,SAAS,EAATA,SAAS;IACTC,iBAAiB,EAAjBA,iBAAiB;IACjB7D,QAAQ,EAARA;EACF,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"Dropzone.hooks.js","names":["React","useDropzone","useDropzoneBase","useI18nContext","partition","MultipleErrors","StyledErrorBannerDetails","dropErrors","fileRejectionReason","getFileDetail","isZeroSize","oneDropAtATimeRejectionReason","dropErrorsByReason","_dropErrorsByReason","_defineProperty","maxFiles","fileAmount","maxFileSize","minFileSize","fileType","getSizeInMB","maxSize","_ref","arguments","length","undefined","_ref$value","value","_ref$disabled","disabled","_ref$multiple","multiple","_ref$noClick","noClick","_ref$noKeyboard","noKeyboard","onDragEnter","onDragOver","onDragLeave","onDropRejected","minSize","_ref$maxFileNumber","maxFileNumber","Infinity","_onDrop","onDrop","onDropAccepted","props","_objectWithoutProperties","_excluded","I18n","_React$useState","useState","_React$useState2","_slicedToArray","acceptedFiles","setAcceptedFiles","_React$useState3","_React$useState4","fileRejections","setFileRejections","maxFilesRemaining","defaultDropError","type","reset","title","message","dropErrorReducer","state","action","rejectedFiles","createElement","map","_ref2","file","key","name","t","oneFileAtATime","body","sizeInMegabytes","multipleErrors","_objectSpread","withOneDropAtATimeError","errors","code","_React$useReducer","useReducer","_React$useReducer2","dropError","dispatchDropError","useCallback","event","droppedFiles","concat","_toConsumableArray","rej","allFilesWithRejections","_ref3","i","_partition","_ref4","_partition2","actualAcceptedFiles_","actualRejectedFiles","actualAcceptedFiles","_ref5","errorCodes","flatMap","rejection","error","hasMultipleErrors","Set","size","_useDropzoneBase","getRootProps","getInputProps","isDragActive","isFileDialogActive","isDragReject","isFocused","isDragAccept","draggedFiles","open","rootRef","inputRef","dragError","useMemo","getFileTypeError","count","getFileAmountError","fileLimit","amountError"],"sources":["../../src/Dropzone/Dropzone.hooks.tsx"],"sourcesContent":["import React from 'react'\nimport type { DropEvent, DropzoneOptions } from 'react-dropzone'\nimport { useDropzone as useDropzoneBase } from 'react-dropzone'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { partition } from '../_utils/partition'\nimport { MultipleErrors } from './Dropzone'\nimport { StyledErrorBannerDetails } from './Dropzone.styles'\nimport type {\n DropError,\n DropErrorType,\n DropzoneHookProps,\n DropzoneHookState,\n FileRejection,\n FileRejectionReason,\n} from './Dropzone.types'\nimport { dropErrors, fileRejectionReason } from './Dropzone.types'\nimport { getFileDetail, isZeroSize } from './Dropzone.utils'\n\nconst oneDropAtATimeRejectionReason = 'one-drop-at-a-time'\n\nconst dropErrorsByReason: Record<FileRejectionReason, DropErrorType> = {\n [fileRejectionReason.maxFiles]: dropErrors.fileAmount,\n [fileRejectionReason.maxFileSize]: dropErrors.maxFileSize,\n [fileRejectionReason.minFileSize]: dropErrors.minFileSize,\n [fileRejectionReason.fileType]: dropErrors.fileType,\n}\n\nconst getSizeInMB = (maxSize: number): number => maxSize / 10e5\n\n/**\n * WARNING:\n * Use ACCEPT prop carefully, because mime type determination is not reliable across platforms.\n * Details: https://github.com/react-dropzone/react-dropzone/tree/master/examples/accept#browser-limitations\n */\nexport const useDropzone = ({\n value = [],\n disabled = false,\n multiple = false,\n noClick = true,\n noKeyboard = true,\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDropRejected,\n maxFileSize: maxSize,\n minFileSize: minSize,\n maxFileNumber = Infinity,\n onDrop: _onDrop,\n onDropAccepted,\n ...props\n}: DropzoneHookProps = {}): DropzoneHookState => {\n const I18n = useI18nContext()\n const [acceptedFiles, setAcceptedFiles] = React.useState<File[]>([])\n const [fileRejections, setFileRejections] = React.useState<FileRejection[]>(\n []\n )\n\n const maxFilesRemaining = maxFileNumber - value.length\n\n const defaultDropError = {\n type: dropErrors.reset,\n title: '',\n message: '',\n }\n\n const dropErrorReducer = (\n state: DropError,\n action: DropErrorType\n ): DropError => {\n const rejectedFiles = (\n <StyledErrorBannerDetails>\n {fileRejections.map(({ file }) => {\n return <li key={file.name}>{getFileDetail(file)}</li>\n })}\n </StyledErrorBannerDetails>\n )\n const title = I18n.t('core.dropzone.errorTitle')\n\n switch (action) {\n case dropErrors.oneFileAtATime:\n return {\n type: dropErrors.oneFileAtATime,\n title: '',\n message: I18n.t('core.dropzone.oneFileAtATimeError'),\n }\n case dropErrors.fileAmount:\n return {\n type: dropErrors.fileAmount,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileNumberError', {\n maxFiles: maxFileNumber,\n }),\n body: rejectedFiles,\n }\n case dropErrors.fileType:\n return {\n type: dropErrors.fileType,\n title,\n message: I18n.t('core.dropzone.standaloneUnsupportedFileTypeError'),\n body: rejectedFiles,\n }\n case dropErrors.maxFileSize:\n return {\n type: dropErrors.maxFileSize,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileSizeError', {\n sizeInMegabytes: getSizeInMB(maxSize as number),\n }),\n body: rejectedFiles,\n }\n case dropErrors.minFileSize:\n const message = isZeroSize(minSize)\n ? I18n.t('core.dropzone.standaloneZeroFileSizeError')\n : I18n.t('core.dropzone.standaloneMinFileSizeError', {\n sizeInMegabytes: getSizeInMB(minSize as number),\n })\n\n return {\n type: dropErrors.minFileSize,\n title,\n message,\n body: rejectedFiles,\n }\n case dropErrors.multipleErrors:\n return {\n type: dropErrors.multipleErrors,\n title,\n message: I18n.t('core.dropzone.multipleErrorsMessage'),\n body: (\n <MultipleErrors\n fileRejections={fileRejections}\n maxFiles={maxFileNumber}\n maxSize={maxSize}\n minSize={minSize}\n />\n ),\n }\n case dropErrors.reset:\n return { ...defaultDropError }\n default:\n return state\n }\n }\n\n const withOneDropAtATimeError = (file: File) => ({\n file,\n errors: [\n {\n message: I18n.t('core.dropzone.oneDropAtATimeError'),\n code: oneDropAtATimeRejectionReason as FileRejectionReason,\n },\n ],\n })\n\n const [dropError, dispatchDropError] = React.useReducer<\n React.Reducer<DropError, DropErrorType>\n >(dropErrorReducer, { ...defaultDropError })\n\n const onDrop: DropzoneOptions['onDrop'] = React.useCallback(\n (\n acceptedFiles: File[],\n rejectedFiles: FileRejection[],\n event: DropEvent\n ) => {\n dispatchDropError(dropErrors.reset)\n\n const droppedFiles = [\n ...acceptedFiles,\n ...rejectedFiles.map((rej) => rej.file),\n ]\n if (!multiple && droppedFiles.length > 1) {\n dispatchDropError(dropErrors.oneFileAtATime)\n onDropRejected?.(droppedFiles.map(withOneDropAtATimeError), event)\n return\n }\n\n const allFilesWithRejections = [\n ...acceptedFiles.map((file) => ({ file, errors: [] })),\n ...rejectedFiles,\n ].map(({ file, errors }, i) => ({\n file,\n errors:\n i < maxFilesRemaining\n ? errors\n : [...errors, { message: '', code: fileRejectionReason.maxFiles }],\n }))\n\n const [actualAcceptedFiles_, actualRejectedFiles] =\n partition<FileRejection>(\n ({ errors }) => errors.length === 0,\n allFilesWithRejections\n )\n\n const actualAcceptedFiles = actualAcceptedFiles_.map(({ file }) => file)\n\n _onDrop?.(actualAcceptedFiles, actualRejectedFiles, event)\n\n setAcceptedFiles(actualAcceptedFiles)\n setFileRejections(actualRejectedFiles)\n\n if (actualAcceptedFiles.length) {\n onDropAccepted?.(actualAcceptedFiles, event)\n }\n\n if (actualRejectedFiles.length) {\n onDropRejected?.(actualRejectedFiles, event)\n }\n\n const errorCodes = actualRejectedFiles\n .flatMap((rejection) => rejection.errors)\n .map((error) => error.code)\n const hasMultipleErrors = new Set([...errorCodes]).size > 1\n\n if (hasMultipleErrors) {\n dispatchDropError(dropErrors.multipleErrors)\n } else {\n dispatchDropError(dropErrorsByReason[errorCodes[0]])\n }\n },\n [_onDrop, maxFilesRemaining, onDropRejected, onDropAccepted, multiple]\n )\n\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n open,\n rootRef,\n inputRef,\n } = useDropzoneBase({\n ...props,\n disabled,\n minSize,\n maxSize,\n multiple,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n noClick,\n noKeyboard,\n })\n\n const dragError = React.useMemo(() => {\n const getFileTypeError = () => {\n return isDragReject\n ? I18n.t('core.dropzone.incorrectFileTypeMessage', {\n count: draggedFiles.length,\n })\n : ''\n }\n\n const getFileAmountError = () => {\n const fileLimit = multiple ? maxFilesRemaining : 1\n\n const amountError = multiple\n ? I18n.t('core.dropzone.invalidAmountAttachments', {\n count: maxFileNumber,\n })\n : I18n.t('core.dropzone.incorrectFileNumber')\n\n return draggedFiles.length > fileLimit ? amountError : ''\n }\n\n return getFileAmountError() || getFileTypeError()\n }, [\n I18n,\n draggedFiles.length,\n maxFilesRemaining,\n isDragReject,\n maxFileNumber,\n multiple,\n ])\n\n return {\n getRootProps,\n getInputProps,\n\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n acceptedFiles,\n fileRejections,\n\n open,\n rootRef,\n inputRef,\n\n multiple,\n dragError,\n dropError,\n dispatchDropError,\n disabled,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,IAAIC,eAAe,QAAQ,gBAAgB;AAC/D,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,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ver';
|
|
|
26
26
|
import { useFocusWithin } from '../_hooks/useFocusWithin';
|
|
27
27
|
import { StyledDropzoneCaption, StyledDropzoneContainer, StyledDropzoneFocusDetector, StyledDropzoneIcon, StyledDropzoneMessage, StyledDropzoneWrapper, StyledErrorBanner, StyledErrorBannerDetails, StyledUploadButton } from './Dropzone.styles';
|
|
28
28
|
import { dropErrors, fileRejectionReason } from './Dropzone.types';
|
|
29
|
-
import { isZeroSize } from './Dropzone.utils';
|
|
29
|
+
import { getFileDetail, isZeroSize } from './Dropzone.utils';
|
|
30
30
|
var extendedViewHeightBreakpoint = 172;
|
|
31
31
|
var DropzoneErrorBannerBase = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
32
32
|
var error = _ref.error,
|
|
@@ -84,11 +84,10 @@ export function MultipleErrors(props) {
|
|
|
84
84
|
key: errorType
|
|
85
85
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
86
86
|
weight: "bold"
|
|
87
|
-
}, messages[errorType]), /*#__PURE__*/React.createElement(StyledErrorBannerDetails, null, filesByErrorType[errorType].map(function (
|
|
88
|
-
var name = _ref2.name;
|
|
87
|
+
}, messages[errorType]), /*#__PURE__*/React.createElement(StyledErrorBannerDetails, null, filesByErrorType[errorType].map(function (file) {
|
|
89
88
|
return /*#__PURE__*/React.createElement("li", {
|
|
90
|
-
key: name
|
|
91
|
-
},
|
|
89
|
+
key: file.name
|
|
90
|
+
}, getFileDetail(file));
|
|
92
91
|
}))) : null;
|
|
93
92
|
}));
|
|
94
93
|
}
|
|
@@ -96,32 +95,32 @@ export function MultipleErrors(props) {
|
|
|
96
95
|
// make error banner accessible as a styled-components selector
|
|
97
96
|
export var DropzoneErrorBanner = /*#__PURE__*/styled(DropzoneErrorBannerBase).withConfig({
|
|
98
97
|
displayName: "DropzoneErrorBanner",
|
|
99
|
-
componentId: "core-
|
|
98
|
+
componentId: "core-12_17_3__sc-l4fojb-0"
|
|
100
99
|
})([""]);
|
|
101
|
-
function DropzoneContainer(
|
|
102
|
-
var active =
|
|
103
|
-
disabled =
|
|
104
|
-
getRootProps =
|
|
105
|
-
rootProps =
|
|
106
|
-
children =
|
|
100
|
+
function DropzoneContainer(_ref2) {
|
|
101
|
+
var active = _ref2.active,
|
|
102
|
+
disabled = _ref2.disabled,
|
|
103
|
+
getRootProps = _ref2.getRootProps,
|
|
104
|
+
rootProps = _ref2.rootProps,
|
|
105
|
+
children = _ref2.children;
|
|
107
106
|
return /*#__PURE__*/React.createElement(StyledDropzoneContainer, _extends({}, getRootProps(rootProps), {
|
|
108
107
|
active: active,
|
|
109
108
|
disabled: disabled
|
|
110
109
|
}), children);
|
|
111
110
|
}
|
|
112
|
-
function DropzoneContent(
|
|
113
|
-
var disabled =
|
|
114
|
-
isIconVisible =
|
|
115
|
-
contentMessage =
|
|
111
|
+
function DropzoneContent(_ref3) {
|
|
112
|
+
var disabled = _ref3.disabled,
|
|
113
|
+
isIconVisible = _ref3.isIconVisible,
|
|
114
|
+
contentMessage = _ref3.contentMessage;
|
|
116
115
|
return /*#__PURE__*/React.createElement(StyledDropzoneMessage, null, isIconVisible && /*#__PURE__*/React.createElement(StyledDropzoneIcon, {
|
|
117
116
|
disabled: disabled
|
|
118
117
|
}, disabled ? /*#__PURE__*/React.createElement(Ban, null) : /*#__PURE__*/React.createElement(Image, null)), contentMessage);
|
|
119
118
|
}
|
|
120
|
-
export function DropzoneDefaultMessage(
|
|
121
|
-
var open =
|
|
122
|
-
disabled =
|
|
123
|
-
multiple =
|
|
124
|
-
errorMessage =
|
|
119
|
+
export function DropzoneDefaultMessage(_ref4) {
|
|
120
|
+
var open = _ref4.open,
|
|
121
|
+
disabled = _ref4.disabled,
|
|
122
|
+
multiple = _ref4.multiple,
|
|
123
|
+
errorMessage = _ref4.errorMessage;
|
|
125
124
|
var I18n = useI18nContext();
|
|
126
125
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledUploadButton, {
|
|
127
126
|
variant: "secondary",
|
|
@@ -137,28 +136,28 @@ var dropErrorsByReason = (_dropErrorsByReason = {}, _defineProperty(_dropErrorsB
|
|
|
137
136
|
var getSizeInMB = function getSizeInMB(maxSize) {
|
|
138
137
|
return maxSize / 10e5;
|
|
139
138
|
};
|
|
140
|
-
var Dropzone_ = /*#__PURE__*/React.forwardRef(function Dropzone(
|
|
141
|
-
var forceIconVisibility =
|
|
142
|
-
contentRenderer =
|
|
143
|
-
disabled =
|
|
144
|
-
tooltip =
|
|
145
|
-
rootRef =
|
|
146
|
-
inputRef =
|
|
147
|
-
dragError =
|
|
148
|
-
dropError =
|
|
149
|
-
dispatchDropError =
|
|
150
|
-
getRootProps =
|
|
151
|
-
getInputProps =
|
|
152
|
-
isDragActive =
|
|
153
|
-
multiple =
|
|
154
|
-
fileRejections =
|
|
155
|
-
open =
|
|
156
|
-
|
|
157
|
-
rootProps =
|
|
158
|
-
|
|
159
|
-
inputProps =
|
|
160
|
-
className =
|
|
161
|
-
qa =
|
|
139
|
+
var Dropzone_ = /*#__PURE__*/React.forwardRef(function Dropzone(_ref5, ref) {
|
|
140
|
+
var forceIconVisibility = _ref5.isIconVisible,
|
|
141
|
+
contentRenderer = _ref5.contentRenderer,
|
|
142
|
+
disabled = _ref5.disabled,
|
|
143
|
+
tooltip = _ref5.tooltip,
|
|
144
|
+
rootRef = _ref5.rootRef,
|
|
145
|
+
inputRef = _ref5.inputRef,
|
|
146
|
+
dragError = _ref5.dragError,
|
|
147
|
+
dropError = _ref5.dropError,
|
|
148
|
+
dispatchDropError = _ref5.dispatchDropError,
|
|
149
|
+
getRootProps = _ref5.getRootProps,
|
|
150
|
+
getInputProps = _ref5.getInputProps,
|
|
151
|
+
isDragActive = _ref5.isDragActive,
|
|
152
|
+
multiple = _ref5.multiple,
|
|
153
|
+
fileRejections = _ref5.fileRejections,
|
|
154
|
+
open = _ref5.open,
|
|
155
|
+
_ref5$rootProps = _ref5.rootProps,
|
|
156
|
+
rootProps = _ref5$rootProps === void 0 ? {} : _ref5$rootProps,
|
|
157
|
+
_ref5$inputProps = _ref5.inputProps,
|
|
158
|
+
inputProps = _ref5$inputProps === void 0 ? {} : _ref5$inputProps,
|
|
159
|
+
className = _ref5.className,
|
|
160
|
+
qa = _ref5.qa;
|
|
162
161
|
var _React$useState3 = React.useState(false),
|
|
163
162
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
164
163
|
isIconVisible = _React$useState4[0],
|
|
@@ -167,8 +166,8 @@ var Dropzone_ = /*#__PURE__*/React.forwardRef(function Dropzone(_ref6, ref) {
|
|
|
167
166
|
isFocusWithin = _useFocusWithin.isFocusWithin,
|
|
168
167
|
containerProps = _useFocusWithin.containerProps;
|
|
169
168
|
var toggleIconVisibility = React.useCallback(function (entries) {
|
|
170
|
-
var
|
|
171
|
-
height =
|
|
169
|
+
var _ref6 = entries[0].target,
|
|
170
|
+
height = _ref6.offsetHeight;
|
|
172
171
|
setIsIconVisible(height >= extendedViewHeightBreakpoint);
|
|
173
172
|
}, [setIsIconVisible]);
|
|
174
173
|
var setResizeObserverTarget = useResizeObserver(toggleIconVisibility);
|