@astrake/lumora-ui 0.1.6 → 0.2.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +141 -92
  2. package/dist/LuCodeBlock.vue_vue_type_script_setup_true_lang-BjwcjuXF.js +1623 -0
  3. package/dist/LuEmbeddedStatusBar.vue_vue_type_script_setup_true_lang-CIksvebU.js +218 -0
  4. package/dist/LuOverlay.vue_vue_type_script_setup_true_lang-DZch4Vrw.js +226 -0
  5. package/dist/components/LuAlert.vue.d.ts +20 -0
  6. package/dist/components/LuAvatar.vue.d.ts +19 -0
  7. package/dist/components/LuBadge.vue.d.ts +16 -0
  8. package/dist/components/LuBreadcrumb.vue.d.ts +16 -0
  9. package/dist/components/LuButton.vue.d.ts +24 -0
  10. package/dist/components/LuCard.vue.d.ts +21 -0
  11. package/dist/components/LuCheckbox.vue.d.ts +27 -0
  12. package/dist/components/LuCodeBlock.vue.d.ts +29 -0
  13. package/dist/components/LuCollapsible.vue.d.ts +25 -0
  14. package/dist/components/LuDivider.vue.d.ts +8 -0
  15. package/dist/components/LuForm.types.d.ts +18 -0
  16. package/dist/components/LuForm.vue.d.ts +55 -0
  17. package/dist/components/LuIcon.vue.d.ts +18 -0
  18. package/dist/components/LuInput.vue.d.ts +26 -0
  19. package/dist/components/LuLink.vue.d.ts +23 -0
  20. package/dist/components/LuMenu.vue.d.ts +26 -0
  21. package/dist/components/LuMenuItem.vue.d.ts +20 -0
  22. package/dist/components/LuModal.vue.d.ts +32 -0
  23. package/dist/components/LuPageHeader.vue.d.ts +10 -0
  24. package/dist/components/LuPagination.vue.d.ts +18 -0
  25. package/dist/components/LuProgressBar.vue.d.ts +7 -0
  26. package/dist/components/LuRadio.vue.d.ts +18 -0
  27. package/dist/components/LuRadioGroup.types.d.ts +8 -0
  28. package/dist/components/LuRadioGroup.vue.d.ts +24 -0
  29. package/dist/components/LuSelect.vue.d.ts +18 -0
  30. package/dist/components/LuSkeleton.vue.d.ts +5 -0
  31. package/dist/components/LuSpinner.vue.d.ts +5 -0
  32. package/dist/components/LuSwitch.vue.d.ts +15 -0
  33. package/dist/components/LuTab.vue.d.ts +16 -0
  34. package/dist/components/LuTabList.vue.d.ts +15 -0
  35. package/dist/components/LuTabPanel.vue.d.ts +16 -0
  36. package/dist/components/LuTable.vue.d.ts +15 -0
  37. package/dist/components/LuTableBody.vue.d.ts +15 -0
  38. package/dist/components/LuTableCell.vue.d.ts +15 -0
  39. package/dist/components/LuTableHead.vue.d.ts +15 -0
  40. package/dist/components/LuTableHeadCell.vue.d.ts +15 -0
  41. package/dist/components/LuTableRow.vue.d.ts +15 -0
  42. package/dist/components/LuTabs.vue.d.ts +20 -0
  43. package/dist/components/LuTag.vue.d.ts +20 -0
  44. package/dist/components/LuText.vue.d.ts +16 -0
  45. package/dist/components/LuTextarea.vue.d.ts +14 -0
  46. package/dist/components/LuThemeSelect.vue.d.ts +2 -0
  47. package/dist/components/LuThemeSwitch.vue.d.ts +2 -0
  48. package/dist/components/LuToggleButton.vue.d.ts +16 -0
  49. package/dist/components/LuToggleGroup.vue.d.ts +20 -0
  50. package/dist/components/LuTooltip.vue.d.ts +19 -0
  51. package/dist/components/__tests__/LuForm.test.d.ts +1 -0
  52. package/{src/components/index.ts → dist/components/index.d.ts} +16 -0
  53. package/dist/components/index.js +47 -0
  54. package/{src/composables/index.ts → dist/composables/index.d.ts} +0 -1
  55. package/dist/composables/index.js +30 -0
  56. package/dist/composables/useRail.d.ts +6 -0
  57. package/dist/composables/useSplit.d.ts +4 -0
  58. package/dist/composables/useTheme.d.ts +7 -0
  59. package/dist/context-0gENwESP.js +62 -0
  60. package/dist/context.d.ts +8 -0
  61. package/{src/index.ts → dist/index.d.ts} +2 -3
  62. package/dist/index.js +94 -0
  63. package/dist/layout/LuDock.vue.d.ts +9 -0
  64. package/dist/layout/LuDockItem.vue.d.ts +16 -0
  65. package/dist/layout/LuFill.vue.d.ts +21 -0
  66. package/dist/layout/LuFixed.vue.d.ts +21 -0
  67. package/dist/layout/LuGrid.vue.d.ts +26 -0
  68. package/dist/layout/LuOverlay.vue.d.ts +15 -0
  69. package/dist/layout/LuScroll.vue.d.ts +15 -0
  70. package/dist/layout/LuSplit.vue.d.ts +16 -0
  71. package/dist/layout/LuSplitPane.vue.d.ts +18 -0
  72. package/dist/layout/LuSplitResizer.vue.d.ts +5 -0
  73. package/dist/layout/LuStack.vue.d.ts +23 -0
  74. package/{src/layout/index.ts → dist/layout/index.d.ts} +1 -14
  75. package/dist/layout/index.js +14 -0
  76. package/dist/plugin.d.ts +6 -0
  77. package/dist/shell/desktop/LuDesktopRailBar.vue.d.ts +17 -0
  78. package/dist/shell/desktop/LuDesktopRailItem.vue.d.ts +18 -0
  79. package/dist/shell/desktop/LuDesktopShell.vue.d.ts +23 -0
  80. package/dist/shell/desktop/LuDesktopSidebar.vue.d.ts +21 -0
  81. package/dist/shell/desktop/LuDesktopStatusBar.vue.d.ts +15 -0
  82. package/dist/shell/desktop/LuDesktopTopBar.vue.d.ts +15 -0
  83. package/dist/shell/embedded/LuEmbeddedShell.vue.d.ts +19 -0
  84. package/dist/shell/embedded/LuEmbeddedStatusBar.vue.d.ts +17 -0
  85. package/dist/shell/embedded/LuEmbeddedTopBar.vue.d.ts +19 -0
  86. package/{src/shell/index.ts → dist/shell/index.d.ts} +4 -2
  87. package/dist/shell/index.js +15 -0
  88. package/dist/shell/mobile/LuMobileHeader.vue.d.ts +19 -0
  89. package/dist/shell/mobile/LuMobileNavBar.vue.d.ts +15 -0
  90. package/dist/shell/mobile/LuMobileShell.vue.d.ts +21 -0
  91. package/dist/skins/default.d.ts +2 -0
  92. package/dist/skins/index.js +416 -0
  93. package/dist/tailwind.d.ts +1 -0
  94. package/dist/tailwind.js +13 -0
  95. package/dist/types.d.ts +15 -0
  96. package/dist/useTheme-Cd4wVaLs.js +21 -0
  97. package/dist/utils.d.ts +21 -0
  98. package/package.json +94 -61
  99. package/src/lumora.css +16 -0
  100. package/src/components/LuAvatar.vue +0 -22
  101. package/src/components/LuBadge.vue +0 -15
  102. package/src/components/LuButton.vue +0 -58
  103. package/src/components/LuCard.vue +0 -20
  104. package/src/components/LuCollapsible.vue +0 -34
  105. package/src/components/LuDivider.vue +0 -18
  106. package/src/components/LuForm.types.ts +0 -24
  107. package/src/components/LuForm.vue +0 -121
  108. package/src/components/LuIcon.vue +0 -39
  109. package/src/components/LuInput.vue +0 -62
  110. package/src/components/LuLink.vue +0 -47
  111. package/src/components/LuPageHeader.vue +0 -24
  112. package/src/components/LuProgressBar.vue +0 -21
  113. package/src/components/LuSelect.vue +0 -67
  114. package/src/components/LuSwitch.vue +0 -74
  115. package/src/components/LuTab.vue +0 -26
  116. package/src/components/LuTabList.vue +0 -15
  117. package/src/components/LuTabPanel.vue +0 -19
  118. package/src/components/LuTable.vue +0 -15
  119. package/src/components/LuTableBody.vue +0 -15
  120. package/src/components/LuTableCell.vue +0 -15
  121. package/src/components/LuTableHead.vue +0 -15
  122. package/src/components/LuTableHeadCell.vue +0 -15
  123. package/src/components/LuTableRow.vue +0 -15
  124. package/src/components/LuTabs.vue +0 -30
  125. package/src/components/LuText.vue +0 -18
  126. package/src/components/LuThemeSelect.vue +0 -26
  127. package/src/components/LuThemeSwitch.vue +0 -22
  128. package/src/components/LuTooltip.vue +0 -36
  129. package/src/components/__tests__/LuForm.test.ts +0 -206
  130. package/src/composables/useRail.ts +0 -24
  131. package/src/composables/useSplit.ts +0 -17
  132. package/src/composables/useTheme.ts +0 -36
  133. package/src/context.ts +0 -36
  134. package/src/layout/LuDock.vue +0 -23
  135. package/src/layout/LuDockItem.vue +0 -18
  136. package/src/layout/LuFill.vue +0 -17
  137. package/src/layout/LuFixed.vue +0 -17
  138. package/src/layout/LuGrid.vue +0 -22
  139. package/src/layout/LuOverlay.vue +0 -17
  140. package/src/layout/LuScroll.vue +0 -17
  141. package/src/layout/LuSplit.vue +0 -23
  142. package/src/layout/LuSplitPane.vue +0 -32
  143. package/src/layout/LuSplitResizer.vue +0 -17
  144. package/src/layout/LuStack.vue +0 -24
  145. package/src/plugin.ts +0 -27
  146. package/src/shell/desktop/LuDesktopRailBar.vue +0 -23
  147. package/src/shell/desktop/LuDesktopRailItem.vue +0 -23
  148. package/src/shell/desktop/LuDesktopShell.vue +0 -25
  149. package/src/shell/desktop/LuDesktopSidebar.vue +0 -36
  150. package/src/shell/desktop/LuDesktopStatusBar.vue +0 -15
  151. package/src/shell/desktop/LuDesktopTopBar.vue +0 -15
  152. package/src/shell/embedded/LuEmbeddedShell.vue +0 -20
  153. package/src/shell/mobile/LuMobileShell.vue +0 -21
  154. package/src/skins/default.ts +0 -94
  155. package/src/types.ts +0 -18
  156. package/tsconfig.json +0 -10
  157. /package/{src/skins/index.ts → dist/skins/index.d.ts} +0 -0
