@jobber/components 2.84.4-pre.11 → 2.85.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/Gallery/GalleryTypes.d.ts +31 -0
- package/dist/Gallery/index.js +5 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,25 @@ menu: Changelog
|
|
|
8
8
|
All notable changes to this project will be documented in this file.
|
|
9
9
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
10
10
|
|
|
11
|
+
## [2.85.1](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.85.0...@jobber/components@2.85.1) (2022-06-29)
|
|
12
|
+
|
|
13
|
+
**Note:** Version bump only for package @jobber/components
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# [2.85.0](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.84.3...@jobber/components@2.85.0) (2022-06-21)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **components:** Atlantis Component For Gallery ([#891](https://github.com/GetJobber/atlantis/issues/891)) ([266d2c8](https://github.com/GetJobber/atlantis/commit/266d2c897156b50859bf996d19ae972e305ac092))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
11
30
|
## [2.84.3](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.84.2...@jobber/components@2.84.3) (2022-06-13)
|
|
12
31
|
|
|
13
32
|
**Note:** Version bump only for package @jobber/components
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IconNames } from "../Icon";
|
|
2
|
+
import { FileUpload } from "../InputFile";
|
|
3
|
+
export declare type Sizes = "small" | "base" | "large" | "extraLarge";
|
|
4
|
+
export declare type FileIconsNames = Extract<IconNames, "file" | "excel" | "pdf" | "video" | "word">;
|
|
5
|
+
export interface GalleryProps {
|
|
6
|
+
/**
|
|
7
|
+
* The size of the files and their spacing in the gallery
|
|
8
|
+
* @default "base"
|
|
9
|
+
*/
|
|
10
|
+
size?: "base" | "large";
|
|
11
|
+
/**
|
|
12
|
+
* The files for the Gallery to display
|
|
13
|
+
*/
|
|
14
|
+
files: File[];
|
|
15
|
+
/**
|
|
16
|
+
* The max number of thumbnails before no more thumbnails are displayed
|
|
17
|
+
* unless the user clicks an action to display the rest
|
|
18
|
+
*/
|
|
19
|
+
max?: number;
|
|
20
|
+
/**
|
|
21
|
+
* onDelete callback - this function will be called when the delete action is
|
|
22
|
+
* triggered on a Gallery image
|
|
23
|
+
*/
|
|
24
|
+
onDelete?(file: File): void;
|
|
25
|
+
}
|
|
26
|
+
export interface File extends Pick<FileUpload, "key" | "name" | "type" | "size" | "progress"> {
|
|
27
|
+
/**
|
|
28
|
+
* The data url of the file.
|
|
29
|
+
*/
|
|
30
|
+
readonly src: string;
|
|
31
|
+
}
|
package/dist/Gallery/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __chunk_1 = require('../chunk-b67af3cb.js');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var React__default = _interopDefault(React);
|
|
10
10
|
var __chunk_2 = require('../chunk-17e02351.js');
|
|
11
|
-
require('classnames');
|
|
11
|
+
var classnames = _interopDefault(require('classnames'));
|
|
12
12
|
require('../Typography/index.js');
|
|
13
13
|
require('../Text/index.js');
|
|
14
14
|
require('@jobber/design');
|
|
@@ -33,8 +33,8 @@ require('react-image-lightbox');
|
|
|
33
33
|
var index$9 = require('../LightBox/index.js');
|
|
34
34
|
require('react-image-lightbox/style.css');
|
|
35
35
|
|
|
36
|
-
var css = ".oLHYkzv718LqMvtqFZFcZ,\n._2JSG0uYj1HSXFads63nptQ {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n grid-gap: var(--space-small);\n grid-gap: var(--space-small);\n gap: var(--space-small);\n}\n\n._2JSG0uYj1HSXFads63nptQ {\n grid-gap: var(--space-base);\n grid-gap: var(--space-base);\n gap: var(--space-base);\n}\n\n.
|
|
37
|
-
var styles = {"gallery":"oLHYkzv718LqMvtqFZFcZ","galleryLarge":"_2JSG0uYj1HSXFads63nptQ","baseShowMoreButton":"FG8mZ6UcMPRsMC9HQinY2","largeShowMoreButton":"_1cTzKosWc22qxWZSiI0CzZ"};
|
|
36
|
+
var css = ".oLHYkzv718LqMvtqFZFcZ,\n._2JSG0uYj1HSXFads63nptQ {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n grid-gap: var(--space-small);\n grid-gap: var(--space-small);\n gap: var(--space-small);\n}\n\n._2JSG0uYj1HSXFads63nptQ {\n grid-gap: var(--space-base);\n grid-gap: var(--space-base);\n gap: var(--space-base);\n}\n\n._3LkQj1p9wvHbrfXfz2nUYp {\n display: -ms-flexbox;\n display: flex;\n}\n\n.FG8mZ6UcMPRsMC9HQinY2 {\n width: 56px;\n height: 56px;\n}\n\n._1cTzKosWc22qxWZSiI0CzZ {\n width: 168px;\n height: 168px;\n box-shadow: var(--shadow-base);\n}\n";
|
|
37
|
+
var styles = {"gallery":"oLHYkzv718LqMvtqFZFcZ","galleryLarge":"_2JSG0uYj1HSXFads63nptQ","showMoreButton":"_3LkQj1p9wvHbrfXfz2nUYp","baseShowMoreButton":"FG8mZ6UcMPRsMC9HQinY2","largeShowMoreButton":"_1cTzKosWc22qxWZSiI0CzZ"};
|
|
38
38
|
__chunk_2.styleInject(css);
|
|
39
39
|
|
|
40
40
|
function Gallery(_a) {
|
|
@@ -49,9 +49,9 @@ function Gallery(_a) {
|
|
|
49
49
|
visibleFiles.map(function (file, index) {
|
|
50
50
|
return (React__default.createElement(index$8.FormatFile, { key: file.key, file: __chunk_1.__assign(__chunk_1.__assign({}, file), { src: function () { return Promise.resolve(file.src); } }), display: "compact", displaySize: size, onClick: function () {
|
|
51
51
|
handleThumbnailClicked(index);
|
|
52
|
-
}, onDelete: function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(file); } }));
|
|
52
|
+
}, onDelete: onDelete ? function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(file); } : undefined }));
|
|
53
53
|
}),
|
|
54
|
-
max && files.length > max && !displayPastMax && (React__default.createElement("div", { className: styles[size + "ShowMoreButton"] },
|
|
54
|
+
max && files.length > max && !displayPastMax && (React__default.createElement("div", { className: classnames(styles.showMoreButton, styles[size + "ShowMoreButton"]) },
|
|
55
55
|
React__default.createElement(index$5.Button, { type: "tertiary", size: size, label: "+ " + (files.length - max), fullWidth: true, onClick: function () {
|
|
56
56
|
setDisplayPastMax(true);
|
|
57
57
|
} })))),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.85.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"> 1%",
|
|
86
86
|
"IE 10"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "db1e956a1ebe6b004c55bfae41df3c09029175d0"
|
|
89
89
|
}
|