@versini/ui-system 1.2.1 → 1.3.0

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.
@@ -0,0 +1,8 @@
1
+ import t from "react";
2
+ const e = t.createContext({
3
+ columnGap: 0,
4
+ rowGap: 0
5
+ });
6
+ export {
7
+ e as FlexgridContext
8
+ };
@@ -0,0 +1,7 @@
1
+ const E = "av-flexgrid", A = "av-flexgrid-item", e = "av-theme-provider", t = 0.25;
2
+ export {
3
+ E as FLEXGRID_CLASSNAME,
4
+ t as FLEXGRID_GAP_RATIO,
5
+ A as FLEXGRID_ITEM_CLASSNAME,
6
+ e as THEMEPROVIDER_CLASSNAME
7
+ };
@@ -1,39 +1,40 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import u from "clsx";
3
- import { FLEXGRID_CLASSNAME as p, FlexgridContext as A, FLEXGRID_GAP_RATIO as t } from "../../chunks/FlexgridContext.DVgU6-jM.js";
4
- const L = ({
5
- children: s,
6
- className: i,
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import p from "clsx";
3
+ import { FLEXGRID_CLASSNAME as u, FLEXGRID_GAP_RATIO as e } from "../../chunks/constants.Gcd2KXZh.js";
4
+ import { FlexgridContext as A } from "../../chunks/FlexgridContext.W67Qim_P.js";
5
+ const R = ({
6
+ children: i,
7
+ className: m,
7
8
  columnGap: r = 1,
8
- rowGap: e = 0,
9
- height: l = "auto",
10
- width: n = "auto",
11
- direction: m = "row",
9
+ rowGap: o = 0,
10
+ height: s = "auto",
11
+ width: l = "auto",
12
+ direction: n = "row",
12
13
  alignHorizontal: a = "normal",
13
14
  alignVertical: x = "normal",
14
15
  ...f
15
16
  }) => {
16
17
  const c = {
17
- flexDirection: m,
18
+ flexDirection: n,
18
19
  justifyContent: a,
19
20
  alignItems: x,
20
- height: l,
21
- width: n,
21
+ height: s,
22
+ width: l,
22
23
  /**
23
24
  * Trick to account for the extra space taken
24
25
  * by the columnGap and rowGap that will be applied
25
26
  * to all FlexgridItems (see context and paddings).
26
27
  */
27
- marginLeft: r * -1 * t + "rem",
28
- marginTop: e * -1 * t + "rem"
29
- }, d = u(
30
- i,
31
- p,
28
+ marginLeft: r * -1 * e + "rem",
29
+ marginTop: o * -1 * e + "rem"
30
+ }, d = p(
31
+ m,
32
+ u,
32
33
  "box-border flex flex-wrap"
33
- ), g = { columnGap: r, rowGap: e };
34
- return /* @__PURE__ */ o("div", { className: d, style: c, ...f, children: /* @__PURE__ */ o(A.Provider, { value: g, children: s }) });
34
+ ), g = { columnGap: r, rowGap: o };
35
+ return /* @__PURE__ */ t("div", { className: d, style: c, ...f, children: /* @__PURE__ */ t(A.Provider, { value: g, children: i }) });
35
36
  };
36
37
  export {
37
- L as Flexgrid,
38
- L as default
38
+ R as Flexgrid,
39
+ R as default
39
40
  };
@@ -1,6 +1,7 @@
1
1
  import { jsx as I } from "react/jsx-runtime";
2
2
  import { useContext as F } from "react";
3
- import { FLEXGRID_ITEM_CLASSNAME as g, FlexgridContext as G, FLEXGRID_GAP_RATIO as u } from "../../chunks/FlexgridContext.DVgU6-jM.js";
3
+ import { FLEXGRID_ITEM_CLASSNAME as g, FLEXGRID_GAP_RATIO as u } from "../../chunks/constants.Gcd2KXZh.js";
4
+ import { FlexgridContext as G } from "../../chunks/FlexgridContext.W67Qim_P.js";
4
5
  import m from "clsx";
5
6
  const i = (l, s) => m({
6
7
  "basis-1/12": l === 1 && !s,
@@ -98,7 +99,7 @@ const i = (l, s) => m({
98
99
  f
99
100
  );
100
101
  }
101
- }, _ = ({
102
+ }, j = ({
102
103
  children: l,
103
104
  className: s,
104
105
  span: f,
@@ -114,5 +115,5 @@ const i = (l, s) => m({
114
115
  return /* @__PURE__ */ I("div", { className: C, style: c, ...x, children: l });
115
116
  };
116
117
  export {
117
- _ as FlexgridItem
118
+ j as FlexgridItem
118
119
  };
@@ -1,19 +1,22 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useRef as i, useEffect as p } from "react";
3
- const m = ({
4
- customTheme: e,
5
- children: n,
6
- global: r
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import u from "clsx";
3
+ import { useRef as E, useEffect as l } from "react";
4
+ import { THEMEPROVIDER_CLASSNAME as y } from "../../chunks/constants.Gcd2KXZh.js";
5
+ const P = ({
6
+ customTheme: r,
7
+ children: o,
8
+ global: e,
9
+ className: f
7
10
  }) => {
8
- const t = i(null);
9
- return p(() => {
10
- var s;
11
- const o = r ? document.documentElement.style : (s = t == null ? void 0 : t.current) == null ? void 0 : s.style;
12
- if (!(!o || !e))
13
- for (const [f, c] of Object.entries(e))
14
- o.setProperty(f, c);
15
- }, [e, r]), e || !r ? /* @__PURE__ */ u("div", { ref: t, className: "contents", children: n }) : n;
11
+ const t = E(null), c = u(y, "contents", f);
12
+ return l(() => {
13
+ var n;
14
+ const s = e ? document.documentElement.style : (n = t == null ? void 0 : t.current) == null ? void 0 : n.style;
15
+ if (!(!s || !r))
16
+ for (const [p, i] of Object.entries(r))
17
+ s.setProperty(p, i);
18
+ }, [r, e]), r || !e ? /* @__PURE__ */ m("div", { ref: t, className: c, children: o }) : o;
16
19
  };
17
20
  export {
18
- m as ThemeProvider
21
+ P as ThemeProvider
19
22
  };
package/dist/index.d.ts CHANGED
@@ -109,6 +109,10 @@ type ThemeProviderProps = {
109
109
  * The children to render.
110
110
  */
111
111
  children: React.ReactNode;
112
+ /**
113
+ * CSS class(es) to add to the main component wrapper.
114
+ */
115
+ className?: string;
112
116
  /**
113
117
  * An object specifying custom properties impacting the base theme.
114
118
  * Not all custom properties need to be specified.
@@ -128,6 +132,6 @@ type ThemeProviderProps = {
128
132
  global?: boolean;
129
133
  };
130
134
 
131
- declare const ThemeProvider: ({ customTheme, children, global, }: ThemeProviderProps) => string | number | boolean | Iterable<react.ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
135
+ declare const ThemeProvider: ({ customTheme, children, global, className, }: ThemeProviderProps) => string | number | boolean | Iterable<react.ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
132
136
 
133
137
  export { Flexgrid, FlexgridItem, ThemeProvider };
package/dist/index.js CHANGED
@@ -2,13 +2,13 @@ import { Flexgrid as i } from "./components/Flexgrid/Flexgrid.js";
2
2
  import { FlexgridItem as t } from "./components/Flexgrid/FlexgridItem.js";
3
3
  import { ThemeProvider as I } from "./components/ThemeProvider/ThemeProvider.js";
4
4
  /*!
5
- @versini/ui-system v1.2.1
5
+ @versini/ui-system v1.3.0
6
6
  © 2024 gizmette.com
7
7
  */
8
8
  try {
9
9
  window.__VERSINI_UI_SYSTEM__ || (window.__VERSINI_UI_SYSTEM__ = {
10
- version: "1.2.1",
11
- buildTime: "03/30/2024 02:28 PM EDT",
10
+ version: "1.3.0",
11
+ buildTime: "04/06/2024 02:17 PM EDT",
12
12
  homepage: "https://github.com/aversini/ui-components",
13
13
  license: "MIT"
14
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-system",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -42,7 +42,7 @@
42
42
  "react-dom": "^18.2.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@versini/ui-components": "5.10.2",
45
+ "@versini/ui-components": "5.12.0",
46
46
  "@versini/ui-styles": "1.6.1",
47
47
  "react": "18.2.0",
48
48
  "react-dom": "18.2.0"
@@ -54,5 +54,5 @@
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "18820eb5a8f49835dc43a598ff390779c86b3e95"
57
+ "gitHead": "2ee026b7b3a150ebfd4e8d3827f9a81d7a9e096b"
58
58
  }
@@ -1,11 +0,0 @@
1
- import t from "react";
2
- const e = "av-flexgrid", r = "av-flexgrid-item", c = 0.25, n = t.createContext({
3
- columnGap: 0,
4
- rowGap: 0
5
- });
6
- export {
7
- e as FLEXGRID_CLASSNAME,
8
- c as FLEXGRID_GAP_RATIO,
9
- r as FLEXGRID_ITEM_CLASSNAME,
10
- n as FlexgridContext
11
- };