rimelight-components 2.1.17 → 2.1.18

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 (126) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/app/Footer.d.vue.ts +5 -1
  4. package/dist/runtime/components/app/Footer.vue +20 -12
  5. package/dist/runtime/components/app/Footer.vue.d.ts +5 -1
  6. package/dist/runtime/components/app/Header.d.vue.ts +5 -1
  7. package/dist/runtime/components/app/Header.vue +4 -2
  8. package/dist/runtime/components/app/Header.vue.d.ts +5 -1
  9. package/dist/runtime/components/app/HeaderLayer.d.vue.ts +5 -3
  10. package/dist/runtime/components/app/HeaderLayer.vue +11 -2
  11. package/dist/runtime/components/app/HeaderLayer.vue.d.ts +5 -3
  12. package/dist/runtime/components/app/Image.d.vue.ts +6 -4
  13. package/dist/runtime/components/app/Image.vue +27 -12
  14. package/dist/runtime/components/app/Image.vue.d.ts +6 -4
  15. package/dist/runtime/components/app/Logo.d.vue.ts +5 -3
  16. package/dist/runtime/components/app/Logo.vue +9 -1
  17. package/dist/runtime/components/app/Logo.vue.d.ts +5 -3
  18. package/dist/runtime/components/app/NewsletterSignup.d.vue.ts +5 -3
  19. package/dist/runtime/components/app/NewsletterSignup.vue +9 -1
  20. package/dist/runtime/components/app/NewsletterSignup.vue.d.ts +5 -3
  21. package/dist/runtime/components/app/ScrollToTop.d.vue.ts +4 -2
  22. package/dist/runtime/components/app/ScrollToTop.vue +17 -9
  23. package/dist/runtime/components/app/ScrollToTop.vue.d.ts +4 -2
  24. package/dist/runtime/components/blocks/Block.d.vue.ts +5 -3
  25. package/dist/runtime/components/blocks/Block.vue +16 -7
  26. package/dist/runtime/components/blocks/Block.vue.d.ts +5 -3
  27. package/dist/runtime/components/blocks/BlockEditRenderer.d.vue.ts +5 -3
  28. package/dist/runtime/components/blocks/BlockEditRenderer.vue +9 -1
  29. package/dist/runtime/components/blocks/BlockEditRenderer.vue.d.ts +5 -3
  30. package/dist/runtime/components/blocks/BlockEditor.vue +4 -33
  31. package/dist/runtime/components/blocks/BlockViewRenderer.d.vue.ts +5 -3
  32. package/dist/runtime/components/blocks/BlockViewRenderer.vue +9 -1
  33. package/dist/runtime/components/blocks/BlockViewRenderer.vue.d.ts +5 -3
  34. package/dist/runtime/components/blocks/TextRenderer.d.vue.ts +5 -3
  35. package/dist/runtime/components/blocks/TextRenderer.vue +8 -0
  36. package/dist/runtime/components/blocks/TextRenderer.vue.d.ts +5 -3
  37. package/dist/runtime/components/blocks/editor/CalloutBlockEditor.d.vue.ts +5 -1
  38. package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +8 -0
  39. package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +5 -1
  40. package/dist/runtime/components/blocks/editor/CardBlockEditor.d.vue.ts +5 -1
  41. package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +9 -1
  42. package/dist/runtime/components/blocks/editor/CardBlockEditor.vue.d.ts +5 -1
  43. package/dist/runtime/components/blocks/editor/ImageBlockEditor.d.vue.ts +11 -3
  44. package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +21 -9
  45. package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue.d.ts +11 -3
  46. package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +5 -3
  47. package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +11 -7
  48. package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +5 -3
  49. package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +5 -3
  50. package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +15 -5
  51. package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +5 -3
  52. package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +5 -3
  53. package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +11 -3
  54. package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +5 -3
  55. package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.d.vue.ts +5 -1
  56. package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +8 -0
  57. package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue.d.ts +5 -1
  58. package/dist/runtime/components/blocks/renderer/CardBlockRenderer.d.vue.ts +5 -1
  59. package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +9 -1
  60. package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue.d.ts +5 -1
  61. package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.d.vue.ts +5 -1
  62. package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue +13 -3
  63. package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue.d.ts +5 -1
  64. package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.d.vue.ts +5 -1
  65. package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +8 -0
  66. package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue.d.ts +5 -1
  67. package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.d.vue.ts +5 -1
  68. package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +8 -0
  69. package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue.d.ts +5 -1
  70. package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +5 -1
  71. package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +8 -0
  72. package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +5 -1
  73. package/dist/runtime/components/cards/TeamCard.d.vue.ts +5 -3
  74. package/dist/runtime/components/cards/TeamCard.vue +24 -6
  75. package/dist/runtime/components/cards/TeamCard.vue.d.ts +5 -3
  76. package/dist/runtime/components/content/Callout.d.vue.ts +5 -3
  77. package/dist/runtime/components/content/Callout.vue +11 -2
  78. package/dist/runtime/components/content/Callout.vue.d.ts +5 -3
  79. package/dist/runtime/components/content/Section.d.vue.ts +5 -3
  80. package/dist/runtime/components/content/Section.vue +87 -86
  81. package/dist/runtime/components/content/Section.vue.d.ts +5 -3
  82. package/dist/runtime/components/content/Test.d.vue.ts +5 -3
  83. package/dist/runtime/components/content/Test.vue +9 -1
  84. package/dist/runtime/components/content/Test.vue.d.ts +5 -3
  85. package/dist/runtime/components/nodes/LinkNode.d.vue.ts +5 -3
  86. package/dist/runtime/components/nodes/LinkNode.vue +11 -1
  87. package/dist/runtime/components/nodes/LinkNode.vue.d.ts +5 -3
  88. package/dist/runtime/components/nodes/TextNode.d.vue.ts +5 -3
  89. package/dist/runtime/components/nodes/TextNode.vue +9 -1
  90. package/dist/runtime/components/nodes/TextNode.vue.d.ts +5 -3
  91. package/dist/runtime/components/page/PageEditor.d.vue.ts +4 -1
  92. package/dist/runtime/components/page/PageEditor.vue +65 -28
  93. package/dist/runtime/components/page/PageEditor.vue.d.ts +4 -1
  94. package/dist/runtime/components/page/PageMention.d.vue.ts +3 -1
  95. package/dist/runtime/components/page/PageMention.vue +15 -4
  96. package/dist/runtime/components/page/PageMention.vue.d.ts +3 -1
  97. package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +8 -2
  98. package/dist/runtime/components/page/PagePropertiesEditor.vue +50 -17
  99. package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +8 -2
  100. package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +8 -2
  101. package/dist/runtime/components/page/PagePropertiesRenderer.vue +67 -20
  102. package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +8 -2
  103. package/dist/runtime/components/page/PageRenderer.d.vue.ts +3 -1
  104. package/dist/runtime/components/page/PageRenderer.vue +50 -16
  105. package/dist/runtime/components/page/PageRenderer.vue.d.ts +3 -1
  106. package/dist/runtime/components/page/PageSurround.d.vue.ts +5 -3
  107. package/dist/runtime/components/page/PageSurround.vue +54 -24
  108. package/dist/runtime/components/page/PageSurround.vue.d.ts +5 -3
  109. package/dist/runtime/components/page/PageTOC.d.vue.ts +5 -3
  110. package/dist/runtime/components/page/PageTOC.vue +17 -7
  111. package/dist/runtime/components/page/PageTOC.vue.d.ts +5 -3
  112. package/dist/runtime/components/page/modals/CreatePageModal.vue +27 -21
  113. package/dist/runtime/components/page/modals/DeletePageModal.vue +23 -6
  114. package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +5 -3
  115. package/dist/runtime/components/swatches/ColorSwatch.vue +25 -11
  116. package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +5 -3
  117. package/dist/runtime/components/swatches/FontSwatch.d.vue.ts +5 -3
  118. package/dist/runtime/components/swatches/FontSwatch.vue +23 -10
  119. package/dist/runtime/components/swatches/FontSwatch.vue.d.ts +5 -3
  120. package/dist/runtime/components/swatches/ImageSwatch.d.vue.ts +5 -3
  121. package/dist/runtime/components/swatches/ImageSwatch.vue +23 -10
  122. package/dist/runtime/components/swatches/ImageSwatch.vue.d.ts +5 -3
  123. package/dist/runtime/components/utilities/Placeholder.d.vue.ts +5 -1
  124. package/dist/runtime/components/utilities/Placeholder.vue +14 -5
  125. package/dist/runtime/components/utilities/Placeholder.vue.d.ts +5 -1
  126. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
