@anywayseo/tools 1.5.1 → 1.5.4

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.
@@ -1,6 +1,7 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
+ import { BoxPositionProps } from '../../../types';
2
3
  type CenterProps = PropsWithChildren<{
3
- className: string;
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-DLPk8AIs.js");
3
+ const index = require("../index-BbMf3hdf.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 { A, B, f, C, E, F, a, G, b, c, g, H, L, h, d, P, S, T, e } from "../index-DD5l7Azu.mjs";
1
+ import { A, B, f, C, E, F, a, G, b, c, g, H, L, h, d, P, S, T, e } from "../index-C95D6IAi.mjs";
2
2
  export {
3
3
  A as Author,
4
4
  B as BonusCard,
@@ -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(react$1.SimpleGrid, { as: "ul", columns, spacing: gap, p: 0, m: 0, listStyleType: "none", className, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index2)) });
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(
@@ -132,7 +145,6 @@ const BonusCard = ({ title, subtitle, content, link, image, className }) => {
132
145
  as: "article",
133
146
  h: "full",
134
147
  bg: "linear-gradient(90deg, #3b1f47, #731d58)",
135
- overflow: "hidden",
136
148
  _before: image ? {
137
149
  content: '""',
138
150
  position: "absolute",
@@ -795,8 +807,8 @@ const Layout = ({ children }) => {
795
807
  /* @__PURE__ */ jsxRuntime.jsx(ScrollToTop, {})
796
808
  ] });
797
809
  };
798
- const List = ({ items, bullet = "—", render, className }) => {
799
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { as: "ul", pl: 0, ml: 2, mb: 4, className, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.ListItem, { as: "li", display: "flex", gap: 1, children: [
810
+ const List = ({ items, bullet = "—", render, className, ...boxProps }) => {
811
+ 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
812
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { children: bullet }),
801
813
  render ? render(item) : item
802
814
  ] }, index2)) });
@@ -897,7 +909,8 @@ const Table = ({
897
909
  bordered = false,
898
910
  striped = true,
899
911
  scrollable,
900
- className
912
+ className,
913
+ ...boxProps
901
914
  }) => {
902
915
  const headerItems = items.slice(0, columnNumber);
903
916
  const bodyItems = items.slice(columnNumber);
@@ -907,6 +920,7 @@ const Table = ({
907
920
  border: bordered ? void 0 : "none",
908
921
  ...scrollable ? { maxH: "50vh", overflowY: "auto" } : {},
909
922
  className,
923
+ ...boxProps,
910
924
  children: [
911
925
  /* @__PURE__ */ jsxRuntime.jsxs(react$1.Table, { variant: striped ? "striped" : "simple", children: [
912
926
  /* @__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 +931,7 @@ const Table = ({
917
931
  }
918
932
  );
919
933
  };
920
- const Tabs = ({ items, className, render }) => {
934
+ const Tabs = ({ items, className, render, ...boxProps }) => {
921
935
  const { tabs, panels } = react.useMemo(() => {
922
936
  const tabs2 = [];
923
937
  const panels2 = [];
@@ -927,7 +941,7 @@ const Tabs = ({ items, className, render }) => {
927
941
  });
928
942
  return { tabs: tabs2, panels: panels2 };
929
943
  }, []);
930
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", className, children: [
944
+ return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", className, ...boxProps, children: [
931
945
  /* @__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
946
  /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanel, { children: render(panel) }, index2)) })
933
947
  ] });
@@ -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(SimpleGrid, { as: "ul", columns, spacing: gap, p: 0, m: 0, listStyleType: "none", className, children: items.map((item, index) => /* @__PURE__ */ jsx(Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index)) });
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(
@@ -131,7 +144,6 @@ const BonusCard = ({ title, subtitle, content, link, image, className }) => {
131
144
  as: "article",
132
145
  h: "full",
133
146
  bg: "linear-gradient(90deg, #3b1f47, #731d58)",
134
- overflow: "hidden",
135
147
  _before: image ? {
136
148
  content: '""',
137
149
  position: "absolute",
@@ -794,8 +806,8 @@ const Layout = ({ children }) => {
794
806
  /* @__PURE__ */ jsx(ScrollToTop, {})
795
807
  ] });
796
808
  };
797
- const List = ({ items, bullet = "—", render, className }) => {
798
- return /* @__PURE__ */ jsx(List$1, { as: "ul", pl: 0, ml: 2, mb: 4, className, children: items.map((item, index) => /* @__PURE__ */ jsxs(ListItem, { as: "li", display: "flex", gap: 1, children: [
809
+ const List = ({ items, bullet = "—", render, className, ...boxProps }) => {
810
+ 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
811
  /* @__PURE__ */ jsx(Box, { children: bullet }),
800
812
  render ? render(item) : item
801
813
  ] }, index)) });
@@ -896,7 +908,8 @@ const Table = ({
896
908
  bordered = false,
897
909
  striped = true,
898
910
  scrollable,
899
- className
911
+ className,
912
+ ...boxProps
900
913
  }) => {
901
914
  const headerItems = items.slice(0, columnNumber);
902
915
  const bodyItems = items.slice(columnNumber);
@@ -906,6 +919,7 @@ const Table = ({
906
919
  border: bordered ? void 0 : "none",
907
920
  ...scrollable ? { maxH: "50vh", overflowY: "auto" } : {},
908
921
  className,
922
+ ...boxProps,
909
923
  children: [
910
924
  /* @__PURE__ */ jsxs(Table$1, { variant: striped ? "striped" : "simple", children: [
911
925
  /* @__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 +930,7 @@ const Table = ({
916
930
  }
917
931
  );
918
932
  };
919
- const Tabs = ({ items, className, render }) => {
933
+ const Tabs = ({ items, className, render, ...boxProps }) => {
920
934
  const { tabs, panels } = useMemo(() => {
921
935
  const tabs2 = [];
922
936
  const panels2 = [];
@@ -926,7 +940,7 @@ const Tabs = ({ items, className, render }) => {
926
940
  });
927
941
  return { tabs: tabs2, panels: panels2 };
928
942
  }, []);
929
- return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", className, children: [
943
+ return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", className, ...boxProps, children: [
930
944
  /* @__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
945
  /* @__PURE__ */ jsx(TabPanels, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(TabPanel, { children: render(panel) }, index)) })
932
946
  ] });
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-DLPk8AIs.js");
3
+ const index = require("./index-BbMf3hdf.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-DD5l7Azu.mjs";
1
+ import { A, B, f, C, E, F, a, G, b, c, g, H, L, h, d, P, S, T, e } from "./index-C95D6IAi.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.1",
4
+ "version": "1.5.4",
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
+ }