@algolia/satellite 1.0.0-beta.114 → 1.0.0-beta.118
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +1 -1
- package/cjs/AutoComplete/AutoComplete.tailwind.js +1 -1
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.d.ts +1 -1
- package/cjs/Avatars/ApplicationAvatar.d.ts +13 -0
- package/cjs/Avatars/ApplicationAvatar.js +43 -0
- package/cjs/Avatars/UserAvatar.d.ts +13 -0
- package/cjs/Avatars/UserAvatar.js +64 -0
- package/cjs/Avatars/index.d.ts +3 -0
- package/cjs/Avatars/index.js +46 -0
- package/cjs/Avatars/types.d.ts +17 -0
- package/cjs/Avatars/types.js +5 -0
- package/cjs/Avatars/utils.d.ts +6 -0
- package/cjs/Avatars/utils.js +82 -0
- package/cjs/Card/Card.tailwind.js +2 -1
- package/cjs/Dropdown/Dropdown.d.ts +8 -2
- package/cjs/Dropdown/Dropdown.js +17 -2
- package/cjs/Dropdown/DropdownButton.d.ts +2 -0
- package/cjs/Dropdown/DropdownButton.js +4 -2
- package/cjs/Dropdown/components/DropdownButtonItem.js +10 -4
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +12 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +75 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +7 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +26 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.d.ts +7 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.js +23 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +9 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +50 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +9 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +46 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/index.d.ts +5 -0
- package/cjs/Dropdown/components/DropdownCollapsibleItem/index.js +72 -0
- package/cjs/Dropdown/components/DropdownFooterItem.d.ts +7 -0
- package/cjs/Dropdown/components/DropdownFooterItem.js +38 -0
- package/cjs/Dropdown/components/DropdownLinkItem.js +1 -1
- package/cjs/Dropdown/components/DropdownRadioItem.js +3 -3
- package/cjs/Dropdown/index.d.ts +2 -0
- package/cjs/Dropdown/index.js +28 -0
- package/cjs/Modal/Modal.d.ts +1 -1
- package/cjs/Modal/Modal.js +10 -7
- package/cjs/Modal/Modal.tailwind.js +0 -5
- package/cjs/Modal/components/ModalSection.d.ts +10 -0
- package/cjs/Modal/components/ModalSection.js +32 -0
- package/cjs/Modal/index.d.ts +2 -0
- package/cjs/Modal/index.js +28 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +21 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.js +78 -0
- package/cjs/Pagination/CompactPagination/index.d.ts +2 -0
- package/cjs/Pagination/CompactPagination/index.js +32 -0
- package/cjs/Pagination/DotPagination/DotPagination.d.ts +9 -0
- package/cjs/Pagination/DotPagination/DotPagination.js +40 -0
- package/cjs/Pagination/DotPagination/index.d.ts +2 -0
- package/cjs/Pagination/DotPagination/index.js +32 -0
- package/cjs/Pagination/{Pagination.d.ts → Pagination/Pagination.d.ts} +1 -1
- package/cjs/Pagination/{Pagination.js → Pagination/Pagination.js} +3 -3
- package/cjs/Pagination/Pagination/index.d.ts +2 -0
- package/cjs/Pagination/Pagination/index.js +32 -0
- package/cjs/Pagination/index.d.ts +2 -0
- package/cjs/Pagination/index.js +28 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +14 -0
- package/cjs/utils/hashCode.d.ts +2 -0
- package/cjs/utils/hashCode.js +28 -0
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +1 -1
- package/esm/AutoComplete/AutoComplete.tailwind.js +1 -1
- package/esm/AutoComplete/components/AutoCompleteEmptyState.d.ts +1 -1
- package/esm/Avatars/ApplicationAvatar.d.ts +13 -0
- package/esm/Avatars/ApplicationAvatar.js +27 -0
- package/esm/Avatars/UserAvatar.d.ts +13 -0
- package/esm/Avatars/UserAvatar.js +42 -0
- package/esm/Avatars/index.d.ts +3 -0
- package/esm/Avatars/index.js +3 -0
- package/esm/Avatars/types.d.ts +17 -0
- package/esm/Avatars/types.js +1 -0
- package/esm/Avatars/utils.d.ts +6 -0
- package/esm/Avatars/utils.js +56 -0
- package/esm/Card/Card.tailwind.js +2 -1
- package/esm/Dropdown/Dropdown.d.ts +8 -2
- package/esm/Dropdown/Dropdown.js +15 -2
- package/esm/Dropdown/DropdownButton.d.ts +2 -0
- package/esm/Dropdown/DropdownButton.js +4 -2
- package/esm/Dropdown/components/DropdownButtonItem.js +8 -4
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +12 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +51 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +7 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +13 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.d.ts +7 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.js +11 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +9 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +30 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +9 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +27 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/index.d.ts +5 -0
- package/esm/Dropdown/components/DropdownCollapsibleItem/index.js +5 -0
- package/esm/Dropdown/components/DropdownFooterItem.d.ts +7 -0
- package/esm/Dropdown/components/DropdownFooterItem.js +21 -0
- package/esm/Dropdown/components/DropdownLinkItem.js +1 -1
- package/esm/Dropdown/components/DropdownRadioItem.js +3 -3
- package/esm/Dropdown/index.d.ts +2 -0
- package/esm/Dropdown/index.js +2 -0
- package/esm/Modal/Modal.d.ts +1 -1
- package/esm/Modal/Modal.js +10 -7
- package/esm/Modal/Modal.tailwind.js +0 -5
- package/esm/Modal/components/ModalSection.d.ts +10 -0
- package/esm/Modal/components/ModalSection.js +17 -0
- package/esm/Modal/index.d.ts +2 -0
- package/esm/Modal/index.js +2 -0
- package/esm/Pagination/CompactPagination/CompactPagination.d.ts +21 -0
- package/esm/Pagination/CompactPagination/CompactPagination.js +56 -0
- package/esm/Pagination/CompactPagination/index.d.ts +2 -0
- package/esm/Pagination/CompactPagination/index.js +2 -0
- package/esm/Pagination/DotPagination/DotPagination.d.ts +9 -0
- package/esm/Pagination/DotPagination/DotPagination.js +26 -0
- package/esm/Pagination/DotPagination/index.d.ts +2 -0
- package/esm/Pagination/DotPagination/index.js +2 -0
- package/esm/Pagination/{Pagination.d.ts → Pagination/Pagination.d.ts} +1 -1
- package/esm/Pagination/{Pagination.js → Pagination/Pagination.js} +3 -3
- package/esm/Pagination/Pagination/index.d.ts +2 -0
- package/esm/Pagination/Pagination/index.js +2 -0
- package/esm/Pagination/index.d.ts +2 -0
- package/esm/Pagination/index.js +2 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/utils/hashCode.d.ts +2 -0
- package/esm/utils/hashCode.js +18 -0
- package/package.json +2 -1
- package/satellite.css +2 -5
- package/satellite.min.css +1 -1
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
var _exportNames = {};
|
9
|
+
Object.defineProperty(exports, "default", {
|
10
|
+
enumerable: true,
|
11
|
+
get: function get() {
|
12
|
+
return _CompactPagination["default"];
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
var _CompactPagination = _interopRequireWildcard(require("./CompactPagination"));
|
17
|
+
|
18
|
+
Object.keys(_CompactPagination).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
21
|
+
if (key in exports && exports[key] === _CompactPagination[key]) return;
|
22
|
+
Object.defineProperty(exports, key, {
|
23
|
+
enumerable: true,
|
24
|
+
get: function get() {
|
25
|
+
return _CompactPagination[key];
|
26
|
+
}
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
+
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare type DotPaginationProps = {
|
3
|
+
/** Currently selected page (1 based index) */
|
4
|
+
currentPage: number;
|
5
|
+
onChange: (page: number) => void;
|
6
|
+
nbPages: number;
|
7
|
+
};
|
8
|
+
export declare const DotPagination: ({ currentPage, onChange, nbPages }: DotPaginationProps) => JSX.Element;
|
9
|
+
export default DotPagination;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = exports.DotPagination = void 0;
|
9
|
+
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
+
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
14
|
+
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
15
|
+
|
16
|
+
var _templateObject, _templateObject2;
|
17
|
+
|
18
|
+
var DotPagination = function DotPagination(_ref) {
|
19
|
+
var currentPage = _ref.currentPage,
|
20
|
+
onChange = _ref.onChange,
|
21
|
+
nbPages = _ref.nbPages;
|
22
|
+
return /*#__PURE__*/_react["default"].createElement("ul", {
|
23
|
+
className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex"])))
|
24
|
+
}, new Array(nbPages).fill(undefined).map(function (_, idx) {
|
25
|
+
var pageIdx = idx + 1;
|
26
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
27
|
+
key: idx
|
28
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
29
|
+
"aria-label": "Go to page ".concat(pageIdx),
|
30
|
+
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n h-3 w-3 rounded-full mx-1\n ", "\n "])), currentPage === pageIdx ? "bg-accent-600" : "bg-grey-200"),
|
31
|
+
onClick: function onClick() {
|
32
|
+
return onChange(pageIdx);
|
33
|
+
}
|
34
|
+
}));
|
35
|
+
}));
|
36
|
+
};
|
37
|
+
|
38
|
+
exports.DotPagination = DotPagination;
|
39
|
+
var _default = DotPagination;
|
40
|
+
exports["default"] = _default;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
var _exportNames = {};
|
9
|
+
Object.defineProperty(exports, "default", {
|
10
|
+
enumerable: true,
|
11
|
+
get: function get() {
|
12
|
+
return _DotPagination["default"];
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
var _DotPagination = _interopRequireWildcard(require("./DotPagination"));
|
17
|
+
|
18
|
+
Object.keys(_DotPagination).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
21
|
+
if (key in exports && exports[key] === _DotPagination[key]) return;
|
22
|
+
Object.defineProperty(exports, key, {
|
23
|
+
enumerable: true,
|
24
|
+
get: function get() {
|
25
|
+
return _DotPagination[key];
|
26
|
+
}
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
+
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -12,5 +12,5 @@ export interface PaginationProps {
|
|
12
12
|
* - Don't use on list with less than 20 items
|
13
13
|
* - Place the pagination at the bottom of the split item
|
14
14
|
*/
|
15
|
-
export declare const Pagination: ({ currentPage, nbPages, onChange, maxButtons: maxButtonsParam }: PaginationProps) => JSX.Element;
|
15
|
+
export declare const Pagination: ({ currentPage, nbPages, onChange, maxButtons: maxButtonsParam, }: PaginationProps) => JSX.Element;
|
16
16
|
export default Pagination;
|
@@ -15,11 +15,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
16
16
|
var _reactFeather = require("react-feather");
|
17
17
|
|
18
|
-
var _satellitePrefixer = _interopRequireDefault(require("
|
18
|
+
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
19
19
|
|
20
|
-
var _range = _interopRequireDefault(require("
|
20
|
+
var _range = _interopRequireDefault(require("../../utils/range"));
|
21
21
|
|
22
|
-
var _Button = _interopRequireWildcard(require("
|
22
|
+
var _Button = _interopRequireWildcard(require("../../Button"));
|
23
23
|
|
24
24
|
var _templateObject;
|
25
25
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
var _exportNames = {};
|
9
|
+
Object.defineProperty(exports, "default", {
|
10
|
+
enumerable: true,
|
11
|
+
get: function get() {
|
12
|
+
return _Pagination["default"];
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
var _Pagination = _interopRequireWildcard(require("./Pagination"));
|
17
|
+
|
18
|
+
Object.keys(_Pagination).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
21
|
+
if (key in exports && exports[key] === _Pagination[key]) return;
|
22
|
+
Object.defineProperty(exports, key, {
|
23
|
+
enumerable: true,
|
24
|
+
get: function get() {
|
25
|
+
return _Pagination[key];
|
26
|
+
}
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
+
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/cjs/Pagination/index.js
CHANGED
@@ -27,6 +27,34 @@ Object.keys(_Pagination).forEach(function (key) {
|
|
27
27
|
});
|
28
28
|
});
|
29
29
|
|
30
|
+
var _DotPagination = require("./DotPagination");
|
31
|
+
|
32
|
+
Object.keys(_DotPagination).forEach(function (key) {
|
33
|
+
if (key === "default" || key === "__esModule") return;
|
34
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
35
|
+
if (key in exports && exports[key] === _DotPagination[key]) return;
|
36
|
+
Object.defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _DotPagination[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
|
44
|
+
var _CompactPagination = require("./CompactPagination");
|
45
|
+
|
46
|
+
Object.keys(_CompactPagination).forEach(function (key) {
|
47
|
+
if (key === "default" || key === "__esModule") return;
|
48
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
49
|
+
if (key in exports && exports[key] === _CompactPagination[key]) return;
|
50
|
+
Object.defineProperty(exports, key, {
|
51
|
+
enumerable: true,
|
52
|
+
get: function get() {
|
53
|
+
return _CompactPagination[key];
|
54
|
+
}
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
30
58
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
59
|
|
32
60
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/cjs/index.d.ts
CHANGED
@@ -6,6 +6,7 @@ export { default as makePurgeCssExtractor } from "./styles/helpers/makePurgeCssE
|
|
6
6
|
export * from "./utils/parseUrl";
|
7
7
|
export * from "./AnnouncementBadge";
|
8
8
|
export * from "./AutoComplete";
|
9
|
+
export * from "./Avatars";
|
9
10
|
export * from "./Badge";
|
10
11
|
export * from "./Banner";
|
11
12
|
export * from "./Button";
|
package/cjs/index.js
CHANGED
@@ -100,6 +100,20 @@ Object.keys(_AutoComplete).forEach(function (key) {
|
|
100
100
|
});
|
101
101
|
});
|
102
102
|
|
103
|
+
var _Avatars = require("./Avatars");
|
104
|
+
|
105
|
+
Object.keys(_Avatars).forEach(function (key) {
|
106
|
+
if (key === "default" || key === "__esModule") return;
|
107
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
108
|
+
if (key in exports && exports[key] === _Avatars[key]) return;
|
109
|
+
Object.defineProperty(exports, key, {
|
110
|
+
enumerable: true,
|
111
|
+
get: function get() {
|
112
|
+
return _Avatars[key];
|
113
|
+
}
|
114
|
+
});
|
115
|
+
});
|
116
|
+
|
103
117
|
var _Badge = require("./Badge");
|
104
118
|
|
105
119
|
Object.keys(_Badge).forEach(function (key) {
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = exports.hashCode = void 0;
|
7
|
+
|
8
|
+
// https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript?rq=1
|
9
|
+
var hashCode = function hashCode(value) {
|
10
|
+
var hash = 0;
|
11
|
+
|
12
|
+
if (value.length === 0) {
|
13
|
+
return hash;
|
14
|
+
}
|
15
|
+
|
16
|
+
for (var i = 0; i < value.length; i++) {
|
17
|
+
var _char = value.charCodeAt(i);
|
18
|
+
|
19
|
+
hash = (hash << 5) - hash + _char;
|
20
|
+
hash = hash & hash; // Convert to 32bit integer
|
21
|
+
}
|
22
|
+
|
23
|
+
return hash;
|
24
|
+
};
|
25
|
+
|
26
|
+
exports.hashCode = hashCode;
|
27
|
+
var _default = hashCode;
|
28
|
+
exports["default"] = _default;
|
@@ -2,7 +2,7 @@ import React, { FunctionComponent } from "react";
|
|
2
2
|
export declare type AnnouncementBadgeSizes = "default" | "small";
|
3
3
|
export interface AnnouncementBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
4
4
|
size?: AnnouncementBadgeSizes;
|
5
|
-
text?: "new" | "beta" | "internal";
|
5
|
+
text?: "new" | "beta" | "internal" | "pilot";
|
6
6
|
variant?: "accent" | "red";
|
7
7
|
children?: never;
|
8
8
|
}
|
@@ -7,5 +7,5 @@ export interface AutoCompleteEmptyStateProps {
|
|
7
7
|
title: React.ReactNode;
|
8
8
|
description?: React.ReactNode;
|
9
9
|
}
|
10
|
-
export declare const AutoCompleteEmptyState: ({ icon, variant, title, description }: AutoCompleteEmptyStateProps) => JSX.Element;
|
10
|
+
export declare const AutoCompleteEmptyState: ({ icon, variant, title, description, }: AutoCompleteEmptyStateProps) => JSX.Element;
|
11
11
|
export default AutoCompleteEmptyState;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { ApplicationAvatarSize, MinimalApplication } from "./types";
|
3
|
+
interface ApplicationAvatarProps {
|
4
|
+
/** A minimal application object containing `applicationID` and `name`. */
|
5
|
+
application: MinimalApplication;
|
6
|
+
/** @default "medium" */
|
7
|
+
size?: ApplicationAvatarSize;
|
8
|
+
/** @ignore */
|
9
|
+
className?: string;
|
10
|
+
}
|
11
|
+
/** The `ApplicationAvatar` is used as a visual representation of an application. */
|
12
|
+
export declare const ApplicationAvatar: ({ className, application, size }: ApplicationAvatarProps) => JSX.Element;
|
13
|
+
export default ApplicationAvatar;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
+
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
4
|
+
|
5
|
+
import React from "react";
|
6
|
+
import cx from "classnames";
|
7
|
+
import stl from "../styles/helpers/satellitePrefixer";
|
8
|
+
import { getApplicationInitials, pickApplicationColors } from "./utils";
|
9
|
+
var SIZE_CLASSNAMES = {
|
10
|
+
small: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-4 h-4"]))),
|
11
|
+
medium: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["w-8 h-8"])))
|
12
|
+
};
|
13
|
+
|
14
|
+
/** The `ApplicationAvatar` is used as a visual representation of an application. */
|
15
|
+
export var ApplicationAvatar = function ApplicationAvatar(_ref) {
|
16
|
+
var className = _ref.className,
|
17
|
+
application = _ref.application,
|
18
|
+
_ref$size = _ref.size,
|
19
|
+
size = _ref$size === void 0 ? "medium" : _ref$size;
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
21
|
+
className: cx(stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["rounded inline-flex flex-shrink-0 items-center justify-center uppercase"]))), pickApplicationColors(application.applicationId), SIZE_CLASSNAMES[size], className),
|
22
|
+
style: size === "small" ? {
|
23
|
+
fontSize: "8px"
|
24
|
+
} : {}
|
25
|
+
}, getApplicationInitials(application));
|
26
|
+
};
|
27
|
+
export default ApplicationAvatar;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { MinimalUser } from "./types";
|
3
|
+
export declare type UserAvatarProps = {
|
4
|
+
/** A minimal user object containing `name`, `email` and `avatar`. */
|
5
|
+
user: MinimalUser;
|
6
|
+
/** @default 32 */
|
7
|
+
size?: number;
|
8
|
+
/** @ignore */
|
9
|
+
className?: string;
|
10
|
+
};
|
11
|
+
/** The `UserAvatar` is used as a visual representation of a user. */
|
12
|
+
export declare const UserAvatar: ({ className, user, size }: UserAvatarProps) => JSX.Element;
|
13
|
+
export default UserAvatar;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
+
|
4
|
+
var _templateObject, _templateObject2;
|
5
|
+
|
6
|
+
import React, { useState } from "react";
|
7
|
+
import cx from "classnames";
|
8
|
+
import stl from "../styles/helpers/satellitePrefixer";
|
9
|
+
import { getUserInitials, getUserBackgroundClassName } from "./utils";
|
10
|
+
|
11
|
+
/** The `UserAvatar` is used as a visual representation of a user. */
|
12
|
+
export var UserAvatar = function UserAvatar(_ref) {
|
13
|
+
var _user$email;
|
14
|
+
|
15
|
+
var className = _ref.className,
|
16
|
+
user = _ref.user,
|
17
|
+
_ref$size = _ref.size,
|
18
|
+
size = _ref$size === void 0 ? 32 : _ref$size;
|
19
|
+
|
20
|
+
var _useState = useState(false),
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
22
|
+
failedToLoadAvatar = _useState2[0],
|
23
|
+
setFailedToLoadAvatar = _useState2[1];
|
24
|
+
|
25
|
+
var initials = getUserInitials(user);
|
26
|
+
var hasValidAvatar = user.avatar && !failedToLoadAvatar;
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
28
|
+
className: cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["relative overflow-hidden flex justify-center items-center rounded-full text-white uppercase"]))), !hasValidAvatar && getUserBackgroundClassName((_user$email = user.email) !== null && _user$email !== void 0 ? _user$email : "no-email"), className),
|
29
|
+
style: {
|
30
|
+
width: size,
|
31
|
+
height: size
|
32
|
+
}
|
33
|
+
}, /*#__PURE__*/React.createElement("span", null, initials), hasValidAvatar && /*#__PURE__*/React.createElement("img", {
|
34
|
+
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["w-full absolute top-0 left-0"]))),
|
35
|
+
src: user.avatar,
|
36
|
+
alt: "".concat(user.name || user.email, "'s avatar"),
|
37
|
+
onError: function onError() {
|
38
|
+
return setFailedToLoadAvatar(true);
|
39
|
+
}
|
40
|
+
}));
|
41
|
+
};
|
42
|
+
export default UserAvatar;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare type ApplicationAvatarSize = "small" | "medium";
|
2
|
+
export declare type MinimalApplication = {
|
3
|
+
applicationId: string;
|
4
|
+
name?: string;
|
5
|
+
};
|
6
|
+
declare type UserAvatarWithName = {
|
7
|
+
name: string;
|
8
|
+
email?: string;
|
9
|
+
};
|
10
|
+
declare type UserAvatarWithEmail = {
|
11
|
+
email: string;
|
12
|
+
name?: string;
|
13
|
+
};
|
14
|
+
export declare type MinimalUser = (UserAvatarWithName | UserAvatarWithEmail) & {
|
15
|
+
avatar?: string;
|
16
|
+
};
|
17
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { MinimalApplication, MinimalUser } from "./types";
|
2
|
+
export declare const pickApplicationColors: (applicationId: string) => string;
|
3
|
+
export declare const getApplicationIdInitial: (applicationId: string) => string;
|
4
|
+
export declare const getApplicationInitials: ({ name, applicationId }: MinimalApplication) => string;
|
5
|
+
export declare const getUserBackgroundClassName: (email: string) => string;
|
6
|
+
export declare const getUserInitials: (user: MinimalUser) => string;
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
+
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28;
|
4
|
+
|
5
|
+
import { remove as removeDiacritics } from "diacritics";
|
6
|
+
import stl from "../styles/helpers/satellitePrefixer";
|
7
|
+
import hashCode from "../utils/hashCode";
|
8
|
+
|
9
|
+
/** APPLICATION */
|
10
|
+
var APPLICATION_COLORS_CLASSNAMES = [stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["bg-grey-200 text-grey-800"]))), stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["bg-nebula-200 text-nebula-800"]))), stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["bg-blue-200 text-blue-800"]))), stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-green-200 text-green-800"]))), stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-pink-200 text-pink-800"]))), stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["bg-red-200 text-red-800"]))), stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["bg-orange-200 text-orange-800"]))), // Darker variants
|
11
|
+
stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["bg-grey-300 text-grey-900"]))), stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["bg-nebula-300 text-nebula-900"]))), stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["bg-blue-300 text-blue-900"]))), stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["bg-green-300 text-green-900"]))), stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["bg-pink-300 text-pink-900"]))), stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["bg-red-300 text-red-900"]))), stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["bg-orange-300 text-orange-900"])))];
|
12
|
+
export var pickApplicationColors = function pickApplicationColors(applicationId) {
|
13
|
+
var _APPLICATION_COLORS_C;
|
14
|
+
|
15
|
+
return (_APPLICATION_COLORS_C = APPLICATION_COLORS_CLASSNAMES[Math.abs(hashCode(applicationId)) % APPLICATION_COLORS_CLASSNAMES.length]) !== null && _APPLICATION_COLORS_C !== void 0 ? _APPLICATION_COLORS_C : APPLICATION_COLORS_CLASSNAMES[0];
|
16
|
+
};
|
17
|
+
export var getApplicationIdInitial = function getApplicationIdInitial(applicationId) {
|
18
|
+
return applicationId.startsWith("beta") ? applicationId.slice(4, 6) : applicationId.slice(0, 2);
|
19
|
+
};
|
20
|
+
export var getApplicationInitials = function getApplicationInitials(_ref) {
|
21
|
+
var name = _ref.name,
|
22
|
+
applicationId = _ref.applicationId;
|
23
|
+
|
24
|
+
if (!name) {
|
25
|
+
return getApplicationIdInitial(applicationId);
|
26
|
+
}
|
27
|
+
|
28
|
+
var words = removeDiacritics(name.trim()).toLocaleUpperCase().split(/\W+/).filter(function (word) {
|
29
|
+
return word.length >= 1;
|
30
|
+
});
|
31
|
+
|
32
|
+
if (words.length === 0 || words.length === 1 && words[0].length < 2) {
|
33
|
+
return getApplicationIdInitial(applicationId);
|
34
|
+
} else if (words.length === 1) {
|
35
|
+
return words[0].slice(0, 2);
|
36
|
+
}
|
37
|
+
|
38
|
+
return "".concat(words[0][0]).concat(words[1][0]);
|
39
|
+
};
|
40
|
+
/** USER */
|
41
|
+
|
42
|
+
var USER_COLORS_CLASSNAMES = [stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["bg-grey-400"]))), stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["bg-nebula-400"]))), stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["bg-blue-400"]))), stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["bg-green-400"]))), stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["bg-pink-400"]))), stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["bg-red-400"]))), stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["bg-orange-400"]))), // Darker variants
|
43
|
+
stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["bg-grey-700"]))), stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["bg-nebula-700"]))), stl(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["bg-blue-700"]))), stl(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["bg-green-700"]))), stl(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["bg-pink-700"]))), stl(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["bg-red-700"]))), stl(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["bg-orange-700"])))];
|
44
|
+
export var getUserBackgroundClassName = function getUserBackgroundClassName(email) {
|
45
|
+
var _USER_COLORS_CLASSNAM;
|
46
|
+
|
47
|
+
return (_USER_COLORS_CLASSNAM = USER_COLORS_CLASSNAMES[Math.abs(hashCode(email)) % USER_COLORS_CLASSNAMES.length]) !== null && _USER_COLORS_CLASSNAM !== void 0 ? _USER_COLORS_CLASSNAM : USER_COLORS_CLASSNAMES[0];
|
48
|
+
};
|
49
|
+
export var getUserInitials = function getUserInitials(user) {
|
50
|
+
var _user$email, _user$email$match;
|
51
|
+
|
52
|
+
var words = user.name ? user.name.trim().split(/\s+/) : (_user$email = user.email) === null || _user$email === void 0 ? void 0 : (_user$email$match = _user$email.match(/^(.+)(?:\+.+?)?@.+$/)) === null || _user$email$match === void 0 ? void 0 : _user$email$match[1].split(".");
|
53
|
+
return words ? words.slice(0, 2).map(function (w) {
|
54
|
+
return w.toLocaleLowerCase()[0];
|
55
|
+
}).join("") : "??";
|
56
|
+
};
|
@@ -13,6 +13,7 @@ export interface DropdownProps {
|
|
13
13
|
/** Defines which side to open the menu */
|
14
14
|
placement?: "bottom-start" | "bottom-end";
|
15
15
|
renderTarget: (params: RenderTargetParams) => React.ReactNode;
|
16
|
+
renderFooter?: (params: RenderTargetParams) => React.ReactNode;
|
16
17
|
children?: React.ReactNode;
|
17
18
|
}
|
18
19
|
export declare const DEFAULT_DROPDOWN_POPPER_MODIFIERS: StrictModifier[];
|
@@ -27,7 +28,7 @@ export declare const DEFAULT_DROPDOWN_POPPER_MODIFIERS: StrictModifier[];
|
|
27
28
|
* - Make sure the most common options are listed. These can be grouped into sub-categories under headings
|
28
29
|
*/
|
29
30
|
export declare const Dropdown: {
|
30
|
-
({ placement, menuClassName, modifiers, renderTarget, children }: DropdownProps): JSX.Element;
|
31
|
+
({ placement, menuClassName, modifiers, renderTarget, renderFooter, children, }: DropdownProps): JSX.Element;
|
31
32
|
ButtonItem: {
|
32
33
|
(props: import("./components/DropdownButtonItem").DropdownButtonItemProps): JSX.Element;
|
33
34
|
defaultProps: {
|
@@ -44,7 +45,7 @@ export declare const Dropdown: {
|
|
44
45
|
(props: import("./components/DropdownRadioItem").DropdownRadioItemProps): JSX.Element;
|
45
46
|
defaultProps: {
|
46
47
|
toggle: boolean;
|
47
|
-
};
|
48
|
+
};
|
48
49
|
};
|
49
50
|
ToggleItem: {
|
50
51
|
(props: import("./components/DropdownToggleItem").DropdownToggleItemProps): JSX.Element;
|
@@ -52,6 +53,11 @@ export declare const Dropdown: {
|
|
52
53
|
toggle: boolean;
|
53
54
|
};
|
54
55
|
};
|
56
|
+
CollapsibleItem: React.FC<import("./components/DropdownCollapsibleItem").DropdownCollapsibleItemProps>;
|
57
|
+
FooterItem: ({ children, className, ...props }: {
|
58
|
+
className?: string | undefined;
|
59
|
+
children: React.ReactNode;
|
60
|
+
}) => JSX.Element | null;
|
55
61
|
Divider: () => JSX.Element;
|
56
62
|
Title: React.FunctionComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
|
57
63
|
};
|
package/esm/Dropdown/Dropdown.js
CHANGED
@@ -16,6 +16,8 @@ import DropdownButtonItem from "./components/DropdownButtonItem";
|
|
16
16
|
import DropdownLinkItem from "./components/DropdownLinkItem";
|
17
17
|
import DropdownRadioItem from "./components/DropdownRadioItem";
|
18
18
|
import DropdownToggleItem from "./components/DropdownToggleItem";
|
19
|
+
import { DropdownCollapsibleItem, DropdownCollapsibleItemsSingleGroup } from "./components/DropdownCollapsibleItem";
|
20
|
+
import DropdownFooterItem from "./components/DropdownFooterItem";
|
19
21
|
import DropdownDivider from "./components/DropdownDivider";
|
20
22
|
import DropdownTitle from "./components/DropdownTitle";
|
21
23
|
import DropdownContext from "./DropdownContext";
|
@@ -37,12 +39,15 @@ export var DEFAULT_DROPDOWN_POPPER_MODIFIERS = [{
|
|
37
39
|
*/
|
38
40
|
|
39
41
|
export var Dropdown = function Dropdown(_ref) {
|
42
|
+
var _renderFooter;
|
43
|
+
|
40
44
|
var _ref$placement = _ref.placement,
|
41
45
|
placement = _ref$placement === void 0 ? "bottom-start" : _ref$placement,
|
42
46
|
menuClassName = _ref.menuClassName,
|
43
47
|
_ref$modifiers = _ref.modifiers,
|
44
48
|
modifiers = _ref$modifiers === void 0 ? [] : _ref$modifiers,
|
45
49
|
renderTarget = _ref.renderTarget,
|
50
|
+
renderFooter = _ref.renderFooter,
|
46
51
|
children = _ref.children;
|
47
52
|
|
48
53
|
var _useState = useState(false),
|
@@ -74,11 +79,17 @@ export var Dropdown = function Dropdown(_ref) {
|
|
74
79
|
},
|
75
80
|
isShowingMenu: showMenu
|
76
81
|
});
|
82
|
+
var footer = (_renderFooter = renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter({
|
83
|
+
toggle: function toggle(open) {
|
84
|
+
return setShowMenu(open === undefined ? !showMenu : open);
|
85
|
+
},
|
86
|
+
isShowingMenu: showMenu
|
87
|
+
})) !== null && _renderFooter !== void 0 ? _renderFooter : null;
|
77
88
|
return /*#__PURE__*/React.createElement(DropdownContext.Provider, {
|
78
89
|
value: {
|
79
90
|
showMenu: setShowMenu
|
80
91
|
}
|
81
|
-
}, /*#__PURE__*/React.createElement("span", {
|
92
|
+
}, /*#__PURE__*/React.createElement(DropdownCollapsibleItemsSingleGroup, null, /*#__PURE__*/React.createElement("span", {
|
82
93
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["inline-block leading-none"]))),
|
83
94
|
ref: setTargetEl
|
84
95
|
}, target), showMenu && targetEl && /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(ClickAwayContainer, {
|
@@ -98,12 +109,14 @@ export var Dropdown = function Dropdown(_ref) {
|
|
98
109
|
fullBleed: true,
|
99
110
|
elevation: "300",
|
100
111
|
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["flex flex-col py-1"])))
|
101
|
-
}, children))), document.body));
|
112
|
+
}, children, footer ? /*#__PURE__*/React.createElement(DropdownFooterItem, null, footer) : null))), document.body)));
|
102
113
|
};
|
103
114
|
Dropdown.ButtonItem = DropdownButtonItem;
|
104
115
|
Dropdown.LinkItem = DropdownLinkItem;
|
105
116
|
Dropdown.RadioItem = DropdownRadioItem;
|
106
117
|
Dropdown.ToggleItem = DropdownToggleItem;
|
118
|
+
Dropdown.CollapsibleItem = DropdownCollapsibleItem;
|
119
|
+
Dropdown.FooterItem = DropdownFooterItem;
|
107
120
|
Dropdown.Divider = DropdownDivider;
|
108
121
|
Dropdown.Title = DropdownTitle;
|
109
122
|
export default Dropdown;
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import React, { FunctionComponent } from "react";
|
2
2
|
import { ButtonProps } from "../Button";
|
3
|
+
import { RenderTargetParams } from "./Dropdown";
|
3
4
|
export interface DropdownButtonProps extends Omit<ButtonProps<"button">, "title"> {
|
4
5
|
/** Title displayed in the `Dropdown` */
|
5
6
|
title: React.ReactNode;
|
7
|
+
renderFooter?: (args: RenderTargetParams) => React.ReactNode;
|
6
8
|
}
|
7
9
|
export declare const DropdownButton: FunctionComponent<DropdownButtonProps>;
|
8
10
|
export default DropdownButton;
|