@lizzelabs/react-harmony 1.0.1 → 1.1.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.
@@ -1,6 +1,9 @@
1
1
  import { ElementEvents, HtmlTag, NoEventsAndAria, PropWithTheme, WithStyle } from '../../types';
2
2
  import { AriaAttributes, ComponentPropsWithoutRef, CSSProperties, ReactNode, RefObject } from 'react';
3
3
  export type PieceAlignmentAndStyleProperties<Theme extends object | undefined> = {
4
+ containerType?: CSSProperties['containerType'];
5
+ containerName?: CSSProperties['containerName'];
6
+ cursor?: CSSProperties['cursor'];
4
7
  margin?: PropWithTheme<string, Theme>;
5
8
  padding?: PropWithTheme<string, Theme>;
6
9
  textColor?: PropWithTheme<string, Theme>;
@@ -1,10 +1,10 @@
1
1
  import { A as r, u as a } from "./animations-B09mMqCx.js";
2
- import { P as u, u as t } from "./piece-Mpz6AD6r.js";
2
+ import { P as u, u as t } from "./piece-CqJl-F6G.js";
3
3
  import { P as x, u as m } from "./piece-provider-DTglah_F.js";
4
- import { S as n, u as P } from "./scrollable-hsA1xMFz.js";
5
- import { S as l, u as p } from "./screen-gL0zeQqb.js";
6
- import { I as d, T, u as A } from "./text-BEFRS4fh.js";
7
- import { M as b, u as v } from "./media-BrSPl6_U.js";
4
+ import { S as n, u as P } from "./scrollable-Dg_gmKLH.js";
5
+ import { S as l, u as p } from "./screen-C0RCelCe.js";
6
+ import { I as d, T, u as A } from "./text-E5g5oMHP.js";
7
+ import { M as b, u as v } from "./media-C5LK6pq4.js";
8
8
  export {
9
9
  r as Animations,
10
10
  d as InternalText,
package/dist/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { A as r, u as a } from "./animations-B09mMqCx.js";
2
- import { P as t, u as i } from "./piece-Mpz6AD6r.js";
2
+ import { P as t, u as i } from "./piece-CqJl-F6G.js";
3
3
  import { P as u, u as m } from "./piece-provider-DTglah_F.js";
4
- import { S as f, u as l } from "./scrollable-hsA1xMFz.js";
5
- import { S as n, u as P } from "./screen-gL0zeQqb.js";
6
- import { I as d, T as A, u as M, w as T } from "./text-BEFRS4fh.js";
7
- import { M as h, u as v } from "./media-BrSPl6_U.js";
4
+ import { S as f, u as l } from "./scrollable-Dg_gmKLH.js";
5
+ import { S as n, u as P } from "./screen-C0RCelCe.js";
6
+ import { I as d, T as A, u as M, w as T } from "./text-E5g5oMHP.js";
7
+ import { M as h, u as v } from "./media-C5LK6pq4.js";
8
8
  import { HARMONY_SYSTEM as y, mergeSystems as C } from "./systems.es.js";
9
9
  import { S as O, e as Y } from "./styles-DofTX6nZ.js";
10
10
  import { a as j, f as D } from "./fillObjectWithDefaults-AoLKqRgC.js";
@@ -1,6 +1,6 @@
1
1
  import { u as f, i as l, j as p } from "./piece-provider-DTglah_F.js";
2
2
  import { useMemo as r, memo as u } from "react";
3
- import { P as M } from "./piece-Mpz6AD6r.js";
3
+ import { P as M } from "./piece-CqJl-F6G.js";
4
4
  const v = ({
5
5
  keyframes: e,
6
6
  withStyle: o,
package/dist/media.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { M as s, u as M } from "./media-BrSPl6_U.js";
1
+ import { M as s, u as M } from "./media-C5LK6pq4.js";
2
2
  export {
3
3
  s as Media,
4
4
  M as useMedia
@@ -1,8 +1,8 @@
1
- import { useMemo as i, useId as b, useInsertionEffect as y, memo as k } from "react";
2
- import { u as w, j as r, i as P } from "./piece-provider-DTglah_F.js";
1
+ import { useMemo as i, useId as b, useInsertionEffect as y, memo as r } from "react";
2
+ import { u as k, j as w, i as P } from "./piece-provider-DTglah_F.js";
3
3
  import { a as x, f as S } from "./fillObjectWithDefaults-AoLKqRgC.js";
4
- import { S as R } from "./styles-DofTX6nZ.js";
5
- const I = [
4
+ import { S as N } from "./styles-DofTX6nZ.js";
5
+ const R = [
6
6
  "as",
7
7
  "kind",
8
8
  "aria",
@@ -24,11 +24,14 @@ const I = [
24
24
  "backgroundColor",
25
25
  "background",
26
26
  "margin",
27
- "padding"
28
- ], s = {
27
+ "padding",
28
+ "containerType",
29
+ "containerName",
30
+ "cursor"
31
+ ], v = {
29
32
  pickComponentProps: (e) => {
30
33
  const n = { ...e };
31
- for (const t of I)
34
+ for (const t of R)
32
35
  delete n[t];
33
36
  return {
34
37
  ...n,
@@ -37,7 +40,7 @@ const I = [
37
40
  },
38
41
  pickComponentStyle: (e, n) => {
39
42
  if (n)
40
- return typeof n == "function" ? s.pickComponentStyle(e, n(e)) : Array.isArray(n) ? n.reduce(
43
+ return typeof n == "function" ? v.pickComponentStyle(e, n(e)) : Array.isArray(n) ? n.reduce(
41
44
  (t, a) => ({
42
45
  ...t,
43
46
  ...typeof a == "function" ? a(e) : a
@@ -146,6 +149,21 @@ const I = [
146
149
  enabled: e.padding !== void 0,
147
150
  name: "padding",
148
151
  value: typeof e.padding == "function" ? e.padding(t) : e.padding
152
+ },
153
+ {
154
+ enabled: e.cursor !== void 0,
155
+ name: "cursor",
156
+ value: e.cursor
157
+ },
158
+ {
159
+ enabled: e.containerType !== void 0,
160
+ name: "containerType",
161
+ value: e.containerType
162
+ },
163
+ {
164
+ enabled: e.containerName !== void 0,
165
+ name: "containerName",
166
+ value: e.containerName
149
167
  }
150
168
  ], m = a.some((l) => l.enabled), u = a.reduce(
151
169
  (l, d) => ({
@@ -161,8 +179,8 @@ const I = [
161
179
  ...u
162
180
  };
163
181
  }
164
- }, j = (e) => {
165
- const { getContext: n, theme: t } = w(), a = i(() => new R(), []), m = b(), u = i(() => e.kind || "piece", [e.kind]), l = i(() => e.id || m, [e.id, m]), d = i(() => `${u}-${l}`, [u, l]), c = i(
182
+ }, I = (e) => {
183
+ const { getContext: n, theme: t } = k(), a = i(() => new N(), []), m = b(), u = i(() => e.kind || "piece", [e.kind]), l = i(() => e.id || m, [e.id, m]), d = i(() => `${u}-${l}`, [u, l]), c = i(
166
184
  () => ({
167
185
  ...e,
168
186
  kind: u,
@@ -174,13 +192,13 @@ const I = [
174
192
  () => n(c),
175
193
  [n, c]
176
194
  ), f = i(
177
- () => s.loadPositionProps(
195
+ () => v.loadPositionProps(
178
196
  c,
179
- s.pickComponentStyle(t, c.withStyle),
197
+ v.pickComponentStyle(t, c.withStyle),
180
198
  t
181
199
  ),
182
200
  [c, t]
183
- ), v = i(
201
+ ), s = i(
184
202
  () => S(
185
203
  {
186
204
  className: `${c.className} ${o.className}`
@@ -190,9 +208,9 @@ const I = [
190
208
  ),
191
209
  [o.defaults, o.className, c]
192
210
  ), g = i(
193
- () => s.pickComponentProps(v),
194
- [v]
195
- ), C = v.as || "div";
211
+ () => v.pickComponentProps(s),
212
+ [s]
213
+ ), C = s.as || "div";
196
214
  return y(
197
215
  function() {
198
216
  return o.style && a.apply(o.style, o.className), f && a.apply(f, d), () => {
@@ -208,14 +226,14 @@ const I = [
208
226
  f
209
227
  ]
210
228
  ), {
211
- element: /* @__PURE__ */ r.jsx(C, { ...g })
229
+ element: /* @__PURE__ */ w.jsx(C, { ...g })
212
230
  };
213
231
  };
214
- function N(e) {
215
- return j(e).element;
232
+ function j(e) {
233
+ return I(e).element;
216
234
  }
217
- const A = k(N, P);
235
+ const E = r(j, P);
218
236
  export {
219
- A as P,
220
- j as u
237
+ E as P,
238
+ I as u
221
239
  };
package/dist/piece.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P, u as a } from "./piece-Mpz6AD6r.js";
1
+ import { P, u as a } from "./piece-CqJl-F6G.js";
2
2
  export {
3
3
  P as Piece,
4
4
  a as usePiece
@@ -1,7 +1,7 @@
1
1
  import { u as d, i as f, j as m } from "./piece-provider-DTglah_F.js";
2
2
  import { useMemo as u, useId as y, useInsertionEffect as S, memo as h } from "react";
3
3
  import { S as b } from "./styles-DofTX6nZ.js";
4
- import { P as g } from "./piece-Mpz6AD6r.js";
4
+ import { P as g } from "./piece-CqJl-F6G.js";
5
5
  const x = (e) => {
6
6
  const { theme: t } = d(), { id: r, fontSize: i, fontFamily: a, containerId: l } = e, n = u(() => new b(), []), s = y();
7
7
  return S(() => (n.apply({
package/dist/screen.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as s, u as S } from "./screen-gL0zeQqb.js";
1
+ import { S as s, u as S } from "./screen-C0RCelCe.js";
2
2
  export {
3
3
  s as Screen,
4
4
  S as useScreen
@@ -1,7 +1,7 @@
1
1
  import { useRef as w, useMemo as m, memo as S } from "react";
2
2
  import { f as k } from "./fillObjectWithDefaults-AoLKqRgC.js";
3
3
  import { u as v, i as $ } from "./piece-provider-DTglah_F.js";
4
- import { u as C } from "./piece-Mpz6AD6r.js";
4
+ import { u as C } from "./piece-CqJl-F6G.js";
5
5
  const p = (o, e, n, a, s, i, t) => ({
6
6
  scrollBehavior: e,
7
7
  overflowX: s ? "auto" : "hidden",
@@ -1,4 +1,4 @@
1
- import { S as e, u as o } from "./scrollable-hsA1xMFz.js";
1
+ import { S as e, u as o } from "./scrollable-Dg_gmKLH.js";
2
2
  export {
3
3
  e as Scrollable,
4
4
  o as useScrollable
@@ -1,14 +1,14 @@
1
- import { memo as u } from "react";
2
- import { u as l, P as d } from "./piece-Mpz6AD6r.js";
3
- import { j as c, i as f } from "./piece-provider-DTglah_F.js";
1
+ import { memo as l } from "react";
2
+ import { u, P as d } from "./piece-CqJl-F6G.js";
3
+ import { j as a, i as f } from "./piece-provider-DTglah_F.js";
4
4
  import "./animations-B09mMqCx.js";
5
5
  import { splitProps as x } from "./utils.es.js";
6
- import "./scrollable-hsA1xMFz.js";
7
- import "./screen-gL0zeQqb.js";
8
- import "./media-BrSPl6_U.js";
6
+ import "./scrollable-Dg_gmKLH.js";
7
+ import "./screen-C0RCelCe.js";
8
+ import "./media-C5LK6pq4.js";
9
9
  const h = (t) => {
10
10
  const { as: n, children: o, kind: e, ...i } = t;
11
- return l({
11
+ return u({
12
12
  ...i,
13
13
  kind: e || "text",
14
14
  as: n,
@@ -34,23 +34,23 @@ function w(t, n = {}) {
34
34
  "width",
35
35
  "margin",
36
36
  "padding"
37
- ], { known: a, unknown: r } = x(
37
+ ], { known: c, unknown: r } = x(
38
38
  e,
39
39
  i
40
- ), { injectContainerProps: m, ...s } = n, p = {
40
+ ), { injectContainerProps: p, ...s } = n, m = {
41
41
  ...s,
42
- ...a
42
+ ...c
43
43
  };
44
- return /* @__PURE__ */ c.jsx(
44
+ return /* @__PURE__ */ a.jsx(
45
45
  d,
46
46
  {
47
47
  kind: "alignment-container",
48
- ...p,
49
- children: /* @__PURE__ */ c.jsx(
48
+ ...m,
49
+ children: /* @__PURE__ */ a.jsx(
50
50
  t,
51
51
  {
52
52
  ...r,
53
- ...m ? s : {},
53
+ ...p ? s : {},
54
54
  children: r?.children
55
55
  }
56
56
  )
@@ -58,8 +58,10 @@ function w(t, n = {}) {
58
58
  );
59
59
  };
60
60
  }
61
- const P = (t) => h(t).element, E = u(
62
- w(P),
61
+ const P = (t) => h(t).element, E = l(
62
+ w(P, {
63
+ withStyle: { display: "flex", flex: "1 1 auto" }
64
+ }),
63
65
  f
64
66
  );
65
67
  export {
package/dist/text.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as a, T as s, u as x } from "./text-BEFRS4fh.js";
1
+ import { I as a, T as s, u as x } from "./text-E5g5oMHP.js";
2
2
  export {
3
3
  a as InternalText,
4
4
  s as Text,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lizzelabs/react-harmony",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "type": "module",