@procore/core-react 10.23.0-rc.33 → 10.23.0-rc.34
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/esm/components/FileList/FileList.d.ts +5 -1
- package/dist/esm/components/FileList/FileList.js +34 -38
- package/dist/esm/components/FileList/FileList.js.map +1 -1
- package/dist/esm/components/FileList/FileList.styles.d.ts +4 -0
- package/dist/esm/components/FileList/FileList.styles.js +13 -0
- package/dist/esm/components/FileList/FileList.styles.js.map +1 -0
- package/dist/esm/components/FileList/FileList.types.d.ts +23 -4
- package/dist/esm/components/FileList/storybook/fileListMockData.d.ts +5 -0
- package/dist/esm/components/FileList/storybook/fileListMockData.js +39 -0
- package/dist/esm/components/FileList/storybook/fileListMockData.js.map +1 -0
- package/dist/esm/locales/en.json +3 -1
- package/dist/esm/state/I18n.d.ts +2 -0
- package/dist/typedoc/components/Avatar/Avatar.types.json +17 -17
- package/dist/typedoc/components/AvatarStack/AvatarStack.types.json +22 -22
- package/dist/typedoc/components/Badge/Badge.types.json +6 -6
- package/dist/typedoc/components/Banner/Banner.types.json +12 -12
- package/dist/typedoc/components/Breadcrumbs/Breadcrumbs.types.json +7 -7
- package/dist/typedoc/components/Button/Button.types.json +11 -11
- package/dist/typedoc/components/Calendar/Calendar.types.json +79 -79
- package/dist/typedoc/components/Card/Card.types.json +6 -6
- package/dist/typedoc/components/Checkbox/Checkbox.types.json +7 -7
- package/dist/typedoc/components/ContactItem/ContactItem.types.json +9 -9
- package/dist/typedoc/components/DateInput/DateInput.types.json +35 -35
- package/dist/typedoc/components/DateSelect/DateSelect.types.json +13 -13
- package/dist/typedoc/components/Dropdown/Dropdown.types.json +34 -34
- package/dist/typedoc/components/DropdownFlyout/DropdownFlyout.types.json +32 -32
- package/dist/typedoc/components/Dropzone/Dropzone.types.json +41 -41
- package/dist/typedoc/components/EmptyState/EmptyState.types.json +14 -14
- package/dist/typedoc/components/FileList/FileList.types.json +71 -5
- package/dist/typedoc/components/FileSelect/FileSelect.types.json +25 -25
- package/dist/typedoc/components/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/typedoc/components/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/typedoc/components/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/typedoc/components/Font/Font.types.json +7 -7
- package/dist/typedoc/components/Form/Form.types.json +684 -684
- package/dist/typedoc/components/GroupSelect/GroupSelect.types.json +50 -50
- package/dist/typedoc/components/Icon/Icon.types.json +10 -10
- package/dist/typedoc/components/Input/Input.types.json +2 -2
- package/dist/typedoc/components/Link/Link.types.json +4 -4
- package/dist/typedoc/components/Menu/Menu.types.json +67 -67
- package/dist/typedoc/components/MenuImperative/MenuImperative.types.json +67 -67
- package/dist/typedoc/components/Modal/Modal.types.json +27 -27
- package/dist/typedoc/components/MultiSelect/MultiSelect.types.json +29 -29
- package/dist/typedoc/components/Notation/Notation.types.json +4 -4
- package/dist/typedoc/components/NumberInput/NumberInput.types.json +25 -25
- package/dist/typedoc/components/OverlayTrigger/OverlayTrigger.json +18 -18
- package/dist/typedoc/components/Pagination/Pagination.types.json +8 -8
- package/dist/typedoc/components/Panel/Panel.types.json +17 -17
- package/dist/typedoc/components/Pill/Pill.types.json +1 -1
- package/dist/typedoc/components/PillSelect/PillSelect.types.json +46 -46
- package/dist/typedoc/components/Popover/Popover.types.json +9 -9
- package/dist/typedoc/components/ProgressBar/ProgressBar.types.json +5 -5
- package/dist/typedoc/components/RadioButton/RadioButton.types.json +6 -6
- package/dist/typedoc/components/Required/Required.types.json +5 -5
- package/dist/typedoc/components/Search/Search.types.json +21 -21
- package/dist/typedoc/components/SegmentedController/SegmentedController.types.json +20 -20
- package/dist/typedoc/components/Select/Select.types.json +31 -31
- package/dist/typedoc/components/Slider/Slider.types.json +6 -6
- package/dist/typedoc/components/Spinner/Spinner.types.json +8 -8
- package/dist/typedoc/components/Switch/Switch.types.json +3 -3
- package/dist/typedoc/components/Table/Table.types.json +94 -94
- package/dist/typedoc/components/Tabs/Tabs.types.json +15 -15
- package/dist/typedoc/components/Tearsheet/Tearsheet.types.json +7 -7
- package/dist/typedoc/components/TextArea/TextArea.types.json +3 -3
- package/dist/typedoc/components/TextEditor/TextEditor.types.json +7 -7
- package/dist/typedoc/components/Thumbnail/Thumbnail.types.json +12 -12
- package/dist/typedoc/components/TieredDropdown/TieredDropdown.types.json +41 -41
- package/dist/typedoc/components/TieredSelect/TieredSelect.types.json +27 -27
- package/dist/typedoc/components/Tile/Tile.types.json +30 -30
- package/dist/typedoc/components/Toast/Toast.types.json +4 -4
- package/dist/typedoc/components/ToggleButton/ToggleButton.types.json +3 -3
- package/dist/typedoc/components/Token/Token.types.json +11 -11
- package/dist/typedoc/components/Tooltip/Tooltip.types.json +13 -13
- package/dist/typedoc/components/Tree/Tree.types.json +85 -85
- package/dist/typedoc/components/Typeahead/Typeahead.types.json +2 -2
- package/dist/typedoc/components/Typography/Typography.types.json +8 -8
- package/dist/typedoc/layouts/Box/Box.types.json +66 -66
- package/dist/typedoc/layouts/DetailPage/DetailPage.json +11 -11
- package/dist/typedoc/layouts/Flex/Flex.types.json +26 -26
- package/dist/typedoc/layouts/FlexList/FlexList.types.json +29 -29
- package/dist/typedoc/layouts/Grid/Grid.json +10 -10
- package/dist/typedoc/layouts/LegacyDetailPage/LegacyDetailPage.json +4 -4
- package/dist/typedoc/layouts/ListPage/ListPage.types.json +10 -10
- package/dist/typedoc/layouts/NextDetailPage/NextDetailPage.types.json +4 -4
- package/dist/typedoc/layouts/NextGrid/NextGrid.types.json +8 -8
- package/dist/typedoc/layouts/PageLayout/PageLayout.types.json +7 -7
- package/dist/typedoc/layouts/ToolHeader/ToolHeader.types.json +8 -8
- package/dist/typedoc/utils/types.json +3 -3
- package/package.json +5 -5
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.12493d4c.iframe.bundle.js +1 -0
- package/storybook-static/main.38f13787.iframe.bundle.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DivAttributes } from '../../utils/types';
|
|
3
|
-
import { FileListProps } from './FileList.types';
|
|
3
|
+
import { FileListItemProps, FileListProps } from './FileList.types';
|
|
4
4
|
/**
|
|
5
5
|
|
|
6
6
|
@since 10.19.0
|
|
@@ -8,4 +8,8 @@ import { FileListProps } from './FileList.types';
|
|
|
8
8
|
@see [Storybook](https://procore.github.io/core/latest/?path=/story/demos-filelist--demo)
|
|
9
9
|
|
|
10
10
|
*/
|
|
11
|
+
export declare const defaultGetViewUrl: (item: FileListItemProps) => string | undefined;
|
|
12
|
+
export declare const defaultGetDownloadUrl: (item: FileListItemProps) => string | undefined;
|
|
13
|
+
export declare const defaultGetName: (item: FileListItemProps) => string;
|
|
11
14
|
export declare const FileList: React.ForwardRefExoticComponent<FileListProps & DivAttributes & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare function Item({ name, viewUrl, downloadUrl, ...props }: FileListItemProps): JSX.Element;
|
|
@@ -20,15 +20,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import styles from '@procore/core-css/src/components/_file_list.scss';
|
|
24
|
-
import classnames from 'classnames/bind';
|
|
25
23
|
import React from 'react';
|
|
26
|
-
import { useOverflowObserver } from '../../effects/OverflowObserver';
|
|
27
24
|
import { useI18nContext } from '../../state/I18n';
|
|
28
|
-
import { parseFilename } from '../../utils/filename';
|
|
29
25
|
import { Tooltip } from '../Tooltip';
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
import { Archive, Download } from '@procore/core-icons/dist';
|
|
27
|
+
import { Link } from '../Link';
|
|
28
|
+
import { Typography } from '../Typography';
|
|
29
|
+
import Box from '../../layouts/Box/Box';
|
|
30
|
+
import { StyledFileListItem, StyledFileListItemDownloadIcon, StyledFileListDownloadAll, StyledFileListItemTextInactive, } from './FileList.styles';
|
|
32
31
|
/**
|
|
33
32
|
|
|
34
33
|
@since 10.19.0
|
|
@@ -36,44 +35,41 @@ var THRESHOLD = 99;
|
|
|
36
35
|
@see [Storybook](https://procore.github.io/core/latest/?path=/story/demos-filelist--demo)
|
|
37
36
|
|
|
38
37
|
*/
|
|
38
|
+
export var defaultGetViewUrl = function (item) {
|
|
39
|
+
return item.viewUrl;
|
|
40
|
+
};
|
|
41
|
+
export var defaultGetDownloadUrl = function (item) {
|
|
42
|
+
return item.downloadUrl;
|
|
43
|
+
};
|
|
44
|
+
export var defaultGetName = function (item) {
|
|
45
|
+
return item.name;
|
|
46
|
+
};
|
|
39
47
|
export var FileList = React.forwardRef(function FileList(_a, ref) {
|
|
40
|
-
var items = _a.items, downloadAllUrl = _a.downloadAllUrl,
|
|
48
|
+
var items = _a.items, downloadAllUrl = _a.downloadAllUrl, _b = _a.getDownloadUrl, getDownloadUrl = _b === void 0 ? defaultGetDownloadUrl : _b, _c = _a.getViewUrl, getViewUrl = _c === void 0 ? defaultGetViewUrl : _c, _d = _a.getName, getName = _d === void 0 ? defaultGetName : _d, qa = _a.qa, props = __rest(_a, ["items", "downloadAllUrl", "getDownloadUrl", "getViewUrl", "getName", "qa"]);
|
|
41
49
|
var I18n = useI18nContext();
|
|
42
50
|
var length = items.length;
|
|
43
|
-
var isDownloadAllVisible = length > 1;
|
|
51
|
+
var isDownloadAllVisible = length > 1 && downloadAllUrl;
|
|
44
52
|
if (length === 0) {
|
|
45
53
|
return null;
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
items.map(function (_a) {
|
|
56
|
-
var _b;
|
|
57
|
-
var name = _a.name, url = _a.url;
|
|
58
|
-
return (React.createElement(Item, { key: "".concat(name, "-").concat(url), name: name, url: url, "data-qa": (_b = qa === null || qa === void 0 ? void 0 : qa.item) === null || _b === void 0 ? void 0 : _b.call(qa, { name: name, url: url }) }));
|
|
59
|
-
})));
|
|
55
|
+
return (React.createElement(Box, __assign({ ref: ref }, props),
|
|
56
|
+
isDownloadAllVisible && (React.createElement(StyledFileListDownloadAll, { variant: "tertiary", size: "sm", icon: React.createElement(Archive, null), href: downloadAllUrl, tabIndex: 0 }, I18n.t('core.fileList.downloadAll'))),
|
|
57
|
+
React.createElement(Box, { as: "ul" }, items.map(function (item, i) {
|
|
58
|
+
var _a;
|
|
59
|
+
var name = getName(item);
|
|
60
|
+
var downloadUrl = getDownloadUrl(item);
|
|
61
|
+
return (React.createElement(Item, { name: name, downloadUrl: getDownloadUrl(item), viewUrl: getViewUrl(item), "data-qa": (_a = qa === null || qa === void 0 ? void 0 : qa.item) === null || _a === void 0 ? void 0 : _a.call(qa, item), key: "".concat(name, "-").concat(downloadUrl) }));
|
|
62
|
+
}))));
|
|
60
63
|
});
|
|
61
|
-
function Item(_a) {
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
React.createElement("a", { href: url, className: cx('file-list__item-download') },
|
|
72
|
-
React.createElement(DownloadIcon, null))));
|
|
73
|
-
}
|
|
74
|
-
function DownloadIcon() {
|
|
75
|
-
return (React.createElement("svg", { width: "16", height: "16", fill: "none", xmlns: "http://www.w3.org/2000/svg", focusable: false },
|
|
76
|
-
React.createElement("path", { d: "M14.5 14.5h-13V11h-1v4.5h15V11h-1v3.5z", fill: "#006DDF" }),
|
|
77
|
-
React.createElement("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.5 10.293V2h1v8.293l3.146-3.147.707.708L8 12.207 3.646 7.854l.708-.708L7.5 10.293z", fill: "#006DDF" })));
|
|
64
|
+
export function Item(_a) {
|
|
65
|
+
var name = _a.name, viewUrl = _a.viewUrl, downloadUrl = _a.downloadUrl, props = __rest(_a, ["name", "viewUrl", "downloadUrl"]);
|
|
66
|
+
var I18n = useI18nContext();
|
|
67
|
+
return (React.createElement(StyledFileListItem, __assign({}, props),
|
|
68
|
+
viewUrl ? (React.createElement(Typography, { intent: "body", weight: "semibold" },
|
|
69
|
+
React.createElement(Link, { href: viewUrl, target: "_blank", tabIndex: 0 }, name))) : (React.createElement(Tooltip, { overlay: I18n.t('core.fileList.noPreview') },
|
|
70
|
+
React.createElement(Typography, { intent: "body", color: "gray15" },
|
|
71
|
+
React.createElement(StyledFileListItemTextInactive, { tabIndex: 0 }, name)))),
|
|
72
|
+
downloadUrl && (React.createElement(Tooltip, { overlay: I18n.t('core.fileList.download') },
|
|
73
|
+
React.createElement(StyledFileListItemDownloadIcon, { "aria-label": I18n.t('core.fileList.download'), href: downloadUrl, icon: React.createElement(Download, { size: "sm" }), size: "sm", variant: "tertiary" })))));
|
|
78
74
|
}
|
|
79
75
|
//# sourceMappingURL=FileList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileList.js","sourceRoot":"","sources":["../../../../src/components/FileList/FileList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FileList.js","sourceRoot":"","sources":["../../../../src/components/FileList/FileList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,GAAG,MAAM,uBAAuB,CAAA;AACvC,OAAO,EACL,kBAAkB,EAClB,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;G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AAC,wBAAwB,CAAC;YAChD,oBAAC,8BAA8B,kBACjB,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,EAC5C,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,oBAAC,QAAQ,IAAC,IAAI,EAAC,IAAI,GAAG,EAC5B,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,UAAU,GAClB,CACM,CACX,CACkB,CACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const StyledFileListDownloadAll: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").LinkButtonProps & import("react").RefAttributes<HTMLAnchorElement>>, any, {}, never>;
|
|
2
|
+
export declare const StyledFileListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
3
|
+
export declare const StyledFileListItemTextInactive: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
|
+
export declare const StyledFileListItemDownloadIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").LinkButtonProps & import("react").RefAttributes<HTMLAnchorElement>>, any, {}, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { spacing } from '../../styles/spacing';
|
|
7
|
+
import { LinkButton } from '../Button';
|
|
8
|
+
export var StyledFileListDownloadAll = styled(LinkButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacing.xs);
|
|
9
|
+
export var StyledFileListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-bottom: ", "px;\n word-break: break-word;\n\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-bottom: ", "px;\n word-break: break-word;\n\n &:last-child {\n margin-bottom: 0;\n }\n"])), spacing.xs);
|
|
10
|
+
export var StyledFileListItemTextInactive = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: pointer;\n"], ["\n cursor: pointer;\n"])));
|
|
11
|
+
export var StyledFileListItemDownloadIcon = styled(LinkButton)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: ", "px;\n align-self: flex-start;\n"], ["\n margin-left: ", "px;\n align-self: flex-start;\n"])), spacing.sm);
|
|
12
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
13
|
+
//# sourceMappingURL=FileList.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileList.styles.js","sourceRoot":"","sources":["../../../../src/components/FileList/FileList.styles.ts"],"names":[],"mappings":";;;;AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,MAAM,CAAC,IAAM,yBAAyB,GAAG,MAAM,CAAC,UAAU,CAAC,iGAAA,qBACxC,EAAU,OAC5B,KADkB,OAAO,CAAC,EAAE,CAC5B,CAAA;AAED,MAAM,CAAC,IAAM,kBAAkB,GAAG,MAAM,CAAC,EAAE,sNAAA,+DAGxB,EAAU,kFAM5B,KANkB,OAAO,CAAC,EAAE,CAM5B,CAAA;AAED,MAAM,CAAC,IAAM,8BAA8B,GAAG,MAAM,CAAC,IAAI,2FAAA,wBAExD,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,8BAA8B,GAAG,MAAM,CAAC,UAAU,CAAC,0HAAA,mBAC/C,EAAU,kCAE1B,KAFgB,OAAO,CAAC,EAAE,CAE1B,CAAA"}
|
|
@@ -2,9 +2,9 @@ interface QaTags {
|
|
|
2
2
|
/**
|
|
3
3
|
* @since 10.19.0
|
|
4
4
|
*/
|
|
5
|
-
item?: (item:
|
|
5
|
+
item?: (item: FileListItemProps) => string;
|
|
6
6
|
}
|
|
7
|
-
interface
|
|
7
|
+
export interface FileListItemProps {
|
|
8
8
|
/**
|
|
9
9
|
* @since 10.19.0
|
|
10
10
|
*/
|
|
@@ -12,7 +12,11 @@ interface FileListItem {
|
|
|
12
12
|
/**
|
|
13
13
|
* @since 10.19.0
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
downloadUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @since 10.22.0
|
|
18
|
+
*/
|
|
19
|
+
viewUrl?: string;
|
|
16
20
|
}
|
|
17
21
|
export interface FileListProps {
|
|
18
22
|
/**
|
|
@@ -23,10 +27,25 @@ export interface FileListProps {
|
|
|
23
27
|
/**
|
|
24
28
|
* @since 10.19.0
|
|
25
29
|
*/
|
|
26
|
-
items:
|
|
30
|
+
items: FileListItemProps[];
|
|
27
31
|
/**
|
|
28
32
|
* @since 10.19.0
|
|
29
33
|
*/
|
|
30
34
|
qa?: QaTags;
|
|
35
|
+
/**
|
|
36
|
+
* A function returning file list item's view URL
|
|
37
|
+
* @since 10.22.0
|
|
38
|
+
*/
|
|
39
|
+
getViewUrl?: (item: FileListItemProps) => string;
|
|
40
|
+
/**
|
|
41
|
+
* A function returning file list item's download URL
|
|
42
|
+
* @since 10.22.0
|
|
43
|
+
*/
|
|
44
|
+
getDownloadUrl?: (item: FileListItemProps) => string;
|
|
45
|
+
/**
|
|
46
|
+
* A function returning file list item's name
|
|
47
|
+
* @since 10.22.0
|
|
48
|
+
*/
|
|
49
|
+
getName?: (item: FileListItemProps) => string;
|
|
31
50
|
}
|
|
32
51
|
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export var items = [
|
|
2
|
+
{
|
|
3
|
+
name: 'IMG-0124.png',
|
|
4
|
+
downloadUrl: '/download_a',
|
|
5
|
+
viewUrl: '/preview_a',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'jobsite-visit.pdf',
|
|
9
|
+
downloadUrl: '/download_b',
|
|
10
|
+
viewUrl: '/preview_b',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'non-previewable-file.exe',
|
|
14
|
+
downloadUrl: '/download_c',
|
|
15
|
+
viewUrl: '',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'file-with-very-long-name-that-will-wrap-onto-infinite-lines forever-depending-on-viewport-width.png',
|
|
19
|
+
downloadUrl: '/download_d',
|
|
20
|
+
viewUrl: '/preview_d',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'IMG-2202.heif',
|
|
24
|
+
downloadUrl: '/download_e',
|
|
25
|
+
viewUrl: '/preview_e',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'AC01-DRAWING-COVER-SHEET.pdf',
|
|
29
|
+
downloadUrl: '/download_f',
|
|
30
|
+
viewUrl: '/preview_f',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'IMG-01.png',
|
|
34
|
+
downloadUrl: '/download_g',
|
|
35
|
+
viewUrl: '/preview_g',
|
|
36
|
+
},
|
|
37
|
+
{ name: 'permit.docx', downloadUrl: '/download_h', viewUrl: '' },
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=fileListMockData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileListMockData.js","sourceRoot":"","sources":["../../../../../src/components/FileList/storybook/fileListMockData.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,KAAK,GAAG;IACnB;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,EAAE;KACZ;IACD;QACE,IAAI,EAAE,qGAAqG;QAC3G,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;KACtB;IACD,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE;CACjE,CAAA"}
|
package/dist/esm/locales/en.json
CHANGED
package/dist/esm/state/I18n.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"description": "Instead of using the default children, you can pass in your own.",
|
|
11
11
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Instead of using the default children, you can pass in your own.</p>\n</div></div>",
|
|
12
12
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
13
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
13
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L40"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "className",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"description": "Additional classNames",
|
|
21
21
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div></div>",
|
|
22
22
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
23
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
23
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L45"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"name": "icon",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"deprecated": "\n\nThe `string` type icon has been deprecated and will be removed in the future.\nPlease use a React icon component from the `@procore/core-icons/dist` package.\n\n**Before**\n\n```\n<Avatar>\n <Avatar.Icon icon=\"building\" />\n</Avatar>\n```\n\n**After**\n\n```\n<Avatar>\n <Avatar.Icon icon={<Building />} />\n</Avatar>\n```\n",
|
|
33
33
|
"deprecatedSince": "10.20.0",
|
|
34
34
|
"sourceFile": "packages/core-react/src/components/Avatar/Avatar.types.ts",
|
|
35
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
35
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/components/Avatar/Avatar.types.ts#L71"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"name": "style",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"description": "Additional CSS styles",
|
|
43
43
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div></div>",
|
|
44
44
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
45
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
45
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L50"
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
"description": ""
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"description": "Instead of using the default children, you can pass in your own.",
|
|
59
59
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Instead of using the default children, you can pass in your own.</p>\n</div></div>",
|
|
60
60
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
61
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
61
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L40"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"name": "className",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"description": "Additional classNames",
|
|
69
69
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div></div>",
|
|
70
70
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
71
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
71
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L45"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"name": "style",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"description": "Additional CSS styles",
|
|
79
79
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div></div>",
|
|
80
80
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
81
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
81
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L50"
|
|
82
82
|
}
|
|
83
83
|
],
|
|
84
84
|
"description": ""
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"description": "Instead of using the default children, you can pass in your own.",
|
|
95
95
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Instead of using the default children, you can pass in your own.</p>\n</div></div>",
|
|
96
96
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
97
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
97
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L40"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"name": "className",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"description": "Additional classNames",
|
|
105
105
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div></div>",
|
|
106
106
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
107
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
107
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L45"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"name": "imageUrl",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"description": "The avatar rich media url",
|
|
115
115
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>The avatar rich media url</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
|
|
116
116
|
"sourceFile": "packages/core-react/src/components/Avatar/Avatar.types.ts",
|
|
117
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
117
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/components/Avatar/Avatar.types.ts#L79"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"name": "style",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"description": "Additional CSS styles",
|
|
125
125
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div></div>",
|
|
126
126
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
127
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
127
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L50"
|
|
128
128
|
}
|
|
129
129
|
],
|
|
130
130
|
"description": ""
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"description": "Instead of using the default children, you can pass in your own.",
|
|
141
141
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Instead of using the default children, you can pass in your own.</p>\n</div></div>",
|
|
142
142
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
143
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
143
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L40"
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
"name": "className",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"description": "Additional classNames",
|
|
151
151
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div></div>",
|
|
152
152
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
153
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
153
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L45"
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
"name": "clickable",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Sets the avatar's clickable state</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd><dt>defaultvalue</dt><dd><p>false</p>\n</dd></dl></div>",
|
|
162
162
|
"defaultValue": "false\n",
|
|
163
163
|
"sourceFile": "packages/core-react/src/components/Avatar/Avatar.types.ts",
|
|
164
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
164
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/components/Avatar/Avatar.types.ts#L12"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"name": "disabled",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Sets the avatar's disabled state</p>\n</div><dl class=\"tsd-comment-tags\"><dt>defaultvalue</dt><dd><p>false</p>\n</dd></dl></div>",
|
|
173
173
|
"defaultValue": "false\n",
|
|
174
174
|
"sourceFile": "packages/core-react/src/components/Avatar/Avatar.types.ts",
|
|
175
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
175
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/components/Avatar/Avatar.types.ts#L18"
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
"name": "size",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"deprecated": "\n\nSize \"xl\" has been deprecated and will be removed in a future version.\nPlease use \"lg\" instead of \"xl\".\n\n**Before**\n\n`<Avatar size=\"xl\" />`\n\n**After**\n\n`<Avatar size=\"lg\" />`\n",
|
|
186
186
|
"deprecatedSince": "10.20.0",
|
|
187
187
|
"sourceFile": "packages/core-react/src/components/Avatar/Avatar.types.ts",
|
|
188
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
188
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/components/Avatar/Avatar.types.ts#L40"
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
191
|
"name": "style",
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"description": "Additional CSS styles",
|
|
196
196
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div></div>",
|
|
197
197
|
"sourceFile": "packages/core-react/src/utils/types.ts",
|
|
198
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
198
|
+
"sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L50"
|
|
199
199
|
}
|
|
200
200
|
],
|
|
201
201
|
"description": ""
|