@activecollab/components 1.0.271 → 1.0.272
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AvatarGroup/AvatarGroup.js +42 -0
- package/dist/cjs/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/dist/cjs/components/AvatarGroup/Styles.js +24 -0
- package/dist/cjs/components/AvatarGroup/Styles.js.map +1 -0
- package/dist/esm/components/AvatarGroup/AvatarGroup.d.ts +7 -0
- package/dist/esm/components/AvatarGroup/AvatarGroup.d.ts.map +1 -0
- package/dist/esm/components/AvatarGroup/AvatarGroup.js +30 -0
- package/dist/esm/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/dist/esm/components/AvatarGroup/Styles.d.ts +7 -0
- package/dist/esm/components/AvatarGroup/Styles.d.ts.map +1 -0
- package/dist/esm/components/AvatarGroup/Styles.js +15 -0
- package/dist/esm/components/AvatarGroup/Styles.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AvatarGroup = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Typography = require("../Typography/Typography");
|
|
10
|
+
var _Styles = require("./Styles");
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
15
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
var AvatarGroup = function AvatarGroup(_ref) {
|
|
17
|
+
var limit = _ref.limit,
|
|
18
|
+
_ref$size = _ref.size,
|
|
19
|
+
size = _ref$size === void 0 ? 34 : _ref$size,
|
|
20
|
+
children = _ref.children;
|
|
21
|
+
var _children = _react.Children.toArray(children).slice(0, limit);
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.AvatarGroupsStyles, null, _children.map(function (child) {
|
|
23
|
+
var item = child;
|
|
24
|
+
return /*#__PURE__*/(0, _react.cloneElement)(item, _objectSpread(_objectSpread({}, item.props), {}, {
|
|
25
|
+
size: size,
|
|
26
|
+
style: {
|
|
27
|
+
marginInlineStart: "-8px",
|
|
28
|
+
outline: "1px solid var(--page-paper-main)"
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
}), limit >= _react.Children.count(children) ? null : /*#__PURE__*/_react.default.createElement(_Styles.LengthCountStyles, {
|
|
32
|
+
size: size,
|
|
33
|
+
style: {
|
|
34
|
+
marginInlineStart: "-8px"
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
37
|
+
variant: "Caption 1",
|
|
38
|
+
weight: "medium"
|
|
39
|
+
}, "+", _react.Children.count(children) - limit)));
|
|
40
|
+
};
|
|
41
|
+
exports.AvatarGroup = AvatarGroup;
|
|
42
|
+
//# sourceMappingURL=AvatarGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarGroup.js","names":["AvatarGroup","limit","size","children","_children","Children","toArray","slice","map","child","item","cloneElement","props","style","marginInlineStart","outline","count"],"sources":["../../../../src/components/AvatarGroup/AvatarGroup.tsx"],"sourcesContent":["import React, {\n Children,\n cloneElement,\n PropsWithChildren,\n ReactElement,\n} from \"react\";\nimport { AvatarProps } from \"../Avatar/Avatar\";\nimport { Typography } from \"../Typography/Typography\";\nimport { AvatarGroupsStyles, LengthCountStyles } from \"./Styles\";\n\nexport interface AvatarGroupsProps {\n limit: number;\n size?: number;\n}\n\nexport const AvatarGroup = ({\n limit,\n size = 34,\n children,\n}: PropsWithChildren<AvatarGroupsProps>) => {\n const _children = Children.toArray(children).slice(0, limit);\n\n return (\n <AvatarGroupsStyles>\n {_children.map((child) => {\n const item = child as ReactElement<AvatarProps>;\n\n return cloneElement(item, {\n ...item.props,\n size: size,\n style: {\n marginInlineStart: \"-8px\",\n outline: \"1px solid var(--page-paper-main)\",\n },\n });\n })}\n\n {limit >= Children.count(children) ? null : (\n <LengthCountStyles size={size} style={{ marginInlineStart: \"-8px\" }}>\n <Typography variant=\"Caption 1\" weight=\"medium\">\n +{Children.count(children) - limit}\n </Typography>\n </LengthCountStyles>\n )}\n </AvatarGroupsStyles>\n );\n};\n"],"mappings":";;;;;;;AAAA;AAOA;AACA;AAAiE;AAAA;AAAA;AAAA;AAAA;AAO1D,IAAMA,WAAW,GAAG,SAAdA,WAAW,OAIoB;EAAA,IAH1CC,KAAK,QAALA,KAAK;IAAA,iBACLC,IAAI;IAAJA,IAAI,0BAAG,EAAE;IACTC,QAAQ,QAARA,QAAQ;EAER,IAAMC,SAAS,GAAGC,eAAQ,CAACC,OAAO,CAACH,QAAQ,CAAC,CAACI,KAAK,CAAC,CAAC,EAAEN,KAAK,CAAC;EAE5D,oBACE,6BAAC,0BAAkB,QAChBG,SAAS,CAACI,GAAG,CAAC,UAACC,KAAK,EAAK;IACxB,IAAMC,IAAI,GAAGD,KAAkC;IAE/C,oBAAO,IAAAE,mBAAY,EAACD,IAAI,kCACnBA,IAAI,CAACE,KAAK;MACbV,IAAI,EAAEA,IAAI;MACVW,KAAK,EAAE;QACLC,iBAAiB,EAAE,MAAM;QACzBC,OAAO,EAAE;MACX;IAAC,GACD;EACJ,CAAC,CAAC,EAEDd,KAAK,IAAII,eAAQ,CAACW,KAAK,CAACb,QAAQ,CAAC,GAAG,IAAI,gBACvC,6BAAC,yBAAiB;IAAC,IAAI,EAAED,IAAK;IAAC,KAAK,EAAE;MAAEY,iBAAiB,EAAE;IAAO;EAAE,gBAClE,6BAAC,sBAAU;IAAC,OAAO,EAAC,WAAW;IAAC,MAAM,EAAC;EAAQ,QAC3CT,eAAQ,CAACW,KAAK,CAACb,QAAQ,CAAC,GAAGF,KAAK,CACvB,CAEhB,CACkB;AAEzB,CAAC;AAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LengthCountStyles = exports.AvatarGroupsStyles = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _FontStyle = require("../FontStyle");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var AvatarGroupsStyles = _styledComponents.default.div.withConfig({
|
|
11
|
+
displayName: "Styles__AvatarGroupsStyles",
|
|
12
|
+
componentId: "sc-1padv46-0"
|
|
13
|
+
})(["display:flex;cursor:pointer;width:fit-content;", ""], _FontStyle.FontStyle);
|
|
14
|
+
exports.AvatarGroupsStyles = AvatarGroupsStyles;
|
|
15
|
+
var LengthCountStyles = _styledComponents.default.div.withConfig({
|
|
16
|
+
displayName: "Styles__LengthCountStyles",
|
|
17
|
+
componentId: "sc-1padv46-1"
|
|
18
|
+
})(["align-items:center;background-color:var(--color-theme-400);block-size:", ";border-radius:50%;display:flex;inline-size:", ";justify-content:center;outline:1px solid var(--page-paper-main);z-index:99;"], function (props) {
|
|
19
|
+
return props.size + "px";
|
|
20
|
+
}, function (props) {
|
|
21
|
+
return props.size + "px";
|
|
22
|
+
});
|
|
23
|
+
exports.LengthCountStyles = LengthCountStyles;
|
|
24
|
+
//# sourceMappingURL=Styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["AvatarGroupsStyles","styled","div","FontStyle","LengthCountStyles","props","size"],"sources":["../../../../src/components/AvatarGroup/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const AvatarGroupsStyles = styled.div`\n display: flex;\n cursor: pointer;\n width: fit-content;\n ${FontStyle}\n`;\n\ninterface LengthCountStylesProps {\n size: number;\n}\n\nexport const LengthCountStyles = styled.div<LengthCountStylesProps>`\n align-items: center;\n background-color: var(--color-theme-400);\n block-size: ${(props) => props.size + \"px\"};\n border-radius: 50%;\n display: flex;\n inline-size: ${(props) => props.size + \"px\"};\n justify-content: center;\n outline: 1px solid var(--page-paper-main);\n z-index: 99;\n`;\n"],"mappings":";;;;;;AAAA;AACA;AAAyC;AAElC,IAAMA,kBAAkB,GAAGC,yBAAM,CAACC,GAAG;EAAA;EAAA;AAAA,2DAIxCC,oBAAS,CACZ;AAAC;AAMK,IAAMC,iBAAiB,GAAGH,yBAAM,CAACC,GAAG;EAAA;EAAA;AAAA,+MAG3B,UAACG,KAAK;EAAA,OAAKA,KAAK,CAACC,IAAI,GAAG,IAAI;AAAA,GAG3B,UAACD,KAAK;EAAA,OAAKA,KAAK,CAACC,IAAI,GAAG,IAAI;AAAA,EAI5C;AAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
export interface AvatarGroupsProps {
|
|
3
|
+
limit: number;
|
|
4
|
+
size?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const AvatarGroup: ({ limit, size, children, }: PropsWithChildren<AvatarGroupsProps>) => JSX.Element;
|
|
7
|
+
//# sourceMappingURL=AvatarGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAGZ,iBAAiB,EAElB,MAAM,OAAO,CAAC;AAKf,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,+BAIrB,kBAAkB,iBAAiB,CAAC,gBA2BtC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React, { Children, cloneElement } from "react";
|
|
3
|
+
import { Typography } from "../Typography/Typography";
|
|
4
|
+
import { AvatarGroupsStyles, LengthCountStyles } from "./Styles";
|
|
5
|
+
export var AvatarGroup = function AvatarGroup(_ref) {
|
|
6
|
+
var limit = _ref.limit,
|
|
7
|
+
_ref$size = _ref.size,
|
|
8
|
+
size = _ref$size === void 0 ? 34 : _ref$size,
|
|
9
|
+
children = _ref.children;
|
|
10
|
+
var _children = Children.toArray(children).slice(0, limit);
|
|
11
|
+
return /*#__PURE__*/React.createElement(AvatarGroupsStyles, null, _children.map(function (child) {
|
|
12
|
+
var item = child;
|
|
13
|
+
return /*#__PURE__*/cloneElement(item, _extends({}, item.props, {
|
|
14
|
+
size: size,
|
|
15
|
+
style: {
|
|
16
|
+
marginInlineStart: "-8px",
|
|
17
|
+
outline: "1px solid var(--page-paper-main)"
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
}), limit >= Children.count(children) ? null : /*#__PURE__*/React.createElement(LengthCountStyles, {
|
|
21
|
+
size: size,
|
|
22
|
+
style: {
|
|
23
|
+
marginInlineStart: "-8px"
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
26
|
+
variant: "Caption 1",
|
|
27
|
+
weight: "medium"
|
|
28
|
+
}, "+", Children.count(children) - limit)));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=AvatarGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarGroup.js","names":["React","Children","cloneElement","Typography","AvatarGroupsStyles","LengthCountStyles","AvatarGroup","limit","size","children","_children","toArray","slice","map","child","item","props","style","marginInlineStart","outline","count"],"sources":["../../../../src/components/AvatarGroup/AvatarGroup.tsx"],"sourcesContent":["import React, {\n Children,\n cloneElement,\n PropsWithChildren,\n ReactElement,\n} from \"react\";\nimport { AvatarProps } from \"../Avatar/Avatar\";\nimport { Typography } from \"../Typography/Typography\";\nimport { AvatarGroupsStyles, LengthCountStyles } from \"./Styles\";\n\nexport interface AvatarGroupsProps {\n limit: number;\n size?: number;\n}\n\nexport const AvatarGroup = ({\n limit,\n size = 34,\n children,\n}: PropsWithChildren<AvatarGroupsProps>) => {\n const _children = Children.toArray(children).slice(0, limit);\n\n return (\n <AvatarGroupsStyles>\n {_children.map((child) => {\n const item = child as ReactElement<AvatarProps>;\n\n return cloneElement(item, {\n ...item.props,\n size: size,\n style: {\n marginInlineStart: \"-8px\",\n outline: \"1px solid var(--page-paper-main)\",\n },\n });\n })}\n\n {limit >= Children.count(children) ? null : (\n <LengthCountStyles size={size} style={{ marginInlineStart: \"-8px\" }}>\n <Typography variant=\"Caption 1\" weight=\"medium\">\n +{Children.count(children) - limit}\n </Typography>\n </LengthCountStyles>\n )}\n </AvatarGroupsStyles>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IACVC,QAAQ,EACRC,YAAY,QAGP,OAAO;AAEd,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,UAAU;AAOhE,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAW,OAIoB;EAAA,IAH1CC,KAAK,QAALA,KAAK;IAAA,iBACLC,IAAI;IAAJA,IAAI,0BAAG,EAAE;IACTC,QAAQ,QAARA,QAAQ;EAER,IAAMC,SAAS,GAAGT,QAAQ,CAACU,OAAO,CAACF,QAAQ,CAAC,CAACG,KAAK,CAAC,CAAC,EAAEL,KAAK,CAAC;EAE5D,oBACE,oBAAC,kBAAkB,QAChBG,SAAS,CAACG,GAAG,CAAC,UAACC,KAAK,EAAK;IACxB,IAAMC,IAAI,GAAGD,KAAkC;IAE/C,oBAAOZ,YAAY,CAACa,IAAI,eACnBA,IAAI,CAACC,KAAK;MACbR,IAAI,EAAEA,IAAI;MACVS,KAAK,EAAE;QACLC,iBAAiB,EAAE,MAAM;QACzBC,OAAO,EAAE;MACX;IAAC,GACD;EACJ,CAAC,CAAC,EAEDZ,KAAK,IAAIN,QAAQ,CAACmB,KAAK,CAACX,QAAQ,CAAC,GAAG,IAAI,gBACvC,oBAAC,iBAAiB;IAAC,IAAI,EAAED,IAAK;IAAC,KAAK,EAAE;MAAEU,iBAAiB,EAAE;IAAO;EAAE,gBAClE,oBAAC,UAAU;IAAC,OAAO,EAAC,WAAW;IAAC,MAAM,EAAC;EAAQ,QAC3CjB,QAAQ,CAACmB,KAAK,CAACX,QAAQ,CAAC,GAAGF,KAAK,CACvB,CAEhB,CACkB;AAEzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AvatarGroupsStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
interface LengthCountStylesProps {
|
|
3
|
+
size: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const LengthCountStyles: import("styled-components").StyledComponent<"div", any, LengthCountStylesProps, never>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/AvatarGroup/Styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,oEAK9B,CAAC;AAEF,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,iBAAiB,wFAU7B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontStyle } from "../FontStyle";
|
|
3
|
+
export var AvatarGroupsStyles = styled.div.withConfig({
|
|
4
|
+
displayName: "Styles__AvatarGroupsStyles",
|
|
5
|
+
componentId: "sc-1padv46-0"
|
|
6
|
+
})(["display:flex;cursor:pointer;width:fit-content;", ""], FontStyle);
|
|
7
|
+
export var LengthCountStyles = styled.div.withConfig({
|
|
8
|
+
displayName: "Styles__LengthCountStyles",
|
|
9
|
+
componentId: "sc-1padv46-1"
|
|
10
|
+
})(["align-items:center;background-color:var(--color-theme-400);block-size:", ";border-radius:50%;display:flex;inline-size:", ";justify-content:center;outline:1px solid var(--page-paper-main);z-index:99;"], function (props) {
|
|
11
|
+
return props.size + "px";
|
|
12
|
+
}, function (props) {
|
|
13
|
+
return props.size + "px";
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=Styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","FontStyle","AvatarGroupsStyles","div","LengthCountStyles","props","size"],"sources":["../../../../src/components/AvatarGroup/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const AvatarGroupsStyles = styled.div`\n display: flex;\n cursor: pointer;\n width: fit-content;\n ${FontStyle}\n`;\n\ninterface LengthCountStylesProps {\n size: number;\n}\n\nexport const LengthCountStyles = styled.div<LengthCountStylesProps>`\n align-items: center;\n background-color: var(--color-theme-400);\n block-size: ${(props) => props.size + \"px\"};\n border-radius: 50%;\n display: flex;\n inline-size: ${(props) => props.size + \"px\"};\n justify-content: center;\n outline: 1px solid var(--page-paper-main);\n z-index: 99;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AACtC,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,IAAMC,kBAAkB,GAAGF,MAAM,CAACG,GAAG;EAAA;EAAA;AAAA,2DAIxCF,SAAS,CACZ;AAMD,OAAO,IAAMG,iBAAiB,GAAGJ,MAAM,CAACG,GAAG;EAAA;EAAA;AAAA,+MAG3B,UAACE,KAAK;EAAA,OAAKA,KAAK,CAACC,IAAI,GAAG,IAAI;AAAA,GAG3B,UAACD,KAAK;EAAA,OAAKA,KAAK,CAACC,IAAI,GAAG,IAAI;AAAA,EAI5C"}
|