@directus/themes 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,13 +112,17 @@ export declare const useTheme: (darkMode: MaybeRef<boolean>, themeLight: MaybeRe
112
112
  title: {
113
113
  foreground: string;
114
114
  fontFamily: string;
115
+ fontWeight: string;
115
116
  };
116
117
  };
117
118
  form: {
119
+ columnGap: string;
120
+ rowGap: string;
118
121
  field: {
119
122
  label: {
120
123
  foreground: string;
121
124
  fontFamily: string;
125
+ fontWeight: string;
122
126
  };
123
127
  input: {
124
128
  background: string;
@@ -132,6 +136,7 @@ export declare const useTheme: (darkMode: MaybeRef<boolean>, themeLight: MaybeRe
132
136
  boxShadowHover: string;
133
137
  boxShadowFocus: string;
134
138
  height: string;
139
+ padding: string;
135
140
  };
136
141
  };
137
142
  };
@@ -177,6 +182,7 @@ export declare const useTheme: (darkMode: MaybeRef<boolean>, themeLight: MaybeRe
177
182
  boxShadowHover: string;
178
183
  boxShadowFocus: string;
179
184
  height: string;
185
+ padding: string;
180
186
  };
181
187
  };
182
188
  };
@@ -211,6 +217,7 @@ export declare const useTheme: (darkMode: MaybeRef<boolean>, themeLight: MaybeRe
211
217
  boxShadowHover: string;
212
218
  boxShadowFocus: string;
213
219
  height: string;
220
+ padding: string;
214
221
  };
215
222
  };
216
223
  };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { computed as v, unref as i, reactive as B, defineComponent as $, toRefs as D, openBlock as T, createBlock as L, Teleport as G, createTextVNode as N, toDisplayString as M } from "vue";
1
+ import { computed as v, unref as i, reactive as B, defineComponent as $, toRefs as D, openBlock as G, createBlock as T, Teleport as L, createTextVNode as N, toDisplayString as M } from "vue";
2
2
  import { useHead as E } from "@unhead/vue";
3
- import { get as W, merge as S, mapKeys as U } from "lodash-es";
3
+ import { get as W, merge as w, mapKeys as U } from "lodash-es";
4
4
  import { defineStore as _, storeToRefs as I } from "pinia";
5
5
  import P from "decamelize";
6
6
  import { flatten as V } from "flat";
@@ -8,7 +8,7 @@ import { cssVar as z } from "@directus/utils/browser";
8
8
  import { Type as r } from "@sinclair/typebox";
9
9
  const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r.String({ $id: "FontWeight" }), k = r.String({ $id: "Length" }), O = r.String({ $id: "Percentage" }), y = r.String({ $id: "BoxShadow" }), j = r.String({ $id: "Number" }), H = r.String({ $id: "Size" }), b = r.Union([r.String(), r.Literal("thin"), r.Literal("medium"), r.Literal("thick")], {
10
10
  $id: "LineWidth"
11
- }), w = r.Optional(
11
+ }), S = r.Optional(
12
12
  r.Object({
13
13
  columnGap: r.Optional(r.Union([r.Ref(k), r.Ref(O)])),
14
14
  rowGap: r.Optional(r.Union([r.Ref(k), r.Ref(O)])),
@@ -186,7 +186,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
186
186
  )
187
187
  })
188
188
  ),
189
- form: w,
189
+ form: S,
190
190
  sidebar: r.Optional(
191
191
  r.Object({
192
192
  background: r.Optional(r.Ref(e)),
@@ -216,7 +216,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
216
216
  borderColor: r.Optional(r.Ref(e))
217
217
  })
218
218
  ),
219
- form: w
219
+ form: S
220
220
  })
221
221
  )
222
222
  })
@@ -234,7 +234,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
234
234
  speed: r.Optional(r.Ref(j))
235
235
  })
236
236
  ),
237
- form: w
237
+ form: S
238
238
  })
239
239
  ),
240
240
  popover: r.Optional(
@@ -409,14 +409,18 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
409
409
  },
410
410
  title: {
411
411
  foreground: "var(--theme--foreground-accent)",
412
- fontFamily: "var(--theme--fonts--display--font-family)"
412
+ fontFamily: "var(--theme--fonts--display--font-family)",
413
+ fontWeight: "var(--theme--fonts--display--font-weight)"
413
414
  }
