@procore/core-react 10.23.0-rc.30 → 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.
Files changed (93) hide show
  1. package/dist/esm/components/Button/Button.js +2 -2
  2. package/dist/esm/components/Button/Button.js.map +1 -1
  3. package/dist/esm/components/FileList/FileList.d.ts +5 -1
  4. package/dist/esm/components/FileList/FileList.js +34 -38
  5. package/dist/esm/components/FileList/FileList.js.map +1 -1
  6. package/dist/esm/components/FileList/FileList.styles.d.ts +4 -0
  7. package/dist/esm/components/FileList/FileList.styles.js +13 -0
  8. package/dist/esm/components/FileList/FileList.styles.js.map +1 -0
  9. package/dist/esm/components/FileList/FileList.types.d.ts +23 -4
  10. package/dist/esm/components/FileList/storybook/fileListMockData.d.ts +5 -0
  11. package/dist/esm/components/FileList/storybook/fileListMockData.js +39 -0
  12. package/dist/esm/components/FileList/storybook/fileListMockData.js.map +1 -0
  13. package/dist/esm/locales/en.json +3 -1
  14. package/dist/esm/state/I18n.d.ts +2 -0
  15. package/dist/typedoc/components/Avatar/Avatar.types.json +17 -17
  16. package/dist/typedoc/components/AvatarStack/AvatarStack.types.json +22 -22
  17. package/dist/typedoc/components/Badge/Badge.types.json +6 -6
  18. package/dist/typedoc/components/Banner/Banner.types.json +12 -12
  19. package/dist/typedoc/components/Breadcrumbs/Breadcrumbs.types.json +7 -7
  20. package/dist/typedoc/components/Button/Button.types.json +11 -11
  21. package/dist/typedoc/components/Calendar/Calendar.types.json +79 -79
  22. package/dist/typedoc/components/Card/Card.types.json +6 -6
  23. package/dist/typedoc/components/Checkbox/Checkbox.types.json +7 -7
  24. package/dist/typedoc/components/ContactItem/ContactItem.types.json +9 -9
  25. package/dist/typedoc/components/DateInput/DateInput.types.json +35 -35
  26. package/dist/typedoc/components/DateSelect/DateSelect.types.json +13 -13
  27. package/dist/typedoc/components/Dropdown/Dropdown.types.json +34 -34
  28. package/dist/typedoc/components/DropdownFlyout/DropdownFlyout.types.json +32 -32
  29. package/dist/typedoc/components/Dropzone/Dropzone.types.json +41 -41
  30. package/dist/typedoc/components/EmptyState/EmptyState.types.json +14 -14
  31. package/dist/typedoc/components/FileList/FileList.types.json +71 -5
  32. package/dist/typedoc/components/FileSelect/FileSelect.types.json +25 -25
  33. package/dist/typedoc/components/FileSelect/GridSource/GridSource.types.json +20 -20
  34. package/dist/typedoc/components/FileSelect/LocalSource/LocalSource.types.json +14 -14
  35. package/dist/typedoc/components/FileSelect/TreeSource/TreeSource.types.json +9 -9
  36. package/dist/typedoc/components/Font/Font.types.json +7 -7
  37. package/dist/typedoc/components/Form/Form.types.json +684 -684
  38. package/dist/typedoc/components/GroupSelect/GroupSelect.types.json +50 -50
  39. package/dist/typedoc/components/Icon/Icon.types.json +10 -10
  40. package/dist/typedoc/components/Input/Input.types.json +2 -2
  41. package/dist/typedoc/components/Link/Link.types.json +4 -4
  42. package/dist/typedoc/components/Menu/Menu.types.json +67 -67
  43. package/dist/typedoc/components/MenuImperative/MenuImperative.types.json +67 -67
  44. package/dist/typedoc/components/Modal/Modal.types.json +27 -27
  45. package/dist/typedoc/components/MultiSelect/MultiSelect.types.json +29 -29
  46. package/dist/typedoc/components/Notation/Notation.types.json +4 -4
  47. package/dist/typedoc/components/NumberInput/NumberInput.types.json +25 -25
  48. package/dist/typedoc/components/OverlayTrigger/OverlayTrigger.json +18 -18
  49. package/dist/typedoc/components/Pagination/Pagination.types.json +8 -8
  50. package/dist/typedoc/components/Panel/Panel.types.json +17 -17
  51. package/dist/typedoc/components/Pill/Pill.types.json +1 -1
  52. package/dist/typedoc/components/PillSelect/PillSelect.types.json +46 -46
  53. package/dist/typedoc/components/Popover/Popover.types.json +9 -9
  54. package/dist/typedoc/components/ProgressBar/ProgressBar.types.json +5 -5
  55. package/dist/typedoc/components/RadioButton/RadioButton.types.json +6 -6
  56. package/dist/typedoc/components/Required/Required.types.json +5 -5
  57. package/dist/typedoc/components/Search/Search.types.json +21 -21
  58. package/dist/typedoc/components/SegmentedController/SegmentedController.types.json +20 -20
  59. package/dist/typedoc/components/Select/Select.types.json +31 -31
  60. package/dist/typedoc/components/Slider/Slider.types.json +6 -6
  61. package/dist/typedoc/components/Spinner/Spinner.types.json +8 -8
  62. package/dist/typedoc/components/Switch/Switch.types.json +3 -3
  63. package/dist/typedoc/components/Table/Table.types.json +94 -94
  64. package/dist/typedoc/components/Tabs/Tabs.types.json +15 -15
  65. package/dist/typedoc/components/Tearsheet/Tearsheet.types.json +7 -7
  66. package/dist/typedoc/components/TextArea/TextArea.types.json +3 -3
  67. package/dist/typedoc/components/TextEditor/TextEditor.types.json +7 -7
  68. package/dist/typedoc/components/Thumbnail/Thumbnail.types.json +12 -12
  69. package/dist/typedoc/components/TieredDropdown/TieredDropdown.types.json +41 -41
  70. package/dist/typedoc/components/TieredSelect/TieredSelect.types.json +27 -27
  71. package/dist/typedoc/components/Tile/Tile.types.json +30 -30
  72. package/dist/typedoc/components/Toast/Toast.types.json +4 -4
  73. package/dist/typedoc/components/ToggleButton/ToggleButton.types.json +3 -3
  74. package/dist/typedoc/components/Token/Token.types.json +11 -11
  75. package/dist/typedoc/components/Tooltip/Tooltip.types.json +13 -13
  76. package/dist/typedoc/components/Tree/Tree.types.json +85 -85
  77. package/dist/typedoc/components/Typeahead/Typeahead.types.json +2 -2
  78. package/dist/typedoc/components/Typography/Typography.types.json +8 -8
  79. package/dist/typedoc/layouts/Box/Box.types.json +66 -66
  80. package/dist/typedoc/layouts/DetailPage/DetailPage.json +11 -11
  81. package/dist/typedoc/layouts/Flex/Flex.types.json +26 -26
  82. package/dist/typedoc/layouts/FlexList/FlexList.types.json +29 -29
  83. package/dist/typedoc/layouts/Grid/Grid.json +10 -10
  84. package/dist/typedoc/layouts/LegacyDetailPage/LegacyDetailPage.json +4 -4
  85. package/dist/typedoc/layouts/ListPage/ListPage.types.json +10 -10
  86. package/dist/typedoc/layouts/NextDetailPage/NextDetailPage.types.json +4 -4
  87. package/dist/typedoc/layouts/NextGrid/NextGrid.types.json +8 -8
  88. package/dist/typedoc/layouts/PageLayout/PageLayout.types.json +7 -7
  89. package/dist/typedoc/layouts/ToolHeader/ToolHeader.types.json +8 -8
  90. package/dist/typedoc/utils/types.json +3 -3
  91. package/package.json +5 -5
  92. package/storybook-static/iframe.html +1 -1
  93. package/storybook-static/{main.0e9e57b1.iframe.bundle.js → main.12493d4c.iframe.bundle.js} +1 -1
