@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
@@ -0,0 +1,220 @@
1
+ //#region src/components/StyleInspector/categoryKeys.ts
2
+ var e = {
3
+ title: "List",
4
+ dot: ["list-style"],
5
+ advanced: []
6
+ }, t = {
7
+ title: "List Item",
8
+ dot: ["list-style-type"],
9
+ advanced: []
10
+ }, n = {
11
+ title: "Layout",
12
+ dot: [
13
+ "flex-direction",
14
+ "flex-wrap",
15
+ "align-items",
16
+ "justify-content",
17
+ "align-content",
18
+ "column-gap",
19
+ "row-gap",
20
+ "grid-row-gap",
21
+ "grid-column-gap",
22
+ "grid-template-areas",
23
+ "grid-template-columns",
24
+ "grid-template-rows",
25
+ "grid-auto-flow",
26
+ "grid-auto-rows",
27
+ "grid-auto-columns",
28
+ "display"
29
+ ],
30
+ advanced: []
31
+ }, r = {
32
+ title: "Flex Child",
33
+ dot: [
34
+ "align-self",
35
+ "order",
36
+ "flex-grow",
37
+ "flex-shrink",
38
+ "flex-basis"
39
+ ],
40
+ advanced: []
41
+ }, i = {
42
+ title: "Spacing",
43
+ dot: [
44
+ "margin-top",
45
+ "margin-bottom",
46
+ "margin-left",
47
+ "margin-right",
48
+ "padding-top",
49
+ "padding-bottom",
50
+ "padding-left",
51
+ "padding-right"
52
+ ],
53
+ advanced: []
54
+ }, a = {
55
+ title: "Size",
56
+ dot: [
57
+ "width",
58
+ "height",
59
+ "min-width",
60
+ "min-height",
61
+ "max-width",
62
+ "max-height",
63
+ "aspect-ratio",
64
+ "box-sizing",
65
+ "overflow",
66
+ "object-fit",
67
+ "object-position",
68
+ "container-type",
69
+ "container-name"
70
+ ],
71
+ advanced: [
72
+ "aspect-ratio",
73
+ "box-sizing",
74
+ "object-position",
75
+ "object-fit",
76
+ "container-type",
77
+ "container-name"
78
+ ]
79
+ }, o = {
80
+ title: "Position",
81
+ dot: [
82
+ "position",
83
+ "top",
84
+ "bottom",
85
+ "z-index",
86
+ "float",
87
+ "clear",
88
+ "left",
89
+ "right"
90
+ ],
91
+ advanced: ["float", "clear"]
92
+ }, s = {
93
+ title: "Typography",
94
+ dot: /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.text-align.font-style.text-decoration.text-decoration-thickness.text-underline-offset.letter-spacing.word-spacing.text-indent.text-transform.direction.text-shadow.white-space.text-wrap.word-break.overflow-wrap.hyphens.vertical-align.text-overflow.line-clamp.font-variant-numeric.font-feature-settings.-webkit-text-fill-color".split("."),
95
+ advanced: [
96
+ "text-decoration-thickness",
97
+ "text-underline-offset",
98
+ "word-break",
99
+ "overflow-wrap",
100
+ "hyphens",
101
+ "vertical-align",
102
+ "text-shadow",
103
+ "font-variant-numeric",
104
+ "font-feature-settings",
105
+ "-webkit-text-fill-color"
106
+ ]
107
+ }, c = {
108
+ title: "Background",
109
+ dot: [
110
+ "background-color",
111
+ "background-image",
112
+ "background-attachment",
113
+ "background-position",
114
+ "background-repeat",
115
+ "background-clip",
116
+ "background-size",
117
+ "background-blend-mode",
118
+ "mask-image"
119
+ ],
120
+ advanced: ["background-blend-mode", "mask-image"]
121
+ }, l = {
122
+ title: "Border",
123
+ dot: [
124
+ "border-top-style",
125
+ "border-top-width",
126
+ "border-top-color",
127
+ "border-bottom-style",
128
+ "border-bottom-width",
129
+ "border-bottom-color",
130
+ "border-left-style",
131
+ "border-left-width",
132
+ "border-left-color",
133
+ "border-right-style",
134
+ "border-right-width",
135
+ "border-right-color",
136
+ "border-top-left-radius",
137
+ "border-top-right-radius",
138
+ "border-bottom-left-radius",
139
+ "border-bottom-right-radius"
140
+ ],
141
+ advanced: []
142
+ }, u = {
143
+ title: "Effects",
144
+ dot: [
145
+ "opacity",
146
+ "visibility",
147
+ "cursor",
148
+ "transition",
149
+ "box-shadow",
150
+ "filter",
151
+ "backdrop-filter",
152
+ "mix-blend-mode",
153
+ "isolation",
154
+ "clip-path",
155
+ "transform",
156
+ "transform-origin",
157
+ "perspective",
158
+ "will-change"
159
+ ],
160
+ advanced: [
161
+ "transform-origin",
162
+ "perspective",
163
+ "backdrop-filter",
164
+ "mix-blend-mode",
165
+ "isolation",
166
+ "clip-path",
167
+ "will-change"
168
+ ]
169
+ }, d = {
170
+ title: "Others",
171
+ dot: /* @__PURE__ */ "pointer-events.user-select.touch-action.resize.appearance.scroll-behavior.overscroll-behavior.scroll-snap-type.scroll-snap-align.scroll-snap-stop.scroll-padding-top.scroll-margin-top.accent-color.caret-color.color-scheme.scrollbar-width.scrollbar-color.outline-width.outline-style.outline-color.outline-offset.border-collapse.border-spacing.table-layout.fill.stroke.stroke-width".split("."),
172
+ advanced: [
173
+ "touch-action",
174
+ "resize",
175
+ "appearance",
176
+ "scroll-behavior",
177
+ "overscroll-behavior",
178
+ "scroll-snap-type",
179
+ "scroll-snap-align",
180
+ "scroll-snap-stop",
181
+ "scroll-padding-top",
182
+ "scroll-margin-top",
183
+ "accent-color",
184
+ "caret-color",
185
+ "color-scheme",
186
+ "scrollbar-width",
187
+ "scrollbar-color",
188
+ "border-collapse",
189
+ "border-spacing",
190
+ "table-layout",
191
+ "fill",
192
+ "stroke",
193
+ "stroke-width"
194
+ ]
195
+ }, f = {
196
+ title: "Variables",
197
+ dot: [],
198
+ advanced: []
199
+ }, p = {
200
+ title: "Raw Style",
201
+ dot: [],
202
+ advanced: []
203
+ }, m = {
204
+ list: e,
205
+ listItem: t,
206
+ display: n,
207
+ displayFlexChild: r,
208
+ spacing: i,
209
+ size: a,
210
+ position: o,
211
+ typography: s,
212
+ background: c,
213
+ border: l,
214
+ effects: u,
215
+ others: d,
216
+ variables: f,
217
+ rawStyle: p
218
+ }, h = Object.keys(m);
219
+ //#endregion
220
+ export { c as BACKGROUND_KEYS, l as BORDER_KEYS, h as CATEGORY_IDS, m as CATEGORY_KEYS, n as DISPLAY_KEYS, u as EFFECTS_KEYS, r as FLEX_CHILD_KEYS, t as LIST_ITEM_KEYS, e as LIST_KEYS, d as OTHERS_KEYS, o as POSITION_KEYS, p as RAW_STYLE_KEYS, a as SIZE_KEYS, i as SPACING_KEYS, s as TYPOGRAPHY_KEYS, f as VARIABLES_KEYS };
@@ -1,54 +1,59 @@
1
1
  import e from "../../hooks/useInspectorValues.mjs";
