@plitzi/sdk-style 0.39.4 → 0.39.7

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 (54) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/builder/StyleAdvanceEditor.mjs +4 -3
  3. package/dist/builder/components/InputEasing/Curve.mjs +1 -1
  4. package/dist/builder/components/InputEasing/Grid.mjs +3 -3
  5. package/dist/builder/components/InputEasing/InputEasing.mjs +2 -2
  6. package/dist/builder/components/InputEasing/InputEasingButton.mjs +1 -1
  7. package/dist/builder/components/InputEasing/InputEasingList.mjs +4 -4
  8. package/dist/builder/components/Selector/Selector.mjs +143 -123
  9. package/dist/builder/components/Selector/SelectorItem/ItemOptions.mjs +4 -3
  10. package/dist/builder/components/Selector/SelectorItem/SelectorItem.mjs +29 -19
  11. package/dist/builder/components/Selector/SelectorItem/helpers.d.ts +1 -1
  12. package/dist/builder/components/Selector/SelectorItem/helpers.mjs +1 -1
  13. package/dist/builder/components/Selector/SelectorSuggestions/SelectorSuggestions.d.ts +6 -3
  14. package/dist/builder/components/Selector/SelectorSuggestions/SelectorSuggestions.mjs +56 -18
  15. package/dist/builder/components/Selector/SelectorSuggestions/helpers.d.ts +8 -0
  16. package/dist/builder/components/Selector/SelectorSuggestions/helpers.mjs +9 -0
  17. package/dist/builder/components/Selector/SelectorSuggestions/index.d.ts +1 -0
  18. package/dist/builder/components/Selector/SelectorSuggestions/index.mjs +3 -2
  19. package/dist/builder/components/StyleInspector/Inspector.mjs +1 -1
  20. package/dist/builder/components/StyleInspector/StyleInspector.mjs +2 -2
  21. package/dist/builder/components/StyleInspector/categories/Background/Background.mjs +1 -1
  22. package/dist/builder/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +6 -6
  23. package/dist/builder/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +3 -3
  24. package/dist/builder/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +1 -1
  25. package/dist/builder/components/StyleInspector/categories/Background/modes/RawMode.mjs +1 -1
  26. package/dist/builder/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +1 -1
  27. package/dist/builder/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +4 -4
  28. package/dist/builder/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +1 -1
  29. package/dist/builder/components/StyleInspector/categories/Position/PositionAdvanced.mjs +5 -5
  30. package/dist/builder/components/StyleInspector/categories/Spacing/SpacingEditor.mjs +1 -1
  31. package/dist/builder/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +1 -1
  32. package/dist/builder/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +2 -2
  33. package/dist/builder/components/StyleInspector/components/AncestorRules/AncestorRuleChip.mjs +1 -1
  34. package/dist/builder/components/StyleInspector/components/AncestorRules/AncestorRules.mjs +1 -1
  35. package/dist/builder/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +5 -5
  36. package/dist/builder/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +1 -1
  37. package/dist/builder/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +3 -3
  38. package/dist/builder/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +2 -2
  39. package/dist/builder/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +1 -1
  40. package/dist/builder/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +1 -1
  41. package/dist/builder/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +2 -2
  42. package/dist/builder/components/StyleInspector/components/ValueList/ValueList.mjs +1 -1
  43. package/dist/builder/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +6 -6
  44. package/dist/builder/components/StyleManager/ManagerSelector.mjs +281 -123
  45. package/dist/builder/components/StyleManager/StyleManager.mjs +75 -35
  46. package/dist/builder/components/StyleManager/StyleSelectorTag.d.ts +5 -1
  47. package/dist/builder/components/StyleManager/StyleSelectorTag.mjs +81 -63
  48. package/dist/builder/hooks/useWindowedList.d.ts +19 -0
  49. package/dist/builder/hooks/useWindowedList.mjs +38 -0
  50. package/package.json +8 -8
  51. package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsCreator.d.ts +0 -7
  52. package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsCreator.mjs +0 -19
  53. package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsList.d.ts +0 -7
  54. package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsList.mjs +0 -24
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @plitzi/sdk-style
2
2
 