@@ -1,24 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin">
3
- <LuText :as="level" variant="page-title">{{ title }}</LuText>
4
- <LuText v-if="description" as="p" variant="page-subtitle" class="mt-2">{{ description }}</LuText>
5
- </div>
6
- </template>
7
-
8
- <script setup lang="ts">
9
- import { computed } from "vue";
10
- import { useLumoraConfig } from "../context";
11
- import LuText from "./LuText.vue";
12
-
13
- const props = withDefaults(defineProps<{
14
- variant?: string;
15
- title: string;
16
- description?: string;
17
- level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
18
- }>(), {
19
- level: "h1"
20
- });
21
-
22
- const { resolveSkin } = useLumoraConfig();
23
- const resolvedSkin = computed(() => resolveSkin("LuPageHeader", props.variant));
24
- </script>
@@ -1,21 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="trackSkin">
3
- <div :class="fillSkin" :style="{ width: `${percent}%` }"></div>
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string; value: number; max?: number }>();
12
-
13
- const percent = computed(() => {
14
- const m = props.max ?? 100;
15
- return Math.max(0, Math.min(100, (props.value / m) * 100));
16
- });
17
-
18
- const { resolveSkin } = useLumoraConfig();
19
- const trackSkin = computed(() => resolveSkin("LuProgressBar", props.variant));
20
- const fillSkin = computed(() => resolveSkin("LuProgressBarFill", props.variant));
21
- </script>
@@ -1,67 +0,0 @@
1
- <template>
2
- <select
3
- v-bind="$attrs"
4
- :class="resolvedSkin"
5
- :value="modelValue"
6
- :name="name"
7
- :disabled="formContext?.disabled.value"
8
- @change="onChange"
9
- @blur="onBlur"
10
- >
11
- <option v-for="opt in options" :key="opt.value" :value="opt.value">
12
- {{ opt.label }}
13
- </option>
14
- </select>
15
- </template>
16
-
17
- <script setup lang="ts">
18
- import { computed, inject, onMounted, onUnmounted, ref } from "vue";
19
- import { useLumoraConfig } from "../context";
20
- import { LuFormContextKey } from "./LuForm.types";
21
-
22
- const props = defineProps<{
23
- modelValue?: string | number;
24
- variant?: string;
25
- options: Array<{ value: string | number; label: string }>;
26
- name?: string;
27
- error?: string | null;
28
- }>();
29
-
30
- const emit = defineEmits<{
31
- (e: "update:modelValue", value: string | number): void;
32
- (e: "blur"): void;
33
- }>();
34
-
35
- const { resolveSkin } = useLumoraConfig();
36
- const resolvedSkin = computed(() => resolveSkin("LuSelect", props.variant));
37
-
38
- const formContext = inject(LuFormContextKey, null);
39
- const internalValue = ref<string | number | undefined>(props.modelValue);
40
-
41
- const onChange = (event: Event) => {
42
- const value = (event.target as HTMLSelectElement).value;
43
- internalValue.value = value;
44
- emit("update:modelValue", value);
45
- };
46
-
47
- const onBlur = () => {
48
- if (props.name && formContext && (formContext.validateOn.value === "blur" || formContext.validateOn.value === "both")) {
49
- // trigger single-field validation — handled by parent LuForm
50
- }
51
- emit("blur");
52
- };
53
-
54
- onMounted(() => {
55
- if (!props.name || !formContext) return;
56
- formContext.register({
57
- name: props.name,
58
- getValue: () => internalValue.value,
59
- setValue: (v) => { internalValue.value = v as string | number; },
60
- setError: (_msg) => { /* error display handled via formContext.getError in template if desired */ },
61
- });
62
- });
63
-
64
- onUnmounted(() => {
65
- if (props.name && formContext) formContext.unregister(props.name);
66
- });
67
- </script>
@@ -1,74 +0,0 @@
1
- <template>
2
- <button
3
- role="switch"
4
- type="button"
5
- :name="name"
6
- :aria-checked="modelValue"
7
- :disabled="mergedDisabled"
8
- :class="[resolvedSkin, modelValue ? activeSkin : '']"
9
- @click="toggle"
10
- @blur="onBlur"
11
- >
12
- <span :class="[thumbSkin, modelValue ? thumbActiveSkin : '']" />
13
- </button>
14
- </template>
15
-
16
- <script setup lang="ts">
17
- import { computed, inject, onMounted, onUnmounted, ref } from "vue";
18
- import { useLumoraConfig } from "../context";
19
- import { LuFormContextKey } from "./LuForm.types";
20
-
21
- const props = defineProps<{
22
- modelValue?: boolean;
23
- variant?: string;
24
- disabled?: boolean;
25
- name?: string;
26
- error?: string | null;
27
- }>();
28
-
29
- const emit = defineEmits<{
30
- (e: "update:modelValue", value: boolean): void;
31
- (e: "blur"): void;
32
- }>();
33
-
34
- const { resolveSkin } = useLumoraConfig();
35
-
36
- const resolvedSkin = computed(() => resolveSkin("LuSwitch", props.variant));
37
- const activeSkin = computed(() => resolveSkin("LuSwitch", "active"));
38
-
39
- const thumbSkin = computed(() => resolveSkin("LuSwitchThumb", props.variant));
40
- const thumbActiveSkin = computed(() => resolveSkin("LuSwitchThumb", "active"));
41
-
42
- const formContext = inject(LuFormContextKey, null);
43
- const internalValue = ref<boolean | undefined>(props.modelValue);
44
-
45
- const mergedDisabled = computed(() => props.disabled || formContext?.disabled.value);
46
-
47
- const toggle = () => {
48
- if (mergedDisabled.value) return;
49
- const newValue = !props.modelValue;
50
- internalValue.value = newValue;
51
- emit("update:modelValue", newValue);
52
- };
53
-
54
- const onBlur = () => {
55
- if (props.name && formContext && (formContext.validateOn.value === "blur" || formContext.validateOn.value === "both")) {
56
- // trigger single-field validation — handled by parent LuForm
57
- }
58
- emit("blur");
59
- };
60
-
61
- onMounted(() => {
62
- if (!props.name || !formContext) return;
63
- formContext.register({
64
- name: props.name,
65
- getValue: () => internalValue.value,
66
- setValue: (v) => { internalValue.value = Boolean(v); },
67
- setError: (_msg) => { /* error display handled via formContext.getError in template if desired */ },
68
- });
69
- });
70
-
71
- onUnmounted(() => {
72
- if (props.name && formContext) formContext.unregister(props.name);
73
- });
74
- </script>
@@ -1,26 +0,0 @@
1
- <template>
2
- <button v-bind="$attrs" :class="[resolvedSkin, isActive ? activeSkin : '']" @click="onClick">
3
- <slot />
4
- </button>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, inject, type Ref } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string; value: string | number }>();
12
-
13
- const activeTab = inject<Ref<string | number | undefined>>("lu-tabs-active");
14
-
15
- const isActive = computed(() => activeTab?.value === props.value);
16
-
17
- const onClick = () => {
18
- if (activeTab) {
19
- activeTab.value = props.value;
20
- }
21
- };
22
-
23
- const { resolveSkin } = useLumoraConfig();
24
- const resolvedSkin = computed(() => resolveSkin("LuTab", props.variant));
25
- const activeSkin = computed(() => resolveSkin("LuTab", "active"));
26
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTabList", props.variant));
15
- </script>
@@ -1,19 +0,0 @@
1
- <template>
2
- <div v-show="isActive" v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, inject, type Ref } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string; value: string | number }>();
12
-
13
- const activeTab = inject<Ref<string | number | undefined>>("lu-tabs-active");
14
-
15
- const isActive = computed(() => activeTab?.value === props.value);
16
-
17
- const { resolveSkin } = useLumoraConfig();
18
- const resolvedSkin = computed(() => resolveSkin("LuTabPanel", props.variant));
19
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <table v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </table>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTable", props.variant));
15
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <tbody v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </tbody>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTableBody", props.variant));
15
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <td v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </td>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTableCell", props.variant));
15
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <thead v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </thead>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTableHead", props.variant));
15
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <th v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </th>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTableHeadCell", props.variant));
15
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <tr v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </tr>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{ variant?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuTableRow", props.variant));
15
- </script>
@@ -1,30 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, provide, ref, watch } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{
12
- variant?: string;
13
- modelValue?: string | number;
14
- }>();
15
-
16
- const emit = defineEmits<{
17
- (e: "update:modelValue", value: string | number): void;
18
- }>();
19
-
20
- const activeTab = ref(props.modelValue);
21
- watch(() => props.modelValue, (val) => activeTab.value = val);
22
- watch(activeTab, (val) => {
23
- if (val !== undefined) emit("update:modelValue", val);
24
- });
25
-
26
- provide("lu-tabs-active", activeTab);
27
-
28
- const { resolveSkin } = useLumoraConfig();
29
- const resolvedSkin = computed(() => resolveSkin("LuTabs", props.variant));
30
- </script>
@@ -1,18 +0,0 @@
1
- <template>
2
- <component :is="as ?? 'span'" v-bind="$attrs" :class="resolvedSkin">
3
- <slot />
4
- </component>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{
12
- variant?: string;
13
- as?: string;
14
- }>();
15
-
16
- const { resolveSkin } = useLumoraConfig();
17
- const resolvedSkin = computed(() => resolveSkin("LuText", props.variant));
18
- </script>
@@ -1,26 +0,0 @@
1
- <template>
2
- <LuSelect
3
- :model-value="mode"
4
- variant="theme"
5
- :options="options"
6
- v-bind="$attrs"
7
- @update:model-value="onChange"
8
- />
9
- </template>
10
-
11
- <script setup lang="ts">
12
- import LuSelect from "./LuSelect.vue";
13
- import { useTheme, type ThemeMode } from "../composables/useTheme";
14
-
15
- const { mode, setMode } = useTheme();
16
-
17
- const options = [
18
- { value: "system", label: "System" },
19
- { value: "light", label: "Light" },
20
- { value: "dark", label: "Dark" },
21
- ];
22
-
23
- const onChange = (val: string | number) => {
24
- setMode(val as ThemeMode);
25
- };
26
- </script>
@@ -1,22 +0,0 @@
1
- <template>
2
- <LuSwitch
3
- :model-value="isDark"
4
- variant="theme"
5
- v-bind="$attrs"
6
- @update:model-value="onToggle"
7
- />
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import { computed } from "vue";
12
- import LuSwitch from "./LuSwitch.vue";
13
- import { useTheme } from "../composables/useTheme";
14
-
15
- const { resolved, setMode } = useTheme();
16
-
17
- const isDark = computed(() => resolved.value === "dark");
18
-
19
- const onToggle = (val: boolean) => {
20
- setMode(val ? "dark" : "light");
21
- };
22
- </script>
@@ -1,36 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="containerSkin" @mouseenter="onEnter" @mouseleave="onLeave">
3
- <slot name="trigger" />
4
- <div v-if="isVisible" :class="contentSkin">
5
- <slot name="content" />
6
- </div>
7
- </div>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import { computed, ref } from "vue";
12
- import { useLumoraConfig } from "../context";
13
-
14
- const props = defineProps<{ variant?: string; position?: "top" | "bottom" | "left" | "right"; delay?: number }>();
15
-
16
- const isVisible = ref(false);
17
- let timeout: ReturnType<typeof setTimeout> | null = null;
18
-
19
- const onEnter = () => {
20
- if (timeout) clearTimeout(timeout);
21
- if (props.delay) {
22
- timeout = setTimeout(() => isVisible.value = true, props.delay);
23
- } else {
24
- isVisible.value = true;
25
- }
26
- };
27
-
28
- const onLeave = () => {
29
- if (timeout) clearTimeout(timeout);
30
- isVisible.value = false;
31
- };
32
-
33
- const { resolveSkin } = useLumoraConfig();
34
- const containerSkin = computed(() => resolveSkin("LuTooltip", props.variant));
35
- const contentSkin = computed(() => resolveSkin("LuTooltipContent", props.position ?? props.variant));
36
- </script>