@gustavo-valsechi/client 1.4.322 → 1.4.324

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,11 +1,9 @@
1
1
  "use client";
2
2
  "use strict";
3
3
  "use client";
4
- var __create = Object.create;
5
4
  var __defProp = Object.defineProperty;
6
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
8
  var __export = (target, all) => {
11
9
  for (var name in all)
@@ -19,14 +17,6 @@ var __copyProps = (to, from, except, desc) => {
19
17
  }
20
18
  return to;
21
19
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
21
  var badge_exports = {};
32
22
  __export(badge_exports, {
@@ -35,14 +25,14 @@ __export(badge_exports, {
35
25
  module.exports = __toCommonJS(badge_exports);
36
26
  var import_jsx_runtime = require("react/jsx-runtime");
37
27
  var import_styles = require("./styles");
38
- var import_lodash = __toESM(require("lodash"));
39
28
  function Badge(props) {
29
+ var _a;
40
30
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "badge-container", children: [
41
31
  (!!props.icon || !!props.img) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "badge-identifier", children: [
42
32
  !!props.icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: props.icon }),
43
33
  !props.icon && !!props.img && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "badge-image" })
44
34
  ] }),
45
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: import_lodash.default.lowerCase(props.value) })
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (_a = props.value) == null ? void 0 : _a.toLowerCase() })
46
36
  ] }) });
47
37
  }
48
38
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,14 +2,14 @@
2
2
  "use client";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Container } from "./styles";
5
- import _ from "lodash";
6
5
  function Badge(props) {
6
+ var _a;
7
7
  return /* @__PURE__ */ jsx(Container, { ...props, children: /* @__PURE__ */ jsxs("div", { className: "badge-container", children: [
8
8
  (!!props.icon || !!props.img) && /* @__PURE__ */ jsxs("div", { className: "badge-identifier", children: [
9
9
  !!props.icon && /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: props.icon }),
10
10
  !props.icon && !!props.img && /* @__PURE__ */ jsx("div", { className: "badge-image" })
11
11
  ] }),
12
- /* @__PURE__ */ jsx("span", { children: _.lowerCase(props.value) })
12
+ /* @__PURE__ */ jsx("span", { children: (_a = props.value) == null ? void 0 : _a.toLowerCase() })
13
13
  ] }) });
14
14
  }
15
15
  export {
@@ -49,11 +49,12 @@ function Table(props) {
49
49
  const modal = (0, import_contexts.useModal)();
50
50
  const loading = ((_a = props.loading) == null ? void 0 : _a.is) || props.loading;
51
51
  (0, import_react.useEffect)(() => {
52
+ if (!theme.content.isMobile) return;
52
53
  modal.add({ component: import_modal.default, name: "table" });
53
54
  return () => modal.remove("table");
54
- }, []);
55
+ }, [theme.content.isMobile]);
55
56
  const onShowLine = (key) => {
56
- if (window.innerWidth > Number(import_lodash.default.replace(theme.content.mobileMaxWidth, "px", ""))) return;
57
+ if (!theme.content.isMobile) return;
57
58
  let content = {};
58
59
  import_lodash.default.forEach(props.options, (data, index) => {
59
60
  var _a2, _b2;
@@ -15,11 +15,12 @@ function Table(props) {
15
15
  const modal = useModal();
16
16
  const loading = ((_a = props.loading) == null ? void 0 : _a.is) || props.loading;
17
17
  useEffect(() => {
18
+ if (!theme.content.isMobile) return;
18
19
  modal.add({ component: Modal, name: "table" });
19
20
  return () => modal.remove("table");
20
- }, []);
21
+ }, [theme.content.isMobile]);
21
22
  const onShowLine = (key) => {
22
- if (window.innerWidth > Number(_.replace(theme.content.mobileMaxWidth, "px", ""))) return;
23
+ if (!theme.content.isMobile) return;
23
24
  let content = {};
24
25
  _.forEach(props.options, (data, index) => {
25
26
  var _a2, _b2;
@@ -36,7 +36,7 @@ __reExport(contexts_exports, require("./tooltip"), module.exports);
36
36
  __reExport(contexts_exports, require("./modal"), module.exports);
37
37
  __reExport(contexts_exports, require("./target"), module.exports);
38
38
  function Context(props) {
39
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.ThemeProvider, { theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_target.TargetProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalProvider, { children: props.children }) }) }) }) });
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.ThemeProvider, { theme: props.theme, common: props.commonTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_target.TargetProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalProvider, { children: props.children }) }) }) }) });
40
40
  }