3
+ ## 0.39.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 081d94e: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
8
+ `@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
9
+ - Updated dependencies [081d94e]
10
+ - @plitzi/sdk-event-bridge@0.39.7
11
+ - @plitzi/sdk-shared@0.39.7
12
+ - @plitzi/sdk-variables@0.39.7
13
+
14
+ ## 0.39.6
15
+
16
+ ### Patch Changes
17
+
18
+ - @plitzi/sdk-event-bridge@0.39.6
19
+ - @plitzi/sdk-shared@0.39.6
20
+ - @plitzi/sdk-variables@0.39.6
21
+
22
+ ## 0.39.5
23
+
24
+ ### Patch Changes
25
+
26
+ - 4427674: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
27
+ `@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
28
+ - Updated dependencies [4427674]
29
+ - @plitzi/sdk-event-bridge@0.39.5
30
+ - @plitzi/sdk-shared@0.39.5
31
+ - @plitzi/sdk-variables@0.39.5
32
+
3
33
  ## 0.39.4
4
34
 
5
35
  ### Patch Changes
@@ -38,12 +38,12 @@ var _ = () => {
38
38
  children: [/* @__PURE__ */ l("div", {
39
39
  className: "flex flex-col items-end gap-2",
40
40
  children: [/* @__PURE__ */ l("p", {
41
- className: "self-stretch text-xs leading-relaxed text-zinc-600 dark:text-zinc-400",
41
+ className: "text-ui-fg-muted self-stretch text-xs leading-relaxed",
42
42
  children: [
43
43
  "CSS of your own for the whole space, past what the style inspector writes.",
44
44
  " ",
45
45
  /* @__PURE__ */ c("span", {
46
- className: "font-medium text-zinc-800 dark:text-zinc-200",
46
+ className: "text-ui-fg font-medium",
47
47
  children: "Ctrl + Space"
48
48
  }),
49
49
  " completes a token.",
@@ -65,10 +65,11 @@ var _ = () => {
65
65
  children: [/* @__PURE__ */ c(f.Icon, { icon: "fa-solid fa-wand-magic-sparkles" }), "Format"]
66
66
  })]
67
67
  }), /* @__PURE__ */ c(p, {
68
- className: "min-h-0 grow overflow-hidden rounded-md border border-gray-300 dark:border-zinc-700",
68
+ className: "border-ui-line-strong min-h-0 grow overflow-hidden rounded-md border",
69
69
  value: S,
70
70
  autoComplete: M,
71
71
  theme: _,
72
+ size: "xs",
72
73
  lineWrapping: !0,
73
74
  onChange: A
74
75
  })]
@@ -3,7 +3,7 @@ import { jsx as e } from "react/jsx-runtime";
3
3
  var t = [], n = ({ value: n = t, xFrom: r = 0, xTo: i = 0, yFrom: a = 0, yTo: o = 0 }) => {
4
4
  let s = (e, t, n) => e * (1 - n) + t * n, c = (e) => Math.round(s(r, i, e)), l = (e) => Math.round(s(a, o, e)), u = c(0), d = l(0), f = c(1), p = l(1), m = c(n[0]), h = l(n[1]), g = c(n[2]), _ = l(n[3]);
5
5
  return /* @__PURE__ */ e("path", {
6
- className: "fill-transparent stroke-gray-900 stroke-2",
6
+ className: "stroke-ui-fg fill-transparent stroke-2",
7
7
  d: `M${u},${d} C${m},${h} ${g},${_} ${f},${p}`
8
8
  });
9
9
  };
@@ -14,16 +14,16 @@ var n = ({ xFrom: n = 0, xTo: r = 0, yFrom: i = 0, yTo: a = 0 }) => {
14
14
  }).join(" ");
15
15
  return /* @__PURE__ */ t("g", { children: [
16
16
  /* @__PURE__ */ e("path", {
17
- className: "fill-white",
17
+ className: "fill-ui-panel",
18
18
  d: b
19
19
  }),
20
20
  /* @__PURE__ */ e("path", {
21
- className: "stroke-gray-300",
21
+ className: "stroke-ui-fg-subtle",
22
22
  strokeWidth: "1px",
23
23
  d: x
24
24
  }),
25
25
  /* @__PURE__ */ e("path", {
26
- className: "stroke-gray-300",
26
+ className: "stroke-ui-fg-subtle",
27
27
  strokeWidth: "2px",
28
28
  d: S
29
29
  }),
@@ -95,7 +95,7 @@ var l = [
95
95
  cy: x,
96
96
  r: f,
97
97
  onMouseDown: this.handleMouseDown("bottom"),
98
- className: "cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:fill-white group-hover:stroke-[6px]"
98
+ className: "group-hover:fill-ui-panel cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:stroke-[6px]"
99
99
  })]
100
100
  }), /* @__PURE__ */ s("g", {
101
101
  className: "group",
@@ -110,7 +110,7 @@ var l = [
110
110
  cy: O,
111
111
  r: f,
112
112
  onMouseDown: this.handleMouseDown("top"),
113
- className: "cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:fill-white group-hover:stroke-[6px]"
113
+ className: "group-hover:fill-ui-panel cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:stroke-[6px]"
114
114
  })]
115
115
  })] })
