@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.
- package/CHANGELOG.md +141 -92
- package/dist/LuCodeBlock.vue_vue_type_script_setup_true_lang-BjwcjuXF.js +1623 -0
- package/dist/LuEmbeddedStatusBar.vue_vue_type_script_setup_true_lang-CIksvebU.js +218 -0
- package/dist/LuOverlay.vue_vue_type_script_setup_true_lang-DZch4Vrw.js +226 -0
- package/dist/components/LuAlert.vue.d.ts +20 -0
- package/dist/components/LuAvatar.vue.d.ts +19 -0
- package/dist/components/LuBadge.vue.d.ts +16 -0
- package/dist/components/LuBreadcrumb.vue.d.ts +16 -0
- package/dist/components/LuButton.vue.d.ts +24 -0
- package/dist/components/LuCard.vue.d.ts +21 -0
- package/dist/components/LuCheckbox.vue.d.ts +27 -0
- package/dist/components/LuCodeBlock.vue.d.ts +29 -0
- package/dist/components/LuCollapsible.vue.d.ts +25 -0
- package/dist/components/LuDivider.vue.d.ts +8 -0
- package/dist/components/LuForm.types.d.ts +18 -0
- package/dist/components/LuForm.vue.d.ts +55 -0
- package/dist/components/LuIcon.vue.d.ts +18 -0
- package/dist/components/LuInput.vue.d.ts +26 -0
- package/dist/components/LuLink.vue.d.ts +23 -0
- package/dist/components/LuMenu.vue.d.ts +26 -0
- package/dist/components/LuMenuItem.vue.d.ts +20 -0
- package/dist/components/LuModal.vue.d.ts +32 -0
- package/dist/components/LuPageHeader.vue.d.ts +10 -0
- package/dist/components/LuPagination.vue.d.ts +18 -0
- package/dist/components/LuProgressBar.vue.d.ts +7 -0
- package/dist/components/LuRadio.vue.d.ts +18 -0
- package/dist/components/LuRadioGroup.types.d.ts +8 -0
- package/dist/components/LuRadioGroup.vue.d.ts +24 -0
- package/dist/components/LuSelect.vue.d.ts +18 -0
- package/dist/components/LuSkeleton.vue.d.ts +5 -0
- package/dist/components/LuSpinner.vue.d.ts +5 -0
- package/dist/components/LuSwitch.vue.d.ts +15 -0
- package/dist/components/LuTab.vue.d.ts +16 -0
- package/dist/components/LuTabList.vue.d.ts +15 -0
- package/dist/components/LuTabPanel.vue.d.ts +16 -0
- package/dist/components/LuTable.vue.d.ts +15 -0
- package/dist/components/LuTableBody.vue.d.ts +15 -0
- package/dist/components/LuTableCell.vue.d.ts +15 -0
- package/dist/components/LuTableHead.vue.d.ts +15 -0
- package/dist/components/LuTableHeadCell.vue.d.ts +15 -0
- package/dist/components/LuTableRow.vue.d.ts +15 -0
- package/dist/components/LuTabs.vue.d.ts +20 -0
- package/dist/components/LuTag.vue.d.ts +20 -0
- package/dist/components/LuText.vue.d.ts +16 -0
- package/dist/components/LuTextarea.vue.d.ts +14 -0
- package/dist/components/LuThemeSelect.vue.d.ts +2 -0
- package/dist/components/LuThemeSwitch.vue.d.ts +2 -0
- package/dist/components/LuToggleButton.vue.d.ts +16 -0
- package/dist/components/LuToggleGroup.vue.d.ts +20 -0
- package/dist/components/LuTooltip.vue.d.ts +19 -0
- package/dist/components/__tests__/LuForm.test.d.ts +1 -0
- package/{src/components/index.ts → dist/components/index.d.ts} +16 -0
- package/dist/components/index.js +47 -0
- package/{src/composables/index.ts → dist/composables/index.d.ts} +0 -1
- package/dist/composables/index.js +30 -0
- package/dist/composables/useRail.d.ts +6 -0
- package/dist/composables/useSplit.d.ts +4 -0
- package/dist/composables/useTheme.d.ts +7 -0
- package/dist/context-0gENwESP.js +62 -0
- package/dist/context.d.ts +8 -0
- package/{src/index.ts → dist/index.d.ts} +2 -3
- package/dist/index.js +94 -0
- package/dist/layout/LuDock.vue.d.ts +9 -0
- package/dist/layout/LuDockItem.vue.d.ts +16 -0
- package/dist/layout/LuFill.vue.d.ts +21 -0
- package/dist/layout/LuFixed.vue.d.ts +21 -0
- package/dist/layout/LuGrid.vue.d.ts +26 -0
- package/dist/layout/LuOverlay.vue.d.ts +15 -0
- package/dist/layout/LuScroll.vue.d.ts +15 -0
- package/dist/layout/LuSplit.vue.d.ts +16 -0
- package/dist/layout/LuSplitPane.vue.d.ts +18 -0
- package/dist/layout/LuSplitResizer.vue.d.ts +5 -0
- package/dist/layout/LuStack.vue.d.ts +23 -0
- package/{src/layout/index.ts → dist/layout/index.d.ts} +1 -14
- package/dist/layout/index.js +14 -0
- package/dist/plugin.d.ts +6 -0
- package/dist/shell/desktop/LuDesktopRailBar.vue.d.ts +17 -0
- package/dist/shell/desktop/LuDesktopRailItem.vue.d.ts +18 -0
- package/dist/shell/desktop/LuDesktopShell.vue.d.ts +23 -0
- package/dist/shell/desktop/LuDesktopSidebar.vue.d.ts +21 -0
- package/dist/shell/desktop/LuDesktopStatusBar.vue.d.ts +15 -0
- package/dist/shell/desktop/LuDesktopTopBar.vue.d.ts +15 -0
- package/dist/shell/embedded/LuEmbeddedShell.vue.d.ts +19 -0
- package/dist/shell/embedded/LuEmbeddedStatusBar.vue.d.ts +17 -0
- package/dist/shell/embedded/LuEmbeddedTopBar.vue.d.ts +19 -0
- package/{src/shell/index.ts → dist/shell/index.d.ts} +4 -2
- package/dist/shell/index.js +15 -0
- package/dist/shell/mobile/LuMobileHeader.vue.d.ts +19 -0
- package/dist/shell/mobile/LuMobileNavBar.vue.d.ts +15 -0
- package/dist/shell/mobile/LuMobileShell.vue.d.ts +21 -0
- package/dist/skins/default.d.ts +2 -0
- package/dist/skins/index.js +416 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +13 -0
- package/dist/types.d.ts +15 -0
- package/dist/useTheme-Cd4wVaLs.js +21 -0
- package/dist/utils.d.ts +21 -0
- package/package.json +94 -61
- package/src/lumora.css +16 -0
- package/src/components/LuAvatar.vue +0 -22
- package/src/components/LuBadge.vue +0 -15
- package/src/components/LuButton.vue +0 -58
- package/src/components/LuCard.vue +0 -20
- package/src/components/LuCollapsible.vue +0 -34
- package/src/components/LuDivider.vue +0 -18
- package/src/components/LuForm.types.ts +0 -24
- package/src/components/LuForm.vue +0 -121
- package/src/components/LuIcon.vue +0 -39
- package/src/components/LuInput.vue +0 -62
- package/src/components/LuLink.vue +0 -47
- package/src/components/LuPageHeader.vue +0 -24
- package/src/components/LuProgressBar.vue +0 -21
- package/src/components/LuSelect.vue +0 -67
- package/src/components/LuSwitch.vue +0 -74
- package/src/components/LuTab.vue +0 -26
- package/src/components/LuTabList.vue +0 -15
- package/src/components/LuTabPanel.vue +0 -19
- package/src/components/LuTable.vue +0 -15
- package/src/components/LuTableBody.vue +0 -15
- package/src/components/LuTableCell.vue +0 -15
- package/src/components/LuTableHead.vue +0 -15
- package/src/components/LuTableHeadCell.vue +0 -15
- package/src/components/LuTableRow.vue +0 -15
- package/src/components/LuTabs.vue +0 -30
- package/src/components/LuText.vue +0 -18
- package/src/components/LuThemeSelect.vue +0 -26
- package/src/components/LuThemeSwitch.vue +0 -22
- package/src/components/LuTooltip.vue +0 -36
- package/src/components/__tests__/LuForm.test.ts +0 -206
- package/src/composables/useRail.ts +0 -24
- package/src/composables/useSplit.ts +0 -17
- package/src/composables/useTheme.ts +0 -36
- package/src/context.ts +0 -36
- package/src/layout/LuDock.vue +0 -23
- package/src/layout/LuDockItem.vue +0 -18
- package/src/layout/LuFill.vue +0 -17
- package/src/layout/LuFixed.vue +0 -17
- package/src/layout/LuGrid.vue +0 -22
- package/src/layout/LuOverlay.vue +0 -17
- package/src/layout/LuScroll.vue +0 -17
- package/src/layout/LuSplit.vue +0 -23
- package/src/layout/LuSplitPane.vue +0 -32
- package/src/layout/LuSplitResizer.vue +0 -17
- package/src/layout/LuStack.vue +0 -24
- package/src/plugin.ts +0 -27
- package/src/shell/desktop/LuDesktopRailBar.vue +0 -23
- package/src/shell/desktop/LuDesktopRailItem.vue +0 -23
- package/src/shell/desktop/LuDesktopShell.vue +0 -25
- package/src/shell/desktop/LuDesktopSidebar.vue +0 -36
- package/src/shell/desktop/LuDesktopStatusBar.vue +0 -15
- package/src/shell/desktop/LuDesktopTopBar.vue +0 -15
- package/src/shell/embedded/LuEmbeddedShell.vue +0 -20
- package/src/shell/mobile/LuMobileShell.vue +0 -21
- package/src/skins/default.ts +0 -94
- package/src/types.ts +0 -18
- package/tsconfig.json +0 -10
- /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>
|
package/src/components/LuTab.vue
DELETED
|
@@ -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>
|