@activecollab/components 1.0.98 → 1.0.101
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/Breadcrumbs/Breadcrumbs.js +75 -0
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/cjs/components/Breadcrumbs/Styles.js +78 -0
- package/dist/cjs/components/Breadcrumbs/Styles.js.map +1 -0
- package/dist/cjs/components/Breadcrumbs/index.js +19 -0
- package/dist/cjs/components/Breadcrumbs/index.js.map +1 -0
- package/dist/cjs/components/ProgressRing/ProgressRing.js +29 -6
- package/dist/cjs/components/ProgressRing/ProgressRing.js.map +1 -1
- package/dist/cjs/components/ProgressRing/Styles.js +14 -2
- package/dist/cjs/components/ProgressRing/Styles.js.map +1 -1
- package/dist/cjs/components/index.js +13 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.d.ts +8 -0
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +53 -0
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/esm/components/Breadcrumbs/Styles.d.ts +6 -0
- package/dist/esm/components/Breadcrumbs/Styles.d.ts.map +1 -0
- package/dist/esm/components/Breadcrumbs/Styles.js +52 -0
- package/dist/esm/components/Breadcrumbs/Styles.js.map +1 -0
- package/dist/esm/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/esm/components/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/esm/components/Breadcrumbs/index.js +2 -0
- package/dist/esm/components/Breadcrumbs/index.js.map +1 -0
- package/dist/esm/components/ProgressRing/ProgressRing.d.ts +2 -0
- package/dist/esm/components/ProgressRing/ProgressRing.d.ts.map +1 -1
- package/dist/esm/components/ProgressRing/ProgressRing.js +30 -7
- package/dist/esm/components/ProgressRing/ProgressRing.js.map +1 -1
- package/dist/esm/components/ProgressRing/Styles.d.ts +2 -0
- package/dist/esm/components/ProgressRing/Styles.d.ts.map +1 -1
- package/dist/esm/components/ProgressRing/Styles.js +10 -1
- package/dist/esm/components/ProgressRing/Styles.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/index.js +6824 -6710
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Breadcrumbs = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var _Button = require("../Button");
|
|
15
|
+
|
|
16
|
+
var _Icons = require("../Icons");
|
|
17
|
+
|
|
18
|
+
var _List = require("../List");
|
|
19
|
+
|
|
20
|
+
var _Menu = require("../Menu");
|
|
21
|
+
|
|
22
|
+
var _Styles = require("./Styles");
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
_ref$separator = _ref.separator,
|
|
32
|
+
separator = _ref$separator === void 0 ? "/" : _ref$separator;
|
|
33
|
+
var ref = (0, _react.useRef)(null);
|
|
34
|
+
var menuBreadcrumbs = 0;
|
|
35
|
+
|
|
36
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
37
|
+
return children.reduce(function (acc, value, index) {
|
|
38
|
+
index >= menuBreadcrumbs ? acc.x.push(value) : acc.y.push(value);
|
|
39
|
+
return acc;
|
|
40
|
+
}, {
|
|
41
|
+
x: [],
|
|
42
|
+
y: []
|
|
43
|
+
});
|
|
44
|
+
}, [children, menuBreadcrumbs]),
|
|
45
|
+
x = _useMemo.x,
|
|
46
|
+
y = _useMemo.y;
|
|
47
|
+
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledNavElement, {
|
|
49
|
+
className: className,
|
|
50
|
+
ref: ref
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_Styles.StyledOList, null, menuBreadcrumbs > 0 ? /*#__PURE__*/_react.default.createElement(_Styles.StyledListMenuItem, null, /*#__PURE__*/_react.default.createElement(_.LayerContextProvider, {
|
|
52
|
+
value: {
|
|
53
|
+
zIndex: _.layers.skyscraper
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_Menu.Menu, {
|
|
56
|
+
target: /*#__PURE__*/_react.default.createElement(_Button.Button, {
|
|
57
|
+
variant: "text gray"
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_Icons.TreeDotsIcon, null))
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_List.List, {
|
|
60
|
+
className: "tw-py-2"
|
|
61
|
+
}, y.map(function (child, index) {
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement(_List.ListItem, {
|
|
63
|
+
key: index
|
|
64
|
+
}, child);
|
|
65
|
+
}))))) : null, x.map(function (child, index) {
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
67
|
+
key: index
|
|
68
|
+
}, index > 0 || menuBreadcrumbs > 0 ? /*#__PURE__*/_react.default.createElement(_Styles.StyledSeparator, null, separator) : null, /*#__PURE__*/_react.default.createElement("li", {
|
|
69
|
+
className: "tw-flex"
|
|
70
|
+
}, child));
|
|
71
|
+
})));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
75
|
+
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":["Breadcrumbs","children","className","separator","ref","menuBreadcrumbs","reduce","acc","value","index","x","push","y","zIndex","layers","skyscraper","map","child"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAgBO,IAAMA,WAAW,GAAG,SAAdA,WAAc,OAIH;AAAA,MAHtBC,QAGsB,QAHtBA,QAGsB;AAAA,MAFtBC,SAEsB,QAFtBA,SAEsB;AAAA,4BADtBC,SACsB;AAAA,MADtBA,SACsB,+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F,CAAM,UAACC,KAAD,EAAQR,KAAR,EAAkB;AACvB,wBACE,6BAAC,cAAD,CAAO,QAAP;AAAgB,MAAA,GAAG,EAAEA;AAArB,OACGA,KAAK,GAAG,CAAR,IAAaJ,eAAe,GAAG,CAA/B,gBACC,6BAAC,uBAAD,QAAkBF,SAAlB,CADD,GAEG,IAHN,eAIE;AAAI,MAAA,SAAS,EAAC;AAAd,OAAyBc,KAAzB,CAJF,CADF;AAQD,GATA,CApBH,CADF,CADF;AAmCD,CArDM","sourcesContent":["import React, { ReactElement, useRef, useMemo } from \"react\";\nimport { LayerContextProvider, layers } from \"../..\";\nimport { Button } from \"../Button\";\nimport { TreeDotsIcon } from \"../Icons\";\nimport { List, ListItem } from \"../List\";\nimport { Menu } from \"../Menu\";\nimport {\n StyledListMenuItem,\n StyledNavElement,\n StyledOList,\n StyledSeparator,\n} from \"./Styles\";\n\nexport interface BreadcrumbsProps {\n /** Children type of node or string */\n children: ReactElement[];\n /** ClassName */\n className?: string;\n /** Separator */\n separator?: ReactElement | string;\n}\n\nexport const Breadcrumbs = ({\n children,\n className,\n separator = \"/\",\n}: BreadcrumbsProps) => {\n const ref = useRef<null | HTMLUListElement>(null);\n const menuBreadcrumbs = 0;\n\n const { x, y } = useMemo(() => {\n return children.reduce(\n (acc, value, index) => {\n index >= menuBreadcrumbs ? acc.x.push(value) : acc.y.push(value);\n return acc;\n },\n { x: [], y: [] } as { x: ReactElement[]; y: ReactElement[] }\n );\n }, [children, menuBreadcrumbs]);\n\n return (\n <StyledNavElement className={className} ref={ref}>\n <StyledOList>\n {menuBreadcrumbs > 0 ? (\n <StyledListMenuItem>\n <LayerContextProvider value={{ zIndex: layers.skyscraper }}>\n <Menu\n target={\n <Button variant=\"text gray\">\n <TreeDotsIcon />\n </Button>\n }\n >\n <List className=\"tw-py-2\">\n {y.map((child, index) => (\n <ListItem key={index}>{child}</ListItem>\n ))}\n </List>\n </Menu>\n </LayerContextProvider>\n </StyledListMenuItem>\n ) : null}\n {x.map((child, index) => {\n return (\n <React.Fragment key={index}>\n {index > 0 || menuBreadcrumbs > 0 ? (\n <StyledSeparator>{separator}</StyledSeparator>\n ) : null}\n <li className=\"tw-flex\">{child}</li>\n </React.Fragment>\n );\n })}\n </StyledOList>\n </StyledNavElement>\n );\n};\n"],"file":"Breadcrumbs.js"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSeparator = exports.StyledOList = exports.StyledNavElement = exports.StyledListMenuItem = exports.StyledListItem = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _BoxSizingStyle = require("../BoxSizingStyle");
|
|
11
|
+
|
|
12
|
+
var _FontStyle = require("../FontStyle");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var StyledNavElement = _styledComponents.default.nav.withConfig({
|
|
17
|
+
displayName: "Styles__StyledNavElement",
|
|
18
|
+
componentId: "sc-rxaesd-0"
|
|
19
|
+
})(["", " ", " ", " ", ""], {
|
|
20
|
+
"width": "100%"
|
|
21
|
+
}, {
|
|
22
|
+
"overflow": "visible"
|
|
23
|
+
}, _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle);
|
|
24
|
+
|
|
25
|
+
exports.StyledNavElement = StyledNavElement;
|
|
26
|
+
StyledNavElement.displayName = "StyledNavElement";
|
|
27
|
+
|
|
28
|
+
var StyledOList = _styledComponents.default.ul.withConfig({
|
|
29
|
+
displayName: "Styles__StyledOList",
|
|
30
|
+
componentId: "sc-rxaesd-1"
|
|
31
|
+
})(["", " ", " ", " ", " ", " ", ""], {
|
|
32
|
+
"display": "flex"
|
|
33
|
+
}, {
|
|
34
|
+
"alignItems": "flex-start"
|
|
35
|
+
}, {
|
|
36
|
+
"listStyleType": "none"
|
|
37
|
+
}, {
|
|
38
|
+
"padding": "0px"
|
|
39
|
+
}, {
|
|
40
|
+
"margin": "0px"
|
|
41
|
+
}, {
|
|
42
|
+
"alignItems": "center"
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
exports.StyledOList = StyledOList;
|
|
46
|
+
StyledOList.displayName = "StyledOList";
|
|
47
|
+
|
|
48
|
+
var StyledListMenuItem = _styledComponents.default.li.withConfig({
|
|
49
|
+
displayName: "Styles__StyledListMenuItem",
|
|
50
|
+
componentId: "sc-rxaesd-2"
|
|
51
|
+
})(["", ""], {
|
|
52
|
+
"flexShrink": "0"
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
exports.StyledListMenuItem = StyledListMenuItem;
|
|
56
|
+
StyledListMenuItem.displayName = "StyledListMenuItem";
|
|
57
|
+
|
|
58
|
+
var StyledListItem = _styledComponents.default.li.withConfig({
|
|
59
|
+
displayName: "Styles__StyledListItem",
|
|
60
|
+
componentId: "sc-rxaesd-3"
|
|
61
|
+
})(["", ""], {
|
|
62
|
+
"display": "flex"
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
exports.StyledListItem = StyledListItem;
|
|
66
|
+
StyledListItem.displayName = "StyledListItem";
|
|
67
|
+
|
|
68
|
+
var StyledSeparator = _styledComponents.default.li.withConfig({
|
|
69
|
+
displayName: "Styles__StyledSeparator",
|
|
70
|
+
componentId: "sc-rxaesd-4"
|
|
71
|
+
})(["", ""], {
|
|
72
|
+
"marginLeft": "1rem",
|
|
73
|
+
"marginRight": "1rem"
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
exports.StyledSeparator = StyledSeparator;
|
|
77
|
+
StyledSeparator.displayName = "StyledSeparator";
|
|
78
|
+
//# sourceMappingURL=Styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Breadcrumbs/Styles.ts"],"names":["StyledNavElement","styled","nav","FontStyle","BoxSizingStyle","displayName","StyledOList","ul","StyledListMenuItem","li","StyledListItem","StyledSeparator"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;AAEO,IAAMA,gBAAgB,GAAGC,0BAAOC,GAAV;AAAA;AAAA;AAAA,4BACvB;AAAA;AAAA,CADuB,EAEvB;AAAA;AAAA,CAFuB,EAGzBC,oBAHyB,EAIzBC,8BAJyB,CAAtB;;;AAOPJ,gBAAgB,CAACK,WAAjB,GAA+B,kBAA/B;;AAEO,IAAMC,WAAW,GAAGL,0BAAOM,EAAV;AAAA;AAAA;AAAA,sCAClB;AAAA;AAAA,CADkB,EAElB;AAAA;AAAA,CAFkB,EAGlB;AAAA;AAAA,CAHkB,EAIlB;AAAA;AAAA,CAJkB,EAKlB;AAAA;AAAA,CALkB,EAMlB;AAAA;AAAA,CANkB,CAAjB;;;AASPD,WAAW,CAACD,WAAZ,GAA0B,aAA1B;;AAEO,IAAMG,kBAAkB,GAAGP,0BAAOQ,EAAV;AAAA;AAAA;AAAA,aACzB;AAAA;AAAA,CADyB,CAAxB;;;AAIPD,kBAAkB,CAACH,WAAnB,GAAiC,oBAAjC;;AAEO,IAAMK,cAAc,GAAGT,0BAAOQ,EAAV;AAAA;AAAA;AAAA,aACrB;AAAA;AAAA,CADqB,CAApB;;;AAIPC,cAAc,CAACL,WAAf,GAA6B,gBAA7B;;AAEO,IAAMM,eAAe,GAAGV,0BAAOQ,EAAV;AAAA;AAAA;AAAA,aACtB;AAAA;AAAA;AAAA,CADsB,CAArB;;;AAIPE,eAAe,CAACN,WAAhB,GAA8B,iBAA9B","sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const StyledNavElement = styled.nav`\n ${tw`tw-w-full`}\n ${tw`tw-overflow-visible`}\n ${FontStyle}\n ${BoxSizingStyle}\n`;\n\nStyledNavElement.displayName = \"StyledNavElement\";\n\nexport const StyledOList = styled.ul`\n ${tw`tw-flex`}\n ${tw`tw-items-start`}\n ${tw`tw-list-none`}\n ${tw`tw-p-0`}\n ${tw`tw-m-0`}\n ${tw`tw-items-center`}\n`;\n\nStyledOList.displayName = \"StyledOList\";\n\nexport const StyledListMenuItem = styled.li`\n ${tw`tw-flex-shrink-0`}\n`;\n\nStyledListMenuItem.displayName = \"StyledListMenuItem\";\n\nexport const StyledListItem = styled.li`\n ${tw`tw-flex`}\n`;\n\nStyledListItem.displayName = \"StyledListItem\";\n\nexport const StyledSeparator = styled.li`\n ${tw`tw-mx-4`}\n`;\n\nStyledSeparator.displayName = \"StyledSeparator\";\n"],"file":"Styles.js"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _Breadcrumbs = require("./Breadcrumbs");
|
|
8
|
+
|
|
9
|
+
Object.keys(_Breadcrumbs).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _Breadcrumbs[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Breadcrumbs[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Breadcrumbs/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./Breadcrumbs\";\n"],"file":"index.js"}
|
|
@@ -28,7 +28,23 @@ var ProgressRing = function ProgressRing(_ref) {
|
|
|
28
28
|
radius = _ref$radius === void 0 ? 20 : _ref$radius,
|
|
29
29
|
_ref$stroke = _ref.stroke,
|
|
30
30
|
stroke = _ref$stroke === void 0 ? 3 : _ref$stroke,
|
|
31
|
-
className = _ref.className
|
|
31
|
+
className = _ref.className,
|
|
32
|
+
_ref$showPercentage = _ref.showPercentage,
|
|
33
|
+
showPercentage = _ref$showPercentage === void 0 ? false : _ref$showPercentage,
|
|
34
|
+
fontSize = _ref.fontSize;
|
|
35
|
+
var progressNumber = (0, _react.useMemo)(function () {
|
|
36
|
+
var width = progress;
|
|
37
|
+
|
|
38
|
+
if (progress > 100) {
|
|
39
|
+
width = 100;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (progress < 0) {
|
|
43
|
+
width = 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return width;
|
|
47
|
+
}, [progress]);
|
|
32
48
|
var normalizedRadius = (0, _react.useMemo)(function () {
|
|
33
49
|
return radius - stroke;
|
|
34
50
|
}, [radius, stroke]);
|
|
@@ -36,11 +52,11 @@ var ProgressRing = function ProgressRing(_ref) {
|
|
|
36
52
|
return normalizedRadius * 2 * Math.PI;
|
|
37
53
|
}, [normalizedRadius]);
|
|
38
54
|
var strokeDashoffsetOuter = (0, _react.useMemo)(function () {
|
|
39
|
-
return circumference - (100 -
|
|
40
|
-
}, [circumference,
|
|
55
|
+
return circumference - (100 - progressNumber) / 100 * circumference;
|
|
56
|
+
}, [circumference, progressNumber]);
|
|
41
57
|
var strokeDashoffsetInner = (0, _react.useMemo)(function () {
|
|
42
|
-
return circumference -
|
|
43
|
-
}, [circumference,
|
|
58
|
+
return circumference - progressNumber / 100 * circumference;
|
|
59
|
+
}, [circumference, progressNumber]);
|
|
44
60
|
return /*#__PURE__*/_react.default.createElement(_Styles.StyledSvg, {
|
|
45
61
|
height: radius * 2,
|
|
46
62
|
width: radius * 2,
|
|
@@ -61,7 +77,14 @@ var ProgressRing = function ProgressRing(_ref) {
|
|
|
61
77
|
r: normalizedRadius,
|
|
62
78
|
cx: radius,
|
|
63
79
|
cy: radius
|
|
64
|
-
})
|
|
80
|
+
}), showPercentage ? /*#__PURE__*/_react.default.createElement(_Styles.StyledProgressRingPercentage, {
|
|
81
|
+
$color: progressColor,
|
|
82
|
+
$fontSize: fontSize,
|
|
83
|
+
x: "50%",
|
|
84
|
+
y: "-50%",
|
|
85
|
+
dominantBaseline: "central",
|
|
86
|
+
textAnchor: "middle"
|
|
87
|
+
}, progressNumber, "%") : null);
|
|
65
88
|
};
|
|
66
89
|
|
|
67
90
|
exports.ProgressRing = ProgressRing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":["ProgressRing","backgroundColor","progressColor","progress","radius","stroke","className","normalizedRadius","circumference","Math","PI","strokeDashoffsetOuter","strokeDashoffsetInner","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":["ProgressRing","backgroundColor","progressColor","progress","radius","stroke","className","showPercentage","fontSize","progressNumber","width","normalizedRadius","circumference","Math","PI","strokeDashoffsetOuter","strokeDashoffsetInner","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;AAMA;;;;;;;;AAqBO,IAAMA,YAAoC,GAAG,SAAvCA,YAAuC,OAS9C;AAAA,MARJC,eAQI,QARJA,eAQI;AAAA,MAPJC,aAOI,QAPJA,aAOI;AAAA,2BANJC,QAMI;AAAA,MANJA,QAMI,8BANO,CAMP;AAAA,yBALJC,MAKI;AAAA,MALJA,MAKI,4BALK,EAKL;AAAA,yBAJJC,MAII;AAAA,MAJJA,MAII,4BAJK,CAIL;AAAA,MAHJC,SAGI,QAHJA,SAGI;AAAA,iCAFJC,cAEI;AAAA,MAFJA,cAEI,oCAFa,KAEb;AAAA,MADJC,QACI,QADJA,QACI;AACJ,MAAMC,cAAc,GAAG,oBAAQ,YAAM;AACnC,QAAIC,KAAK,GAAGP,QAAZ;;AACA,QAAIA,QAAQ,GAA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AAC,8BAAD;AACE,IAAA,MAAM,EAAEF,aADV;AAEE,IAAA,iBAAiB,EAAEc,qBAFrB;AAGE,IAAA,WAAW,EAAEX,MAHf;AAIE,IAAA,eAAe,YAAKO,aAAL,cAAsBA,aAAtB,CAJjB;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEP,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IAdF,EAuBGG,cAAc,gBACb,6BAAC,oCAAD;AACE,IAAA,MAAM,EAAEL,aADV;AAEE,IAAA,SAAS,EAAEM,QAFb;AAGE,IAAA,CAAC,EAAC,KAHJ;AAIE,IAAA,CAAC,EAAC,MAJJ;AAKE,IAAA,gBAAgB,EAAC,SALnB;AAME,IAAA,UAAU,EAAC;AANb,KAQGC,cARH,MADa,GAWX,IAlCN,CADF;AAsCD,CAzEM;;;AA2EPT,YAAY,CAACiB,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { FC, useMemo } from \"react\";\nimport {\n StyledBackgroundCircle,\n StyledForegroundCircle,\n StyledSvg,\n StyledProgressRingPercentage,\n} from \"./Styles\";\nimport classNames from \"classnames\";\n\nexport interface IProgressRingProps {\n /** Progress prop can be number. */\n progress?: number;\n /** Custom classname for styling. */\n backgroundColor?: string;\n /** Custom classname for styling. */\n progressColor?: string;\n /** Custom classname for styling. */\n radius?: number;\n /** Custom classname for styling. */\n stroke?: number;\n /** Applies passed classes */\n className?: string;\n /** Should the percentage be displayed inside ring or not */\n showPercentage?: boolean;\n /** Size of displayed percentage */\n fontSize?: number;\n}\n\nexport const ProgressRing: FC<IProgressRingProps> = ({\n backgroundColor,\n progressColor,\n progress = 0,\n radius = 20,\n stroke = 3,\n className,\n showPercentage = false,\n fontSize,\n}) => {\n const progressNumber = useMemo(() => {\n let width = progress;\n if (progress > 100) {\n width = 100;\n }\n if (progress < 0) {\n width = 0;\n }\n return width;\n }, [progress]);\n\n const normalizedRadius = useMemo(() => radius - stroke, [radius, stroke]);\n const circumference = useMemo(\n () => normalizedRadius * 2 * Math.PI,\n [normalizedRadius]\n );\n const strokeDashoffsetOuter = useMemo(\n () => circumference - ((100 - progressNumber) / 100) * circumference,\n [circumference, progressNumber]\n );\n const strokeDashoffsetInner = useMemo(\n () => circumference - (progressNumber / 100) * circumference,\n [circumference, progressNumber]\n );\n\n return (\n <StyledSvg\n height={radius * 2}\n width={radius * 2}\n className={classNames(className)}\n >\n <StyledBackgroundCircle\n $color={backgroundColor}\n $strokeDashOffset={-strokeDashoffsetOuter}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n <StyledForegroundCircle\n $color={progressColor}\n $strokeDashOffset={strokeDashoffsetInner}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n {showPercentage ? (\n <StyledProgressRingPercentage\n $color={progressColor}\n $fontSize={fontSize}\n x=\"50%\"\n y=\"-50%\"\n dominantBaseline=\"central\"\n textAnchor=\"middle\"\n >\n {progressNumber}%\n </StyledProgressRingPercentage>\n ) : null}\n </StyledSvg>\n );\n};\n\nProgressRing.displayName = \"ProgressRing\";\n"],"file":"ProgressRing.js"}
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.StyledSvg = exports.StyledForegroundCircle = exports.StyledBackgroundCircle = void 0;
|
|
8
|
+
exports.StyledSvg = exports.StyledProgressRingPercentage = exports.StyledForegroundCircle = exports.StyledBackgroundCircle = void 0;
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
|
|
@@ -25,7 +25,7 @@ var StyledBackgroundCircle = _styledComponents.default.circle.withConfig({
|
|
|
25
25
|
displayName: "Styles__StyledBackgroundCircle",
|
|
26
26
|
componentId: "sc-o6dcyu-1"
|
|
27
27
|
})(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", ""], function (props) {
|
|
28
|
-
return props.$color ? (0, _styledComponents.css)(["stroke:", ";"], props.$color) : (0, _styledComponents.css)(["stroke:var(--color-theme-300);"]);
|
|
28
|
+
return props.$color ? (0, _styledComponents.css)(["stroke:", ";"], props.$color) : (0, _styledComponents.css)(["stroke:var(--color-theme-transparent-300);"]);
|
|
29
29
|
}, function (props) {
|
|
30
30
|
return props.$strokeDashOffset && (0, _styledComponents.css)(["stroke-dashoffset:", ";"], props.$strokeDashOffset);
|
|
31
31
|
});
|
|
@@ -44,4 +44,16 @@ var StyledForegroundCircle = _styledComponents.default.circle.withConfig({
|
|
|
44
44
|
|
|
45
45
|
exports.StyledForegroundCircle = StyledForegroundCircle;
|
|
46
46
|
StyledForegroundCircle.displayName = "StyledForegroundCircle";
|
|
47
|
+
|
|
48
|
+
var StyledProgressRingPercentage = _styledComponents.default.text.withConfig({
|
|
49
|
+
displayName: "Styles__StyledProgressRingPercentage",
|
|
50
|
+
componentId: "sc-o6dcyu-3"
|
|
51
|
+
})(["transform:rotate(90deg);", " ", ""], function (props) {
|
|
52
|
+
return props.$color ? (0, _styledComponents.css)(["fill:", ";"], props.$color) : (0, _styledComponents.css)(["fill:var(--color-secondary);"]);
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return props.$fontSize ? (0, _styledComponents.css)(["font-size:", "px;"], props.$fontSize) : (0, _styledComponents.css)(["font-size:10px;"]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
exports.StyledProgressRingPercentage = StyledProgressRingPercentage;
|
|
58
|
+
StyledProgressRingPercentage.displayName = "StyledProgressRingPercentage";
|
|
47
59
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ProgressRing/Styles.ts"],"names":["StyledSvg","styled","svg","displayName","StyledBackgroundCircle","circle","props","$color","css","$strokeDashOffset","StyledForegroundCircle"],"mappings":";;;;;;;;;AAAA;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ProgressRing/Styles.ts"],"names":["StyledSvg","styled","svg","displayName","StyledBackgroundCircle","circle","props","$color","css","$strokeDashOffset","StyledForegroundCircle","StyledProgressRingPercentage","text","$fontSize"],"mappings":";;;;;;;;;AAAA;;;;;;AAQO,IAAMA,SAAS,GAAGC,0BAAOC,GAAV;AAAA;AAAA;AAAA,iCAAf;;;AAIPF,SAAS,CAACG,WAAV,GAAwB,WAAxB;;AAEO,IAAMC,sBAAsB,GAAGH,0BAAOI,MAAV;AAAA;AAAA;AAAA,4EAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,OACIC,qBADJ,oBAEgBF,KAAK,CAACC,MAFtB,QAIIC,qBAJJ,iDADA;AAAA,CAJ+B,EAa/B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACG,iBAAN,QACAD,qBADA,+BAEuBF,KAAK,CAACG,iBAF7B,CADA;AAAA,CAb+B,CAA5B;;;AAoBPL,sBAAsB,CAACD,WAAvB,GAAqC,wBAArC;;AAEO,IAAMO,sBAAsB,GAAGT,0BAAOI,MAAV;AAAA;AAAA;AAAA,4EAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,OACIC,qBADJ,oBAEgBF,KAAK,CAACC,MAFtB,QAIIC,qBAJJ,qCADA;AAAA,CAJ+B,EAa/B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACG,iBAAN,QACAD,qBADA,+BAEuBF,KAAK,CAACG,iBAF7B,CADA;AAAA,CAb+B,CAA5B;;;AAoBPC,sBAAsB,CAACP,WAAvB,GAAqC,wBAArC;;AAEO,IAAMQ,4BAA4B,GAAGV,0BAAOW,IAAV;AAAA;AAAA;AAAA,0CAGrC,UAACN,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,OACIC,qBADJ,kBAEcF,KAAK,CAACC,MAFpB,QAIIC,qBAJJ,mCADA;AAAA,CAHqC,EAYrC,UAACF,KAAD;AAAA,SACAA,KAAK,CAACO,SAAN,OACIL,qBADJ,yBAEmBF,KAAK,CAACO,SAFzB,QAIIL,qBAJJ,sBADA;AAAA,CAZqC,CAAlC;;;AAsBPG,4BAA4B,CAACR,WAA7B,GAA2C,8BAA3C","sourcesContent":["import styled, { css } from \"styled-components\";\n\ninterface IStyledProgressRing {\n $color?: string;\n $strokeDashOffset?: number;\n $fontSize?: number;\n}\n\nexport const StyledSvg = styled.svg`\n transform: rotate(-90deg);\n`;\n\nStyledSvg.displayName = \"StyledSvg\";\n\nexport const StyledBackgroundCircle = styled.circle<IStyledProgressRing>`\n fill: transparent;\n transition: stroke-dashoffset 0.5s linear;\n\n ${(props) =>\n props.$color\n ? css`\n stroke: ${props.$color};\n `\n : css`\n stroke: var(--color-theme-transparent-300);\n `}\n\n ${(props) =>\n props.$strokeDashOffset &&\n css`\n stroke-dashoffset: ${props.$strokeDashOffset};\n `}\n`;\n\nStyledBackgroundCircle.displayName = \"StyledBackgroundCircle\";\n\nexport const StyledForegroundCircle = styled.circle<IStyledProgressRing>`\n fill: transparent;\n transition: stroke-dashoffset 0.5s linear;\n\n ${(props) =>\n props.$color\n ? css`\n stroke: ${props.$color};\n `\n : css`\n stroke: var(--color-secondary);\n `}\n\n ${(props) =>\n props.$strokeDashOffset &&\n css`\n stroke-dashoffset: ${props.$strokeDashOffset};\n `}\n`;\n\nStyledForegroundCircle.displayName = \"StyledForegroundCircle\";\n\nexport const StyledProgressRingPercentage = styled.text<IStyledProgressRing>`\n transform: rotate(90deg);\n\n ${(props) =>\n props.$color\n ? css`\n fill: ${props.$color};\n `\n : css`\n fill: var(--color-secondary);\n `}\n\n ${(props) =>\n props.$fontSize\n ? css`\n font-size: ${props.$fontSize}px;\n `\n : css`\n font-size: 10px;\n `}\n`;\n\nStyledProgressRingPercentage.displayName = \"StyledProgressRingPercentage\";\n"],"file":"Styles.js"}
|
|
@@ -30,6 +30,19 @@ Object.keys(_ButtonGroup).forEach(function (key) {
|
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
+
var _Breadcrumbs = require("./Breadcrumbs");
|
|
34
|
+
|
|
35
|
+
Object.keys(_Breadcrumbs).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _Breadcrumbs[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _Breadcrumbs[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
33
46
|
var _CounterButton = require("./CounterButton");
|
|
34
47
|
|
|
35
48
|
Object.keys(_CounterButton).forEach(function (key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./Button\";\nexport * from \"./ButtonGroup\";\nexport * from \"./CounterButton\";\nexport * from \"./Steppers\";\nexport * from \"./Tables\";\nexport * from \"./CompleteCheckbox\";\nexport * from \"./Paper\";\nexport * from \"./ScaleBar\";\nexport * from \"./Card\";\nexport * from \"./EntityCard\";\nexport * from \"./Signifier\";\nexport * from \"./Avatar\";\nexport * from \"./Tag\";\nexport * from \"./Loaders\";\nexport * from \"./Nav\";\nexport * from \"./Bubble\";\nexport * from \"./Input\";\nexport * from \"./Menu\";\nexport * from \"./Expanders\";\nexport * from \"./Pickers\";\nexport * from \"./DatePicker\";\nexport * from \"./List\";\nexport * from \"./MenuSelector\";\nexport * from \"./MultiAvatar\";\nexport * from \"./RadioButton\";\nexport * from \"./ScrollShadow\";\nexport * from \"./Icons\";\nexport * from \"./Textarea\";\nexport * from \"./Modal\";\nexport * from \"./Sheet\";\nexport * from \"./Header\";\nexport * from \"./AutoResizeTextarea\";\nexport * from \"./Overlay\";\nexport * from \"./Accordion\";\nexport * from \"./Choose\";\nexport * from \"./Links\";\nexport * from \"./SelectDate\";\nexport * from \"./Popper\";\nexport * from \"./ToastMessage\";\nexport * from \"./Tooltip\";\nexport * from \"./Transitions\";\nexport * from \"./Pressed\";\nexport * from \"./Window\";\nexport * from \"./ValueButton\";\nexport * from \"./Select\";\nexport * from \"./Dialog\";\nexport * from \"./ConfirmDialog\";\nexport * from \"./Checkbox\";\nexport * from \"./Toggle\";\nexport * from \"./Typography\";\nexport * from \"./Autocomplete\";\nexport * from \"./ComboBox\";\nexport * from \"./ProgressBar\";\nexport * from \"./Reactions\";\nexport * from \"./Label\";\nexport * from \"./GlobalStyle\";\nexport * from \"./ProgressRing\";\nexport * from \"./Folder\";\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./Button\";\nexport * from \"./ButtonGroup\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./CounterButton\";\nexport * from \"./Steppers\";\nexport * from \"./Tables\";\nexport * from \"./CompleteCheckbox\";\nexport * from \"./Paper\";\nexport * from \"./ScaleBar\";\nexport * from \"./Card\";\nexport * from \"./EntityCard\";\nexport * from \"./Signifier\";\nexport * from \"./Avatar\";\nexport * from \"./Tag\";\nexport * from \"./Loaders\";\nexport * from \"./Nav\";\nexport * from \"./Bubble\";\nexport * from \"./Input\";\nexport * from \"./Menu\";\nexport * from \"./Expanders\";\nexport * from \"./Pickers\";\nexport * from \"./DatePicker\";\nexport * from \"./List\";\nexport * from \"./MenuSelector\";\nexport * from \"./MultiAvatar\";\nexport * from \"./RadioButton\";\nexport * from \"./ScrollShadow\";\nexport * from \"./Icons\";\nexport * from \"./Textarea\";\nexport * from \"./Modal\";\nexport * from \"./Sheet\";\nexport * from \"./Header\";\nexport * from \"./AutoResizeTextarea\";\nexport * from \"./Overlay\";\nexport * from \"./Accordion\";\nexport * from \"./Choose\";\nexport * from \"./Links\";\nexport * from \"./SelectDate\";\nexport * from \"./Popper\";\nexport * from \"./ToastMessage\";\nexport * from \"./Tooltip\";\nexport * from \"./Transitions\";\nexport * from \"./Pressed\";\nexport * from \"./Window\";\nexport * from \"./ValueButton\";\nexport * from \"./Select\";\nexport * from \"./Dialog\";\nexport * from \"./ConfirmDialog\";\nexport * from \"./Checkbox\";\nexport * from \"./Toggle\";\nexport * from \"./Typography\";\nexport * from \"./Autocomplete\";\nexport * from \"./ComboBox\";\nexport * from \"./ProgressBar\";\nexport * from \"./Reactions\";\nexport * from \"./Label\";\nexport * from \"./GlobalStyle\";\nexport * from \"./ProgressRing\";\nexport * from \"./Folder\";\n"],"file":"index.js"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export interface BreadcrumbsProps {
|
|
3
|
+
children: ReactElement[];
|
|
4
|
+
className?: string;
|
|
5
|
+
separator?: ReactElement | string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Breadcrumbs: ({ children, className, separator, }: BreadcrumbsProps) => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAmB,MAAM,OAAO,CAAC;AAa7D,MAAM,WAAW,gBAAgB;IAE/B,QAAQ,EAAE,YAAY,EAAE,CAAC;IAEzB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,WAAW,wCAIrB,gBAAgB,gBAiDlB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useRef, useMemo } from "react";
|
|
2
|
+
import { LayerContextProvider, layers } from "../..";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
import { TreeDotsIcon } from "../Icons";
|
|
5
|
+
import { List, ListItem } from "../List";
|
|
6
|
+
import { Menu } from "../Menu";
|
|
7
|
+
import { StyledListMenuItem, StyledNavElement, StyledOList, StyledSeparator } from "./Styles";
|
|
8
|
+
export var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
9
|
+
var children = _ref.children,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
_ref$separator = _ref.separator,
|
|
12
|
+
separator = _ref$separator === void 0 ? "/" : _ref$separator;
|
|
13
|
+
var ref = useRef(null);
|
|
14
|
+
var menuBreadcrumbs = 0;
|
|
15
|
+
|
|
16
|
+
var _useMemo = useMemo(function () {
|
|
17
|
+
return children.reduce(function (acc, value, index) {
|
|
18
|
+
index >= menuBreadcrumbs ? acc.x.push(value) : acc.y.push(value);
|
|
19
|
+
return acc;
|
|
20
|
+
}, {
|
|
21
|
+
x: [],
|
|
22
|
+
y: []
|
|
23
|
+
});
|
|
24
|
+
}, [children, menuBreadcrumbs]),
|
|
25
|
+
x = _useMemo.x,
|
|
26
|
+
y = _useMemo.y;
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/React.createElement(StyledNavElement, {
|
|
29
|
+
className: className,
|
|
30
|
+
ref: ref
|
|
31
|
+
}, /*#__PURE__*/React.createElement(StyledOList, null, menuBreadcrumbs > 0 ? /*#__PURE__*/React.createElement(StyledListMenuItem, null, /*#__PURE__*/React.createElement(LayerContextProvider, {
|
|
32
|
+
value: {
|
|
33
|
+
zIndex: layers.skyscraper
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
36
|
+
target: /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
variant: "text gray"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(TreeDotsIcon, null))
|
|
39
|
+
}, /*#__PURE__*/React.createElement(List, {
|
|
40
|
+
className: "tw-py-2"
|
|
41
|
+
}, y.map(function (child, index) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
43
|
+
key: index
|
|
44
|
+
}, child);
|
|
45
|
+
}))))) : null, x.map(function (child, index) {
|
|
46
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
47
|
+
key: index
|
|
48
|
+
}, index > 0 || menuBreadcrumbs > 0 ? /*#__PURE__*/React.createElement(StyledSeparator, null, separator) : null, /*#__PURE__*/React.createElement("li", {
|
|
49
|
+
className: "tw-flex"
|
|
50
|
+
}, child));
|
|
51
|
+
})));
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":["React","useRef","useMemo","LayerContextProvider","layers","Button","TreeDotsIcon","List","ListItem","Menu","StyledListMenuItem","StyledNavElement","StyledOList","StyledSeparator","Breadcrumbs","children","className","separator","ref","menuBreadcrumbs","reduce","acc","value","index","x","push","y","zIndex","skyscraper","map","child"],"mappings":"AAAA,OAAOA,KAAP,IAA8BC,MAA9B,EAAsCC,OAAtC,QAAqD,OAArD;AACA,SAASC,oBAAT,EAA+BC,MAA/B,QAA6C,OAA7C;AACA,SAASC,MAAT,QAAuB,WAAvB;AACA,SAASC,YAAT,Q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eACJ,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC;AAAhB,oBACE,oBAAC,YAAD,OADF;AAFJ,kBAOE,oBAAC,IAAD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGF,CAAC,CAACG,GAAF,CAAM,UAACC,KAAD,EAAQP,KAAR;AAAA,wBACL,oBAAC,QAAD;AAAU,MAAA,GAAG,EAAEA;AAAf,OAAuBO,KAAvB,CADK;AAAA,GAAN,CADH,CAPF,CADF,CADF,CADD,GAkBG,IAnBN,EAoBGN,CAAC,CAACK,GAAF,CAAM,UAACC,KAAD,EAAQP,KAAR,EAAkB;AACvB,wBACE,oBAAC,KAAD,CAAO,QAAP;AAAgB,MAAA,GAAG,EAAEA;AAArB,OACGA,KAAK,GAAG,CAAR,IAAaJ,eAAe,GAAG,CAA/B,gBACC,oBAAC,eAAD,QAAkBF,SAAlB,CADD,GAEG,IAHN,eAIE;AAAI,MAAA,SAAS,EAAC;AAAd,OAAyBa,KAAzB,CAJF,CADF;AAQD,GATA,CApBH,CADF,CADF;AAmCD,CArDM","sourcesContent":["import React, { ReactElement, useRef, useMemo } from \"react\";\nimport { LayerContextProvider, layers } from \"../..\";\nimport { Button } from \"../Button\";\nimport { TreeDotsIcon } from \"../Icons\";\nimport { List, ListItem } from \"../List\";\nimport { Menu } from \"../Menu\";\nimport {\n StyledListMenuItem,\n StyledNavElement,\n StyledOList,\n StyledSeparator,\n} from \"./Styles\";\n\nexport interface BreadcrumbsProps {\n /** Children type of node or string */\n children: ReactElement[];\n /** ClassName */\n className?: string;\n /** Separator */\n separator?: ReactElement | string;\n}\n\nexport const Breadcrumbs = ({\n children,\n className,\n separator = \"/\",\n}: BreadcrumbsProps) => {\n const ref = useRef<null | HTMLUListElement>(null);\n const menuBreadcrumbs = 0;\n\n const { x, y } = useMemo(() => {\n return children.reduce(\n (acc, value, index) => {\n index >= menuBreadcrumbs ? acc.x.push(value) : acc.y.push(value);\n return acc;\n },\n { x: [], y: [] } as { x: ReactElement[]; y: ReactElement[] }\n );\n }, [children, menuBreadcrumbs]);\n\n return (\n <StyledNavElement className={className} ref={ref}>\n <StyledOList>\n {menuBreadcrumbs > 0 ? (\n <StyledListMenuItem>\n <LayerContextProvider value={{ zIndex: layers.skyscraper }}>\n <Menu\n target={\n <Button variant=\"text gray\">\n <TreeDotsIcon />\n </Button>\n }\n >\n <List className=\"tw-py-2\">\n {y.map((child, index) => (\n <ListItem key={index}>{child}</ListItem>\n ))}\n </List>\n </Menu>\n </LayerContextProvider>\n </StyledListMenuItem>\n ) : null}\n {x.map((child, index) => {\n return (\n <React.Fragment key={index}>\n {index > 0 || menuBreadcrumbs > 0 ? (\n <StyledSeparator>{separator}</StyledSeparator>\n ) : null}\n <li className=\"tw-flex\">{child}</li>\n </React.Fragment>\n );\n })}\n </StyledOList>\n </StyledNavElement>\n );\n};\n"],"file":"Breadcrumbs.js"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const StyledNavElement: import("styled-components").StyledComponent<"nav", any, {}, never>;
|
|
2
|
+
export declare const StyledOList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
3
|
+
export declare const StyledListMenuItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
4
|
+
export declare const StyledListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
5
|
+
export declare const StyledSeparator: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
6
|
+
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,oEAK5B,CAAC;AAIF,eAAO,MAAM,WAAW,mEAOvB,CAAC;AAIF,eAAO,MAAM,kBAAkB,mEAE9B,CAAC;AAIF,eAAO,MAAM,cAAc,mEAE1B,CAAC;AAIF,eAAO,MAAM,eAAe,mEAE3B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BoxSizingStyle } from "../BoxSizingStyle";
|
|
3
|
+
import { FontStyle } from "../FontStyle";
|
|
4
|
+
export var StyledNavElement = styled.nav.withConfig({
|
|
5
|
+
displayName: "Styles__StyledNavElement",
|
|
6
|
+
componentId: "sc-rxaesd-0"
|
|
7
|
+
})(["", " ", " ", " ", ""], {
|
|
8
|
+
"width": "100%"
|
|
9
|
+
}, {
|
|
10
|
+
"overflow": "visible"
|
|
11
|
+
}, FontStyle, BoxSizingStyle);
|
|
12
|
+
StyledNavElement.displayName = "StyledNavElement";
|
|
13
|
+
export var StyledOList = styled.ul.withConfig({
|
|
14
|
+
displayName: "Styles__StyledOList",
|
|
15
|
+
componentId: "sc-rxaesd-1"
|
|
16
|
+
})(["", " ", " ", " ", " ", " ", ""], {
|
|
17
|
+
"display": "flex"
|
|
18
|
+
}, {
|
|
19
|
+
"alignItems": "flex-start"
|
|
20
|
+
}, {
|
|
21
|
+
"listStyleType": "none"
|
|
22
|
+
}, {
|
|
23
|
+
"padding": "0px"
|
|
24
|
+
}, {
|
|
25
|
+
"margin": "0px"
|
|
26
|
+
}, {
|
|
27
|
+
"alignItems": "center"
|
|
28
|
+
});
|
|
29
|
+
StyledOList.displayName = "StyledOList";
|
|
30
|
+
export var StyledListMenuItem = styled.li.withConfig({
|
|
31
|
+
displayName: "Styles__StyledListMenuItem",
|
|
32
|
+
componentId: "sc-rxaesd-2"
|
|
33
|
+
})(["", ""], {
|
|
34
|
+
"flexShrink": "0"
|
|
35
|
+
});
|
|
36
|
+
StyledListMenuItem.displayName = "StyledListMenuItem";
|
|
37
|
+
export var StyledListItem = styled.li.withConfig({
|
|
38
|
+
displayName: "Styles__StyledListItem",
|
|
39
|
+
componentId: "sc-rxaesd-3"
|
|
40
|
+
})(["", ""], {
|
|
41
|
+
"display": "flex"
|
|
42
|
+
});
|
|
43
|
+
StyledListItem.displayName = "StyledListItem";
|
|
44
|
+
export var StyledSeparator = styled.li.withConfig({
|
|
45
|
+
displayName: "Styles__StyledSeparator",
|
|
46
|
+
componentId: "sc-rxaesd-4"
|
|
47
|
+
})(["", ""], {
|
|
48
|
+
"marginLeft": "1rem",
|
|
49
|
+
"marginRight": "1rem"
|
|
50
|
+
});
|
|
51
|
+
StyledSeparator.displayName = "StyledSeparator";
|
|
52
|
+
//# sourceMappingURL=Styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Breadcrumbs/Styles.ts"],"names":["styled","BoxSizingStyle","FontStyle","StyledNavElement","nav","displayName","StyledOList","ul","StyledListMenuItem","li","StyledListItem","StyledSeparator"],"mappings":"AAAA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,SAAT,QAA0B,cAA1B;AAEA,OAAO,IAAMC,gBAAgB,GAAGH,MAAM,CAACI,GAAV;AAAA;AAAA;AAAA,4BACvB;AAAA;AAAA,CADuB,EAEvB;AAAA;AAAA,CAFuB,EAGzBF,SAHyB,EAIzBD,cAJyB,CAAtB;AAOPE,gBAAgB,CAACE,WAAjB,GAA+B,kBAA/B;AAEA,OAAO,IAAMC,WAAW,GAAGN,MAAM,CAACO,EAAV;AAAA;AAAA;AAAA,sCAClB;AAAA;AAAA,CADkB,EAElB;AAAA;AAAA,CAFkB,EAGlB;AAAA;AAAA,CAHkB,EAIlB;AAAA;AAAA,CAJkB,EAKlB;AAAA;AAAA,CALkB,EAMlB;AAAA;AAAA,CANkB,CAAjB;AASPD,WAAW,CAACD,WAAZ,GAA0B,aAA1B;AAEA,OAAO,IAAMG,kBAAkB,GAAGR,MAAM,CAACS,EAAV;AAAA;AAAA;AAAA,aACzB;AAAA;AAAA,CADyB,CAAxB;AAIPD,kBAAkB,CAACH,WAAnB,GAAiC,oBAAjC;AAEA,OAAO,IAAMK,cAAc,GAAGV,MAAM,CAACS,EAAV;AAAA;AAAA;AAAA,aACrB;AAAA;AAAA,CADqB,CAApB;AAIPC,cAAc,CAACL,WAAf,GAA6B,gBAA7B;AAEA,OAAO,IAAMM,eAAe,GAAGX,MAAM,CAACS,EAAV;AAAA;AAAA;AAAA,aACtB;AAAA;AAAA;AAAA,CADsB,CAArB;AAIPE,eAAe,CAACN,WAAhB,GAA8B,iBAA9B","sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const StyledNavElement = styled.nav`\n ${tw`tw-w-full`}\n ${tw`tw-overflow-visible`}\n ${FontStyle}\n ${BoxSizingStyle}\n`;\n\nStyledNavElement.displayName = \"StyledNavElement\";\n\nexport const StyledOList = styled.ul`\n ${tw`tw-flex`}\n ${tw`tw-items-start`}\n ${tw`tw-list-none`}\n ${tw`tw-p-0`}\n ${tw`tw-m-0`}\n ${tw`tw-items-center`}\n`;\n\nStyledOList.displayName = \"StyledOList\";\n\nexport const StyledListMenuItem = styled.li`\n ${tw`tw-flex-shrink-0`}\n`;\n\nStyledListMenuItem.displayName = \"StyledListMenuItem\";\n\nexport const StyledListItem = styled.li`\n ${tw`tw-flex`}\n`;\n\nStyledListItem.displayName = \"StyledListItem\";\n\nexport const StyledSeparator = styled.li`\n ${tw`tw-mx-4`}\n`;\n\nStyledSeparator.displayName = \"StyledSeparator\";\n"],"file":"Styles.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAd","sourcesContent":["export * from \"./Breadcrumbs\";\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAS3C,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,kBAAkB,CAyE/C,CAAC"}
|