@plitzi/sdk-style 0.38.10 → 0.38.12

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 (173) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/dist/StyleMap/helpers/isValueValid.mjs +5 -4
  3. package/dist/StyleMap/helpers/utils.mjs +13 -12
  4. package/dist/components/InputEasing/InputEasingButton.mjs +1 -1
  5. package/dist/components/InputEasing/InputEasingList.mjs +5 -5
  6. package/dist/components/Selector/Selector.mjs +2 -1
  7. package/dist/components/Selector/SelectorItem/ItemOptions.mjs +45 -41
  8. package/dist/components/Selector/SelectorItem/SelectorItem.mjs +4 -4
  9. package/dist/components/Selector/SelectorItem/helpers.d.ts +2 -0
  10. package/dist/components/Selector/SelectorItem/helpers.mjs +4 -0
  11. package/dist/components/StyleInspector/Inspector.mjs +185 -171
  12. package/dist/components/StyleInspector/InspectorSearchContext.d.ts +3 -0
  13. package/dist/components/StyleInspector/InspectorSearchContext.mjs +6 -0
  14. package/dist/components/StyleInspector/StyleInspector.mjs +213 -187
  15. package/dist/components/StyleInspector/categories/Background/Background.mjs +84 -177
  16. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.d.ts +8 -0
  17. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.mjs +53 -0
  18. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.d.ts +3 -0
  19. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.mjs +5 -0
  20. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +159 -153
  21. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.d.ts +11 -0
  22. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.mjs +45 -0
  23. package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.mjs +26 -23
  24. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.mjs +65 -56
  25. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.d.ts +4 -0
  26. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.mjs +8 -0
  27. package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.mjs +28 -27
  28. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.d.ts +8 -0
  29. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.mjs +28 -0
  30. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.d.ts +3 -0
  31. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.mjs +5 -0
  32. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.d.ts +4 -2
  33. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.mjs +19 -18
  34. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +4 -0
  35. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +48 -80
  36. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +5 -3
  37. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +51 -41
  38. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +5 -1
  39. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +54 -32
  40. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +3 -1
  41. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.mjs +14 -13
  42. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.d.ts +8 -0
  43. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.mjs +8 -0
  44. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.d.ts +8 -0
  45. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +11 -0
  46. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.d.ts +3 -0
  47. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.mjs +5 -0
  48. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.d.ts +21 -7
  49. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.mjs +114 -113
  50. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.d.ts +8 -0
  51. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.mjs +11 -0
  52. package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +22 -79
  53. package/dist/components/StyleInspector/categories/Background/modes/ImageMode.mjs +16 -77
  54. package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.mjs +19 -62
  55. package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +58 -98
  56. package/dist/components/StyleInspector/categories/Background/modes/RawMode.d.ts +8 -0
  57. package/dist/components/StyleInspector/categories/Background/modes/RawMode.mjs +22 -0
  58. package/dist/components/StyleInspector/categories/Background/modes/helpers.d.ts +19 -0
  59. package/dist/components/StyleInspector/categories/Background/modes/helpers.mjs +54 -0
  60. package/dist/components/StyleInspector/categories/Border/Border.mjs +26 -43
  61. package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +60 -51
  62. package/dist/components/StyleInspector/categories/Display/Display.mjs +65 -81
  63. package/dist/components/StyleInspector/categories/Display/DisplayGap.d.ts +14 -1
  64. package/dist/components/StyleInspector/categories/Display/DisplayGap.mjs +26 -13
  65. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.mjs +33 -38
  66. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +13 -36
  67. package/dist/components/StyleInspector/categories/Effects/Effects.mjs +120 -204
  68. package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +23 -31
  69. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +9 -5
  70. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +57 -124
  71. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.d.ts +25 -0
  72. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.mjs +87 -0
  73. package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +18 -28
  74. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +1 -2
  75. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +52 -76
  76. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts +5 -0
  77. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs +8 -2
  78. package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +21 -37
  79. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.d.ts +10 -0
  80. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +92 -0
  81. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +4 -4
  82. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +78 -359
  83. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.d.ts +39 -0
  84. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.mjs +268 -0
  85. package/dist/components/StyleInspector/categories/List/List.mjs +21 -70
  86. package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +21 -70
  87. package/dist/components/StyleInspector/categories/Others/Others.mjs +63 -85
  88. package/dist/components/StyleInspector/categories/Position/Position.mjs +67 -75
  89. package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +19 -18
  90. package/dist/components/StyleInspector/categories/Size/Size.mjs +65 -85
  91. package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +18 -27
  92. package/dist/components/StyleInspector/categories/Spacing/SpacingBox.d.ts +15 -0
  93. package/dist/components/StyleInspector/categories/Spacing/SpacingBox.mjs +63 -0
  94. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.d.ts +3 -11
  95. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +18 -70
  96. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.d.ts +3 -7
  97. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +16 -67
  98. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +58 -67
  99. package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +1 -1
  100. package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +1 -1
  101. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +16 -40
  102. package/dist/components/StyleInspector/categories/Variables/Variables.mjs +38 -37
  103. package/dist/components/StyleInspector/categories/blendModes.d.ts +2 -0
  104. package/dist/components/StyleInspector/categories/blendModes.mjs +21 -0
  105. package/dist/components/StyleInspector/categories/listMarkers.d.ts +8 -0
  106. package/dist/components/StyleInspector/categories/listMarkers.mjs +25 -0
  107. package/dist/components/StyleInspector/categoryKeys.d.ts +45 -0
  108. package/dist/components/StyleInspector/categoryKeys.mjs +220 -0
  109. package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +43 -38
  110. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +2 -1
  111. package/dist/components/StyleInspector/components/CategorySection/CategorySection.mjs +30 -15
  112. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.d.ts +8 -0
  113. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.mjs +23 -0
  114. package/dist/components/StyleInspector/components/ColorSwatch/helpers.d.ts +3 -0
  115. package/dist/components/StyleInspector/components/ColorSwatch/helpers.mjs +9 -0
  116. package/dist/components/StyleInspector/components/ColorSwatch/index.d.ts +3 -0
  117. package/dist/components/StyleInspector/components/ColorSwatch/index.mjs +5 -0
  118. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +1 -0
  119. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.mjs +11 -11
  120. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.d.ts +11 -0
  121. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +38 -0
  122. package/dist/components/StyleInspector/components/InspectorFooter/helpers.d.ts +2 -0
  123. package/dist/components/StyleInspector/components/InspectorFooter/helpers.mjs +11 -0
  124. package/dist/components/StyleInspector/components/InspectorFooter/index.d.ts +3 -0
  125. package/dist/components/StyleInspector/components/InspectorFooter/index.mjs +5 -0
  126. package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +34 -31
  127. package/dist/components/StyleInspector/components/InspectorLabel/helpers.d.ts +17 -0
  128. package/dist/components/StyleInspector/components/InspectorLabel/helpers.mjs +16 -0
  129. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.d.ts +7 -0
  130. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +24 -0
  131. package/dist/components/StyleInspector/components/InspectorSearch/index.d.ts +3 -0
  132. package/dist/components/StyleInspector/components/InspectorSearch/index.mjs +5 -0
  133. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.d.ts +9 -0
  134. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +110 -0
  135. package/dist/components/StyleInspector/components/ShadowItem/index.d.ts +3 -0
  136. package/dist/components/StyleInspector/components/ShadowItem/index.mjs +5 -0
  137. package/dist/components/StyleInspector/components/ShadowList/ShadowList.d.ts +15 -0
  138. package/dist/components/StyleInspector/components/ShadowList/ShadowList.mjs +25 -0
  139. package/dist/components/StyleInspector/components/ShadowList/index.d.ts +3 -0
  140. package/dist/components/StyleInspector/components/ShadowList/index.mjs +5 -0
  141. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.d.ts +7 -0
  142. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +24 -0
  143. package/dist/components/StyleInspector/components/TargetSummary/index.d.ts +3 -0
  144. package/dist/components/StyleInspector/components/TargetSummary/index.mjs +5 -0
  145. package/dist/components/StyleInspector/components/ValueList/ValueList.d.ts +12 -0
  146. package/dist/components/StyleInspector/components/ValueList/ValueList.mjs +25 -0
  147. package/dist/components/StyleInspector/components/ValueList/index.d.ts +3 -0
  148. package/dist/components/StyleInspector/components/ValueList/index.mjs +5 -0
  149. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.d.ts +16 -0
  150. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +71 -0
  151. package/dist/components/StyleInspector/components/ValueListItem/index.d.ts +3 -0
  152. package/dist/components/StyleInspector/components/ValueListItem/index.mjs +5 -0
  153. package/dist/components/StyleInspector/cssValues.d.ts +13 -0
  154. package/dist/components/StyleInspector/cssValues.mjs +23 -0
  155. package/dist/components/StyleInspector/helpers.d.ts +17 -1
  156. package/dist/components/StyleInspector/helpers.mjs +9 -2
  157. package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +42 -45
  158. package/dist/components/StyleInspector/hooks/usePropertyChange.d.ts +6 -0
  159. package/dist/components/StyleInspector/hooks/usePropertyChange.mjs +9 -0
  160. package/dist/components/StyleInspector/search.d.ts +11 -0
  161. package/dist/components/StyleInspector/search.mjs +14 -0
  162. package/dist/components/StyleInspector/shadowValue.d.ts +20 -0
  163. package/dist/components/StyleInspector/shadowValue.mjs +36 -0
  164. package/dist/components/StyleManager/StyleSelectorTag.mjs +1 -1
  165. package/package.json +225 -21
  166. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +0 -8
  167. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.mjs +0 -27
  168. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +0 -8
  169. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +0 -132
  170. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +0 -2
  171. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +0 -18
  172. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +0 -8
  173. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.mjs +0 -83