@@ -68,7 +68,7 @@ var ButtonContent = function (_a) {
68
68
  */
69
69
  export var Button = React.forwardRef(function Button(_a, ref) {
70
70
  var _b = _a.block, block = _b === void 0 ? false : _b, children = _a.children, _c = _a.disabled, disabled = _c === void 0 ? false : _c, icon = _a.icon, iconRight = _a.iconRight, _d = _a.loading, loading = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.type, type = _f === void 0 ? 'button' : _f, _g = _a.variant, variant = _g === void 0 ? 'primary' : _g, props = __rest(_a, ["block", "children", "disabled", "icon", "iconRight", "loading", "size", "type", "variant"]);
71
- return (React.createElement(StyledButton, __assign({ "aria-busy": loading || undefined, tabIndex: 0 }, props, { "$block": block, disabled: disabled || loading, "$loading": loading, "$size": size, "$variant": variant, type: type, ref: ref }),
71
+ return (React.createElement(StyledButton, __assign({ "aria-busy": loading || undefined, "data-a11y-skip": variant === 'primary' ? 'color-contrast' : undefined, tabIndex: 0 }, props, { "$block": block, disabled: disabled || loading, "$loading": loading, "$size": size, "$variant": variant, type: type, ref: ref }),
72
72
  React.createElement(ButtonContent, { icon: icon, iconRight: iconRight, size: size, variant: variant }, children)));
73
73
  });
74
74
  export var LinkButton = React.forwardRef(function LinkButton(_a, ref) {
@@ -90,7 +90,7 @@ export var LinkButton = React.forwardRef(function LinkButton(_a, ref) {
90
90
  });
91
91
  var disabled = disabled_ || !href_;
92
92
  var href = disabled ? undefined : href_;
93
- return (React.createElement(StyledLinkButton, __assign({}, props, { role: "button", "aria-disabled": disabled, href: href, "$disabled": disabled, "$block": block, "$size": size, "$variant": variant, ref: mergeRefs(ref, innerRef) }),
93
+ return (React.createElement(StyledLinkButton, __assign({ "data-a11y-skip": variant === 'primary' ? 'color-contrast' : undefined }, props, { role: "button", "aria-disabled": disabled, href: href, "$disabled": disabled, "$block": block, "$size": size, "$variant": variant, ref: mergeRefs(ref, innerRef) }),
94
94
  React.createElement(ButtonContent, { icon: icon, iconRight: iconRight, size: size, variant: variant }, children)));
95
95
  });
96
96
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,iBAAiB,CAAA;AAGxB;;;GAGG;AACH,SAAS,UAAU,CAAC,EAAwC;;QAAtC,IAAI,UAAA;IACxB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,oBAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,GAAG,CAAA;KACtC;SAAM,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;QACrC,OAAO,KAAK,CAAC,YAAY,CAAC,IAAI,YAAI,GAAC,gBAAgB,IAAG,MAAM,MAAG,CAAA;KAChE;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,IAAM,aAAa,GAEf,UAAC,EAA4C;;QAA1C,QAAQ,cAAA,EAAE,IAAI,UAAA,EAAE,SAAS,eAAA,EAAE,IAAI,UAAA,EAAE,OAAO,aAAA;IAC7C,OAAO,CACL;QACE,oBAAC,aAAa;YACZ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c,EAAE,CAAA;YAClB,MAAA,QAAQ,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAA;SAC1B;IACH,CAAC,CAAA;IAED,gBAAgB,CAAC;QACf,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAA;IAEF,IAAM,QAAQ,GAAG,SAAS,IAAI,CAAC,KAAK,CAAA;IACpC,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;IAEzC,OAAO,CACL,oBAAC,gBAAgB,+BACC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,IAChE,KAAK,IACT,IAAI,EAAC,QAAQ,mBACE,QAAQ,EACvB,IAAI,EAAE,IAAI,eACC,QAAQ,YACX,KAAK,WACN,IAAI,cACD,OAAO,EACjB,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC;QAE7B,oBAAC,aAAa,IACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,IAEf,QAAQ,CACK,CACC,CACpB,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -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
- var cx = classnames.bind(styles);
31
- var THRESHOLD = 99;
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, className = _a.className, qa = _a.qa, props = __rest(_a, ["items", "downloadAllUrl", "className", "qa"]);
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
- if (isDownloadAllVisible && !downloadAllUrl) {
48
- console.warn('FileList: "downloadAllUrl" is not provided');
49
- }
50
- return (React.createElement("div", __assign({ ref: ref, className: cx('file-list', className) }, props),
51
- isDownloadAllVisible && (React.createElement("div", { className: cx('file-list__download-all') },
52
- React.createElement("a", { className: cx('file-list__download-all-link'), href: downloadAllUrl },
53
- I18n.t('core.fileList.downloadAll'),
54
- ' ', "(".concat(length > THRESHOLD ? "".concat(THRESHOLD, "+") : length, ")")))),
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 url = _a.url, name = _a.name, props = __rest(_a, ["url", "name"]);
63
- var _b = parseFilename(name), filename = _b.filename, extension = _b.extension, isFilename = _b.isFilename;
64
- var _c = useOverflowObserver(), isOverflowingX = _c.isOverflowingX, ref = _c.ref;
65
- var body = isFilename ? "".concat(filename, ".") : name;
66
- return (React.createElement("div", __assign({ className: cx('file-list__item') }, props),
67
- React.createElement(Tooltip, { placement: "right", overlay: name, trigger: isOverflowingX ? 'hover' : 'none', showKeys: [] },
68
- React.createElement("div", { tabIndex: 0, className: cx('file-list__preview') },
69
- React.createElement("span", { ref: ref, className: cx('file-list__preview-text-body') }, body),
70
- isFilename && (React.createElement("span", { className: cx('file-list__preview-text-extension') }, extension)))),
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,MAAM,MAAM,kDAAkD,CAAA;AACrE,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAGpC,IAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAElC,IAAM,SAAS,GAAG,EAAE,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAGtC,SAAS,QAAQ,CAAC,EAAkD,EAAE,GAAG;IAArD,IAAA,KAAK,WAAA,EAAE,cAAc,oBAAA,EAAE,SAAS,eAAA,EAAE,EAAE,QAAA,EAAK,KAAK,cAAhD,8CAAkD,CAAF;IAClE,IAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IACrB,IAAA,MAAM,GAAK,KAAK,OAAV,CAAU;IACxB,IAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,CAAA;IAEvC,IAAI,MAAM,KAAK,CAAC,EAAE;QAChB,OAAO,IAAI,CAAA;KACZ;IAED,IAAI,oBAAoB,IAAI,CAAC,cAAc,EAAE;QAC3C,OAAO,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAA;KAC3D;IAED,OAAO,CACL,sCAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE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K;QAC9C,oBAAC,OAAO,IACN,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAC1C,QAAQ,EAAE,EAAE;YAEZ,6BAAK,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,oBAAoB,CAAC;gBACnD,8BAAM,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,8BAA8B,CAAC,IAC1D,IAAI,CACA;gBACN,UAAU,IAAI,CACb,8BAAM,SAAS,EAAE,EAAE,CAAC,mCAAmC,CAAC,IACrD,SAAS,CACL,CACR,CACG,CACE;QACV,2BAAG,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,0BAA0B,CAAC;YACrD,oBAAC,YAAY,OAAG,CACd,CACA,CACP,CAAA;AACH,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,CACL,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,KAAK;QAEhB,8BAAM,CAAC,EAAC,wCAAwC,EAAC,IAAI,EAAC,SAAS,GAAG;QAClE,2CACY,SAAS,eACT,SAAS,EACnB,CAAC,EAAC,sFAAsF,EACxF,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AACH,CAAC"}
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,E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YACjD,oBAAC,UAAU,IAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,QAAQ;gBACtC,oBAAC,8BAA8B,IAAC,QAAQ,EAAE,CAAC,IACxC,IAAI,CAC0B,CACtB,CACL,CACX;QACA,WAAW,IAAI,CACd,oBAAC,OAAO,IAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,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: FileListItem) => string;
5
+ item?: (item: FileListItemProps) => string;
6
6
  }
7
- interface FileListItem {
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
- url: string;
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: FileListItem[];
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,5 @@
1
+ export declare const items: {
2
+ name: string;
3
+ downloadUrl: string;
4
+ viewUrl: string;
5
+ }[];
@@ -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"}
@@ -244,7 +244,9 @@
244
244
  "more": "More"
245
245
  },
246
246
  "fileList": {
247
- "downloadAll": "Download All"
247
+ "downloadAll": "Download All",
248
+ "download": "Download",
249
+ "noPreview": "No Preview Available"
248
250
  },
249
251
  "tieredSelect": {
250
252
  "emptyMessage": "No locations.",
@@ -535,6 +535,8 @@ export declare const coreTranslations: {
535
535
  };
536
536
  fileList: {
537
537
  downloadAll: string;
538
+ download: string;
539
+ noPreview: string;
538
540
  };
539
541
  tieredSelect: {
540
542
  emptyMessage: string;
@@ -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/5e05f87b3/packages/core-react/src/utils/types.ts#L40"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L45"
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/5e05f87b3/packages/core-react/src/components/Avatar/Avatar.types.ts#L71"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L50"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L40"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L45"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L50"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L40"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L45"
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/5e05f87b3/packages/core-react/src/components/Avatar/Avatar.types.ts#L79"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L50"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L40"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L45"
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&#39;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/5e05f87b3/packages/core-react/src/components/Avatar/Avatar.types.ts#L12"
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&#39;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/5e05f87b3/packages/core-react/src/components/Avatar/Avatar.types.ts#L18"
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/5e05f87b3/packages/core-react/src/components/Avatar/Avatar.types.ts#L40"
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/5e05f87b3/packages/core-react/src/utils/types.ts#L50"
198
+ "sourceUrl": "https://github.com/procore/core/blob/dec1307a5/packages/core-react/src/utils/types.ts#L50"
199
199
  }
200
200
  ],
201
201
  "description": ""