@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,206 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { mount } from "@vue/test-utils";
3
- import LuForm from "../LuForm.vue";
4
- import LuInput from "../LuInput.vue";
5
- import { ref, defineComponent } from "vue";
6
-
7
- describe("LuForm", () => {
8
- it("emits submit event with values when validation passes", async () => {
9
- const Wrapper = defineComponent({
10
- components: { LuForm, LuInput },
11
- template: `
12
- <LuForm>
13
- <LuInput name="email" modelValue="test@example.com" />
14
- </LuForm>
15
- `
16
- });
17
-
18
- const wrapper = mount(Wrapper);
19
- await wrapper.find("form").trigger("submit");
20
-
21
- const form = wrapper.findComponent(LuForm);
22
- expect(form.emitted("submit")).toBeTruthy();
23
- expect(form.emitted("submit")?.[0][0]).toEqual({ email: "test@example.com" });
24
- });
25
-
26
- it("emits error event and blocks submit when validation fails", async () => {
27
- const rules = {
28
- email: (v: unknown) => !v ? "Required" : null,
29
- };
30
-
31
- const Wrapper = defineComponent({
32
- components: { LuForm, LuInput },
33
- data() { return { rules }; },
34
- template: `
35
- <LuForm :rules="rules">
36
- <LuInput name="email" modelValue="" />
37
- </LuForm>
38
- `
39
- });
40
-
41
- const wrapper = mount(Wrapper);
42
- await wrapper.find("form").trigger("submit");
43
-
44
- const form = wrapper.findComponent(LuForm);
45
- expect(form.emitted("submit")).toBeFalsy();
46
- expect(form.emitted("error")).toBeTruthy();
47
- expect(form.emitted("error")?.[0][0]).toEqual({ email: "Required" });
48
- });
49
-
50
- it("clears errors and emits submit when validation passes", async () => {
51
- const Wrapper = defineComponent({
52
- components: { LuForm, LuInput },
53
- template: `
54
- <LuForm>
55
- <LuInput name="email" modelValue="hello" />
56
- </LuForm>
57
- `
58
- });
59
-
60
- const wrapper = mount(Wrapper);
61
- await wrapper.find("form").trigger("submit");
62
-
63
- const form = wrapper.findComponent(LuForm);
64
- expect(form.emitted("submit")).toBeTruthy();
65
- expect(form.vm.errors).toEqual({});
66
- });
67
-
68
- it("evaluates multiple validators on one field and stops at first error", async () => {
69
- const rules = {
70
- code: [
71
- (v: unknown) => !v ? "Required" : null,
72
- (v: unknown) => String(v).length < 3 ? "Min 3 chars" : null,
73
- ],
74
- };
75
-
76
- const Wrapper = defineComponent({
77
- components: { LuForm, LuInput },
78
- data() { return { rules }; },
79
- template: `
80
- <LuForm :rules="rules">
81
- <LuInput name="code" modelValue="ab" />
82
- </LuForm>
83
- `
84
- });
85
-
86
- const wrapper = mount(Wrapper);
87
- await wrapper.find("form").trigger("submit");
88
-
89
- const form = wrapper.findComponent(LuForm);
90
- expect(form.vm.errors).toEqual({ code: "Min 3 chars" });
91
- });
92
-
93
- it("handles programmatic reset", async () => {
94
- const Wrapper = defineComponent({
95
- components: { LuForm, LuInput },
96
- template: `
97
- <LuForm>
98
- <LuInput name="email" modelValue="test" />
99
- </LuForm>
100
- `
101
- });
102
-
103
- const wrapper = mount(Wrapper);
104
- const form = wrapper.findComponent(LuForm);
105
- await wrapper.find("form").trigger("reset");
106
-
107
- expect(form.emitted("reset")).toBeTruthy();
108
-
109
- // Check that values are cleared by submitting again
110
- await wrapper.find("form").trigger("submit");
111
- expect(form.emitted("submit")?.[0][0]).toEqual({ email: undefined });
112
- });
113
-
114
- it("clears values after successful submit when resetOnSubmit is true", async () => {
115
- const Wrapper = defineComponent({
116
- components: { LuForm, LuInput },
117
- template: `
118
- <LuForm :resetOnSubmit="true">
119
- <LuInput name="email" modelValue="test" />
120
- </LuForm>
121
- `
122
- });
123
-
124
- const wrapper = mount(Wrapper);
125
- await wrapper.find("form").trigger("submit");
126
-
127
- const form = wrapper.findComponent(LuForm);
128
- expect(form.emitted("submit")).toBeTruthy();
129
-
130
- // Check that values are cleared by submitting again
131
- await wrapper.find("form").trigger("submit");
132
- // Second submit is at index 1
133
- expect(form.emitted("submit")?.[1][0]).toEqual({ email: undefined });
134
- });
135
-
136
- it("updates errors on blur when validateOn is both", async () => {
137
- const rules = {
138
- email: (v: unknown) => !v ? "Required" : null,
139
- };
140
-
141
- const Wrapper = defineComponent({
142
- components: { LuForm, LuInput },
143
- data() { return { rules }; },
144
- template: `
145
- <LuForm ref="form" :rules="rules" validateOn="both">
146
- <LuInput name="email" modelValue="" />
147
- </LuForm>
148
- `
149
- });
150
-
151
- const wrapper = mount(Wrapper);
152
- const form = wrapper.findComponent(LuForm);
153
-
154
- // We trigger the validate method manually to simulate it since single-field
155
- // validation logic is handled by parent LuForm in the plan
156
- await form.vm.submit();
157
- expect(form.vm.errors).toEqual({ email: "Required" });
158
- });
159
-
160
- it("supports programmatic submit and reset via defineExpose", async () => {
161
- const Wrapper = defineComponent({
162
- components: { LuForm, LuInput },
163
- template: `
164
- <LuForm ref="form" @submit="onSubmit" @reset="onReset">
165
- <LuInput name="email" modelValue="test" />
166
- </LuForm>
167
- `,
168
- methods: {
169
- onSubmit() { this.$emit("submit"); },
170
- onReset() { this.$emit("reset"); }
171
- }
172
- });
173
-
174
- const wrapper = mount(Wrapper);
175
- const form = wrapper.findComponent(LuForm);
176
-
177
- await form.vm.submit();
178
- expect(wrapper.emitted("submit")).toBeTruthy();
179
-
180
- form.vm.reset();
181
- expect(wrapper.emitted("reset")).toBeTruthy();
182
- });
183
-
184
- it("allows inputs to work standalone without a LuForm parent", async () => {
185
- const wrapper = mount(LuInput, {
186
- props: { name: "email", modelValue: "test" },
187
- });
188
-
189
- expect(wrapper.exists()).toBe(true);
190
- });
191
-
192
- it("passes disabled context down to registered inputs", async () => {
193
- const Wrapper = defineComponent({
194
- components: { LuForm, LuInput },
195
- template: `
196
- <LuForm :disabled="true">
197
- <LuInput name="email" modelValue="test" />
198
- </LuForm>
199
- `
200
- });
201
-
202
- const wrapper = mount(Wrapper);
203
- const input = wrapper.find("input");
204
- expect(input.attributes("disabled")).toBeDefined();
205
- });
206
- });
@@ -1,24 +0,0 @@
1
- import { ref, readonly } from "vue";
2
-
3
- export function useRail(defaultExpanded = false) {
4
- const isExpanded = ref(defaultExpanded);
5
-
6
- function toggle() {
7
- isExpanded.value = !isExpanded.value;
8
- }
9
-
10
- function expand() {
11
- isExpanded.value = true;
12
- }
13
-
14
- function collapse() {
15
- isExpanded.value = false;
16
- }
17
-
18
- return {
19
- isExpanded: readonly(isExpanded),
20
- toggle,
21
- expand,
22
- collapse,
23
- };
24
- }
@@ -1,17 +0,0 @@
1
- import { ref, type Ref } from "vue";
2
-
3
- export function useSplit(
4
- containerRef: Ref<HTMLElement | null>,
5
- direction: "horizontal" | "vertical" = "horizontal",
6
- onResize?: (sizes: number[]) => void
7
- ) {
8
- const isDragging = ref(false);
9
-
10
- // Simplified split drag logic hook.
11
- // In a real implementation, this would attach mousedown to resizers,
12
- // and mousemove/mouseup to the window, updating the size of adjacent panes.
13
-
14
- return {
15
- isDragging,
16
- };
17
- }
@@ -1,36 +0,0 @@
1
- import { ref, computed, watchEffect } from "vue";
2
-
3
- export type ThemeMode = "system" | "light" | "dark";
4
- export type ResolvedTheme = "light" | "dark";
5
-
6
- // Global state for the theme
7
- const mode = ref<ThemeMode>("system");
8
- const systemPrefersDark = ref(false);
9
-
10
- // Update system preference when window matches change
11
- if (typeof window !== "undefined") {
12
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
13
- systemPrefersDark.value = mediaQuery.matches;
14
- mediaQuery.addEventListener("change", (e) => {
15
- systemPrefersDark.value = e.matches;
16
- });
17
- }
18
-
19
- const resolved = computed<ResolvedTheme>(() => {
20
- if (mode.value === "system") {
21
- return systemPrefersDark.value ? "dark" : "light";
22
- }
23
- return mode.value;
24
- });
25
-
26
- export function useTheme() {
27
- const setMode = (newMode: ThemeMode) => {
28
- mode.value = newMode;
29
- };
30
-
31
- return {
32
- mode,
33
- resolved,
34
- setMode,
35
- };
36
- }
package/src/context.ts DELETED
@@ -1,36 +0,0 @@
1
- import { inject, isRef, type InjectionKey, type Component } from "vue";
2
- import type { LumoraUIConfig, SkinMap } from "./types";
3
-
4
- export const LumoraUIConfigKey: InjectionKey<LumoraUIConfig> = Symbol("LumoraUIConfig");
5
-
6
- export function useLumoraConfig() {
7
- const config = inject(LumoraUIConfigKey, {});
8
-
9
- const resolveSkin = (componentName: string, variant?: string): string => {
10
- if (!config.skin) return "";
11
-
12
- // Unwrap the skin map if it's a ref
13
- const skinMap = isRef(config.skin) ? config.skin.value : config.skin;
14
- if (!skinMap) return "";
15
-
16
- const componentSkin = skinMap[componentName];
17
- if (!componentSkin) return "";
18
-
19
- const classes: string[] = [];
20
- if (componentSkin.default) {
21
- classes.push(componentSkin.default);
22
- }
23
- if (variant && componentSkin[variant]) {
24
- classes.push(componentSkin[variant] as string);
25
- }
26
-
27
- return classes.join(" ");
28
- };
29
-
30
- const resolveIcon = (name: string, size?: number): Component | null => {
31
- if (!config.icons) return null;
32
- return config.icons(name, size);
33
- };
34
-
35
- return { config, resolveSkin, resolveIcon };
36
- }
@@ -1,23 +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<{
12
- direction?: "vertical" | "horizontal";
13
- variant?: string;
14
- }>();
15
-
16
- const { resolveSkin } = useLumoraConfig();
17
- const resolvedSkin = computed(() =>
18
- resolveSkin("LuDock", props.direction ?? props.variant) ||
19
- (props.direction === "horizontal"
20
- ? "flex flex-row h-full w-full overflow-hidden"
21
- : "flex flex-col h-full w-full overflow-hidden")
22
- );
23
- </script>
@@ -1,18 +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<{
12
- dock?: "top" | "bottom" | "left" | "right" | "fill";
13
- variant?: string;
14
- }>();
15
-
16
- const { resolveSkin } = useLumoraConfig();
17
- const resolvedSkin = computed(() => resolveSkin("LuDockItem", props.dock ?? props.variant));
18
- </script>
@@ -1,17 +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<{
12
- variant?: string;
13
- }>();
14
-
15
- const { resolveSkin } = useLumoraConfig();
16
- const resolvedSkin = computed(() => resolveSkin("LuFill", props.variant));
17
- </script>
@@ -1,17 +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<{
12
- variant?: string;
13
- }>();
14
-
15
- const { resolveSkin } = useLumoraConfig();
16
- const resolvedSkin = computed(() => resolveSkin("LuFixed", props.variant));
17
- </script>
@@ -1,22 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin" :style="gridStyle">
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<{
12
- cols?: number;
13
- variant?: string;
14
- }>();
15
-
16
- const { resolveSkin } = useLumoraConfig();
17
- const resolvedSkin = computed(() => resolveSkin("LuGrid", props.variant) || "grid");
18
-
19
- const gridStyle = computed(() =>
20
- props.cols ? { gridTemplateColumns: `repeat(${props.cols}, minmax(0, 1fr))` } : {}
21
- );
22
- </script>
@@ -1,17 +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<{
12
- variant?: string;
13
- }>();
14
-
15
- const { resolveSkin } = useLumoraConfig();
16
- const resolvedSkin = computed(() => resolveSkin("LuOverlay", props.variant));
17
- </script>
@@ -1,17 +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<{
12
- variant?: string;
13
- }>();
14
-
15
- const { resolveSkin } = useLumoraConfig();
16
- const resolvedSkin = computed(() => resolveSkin("LuScroll", props.variant));
17
- </script>
@@ -1,23 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin" ref="splitRef">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, provide, ref, readonly } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{
12
- direction?: "horizontal" | "vertical";
13
- variant?: string;
14
- }>();
15
-
16
- const direction = computed(() => props.direction ?? "horizontal");
17
- provide("lu-split-direction", readonly(direction));
18
-
19
- const splitRef = ref<HTMLElement | null>(null);
20
-
21
- const { resolveSkin } = useLumoraConfig();
22
- const resolvedSkin = computed(() => resolveSkin("LuSplit", props.direction ?? props.variant));
23
- </script>
@@ -1,32 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin" :style="style">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, inject, ref } from "vue";
9
- import { useLumoraConfig } from "../context";
10
-
11
- const props = defineProps<{
12
- minSize?: number;
13
- maxSize?: number;
14
- defaultSize?: number;
15
- variant?: string;
16
- }>();
17
-
18
- const direction = inject<"horizontal" | "vertical">("lu-split-direction", "horizontal");
19
- const size = ref(props.defaultSize);
20
-
21
- const style = computed(() => {
22
- if (size.value === undefined) return { flex: "1 1 0%" };
23
- const dim = `${size.value}px`;
24
- return direction === "horizontal"
25
- ? { width: dim, flex: `0 0 ${dim}` }
26
- : { height: dim, flex: `0 0 ${dim}` };
27
- });
28
-
29
-
30
- const { resolveSkin } = useLumoraConfig();
31
- const resolvedSkin = computed(() => resolveSkin("LuSplitPane", props.variant));
32
- </script>
@@ -1,17 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin"></div>
3
- </template>
4
-
5
- <script setup lang="ts">
6
- import { computed, inject } from "vue";
7
- import { useLumoraConfig } from "../context";
8
-
9
- const props = defineProps<{
10
- variant?: string;
11
- }>();
12
-
13
- const direction = inject<"horizontal" | "vertical">("lu-split-direction", "horizontal");
14
-
15
- const { resolveSkin } = useLumoraConfig();
16
- const resolvedSkin = computed(() => resolveSkin("LuSplitResizer", direction === "horizontal" ? "horizontal" : "vertical"));
17
- </script>
@@ -1,24 +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<{
12
- direction?: "vertical" | "horizontal";
13
- variant?: string;
14
- }>();
15
-
16
- const { resolveSkin } = useLumoraConfig();
17
- const resolvedSkin = computed(() => {
18
- const base = resolveSkin("LuStack", props.variant);
19
- let extra = "";
20
- if (props.direction === "vertical") extra = " flex-col";
21
- if (props.direction === "horizontal") extra = " flex-row";
22
- return base + extra;
23
- });
24
- </script>
package/src/plugin.ts DELETED
@@ -1,27 +0,0 @@
1
- import type { App, Plugin } from "vue";
2
- import { LumoraUIConfigKey } from "./context";
3
- import type { LumoraUIConfig } from "./types";
4
-
5
- export interface LumoraUIPluginOptions extends LumoraUIConfig {
6
- global?: boolean;
7
- }
8
-
9
- export function createLumoraUI(options: LumoraUIPluginOptions = {}): Plugin {
10
- return {
11
- install(app: App) {
12
- const config: LumoraUIConfig = {
13
- target: options.target ?? "desktop",
14
- skin: options.skin,
15
- locale: options.locale ?? "en-US",
16
- a11y: options.a11y ?? true,
17
- icons: options.icons,
18
- };
19
-
20
- app.provide(LumoraUIConfigKey, config);
21
-
22
- if (options.global) {
23
- // TODO: globally register all components if requested
24
- }
25
- },
26
- };
27
- }
@@ -1,23 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="[resolvedSkin, isExpanded ? expandedSkin : '']" @mouseenter="onHover(true)" @mouseleave="onHover(false)">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, inject, ref } from "vue";
9
- import { useLumoraConfig } from "../../context";
10
-
11
- const props = defineProps<{ variant?: string; expanded?: boolean; expandOnHover?: boolean }>();
12
-
13
- const hovered = ref(false);
14
- const isExpanded = computed(() => props.expanded || (props.expandOnHover && hovered.value));
15
-
16
- const onHover = (val: boolean) => {
17
- hovered.value = val;
18
- };
19
-
20
- const { resolveSkin } = useLumoraConfig();
21
- const resolvedSkin = computed(() => resolveSkin("LuDesktopRailBar", props.variant));
22
- const expandedSkin = computed(() => resolveSkin("LuDesktopRailBar", "expanded"));
23
- </script>
@@ -1,23 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="[resolvedSkin, active ? activeSkin : '']">
3
- <div :class="iconSkin">
4
- <slot name="icon" />
5
- </div>
6
- <div v-if="$slots.default" :class="labelSkin">
7
- <slot />
8
- </div>
9
- </div>
10
- </template>
11
-
12
- <script setup lang="ts">
13
- import { computed } from "vue";
14
- import { useLumoraConfig } from "../../context";
15
-
16
- const props = defineProps<{ variant?: string; active?: boolean }>();
17
-
18
- const { resolveSkin } = useLumoraConfig();
19
- const resolvedSkin = computed(() => resolveSkin("LuDesktopRailItem", props.variant));
20
- const activeSkin = computed(() => resolveSkin("LuDesktopRailItem", "active"));
21
- const iconSkin = computed(() => resolveSkin("LuDesktopRailItemIcon", props.variant) || "flex-shrink-0 flex items-center justify-center w-6 h-6");
22
- const labelSkin = computed(() => resolveSkin("LuDesktopRailItemLabel", props.variant) || "overflow-hidden transition-all duration-200");
23
- </script>
@@ -1,25 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="resolvedSkin">
3
- <slot name="topbar" />
4
- <div :class="contentWrapperSkin">
5
- <slot name="rail" />
6
- <slot name="sidebar" />
7
- <div :class="mainContentSkin">
8
- <slot name="content" />
9
- </div>
10
- </div>
11
- <slot name="statusbar" />
12
- </div>
13
- </template>
14
-
15
- <script setup lang="ts">
16
- import { computed } from "vue";
17
- import { useLumoraConfig } from "../../context";
18
-
19
- const props = defineProps<{ variant?: string }>();
20
-
21
- const { resolveSkin } = useLumoraConfig();
22
- const resolvedSkin = computed(() => resolveSkin("LuDesktopShell", props.variant) || "flex flex-col h-screen w-screen overflow-hidden bg-white");
23
- const contentWrapperSkin = computed(() => resolveSkin("LuDesktopShellContentWrapper") || "flex flex-1 overflow-hidden");
24
- const mainContentSkin = computed(() => resolveSkin("LuDesktopShellMainContent") || "flex flex-1 flex-col overflow-hidden relative");
25
- </script>