@@ -1,64 +1,49 @@
1
- import e from "../../StyleInspectorContext.mjs";
2
- import t from "../../hooks/useInspectorValues.mjs";
3
- import n from "../../components/InspectorLabel/index.mjs";
1
+ import { BLEND_MODES as e } from "../blendModes.mjs";
2
+ import t from "../../StyleInspectorContext.mjs";
3
+ import n from "../../hooks/useInspectorValues.mjs";
4
4
  import r from "../../components/CategoryOption/index.mjs";
5
5
  import i from "../../components/CategorySection/index.mjs";
6
6
  import { DEFAULT_LAYER_PROPS as a, DEFAULT_STOPS as o, newLayerId as s, newStopId as c, serializeLayersToCSS as l } from "./helpers/backgroundParser.mjs";
7
7
  import u from "./components/BackgroundLayer/index.mjs";
8
- import d from "../../components/CategoryAdvanced/index.mjs";
9
- import f from "../../components/CategoryContainer/index.mjs";
10
- import p from "./helpers/parseToBgLayers.mjs";
11
- import { memo as m, use as h, useCallback as g, useRef as _, useState as v } from "react";
12
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
13
- import x from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
8
+ import { BACKGROUND_KEYS as d } from "../../categoryKeys.mjs";
9
+ import f from "../../components/CategoryAdvanced/index.mjs";
10
+ import p from "../../components/CategoryContainer/index.mjs";
11
+ import { BG_LAYER_KEYS as m, layerValuesKey as h } from "./helpers/layerValues.mjs";
12
+ import g from "./helpers/parseToBgLayers.mjs";
13
+ import _ from "../../components/ValueList/index.mjs";
14
+ import { memo as v, use as y, useCallback as b, useRef as x, useState as S } from "react";
15
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
16
+ import T from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
14
17
  //#region src/components/StyleInspector/categories/Background/Background.tsx
