@anywayseo/tools 1.5.1 → 1.5.3
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/components/base/center/index.d.ts +3 -2
- package/dist/components/base/grid/index.d.ts +3 -3
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/list/index.d.ts +3 -3
- package/dist/components/table/index.d.ts +2 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/{index-DLPk8AIs.js → index-C5pGuMKq.js} +24 -9
- package/dist/{index-DD5l7Azu.mjs → index-DZkjaSoV.mjs} +24 -9
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/components/common/index.d.ts +5 -0
- package/package.json +7 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { BoxPositionProps } from '../../../types';
|
|
2
3
|
type CenterProps = PropsWithChildren<{
|
|
3
|
-
className
|
|
4
|
-
}>;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & BoxPositionProps>;
|
|
5
6
|
declare const Center: FC<CenterProps>;
|
|
6
7
|
export default Center;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Key } from 'react';
|
|
2
|
-
import { KeyGetter, RenderFunction } from '../../../types';
|
|
2
|
+
import { BoxPositionProps, KeyGetter, RenderFunction } from '../../../types';
|
|
3
3
|
import { ColumnsConfig, SpacingConfig } from './types';
|
|
4
4
|
type GridGetKeyProp<T> = T extends {
|
|
5
5
|
key: Key;
|
|
@@ -14,6 +14,6 @@ type GridProps<T> = {
|
|
|
14
14
|
gap?: SpacingConfig;
|
|
15
15
|
className?: string;
|
|
16
16
|
render: RenderFunction<T>;
|
|
17
|
-
} & GridGetKeyProp<T
|
|
18
|
-
declare const Grid: <T>({ items, columns, gap, render, getKey, className }: GridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
} & GridGetKeyProp<T> & BoxPositionProps;
|
|
18
|
+
declare const Grid: <T>({ items, columns, gap, render, getKey, className, ...boxProps }: GridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default Grid;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../index-
|
|
3
|
+
const index = require("../index-C5pGuMKq.js");
|
|
4
4
|
exports.Author = index.Author;
|
|
5
5
|
exports.BonusCard = index.BonusCard;
|
|
6
6
|
exports.Center = index.Center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderFunction } from '../../types';
|
|
1
|
+
import { BoxPositionProps, RenderFunction } from '../../types';
|
|
2
2
|
type ListRenderProps<T> = T extends string ? {
|
|
3
3
|
render?: never;
|
|
4
4
|
} : {
|
|
@@ -8,6 +8,6 @@ type ListProps<T = string> = {
|
|
|
8
8
|
items: T[];
|
|
9
9
|
bullet?: string;
|
|
10
10
|
className?: string;
|
|
11
|
-
} & ListRenderProps<T
|
|
12
|
-
declare const List: <T>({ items, bullet, render, className }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
} & ListRenderProps<T> & BoxPositionProps;
|
|
12
|
+
declare const List: <T>({ items, bullet, render, className, ...boxProps }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default List;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { BoxPositionProps } from '../../types';
|
|
2
3
|
type TableProps = {
|
|
3
4
|
columnNumber: number;
|
|
4
5
|
items: ReactNode[];
|
|
@@ -7,6 +8,6 @@ type TableProps = {
|
|
|
7
8
|
striped?: boolean;
|
|
8
9
|
scrollable?: boolean;
|
|
9
10
|
className?: string;
|
|
10
|
-
};
|
|
11
|
+
} & BoxPositionProps;
|
|
11
12
|
declare const Table: FC<TableProps>;
|
|
12
13
|
export default Table;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ITabItem, RenderFunction } from '../../types';
|
|
1
|
+
import { BoxPositionProps, ITabItem, RenderFunction } from '../../types';
|
|
2
2
|
type TabsProps<T> = {
|
|
3
3
|
items: ITabItem<T>[];
|
|
4
4
|
className?: string;
|
|
5
5
|
render: RenderFunction<T>;
|
|
6
|
-
};
|
|
7
|
-
declare const Tabs: <T>({ items, className, render }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
} & BoxPositionProps;
|
|
7
|
+
declare const Tabs: <T>({ items, className, render, ...boxProps }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default Tabs;
|
|
@@ -79,12 +79,25 @@ const Author = ({ author, ...cardProps }) => {
|
|
|
79
79
|
)
|
|
80
80
|
] });
|
|
81
81
|
};
|
|
82
|
-
const Center = ({ children, className }) => {
|
|
83
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react$1.Center, { className, children });
|
|
82
|
+
const Center = ({ children, className, ...boxProps }) => {
|
|
83
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.Center, { className, ...boxProps, children });
|
|
84
84
|
};
|
|
85
85
|
const defaultColumns = { base: 1, sm: 2, md: 3, lg: 4, xl: 5 };
|
|
86
|
-
const Grid = ({ items, columns = defaultColumns, gap, render, getKey, className }) => {
|
|
87
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
const Grid = ({ items, columns = defaultColumns, gap, render, getKey, className, ...boxProps }) => {
|
|
87
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
react$1.SimpleGrid,
|
|
89
|
+
{
|
|
90
|
+
as: "ul",
|
|
91
|
+
columns,
|
|
92
|
+
spacing: gap,
|
|
93
|
+
p: 0,
|
|
94
|
+
m: 0,
|
|
95
|
+
listStyleType: "none",
|
|
96
|
+
className,
|
|
97
|
+
...boxProps,
|
|
98
|
+
children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index2))
|
|
99
|
+
}
|
|
100
|
+
);
|
|
88
101
|
};
|
|
89
102
|
const LinkButton = ({ label, url, width = "auto" }) => {
|
|
90
103
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -795,8 +808,8 @@ const Layout = ({ children }) => {
|
|
|
795
808
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollToTop, {})
|
|
796
809
|
] });
|
|
797
810
|
};
|
|
798
|
-
const List = ({ items, bullet = "—", render, className }) => {
|
|
799
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react$1.List, {
|
|
811
|
+
const List = ({ items, bullet = "—", render, className, ...boxProps }) => {
|
|
812
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { pl: 0, ml: 2, mb: 4, className, ...boxProps, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.ListItem, { display: "flex", gap: 1, children: [
|
|
800
813
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { children: bullet }),
|
|
801
814
|
render ? render(item) : item
|
|
802
815
|
] }, index2)) });
|
|
@@ -897,7 +910,8 @@ const Table = ({
|
|
|
897
910
|
bordered = false,
|
|
898
911
|
striped = true,
|
|
899
912
|
scrollable,
|
|
900
|
-
className
|
|
913
|
+
className,
|
|
914
|
+
...boxProps
|
|
901
915
|
}) => {
|
|
902
916
|
const headerItems = items.slice(0, columnNumber);
|
|
903
917
|
const bodyItems = items.slice(columnNumber);
|
|
@@ -907,6 +921,7 @@ const Table = ({
|
|
|
907
921
|
border: bordered ? void 0 : "none",
|
|
908
922
|
...scrollable ? { maxH: "50vh", overflowY: "auto" } : {},
|
|
909
923
|
className,
|
|
924
|
+
...boxProps,
|
|
910
925
|
children: [
|
|
911
926
|
/* @__PURE__ */ jsxRuntime.jsxs(react$1.Table, { variant: striped ? "striped" : "simple", children: [
|
|
912
927
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Thead, { ...scrollable ? { position: "sticky", top: 0, zIndex: 1, bg: "gray.800" } : {}, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Tr, { children: headerItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Th, { children: item }, index2)) }) }),
|
|
@@ -917,7 +932,7 @@ const Table = ({
|
|
|
917
932
|
}
|
|
918
933
|
);
|
|
919
934
|
};
|
|
920
|
-
const Tabs = ({ items, className, render }) => {
|
|
935
|
+
const Tabs = ({ items, className, render, ...boxProps }) => {
|
|
921
936
|
const { tabs, panels } = react.useMemo(() => {
|
|
922
937
|
const tabs2 = [];
|
|
923
938
|
const panels2 = [];
|
|
@@ -927,7 +942,7 @@ const Tabs = ({ items, className, render }) => {
|
|
|
927
942
|
});
|
|
928
943
|
return { tabs: tabs2, panels: panels2 };
|
|
929
944
|
}, []);
|
|
930
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", className, children: [
|
|
945
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", className, ...boxProps, children: [
|
|
931
946
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Tab, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index2)) }),
|
|
932
947
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanel, { children: render(panel) }, index2)) })
|
|
933
948
|
] });
|
|
@@ -78,12 +78,25 @@ const Author = ({ author, ...cardProps }) => {
|
|
|
78
78
|
)
|
|
79
79
|
] });
|
|
80
80
|
};
|
|
81
|
-
const Center = ({ children, className }) => {
|
|
82
|
-
return /* @__PURE__ */ jsx(Center$1, { className, children });
|
|
81
|
+
const Center = ({ children, className, ...boxProps }) => {
|
|
82
|
+
return /* @__PURE__ */ jsx(Center$1, { className, ...boxProps, children });
|
|
83
83
|
};
|
|
84
84
|
const defaultColumns = { base: 1, sm: 2, md: 3, lg: 4, xl: 5 };
|
|
85
|
-
const Grid = ({ items, columns = defaultColumns, gap, render, getKey, className }) => {
|
|
86
|
-
return /* @__PURE__ */ jsx(
|
|
85
|
+
const Grid = ({ items, columns = defaultColumns, gap, render, getKey, className, ...boxProps }) => {
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
SimpleGrid,
|
|
88
|
+
{
|
|
89
|
+
as: "ul",
|
|
90
|
+
columns,
|
|
91
|
+
spacing: gap,
|
|
92
|
+
p: 0,
|
|
93
|
+
m: 0,
|
|
94
|
+
listStyleType: "none",
|
|
95
|
+
className,
|
|
96
|
+
...boxProps,
|
|
97
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index))
|
|
98
|
+
}
|
|
99
|
+
);
|
|
87
100
|
};
|
|
88
101
|
const LinkButton = ({ label, url, width = "auto" }) => {
|
|
89
102
|
return /* @__PURE__ */ jsx(
|
|
@@ -794,8 +807,8 @@ const Layout = ({ children }) => {
|
|
|
794
807
|
/* @__PURE__ */ jsx(ScrollToTop, {})
|
|
795
808
|
] });
|
|
796
809
|
};
|
|
797
|
-
const List = ({ items, bullet = "—", render, className }) => {
|
|
798
|
-
return /* @__PURE__ */ jsx(List$1, {
|
|
810
|
+
const List = ({ items, bullet = "—", render, className, ...boxProps }) => {
|
|
811
|
+
return /* @__PURE__ */ jsx(List$1, { pl: 0, ml: 2, mb: 4, className, ...boxProps, children: items.map((item, index) => /* @__PURE__ */ jsxs(ListItem, { display: "flex", gap: 1, children: [
|
|
799
812
|
/* @__PURE__ */ jsx(Box, { children: bullet }),
|
|
800
813
|
render ? render(item) : item
|
|
801
814
|
] }, index)) });
|
|
@@ -896,7 +909,8 @@ const Table = ({
|
|
|
896
909
|
bordered = false,
|
|
897
910
|
striped = true,
|
|
898
911
|
scrollable,
|
|
899
|
-
className
|
|
912
|
+
className,
|
|
913
|
+
...boxProps
|
|
900
914
|
}) => {
|
|
901
915
|
const headerItems = items.slice(0, columnNumber);
|
|
902
916
|
const bodyItems = items.slice(columnNumber);
|
|
@@ -906,6 +920,7 @@ const Table = ({
|
|
|
906
920
|
border: bordered ? void 0 : "none",
|
|
907
921
|
...scrollable ? { maxH: "50vh", overflowY: "auto" } : {},
|
|
908
922
|
className,
|
|
923
|
+
...boxProps,
|
|
909
924
|
children: [
|
|
910
925
|
/* @__PURE__ */ jsxs(Table$1, { variant: striped ? "striped" : "simple", children: [
|
|
911
926
|
/* @__PURE__ */ jsx(Thead, { ...scrollable ? { position: "sticky", top: 0, zIndex: 1, bg: "gray.800" } : {}, children: /* @__PURE__ */ jsx(Tr, { children: headerItems.map((item, index) => /* @__PURE__ */ jsx(Th, { children: item }, index)) }) }),
|
|
@@ -916,7 +931,7 @@ const Table = ({
|
|
|
916
931
|
}
|
|
917
932
|
);
|
|
918
933
|
};
|
|
919
|
-
const Tabs = ({ items, className, render }) => {
|
|
934
|
+
const Tabs = ({ items, className, render, ...boxProps }) => {
|
|
920
935
|
const { tabs, panels } = useMemo(() => {
|
|
921
936
|
const tabs2 = [];
|
|
922
937
|
const panels2 = [];
|
|
@@ -926,7 +941,7 @@ const Tabs = ({ items, className, render }) => {
|
|
|
926
941
|
});
|
|
927
942
|
return { tabs: tabs2, panels: panels2 };
|
|
928
943
|
}, []);
|
|
929
|
-
return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", className, children: [
|
|
944
|
+
return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", className, ...boxProps, children: [
|
|
930
945
|
/* @__PURE__ */ jsx(TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index) => /* @__PURE__ */ jsx(Tab, { children: /* @__PURE__ */ jsx(Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index)) }),
|
|
931
946
|
/* @__PURE__ */ jsx(TabPanels, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(TabPanel, { children: render(panel) }, index)) })
|
|
932
947
|
] });
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-C5pGuMKq.js");
|
|
4
4
|
const index$1 = require("./index-IpSV-c71.js");
|
|
5
5
|
const i18n$1 = require("./index-DCIXk-YH.js");
|
|
6
6
|
const index$2 = require("./index-BWuTDC6H.js");
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, B, f, C, E, F, a, G, b, c, g, H, L, h, d, P, S, T, e } from "./index-
|
|
1
|
+
import { A, B, f, C, E, F, a, G, b, c, g, H, L, h, d, P, S, T, e } from "./index-DZkjaSoV.mjs";
|
|
2
2
|
import { u } from "./index-xuSxvz5z.mjs";
|
|
3
3
|
import { a as a2, G as G2, r } from "./index-DxLcykuT.mjs";
|
|
4
4
|
import { M } from "./index-wbMOJRW_.mjs";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { Key, ReactElement } from 'react';
|
|
2
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
2
3
|
export type KeyGetter<T> = (item: T) => Key;
|
|
3
4
|
export type RenderFunction<T> = (item: T) => ReactElement;
|
|
5
|
+
type BoxPaddingProps = Pick<BoxProps, 'p' | 'pt' | 'pr' | 'pb' | 'pl' | 'px' | 'py' | 'ps' | 'pe'>;
|
|
6
|
+
type BoxMarginProps = Pick<BoxProps, 'm' | 'mt' | 'mr' | 'mb' | 'ml' | 'mx' | 'my' | 'ms' | 'me'>;
|
|
7
|
+
export type BoxPositionProps = BoxMarginProps & BoxPaddingProps;
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anywayseo/tools",
|
|
3
3
|
"description": "Shared UI Components and Modules",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"ui",
|
|
@@ -67,7 +67,11 @@
|
|
|
67
67
|
"start": "npm pack",
|
|
68
68
|
"build": "tsc -b && vite build",
|
|
69
69
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
70
|
-
"prepack": "npm run build"
|
|
70
|
+
"prepack": "npm run build",
|
|
71
|
+
"bump:patch": "npm version patch",
|
|
72
|
+
"bump:minor": "npm version minor",
|
|
73
|
+
"bump:major": "npm version major",
|
|
74
|
+
"postversion": "git push --follow-tags && npm publish"
|
|
71
75
|
},
|
|
72
76
|
"devDependencies": {
|
|
73
77
|
"@types/react": "18.3.12",
|
|
@@ -98,4 +102,4 @@
|
|
|
98
102
|
"react-dom": "^18.3.1",
|
|
99
103
|
"react-i18next": "^15.0.0"
|
|
100
104
|
}
|
|
101
|
-
}
|
|
105
|
+
}
|