@lizzelabs/react-harmony 1.0.0 → 1.0.1

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.
Files changed (79) hide show
  1. package/dist/animations-B09mMqCx.js +24 -0
  2. package/dist/animations.es.js +5 -0
  3. package/dist/components/animations/animations.d.ts +5 -0
  4. package/dist/components/animations/animations.hook.d.ts +2 -0
  5. package/dist/components/animations/animations.types.d.ts +16 -0
  6. package/dist/components/animations/index.d.ts +3 -0
  7. package/dist/components/index.d.ts +7 -0
  8. package/dist/components/media/index.d.ts +3 -0
  9. package/dist/components/media/media.d.ts +5 -0
  10. package/dist/components/media/media.hook.d.ts +2 -0
  11. package/dist/components/media/media.types.d.ts +15 -0
  12. package/dist/components/piece/index.d.ts +3 -0
  13. package/dist/components/piece/piece.d.ts +6 -0
  14. package/dist/components/piece/piece.hook.d.ts +5 -0
  15. package/dist/components/piece/piece.static.d.ts +2 -0
  16. package/dist/components/piece/piece.types.d.ts +34 -0
  17. package/dist/components/piece/piece.utils.d.ts +7 -0
  18. package/dist/components/piece-provider/index.d.ts +3 -0
  19. package/dist/components/piece-provider/piece-provider.context.d.ts +2 -0
  20. package/dist/components/piece-provider/piece-provider.d.ts +4 -0
  21. package/dist/components/piece-provider/piece-provider.hook.d.ts +2 -0
  22. package/dist/components/piece-provider/piece-provider.types.d.ts +24 -0
  23. package/dist/components/screen/index.d.ts +3 -0
  24. package/dist/components/screen/screen.d.ts +4 -0
  25. package/dist/components/screen/screen.hook.d.ts +4 -0
  26. package/dist/components/screen/screen.types.d.ts +15 -0
  27. package/dist/components/scrollable/index.d.ts +3 -0
  28. package/dist/components/scrollable/scrollable.d.ts +6 -0
  29. package/dist/components/scrollable/scrollable.hook.d.ts +5 -0
  30. package/dist/components/scrollable/scrollable.styles.d.ts +14 -0
  31. package/dist/components/scrollable/scrollable.types.d.ts +12 -0
  32. package/dist/components/text/index.d.ts +3 -0
  33. package/dist/components/text/text.d.ts +4 -0
  34. package/dist/components/text/text.hook.d.ts +5 -0
  35. package/dist/components/text/text.types.d.ts +3 -0
  36. package/dist/components.es.js +24 -0
  37. package/dist/fillObjectWithDefaults-AoLKqRgC.js +13 -0
  38. package/dist/hocs/index.d.ts +1 -0
  39. package/dist/hocs/withPieceAsContainer.d.ts +7 -0
  40. package/dist/index.d.ts +5 -0
  41. package/dist/index.es.js +36 -0
  42. package/dist/media-BrSPl6_U.js +48 -0
  43. package/dist/media.es.js +5 -0
  44. package/dist/piece-Mpz6AD6r.js +221 -0
  45. package/dist/piece-provider-DTglah_F.js +1388 -0
  46. package/dist/piece-provider.es.js +5 -0
  47. package/dist/piece.es.js +5 -0
  48. package/dist/screen-gL0zeQqb.js +53 -0
  49. package/dist/screen.es.js +5 -0
  50. package/dist/scrollable-hsA1xMFz.js +94 -0
  51. package/dist/scrollable.es.js +5 -0
  52. package/dist/styles-DofTX6nZ.js +653 -0
  53. package/dist/systems/harmony/alignment-container.d.ts +2 -0
  54. package/dist/systems/harmony/contents.d.ts +2 -0
  55. package/dist/systems/harmony/index.d.ts +1 -0
  56. package/dist/systems/harmony/input.d.ts +2 -0
  57. package/dist/systems/harmony/media.d.ts +2 -0
  58. package/dist/systems/harmony/piece.d.ts +2 -0
  59. package/dist/systems/harmony/reset.d.ts +2 -0
  60. package/dist/systems/harmony/screen.d.ts +2 -0
  61. package/dist/systems/harmony/scrollable.d.ts +2 -0
  62. package/dist/systems/index.d.ts +2 -0
  63. package/dist/systems/mergeSystems.d.ts +2 -0
  64. package/dist/systems.es.js +97 -0
  65. package/dist/text-BEFRS4fh.js +70 -0
  66. package/dist/text.es.js +6 -0
  67. package/dist/types/css.d.ts +6 -0
  68. package/dist/types/html.d.ts +5 -0
  69. package/dist/types/index.d.ts +3 -0
  70. package/dist/types/utils.d.ts +20 -0
  71. package/dist/types.es.js +1 -0
  72. package/dist/utils/appendClasses.d.ts +1 -0
  73. package/dist/utils/excludeProperties.d.ts +1 -0
  74. package/dist/utils/fillObjectWithDefaults.d.ts +1 -0
  75. package/dist/utils/index.d.ts +5 -0
  76. package/dist/utils/splitProps.d.ts +4 -0
  77. package/dist/utils/styles.d.ts +28 -0
  78. package/dist/utils.es.js +25 -0
  79. package/package.json +1 -1