+ import { tv } from "tailwind-variants";
2
3
  import { useI18n } from "vue-i18n";
3
- const { t } = useI18n();
4
4
  const {
5
5
  pageType,
6
6
  previousTitle,
@@ -18,33 +18,66 @@ const {
18
18
  nextDescription: { type: String, required: false },
19
19
  nextTo: { type: String, required: false }
20
20
  });
21
+ const emit = defineEmits([]);
22
+ const pageSurroundStyles = tv({
23
+ slots: {
24
+ grid: "grid grid-cols-1 gap-8 sm:grid-cols-2",
25
+ card: "group block h-full bg-transparent hover:bg-elevated/50 focus-visible:outline-primary",
26
+ cardContent: "flex flex-col gap-md",
27
+ cardContentEnd: "items-end",
28
+ headingGroup: "flex flex-col gap-xs",
29
+ headingGroupEnd: "items-end",
30
+ button: "w-fit text-md rounded-full text-primary group-hover:text-highlighted",
31
+ typeLabel: "text-muted",
32
+ infoGroup: "flex flex-col gap-sm",
33
+ infoGroupEnd: "items-end gap-xs",
34
+ title: "text-primary text-sm group-hover:text-highlighted",
35
+ titleEnd: "text-right",
36
+ description: "text-toned text-xs",
37
+ descriptionEnd: "text-right"
38
+ }
39
+ });
40
+ const {
41
+ grid,
42
+ card,
43
+ cardContent,
44
+ cardContentEnd,
45
+ headingGroup,
46
+ headingGroupEnd,
47
+ button,
48
+ typeLabel,
49
+ infoGroup,
50
+ infoGroupEnd,
51
+ title: titleClass,
52
+ titleEnd,
53
+ description: descriptionClass,
54
+ descriptionEnd
55
+ } = pageSurroundStyles();
56
+ const { t } = useI18n();
21
57
  </script>
