@plitzi/sdk-style 0.38.10 → 0.38.11

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 (149) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/dist/components/InputEasing/InputEasingButton.mjs +1 -1
  3. package/dist/components/InputEasing/InputEasingList.mjs +5 -5
  4. package/dist/components/Selector/Selector.mjs +2 -1
  5. package/dist/components/Selector/SelectorItem/ItemOptions.mjs +45 -41
  6. package/dist/components/Selector/SelectorItem/SelectorItem.mjs +4 -4
  7. package/dist/components/Selector/SelectorItem/helpers.d.ts +2 -0
  8. package/dist/components/Selector/SelectorItem/helpers.mjs +4 -0
  9. package/dist/components/StyleInspector/Inspector.mjs +185 -171
  10. package/dist/components/StyleInspector/InspectorSearchContext.d.ts +3 -0
  11. package/dist/components/StyleInspector/InspectorSearchContext.mjs +6 -0
  12. package/dist/components/StyleInspector/StyleInspector.mjs +154 -128
  13. package/dist/components/StyleInspector/categories/Background/Background.mjs +82 -114
  14. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.d.ts +8 -0
  15. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.mjs +53 -0
  16. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.d.ts +3 -0
  17. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.mjs +5 -0
  18. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +159 -153
  19. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.d.ts +11 -0
  20. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.mjs +45 -0
  21. package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.mjs +26 -23
  22. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.mjs +65 -56
  23. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.d.ts +4 -0
  24. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.mjs +8 -0
  25. package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.mjs +28 -27
  26. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.d.ts +4 -2
  27. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.mjs +19 -18
  28. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +4 -0
  29. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +48 -80
  30. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +5 -3
  31. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +51 -41
  32. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +5 -1
  33. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +54 -32
  34. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +3 -1
  35. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.mjs +14 -13
  36. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.d.ts +8 -0
  37. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.mjs +8 -0
  38. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.d.ts +8 -0
  39. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +11 -0
  40. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.d.ts +3 -0
  41. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.mjs +5 -0
  42. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.d.ts +21 -7
  43. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.mjs +114 -113
  44. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.d.ts +8 -0
  45. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.mjs +11 -0
  46. package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +52 -87
  47. package/dist/components/StyleInspector/categories/Background/modes/ImageMode.mjs +16 -77
  48. package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.mjs +19 -62
  49. package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +79 -97
  50. package/dist/components/StyleInspector/categories/Background/modes/RawMode.d.ts +8 -0
  51. package/dist/components/StyleInspector/categories/Background/modes/RawMode.mjs +22 -0
  52. package/dist/components/StyleInspector/categories/Background/modes/helpers.d.ts +19 -0
  53. package/dist/components/StyleInspector/categories/Background/modes/helpers.mjs +54 -0
  54. package/dist/components/StyleInspector/categories/Border/Border.mjs +26 -43
  55. package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +60 -51
  56. package/dist/components/StyleInspector/categories/Display/Display.mjs +32 -49
  57. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.mjs +33 -38
  58. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +21 -33
  59. package/dist/components/StyleInspector/categories/Effects/Effects.mjs +131 -154
  60. package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +23 -31
  61. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +9 -5
  62. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +57 -124
  63. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.d.ts +25 -0
  64. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.mjs +87 -0
  65. package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +18 -28
  66. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +1 -2
  67. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +52 -76
  68. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts +5 -0
  69. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs +8 -2
  70. package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +21 -37
  71. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.d.ts +10 -0
  72. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +92 -0
  73. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +4 -4
  74. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +78 -359
  75. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.d.ts +39 -0
  76. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.mjs +268 -0
  77. package/dist/components/StyleInspector/categories/List/List.mjs +39 -38
  78. package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +29 -29
  79. package/dist/components/StyleInspector/categories/Others/Others.mjs +66 -88
  80. package/dist/components/StyleInspector/categories/Position/Position.mjs +67 -75
  81. package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +19 -18
  82. package/dist/components/StyleInspector/categories/Size/Size.mjs +68 -88
  83. package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +18 -27
  84. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +2 -2
  85. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +4 -3
  86. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +88 -98
  87. package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +1 -1
  88. package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +1 -1
  89. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +26 -39
  90. package/dist/components/StyleInspector/categories/Variables/Variables.mjs +38 -37
  91. package/dist/components/StyleInspector/categoryKeys.d.ts +45 -0
  92. package/dist/components/StyleInspector/categoryKeys.mjs +220 -0
  93. package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +43 -38
  94. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +2 -1
  95. package/dist/components/StyleInspector/components/CategorySection/CategorySection.mjs +30 -15
  96. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.d.ts +8 -0
  97. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.mjs +23 -0
  98. package/dist/components/StyleInspector/components/ColorSwatch/helpers.d.ts +3 -0
  99. package/dist/components/StyleInspector/components/ColorSwatch/helpers.mjs +9 -0
  100. package/dist/components/StyleInspector/components/ColorSwatch/index.d.ts +3 -0
  101. package/dist/components/StyleInspector/components/ColorSwatch/index.mjs +5 -0
  102. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +1 -0
  103. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.mjs +11 -11
  104. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.d.ts +11 -0
  105. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +38 -0
  106. package/dist/components/StyleInspector/components/InspectorFooter/helpers.d.ts +2 -0
  107. package/dist/components/StyleInspector/components/InspectorFooter/helpers.mjs +11 -0
  108. package/dist/components/StyleInspector/components/InspectorFooter/index.d.ts +3 -0
  109. package/dist/components/StyleInspector/components/InspectorFooter/index.mjs +5 -0
  110. package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +34 -31
  111. package/dist/components/StyleInspector/components/InspectorLabel/helpers.d.ts +17 -0
  112. package/dist/components/StyleInspector/components/InspectorLabel/helpers.mjs +16 -0
  113. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.d.ts +7 -0
  114. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +24 -0
  115. package/dist/components/StyleInspector/components/InspectorSearch/index.d.ts +3 -0
  116. package/dist/components/StyleInspector/components/InspectorSearch/index.mjs +5 -0
  117. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.d.ts +9 -0
  118. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +110 -0
  119. package/dist/components/StyleInspector/components/ShadowItem/index.d.ts +3 -0
  120. package/dist/components/StyleInspector/components/ShadowItem/index.mjs +5 -0
  121. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.d.ts +7 -0
  122. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +24 -0
  123. package/dist/components/StyleInspector/components/TargetSummary/index.d.ts +3 -0
  124. package/dist/components/StyleInspector/components/TargetSummary/index.mjs +5 -0
  125. package/dist/components/StyleInspector/components/ValueList/ValueList.d.ts +12 -0
  126. package/dist/components/StyleInspector/components/ValueList/ValueList.mjs +25 -0
  127. package/dist/components/StyleInspector/components/ValueList/index.d.ts +3 -0
  128. package/dist/components/StyleInspector/components/ValueList/index.mjs +5 -0
  129. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.d.ts +16 -0
  130. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +71 -0
  131. package/dist/components/StyleInspector/components/ValueListItem/index.d.ts +3 -0
  132. package/dist/components/StyleInspector/components/ValueListItem/index.mjs +5 -0
  133. package/dist/components/StyleInspector/cssValues.d.ts +15 -0
  134. package/dist/components/StyleInspector/cssValues.mjs +27 -0
  135. package/dist/components/StyleInspector/helpers.d.ts +17 -1
  136. package/dist/components/StyleInspector/helpers.mjs +9 -2
  137. package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +42 -45
  138. package/dist/components/StyleInspector/search.d.ts +11 -0
  139. package/dist/components/StyleInspector/search.mjs +14 -0
  140. package/dist/components/StyleInspector/shadowValue.d.ts +20 -0
  141. package/dist/components/StyleInspector/shadowValue.mjs +36 -0
  142. package/dist/components/StyleManager/StyleSelectorTag.mjs +1 -1
  143. package/package.json +185 -17
  144. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +0 -8
  145. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +0 -132
  146. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +0 -2
  147. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +0 -18
  148. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +0 -8
  149. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.mjs +0 -83