414
415
  },
415
416
  form: {
417
+ columnGap: "32px",
418
+ rowGap: "40px",
416
419
  field: {
417
420
  label: {
418
421
  foreground: "var(--theme--foreground-accent)",
419
- fontFamily: "var(--theme--fonts--sans--font-family)"
422
+ fontFamily: "var(--theme--fonts--sans--font-family)",
423
+ fontWeight: "600"
420
424
  },
421
425
  input: {
422
426
  background: "var(--theme--background)",
@@ -429,7 +433,8 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
429
433
  boxShadow: "none",
430
434
  boxShadowHover: "none",
431
435
  boxShadowFocus: "0 0 16px -8px var(--theme--primary)",
432
- height: "60px"
436
+ height: "60px",
437
+ padding: "16px"
433
438
  }
434
439
  }
435
440
  },
@@ -474,7 +479,8 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
474
479
  boxShadow: "var(--theme--form--field--input--box-shadow)",
475
480
  boxShadowHover: "var(--theme--form--field--input--box-shadow-hover)",
476
481
  boxShadowFocus: "var(--theme--form--field--input--box-shadow-focus)",
477
- height: "52px"
482
+ height: "52px",
483
+ padding: "12px"
478
484
  }
479
485
  }
480
486
  }
@@ -508,7 +514,8 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
508
514
  boxShadow: "var(--theme--form--field--input--box-shadow)",
509
515
  boxShadowHover: "var(--theme--form--field--input--box-shadow-hover)",
510
516
  boxShadowFocus: "var(--theme--form--field--input--box-shadow-focus)",
511
- height: "var(--theme--form--field--input--height)"
517
+ height: "var(--theme--form--field--input--height)",
518
+ padding: "var(--theme--form--field--input--padding)"
512
519
  }
513
520
  }
514
521
  }
@@ -696,7 +703,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
696
703
  background: "transparent",
697
704
  backgroundHover: "var(--theme--navigation--background-accent)",
698
705
  backgroundActive: "var(--theme--navigation--background-accent)",
699
- fontFamily: "var(--theme--font-family-sans-serif)",
706
+ fontFamily: "var(--theme--fonts--sans--font-family)",
700
707
  divider: {
701
708
  borderColor: "var(--theme--border-color-accent)",
702
709
  borderWidth: "var(--theme--border-width)"
@@ -710,7 +717,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
710
717
  boxShadow: "0 4px 7px -4px rgb(0 0 0 / 0.2)",
711
718
  headline: {
712
719
  foreground: "var(--theme--foreground-subdued)",
713
- fontFamily: "var(--theme--font-family-sans-serif)"
720
+ fontFamily: "var(--theme--fonts--sans--font-family)"
714
721
  },
715
722
  title: {
716
723
  foreground: "var(--theme--foreground-accent)",
@@ -724,7 +731,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
724
731
  field: {
725
732
  label: {
726
733
  foreground: "var(--theme--foreground-accent)",
727
- fontFamily: "var(--theme--font-family-sans-serif)",
734
+ fontFamily: "var(--theme--fonts--sans--font-family)",
728
735
  fontWeight: "600"
729
736
  },
730
737
  input: {
@@ -746,7 +753,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
746
753
  sidebar: {
747
754
  background: "var(--theme--background-normal)",
748
755
  foreground: "var(--theme--foreground-subdued)",
749
- fontFamily: "var(--theme--font-family-sans-serif)",
756
+ fontFamily: "var(--theme--fonts--sans--font-family)",
750
757
  borderColor: "transparent",
751
758
  borderWidth: "0px",
752
759
  section: {
@@ -762,7 +769,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
762
769
  background: "var(--theme--background-accent)",
763
770
  backgroundHover: "var(--theme--sidebar--section--toggle--background)",
764
771
  backgroundActive: "var(--theme--sidebar--section--toggle--background)",
765
- fontFamily: "var(--theme--font-family-sans-serif)",
772
+ fontFamily: "var(--theme--fonts--sans--font-family)",
766
773
  borderColor: "transparent",
767
774
  borderWidth: "0px"
768
775
  },
@@ -925,7 +932,6 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
925
932
  }
926
933
  }
927
934
  },
928
- fontFamilyDisplay: "system-ui",
929
935
  public: {
930
936
  art: {
931
937
  background: "color-mix(in srgb, #FFFFFF, var(--project-color) 10%)",
@@ -942,7 +948,12 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
942
948
  primaryAccent: "#E2E8F0",
943
949
  secondaryAccent: "#E2E8F0",
944
950
  secondaryBackground: "#F1F5F9",
945
- secondarySubdued: "#F8FAFC"
951
+ secondarySubdued: "#F8FAFC",
952
+ fonts: {
953
+ display: {
954
+ fontFamily: "system-ui"
955
+ }
956
+ }
946
957
  }
947
958
  }), Y = [A], Z = [C, X, J], rr = _("🎨 Themes", () => {
948
959
  const d = B({ light: Z, dark: Y });
@@ -953,7 +964,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
953
964
  const { themes: c } = I(rr());
954
965
  return { theme: v(() => {
955
966
  const a = i(d) ? i(f) : i(s), t = i(d) ? A : C, n = i(d) ? i(o) : i(p), h = i(c)[i(d) ? "dark" : "light"].find((l) => l.name === a);
956
- return h ? n ? S({}, t, h, { rules: n }) : S(t, h) : (a && a !== t.name && console.warn(`Theme "${a}" doesn't exist.`), n ? S({}, t, { rules: n }) : t);
967
+ return h ? n ? w({}, t, h, { rules: n }) : w(t, h) : (a && a !== t.name && console.warn(`Theme "${a}" doesn't exist.`), n ? w({}, t, { rules: n }) : t);
957
968
  }) };
958
969
  }, or = (d) => {
959
970
  const s = V(d, { delimiter: "--" }), f = (p) => `--theme--${P(p, { separator: "-" })}`;
@@ -986,7 +997,7 @@ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r
986
997
  })
987
998
  });