15
- var S = [
16
- "background-color",
17
- "background-image",
18
- "background-attachment",
19
- "background-position",
20
- "background-repeat",
21
- "background-clip",
22
- "background-size",
23
- "background-blend-mode",
24
- "mask-image"
25
- ], C = [
26
- "background-image",
27
- "background-size",
28
- "background-position",
29
- "background-repeat",
30
- "background-attachment",
31
- "background-clip"
32
- ], w = ["background-blend-mode", "mask-image"], T = (e) => C.map((t) => String(e[t])).join("||"), E = m(({ replaceTokens: m = !1, isCollapsed: E = !0, onCollapse: D }) => {
33
- let { setValue: O } = h(e), k = t({
34
- keys: C,
18
+ var E = ["background-color"], D = v(({ replaceTokens: v = !1, isCollapsed: D = !0, onCollapse: O }) => {
19
+ let { setValue: k } = y(t), A = n({
20
+ keys: m,
35
21
  asValue: !0,
36
- strictMode: !0,
37
- replaceTokens: m
38
- }), { "background-color": A, "background-blend-mode": j, "mask-image": M } = t({
22
+ strictMode: !0
23
+ }), { "background-color": j, "background-blend-mode": M, "mask-image": N } = n({
39
24
  keys: [
40
25
  "background-color",
41
26
  "background-blend-mode",
42
27
  "mask-image"
43
28
  ],
44
29
  asValue: !0,
45
- replaceTokens: m
46
- }), N = T(k), P = _(k);
47
- P.current = k;
48
- let F = _(null), [I, L] = v(() => p(k));
49
- x(() => {
50
- N !== F.current && (L(p(P.current)), F.current = N);
51
- }, [N]);
52
- let [R, z] = v(null), B = g((e) => z((t) => t === e ? null : e), []), V = g((e) => {
30
+ replaceTokens: v
31
+ }), P = h(A), F = x(A);
32
+ F.current = A;
33
+ let I = x(null), [L, R] = S(() => g(A));
34
+ T(() => {
35
+ P !== I.current && (R(g(F.current)), I.current = P);
36
+ }, [P]);
37
+ let [z, B] = S(null), V = b((e) => B((t) => t === e ? null : e), []), H = b((e) => {
53
38
  let t = l(e);
54
- F.current = T(t), L(e), O(void 0, t);
55
- }, [O]), H = g((e, t) => {
39
+ I.current = h(t), R(e), k(void 0, t);
40
+ }, [k]), U = b((e, t) => {
56
41
  if (e === t) return;
57
- let n = [...I], [r] = n.splice(e, 1);
58
- n.splice(t, 0, r), V(n);
59
- }, [I, V]), U = g((e) => (t) => {
60
- V(I.map((n, r) => r === e ? t : n));
61
- }, [I, V]), W = g(() => {
42
+ let n = [...L], [r] = n.splice(e, 1);
43
+ n.splice(t, 0, r), H(n);
44
+ }, [L, H]), W = b((e) => (t) => {
45
+ H(L.map((n, r) => r === e ? t : n));
46
+ }, [L, H]), G = b(() => {
62
47
  let e = s(), t = {
63
48
  ...a,
64
49
  id: e,
@@ -73,147 +58,69 @@ var S = [
73
58
  position: "100%"
74
59
  }]
75
60
  };
76
- z(e), V([...I, t]);
77
- }, [I, V]), G = g((e) => () => {
78
- V(I.filter((t, n) => n !== e));
79
- }, [I, V]), K = g((e) => {
80
- O("background-color", e);
81
- }, [O]), q = g((e) => {
82
- O("background-blend-mode", e);
83
- }, [O]), J = g((e) => {
84
- O("mask-image", e);
85
- }, [O]), Y = g((e) => D?.("background", e), [D]);
86
- return /* @__PURE__ */ y(f, {
87
- title: "Background",
88
- dotKeys: S,
89
- advancedKeys: w,
90
- isCollapsed: E,
91
- onCollapse: Y,
92
- children: /* @__PURE__ */ b("div", {
61
+ B(e), H([...L, t]);
62
+ }, [L, H]), K = b((e) => () => {
63
+ H(L.filter((t, n) => n !== e));
64
+ }, [L, H]), q = b((e) => {
65
+ k("background-color", e);
66
+ }, [k]), J = b((e) => {
67
+ k("background-blend-mode", e);
68
+ }, [k]), Y = b((e) => {
69
+ k("mask-image", e);
70
+ }, [k]), X = b((e) => O?.("background", e), [O]);
71
+ return /* @__PURE__ */ C(p, {
72
+ title: d.title,
73
+ dotKeys: d.dot,
74
+ advancedKeys: d.advanced,
75
+ isCollapsed: D,
76
+ onCollapse: X,
77
+ children: /* @__PURE__ */ w("div", {
93
78
  className: "flex flex-col gap-2",
94
79
  children: [
95
- /* @__PURE__ */ b("div", {
96
- className: "flex flex-col gap-1",
97
- children: [
98
- /* @__PURE__ */ b("div", {
99
- className: "flex items-center justify-between",
100
- children: [/* @__PURE__ */ y(n, {
101
- keyValue: C,
102
- children: "Layers"
103
- }), /* @__PURE__ */ b("button", {
104
- type: "button",
105
- className: "flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-xs text-blue-500 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/30",
106
- onClick: W,
107
- title: "Add background layer",
108
- children: [/* @__PURE__ */ y("i", { className: "fas fa-plus text-[10px]" }), "Add"]
109
- })]
110
- }),
111
- !I.length && /* @__PURE__ */ y("div", {
112
- className: "rounded border border-dashed border-gray-300 py-3 text-center text-xs text-gray-400 dark:border-zinc-600 dark:text-zinc-500",
113
- children: "No layers — click Add to start"
114
- }),
115
- I.length > 0 && /* @__PURE__ */ y("div", {
116
- className: "flex flex-col gap-1",
117
- children: I.map((e, t) => /* @__PURE__ */ y(u, {
118
- index: t,
119
- layer: e,
120
- expanded: R === e.id,
121
- onExpand: B,
122
- onChange: U(t),
123
- onRemove: G(t),
124
- onReorder: H
125
- }, e.id))
126
- })
127
- ]
80
+ /* @__PURE__ */ w(_, {
81
+ label: "Layers",
82
+ keys: m,
83
+ addLabel: "Add a layer — the first one is drawn on top",
84
+ onAdd: G,
85
+ children: [!L.length && /* @__PURE__ */ C("p", {
86
+ className: "m-0 rounded-md border border-dashed border-gray-300 px-3 py-2.5 text-center text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400",
87
+ children: "No layers. Add one for a gradient or an image."
88
+ }), L.length > 0 && L.map((e, t) => /* @__PURE__ */ C(u, {
89
+ index: t,
90
+ layer: e,
91
+ expanded: z === e.id,
92
+ onExpand: V,
93
+ onChange: W(t),
94
+ onRemove: K(t),
95
+ onReorder: U
96
+ }, e.id))]
128
97
  }),
129
- /* @__PURE__ */ y(i, {
130
- label: "Base Color",
131
- keys: ["background-color"],
132
- children: /* @__PURE__ */ y(r, {
98
+ /* @__PURE__ */ C(i, {
99
+ label: "Color",
100
+ keys: E,
101
+ children: /* @__PURE__ */ C(r, {
133
102
  type: "color",
134
- value: A,
135
- onChange: K
103
+ value: j,
104
+ onChange: q
136
105
  })
137
106
  }),
138
- /* @__PURE__ */ y(d, { children: /* @__PURE__ */ b(i, {
107
+ /* @__PURE__ */ C(f, { children: /* @__PURE__ */ w(i, {
139
108
  label: "",
140
- children: [/* @__PURE__ */ b(r, {
109
+ children: [/* @__PURE__ */ C(r, {
141
110
  keys: ["background-blend-mode"],
142
111
  label: "Blend",
143
- value: j,
144
- onChange: q,
112
+ value: M,
113
+ onChange: J,
145
114
  type: "select",
146
- children: [
147
- /* @__PURE__ */ y("option", {
148
- value: "normal",
149
- children: "Normal"
150
- }),
151
- /* @__PURE__ */ y("option", {
152
- value: "multiply",
153
- children: "Multiply"
154
- }),
155
- /* @__PURE__ */ y("option", {
156
- value: "screen",
157
- children: "Screen"
158
- }),
159
- /* @__PURE__ */ y("option", {
160
- value: "overlay",
161
- children: "Overlay"
162
- }),
163
- /* @__PURE__ */ y("option", {
164
- value: "darken",
165
- children: "Darken"
166
- }),
167
- /* @__PURE__ */ y("option", {
168
- value: "lighten",
169
- children: "Lighten"
170
- }),
171
- /* @__PURE__ */ y("option", {
172
- value: "color-dodge",
173
- children: "Color Dodge"
174
- }),
175
- /* @__PURE__ */ y("option", {
176
- value: "color-burn",
177
- children: "Color Burn"
178
- }),
179
- /* @__PURE__ */ y("option", {
180
- value: "hard-light",
181
- children: "Hard Light"
182
- }),
183
- /* @__PURE__ */ y("option", {
184
- value: "soft-light",
185
- children: "Soft Light"
186
- }),
187
- /* @__PURE__ */ y("option", {
188
- value: "difference",
189
- children: "Difference"
190
- }),
191
- /* @__PURE__ */ y("option", {
192
- value: "exclusion",
193
- children: "Exclusion"
194
- }),
195
- /* @__PURE__ */ y("option", {
196
- value: "hue",
197
- children: "Hue"
198
- }),
199
- /* @__PURE__ */ y("option", {
200
- value: "saturation",
201
- children: "Saturation"
202
- }),
203
- /* @__PURE__ */ y("option", {
204
- value: "color",
205
- children: "Color"
206
- }),
207
- /* @__PURE__ */ y("option", {
208
- value: "luminosity",
209
- children: "Luminosity"
210
- })
211
- ]
212
- }), /* @__PURE__ */ y(r, {
115
+ children: e.map(([e, t]) => /* @__PURE__ */ C("option", {
116
+ value: e,
117
+ children: t
118
+ }, e))
119
+ }), /* @__PURE__ */ C(r, {
213
120
  keys: ["mask-image"],
214
121
  label: "Mask",
215
- value: M,
216
- onChange: J
122
+ value: N,
123
+ onChange: Y
217
124
  })]
218
125
  }) })
219
126
  ]
@@ -221,4 +128,4 @@ var S = [
221
128
  });
222
129
  });
223
130
  //#endregion
224
- export { E as default };
131
+ export { D as default };
@@ -0,0 +1,8 @@
1
+ import { BackgroundLayer } from '../../helpers/backgroundParser';
2
+ export type BackgroundAttachmentProps = {
3
+ layer: BackgroundLayer;
4
+ onChange?: (layer: BackgroundLayer) => void;
5
+ };
6
+ /** Whether the layer scrolls with the element, with its content, or stays put while the page moves under it. */
7
+ declare const BackgroundAttachment: ({ layer, onChange }: BackgroundAttachmentProps) => import('react').JSX.Element;
8
+ export default BackgroundAttachment;
@@ -0,0 +1,53 @@
1
+ import { asText as e } from "../../../../cssValues.mjs";
2
+ import t from "../../../../components/CategoryOption/index.mjs";
3
+ import n from "../../../../components/CategorySection/index.mjs";
4
+ import { useCallback as r, useMemo as i } from "react";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ //#region src/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.tsx
7
+ var o = ({ layer: o, onChange: s }) => {
8
+ let c = i(() => [
9
+ {
10
+ value: "scroll",
11
+ icon: /* @__PURE__ */ a("span", {
12
+ className: "px-1.5 text-xs select-none",
13
+ children: "Scroll"
14
+ }),
15
+ description: "Scrolls with the element",
16
+ active: o.attachment === "scroll",
17
+ size: "custom"
18
+ },
19
+ {
20
+ value: "local",
21
+ icon: /* @__PURE__ */ a("span", {
22
+ className: "px-1.5 text-xs select-none",
23
+ children: "Local"
24
+ }),
25
+ description: "Scrolls with the element’s content",
26
+ active: o.attachment === "local",
27
+ size: "custom"
28
+ },
29
+ {
30
+ value: "fixed",
31
+ icon: /* @__PURE__ */ a("span", {
32
+ className: "px-1.5 text-xs select-none",
33
+ children: "Fixed"
34
+ }),
35
+ description: "Stays put while the page scrolls",
36
+ active: o.attachment === "fixed",
37
+ size: "custom"
38
+ }
39
+ ], [o.attachment]), l = r((t) => s?.({
40
+ ...o,
41
+ attachment: e(t)
42
+ }), [o, s]);
43
+ return /* @__PURE__ */ a(n, {
44
+ label: "Attachment",
45
+ children: /* @__PURE__ */ a(t, {
46
+ type: "iconGroup",
47
+ items: c,
48
+ onChange: l
49
+ })
50
+ });
51
+ };
52
+ //#endregion
53
+ export { o as default };
@@ -0,0 +1,3 @@
1
+ import { default as BackgroundAttachment } from './BackgroundAttachment';
2
+ export * from './BackgroundAttachment';
3
+ export default BackgroundAttachment;
@@ -0,0 +1,5 @@
1
+ import e from "./BackgroundAttachment.mjs";
2
+ //#region src/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };