glints-aries 4.0.152 → 4.0.155
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/es/Display/Gallery/Gallery.js +14 -10
- package/es/Display/Gallery/GalleryStyle.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +0 -1
- package/lib/Display/Gallery/Gallery.js +14 -10
- package/lib/Display/Gallery/GalleryStyle.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -6
- package/package.json +1 -1
|
@@ -41,6 +41,14 @@ var Gallery = function Gallery(_ref) {
|
|
|
41
41
|
return setCurrentIndex(index - 1);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
var hasImage = React.Children.toArray(children).some(function (child) {
|
|
45
|
+
return /*#__PURE__*/React.isValidElement(child) && child.type === 'img';
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (!hasImage) {
|
|
49
|
+
console.error('Only img components allowed as children.');
|
|
50
|
+
}
|
|
51
|
+
|
|
44
52
|
React.useEffect(function componentDidMount() {
|
|
45
53
|
if (React.Children.count(children) > imagesDisplayed) setImageLeft(React.Children.count(children) - imagesDisplayed); // Disabling this warning because we want to preserver some legacy
|
|
46
54
|
// behaviour here.
|
|
@@ -61,8 +69,7 @@ var Gallery = function Gallery(_ref) {
|
|
|
61
69
|
onClick: function onClick() {
|
|
62
70
|
return handleClick(index);
|
|
63
71
|
}
|
|
64
|
-
}, /*#__PURE__*/React.
|
|
65
|
-
src: data.props.src,
|
|
72
|
+
}, /*#__PURE__*/React.cloneElement(data, {
|
|
66
73
|
alt: index.toString(10)
|
|
67
74
|
}));
|
|
68
75
|
})), /*#__PURE__*/React.createElement(Modal, {
|
|
@@ -82,9 +89,7 @@ var Gallery = function Gallery(_ref) {
|
|
|
82
89
|
}, /*#__PURE__*/React.createElement(GalleryImageWrapper, {
|
|
83
90
|
role: "banner",
|
|
84
91
|
tabIndex: 0
|
|
85
|
-
}, /*#__PURE__*/React.
|
|
86
|
-
src: data.props.src,
|
|
87
|
-
key: data.props.src + "_" + index,
|
|
92
|
+
}, /*#__PURE__*/React.cloneElement(data, {
|
|
88
93
|
alt: index.toString(10)
|
|
89
94
|
})));
|
|
90
95
|
})), /*#__PURE__*/React.createElement(GalleryThumbnailWrapper, null, React.Children.map(children, function (data, index) {
|
|
@@ -93,11 +98,10 @@ var Gallery = function Gallery(_ref) {
|
|
|
93
98
|
onClick: function onClick() {
|
|
94
99
|
return handleClickThumbs(index);
|
|
95
100
|
}
|
|
96
|
-
}, /*#__PURE__*/React.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
alt: index.toString(10)
|
|
100
|
-
className: index === currentIndex ? 'active' : null
|
|
101
|
+
}, /*#__PURE__*/React.cloneElement(data, {
|
|
102
|
+
className: index === currentIndex ? 'active' : null,
|
|
103
|
+
'data-testid': 'gallery_thumbnail',
|
|
104
|
+
alt: index.toString(10)
|
|
101
105
|
}));
|
|
102
106
|
}))));
|
|
103
107
|
};
|
|
@@ -21,7 +21,7 @@ export var GalleryItem = styled.div.withConfig({
|
|
|
21
21
|
export var GalleryImageWrapper = styled.div.withConfig({
|
|
22
22
|
displayName: "GalleryStyle__GalleryImageWrapper",
|
|
23
23
|
componentId: "sc-mrr504-3"
|
|
24
|
-
})(["position:relative;display:flex;justify-content:center;align-items:center;img{height:50vh;width:
|
|
24
|
+
})(["position:relative;display:flex;justify-content:center;align-items:center;img{height:50vh;width:100%;object-fit:contain;}"]);
|
|
25
25
|
export var GalleryThumbnailWrapper = styled.div.withConfig({
|
|
26
26
|
displayName: "GalleryStyle__GalleryThumbnailWrapper",
|
|
27
27
|
componentId: "sc-mrr504-4"
|
package/es/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { default as Drawer } from './Navigation/Drawer';
|
|
|
11
11
|
export { default as Dropdown } from './Navigation/Dropdown';
|
|
12
12
|
export { default as Gallery } from './Display/Gallery';
|
|
13
13
|
export { Box } from './Layout/Box';
|
|
14
|
-
export { ResponsiveSpacing } from './Layout/Box/types';
|
|
14
|
+
export type { ResponsiveSpacing } from './Layout/Box/types';
|
|
15
15
|
export { Flex } from './Layout/Flex';
|
|
16
16
|
export { default as Grid } from './Layout/Grid';
|
|
17
17
|
export { default as Heading } from './General/Heading';
|
package/es/index.js
CHANGED
|
@@ -14,7 +14,6 @@ export { default as Drawer } from './Navigation/Drawer';
|
|
|
14
14
|
export { default as Dropdown } from './Navigation/Dropdown';
|
|
15
15
|
export { default as Gallery } from './Display/Gallery';
|
|
16
16
|
export { Box } from './Layout/Box';
|
|
17
|
-
export { ResponsiveSpacing } from './Layout/Box/types';
|
|
18
17
|
export { Flex } from './Layout/Flex';
|
|
19
18
|
export { default as Grid } from './Layout/Grid';
|
|
20
19
|
export { default as Heading } from './General/Heading';
|
|
@@ -55,6 +55,14 @@ var Gallery = function Gallery(_ref) {
|
|
|
55
55
|
return setCurrentIndex(index - 1);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
var hasImage = React.Children.toArray(children).some(function (child) {
|
|
59
|
+
return /*#__PURE__*/React.isValidElement(child) && child.type === 'img';
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (!hasImage) {
|
|
63
|
+
console.error('Only img components allowed as children.');
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
React.useEffect(function componentDidMount() {
|
|
59
67
|
if (React.Children.count(children) > imagesDisplayed) setImageLeft(React.Children.count(children) - imagesDisplayed); // Disabling this warning because we want to preserver some legacy
|
|
60
68
|
// behaviour here.
|
|
@@ -75,8 +83,7 @@ var Gallery = function Gallery(_ref) {
|
|
|
75
83
|
onClick: function onClick() {
|
|
76
84
|
return handleClick(index);
|
|
77
85
|
}
|
|
78
|
-
}, /*#__PURE__*/React.
|
|
79
|
-
src: data.props.src,
|
|
86
|
+
}, /*#__PURE__*/React.cloneElement(data, {
|
|
80
87
|
alt: index.toString(10)
|
|
81
88
|
}));
|
|
82
89
|
})), /*#__PURE__*/React.createElement(_Modal["default"], {
|
|
@@ -96,9 +103,7 @@ var Gallery = function Gallery(_ref) {
|
|
|
96
103
|
}, /*#__PURE__*/React.createElement(_GalleryStyle.GalleryImageWrapper, {
|
|
97
104
|
role: "banner",
|
|
98
105
|
tabIndex: 0
|
|
99
|
-
}, /*#__PURE__*/React.
|
|
100
|
-
src: data.props.src,
|
|
101
|
-
key: data.props.src + "_" + index,
|
|
106
|
+
}, /*#__PURE__*/React.cloneElement(data, {
|
|
102
107
|
alt: index.toString(10)
|
|
103
108
|
})));
|
|
104
109
|
})), /*#__PURE__*/React.createElement(_GalleryStyle.GalleryThumbnailWrapper, null, React.Children.map(children, function (data, index) {
|
|
@@ -107,11 +112,10 @@ var Gallery = function Gallery(_ref) {
|
|
|
107
112
|
onClick: function onClick() {
|
|
108
113
|
return handleClickThumbs(index);
|
|
109
114
|
}
|
|
110
|
-
}, /*#__PURE__*/React.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
alt: index.toString(10)
|
|
114
|
-
className: index === currentIndex ? 'active' : null
|
|
115
|
+
}, /*#__PURE__*/React.cloneElement(data, {
|
|
116
|
+
className: index === currentIndex ? 'active' : null,
|
|
117
|
+
'data-testid': 'gallery_thumbnail',
|
|
118
|
+
alt: index.toString(10)
|
|
115
119
|
}));
|
|
116
120
|
}))));
|
|
117
121
|
};
|
|
@@ -39,7 +39,7 @@ exports.GalleryItem = GalleryItem;
|
|
|
39
39
|
var GalleryImageWrapper = _styledComponents["default"].div.withConfig({
|
|
40
40
|
displayName: "GalleryStyle__GalleryImageWrapper",
|
|
41
41
|
componentId: "sc-mrr504-3"
|
|
42
|
-
})(["position:relative;display:flex;justify-content:center;align-items:center;img{height:50vh;width:
|
|
42
|
+
})(["position:relative;display:flex;justify-content:center;align-items:center;img{height:50vh;width:100%;object-fit:contain;}"]);
|
|
43
43
|
|
|
44
44
|
exports.GalleryImageWrapper = GalleryImageWrapper;
|
|
45
45
|
|
package/lib/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { default as Drawer } from './Navigation/Drawer';
|
|
|
11
11
|
export { default as Dropdown } from './Navigation/Dropdown';
|
|
12
12
|
export { default as Gallery } from './Display/Gallery';
|
|
13
13
|
export { Box } from './Layout/Box';
|
|
14
|
-
export { ResponsiveSpacing } from './Layout/Box/types';
|
|
14
|
+
export type { ResponsiveSpacing } from './Layout/Box/types';
|
|
15
15
|
export { Flex } from './Layout/Flex';
|
|
16
16
|
export { default as Grid } from './Layout/Grid';
|
|
17
17
|
export { default as Heading } from './General/Heading';
|
package/lib/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.Greyscale = exports.GraduationHatIcon = exports.GlobeIcon = exports.GlintsContainer = exports.GithubIcon = exports.Gallery = exports.FullScreenIcon = exports.FolderIcon = exports.Flex = exports.FlagIcon = exports.FilterIcon = exports.FileSolidIcon = exports.FilePreviewIcon = exports.FileIcon = exports.FileAlternateIcon = exports.FacebookIcon = exports.EyeSolidIcon = exports.EyeSlashedIcon = exports.EyeIcon = exports.ExternalLinkIcon = exports.ExitFullScreenIcon = exports.ExclamationIcon = exports.EditOutlineIcon = exports.EditIcon = exports.Dropdown = exports.Drawer = exports.DragStripesIcon = exports.DragArrowIcon = exports.DownshiftSelectSubComponents = exports.DownshiftSelectItemToString = exports.DownshiftSelectDefaultTransformFunction = exports.DownshiftSelect = exports.DownloadIcon = exports.DoveIcon = exports.DoubleCheckmarkIcon = exports.DotIcon = exports.DocumentCheckIcon = exports.Divider = exports.DiscountSolidIcon = exports.Device = exports.DeleteIcon = exports.CurrencyIcon = exports.CopyOutlinedIcon = exports.CopyLinkIcon = exports.CopyIcon = exports.ConnectionIcon = exports.CompassIcon = exports.CommunityIcon = exports.Collapsible = exports.CodepenIcon = exports.CloudUploadIcon = exports.CloudDownloadIcon = exports.CloseIcon = exports.CloseCircleSolidIcon = exports.ClockIcon = exports.ClipboardIcon = exports.ClipboardCheckOutlineIcon = exports.CircleIcon = exports.CircleAndCheckIcon = exports.CheckmarkThickIcon = exports.CheckmarkSolidIcon = exports.CheckmarkIcon = exports.ChecklistIcon = exports.Checkbox = exports.CameraIcon = exports.CalendarIcon = exports.Button = exports.BulletListIcon = exports.BuildingSolidIcon = exports.BriefcaseSolidIcon = exports.Breadcrumb = exports.Brand = exports.BoxWithHandleSolidIcon = exports.Box = exports.BookmarkRoundedOutlineIcon = exports.BookmarkOutlineIcon = exports.BookmarkIcon = exports.BellIcon = exports.BehanceIcon = exports.Badge = exports.AttachmentIcon = exports.AsteriskSolidIcon = exports.ArrowUpSolidIcon = exports.ArrowUpIcon = exports.ArrowRoundForwardIcon = exports.ArrowRoundBackIcon = exports.ArrowNextSolidIcon = exports.ArrowNextIcon = exports.ArrowNextDoubleIcon = exports.ArrowDownSolidIcon = exports.ArrowDownIcon = exports.ArrowDownCircleOutlineIcon = exports.ArrowBackSolidIcon = exports.ArrowBackIcon = exports.ArrowBackDoubleIcon = exports.Alert = exports.AddIcon = exports.AddCircleSolidIcon = exports.AddCircleOutlineIcon = exports.Accordion = void 0;
|
|
7
|
-
exports.ThumbsUpOutlineIcon = exports.ThumbsUpIcon = exports.Textarea = exports.TextField = exports.TelegramIcon = exports.TaskIcon = exports.TagIcon = exports.Tag = exports.Tabs = exports.Swipeable = exports.StarOutlineIcon = exports.StarIcon = exports.StarCircleIcon = exports.StackIcon = exports.SpinnerIcon = exports.SpeechBubbleOutlineIcon = exports.SpeechBubbleIcon = exports.SpeakerIcon = exports.Slider = exports.ShieldCheckIcon = exports.ShareScreenIcon = exports.ShareOutlineIcon = exports.ShareIcon = exports.ShareArrowOutlineIcon = exports.ShareArrowIcon = exports.Shadow = exports.SettingSolidIcon = exports.SettingIcon = exports.SendIcon = exports.Select = exports.SecondaryColor = exports.SearchIcon = exports.ScreenSize = exports.SaveSolidIcon = exports.SalaryIcon = exports.RssIcon = exports.RotateIcon = exports.ResumeOutlineIcon = exports.
|
|
8
|
-
exports.defaultEmptyListText = exports.ZaloIcon = exports.YoutubeIcon = exports.WhatsappIcon = exports.WarningSolidIcon = exports.WarningOutlineIcon = exports.WarningIcon = exports.WarningCircleSolidIcon = exports.VimeoIcon = exports.ViewIcon = exports.VideoOffIcon = exports.VideoIcon = exports.UserWrenchIcon = exports.UserIcon = exports.UserCogIcon = exports.UpvoteIcon = exports.UploadIcon = exports.Typography = exports.TwitterIcon = exports.TvPlayIcon = exports.TrashIcon = exports.Tooltip = exports.ToggleSwitch = exports.TieIcon =
|
|
7
|
+
exports.TicketSolidIcon = exports.ThumbsUpOutlineIcon = exports.ThumbsUpIcon = exports.Textarea = exports.TextField = exports.TelegramIcon = exports.TaskIcon = exports.TagIcon = exports.Tag = exports.Tabs = exports.Swipeable = exports.StarOutlineIcon = exports.StarIcon = exports.StarCircleIcon = exports.StackIcon = exports.SpinnerIcon = exports.SpeechBubbleOutlineIcon = exports.SpeechBubbleIcon = exports.SpeakerIcon = exports.Slider = exports.ShieldCheckIcon = exports.ShareScreenIcon = exports.ShareOutlineIcon = exports.ShareIcon = exports.ShareArrowOutlineIcon = exports.ShareArrowIcon = exports.Shadow = exports.SettingSolidIcon = exports.SettingIcon = exports.SendIcon = exports.Select = exports.SecondaryColor = exports.SearchIcon = exports.ScreenSize = exports.SaveSolidIcon = exports.SalaryIcon = exports.RssIcon = exports.RotateIcon = exports.ResumeOutlineIcon = exports.ReplyIcon = exports.RefreshSolidIcon = exports.RadioButton = exports.QuotationIcon = exports.QuestionOutlineIcon = exports.PuzzleIcon = exports.ProfilePicture = exports.PrimaryColor = exports.PowerIcon = exports.Popover = exports.PointingModal = exports.PhoneNumberInput = exports.PhoneIcon = exports.PdfOutlineIcon = exports.PdfIcon = exports.OnlineIcon = exports.NumberListIcon = exports.NumberInput = exports.NotificationIcon = exports.NameTagIcon = exports.MoreIcon = exports.MoreHorizontalIcon = exports.Modal = exports.MinusIcon = exports.MinusCircleSolidIcon = exports.MinusCircleIcon = exports.MicOffIcon = exports.MicIcon = exports.MessageOutlineIncomingIcon = exports.MessageOutlineIcon = exports.MenuIcon = exports.MenuHalfIcon = exports.MedalIcon = exports.MailSolidIcon = exports.MailIcon = exports.LockSolidIcon = exports.LocationIcon = exports.LoadingIcon = exports.Loading = exports.LinkedinIcon = exports.LineIcon = exports.LightningOutlineIcon = exports.LightbulbIcon = exports.JobSearchIcon = exports.JobOutlineIcon = exports.InstagramIcon = exports.InfoSolidIcon = exports.InfoIcon = exports.ImageIcon = exports.Icon = exports.HourglassIcon = exports.HomeIcon = exports.HelpIcon = exports.HeartSolidIcon = exports.HeartIcon = exports.Heading = exports.HandShakeIcon = exports.HandIcon = exports.GuaranteeIcon = exports.GroupIcon = exports.Grid = void 0;
|
|
8
|
+
exports.defaultEmptyListText = exports.ZaloIcon = exports.YoutubeIcon = exports.WhatsappIcon = exports.WarningSolidIcon = exports.WarningOutlineIcon = exports.WarningIcon = exports.WarningCircleSolidIcon = exports.VimeoIcon = exports.ViewIcon = exports.VideoOffIcon = exports.VideoIcon = exports.UserWrenchIcon = exports.UserIcon = exports.UserCogIcon = exports.UpvoteIcon = exports.UploadIcon = exports.Typography = exports.TwitterIcon = exports.TvPlayIcon = exports.TrashIcon = exports.Tooltip = exports.ToggleSwitch = exports.TieIcon = void 0;
|
|
9
9
|
|
|
10
10
|
var _Accordion = _interopRequireDefault(require("./Display/Accordion"));
|
|
11
11
|
|
|
@@ -59,10 +59,6 @@ var _Box = require("./Layout/Box");
|
|
|
59
59
|
|
|
60
60
|
exports.Box = _Box.Box;
|
|
61
61
|
|
|
62
|
-
var _types = require("./Layout/Box/types");
|
|
63
|
-
|
|
64
|
-
exports.ResponsiveSpacing = _types.ResponsiveSpacing;
|
|
65
|
-
|
|
66
62
|
var _Flex = require("./Layout/Flex");
|
|
67
63
|
|
|
68
64
|
exports.Flex = _Flex.Flex;
|