116
116
  ]
@@ -5,7 +5,7 @@ var n = ({ children: n, title: r = "", className: i = "", onClick: a }) => /* @_
5
5
  type: "button",
6
6
  title: r,
7
7
  onClick: a,
8
- className: t("hover:text-primary-600 dark:hover:text-primary-300 m-0.5 h-7 w-7 cursor-pointer rounded-md p-1 text-zinc-600 hover:bg-gray-100 dark:text-zinc-300 dark:hover:bg-zinc-800", i),
8
+ className: t("hover:text-primary-600 dark:hover:text-primary-300 text-ui-fg-muted hover:bg-ui-hover m-0.5 h-7 w-7 cursor-pointer rounded-md p-1", i),
9
9
  children: /* @__PURE__ */ e("svg", {
10
10
  viewBox: "0 0 30 30",
11
11
  className: "overflow-visible",
@@ -11,7 +11,7 @@ var a = ({ className: a = "", onChange: o }) => {
11
11
  /* @__PURE__ */ r("div", {
12
12
  className: "flex flex-col",
13
13
  children: [/* @__PURE__ */ n("div", {
14
- className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
14
+ className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
15
15
  children: "Default"
16
16
  }), /* @__PURE__ */ r("div", {
17
17
  className: "flex flex-wrap",
@@ -62,7 +62,7 @@ var a = ({ className: a = "", onChange: o }) => {
62
62
  /* @__PURE__ */ r("div", {
63
63
  className: "flex flex-col",
64
64
  children: [/* @__PURE__ */ n("div", {
65
- className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
65
+ className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
66
66
  children: "Ease In"
67
67
  }), /* @__PURE__ */ r("div", {
68
68
  className: "flex flex-wrap",
@@ -137,7 +137,7 @@ var a = ({ className: a = "", onChange: o }) => {
137
137
  /* @__PURE__ */ r("div", {
138
138
  className: "flex flex-col",
139
139
  children: [/* @__PURE__ */ n("div", {
140
- className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
140
+ className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
141
141
  children: "Ease Out"
142
142
  }), /* @__PURE__ */ r("div", {
143
143
  className: "flex flex-wrap",
@@ -212,7 +212,7 @@ var a = ({ className: a = "", onChange: o }) => {
212
212
  /* @__PURE__ */ r("div", {
213
213
  className: "flex flex-col",
214
214
  children: [/* @__PURE__ */ n("div", {
215
- className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
215
+ className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
216
216
  children: "Ease In Out"
217
217
  }), /* @__PURE__ */ r("div", {
218
218
  className: "flex flex-wrap",
@@ -1,110 +1,124 @@
1
1
  import { inStylesheetOrder as e, overriddenProperties as t, overrideNote as n, selectorFormatter as r } from "./SelectorHelper.mjs";
2
2
  import i from "./SelectorItem/index.mjs";
3
- import a from "./SelectorSuggestions/index.mjs";
4
- import o from "../StyleManager/index.mjs";
5
- import { memo as s, useCallback as c, useMemo as l, useRef as u, useState as d } from "react";
6
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
- import { get as m, omit as h, pick as g } from "@plitzi/plitzi-ui/helpers";
8
- import _ from "@plitzi/plitzi-ui/Button";
9
- import v from "clsx";
10
- import y, { useFloating as b } from "@plitzi/plitzi-ui/ContainerFloating";
11
- import { usePopup as x } from "@plitzi/plitzi-ui/Popup";
3
+ import { suggestionsFor as a } from "./SelectorSuggestions/helpers.mjs";
4
+ import ee from "./SelectorSuggestions/index.mjs";
5
+ import te from "../StyleManager/index.mjs";
6
+ import { memo as o, useCallback as s, useMemo as c, useRef as l, useState as u } from "react";
7
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
+ import { get as p, omit as ne, pick as m } from "@plitzi/plitzi-ui/helpers";
9
+ import h from "@plitzi/plitzi-ui/Button";
10
+ import g from "clsx";
11
+ import _, { useFloating as v } from "@plitzi/plitzi-ui/ContainerFloating";
12
+ import { usePopup as y } from "@plitzi/plitzi-ui/Popup";
12
13
  // src/builder/components/Selector/Selector.tsx
13
- var S = "Classes apply left to right, in the order the stylesheet lists them: where two set the same property, the one further right wins.", C = s(({ className: s = "", value: C = "", selectors: w, selector: T, componentType: E, labels: D, disabled: O = !1, onChange: k, onSelectorSelected: A, onAdd: j, onRemove: M }) => {
14
- let N = u(null), [P, F] = d(""), [I, L, , R, z] = b({ disabled: O }), { existsPopup: B, addPopup: V } = x("floating"), H = l(() => Object.values(w ?? {}).find((e) => e.type === "element" && e.componentType === E), [E, w]), U = l(() => Object.values(g(w ?? {}, C.split(" "))).map((e) => g(e, ["name", "type"])), [w, C]), W = l(() => e(U.map((e, t) => ({
14
+ var b = "Classes apply left to right, in the order the stylesheet lists them: where two set the same property, the one further right wins.", x = o(({ className: o = "", value: x = "", selectors: S, selector: C, componentType: w, labels: T, disabled: E = !1, onChange: D, onSelectorSelected: O, onAdd: k, onRemove: A }) => {
15
+ let j = l(null), [M, N] = u(""), [P, F] = u(-1), [I, L, , R, z] = v({ disabled: E }), { existsPopup: B, addPopup: V } = y("floating"), H = c(() => Object.values(S ?? {}).find((e) => e.type === "element" && e.componentType === w), [w, S]), U = c(() => Object.values(m(S ?? {}, x.split(" "))).map((e) => m(e, ["name", "type"])), [S, x]), W = c(() => e(U.map((e, t) => ({
15
16
  ...e,
16
17
  position: t
17
- })), Object.keys(w ?? {})), [U, w]), G = l(() => t(W.map(({ name: e }) => e), w ?? {}), [W, w]), K = l(() => n(T?.name.replace(/:.*/, ""), G), [T, G]), q = l(() => Object.values(h(w ?? {}, C.split(" "))), [w, C]), J = c((e) => {
18
- L(e.target.value.length > 0), F(e.target.value);
19
- }, [L]), Y = c(() => {
20
- N.current?.focus(), L(P.length > 0);
21
- }, [
22
- N,
23
- P,
24
- L
25
- ]), X = c((e) => A?.(e), [A]), Z = c((e) => (t, n = !0) => {
18
+ })), Object.keys(S ?? {})), [U, S]), G = c(() => t(W.map(({ name: e }) => e), S ?? {}), [W, S]), K = c(() => n(C?.name.replace(/:.*/, ""), G), [C, G]), q = c(() => Object.values(ne(S ?? {}, x.split(" "))), [S, x]), J = c(() => a(M, q), [M, q]), Y = J.list.length + +!!J.creates, X = s((e) => {
19
+ L(!0), N(e.target.value), F(-1);
20
+ }, [L]), re = s(() => {
21
+ j.current?.focus(), L(!0);
22
+ }, [j, L]), Z = s((e) => O?.(e), [O]), ie = s((e) => (t, n = !0) => {
26
23
  let r = [...U.filter((t, n) => n !== e), t].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
27
- j?.(t, !1), k?.(r), n && A?.(t);
24
+ k?.(t, !1), D?.(r), n && O?.(t);
28
25
  }, [
29
26
  U,
30
- j,
31
27
  k,
32
- A
33
- ]), Q = c((e) => (t, n) => {
28
+ D,
29
+ O
30
+ ]), ae = s((e) => (t, n) => {
34
31
  switch (t) {
35
32
  case "remove":
36
33
  case "delete": {
37
34
  let n = U.filter((t, n) => n !== e), r = n.reduce((e, t) => `${e} ${t.name}`, "").trim();
38
- T && U[e].name === T.name && A?.(m(n, "0")), k?.(r), t === "delete" && M?.(U[e]);
35
+ C && U[e].name === C.name && O?.(p(n, "0")), D?.(r), t === "delete" && A?.(U[e]);
39
36
  break;
40
37
  }
41
38
  case "duplicate": {
42
39
  if (!n) break;
43
40
  let t = [...U, n].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
44
- j?.(n, !0, m(U, `${e}`)), k?.(t);
41
+ k?.(n, !0, p(U, `${e}`)), D?.(t);
45
42
  break;
46
43
  }
47
44
  }
48
45
  }, [
49
46
  U,
50
- T,
47
+ C,
48
+ D,
49
+ O,
50
+ k,
51
+ A
52
+ ]), Q = s((e) => {
53
+ setTimeout(() => N(""), 0), L(!1);
54
+ let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
55
+ D?.(t), O?.(e);
56
+ }, [
57
+ U,
58
+ D,
59
+ O,
60
+ L
61
+ ]), $ = s((e) => {
62
+ setTimeout(() => N(""), 0), L(!1);
63
+ let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
64
+ D?.(t), k?.(e, !1), O?.(e);
65
+ }, [
66
+ U,
67
+ D,
51
68
  k,
52
- A,
53
- j,
54
- M
55
- ]), $ = c((e) => {
69
+ O,
70
+ L
71
+ ]), oe = s((e) => {
56
72
  switch (e.key) {
57
73
  case "Enter": {
74
+ if (P >= 0) {
75
+ if (e.preventDefault(), J.creates && P === 0) $({
76
+ name: J.creates,
77
+ type: "class"
78
+ });
79
+ else {
80
+ let e = J.list.at(P - +!!J.creates);
81
+ e && Q(e);
82
+ }
83
+ F(-1);
84
+ break;
85
+ }
58
86
  let { value: t } = e.currentTarget;
59
87
  if (t !== "" && !U.find((e) => e.name === t)) {
60
- F("");
88
+ N("");
61
89
  let n = {
62
90
  name: r(t),
63
91
  type: "class"
64
92
  }, i = [...U, n].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
65
- j?.(n, !1), k?.(i), L(!1), e.currentTarget.blur(), A?.(n);
93
+ k?.(n, !1), D?.(i), L(!1), e.currentTarget.blur(), O?.(n);
66
94
  }
67
95
  setTimeout(() => {
68
- N.current?.focus();
96
+ j.current?.focus();
69
97
  }, 0);
70
98
  break;
71
99
  }
72
100
  case "ArrowUp":
73
- L(!1);
101
+ e.preventDefault(), F((e) => Math.max(e - 1, -1));
74
102
  break;
75
103
  case "ArrowDown":
76
- L(!0);
104
+ e.preventDefault(), L(!0), F((e) => Math.min(e + 1, Y - 1));
77
105
  break;
78
- case "Escape": e.stopPropagation(), F(""), e.currentTarget.blur();
106
+ case "Escape": e.stopPropagation(), N(""), F(-1), L(!1), e.currentTarget.blur();
79
107
  }
80
- }, [
81
- U,
82
- j,
83
- k,
84
- A,
85
- L
86
- ]), ee = c((e) => {
87
- setTimeout(() => F(""), 0), L(!1);
88
- let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
89
- k?.(t), A?.(e);
90
108
  }, [
91
109
  U,
92
110
  k,
93
- A,
94
- L
95
- ]), te = c((e) => {
96
- setTimeout(() => F(""), 0), L(!1);
97
- let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
98
- k?.(t), j?.(e, !1), A?.(e);
99
- }, [
100
- U,
101
- k,
102
- j,
103
- A,
104
- L
105
- ]), ne = c((e) => {
106
- e.preventDefault(), e.stopPropagation(), B("styleManager") || V("styleManager", /* @__PURE__ */ f(o, {}), {
107
- icon: /* @__PURE__ */ f("i", { className: "fas fa-swatchbook text-base" }),
111
+ D,
112
+ O,
113
+ L,
114
+ P,
115
+ J,
116
+ Y,
117
+ $,
118
+ Q
119
+ ]), se = s((e) => {
120
+ e.preventDefault(), e.stopPropagation(), B("styleManager") || V("styleManager", /* @__PURE__ */ d(te, {}), {
121
+ icon: /* @__PURE__ */ d("i", { className: "fas fa-swatchbook text-base" }),
108
122
  title: "Style Manager",
109
123
  resizeHandles: ["se"],
110
124
  allowLeftSide: !0,
@@ -113,80 +127,86 @@ var S = "Classes apply left to right, in the order the stylesheet lists them: wh
113
127
  width: 720,
114
128
  height: 640
115
129
  });
116
- }, [V, B]), re = l(() => ({ width: z?.width }), [z]);
117
- return /* @__PURE__ */ p("div", {
130
+ }, [V, B]), ce = c(() => ({ width: z?.width }), [z]);
131
+ return /* @__PURE__ */ f("div", {
118
132
  className: "flex w-full min-w-0 flex-col gap-1",
119
- children: [/* @__PURE__ */ p(y, {
133
+ children: [/* @__PURE__ */ f(_, {
120
134
  ref: R,
121
135
  className: "w-full",
122
136
  open: I,
123
- children: [/* @__PURE__ */ f(y.Trigger, {
137
+ children: [/* @__PURE__ */ d(_.Trigger, {
124
138
  className: "w-full",
125
- children: /* @__PURE__ */ p("div", {
126
- className: v("bg-grayviolet-200 relative flex flex-wrap gap-1 rounded-sm p-1 dark:bg-zinc-800", s, {
127
- "pointer-events-none cursor-not-allowed bg-gray-100 dark:bg-zinc-900": O,
128
- "cursor-pointer": !O
139
+ children: /* @__PURE__ */ f("div", {
140
+ className: g("bg-ui-panel relative flex min-h-8 items-center gap-1 rounded-md border py-1 pr-1 pl-1", o, {
141
+ "border-ui-line pointer-events-none cursor-not-allowed opacity-60": E,
142
+ "focus-within:border-primary-500 focus-within:ring-primary-500/20 border-ui-line-strong cursor-text focus-within:ring-2": !E
129
143
  }),
130
- onClick: Y,
131
- onKeyDown: $,
132
- children: [
133
- /* @__PURE__ */ f(_, {
134
- intent: "secondary",
135
- size: "custom",
136
- onClick: ne,
137
- className: "h-7 w-7 rounded-sm bg-white dark:bg-zinc-700 dark:text-zinc-200",
138
- title: "Style Manager",
139
- children: /* @__PURE__ */ f(_.Icon, { icon: "fas fa-swatchbook" })
140
- }),
141
- H && /* @__PURE__ */ f(i, {
142
- selector: H.name,
143
- type: H.type,
144
- editable: !1,
145
- active: H.name === T?.name.replace(/:.*/, ""),
146
- onClick: X
147
- }),
148
- W.map(({ position: e, ...t }) => /* @__PURE__ */ f(i, {
149
- selector: t.name,
150
- label: D?.[t.name],
151
- type: t.type,
152
- editable: t.type !== "element",
153
- active: t.name === T?.name.replace(/:.*/, ""),
154
- onAction: Q(e),
155
- onClick: X,
156
- onChange: Z(e)
157
- }, `${e}_${t.name}`)),
158
- /* @__PURE__ */ f("input", {
159
- ref: N,
160
- className: "flex min-h-0 w-0 border-none bg-transparent px-1 py-0 text-xs text-inherit outline-hidden focus:min-w-[50px] focus:grow focus:ring-transparent",
161
- autoComplete: "off",
162
- autoCorrect: "off",
163
- autoCapitalize: "off",
164
- spellCheck: "false",
165
- value: P,
166
- onChange: J
167
- })
168
- ]
144
+ onClick: re,
145
+ onKeyDown: oe,
146
+ children: [/* @__PURE__ */ f("div", {
147
+ className: "flex min-w-0 grow flex-wrap items-center gap-1",
148
+ children: [
149
+ H && /* @__PURE__ */ d(i, {
150
+ selector: H.name,
151
+ type: H.type,
152
+ editable: !1,
153
+ active: H.name === C?.name.replace(/:.*/, ""),
154
+ onClick: Z
155
+ }),
156
+ W.map(({ position: e, ...t }) => /* @__PURE__ */ d(i, {
157
+ selector: t.name,
158
+ label: T?.[t.name],
159
+ type: t.type,
160
+ editable: t.type !== "element",
161
+ active: t.name === C?.name.replace(/:.*/, ""),
162
+ onAction: ae(e),
163
+ onClick: Z,
164
+ onChange: ie(e)
165
+ }, `${e}_${t.name}`)),
166
+ /* @__PURE__ */ d("input", {
167
+ ref: j,
168
+ className: "placeholder:text-ui-fg-subtle min-w-20 grow basis-0 border-none bg-transparent px-1 py-0.5 text-xs text-inherit outline-hidden focus:ring-transparent",
169
+ placeholder: W.length > 0 ? "Add class…" : "Add a class to style it…",
170
+ "aria-label": "Add a class",
171
+ "aria-expanded": I,
172
+ "aria-autocomplete": "list",
173
+ autoComplete: "off",
174
+ autoCorrect: "off",
175
+ autoCapitalize: "off",
176
+ spellCheck: "false",
177
+ value: M,
178
+ onChange: X
179
+ })
180
+ ]
181
+ }), /* @__PURE__ */ d(h, {
182
+ intent: "secondary",
183
+ size: "custom",
184
+ onClick: se,
185
+ className: "text-ui-fg-subtle hover:bg-ui-hover hover:text-ui-fg h-6 w-6 shrink-0 self-start rounded bg-transparent dark:bg-transparent",
186
+ title: "Open the Style Manager: every class and element default of the space",
187
+ children: /* @__PURE__ */ d(h.Icon, { icon: "fas fa-swatchbook" })
188
+ })]
169
189
  })
170
- }), /* @__PURE__ */ f(y.Content, {
171
- style: re,
172
- children: /* @__PURE__ */ f(a, {
173
- selector: P,
174
- selectors: q,
175
- onSelect: ee,
176
- onCreate: te
190
+ }), /* @__PURE__ */ d(_.Content, {
191
+ style: ce,
192
+ children: /* @__PURE__ */ d(ee, {
193
+ suggestions: J,
194
+ highlighted: P,
195
+ onSelect: Q,
196
+ onCreate: $
177
197
  })
178
198
  })]
179
- }), W.length > 1 && /* @__PURE__ */ p("div", {
180
- className: "flex min-w-0 items-center gap-1.5 px-1 text-[11px] text-gray-500 dark:text-zinc-400",
181
- title: K ?? S,
182
- children: [/* @__PURE__ */ f("i", {
199
+ }), W.length > 1 && /* @__PURE__ */ f("div", {
200
+ className: "text-ui-fg-subtle flex min-w-0 items-center gap-1.5 px-1 text-[11px]",
201
+ title: K ?? b,
202
+ children: [/* @__PURE__ */ d("i", {
183
203
  className: "fas fa-circle-info shrink-0",
184
- title: S
185
- }), /* @__PURE__ */ f("span", {
204
+ title: b
205
+ }), /* @__PURE__ */ d("span", {
186
206
  className: "truncate",
187
207
  children: K ?? "Left to right: the class further right wins where they overlap"
188
208
  })]
189
209
  })]
190
210
  });
191
211
  });
192
- export { C as default };
212
+ export { x as default };
@@ -26,11 +26,12 @@ var l = ({ selector: l = "", type: u = "class", onAction: d }) => {
26
26
  ]);
27
27
  return /* @__PURE__ */ r(a, { children: [/* @__PURE__ */ n(a.Trigger, { children: /* @__PURE__ */ n(o, {
28
28
  icon: "fa-solid fa-ellipsis-vertical",
29
- className: "h-4 w-4 !min-w-4"
29
+ className: "h-4 w-3 !min-w-3 rounded-sm opacity-70 hover:opacity-100",
30
+ title: "Class actions: duplicate, remove, delete"
30
31
  }) }), /* @__PURE__ */ n(a.Content, {
31
- className: "text-xs text-zinc-700 dark:text-zinc-300",
32
+ className: "text-ui-fg text-xs",
32
33
  children: /* @__PURE__ */ n("div", {
33
- className: "min-w-44 rounded-md border border-gray-200 bg-white p-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-800",
34
+ className: "border-ui-line bg-ui-overlay min-w-44 rounded-md border p-1 shadow-lg",
34
35
  children: /* @__PURE__ */ r("ul", {
35
36
  className: "m-0 flex list-none flex-col p-0",
36
37
  children: [
@@ -23,29 +23,39 @@ var c = ({ className: c = "", selector: l = "", label: u, type: d = "class", edi
23
23
  });
24
24
  }, [d, g]);
25
25
  return /* @__PURE__ */ a("div", {
26
- className: o("relative flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 select-none", c, {
27
- "bg-primary-600 text-white": d !== "element" && p,
28
- "bg-primary-500/20 text-primary-800 dark:text-primary-200": d === "element" && p,
29
- "bg-gray-200 text-zinc-700 hover:bg-gray-300 dark:bg-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-600": !p,
26
+ className: o("relative flex h-6 cursor-pointer items-center gap-1 rounded px-1.5 select-none", c, {
27
+ "bg-primary-600 text-white shadow-sm": d !== "element" && p,
28
+ "bg-primary-500/15 text-primary-800 ring-primary-500/40 dark:text-primary-200 ring-1": d === "element" && p,
29
+ "bg-ui-raised text-ui-fg ring-ui-line hover:bg-ui-hover ring-1": !p,
30
30
  "max-w-full min-w-0": !f
31
31
  }),
32
32
  onClick: v,
33
33
  title: `${d}: ${l}`,
34
- children: [/* @__PURE__ */ a("div", {
35
- className: "flex min-w-0 grow basis-0 text-xs",
36
- children: [f && /* @__PURE__ */ i(s, {
37
- className: "inline text-nowrap focus-visible:m-[1px] focus-visible:px-1 focus-visible:outline-1 focus-visible:outline-dashed",
38
- value: x,
39
- openMode: "doubleClick",
40
- onChange: w,
41
- onEditOpen: S,
42
- onEditClose: C
43
- }), !f && x]
44
- }), f && d !== "element" && /* @__PURE__ */ i(t, {
45
- selector: l,
46
- type: d,
47
- onAction: _
48
- })]
34
+ children: [
35
+ d === "element" && /* @__PURE__ */ i("i", {
36
+ className: "fa-solid fa-cube text-[9px] opacity-70",
37
+ "aria-hidden": !0
38
+ }),
39
+ /* @__PURE__ */ a("div", {
40
+ className: "flex min-w-0 grow basis-0 font-mono text-[11px]",
41
+ children: [f && /* @__PURE__ */ i(s, {
42
+ className: "inline text-nowrap focus-visible:m-[1px] focus-visible:px-1 focus-visible:outline-1 focus-visible:outline-dashed",
43
+ value: x,
44
+ openMode: "doubleClick",
45
+ onChange: w,
46
+ onEditOpen: S,
47
+ onEditClose: C
48
+ }), !f && /* @__PURE__ */ i("span", {
49
+ className: "truncate",
50
+ children: x
51
+ })]
52
+ }),
53
+ f && d !== "element" && /* @__PURE__ */ i(t, {
54
+ selector: l,
55
+ type: d,
56
+ onAction: _
57
+ })
58
+ ]
49
59
  });
50
60
  };
51
61
  export { c as default };
@@ -1,2 +1,2 @@
1
1
  /** An entry of a class's actions menu: a full-width button, highlighted under the pointer and the keyboard alike. */
2
- export declare const ITEM_CLASS = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:outline-none dark:hover:bg-zinc-700 dark:focus-visible:bg-zinc-700";
2
+ export declare const ITEM_CLASS = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-ui-hover focus-visible:bg-ui-hover focus-visible:outline-none";
@@ -1,3 +1,3 @@
1
1
  // src/builder/components/Selector/SelectorItem/helpers.ts
2
- var e = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:outline-none dark:hover:bg-zinc-700 dark:focus-visible:bg-zinc-700";
2
+ var e = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-ui-hover focus-visible:bg-ui-hover focus-visible:outline-none";
3
3
  export { e as ITEM_CLASS };
@@ -1,9 +1,12 @@
1
+ import { Suggestions } from './helpers';
1
2
  import { SelectorValue } from '../Selector';
2
3
  export type SelectorSuggestionsProps = {
3
- selector?: string;
4
+ suggestions: Suggestions;
5
+ /** The option the keys are on: 0 is the class to create when there is one, then the list. */
6
+ highlighted?: number;
4
7
  onSelect?: (tag: SelectorValue) => void;
5
8
  onCreate?: (tag: SelectorValue) => void;
6
- selectors?: SelectorValue[];
7
9
  };
8
- declare const SelectorSuggestions: ({ onSelect, onCreate, selector, selectors }: SelectorSuggestionsProps) => import('react').JSX.Element;
10
+ /** The classes to add, filtered by what is typed, and the one to create when nothing has that name. */
11
+ declare const SelectorSuggestions: ({ suggestions, highlighted, onSelect, onCreate }: SelectorSuggestionsProps) => import('react').JSX.Element;
9
12
  export default SelectorSuggestions;