988
999
  const h = v(() => `:root {${Object.entries(i(t)).map(([g, x]) => `${g}: ${x};`).join(" ")}}`);
989
- return (l, g) => (T(), L(G, { to: "#theme" }, [
1000
+ return (l, g) => (G(), T(L, { to: "#theme" }, [
990
1001
  N(M(h.value), 1)
991
1002
  ]));
992
1003
  }
@@ -108,13 +108,17 @@ declare const _default: {
108
108
  title: {
109
109
  foreground: string;
110
110
  fontFamily: string;
111
+ fontWeight: string;
111
112
  };
112
113
  };
113
114
  form: {
115
+ columnGap: string;
116
+ rowGap: string;
114
117
  field: {
115
118
  label: {
116
119
  foreground: string;
117
120
  fontFamily: string;
121
+ fontWeight: string;
118
122
  };
119
123
  input: {
120
124
  background: string;
@@ -128,6 +132,7 @@ declare const _default: {
128
132
  boxShadowHover: string;
129
133
  boxShadowFocus: string;
130
134
  height: string;
135
+ padding: string;
131
136
  };
132
137
  };
133
138
  };
@@ -173,6 +178,7 @@ declare const _default: {
173
178
  boxShadowHover: string;
174
179
  boxShadowFocus: string;
175
180
  height: string;
181
+ padding: string;
176
182
  };
177
183
  };
178
184
  };
@@ -207,6 +213,7 @@ declare const _default: {
207
213
  boxShadowHover: string;
208
214
  boxShadowFocus: string;
209
215
  height: string;
216
+ padding: string;
210
217
  };
211
218
  };
212
219
  };
@@ -90,7 +90,6 @@ declare const _default: {
90
90
  };
91
91
  };
92
92
  };
93
- fontFamilyDisplay: string;
94
93
  public: {
95
94
  art: {
96
95
  background: string;
@@ -108,6 +107,11 @@ declare const _default: {
108
107
  secondaryAccent: string;
109
108
  secondaryBackground: string;
110
109
  secondarySubdued: string;
110
+ fonts: {
111
+ display: {
112
+ fontFamily: string;
113
+ };
114
+ };
111
115
  };
112
116
  };
113
117
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/themes",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Themes for Directus",
5
5
  "homepage": "https://directus.io",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "typescript": "5.2.2",
37
37
  "vite": "4.4.11",
38
38
  "vite-plugin-dts": "3.6.0",
39
- "@directus/types": "11.0.2",
40
- "@directus/tsconfig": "1.0.1"
39
+ "@directus/tsconfig": "1.0.1",
40
+ "@directus/types": "11.0.2"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "pinia": "2.1.7",