@@ -1,76 +1,33 @@
1
- import e from "../../../components/CategoryOption/index.mjs";
2
- import t from "../../../components/CategorySection/index.mjs";
3
- import n from "../components/BackgroundPosition/index.mjs";
4
- import r from "../components/BackgroundSize/index.mjs";
5
- import i from "../components/BackgroundTile/index.mjs";
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 { ANGLE_UNITS as r, LINEAR_DIRECTIONS as i } from "./helpers.mjs";
6
5
  import a from "../components/GradientStopBar/index.mjs";
7
6
  import { useCallback as o } from "react";
8
7
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
8
  //#region src/components/StyleInspector/categories/Background/modes/LinearGradientMode.tsx
10
9
  var u = ({ layer: u, onChange: d }) => {
11
- let f = o((e) => d?.({
10
+ let f = o((t) => d?.({
12
11
  ...u,
13
- angle: String(e)
12
+ angle: e(t)
14
13
  }), [u, d]), p = o((e) => d?.({
15
14
  ...u,
16
15
  stops: e
17
16
  }), [u, d]);
18
- return /* @__PURE__ */ l(s, { children: [
19
- /* @__PURE__ */ c(t, {
20
- label: "Angle",
21
- children: /* @__PURE__ */ c(e, {
22
- type: "metric",
23
- value: u.angle,
24
- units: [
25
- {
26
- label: "deg",
27
- value: "deg"
28
- },
29
- {
30
- label: "rad",
31
- value: "rad"
32
- },
33
- {
34
- label: "turn",
35
- value: "turn"
36
- }
37
- ],
38
- allowedWords: [
39
- "to top",
40
- "to right",
41
- "to bottom",
42
- "to left",
43
- "to top right",
44
- "to bottom right",
45
- "to bottom left",
46
- "to top left"
47
- ],
48
- min: 0,
49
- max: 360,
50
- onChange: f
51
- })
52
- }),
53
- /* @__PURE__ */ c(t, {
54
- label: "Gradient",
55
- direction: "column",
56
- children: /* @__PURE__ */ c(a, {
57
- stops: u.stops,
58
- onChange: p
59
- })
60
- }),
61
- /* @__PURE__ */ c(r, {
62
- layer: u,
63
- onChange: d
64
- }),
65
- /* @__PURE__ */ c(n, {
66
- layer: u,
67
- onChange: d
68
- }),
69
- /* @__PURE__ */ c(i, {
70
- layer: u,
71
- onChange: d
17
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(n, {
18
+ label: "Direction",
19
+ children: /* @__PURE__ */ c(t, {
20
+ type: "metric",
21
+ value: u.angle || "to bottom",
22
+ units: r,
23
+ allowedWords: i,
24
+ min: -Infinity,
25
+ onChange: f
72
26
  })
73
- ] });
27
+ }), /* @__PURE__ */ c(a, {
28
+ stops: u.stops,
29
+ onChange: p
30
+ })] });
74
31
  };
75
32
  //#endregion
76
33
  export { u as default };
@@ -1,120 +1,102 @@
1
- import e from "../../../components/CategoryOption/index.mjs";
2
- import t from "../../../components/CategorySection/index.mjs";
3
- import n from "../components/BackgroundPosition/index.mjs";
4
- import r from "../components/BackgroundSize/index.mjs";
5
- import i from "../components/BackgroundTile/index.mjs";
6
- import a from "../components/GradientStopBar/index.mjs";
7
- import { useCallback as o } from "react";
8
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
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 { CENTER_X_WORDS as r, CENTER_Y_WORDS as i, RADIAL_EXTENTS as a, centerParts as o, customExtentFor as s, isExtentKeyword as c, joinCenter as l } from "./helpers.mjs";
5
+ import u from "../components/GradientStopBar/index.mjs";
6
+ import { useCallback as d } from "react";
7
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
8
  //#region src/components/StyleInspector/categories/Background/modes/RadialGradientMode.tsx
10
- var u = ({ layer: u, onChange: d }) => {
11
- let f = o((e) => d?.({
12
- ...u,
13
- radialShape: e
14
- }), [u, d]), p = o((e) => d?.({
15
- ...u,
16
- radialExtent: String(e)
17
- }), [u, d]), m = o((e) => {
18
- let t = u.radialPosition.split(" ");
19
- d?.({
20
- ...u,
21
- radialPosition: `${String(e)} ${t[1] ?? "50%"}`
9
+ var h = "custom", g = ({ layer: g, onChange: _ }) => {
10
+ let [v, y] = o(g.radialPosition), b = !c(g.radialExtent), x = d((t) => _?.({
11
+ ...g,
12
+ radialShape: e(t) === "circle" ? "circle" : "ellipse"
13
+ }), [g, _]), S = d((t) => {
14
+ let n = e(t);
15
+ _?.({
16
+ ...g,
17
+ radialExtent: n === h ? s(g.radialShape) : n
22
18
  });
23
- }, [u, d]), h = o((e) => {
24
- let t = u.radialPosition.split(" ");
25
- d?.({
26
- ...u,
27
- radialPosition: `${t[0] ?? "50%"} ${String(e)}`
28
- });
29
- }, [u, d]), g = o((e) => d?.({
30
- ...u,
19
+ }, [g, _]), C = d((t) => _?.({
20
+ ...g,
21
+ radialExtent: e(t)
22
+ }), [g, _]), w = d((t) => _?.({
23
+ ...g,
24
+ radialPosition: l(e(t), y)
25
+ }), [
26
+ y,
27
+ g,
28
+ _
29
+ ]), T = d((t) => _?.({
30
+ ...g,
31
+ radialPosition: l(v, e(t))
32
+ }), [
33
+ v,
34
+ g,
35
+ _
36
+ ]), E = d((e) => _?.({
37
+ ...g,
31
38
  stops: e
32
- }), [u, d]);
33
- return /* @__PURE__ */ l(s, { children: [
34
- /* @__PURE__ */ c(t, {
39
+ }), [g, _]);
40
+ return /* @__PURE__ */ m(f, { children: [
41
+ /* @__PURE__ */ p(n, {
35
42
  label: "Shape",
36
- children: /* @__PURE__ */ l(e, {
43
+ children: /* @__PURE__ */ m(t, {
37
44
  type: "select",
38
- value: u.radialShape,
39
- onChange: f,
40
- children: [/* @__PURE__ */ c("option", {
45
+ value: g.radialShape,
46
+ onChange: x,
47
+ children: [/* @__PURE__ */ p("option", {
41
48
  value: "ellipse",
42
49
  children: "Ellipse"
43
- }), /* @__PURE__ */ c("option", {
50
+ }), /* @__PURE__ */ p("option", {
44
51
  value: "circle",
45
52
  children: "Circle"
46
53
  })]
47
54
  })
48
55
  }),
49
- /* @__PURE__ */ c(t, {
50
- label: "Size",
51
- children: /* @__PURE__ */ l(e, {
56
+ /* @__PURE__ */ p(n, {
57
+ label: "Extent",
58
+ children: /* @__PURE__ */ m(t, {
52
59
  type: "select",
53
- value: u.radialExtent,
54
- onChange: p,
55
- children: [
56
- /* @__PURE__ */ c("option", {
57
- value: "farthest-corner",
58
- children: "Farthest Corner"
59
- }),
60
- /* @__PURE__ */ c("option", {
61
- value: "farthest-side",
62
- children: "Farthest Side"
63
- }),
64
- /* @__PURE__ */ c("option", {
65
- value: "closest-corner",
66
- children: "Closest Corner"
67
- }),
68
- /* @__PURE__ */ c("option", {
69
- value: "closest-side",
70
- children: "Closest Side"
71
- })
72
- ]
60
+ value: b ? h : g.radialExtent,
61
+ onChange: S,
62
+ children: [a.map((e) => /* @__PURE__ */ p("option", {
63
+ value: e.value,
64
+ children: e.label
65
+ }, e.value)), /* @__PURE__ */ p("option", {
66
+ value: h,
67
+ children: "Custom size"
68
+ })]
69
+ })
70
+ }),
71
+ b && /* @__PURE__ */ p(n, {
72
+ label: "Radius",
73
+ children: /* @__PURE__ */ p(t, {
74
+ type: "input",
75
+ value: g.radialExtent,
76
+ onChange: C
73
77
  })
74
78
  }),
75
- /* @__PURE__ */ l(t, {
76
- label: "Position",
77
- children: [/* @__PURE__ */ c(e, {
79
+ /* @__PURE__ */ m(n, {
80
+ label: "Center",
81
+ children: [/* @__PURE__ */ p(t, {
78
82
  type: "metric",
79
- value: u.radialPosition.split(" ")[0] ?? "50%",
80
- allowedWords: [
81
- "center",
82
- "left",
83
- "right"
84
- ],
85
- onChange: m
86
- }), /* @__PURE__ */ c(e, {
83
+ value: v,
84
+ allowedWords: r,
85
+ min: -Infinity,
86
+ onChange: w
87
+ }), /* @__PURE__ */ p(t, {
87
88
  type: "metric",
88
- value: u.radialPosition.split(" ")[1] ?? "50%",
89
- allowedWords: [
90
- "center",
91
- "top",
92
- "bottom"
93
- ],
94
- onChange: h
89
+ value: y,
90
+ allowedWords: i,
91
+ min: -Infinity,
92
+ onChange: T
95
93
  })]
96
94
  }),
97
- /* @__PURE__ */ c(t, {
98
- label: "Gradient",
99
- direction: "column",
100
- children: /* @__PURE__ */ c(a, {
101
- stops: u.stops,
102
- onChange: g
103
- })
104
- }),
105
- /* @__PURE__ */ c(r, {
106
- layer: u,
107
- onChange: d
108
- }),
109
- /* @__PURE__ */ c(n, {
110
- layer: u,
111
- onChange: d
112
- }),
113
- /* @__PURE__ */ c(i, {
114
- layer: u,
115
- onChange: d
95
+ /* @__PURE__ */ p(u, {
96
+ stops: g.stops,
97
+ onChange: E
116
98
  })
117
99
  ] });
118
100
  };
119
101
  //#endregion
120
- export { u as default };
102
+ export { g as default };
@@ -0,0 +1,8 @@
1
+ import { BackgroundLayer } from '../helpers/backgroundParser';
2
+ export type RawModeProps = {
3
+ layer: BackgroundLayer;
4
+ onChange?: (layer: BackgroundLayer) => void;
5
+ };
6
+ /** A layer the editor has no controls for — a token, `image-set()` — written as the CSS it is. */
7
+ declare const RawMode: ({ layer, onChange }: RawModeProps) => import('react').JSX.Element;
8
+ export default RawMode;
@@ -0,0 +1,22 @@
1
+ import { asText as e } from "../../../cssValues.mjs";
2
+ import t from "../../../components/CategoryOption/index.mjs";
3
+ import { useCallback as n } from "react";
4
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/components/StyleInspector/categories/Background/modes/RawMode.tsx
6
+ var o = ({ layer: o, onChange: s }) => {
7
+ let c = n((t) => s?.({
8
+ ...o,
9
+ raw: e(t)
10
+ }), [o, s]);
11
+ return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(t, {
12
+ label: "CSS",
13
+ type: "input",
14
+ value: o.raw,
15
+ onChange: c
16
+ }), /* @__PURE__ */ i("p", {
17
+ className: "m-0 text-[11px] text-zinc-500 dark:text-zinc-400",
18
+ children: "Any image CSS accepts: a token such as var(--hero-bg), image-set(…), cross-fade(…)."
19
+ })] });
20
+ };
21
+ //#endregion
22
+ export { o as default };
@@ -0,0 +1,19 @@
1
+ export declare const ANGLE_UNITS: {
2
+ label: string;
3
+ value: string;
4
+ }[];
5
+ export declare const LINEAR_DIRECTIONS: string[];
6
+ export declare const CENTER_X_WORDS: string[];
7
+ export declare const CENTER_Y_WORDS: string[];
8
+ /** The keywords a radial gradient's size can be; anything else is a size of its own (`100px`, `40% 20%`). */
9
+ export declare const RADIAL_EXTENTS: {
10
+ value: string;
11
+ label: string;
12
+ }[];
13
+ export declare const isExtentKeyword: (extent: string) => boolean;
14
+ /** A size a circle takes as one length; an ellipse needs two. */
15
+ export declare const customExtentFor: (shape: "circle" | "ellipse") => string;
16
+ /** A gradient's center as its two axes — CSS's default (the middle) when it names none. */
17
+ export declare const centerParts: (position: string) => [string, string];
18
+ /** Back to the one value, left out when it is the default — so a gradient that never named a center still names none. */
19
+ export declare const joinCenter: (x: string, y: string) => string;
@@ -0,0 +1,54 @@
1
+ //#region src/components/StyleInspector/categories/Background/modes/helpers.ts
2
+ var e = [
3
+ {
4
+ label: "DEG",
5
+ value: "deg"
6
+ },
7
+ {
8
+ label: "TURN",
9
+ value: "turn"
10
+ },
11
+ {
12
+ label: "RAD",
13
+ value: "rad"
14
+ }
15
+ ], t = [
16
+ "to top",
17
+ "to right",
18
+ "to bottom",
19
+ "to left",
20
+ "to top right",
21
+ "to bottom right",
22
+ "to bottom left",
23
+ "to top left"
24
+ ], n = [
25
+ "center",
26
+ "left",
27
+ "right"
28
+ ], r = [
29
+ "center",
30
+ "top",
31
+ "bottom"
32
+ ], i = [
33
+ {
34
+ value: "farthest-corner",
35
+ label: "Farthest corner"
36
+ },
37
+ {
38
+ value: "farthest-side",
39
+ label: "Farthest side"
40
+ },
41
+ {
42
+ value: "closest-corner",
43
+ label: "Closest corner"
44
+ },
45
+ {
46
+ value: "closest-side",
47
+ label: "Closest side"
48
+ }
49
+ ], a = (e) => i.some((t) => t.value === e), o = (e) => e === "circle" ? "100px" : "50% 50%", s = (e) => {
50
+ let [t = "center", n = "center"] = e.split(" ").filter(Boolean);
51
+ return [t, n];
52
+ }, c = (e, t) => e === "center" && t === "center" ? "" : `${e} ${t}`;
53
+ //#endregion
54
+ export { e as ANGLE_UNITS, n as CENTER_X_WORDS, r as CENTER_Y_WORDS, t as LINEAR_DIRECTIONS, i as RADIAL_EXTENTS, s as centerParts, o as customExtentFor, a as isExtentKeyword, c as joinCenter };
@@ -1,37 +1,20 @@
1
1
  import e from "../../StyleInspectorContext.mjs";
2
2
  import t from "../../hooks/useInspectorValues.mjs";
3
- import n from "../../components/CategoryContainer/index.mjs";
4
- import r from "./BorderColor.mjs";
5
- import i from "./BorderPlacements.mjs";
6
- import a from "./BorderRadius.mjs";
7
- import o from "./BorderStyle.mjs";
8
- import s from "./BorderWidth.mjs";
9
- import { memo as c, use as l, useCallback as u, useState as d } from "react";
10
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
- //#region src/components/StyleInspector/categories/Border/Border.tsx
12
- var m = [
13
- "border-top-style",
14
- "border-top-width",
15
- "border-top-color",
16
- "border-bottom-style",
17
- "border-bottom-width",
18
- "border-bottom-color",
19
- "border-left-style",
20
- "border-left-width",
21
- "border-left-color",
22
- "border-right-style",
23
- "border-right-width",
24
- "border-right-color",
25
- "border-top-left-radius",
26
- "border-top-right-radius",
27
- "border-bottom-left-radius",
28
- "border-bottom-right-radius"
29
- ], h = c(({ replaceTokens: c = !1, isCollapsed: h = !0, onCollapse: g }) => {
30
- let [_, v] = d("all"), { setValue: y } = l(e), b = t({
31
- keys: m,
3
+ import { BORDER_KEYS as n } from "../../categoryKeys.mjs";
4
+ import r from "../../components/CategoryContainer/index.mjs";
5
+ import i from "./BorderColor.mjs";
6
+ import a from "./BorderPlacements.mjs";
7
+ import o from "./BorderRadius.mjs";
8
+ import s from "./BorderStyle.mjs";
9
+ import c from "./BorderWidth.mjs";
10
+ import { memo as l, use as u, useCallback as d, useState as f } from "react";
11
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
+ var h = l(({ replaceTokens: l = !1, isCollapsed: h = !0, onCollapse: g }) => {
13
+ let [_, v] = f("all"), { setValue: y } = u(e), b = t({
14
+ keys: n.dot,
32
15
  asValue: !0,
33
- replaceTokens: c
34
- }), x = u((e) => (t) => {
16
+ replaceTokens: l
17
+ }), x = d((e) => (t) => {
35
18
  switch (e) {
36
19
  case "radius":
37
20
  y(void 0, {
@@ -80,37 +63,37 @@ var m = [
80
63
  _,
81
64
  b,
82
65
  y
83
- ]), S = u((e) => g?.("border", e), [g]);
84
- return /* @__PURE__ */ f(n, {
85
- title: "Border",
86
- dotKeys: m,
66
+ ]), S = d((e) => g?.("border", e), [g]);
67
+ return /* @__PURE__ */ p(r, {
68
+ title: n.title,
69
+ dotKeys: n.dot,
87
70
  isCollapsed: h,
88
71
  onCollapse: S,
89
- children: /* @__PURE__ */ p("div", {
72
+ children: /* @__PURE__ */ m("div", {
90
73
  className: "flex flex-col gap-2",
91
- children: [/* @__PURE__ */ f(a, {
74
+ children: [/* @__PURE__ */ p(o, {
92
75
  values: b,
93
76
  onChange: x("radius"),
94
77
  onChangeSegment: x
95
- }), /* @__PURE__ */ p("div", {
78
+ }), /* @__PURE__ */ m("div", {
96
79
  className: "flex w-full flex-col gap-2",
97
- children: [/* @__PURE__ */ f(i, {
80
+ children: [/* @__PURE__ */ p(a, {
98
81
  currentPlacement: _,
99
82
  setCurrentPlacement: v
100
- }), /* @__PURE__ */ p("div", {
83
+ }), /* @__PURE__ */ m("div", {
101
84
  className: "flex w-full flex-col gap-2",
102
85
  children: [
103
- /* @__PURE__ */ f(o, {
86
+ /* @__PURE__ */ p(s, {
104
87
  values: b,
105
88
  currentPlacement: _,
106
89
  onChange: x("style")
107
90
  }),
108
- /* @__PURE__ */ f(s, {
91
+ /* @__PURE__ */ p(c, {
109
92
  values: b,
110
93
  currentPlacement: _,
111
94
  onChange: x("width")
112
95
  }),
113
- /* @__PURE__ */ f(r, {
96
+ /* @__PURE__ */ p(i, {
114
97
  values: b,
115
98
  currentPlacement: _,
116
99
  onChange: x("color")
@@ -1,55 +1,64 @@
1
- import { useCallback as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import r from "clsx";
4
- import i from "@plitzi/plitzi-ui/Icon";
5
- import a from "@plitzi/plitzi-ui/icons/BorderPlacementBottom";
6
- import o from "@plitzi/plitzi-ui/icons/BorderPlacementCenter";
7
- import s from "@plitzi/plitzi-ui/icons/BorderPlacementLeft";
8
- import c from "@plitzi/plitzi-ui/icons/BorderPlacementRight";
9
- import l from "@plitzi/plitzi-ui/icons/BorderPlacementTop";
1
+ import e from "../../components/CategorySection/index.mjs";
2
+ import { useCallback as t } from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import i from "clsx";
5
+ import a from "@plitzi/plitzi-ui/Icon";
6
+ import o from "@plitzi/plitzi-ui/icons/BorderPlacementBottom";
7
+ import s from "@plitzi/plitzi-ui/icons/BorderPlacementCenter";
8
+ import c from "@plitzi/plitzi-ui/icons/BorderPlacementLeft";
9
+ import l from "@plitzi/plitzi-ui/icons/BorderPlacementRight";
10
+ import u from "@plitzi/plitzi-ui/icons/BorderPlacementTop";
10
11
  //#region src/components/StyleInspector/categories/Border/BorderPlacements.tsx
11
- var u = ({ currentPlacement: u, setCurrentPlacement: d }) => {
12
- let f = e((e) => () => d(e), [d]);
13
- return /* @__PURE__ */ n("div", {
14
- className: "mx-auto grid grid-cols-3 grid-rows-3 place-items-center gap-2",
15
- children: [
16
- /* @__PURE__ */ t(i, {
17
- size: "2xl",
18
- className: r("col-start-2 cursor-pointer rounded p-0.5", { "bg-primary-100": u === "top" }),
19
- onClick: f("top"),
20
- active: u === "top",
21
- children: /* @__PURE__ */ t(l, {})
22
- }),
23
- /* @__PURE__ */ t(i, {
24
- size: "2xl",
25
- className: r("row-start-2 cursor-pointer rounded p-0.5", { "bg-primary-100": u === "left" }),
26
- onClick: f("left"),
27
- active: u === "left",
28
- children: /* @__PURE__ */ t(s, {})
29
- }),
30
- /* @__PURE__ */ t(i, {
31
- size: "2xl",
32
- className: r("row-start-2 grid cursor-pointer grid-cols-3 rounded p-0.5", { "bg-primary-100": u === "all" }),
33
- onClick: f("all"),
34
- active: u === "all",
35
- children: /* @__PURE__ */ t(o, {})
36
- }),
37
- /* @__PURE__ */ t(i, {
38
- size: "2xl",
39
- className: r("row-start-2 cursor-pointer rounded p-0.5", { "bg-primary-100": u === "right" }),
40
- onClick: f("right"),
41
- active: u === "right",
42
- children: /* @__PURE__ */ t(c, {})
43
- }),
44
- /* @__PURE__ */ t(i, {
45
- size: "2xl",
46
- className: r("col-start-2 row-start-3 cursor-pointer rounded p-0.5", { "bg-primary-100": u === "bottom" }),
47
- onClick: f("bottom"),
48
- active: u === "bottom",
49
- children: /* @__PURE__ */ t(a, {})
50
- })
51
- ]
12
+ var d = ({ currentPlacement: d, setCurrentPlacement: f }) => {
13
+ let p = t((e) => () => f(e), [f]);
14
+ return /* @__PURE__ */ n(e, {
15
+ label: "Side",
16
+ children: /* @__PURE__ */ r("div", {
17
+ className: "mx-auto grid grid-cols-3 grid-rows-3 place-items-center gap-1.5",
18
+ children: [
19
+ /* @__PURE__ */ n(a, {
20
+ size: "2xl",
21
+ className: i("col-start-2 cursor-pointer rounded p-0.5", { "bg-primary-500/15 dark:bg-primary-400/20": d === "top" }),
22
+ title: "Top border",
23
+ onClick: p("top"),
24
+ active: d === "top",
25
+ children: /* @__PURE__ */ n(u, {})
26
+ }),
27
+ /* @__PURE__ */ n(a, {
28
+ size: "2xl",
29
+ className: i("row-start-2 cursor-pointer rounded p-0.5", { "bg-primary-500/15 dark:bg-primary-400/20": d === "left" }),
30
+ title: "Left border",
31
+ onClick: p("left"),
32
+ active: d === "left",
33
+ children: /* @__PURE__ */ n(c, {})
34
+ }),
35
+ /* @__PURE__ */ n(a, {
36
+ size: "2xl",
37
+ className: i("row-start-2 grid cursor-pointer grid-cols-3 rounded p-0.5", { "bg-primary-500/15 dark:bg-primary-400/20": d === "all" }),
38
+ title: "All four sides",
39
+ onClick: p("all"),
40
+ active: d === "all",
41
+ children: /* @__PURE__ */ n(s, {})
42
+ }),
43
+ /* @__PURE__ */ n(a, {
44
+ size: "2xl",
45
+ className: i("row-start-2 cursor-pointer rounded p-0.5", { "bg-primary-500/15 dark:bg-primary-400/20": d === "right" }),
46
+ title: "Right border",
47
+ onClick: p("right"),
48
+ active: d === "right",
49
+ children: /* @__PURE__ */ n(l, {})
50
+ }),
51
+ /* @__PURE__ */ n(a, {
52
+ size: "2xl",
53
+ className: i("col-start-2 row-start-3 cursor-pointer rounded p-0.5", { "bg-primary-500/15 dark:bg-primary-400/20": d === "bottom" }),
54
+ title: "Bottom border",
55
+ onClick: p("bottom"),
56
+ active: d === "bottom",
57
+ children: /* @__PURE__ */ n(o, {})
58
+ })
59
+ ]
60
+ })
52
61
  });
53
62
  };
54
63
  //#endregion
55
- export { u as default };
64
+ export { d as default };