2
2
  import t from "../CategoryAdvanced/CategoryAdvancedContext.mjs";
3
- import n from "../InspectorDots/index.mjs";
4
- import { useCallback as r } from "react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import o from "clsx";
7
- import s from "@plitzi/plitzi-ui/Icon";
8
- import c from "@plitzi/plitzi-ui/hooks/useStorage";
9
- import l from "@plitzi/plitzi-ui/ContainerCollapsable";
3
+ import n from "../../InspectorSearchContext.mjs";
4
+ import { advancedMatches as r } from "../../search.mjs";
5
+ import i from "../InspectorDots/index.mjs";
6
+ import { use as a, useCallback as o } from "react";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ import l from "clsx";
9
+ import u from "@plitzi/plitzi-ui/Icon";
10
+ import d from "@plitzi/plitzi-ui/hooks/useStorage";
11
+ import f from "@plitzi/plitzi-ui/ContainerCollapsable";
10
12
  //#region src/components/StyleInspector/components/CategoryContainer/CategoryContainer.tsx
11
- var u = ({ className: u, classNameContent: d, children: f, title: p = "Title", dotKeys: m, advancedKeys: h, isCollapsed: g = !0, onCollapse: _ }) => {
12
- let [v, y] = c(`builder-state.styleInspector.advanced.${p}`, !1), { hasValues: b } = e({
13
- keys: h,
13
+ var p = ({ className: p, classNameContent: m, children: h, title: g = "Title", dotKeys: _, advancedKeys: v, isCollapsed: y = !0, onCollapse: b }) => {
14
+ let [x, S] = d(`builder-state.styleInspector.advanced.${g}`, !1), { hasValues: C } = e({
15
+ keys: v,
14
16
  asValue: !1
15
- }), x = r((e) => {
16
- e.stopPropagation(), y((e) => !e);
17
- }, [y]);
18
- return /* @__PURE__ */ a(l, {
19
- className: u,
20
- collapsed: g,
21
- onChange: _,
22
- children: [/* @__PURE__ */ i(l.Header, {
23
- className: o("h-8", {
24
- "border-b border-gray-200 hover:bg-slate-100 dark:border-zinc-700 dark:hover:bg-zinc-700/50": g,
25
- "bg-slate-100 dark:bg-zinc-700/50": !g
17
+ }), w = a(n), T = r(v, w), E = x || T, D = o((e) => {
18
+ e.stopPropagation(), S((e) => !e);
19
+ }, [S]);
20
+ return /* @__PURE__ */ c(f, {
21
+ className: p,
22
+ collapsed: y,
23
+ onChange: b,
24
+ children: [/* @__PURE__ */ s(f.Header, {
25
+ className: l("h-8 px-2.5", {
26
+ "border-b border-gray-200 dark:border-zinc-800": y,
27
+ "bg-gray-50 dark:bg-zinc-800/60": !y
28
+ }),
29
+ title: /* @__PURE__ */ s("span", {
30
+ className: "text-[13px] font-medium text-zinc-800 dark:text-zinc-100",
31
+ children: g
26
32
  }),
27
- title: p,
28
33
  placement: "right",
29
- iconCollapsed: /* @__PURE__ */ i(s, { icon: "fa-solid fa-angle-down" }),
30
- iconExpanded: /* @__PURE__ */ i(s, { icon: "fa-solid fa-angle-up" }),
31
- children: /* @__PURE__ */ a("div", {
34
+ iconCollapsed: /* @__PURE__ */ s(u, { icon: "fa-solid fa-angle-down" }),
35
+ iconExpanded: /* @__PURE__ */ s(u, { icon: "fa-solid fa-angle-up" }),
36
+ children: /* @__PURE__ */ c("div", {
32
37
  className: "flex items-center gap-2",
33
- children: [/* @__PURE__ */ i(n, { styleKeys: m }), !!h?.length && !g && /* @__PURE__ */ i(s, {
34
- className: o("cursor-pointer text-xs", {
35
- "text-blue-500": v,
36
- "text-orange-500": !v && b,
37
- "text-gray-400 hover:text-gray-600 dark:text-zinc-500 dark:hover:text-zinc-300": !v && !b
38
+ children: [/* @__PURE__ */ s(i, { styleKeys: _ }), !!v?.length && !y && /* @__PURE__ */ s(u, {
39
+ className: l("cursor-pointer text-xs", {
40
+ "text-primary-500 dark:text-primary-400": E,
41
+ "text-sky-600 dark:text-sky-400": !E && C,
42
+ "text-gray-400 hover:text-gray-600 dark:text-zinc-500 dark:hover:text-zinc-300": !E && !C
38
43
  }),
39
44
  icon: "fa-solid fa-sliders",
40
- title: v ? "Hide advanced properties" : "Show advanced properties",
41
- onClick: x
45
+ title: x ? "Hide advanced properties" : "Show advanced properties",
46
+ onClick: D
42
47
  })]
43
48
  })
44
- }), /* @__PURE__ */ i(l.Content, {
45
- className: o("flex flex-col gap-3 p-2", { "border-b border-gray-200 dark:border-zinc-700": !g }, d),
46
- children: /* @__PURE__ */ i(t, {
47
- value: v,
48
- children: f
49
+ }), /* @__PURE__ */ s(f.Content, {
50
+ className: l("flex flex-col gap-3 px-2.5 py-3", { "border-b border-gray-200 dark:border-zinc-800": !y }, m),
51
+ children: /* @__PURE__ */ s(t, {
52
+ value: E,
53
+ children: h
49
54
  })
50
55
  })]
51
56
  });
52
57
  };
53
58
  //#endregion
54
- export { u as default };
59
+ export { p as default };
@@ -14,7 +14,8 @@ var a = ({ items: a = [], onChange: o }) => {
14
14
  className: r("cursor-pointer rounded-sm p-0.5", {
15
15
  "bg-zinc-300 dark:bg-zinc-800": e.active,
16
16
  "text-xs": typeof e.icon == "string",
17
- "h-5 w-5": e.size !== "custom"
17
+ "h-5 w-5": e.size !== "custom",
18
+ "flex-1 justify-center": e.size === "custom"
18
19
  }),
19
20
  active: e.active,
20
21
  onClick: c(e.value),
@@ -1,18 +1,33 @@
1
1
  import e from "../InspectorLabel/index.mjs";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import r from "@plitzi/plitzi-ui/Flex";
2
+ import { Children 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/Flex";
4
6
  //#region src/components/StyleInspector/components/CategorySection/CategorySection.tsx
5
- var i = ({ children: i, className: a, direction: o = "row", label: s, keys: c }) => /* @__PURE__ */ n(r, {
6
- direction: o,
7
- gap: 2,
8
- justify: s && o === "row" ? "between" : void 0,
9
- items: o === "row" ? "center" : void 0,
10
- className: a,
11
- children: [s && /* @__PURE__ */ t(e, {
12
- className: o === "row" ? "w-18" : "w-full",
13
- keyValue: c,
14
- children: s
15
- }), i]
16
- });
7
+ var o = 2, s = ({ children: s, className: c, direction: l = "row", label: u, keys: d }) => {
8
+ let f = t.toArray(s).length;
9
+ return l === "row" && f > o ? /* @__PURE__ */ r("div", {
10
+ className: i("flex flex-col gap-1", c),
11
+ children: [u && /* @__PURE__ */ n(e, {
12
+ className: "w-full",
13
+ keyValue: d,
14
+ children: u
15
+ }), /* @__PURE__ */ n("div", {
16
+ className: "grid grid-cols-[repeat(auto-fill,minmax(6.5rem,1fr))] items-end gap-2",
17
+ children: s
18
+ })]
19
+ }) : /* @__PURE__ */ r(a, {
20
+ direction: l,
21
+ gap: 2,
22
+ justify: u && l === "row" ? "between" : void 0,
23
+ items: l === "row" ? "center" : void 0,
24
+ className: c,
25
+ children: [u && /* @__PURE__ */ n(e, {
26
+ className: l === "row" ? "w-20" : "w-full",
27
+ keyValue: d,
28
+ children: u
29
+ }), s]
30
+ });
31
+ };
17
32
  //#endregion
18
- export { i as default };
33
+ export { s as default };
@@ -0,0 +1,8 @@
1
+ export type ColorSwatchProps = {
2
+ className?: string;
3
+ /** A color, or any background (a gradient, an image) — drawn over a checkerboard so transparency shows. */
4
+ value: string;
5
+ property?: 'background-color' | 'background';
6
+ };
7
+ declare const _default: import('react').MemoExoticComponent<({ className, value, property }: ColorSwatchProps) => import('react').JSX.Element>;
8
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { resolveTokens as e } from "../../cssValues.mjs";
2
+ import t from "../../StyleInspectorContext.mjs";
3
+ import { CHECKERBOARD as n } from "./helpers.mjs";
4
+ import { memo as r, use as i, useMemo as a } from "react";
5
+ import { jsx as o } from "react/jsx-runtime";
6
+ import s from "clsx";
7
+ var c = r(({ className: r, value: c, property: l = "background-color" }) => {
8
+ let { variables: u } = i(t), d = a(() => ({ [l === "background" ? "background" : "backgroundColor"]: e(c, u) }), [
9
+ l,
10
+ c,
11
+ u
12
+ ]);
13
+ return /* @__PURE__ */ o("span", {
14
+ className: s("relative inline-flex shrink-0 overflow-hidden rounded ring-1 ring-black/15 ring-inset dark:ring-white/20", r),
15
+ style: n,
16
+ children: /* @__PURE__ */ o("span", {
17
+ className: "absolute inset-0",
18
+ style: d
19
+ })
20
+ });
21
+ });
22
+ //#endregion
23
+ export { c as default };
@@ -0,0 +1,3 @@
1
+ import { CSSProperties } from 'react';
2
+ /** The pattern a transparent color is drawn over, so `transparent` and `rgba(…, 0.2)` read as what they are. */
3
+ export declare const CHECKERBOARD: CSSProperties;
@@ -0,0 +1,9 @@
1
+ //#region src/components/StyleInspector/components/ColorSwatch/helpers.ts
2
+ var e = {
3
+ backgroundImage: "linear-gradient(45deg, #cfcfd8 25%, transparent 25%), linear-gradient(-45deg, #cfcfd8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cfcfd8 75%), linear-gradient(-45deg, transparent 75%, #cfcfd8 75%)",
4
+ backgroundColor: "#ffffff",
5
+ backgroundSize: "8px 8px",
6
+ backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0"
7
+ };
8
+ //#endregion
9
+ export { e as CHECKERBOARD };
@@ -0,0 +1,3 @@
1
+ import { default as ColorSwatch } from './ColorSwatch';
2
+ export * from './ColorSwatch';
3
+ export default ColorSwatch;
@@ -0,0 +1,5 @@
1
+ import e from "./ColorSwatch.mjs";
2
+ //#region src/components/StyleInspector/components/ColorSwatch/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -2,5 +2,6 @@ import { StyleCategory } from '@plitzi/sdk-shared';
2
2
  export type InspectorDotsProps = {
3
3
  styleKeys?: StyleCategory[];
4
4
  };
5
+ /** The same four sources a row's label is tinted by, summed up for a whole category while it is folded. */
5
6
  declare const InspectorDots: ({ styleKeys }: InspectorDotsProps) => import('react').JSX.Element;
6
7
  export default InspectorDots;
@@ -9,21 +9,21 @@ var r = ({ styleKeys: r }) => {
9
9
  return /* @__PURE__ */ n("div", {
10
10
  className: "flex items-center gap-1.5",
11
11
  children: [
12
- i && /* @__PURE__ */ t("div", {
13
- className: "h-1.5 w-1.5 rounded-full bg-orange-300",
14
- title: "Has Inherit"
15
- }),
16
12
  s && /* @__PURE__ */ t("div", {
17
- className: "h-1.5 w-1.5 rounded-full bg-blue-300",
18
- title: "Has Value"
13
+ className: "h-1.5 w-1.5 rounded-full bg-sky-500 dark:bg-sky-400",
14
+ title: "Has values set on this selector"
15
+ }),
16
+ o && /* @__PURE__ */ t("div", {
17
+ className: "h-1.5 w-1.5 rounded-full bg-emerald-500 dark:bg-emerald-400",
18
+ title: "Uses tokens"
19
19
  }),
20
20
  a && /* @__PURE__ */ t("div", {
21
- className: "h-1.5 w-1.5 rounded-full bg-purple-300",
22
- title: "Has Binding"
21
+ className: "h-1.5 w-1.5 rounded-full bg-violet-500 dark:bg-violet-400",
22
+ title: "Has values bound to data"
23
23
  }),
24
- o && /* @__PURE__ */ t("div", {
25
- className: "h-1.5 w-1.5 rounded-full bg-green-300",
26
- title: "Has Variables"
24
+ i && /* @__PURE__ */ t("div", {
25
+ className: "h-1.5 w-1.5 rounded-full bg-amber-500 dark:bg-amber-400",
26
+ title: "Inherits values from elsewhere"
27
27
  })
28
28
  ]
29
29
  });
@@ -0,0 +1,11 @@
1
+ import { ChangeEvent } from 'react';
2
+ export type InspectorFooterProps = {
3
+ replaceTokens: boolean;
4
+ showAllOptions: boolean;
5
+ canShowAllOptions: boolean;
6
+ onCollapseAll: () => void;
7
+ onChangeReplaceTokens: (e: ChangeEvent<HTMLInputElement>) => void;
8
+ onChangeShowAllOptions: (e: ChangeEvent<HTMLInputElement>) => void;
9
+ };
10
+ declare const InspectorFooter: ({ replaceTokens, showAllOptions, canShowAllOptions, onCollapseAll, onChangeReplaceTokens, onChangeShowAllOptions }: InspectorFooterProps) => import('react').JSX.Element;
11
+ export default InspectorFooter;
@@ -0,0 +1,38 @@
1
+ import { LEGEND as e } from "./helpers.mjs";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import r from "@plitzi/plitzi-ui/Icon";
4
+ import i from "@plitzi/plitzi-ui/Switch";
5
+ //#region src/components/StyleInspector/components/InspectorFooter/InspectorFooter.tsx
6
+ var a = ({ replaceTokens: a, showAllOptions: o, canShowAllOptions: s, onCollapseAll: c, onChangeReplaceTokens: l, onChangeShowAllOptions: u }) => /* @__PURE__ */ n("div", {
7
+ className: "flex items-center justify-between gap-3 border-t border-gray-200 px-2.5 py-1.5 dark:border-zinc-800",
8
+ children: [/* @__PURE__ */ n("div", {
9
+ className: "flex items-center gap-3 text-zinc-500 dark:text-zinc-400",
10
+ children: [/* @__PURE__ */ t(r, {
11
+ className: "cursor-pointer text-xs hover:text-zinc-800 dark:hover:text-zinc-100",
12
+ icon: "fa-solid fa-angles-up",
13
+ title: "Collapse every category",
14
+ onClick: c
15
+ }), /* @__PURE__ */ t(r, {
16
+ className: "cursor-help text-xs",
17
+ icon: "fa-solid fa-circle-info",
18
+ title: e
19
+ })]
20
+ }), /* @__PURE__ */ n("div", {
21
+ className: "flex items-center gap-3 whitespace-nowrap",
22
+ children: [/* @__PURE__ */ t(i, {
23
+ size: "xs",
24
+ label: "Token values",
25
+ title: "Show what each token resolves to instead of its name",
26
+ checked: a,
27
+ onChange: l
28
+ }), s && /* @__PURE__ */ t(i, {
29
+ size: "xs",
30
+ label: "All options",
31
+ title: "Show every category, including the ones this element does not use",
32
+ checked: o,
33
+ onChange: u
34
+ })]
35
+ })]
36
+ });
37
+ //#endregion
38
+ export { a as default };
@@ -0,0 +1,2 @@
1
+ /** What the colour of a row's label — and of the dots on a folded category — says about where its value comes from. */
2
+ export declare const LEGEND: string;
@@ -0,0 +1,11 @@
1
+ //#region src/components/StyleInspector/components/InspectorFooter/helpers.ts
2
+ var e = [
3
+ "Label colours",
4
+ "Blue — set on this selector (click the label to reset it)",
5
+ "Green — set from a token",
6
+ "Violet — bound to data",
7
+ "Amber — inherited from another selector or breakpoint",
8
+ "Grey — nothing set, the default applies"
9
+ ].join("\n");
10
+ //#endregion
11
+ export { e as LEGEND };
@@ -0,0 +1,3 @@
1
+ import { default as InspectorFooter } from './InspectorFooter';
2
+ export * from './InspectorFooter';
3
+ export default InspectorFooter;
@@ -0,0 +1,5 @@
1
+ import e from "./InspectorFooter.mjs";
2
+ //#region src/components/StyleInspector/components/InspectorFooter/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,40 +1,43 @@
1
- import e from "../../StyleInspectorContext.mjs";
2
- import t from "../../hooks/useInspectorValues.mjs";
3
- import { memo as n, use as r, useCallback as i } from "react";
4
- import { jsx as a } from "react/jsx-runtime";
5
- import o from "clsx";
6
- var s = n(({ keyValue: n, children: s, className: c = "", size: l = "small", sectionTitle: u = !1 }) => {
7
- let { resetValue: d } = r(e), { hasValues: f, hasInherit: p, hasBinding: m, hasVariables: h } = t({
8
- keys: n,
1
+ import { labelHint as e, labelSource as t } from "./helpers.mjs";
2
+ import n from "../../StyleInspectorContext.mjs";
3
+ import r from "../../hooks/useInspectorValues.mjs";
4
+ import { memo as i, use as a, useCallback as o } from "react";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ import c from "clsx";
7
+ var l = i(({ keyValue: i, children: l, className: u = "", size: d = "small", sectionTitle: f = !1 }) => {
8
+ let { resetValue: p, inheritData: m } = a(n), h = r({
9
+ keys: i,
9
10
  asValue: !1
10
- }), g = i(() => {
11
- f && n && d(n);
11
+ }), { hasValues: g } = h, _ = t(h), v = e(_, g, i, m), y = o(() => {
12
+ g && i && p(i);
12
13
  }, [
13
- d,
14
- f,
15
- n
14
+ p,
15
+ g,
16
+ i
16
17
  ]);
17
- return /* @__PURE__ */ a("div", {
18
- className: o("inspector__label flex min-w-[50px] shrink-0 items-center select-none", c, {
19
- "text-xs": l === "small",
20
- "text-sm": l === "medium",
21
- "text-base": l === "normal",
22
- "mb-[-1px] p-0": u
18
+ return /* @__PURE__ */ s("div", {
19
+ className: c("inspector__label flex min-w-[50px] shrink-0 items-center select-none", u, {
20
+ "text-xs": d === "small",
21
+ "text-sm": d === "medium",
22
+ "text-base": d === "normal",
23
+ "mb-[-1px] p-0": f
23
24
  }),
24
- title: typeof s == "string" ? s : void 0,
25
- children: /* @__PURE__ */ a("label", {
26
- className: o("m-0 truncate", {
27
- "px-1": !u,
28
- "rounded-tl rounded-tr border border-gray-300 bg-gray-100 px-2 font-bold text-zinc-700 dark:border-zinc-600 dark:bg-zinc-700 dark:text-zinc-200": u,
29
- "cursor-pointer bg-blue-200 text-blue-600 dark:bg-blue-900/50 dark:text-blue-400": f && !m && !h,
30
- "cursor-pointer bg-green-200 text-green-600 dark:bg-green-900/50 dark:text-green-400": h,
31
- "cursor-pointer bg-purple-200 text-purple-600 dark:bg-purple-900/50 dark:text-purple-400": m,
32
- "bg-orange-200 text-orange-600 dark:bg-orange-900/50 dark:text-orange-400": p && !f && !h
25
+ title: v ?? (typeof l == "string" ? l : void 0),
26
+ children: /* @__PURE__ */ s("label", {
27
+ className: c("m-0 truncate rounded-sm leading-5 transition-colors duration-150", {
28
+ "px-1": !f,
29
+ "rounded-b-none border border-gray-300 bg-gray-100 px-2 font-semibold text-zinc-700 dark:border-zinc-600 dark:bg-zinc-700 dark:text-zinc-200": f,
30
+ "text-zinc-600 dark:text-zinc-400": !f && _ === "none",
31
+ "bg-sky-500/12 text-sky-700 dark:bg-sky-400/12 dark:text-sky-300": _ === "value",
32
+ "bg-emerald-500/12 text-emerald-700 dark:bg-emerald-400/12 dark:text-emerald-300": _ === "variable",
33
+ "bg-violet-500/12 text-violet-700 dark:bg-violet-400/14 dark:text-violet-300": _ === "binding",
34
+ "text-amber-700 dark:text-amber-400/90": _ === "inherit",
35
+ "cursor-pointer hover:bg-red-500/12 hover:text-red-700 hover:line-through dark:hover:bg-red-400/12 dark:hover:text-red-300": g
33
36
  }),
34
- onClick: g,
35
- children: s
37
+ onClick: y,
38
+ children: l
36
39
  })
37
40
  });
38
41
  });
39
42
  //#endregion
40
- export { s as default };
43
+ export { l as default };