22
58
 
23
59
  <template>
24
- <div class="grid grid-cols-1 gap-8 sm:grid-cols-2">
60
+ <div :class="grid()">
25
61
  <div>
26
62
  <ULink v-if="previousTitle" :to="previousTo" class="h-full">
27
- <UCard
28
- variant="soft"
29
- class="group block h-full bg-transparent hover:bg-elevated/50 focus-visible:outline-primary"
30
- >
31
- <div class="flex flex-col gap-md">
32
- <div class="flex flex-col gap-xs">
63
+ <UCard variant="soft" :class="card()">
64
+ <div :class="cardContent()">
65
+ <div :class="headingGroup()">
33
66
  <UButton
34
67
  variant="outline"
35
68
  icon="lucide:arrow-left"
36
- class="group-hover w-fit text-md rounded-full text-primary group-hover:text-highlighted"
69
+ :class="button()"
37
70
  />
38
- <span class="text-muted">
71
+ <span :class="typeLabel()">
39
72
  {{ t("navigation_previous") }}
40
73
  {{ t(pageType) }}
41
74
  </span>
42
75
  </div>
43
- <div class="flex flex-col gap-sm">
44
- <p class="text-primary text-sm group-hover:text-highlighted">
76
+ <div :class="infoGroup()">
77
+ <p :class="titleClass()">
45
78
  {{ previousTitle }}
46
79
  </p>
47
- <p class="text-toned text-xs">
80
+ <p :class="descriptionClass()">
48
81
  {{ previousDescription }}
49
82
  </p>
50
83
  </div>