@@ -0,0 +1,221 @@
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";
3
+ import { a as x, f as S } from "./fillObjectWithDefaults-AoLKqRgC.js";
4
+ import { S as R } from "./styles-DofTX6nZ.js";
5
+ const I = [
6
+ "as",
7
+ "kind",
8
+ "aria",
9
+ "withStyle",
10
+ "direction",
11
+ "alignContent",
12
+ "justifyContent",
13
+ "justifyItems",
14
+ "alignItems",
15
+ "display",
16
+ "contentColumns",
17
+ "contentRows",
18
+ "atColumn",
19
+ "atRow",
20
+ "fontSize",
21
+ "flex",
22
+ "gap",
23
+ "textColor",
24
+ "backgroundColor",
25
+ "background",
26
+ "margin",
27
+ "padding"
28
+ ], s = {
29
+ pickComponentProps: (e) => {
30
+ const n = { ...e };
31
+ for (const t of I)
32
+ delete n[t];
33
+ return {
34
+ ...n,
35
+ ...e.aria
36
+ };
37
+ },
38
+ pickComponentStyle: (e, n) => {
39
+ if (n)
40
+ return typeof n == "function" ? s.pickComponentStyle(e, n(e)) : Array.isArray(n) ? n.reduce(
41
+ (t, a) => ({
42
+ ...t,
43
+ ...typeof a == "function" ? a(e) : a
44
+ }),
45
+ {}
46
+ ) : n;
47
+ },
48
+ loadPositionProps: (e, n, t) => {
49
+ const a = [
50
+ {
51
+ enabled: e.flex !== void 0,
52
+ name: "flex",
53
+ value: e.flex
54
+ },
55
+ {
56
+ enabled: e.contentColumns !== void 0,
57
+ name: "gridTemplateColumns",
58
+ value: typeof e.contentColumns == "number" ? `repeat(${e.contentColumns}, 1fr)` : e.contentColumns
59
+ },
60
+ {
61
+ enabled: e.contentRows !== void 0,
62
+ name: "gridTemplateRows",
63
+ value: typeof e.contentRows == "number" ? `repeat(${e.contentRows}, 1fr)` : e.contentRows
64
+ },
65
+ {
66
+ enabled: e.atColumn !== void 0,
67
+ name: "gridColumn",
68
+ value: typeof e.atColumn == "number" ? `${e.atColumn} / ${e.atColumn + 1}` : e.atColumn
69
+ },
70
+ {
71
+ enabled: e.atRow !== void 0,
72
+ name: "gridRow",
73
+ value: typeof e.atRow == "number" ? `${e.atRow} / ${e.atRow + 1}` : e.atRow
74
+ },
75
+ {
76
+ enabled: e.height !== void 0,
77
+ name: "height",
78
+ value: e.height
79
+ },
80
+ {
81
+ enabled: e.width !== void 0,
82
+ name: "width",
83
+ value: e.width
84
+ },
85
+ {
86
+ enabled: e.display !== void 0,
87
+ name: "display",
88
+ value: e.display
89
+ },
90
+ {
91
+ enabled: e.direction !== void 0,
92
+ name: "flexDirection",
93
+ value: e.direction
94
+ },
95
+ {
96
+ enabled: e.alignContent !== void 0,
97
+ name: "alignContent",
98
+ value: e.alignContent
99
+ },
100
+ {
101
+ enabled: e.justifyContent !== void 0,
102
+ name: "justifyContent",
103
+ value: e.justifyContent
104
+ },
105
+ {
106
+ enabled: e.alignItems !== void 0,
107
+ name: "alignItems",
108
+ value: e.alignItems
109
+ },
110
+ {
111
+ enabled: e.justifyItems !== void 0,
112
+ name: "justifyItems",
113
+ value: e.justifyItems
114
+ },
115
+ {
116
+ enabled: e.fontSize !== void 0,
117
+ name: "fontSize",
118
+ value: typeof e.fontSize == "function" ? e.fontSize(t) : e.fontSize
119
+ },
120
+ {
121
+ enabled: e.gap !== void 0,
122
+ name: "gap",
123
+ value: e.gap
124
+ },
125
+ {
126
+ enabled: e.textColor !== void 0,
127
+ name: "color",
128
+ value: typeof e.textColor == "function" ? e.textColor(t) : e.textColor
129
+ },
130
+ {
131
+ enabled: e.background !== void 0,
132
+ name: "background",
133
+ value: typeof e.background == "function" ? e.background(t) : e.background
134
+ },
135
+ {
136
+ enabled: e.backgroundColor !== void 0,
137
+ name: "backgroundColor",
138
+ value: typeof e.backgroundColor == "function" ? e.backgroundColor(t) : e.backgroundColor
139
+ },
140
+ {
141
+ enabled: e.margin !== void 0,
142
+ name: "margin",
143
+ value: typeof e.margin == "function" ? e.margin(t) : e.margin
144
+ },
145
+ {
146
+ enabled: e.padding !== void 0,
147
+ name: "padding",
148
+ value: typeof e.padding == "function" ? e.padding(t) : e.padding
149
+ }
150
+ ], m = a.some((l) => l.enabled), u = a.reduce(
151
+ (l, d) => ({
152
+ ...l,
153
+ ...d.enabled ? {
154
+ [d.name]: d.value
155
+ } : {}
156
+ }),
157
+ {}
158
+ );
159
+ return !n && m === !1 ? void 0 : {
160
+ ...n,
161
+ ...u
162
+ };
163
+ }
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(
166
+ () => ({
167
+ ...e,
168
+ kind: u,
169
+ id: l,
170
+ className: x(e.className, d)
171
+ }),
172
+ [e, u, l, d]
173
+ ), o = i(
174
+ () => n(c),
175
+ [n, c]
176
+ ), f = i(
177
+ () => s.loadPositionProps(
178
+ c,
179
+ s.pickComponentStyle(t, c.withStyle),
180
+ t
181
+ ),
182
+ [c, t]
183
+ ), v = i(
184
+ () => S(
185
+ {
186
+ className: `${c.className} ${o.className}`
187
+ },
188
+ o.defaults,
189
+ c
190
+ ),
191
+ [o.defaults, o.className, c]
192
+ ), g = i(
193
+ () => s.pickComponentProps(v),
194
+ [v]
195
+ ), C = v.as || "div";
196
+ return y(
197
+ function() {
198
+ return o.style && a.apply(o.style, o.className), f && a.apply(f, d), () => {
199
+ a.delete();
200
+ };
201
+ },
202
+ [
203
+ a,
204
+ o.style,
205
+ o.className,
206
+ f,
207
+ d,
208
+ f
209
+ ]
210
+ ), {
211
+ element: /* @__PURE__ */ r.jsx(C, { ...g })
212
+ };
213
+ };
214
+ function N(e) {
215
+ return j(e).element;
216
+ }
217
+ const A = k(N, P);
218
+ export {
219
+ A as P,
220
+ j as u
221
+ };