@proteinjs/ui 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.7](https://github.com/proteinjs/ui/compare/@proteinjs/ui@2.0.6...@proteinjs/ui@2.0.7) (2024-05-21)
7
+
8
+ **Note:** Version bump only for package @proteinjs/ui
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.0.6](https://github.com/proteinjs/ui/compare/@proteinjs/ui@2.0.5...@proteinjs/ui@2.0.6) (2024-05-17)
7
15
 
8
16
 
package/dist/index.d.ts CHANGED
@@ -9,7 +9,6 @@ export * from './src/form/container/FormPage';
9
9
  export * from './src/container/PageContainer';
10
10
  export * from './src/container/AccountAuth';
11
11
  export * from './src/container/NavMenu';
12
- export * from './src/list/NestedList';
13
12
  export * from './src/table/Table';
14
13
  export * from './src/table/TableButton';
15
14
  export * from './src/table/TableLoader';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AAExC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AAExC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -25,7 +25,6 @@ __exportStar(require("./src/form/container/FormPage"), exports);
25
25
  __exportStar(require("./src/container/PageContainer"), exports);
26
26
  __exportStar(require("./src/container/AccountAuth"), exports);
27
27
  __exportStar(require("./src/container/NavMenu"), exports);
28
- __exportStar(require("./src/list/NestedList"), exports);
29
28
  __exportStar(require("./src/table/Table"), exports);
30
29
  __exportStar(require("./src/table/TableButton"), exports);
31
30
  __exportStar(require("./src/table/TableLoader"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,oDAAkC;AAElC,kDAAgC;AAChC,mDAAiC;AACjC,wDAAsC;AAEtC,8DAA4C;AAE5C,iEAA+C;AAC/C,gEAA8C;AAE9C,gEAA8C;AAC9C,8DAA4C;AAC5C,0DAAwC;AAExC,wDAAsC;AAEtC,oDAAkC;AAClC,0DAAwC;AACxC,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,oDAAkC;AAElC,kDAAgC;AAChC,mDAAiC;AACjC,wDAAsC;AAEtC,8DAA4C;AAE5C,iEAA+C;AAC/C,gEAA8C;AAE9C,gEAA8C;AAC9C,8DAA4C;AAC5C,0DAAwC;AAExC,oDAAkC;AAClC,0DAAwC;AACxC,0DAAwC"}
package/index.ts CHANGED
@@ -14,8 +14,6 @@ export * from './src/container/PageContainer';
14
14
  export * from './src/container/AccountAuth';
15
15
  export * from './src/container/NavMenu';
16
16
 
17
- export * from './src/list/NestedList';
18
-
19
17
  export * from './src/table/Table';
20
18
  export * from './src/table/TableButton';
21
19
  export * from './src/table/TableLoader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/ui",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "UI libs",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "main": "./dist/generated/index.js",
55
55
  "types": "./dist/generated/index.d.ts",
56
- "gitHead": "a51c4c8944bc140db08655a5f1d059515165edae"
56
+ "gitHead": "49ab325eb7fdf9e48b0401f9a5c4a433bc5a442e"
57
57
  }
@@ -1,14 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- export type NestedListItem = {
3
- element: ReactElement;
4
- children?: NestedListItem[];
5
- renderChildren?: boolean;
6
- };
7
- type NestedListProps = {
8
- items: NestedListItem[];
9
- level?: number;
10
- levelColors?: string[];
11
- };
12
- export declare const NestedList: ({ items, level, levelColors }: NestedListProps) => React.JSX.Element;
13
- export {};
14
- //# sourceMappingURL=NestedList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NestedList.d.ts","sourceRoot":"","sources":["../../../src/list/NestedList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAC9G,KAAK,eAAe,GAAG;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAO3F,eAAO,MAAM,UAAU,kCAAmC,eAAe,sBA8CxE,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NestedList = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var material_1 = require("@mui/material");
9
- var blue = '#1976d2';
10
- var green = '#76d275';
11
- var orange = '#ffa726';
12
- var purple = '#ab47bc';
13
- var defaultLevelColors = [blue, green, orange, purple];
14
- var NestedList = function (_a) {
15
- var items = _a.items, level = _a.level, levelColors = _a.levelColors;
16
- var isRoot = typeof level === 'undefined';
17
- var resolvedLevel = level ? level : 0;
18
- var resolvedLevelColors = levelColors ? levelColors : defaultLevelColors;
19
- var flattenedItems = flattenItems(items);
20
- function flattenItems(items) {
21
- var flattened = [];
22
- for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
23
- var item = items_1[_i];
24
- flattened.push(item);
25
- if (item.children && (item.renderChildren || typeof item.renderChildren === 'undefined')) {
26
- flattened.push(item.children);
27
- }
28
- }
29
- return flattened;
30
- }
31
- return (react_1.default.createElement(material_1.Box, { component: 'ul', sx: {
32
- padding: isRoot ? 0 : undefined,
33
- margin: isRoot ? 0 : undefined,
34
- } }, flattenedItems.map(function (item, index) {
35
- return Array.isArray(item) ? (react_1.default.createElement(exports.NestedList, { key: index, items: item, level: resolvedLevel + 1 })) : (react_1.default.createElement(material_1.Box, { key: index, component: 'li', sx: function (theme) { return ({
36
- borderLeft: 3,
37
- borderLeftColor: resolvedLevelColors[resolvedLevel % resolvedLevelColors.length],
38
- listStyleType: 'none',
39
- marginTop: !(isRoot && index == 0) ? theme.spacing(1) : undefined,
40
- }); } }, item.element));
41
- })));
42
- };
43
- exports.NestedList = NestedList;
44
- //# sourceMappingURL=NestedList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NestedList.js","sourceRoot":"","sources":["../../../src/list/NestedList.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA4C;AAC5C,0CAAoC;AAIpC,IAAM,IAAI,GAAG,SAAS,CAAC;AACvB,IAAM,KAAK,GAAG,SAAS,CAAC;AACxB,IAAM,MAAM,GAAG,SAAS,CAAC;AACzB,IAAM,MAAM,GAAG,SAAS,CAAC;AACzB,IAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD,IAAM,UAAU,GAAG,UAAC,EAA8C;QAA5C,KAAK,WAAA,EAAE,KAAK,WAAA,EAAE,WAAW,iBAAA;IACpD,IAAM,MAAM,GAAG,OAAO,KAAK,KAAK,WAAW,CAAC;IAC5C,IAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,IAAM,mBAAmB,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAC3E,IAAM,cAAc,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAE3C,SAAS,YAAY,CAAC,KAAuB;QAC3C,IAAM,SAAS,GAAG,EAAE,CAAC;QACrB,KAAmB,UAAK,EAAL,eAAK,EAAL,mBAAK,EAAL,IAAK,EAAE;YAArB,IAAM,IAAI,cAAA;YACb,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,WAAW,CAAC,EAAE;gBACxF,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC/B;SACF;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,CACL,8BAAC,cAAG,IACF,SAAS,EAAC,IAAI,EACd,EAAE,EAAE;YACF,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YAC/B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;SAC/B,IAEA,cAAc,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK;QAC9B,OAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACpB,8BAAC,kBAAU,IAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,GAAG,CAAC,GAAI,CAClE,CAAC,CAAC,CAAC,CACF,8BAAC,cAAG,IACF,GAAG,EAAE,KAAK,EACV,SAAS,EAAC,IAAI,EACd,EAAE,EAAE,UAAC,KAAK,IAAK,OAAA,CAAC;gBACd,UAAU,EAAE,CAAC;gBACb,eAAe,EAAE,mBAAmB,CAAC,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC;gBAChF,aAAa,EAAE,MAAM;gBACrB,SAAS,EAAE,CAAC,CAAC,MAAM,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;aAClE,CAAC,EALa,CAKb,IAED,IAAI,CAAC,OAAO,CACT,CACP;IAfD,CAeC,CACF,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,UAAU,cA8CrB"}
@@ -1,58 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Box } from '@mui/material';
3
-
4
- export type NestedListItem = { element: ReactElement; children?: NestedListItem[]; renderChildren?: boolean };
5
- type NestedListProps = { items: NestedListItem[]; level?: number; levelColors?: string[] };
6
- const blue = '#1976d2';
7
- const green = '#76d275';
8
- const orange = '#ffa726';
9
- const purple = '#ab47bc';
10
- const defaultLevelColors = [blue, green, orange, purple];
11
-
12
- export const NestedList = ({ items, level, levelColors }: NestedListProps) => {
13
- const isRoot = typeof level === 'undefined';
14
- const resolvedLevel = level ? level : 0;
15
- const resolvedLevelColors = levelColors ? levelColors : defaultLevelColors;
16
- const flattenedItems = flattenItems(items);
17
-
18
- function flattenItems(items: NestedListItem[]): (NestedListItem | NestedListItem[])[] {
19
- const flattened = [];
20
- for (const item of items) {
21
- flattened.push(item);
22
- if (item.children && (item.renderChildren || typeof item.renderChildren === 'undefined')) {
23
- flattened.push(item.children);
24
- }
25
- }
26
-
27
- return flattened;
28
- }
29
-
30
- return (
31
- <Box
32
- component='ul'
33
- sx={{
34
- padding: isRoot ? 0 : undefined,
35
- margin: isRoot ? 0 : undefined,
36
- }}
37
- >
38
- {flattenedItems.map((item, index) =>
39
- Array.isArray(item) ? (
40
- <NestedList key={index} items={item} level={resolvedLevel + 1} />
41
- ) : (
42
- <Box
43
- key={index}
44
- component='li'
45
- sx={(theme) => ({
46
- borderLeft: 3,
47
- borderLeftColor: resolvedLevelColors[resolvedLevel % resolvedLevelColors.length],
48
- listStyleType: 'none',
49
- marginTop: !(isRoot && index == 0) ? theme.spacing(1) : undefined,
50
- })}
51
- >
52
- {item.element}
53
- </Box>
54
- )
55
- )}
56
- </Box>
57
- );
58
- };