@@ -54,27 +87,24 @@ const {
54
87
  </div>
55
88
  <div>
56
89
  <ULink v-if="nextTitle" :to="nextTo" class="h-full">
57
- <UCard
58
- variant="soft"
59
- class="group block h-full bg-transparent hover:bg-elevated/50 focus-visible:outline-primary"
60
- >
61
- <div class="flex flex-col items-end gap-md">
62
- <div class="flex flex-col items-end gap-xs">
90
+ <UCard variant="soft" :class="card()">
91
+ <div :class="[cardContent(), cardContentEnd()]">
92
+ <div :class="[headingGroup(), headingGroupEnd()]">
63
93
  <UButton
64
94
  variant="outline"
65
95
  icon="lucide:arrow-right"
66
- class="w-fit rounded-full text-primary text-md group-hover:text-highlighted"
96
+ :class="button()"
67
97
  />
68
- <span class="text-muted">
98
+ <span :class="typeLabel()">
69
99
  {{ t("navigation_next") }}
70
100
  {{ t(pageType) }}</span
71
101
  >
72
102
  </div>
73
- <div class="flex flex-col items-end gap-xs">
74
- <p class="text-right text-sm text-primary group-hover:text-highlighted">
103
+ <div :class="[infoGroup(), infoGroupEnd()]">
104
+ <p :class="[titleClass(), titleEnd()]">
75
105
  {{ nextTitle }}
76
106
  </p>
77
- <p class="text-right text-toned text-xs">
107
+ <p :class="[descriptionClass(), descriptionEnd()]">
78
108
  {{ nextDescription }}
79
109
  </p>
80
110
  </div>
@@ -1,4 +1,4 @@
1
- type __VLS_Props = {
1
+ export interface PageSurroundProps {
2
2
  pageType: string;
3
3
  previousTitle?: string;
4
4
  previousDescription?: string;
@@ -6,7 +6,9 @@ type __VLS_Props = {
6
6
  nextTitle?: string;
7
7
  nextDescription?: string;
8
8
  nextTo?: string;
9
- };
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ }
10
+ export interface PageSurroundEmits {
11
+ }
12
+ declare const __VLS_export: import("vue").DefineComponent<PageSurroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSurroundProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
13
  declare const _default: typeof __VLS_export;
12
14
  export default _default;
@@ -1,14 +1,16 @@
1
1
  import type { Block, HeadingLevel } from "../../types/index.js";
2
- type __VLS_Props = {
2
+ export interface PageTOCProps {
3
3
  pageBlocks: Block[] | null;
4
4
  title?: string;
5
5
  levels?: HeadingLevel[];
6
- };
6
+ }
7
+ export interface PageTOCEmits {
8
+ }
7
9
  declare var __VLS_7: {};
8
10
  type __VLS_Slots = {} & {
9
11
  bottom?: (props: typeof __VLS_7) => any;
10
12
  };
11
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
13
+ declare const __VLS_base: import("vue").DefineComponent<PageTOCProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageTOCProps> & Readonly<{}>, {
12
14
  title: string;
13
15
  levels: HeadingLevel[];
14
16
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -9,10 +9,11 @@ const props = defineProps({
9
9
  title: { type: String, required: false, default: "table_of_contents" },
10
10
  levels: { type: Array, required: false, default: () => [2, 3, 4] }
11
11
  });
12
- const { t } = useI18n();
13
- const activeId = ref(null);
14
- const tocVariants = tv({
12
+ const emit = defineEmits([]);
13
+ const pageTOCStyles = tv({
15
14
  slots: {
15
+ nav: "flex flex-col gap-sm w-full",
16
+ list: "flex flex-col",
16
17
  link: "group relative flex items-center px-3 py-1.5 text-sm transition-all duration-200 border-s-2 -ms-px",
17
18
  text: "truncate"
18
19
  },
@@ -35,6 +36,15 @@ const tocVariants = tv({
35
36
  }
36
37
  }
37
38
  });
39
+ const {
40
+ nav,
41
+ list,
42
+ link,
43
+ text
44
+ } = pageTOCStyles();
45
+ const { t } = useI18n();
46
+ const activeId = ref(null);
47
+ const { locale } = useI18n();
38
48
  const extractHeadings = (blocks) => {
39
49
  const headings = [];
40
50
  if (!blocks) return headings;
@@ -84,18 +94,18 @@ onMounted(() => {
84
94
  </script>
85
95
 
86
96
  <template>
87
- <nav class="flex flex-col gap-sm w-full" aria-label="Table of Contents">
97
+ <nav :class="nav()" aria-label="Table of Contents">
88
98
  <h5 v-if="title">
89
99
  {{ t(title) }}
90
100
  </h5>
91
101
 
92
- <ul v-if="items.length > 0" class="flex flex-col">
102
+ <ul v-if="items.length > 0" :class="list()">
93
103
  <li v-for="item in items" :key="item.id">
94
104
  <NuxtLink
95
105
  :to="{ hash: `#${item.id}` }"
96
- :class="tocVariants({ active: activeId === item.id, level: item.level }).link()"
106
+ :class="pageTOCStyles({ active: activeId === item.id, level: item.level }).link()"
97
107
  >
98
- <span :class="tocVariants().text()">
108
+ <span :class="text()">
99
109
  {{ item.title }}
100
110
  </span>
101
111
  </NuxtLink>
@@ -1,14 +1,16 @@
1
1
  import type { Block, HeadingLevel } from "../../types/index.js";
2
- type __VLS_Props = {
2
+ export interface PageTOCProps {
3
3
  pageBlocks: Block[] | null;
4
4
  title?: string;
5
5
  levels?: HeadingLevel[];
6
- };
6
+ }
7
+ export interface PageTOCEmits {
8
+ }
7
9
  declare var __VLS_7: {};
8
10
  type __VLS_Slots = {} & {
9
11
  bottom?: (props: typeof __VLS_7) => any;
10
12
  };
11
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
13
+ declare const __VLS_base: import("vue").DefineComponent<PageTOCProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageTOCProps> & Readonly<{}>, {
12
14
  title: string;
13
15
  levels: HeadingLevel[];
14
16
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -3,25 +3,31 @@ import { ref, computed, watch } from "vue";
3
3
  import {} from "../../../types";
4
4
  import { tv } from "tailwind-variants";
5
5
  import { useI18n } from "vue-i18n";
6
- const { t } = useI18n();
7
6
  const { isOpen, loading, definitions } = defineProps({
8
7
  isOpen: { type: Boolean, required: true },
9
8
  definitions: { type: Object, required: true },
10
9
  loading: { type: Boolean, required: false }
11
10
  });
12
- const emits = defineEmits(["close", "confirm"]);
11
+ const emit = defineEmits(["close", "confirm"]);
13
12
  const createPageModalStyles = tv({
14
13
  slots: {
15
- base: "flex flex-col gap-6",
16
- group: "border border-neutral-200 rounded-lg p-4 bg-white shadow-sm",
17
- groupTitle: "text-lg font-bold text-neutral-900 mb-4",
18
- field: "flex flex-col gap-1.5",
19
- label: "text-sm font-medium text-neutral-700",
20
- input: "w-full px-3 py-2 rounded-md border border-neutral-300 focus:ring-2 focus:ring-primary-500 transition-all outline-hidden",
21
- select: "w-full px-3 py-2 rounded-md border border-neutral-300 bg-white"
14
+ header: "flex items-center justify-between",
15
+ headerTitle: "text-base font-semibold leading-6",
16
+ closeButton: "-my-1",
17
+ body: "space-y-4 py-4",
18
+ field: "w-full",
19
+ footer: "flex justify-end gap-2"
22
20
  }
23
21
  });
24
- const styles = createPageModalStyles();
22
+ const {
23
+ header: headerClass,
24
+ headerTitle,
25
+ closeButton,
26
+ body,
27
+ field,
28
+ footer
29
+ } = createPageModalStyles();
30
+ const { t } = useI18n();
25
31
  const selectedType = ref("");
26
32
  const title = ref("");
27
33
  const slug = ref("");
@@ -44,8 +50,8 @@ const handleConfirm = () => {
44
50
  const properties = {};
45
51
  Object.entries(definition.properties).forEach(([groupKey, group]) => {
46
52
  properties[groupKey] = {};
47
- Object.entries(group.fields).forEach(([fieldKey, field]) => {
48
- properties[groupKey][fieldKey] = field.value;
53
+ Object.entries(group.fields).forEach(([fieldKey, field2]) => {
54
+ properties[groupKey][fieldKey] = field2.value;
49
55
  });
50
56
  });
51
57
  const newPage = {
@@ -55,29 +61,29 @@ const handleConfirm = () => {
55
61
  properties,
56
62
  blocks: definition.initialBlocks ? definition.initialBlocks() : []
57
63
  };
58
- emits("confirm", newPage);
64
+ emit("confirm", newPage);
59
65
  };
60
66
  </script>
61
67
 
62
68
  <template>
63
- <UModal :model-value="isOpen" @update:model-value="emits('close')">
69
+ <UModal :model-value="isOpen" @update:model-value="emit('close')">
64
70
  <slot/>
65
71
  <template #content>
66
72
  <UCard>
67
73
  <template #header>
68
- <div class="flex items-center justify-between">
69
- <h3 class="text-base font-semibold leading-6">Create New Page</h3>
70
- <UButton color="neutral" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="emits('close')" />
74
+ <div :class="headerClass()">
75
+ <h3 :class="headerTitle()">Create New Page</h3>
76
+ <UButton color="neutral" variant="ghost" icon="i-heroicons-x-mark-20-solid" :class="closeButton()" @click="emit('close')" />
71
77
  </div>
72
78
  </template>
73
79
 
74
- <div class="space-y-4 py-4">
80
+ <div :class="body()">
75
81
  <UFormField label="Page Template" required>
76
82
  <USelect
77
83
  v-model="selectedType"
78
84
  :items="typeOptions"
79
85
  :placeholder="t('editor.template_placeholder', 'Select a template...')"
80
- class="w-full"
86
+ :class="field()"
81
87
  />
82
88
  </UFormField>
83
89
 
@@ -91,8 +97,8 @@ const handleConfirm = () => {
91
97
  </div>
92
98
 
93
99
  <template #footer>
94
- <div class="flex justify-end gap-2">
95
- <UButton color="neutral" variant="ghost" label="Cancel" @click="emits('close')" />
100
+ <div :class="footer()">
101
+ <UButton color="neutral" variant="ghost" label="Cancel" @click="emit('close')" />
96
102
  <UButton
97
103
  color="primary"
98
104
  label="Create & Edit"
@@ -1,13 +1,30 @@
1
1
  <script setup>
2
2
  import { ref, watch } from "vue";
3
3
  import { useI18n } from "vue-i18n";
4
+ import { tv } from "tailwind-variants";
5
+ const { t } = useI18n();
4
6
  const { isOpen, loading, pageTitle } = defineProps({
5
7
  isOpen: { type: Boolean, required: true },
6
8
  loading: { type: Boolean, required: false },
7
9
  pageTitle: { type: String, required: true }
8
10
  });
9
11
  const emits = defineEmits(["close", "confirm"]);
10
- const { t } = useI18n();
12
+ const deletePageModalStyles = tv({
13
+ slots: {
14
+ header: "flex items-center justify-between",
15
+ headerTitle: "text-base font-semibold leading-6 text-error-600",
16
+ closeButton: "-my-1",
17
+ body: "text-sm text-neutral-600 dark:text-neutral-400",
18
+ footer: "flex justify-end gap-2"
19
+ }
20
+ });
21
+ const {
22
+ header: headerClass,
23
+ headerTitle,
24
+ closeButton,
25
+ body,
26
+ footer
27
+ } = deletePageModalStyles();
11
28
  const confirmationInput = ref("");
12
29
  const CONFIRMATION_TEXT = "DELETE";
13
30
  watch(() => isOpen, (val) => {
@@ -26,21 +43,21 @@ const handleConfirm = () => {
26
43
  <template #content>
27
44
  <UCard :ui="{ body: 'space-y-4' }">
28
45
  <template #header>
29
- <div class="flex items-center justify-between">
30
- <h3 class="text-base font-semibold leading-6 text-error-600">
46
+ <div :class="headerClass()">
47
+ <h3 :class="headerTitle()">
31
48
  {{ t("editor.delete_page_title", "Delete Page") }}
32
49
  </h3>
33
50
  <UButton
34
51
  color="neutral"
35
52
  variant="ghost"
36
53
  icon="lucide:x"
37
- class="-my-1"
54
+ :class="closeButton()"
38
55
  @click="emits('close')"
39
56
  />
40
57
  </div>
41
58
  </template>
42
59
 
43
- <div class="text-sm text-neutral-600 dark:text-neutral-400">
60
+ <div :class="body()">
44
61
  <p>
45
62
  Are you sure you want to delete <strong>{{ pageTitle }}</strong>?
46
63
  This action is permanent and cannot be undone.
@@ -61,7 +78,7 @@ const handleConfirm = () => {
61
78
  </UFormField>
62
79
 
63
80
  <template #footer>
64
- <div class="flex justify-end gap-2">
81
+ <div :class="footer()">
65
82
  <UButton
66
83
  color="neutral"
67
84
  variant="ghost"
@@ -1,11 +1,13 @@
1
- type __VLS_Props = {
1
+ export interface ColorSwatchProps {
2
2
  name?: string;
3
3
  hex?: string;
4
4
  rgb?: string;
5
5
  hsl?: string;
6
6
  oklch?: string;
7
7
  cmyk?: string;
8
- };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ }
9
+ export interface ColorSwatchEmits {
10
+ }
11
+ declare const __VLS_export: import("vue").DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
12
  declare const _default: typeof __VLS_export;
11
13
  export default _default;
@@ -2,6 +2,7 @@
2
2
  import { computed } from "vue";
3
3
  import { useClipboard } from "@vueuse/core";
4
4
  import { useToast } from "@nuxt/ui/composables";
5
+ import { tv } from "tailwind-variants";
5
6
  const { copy } = useClipboard();
6
7
  const toast = useToast();
7
8
  const { name, hex, rgb, hsl, oklch, cmyk } = defineProps({
@@ -12,6 +13,19 @@ const { name, hex, rgb, hsl, oklch, cmyk } = defineProps({
12
13
  oklch: { type: String, required: false },
13
14
  cmyk: { type: String, required: false }
14
15
  });
16
+ const emit = defineEmits([]);
17
+ const colorSwatchStyles = tv({
18
+ slots: {
19
+ card: "w-full rounded-none xl:w-fit",
20
+ title: "text-lg font-bold",
21
+ content: "flex flex-col items-center gap-sm xl:flex-row xl:items-start",
22
+ preview: "flex aspect-square size-48 p-sm",
23
+ details: "flex flex-col justify-end gap-xs text-xs",
24
+ buttonGroup: "flex w-full flex-col justify-center gap-sm",
25
+ button: "w-full xl:w-36"
26
+ }
27
+ });
28
+ const { card, title: titleStyle, content, preview, details, buttonGroup, button } = colorSwatchStyles();
15
29
  const copyToClipboard = async (text) => {
16
30
  try {
17
31
  await copy(`${text}`);
@@ -42,13 +56,13 @@ const color = computed(() => {
42
56
  </script>
43
57
 
44
58
  <template>
45
- <UCard variant="subtle" class="w-full rounded-none xl:w-fit">
59
+ <UCard variant="subtle" :class="card()">
46
60
  <template #header v-if="name">
47
- <h3 class="text-lg font-bold">{{ name }}</h3>
61
+ <h3 :class="titleStyle()">{{ name }}</h3>
48
62
  </template>
49
- <div class="flex flex-col items-center gap-sm xl:flex-row xl:items-start">
50
- <div class="flex aspect-square size-48 p-sm" :style="{ backgroundColor: color }">
51
- <div class="flex flex-col justify-end gap-xs text-xs">
63
+ <div :class="content()">
64
+ <div :class="preview()" :style="{ backgroundColor: color }">
65
+ <div :class="details()">
52
66
  <span v-if="name" class="text-sm">{{ formatColor(name) }}</span>
53
67
  <span v-if="hex">HEX {{ formatColor(hex) }}</span>
54
68
  <span v-if="rgb">{{ formatColor(rgb) }}</span>
@@ -57,14 +71,14 @@ const color = computed(() => {
57
71
  <span v-if="cmyk">{{ formatColor(cmyk) }}</span>
58
72
  </div>
59
73
  </div>
60
- <div class="flex w-full flex-col justify-center gap-sm">
74
+ <div :class="buttonGroup()">
61
75
  <UButton
62
76
  v-if="hex"
63
77
  variant="outline"
64
78
  size="sm"
65
79
  icon="lucide:copy"
66
80
  label="Copy HEX"
67
- class="w-full xl:w-36"
81
+ :class="button()"
68
82
  @click="copyToClipboard(hex)"
69
83
  />
70
84
  <UButton
@@ -73,7 +87,7 @@ const color = computed(() => {
73
87
  size="sm"
74
88
  icon="lucide:copy"
75
89
  label="Copy RGB"
76
- class="w-full xl:w-36"
90
+ :class="button()"
77
91
  @click="copyToClipboard(rgb)"
78
92
  />
79
93
  <UButton
@@ -82,7 +96,7 @@ const color = computed(() => {
82
96
  size="sm"
83
97
  icon="lucide:copy"
84
98
  label="Copy HSL"
85
- class="w-full xl:w-36"
99
+ :class="button()"
86
100
  @click="copyToClipboard(hsl)"
87
101
  />
88
102
  <UButton
@@ -91,7 +105,7 @@ const color = computed(() => {
91
105
  size="sm"
92
106
  icon="lucide:copy"
93
107
  label="Copy OKLCH"
94
- class="w-full xl:w-36"
108
+ :class="button()"
95
109
  @click="copyToClipboard(oklch)"
96
110
  />
97
111
  <UButton
@@ -100,7 +114,7 @@ const color = computed(() => {
100
114
  size="sm"
101
115
  icon="lucide:copy"
102
116
  label="Copy CMYK"
103
- class="w-full xl:w-36"
117
+ :class="button()"
104
118
  @click="copyToClipboard(cmyk)"
105
119
  />
106
120
  </div>
@@ -1,11 +1,13 @@
1
- type __VLS_Props = {
1
+ export interface ColorSwatchProps {
2
2
  name?: string;
3
3
  hex?: string;
4
4
  rgb?: string;
5
5
  hsl?: string;
6
6
  oklch?: string;
7
7
  cmyk?: string;
8
- };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ }
9
+ export interface ColorSwatchEmits {
10
+ }
11
+ declare const __VLS_export: import("vue").DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
12
  declare const _default: typeof __VLS_export;
11
13
  export default _default;
@@ -1,10 +1,12 @@
1
- type __VLS_Props = {
1
+ export interface FontSwatchProps {
2
2
  name?: string;
3
3
  jpg?: string;
4
4
  png?: string;
5
5
  webp?: string;
6
6
  svg?: string;
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ }
8
+ export interface FontSwatchEmits {
9
+ }
10
+ declare const __VLS_export: import("vue").DefineComponent<FontSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FontSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
11
  declare const _default: typeof __VLS_export;
10
12
  export default _default;
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
- import { computed } from "#imports";
2
+ import { computed } from "vue";
3
+ import { tv } from "tailwind-variants";
3
4
  const { name, jpg, png, webp, svg } = defineProps({
4
5
  name: { type: String, required: false },
5
6
  jpg: { type: String, required: false },
@@ -7,6 +8,18 @@ const { name, jpg, png, webp, svg } = defineProps({
7
8
  webp: { type: String, required: false },
8
9
  svg: { type: String, required: false }
9
10
  });
11
+ const emit = defineEmits([]);
12
+ const fontSwatchStyles = tv({
13
+ slots: {
14
+ card: "w-full rounded-none xl:w-fit",
15
+ title: "text-lg font-bold",
16
+ content: "flex flex-col gap-sm",
17
+ actions: "flex flex-col items-center gap-sm xl:flex-row xl:items-start",
18
+ buttonGroup: "flex w-full flex-col justify-center gap-sm",
19
+ button: "w-full xl:w-36"
20
+ }
21
+ });
22
+ const { card, title: titleStyle, content, actions, buttonGroup, button } = fontSwatchStyles();
10
23
  const image = computed(() => {
11
24
  if (webp) return webp;
12
25
  if (png) return png;
@@ -17,12 +30,12 @@ const image = computed(() => {
17
30
  </script>
18
31
 
19
32
  <template>
20
- <UCard variant="subtle" class="w-full rounded-none xl:w-fit">
33
+ <UCard variant="subtle" :class="card()">
21
34
  <template #header v-if="name">
22
- <h3 class="text-lg font-bold">{{ name }}</h3>
35
+ <h3 :class="titleStyle()">{{ name }}</h3>
23
36
  <span></span>
24
37
  </template>
25
- <div class="flex flex-col gap-sm">
38
+ <div :class="content()">
26
39
  <h1>H1</h1>
27
40
  <p>{{}}</p>
28
41
  </div>
@@ -31,15 +44,15 @@ const image = computed(() => {
31
44
  <p>a b c d e f g h i j k l m n o p q r s t u v w x y z</p>
32
45
  <p>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</p>
33
46
  <p></p>
34
- <div class="flex flex-col items-center gap-sm xl:flex-row xl:items-start">
35
- <div class="flex w-full flex-col justify-center gap-sm">
47
+ <div :class="actions()">
48
+ <div :class="buttonGroup()">
36
49
  <UButton
37
50
  v-if="jpg"
38
51
  variant="outline"
39
52
  size="sm"
40
53
  icon="lucide:download"
41
54
  label="Download JPG"
42
- class="w-full xl:w-36"
55
+ :class="button()"
43
56
  :to="jpg"
44
57
  target="_blank"
45
58
  />
@@ -49,7 +62,7 @@ const image = computed(() => {
49
62
  size="sm"
50
63
  icon="lucide:download"
51
64
  label="Download PNG"
52
- class="w-full xl:w-36"
65
+ :class="button()"
53
66
  :to="png"
54
67
  target="_blank"
55
68
  />
@@ -59,7 +72,7 @@ const image = computed(() => {
59
72
  size="sm"
60
73
  icon="lucide:download"
61
74
  label="Download WEBP"
62
- class="w-full xl:w-36"
75
+ :class="button()"
63
76
  :to="webp"
64
77
  target="_blank"
65
78
  />
@@ -69,7 +82,7 @@ const image = computed(() => {
69
82
  size="sm"
70
83
  icon="lucide:download"
71
84
  label="Download SVG"
72
- class="w-full xl:w-36"
85
+ :class="button()"
73
86
  :to="svg"
74
87
  target="_blank"
75
88
  />