41
41
  // Annotate the CommonJS export names for ESM import in node:
42
42
  0 && (module.exports = {
@@ -12,7 +12,7 @@ export * from "./tooltip";
12
12
  export * from "./modal";
13
13
  export * from "./target";
14
14
  function Context(props) {
15
- return /* @__PURE__ */ jsx(ThemeProvider, { theme: props.theme, children: /* @__PURE__ */ jsx(IconProvider, { children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TargetProvider, { children: /* @__PURE__ */ jsx(ModalProvider, { children: props.children }) }) }) }) });
15
+ return /* @__PURE__ */ jsx(ThemeProvider, { theme: props.theme, common: props.commonTheme, children: /* @__PURE__ */ jsx(IconProvider, { children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TargetProvider, { children: /* @__PURE__ */ jsx(ModalProvider, { children: props.children }) }) }) }) });
16
16
  }
17
17
  export {
18
18
  Context as default
@@ -73,10 +73,10 @@ const ThemeProviderContainer = (props) => {
73
73
  value: {
74
74
  theme: theme || defaultTheme,
75
75
  setTheme,
76
- content: import_content.Themes[theme || defaultTheme],
76
+ content: { ...import_content.Themes[theme || defaultTheme], ...props.common || {} },
77
77
  Switcher: SwitcherComponent
78
78
  },
79
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_registry.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled_components.ThemeProvider, { theme: import_content.Themes[theme || defaultTheme], children: [
79
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_registry.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled_components.ThemeProvider, { theme: { ...import_content.Themes[theme || defaultTheme], ...props.common || {} }, children: [
80
80
  props.children,
81
81
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, {})
82
82
  ] }) })
@@ -39,10 +39,10 @@ const ThemeProviderContainer = (props) => {
39
39
  value: {
40
40
  theme: theme || defaultTheme,
41
41
  setTheme,
42
- content: Themes[theme || defaultTheme],
42
+ content: { ...Themes[theme || defaultTheme], ...props.common || {} },
43
43
  Switcher: SwitcherComponent
44
44
  },
45
- children: /* @__PURE__ */ jsx(StyledComponentsRegistry, { children: /* @__PURE__ */ jsxs(ThemeProvider, { theme: Themes[theme || defaultTheme], children: [
45
+ children: /* @__PURE__ */ jsx(StyledComponentsRegistry, { children: /* @__PURE__ */ jsxs(ThemeProvider, { theme: { ...Themes[theme || defaultTheme], ...props.common || {} }, children: [
46
46
  props.children,
47
47
  /* @__PURE__ */ jsx(GlobalStyles, {})
48
48
  ] }) })
@@ -9,4 +9,7 @@ export interface IBaseProvider {
9
9
  children: React.ReactNode;
10
10
  }
11
11
  export interface IContext extends IThemeProvider {
12
+ commonTheme?: {
13
+ [key: string]: any;
14
+ };
12
15
  }
@@ -1,6 +1,9 @@
1
1
  import { IBaseProvider } from "../..";
2
2
  export interface IThemeProvider extends IBaseProvider {
3
3
  theme?: keyof ITheme;
4
+ common?: {
5
+ [key: string]: any;
6
+ };
4
7
  }
5
8
  export interface ICommonTheme {
6
9
  secondary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.322",
3
+ "version": "1.4.324",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",