@astrake/lumora-ui 0.2.0 → 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 (179) hide show
  1. package/CHANGELOG.md +141 -137
  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/dist/components/index.js +47 -0
  53. package/{src/composables/index.ts → dist/composables/index.d.ts} +0 -1
  54. package/dist/composables/index.js +30 -0
  55. package/dist/composables/useRail.d.ts +6 -0
  56. package/dist/composables/useSplit.d.ts +4 -0
  57. package/dist/composables/useTheme.d.ts +7 -0
  58. package/dist/context-0gENwESP.js +62 -0
  59. package/dist/context.d.ts +8 -0
  60. package/{src/index.ts → dist/index.d.ts} +0 -1
  61. package/dist/index.js +94 -0
  62. package/dist/layout/LuDock.vue.d.ts +9 -0
  63. package/dist/layout/LuDockItem.vue.d.ts +16 -0
  64. package/dist/layout/LuFill.vue.d.ts +21 -0
  65. package/dist/layout/LuFixed.vue.d.ts +21 -0
  66. package/dist/layout/LuGrid.vue.d.ts +26 -0
  67. package/dist/layout/LuOverlay.vue.d.ts +15 -0
  68. package/dist/layout/LuScroll.vue.d.ts +15 -0
  69. package/dist/layout/LuSplit.vue.d.ts +16 -0
  70. package/dist/layout/LuSplitPane.vue.d.ts +18 -0
  71. package/dist/layout/LuSplitResizer.vue.d.ts +5 -0
  72. package/dist/layout/LuStack.vue.d.ts +23 -0
  73. package/{src/layout/index.ts → dist/layout/index.d.ts} +1 -14
  74. package/dist/layout/index.js +14 -0
  75. package/dist/plugin.d.ts +6 -0
  76. package/dist/shell/desktop/LuDesktopRailBar.vue.d.ts +17 -0
  77. package/dist/shell/desktop/LuDesktopRailItem.vue.d.ts +18 -0
  78. package/dist/shell/desktop/LuDesktopShell.vue.d.ts +23 -0
  79. package/dist/shell/desktop/LuDesktopSidebar.vue.d.ts +21 -0
  80. package/dist/shell/desktop/LuDesktopStatusBar.vue.d.ts +15 -0
  81. package/dist/shell/desktop/LuDesktopTopBar.vue.d.ts +15 -0
  82. package/dist/shell/embedded/LuEmbeddedShell.vue.d.ts +19 -0
  83. package/dist/shell/embedded/LuEmbeddedStatusBar.vue.d.ts +17 -0
  84. package/dist/shell/embedded/LuEmbeddedTopBar.vue.d.ts +19 -0
  85. package/{src/shell/index.ts → dist/shell/index.d.ts} +0 -1
  86. package/dist/shell/index.js +15 -0
  87. package/dist/shell/mobile/LuMobileHeader.vue.d.ts +19 -0
  88. package/dist/shell/mobile/LuMobileNavBar.vue.d.ts +15 -0
  89. package/dist/shell/mobile/LuMobileShell.vue.d.ts +21 -0
  90. package/dist/skins/default.d.ts +2 -0
  91. package/{src/skins/default.ts → dist/skins/index.js} +119 -129
  92. package/dist/tailwind.d.ts +1 -0
  93. package/dist/tailwind.js +13 -0
  94. package/dist/types.d.ts +15 -0
  95. package/dist/useTheme-Cd4wVaLs.js +21 -0
  96. package/dist/utils.d.ts +21 -0
  97. package/package.json +94 -69
  98. package/src/lumora.css +16 -16
  99. package/src/components/LuAlert.vue +0 -33
  100. package/src/components/LuAvatar.vue +0 -22
  101. package/src/components/LuBadge.vue +0 -15
  102. package/src/components/LuBreadcrumb.vue +0 -63
  103. package/src/components/LuButton.vue +0 -58
  104. package/src/components/LuCard.vue +0 -27
  105. package/src/components/LuCheckbox.vue +0 -94
  106. package/src/components/LuCodeBlock.vue +0 -168
  107. package/src/components/LuCollapsible.vue +0 -34
  108. package/src/components/LuDivider.vue +0 -18
  109. package/src/components/LuForm.types.ts +0 -24
  110. package/src/components/LuForm.vue +0 -121
  111. package/src/components/LuIcon.vue +0 -39
  112. package/src/components/LuInput.vue +0 -82
  113. package/src/components/LuLink.vue +0 -47
  114. package/src/components/LuMenu.vue +0 -86
  115. package/src/components/LuMenuItem.vue +0 -37
  116. package/src/components/LuModal.vue +0 -115
  117. package/src/components/LuPageHeader.vue +0 -24
  118. package/src/components/LuPagination.vue +0 -118
  119. package/src/components/LuProgressBar.vue +0 -21
  120. package/src/components/LuRadio.vue +0 -55
  121. package/src/components/LuRadioGroup.types.ts +0 -10
  122. package/src/components/LuRadioGroup.vue +0 -66
  123. package/src/components/LuSelect.vue +0 -67
  124. package/src/components/LuSkeleton.vue +0 -15
  125. package/src/components/LuSpinner.vue +0 -36
  126. package/src/components/LuSwitch.vue +0 -76
  127. package/src/components/LuTab.vue +0 -26
  128. package/src/components/LuTabList.vue +0 -15
  129. package/src/components/LuTabPanel.vue +0 -19
  130. package/src/components/LuTable.vue +0 -15
  131. package/src/components/LuTableBody.vue +0 -15
  132. package/src/components/LuTableCell.vue +0 -15
  133. package/src/components/LuTableHead.vue +0 -15
  134. package/src/components/LuTableHeadCell.vue +0 -15
  135. package/src/components/LuTableRow.vue +0 -15
  136. package/src/components/LuTabs.vue +0 -30
  137. package/src/components/LuTag.vue +0 -35
  138. package/src/components/LuText.vue +0 -18
  139. package/src/components/LuTextarea.vue +0 -62
  140. package/src/components/LuThemeSelect.vue +0 -26
  141. package/src/components/LuThemeSwitch.vue +0 -22
  142. package/src/components/LuToggleButton.vue +0 -35
  143. package/src/components/LuToggleGroup.vue +0 -27
  144. package/src/components/LuTooltip.vue +0 -36
  145. package/src/components/__tests__/LuForm.test.ts +0 -206
  146. package/src/composables/useRail.ts +0 -24
  147. package/src/composables/useSplit.ts +0 -17
  148. package/src/composables/useTheme.ts +0 -36
  149. package/src/context.ts +0 -39
  150. package/src/layout/LuDock.vue +0 -56
  151. package/src/layout/LuDockItem.vue +0 -20
  152. package/src/layout/LuFill.vue +0 -27
  153. package/src/layout/LuFixed.vue +0 -27
  154. package/src/layout/LuGrid.vue +0 -45
  155. package/src/layout/LuOverlay.vue +0 -17
  156. package/src/layout/LuScroll.vue +0 -19
  157. package/src/layout/LuSplit.vue +0 -23
  158. package/src/layout/LuSplitPane.vue +0 -32
  159. package/src/layout/LuSplitResizer.vue +0 -19
  160. package/src/layout/LuStack.vue +0 -29
  161. package/src/plugin.ts +0 -28
  162. package/src/shell/desktop/LuDesktopRailBar.vue +0 -23
  163. package/src/shell/desktop/LuDesktopRailItem.vue +0 -23
  164. package/src/shell/desktop/LuDesktopShell.vue +0 -25
  165. package/src/shell/desktop/LuDesktopSidebar.vue +0 -36
  166. package/src/shell/desktop/LuDesktopStatusBar.vue +0 -15
  167. package/src/shell/desktop/LuDesktopTopBar.vue +0 -15
  168. package/src/shell/embedded/LuEmbeddedShell.vue +0 -20
  169. package/src/shell/embedded/LuEmbeddedStatusBar.vue +0 -16
  170. package/src/shell/embedded/LuEmbeddedTopBar.vue +0 -17
  171. package/src/shell/mobile/LuMobileHeader.vue +0 -17
  172. package/src/shell/mobile/LuMobileNavBar.vue +0 -15
  173. package/src/shell/mobile/LuMobileShell.vue +0 -21
  174. package/src/tailwind.ts +0 -25
  175. package/src/types.ts +0 -18
  176. package/src/utils.ts +0 -95
  177. package/tsconfig.json +0 -10
  178. /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
  179. /package/{src/skins/index.ts → dist/skins/index.d.ts} +0 -0
package/package.json CHANGED
@@ -1,69 +1,94 @@
1
- {
2
- "name": "@astrake/lumora-ui",
3
- "version": "0.2.0",
4
- "description": "Headless Vue 3 component framework for three surface targets — Mobile, Desktop, and Embedded — with a unified --lu-* design token system.",
5
- "author": "Anuvab Chakraborty (https://github.com/madlybong)",
6
- "license": "MIT",
7
- "type": "module",
8
- "exports": {
9
- ".": "./src/index.ts",
10
- "./style": "./src/lumora.css",
11
- "./tailwind": "./src/tailwind.ts",
12
- "./layout": "./src/layout/index.ts",
13
- "./shell": "./src/shell/index.ts",
14
- "./components": "./src/components/index.ts",
15
- "./composables": "./src/composables/index.ts",
16
- "./skins": "./src/skins/index.ts"
17
- },
18
- "keywords": [
19
- "vue",
20
- "vue3",
21
- "ui",
22
- "components",
23
- "mobile",
24
- "desktop",
25
- "embedded",
26
- "headless",
27
- "design-tokens",
28
- "lumora",
29
- "astrake",
30
- "typescript"
31
- ],
32
- "repository": {
33
- "type": "git",
34
- "url": "https://github.com/madlybong/LumoraUI.git"
35
- },
36
- "homepage": "https://ui.lumora.astrake.com",
37
- "bugs": {
38
- "url": "https://github.com/madlybong/LumoraUI/issues"
39
- },
40
- "funding": {
41
- "type": "github",
42
- "url": "https://github.com/sponsors/madlybong"
43
- },
44
- "publishConfig": {
45
- "access": "public",
46
- "registry": "https://registry.npmjs.org/"
47
- },
48
- "files": [
49
- "src",
50
- "tsconfig.json",
51
- "README.md",
52
- "CHANGELOG.md"
53
- ],
54
- "scripts": {
55
- "prepack": "bun -e \"await Bun.write('README.md', await Bun.file('../../README.md').text()); await Bun.write('CHANGELOG.md', await Bun.file('../../CHANGELOG.md').text())\"",
56
- "postpack": "bun -e \"import { unlinkSync } from 'fs'; try { unlinkSync('README.md') } catch(e){} try { unlinkSync('CHANGELOG.md') } catch(e){}\"",
57
- "build": "bun run ../../tools/build.ts",
58
- "check": "vue-tsc -p ./tsconfig.json"
59
- },
60
- "peerDependencies": {
61
- "tailwindcss": "^4.0.0",
62
- "vue": "^3.5.0"
63
- },
64
- "dependencies": {
65
- "clsx": "^2.1.1",
66
- "shiki": "^4.0.2",
67
- "tailwind-merge": "^3.5.0"
68
- }
69
- }
1
+ {
2
+ "name": "@astrake/lumora-ui",
3
+ "version": "0.2.1",
4
+ "description": "Headless Vue 3 component framework for three surface targets — Mobile, Desktop, and Embedded — with a unified --lu-* design token system.",
5
+ "author": "Anuvab Chakraborty (https://github.com/madlybong)",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./style": "./src/lumora.css",
17
+ "./tailwind": {
18
+ "types": "./dist/tailwind.d.ts",
19
+ "import": "./dist/tailwind.js"
20
+ },
21
+ "./layout": {
22
+ "types": "./dist/layout/index.d.ts",
23
+ "import": "./dist/layout/index.js"
24
+ },
25
+ "./shell": {
26
+ "types": "./dist/shell/index.d.ts",
27
+ "import": "./dist/shell/index.js"
28
+ },
29
+ "./components": {
30
+ "types": "./dist/components/index.d.ts",
31
+ "import": "./dist/components/index.js"
32
+ },
33
+ "./composables": {
34
+ "types": "./dist/composables/index.d.ts",
35
+ "import": "./dist/composables/index.js"
36
+ },
37
+ "./skins": {
38
+ "types": "./dist/skins/index.d.ts",
39
+ "import": "./dist/skins/index.js"
40
+ }
41
+ },
42
+ "keywords": [
43
+ "vue",
44
+ "vue3",
45
+ "ui",
46
+ "components",
47
+ "mobile",
48
+ "desktop",
49
+ "embedded",
50
+ "headless",
51
+ "design-tokens",
52
+ "lumora",
53
+ "astrake",
54
+ "typescript"
55
+ ],
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://github.com/madlybong/LumoraUI.git"
59
+ },
60
+ "homepage": "https://ui.lumora.astrake.com",
61
+ "bugs": {
62
+ "url": "https://github.com/madlybong/LumoraUI/issues"
63
+ },
64
+ "funding": {
65
+ "type": "github",
66
+ "url": "https://github.com/sponsors/madlybong"
67
+ },
68
+ "publishConfig": {
69
+ "access": "public",
70
+ "registry": "https://registry.npmjs.org/"
71
+ },
72
+ "files": [
73
+ "dist",
74
+ "src/lumora.css",
75
+ "README.md",
76
+ "CHANGELOG.md"
77
+ ],
78
+ "scripts": {
79
+ "prepack": "bun run build && bun -e \"await Bun.write('README.md', await Bun.file('../../README.md').text()); await Bun.write('CHANGELOG.md', await Bun.file('../../CHANGELOG.md').text())\"",
80
+ "postpack": "bun -e \"import { unlinkSync } from 'fs'; try { unlinkSync('README.md') } catch(e){} try { unlinkSync('CHANGELOG.md') } catch(e){}\"",
81
+ "build:types": "bun -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\" && bun run vue-tsc -p tsconfig.build.json",
82
+ "build": "bun -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\" && bun run vue-tsc -p tsconfig.build.json && bun run ../../node_modules/vite/bin/vite.js build -c vite.config.ts",
83
+ "check": "vue-tsc -p ./tsconfig.json"
84
+ },
85
+ "peerDependencies": {
86
+ "tailwindcss": "^4.0.0",
87
+ "vue": "^3.5.0"
88
+ },
89
+ "dependencies": {
90
+ "clsx": "^2.1.1",
91
+ "shiki": "^4.0.2",
92
+ "tailwind-merge": "^3.5.0"
93
+ }
94
+ }
package/src/lumora.css CHANGED
@@ -1,16 +1,16 @@
1
- /* LumoraUI structural baseline — Tailwind v4 Escape Hatch, v0.1.7+ */
2
- /* Consumers MUST import this: import '@astrake/lumora-ui/style' */
3
-
4
- /*
5
- With the transition to Tailwind v4 as the native design engine,
6
- all structural layout classes (e.g., .lu-button, .lu-stack) have been removed.
7
- Layout structure is now provided by the defaultSkin (`default.ts`) out of the box.
8
-
9
- This file serves as an escape hatch for:
10
- 1. Complex [data-state="..."] selector combinations.
11
- 2. Webkit scrollbar pseudoclasses.
12
- 3. Keyframe animations that Tailwind v4 cannot natively express.
13
- */
14
-
15
- /* Example: Webkit Scrollbar overrides can go here */
16
-
1
+ /* LumoraUI structural baseline — Tailwind v4 Escape Hatch, v0.1.7+ */
2
+ /* Consumers MUST import this: import '@astrake/lumora-ui/style' */
3
+
4
+ /*
5
+ With the transition to Tailwind v4 as the native design engine,
6
+ all structural layout classes (e.g., .lu-button, .lu-stack) have been removed.
7
+ Layout structure is now provided by the defaultSkin (`default.ts`) out of the box.
8
+
9
+ This file serves as an escape hatch for:
10
+ 1. Complex [data-state="..."] selector combinations.
11
+ 2. Webkit scrollbar pseudoclasses.
12
+ 3. Keyframe animations that Tailwind v4 cannot natively express.
13
+ */
14
+
15
+ /* Example: Webkit Scrollbar overrides can go here */
16
+
@@ -1,33 +0,0 @@
1
- <template>
2
- <div :class="resolvedSkin" role="alert">
3
- <div v-if="$slots.icon || icon" :class="resolvedIconWrapperSkin">
4
- <slot name="icon">
5
- <LuIcon v-if="icon" :name="icon" />
6
- </slot>
7
- </div>
8
- <div :class="resolvedContentSkin">
9
- <slot />
10
- </div>
11
- <div v-if="$slots.action" :class="resolvedActionSkin">
12
- <slot name="action" />
13
- </div>
14
- </div>
15
- </template>
16
-
17
- <script setup lang="ts">
18
- import { computed } from "vue";
19
- import { useLumoraConfig } from "../context";
20
- import LuIcon from "./LuIcon.vue";
21
-
22
- const props = defineProps<{
23
- variant?: string;
24
- icon?: string;
25
- }>();
26
-
27
- const { resolveSkin } = useLumoraConfig();
28
-
29
- const resolvedSkin = computed(() => resolveSkin("LuAlert", props.variant));
30
- const resolvedIconWrapperSkin = computed(() => resolveSkin("LuAlertIcon", props.variant));
31
- const resolvedContentSkin = computed(() => resolveSkin("LuAlertContent", props.variant));
32
- const resolvedActionSkin = computed(() => resolveSkin("LuAlertAction", props.variant));
33
- </script>
@@ -1,22 +0,0 @@
1
- <template>
2
- <div v-bind="$attrs" :class="containerSkin" :data-size="size">
3
- <img v-if="src && !hasError" :src="src" :alt="alt" :class="imageSkin" @error="hasError = true" />
4
- <div v-else :class="fallbackSkin">
5
- <slot>{{ fallback }}</slot>
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; src?: string; fallback?: string; alt?: string; size?: string }>();
15
-
16
- const hasError = ref(false);
17
-
18
- const { resolveSkin } = useLumoraConfig();
19
- const containerSkin = computed(() => resolveSkin("LuAvatar", props.variant));
20
- const imageSkin = computed(() => resolveSkin("LuAvatarImage", props.variant));
21
- const fallbackSkin = computed(() => resolveSkin("LuAvatarFallback", props.variant));
22
- </script>
@@ -1,15 +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<{ variant?: string; as?: string }>();
12
-
13
- const { resolveSkin } = useLumoraConfig();
14
- const resolvedSkin = computed(() => resolveSkin("LuBadge", props.variant));
15
- </script>
@@ -1,63 +0,0 @@
1
- <template>
2
- <nav aria-label="breadcrumb">
3
- <ol :class="resolvedSkin">
4
- <li v-for="(item, index) in items" :key="index" :class="resolvedItemSkin">
5
- <LuLink
6
- v-if="item.href || item.to"
7
- :href="item.href"
8
- :to="item.to"
9
- :variant="item.current ? 'nav-active' : 'nav'"
10
- :aria-current="item.current ? 'page' : undefined"
11
- :class="resolvedLinkSkin"
12
- >
13
- <LuIcon v-if="item.icon" :name="item.icon" class="mr-2 h-4 w-4" />
14
- {{ item.label }}
15
- </LuLink>
16
- <span
17
- v-else
18
- :class="resolvedPageSkin"
19
- :aria-current="item.current ? 'page' : undefined"
20
- >
21
- <LuIcon v-if="item.icon" :name="item.icon" class="mr-2 h-4 w-4" />
22
- {{ item.label }}
23
- </span>
24
- <LuIcon
25
- v-if="index < items.length - 1"
26
- :name="separatorIcon"
27
- :class="resolvedSeparatorSkin"
28
- />
29
- </li>
30
- </ol>
31
- </nav>
32
- </template>
33
-
34
- <script setup lang="ts">
35
- import { computed } from "vue";
36
- import { useLumoraConfig } from "../context";
37
- import LuLink from "./LuLink.vue";
38
- import LuIcon from "./LuIcon.vue";
39
-
40
- export interface LuBreadcrumbItem {
41
- label: string;
42
- href?: string;
43
- to?: any;
44
- current?: boolean;
45
- icon?: string;
46
- }
47
-
48
- const props = withDefaults(defineProps<{
49
- items: LuBreadcrumbItem[];
50
- variant?: string;
51
- separatorIcon?: string;
52
- }>(), {
53
- separatorIcon: 'chevron-right'
54
- });
55
-
56
- const { resolveSkin } = useLumoraConfig();
57
-
58
- const resolvedSkin = computed(() => resolveSkin("LuBreadcrumb", props.variant));
59
- const resolvedItemSkin = computed(() => resolveSkin("LuBreadcrumbItem", props.variant));
60
- const resolvedLinkSkin = computed(() => resolveSkin("LuBreadcrumbLink", props.variant));
61
- const resolvedPageSkin = computed(() => resolveSkin("LuBreadcrumbPage", props.variant));
62
- const resolvedSeparatorSkin = computed(() => resolveSkin("LuBreadcrumbSeparator", props.variant));
63
- </script>
@@ -1,58 +0,0 @@
1
- <template>
2
- <component
3
- :is="componentType"
4
- v-bind="bindingProps"
5
- :class="resolvedSkin"
6
- @click="emit('click', $event)"
7
- >
8
- <slot />
9
- </component>
10
- </template>
11
-
12
- <script setup lang="ts">
13
- import { computed, resolveComponent, useAttrs } from "vue";
14
- import { useLumoraConfig } from "../context";
15
-
16
- const props = defineProps<{
17
- type?: "button" | "submit" | "reset";
18
- disabled?: boolean;
19
- variant?: string;
20
- as?: string;
21
- to?: any;
22
- href?: string;
23
- }>();
24
-
25
- const emit = defineEmits<{
26
- (e: "click", event: MouseEvent): void;
27
- }>();
28
-
29
- const componentType = computed(() => {
30
- if (props.as) return props.as;
31
- if (props.to) {
32
- const routerLink = resolveComponent("RouterLink");
33
- return typeof routerLink === 'string' ? 'a' : routerLink;
34
- }
35
- if (props.href) return "a";
36
- return "button";
37
- });
38
-
39
- const bindingProps = computed(() => {
40
- const p: any = { ...props, ...useAttrs() };
41
- delete p.variant;
42
- delete p.as;
43
-
44
- if (componentType.value !== 'button') {
45
- delete p.type;
46
- }
47
- if (props.disabled && componentType.value !== 'button') {
48
- // Buttons can be natively disabled, but links cannot easily.
49
- // However, if disabled is true, we keep it so CSS can style it.
50
- // To prevent click navigation on disabled links, we would need to handle the click event.
51
- // For now, we pass it down so styling works.
52
- }
53
- return p;
54
- });
55
-
56
- const { resolveSkin } = useLumoraConfig();
57
- const resolvedSkin = computed(() => resolveSkin("LuButton", props.variant));
58
- </script>
@@ -1,27 +0,0 @@
1
- <template>
2
- <component :is="as" 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
- import { resolveLayoutProps, cn } from "../utils";
11
-
12
- const props = withDefaults(defineProps<{
13
- variant?: string;
14
- as?: string;
15
- padding?: string | number;
16
- width?: string;
17
- height?: string;
18
- }>(), {
19
- as: "div"
20
- });
21
-
22
- const { resolveSkin } = useLumoraConfig();
23
- const resolvedSkin = computed(() => cn(
24
- resolveSkin("LuCard", props.variant),
25
- resolveLayoutProps(props)
26
- ));
27
- </script>
@@ -1,94 +0,0 @@
1
- <template>
2
- <div :class="resolvedContainerSkin">
3
- <input
4
- type="checkbox"
5
- v-bind="$attrs"
6
- :class="resolvedSkin"
7
- :checked="modelValue"
8
- :name="name"
9
- :disabled="formContext?.disabled.value"
10
- @change="onChange"
11
- @blur="onBlur"
12
- />
13
- <label v-if="$slots.default || label" :class="resolvedLabelSkin" @click.prevent="toggle">
14
- <slot>{{ label }}</slot>
15
- </label>
16
- </div>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import { computed, inject, onMounted, onUnmounted, ref, watch } from "vue";
21
- import { useLumoraConfig } from "../context";
22
- import { LuFormContextKey } from "./LuForm.types";
23
-
24
- const props = defineProps<{
25
- modelValue?: boolean;
26
- variant?: string;
27
- name?: string;
28
- label?: string;
29
- error?: string | null;
30
- }>();
31
-
32
- const emit = defineEmits<{
33
- (e: "update:modelValue", value: boolean): void;
34
- (e: "change", value: boolean): void;
35
- (e: "blur"): void;
36
- }>();
37
-
38
- const { resolveSkin } = useLumoraConfig();
39
- const resolvedContainerSkin = computed(() => resolveSkin("LuCheckboxContainer", props.variant));
40
- const resolvedSkin = computed(() => resolveSkin("LuCheckbox", props.variant));
41
- const resolvedLabelSkin = computed(() => resolveSkin("LuCheckboxLabel", props.variant));
42
-
43
- const formContext = inject(LuFormContextKey, null);
44
- const internalValue = ref<boolean>(!!props.modelValue);
45
-
46
- watch(() => props.modelValue, (newVal) => {
47
- internalValue.value = !!newVal;
48
- });
49
-
50
- const onChange = (event: Event) => {
51
- const target = event.target as HTMLInputElement;
52
- const value = target.checked;
53
- internalValue.value = value;
54
- emit("update:modelValue", value);
55
- emit("change", value);
56
-
57
- if (props.name && formContext && (formContext.validateOn.value === "blur" || formContext.validateOn.value === "both")) {
58
- // trigger validation handled by parent
59
- }
60
- };
61
-
62
- const toggle = () => {
63
- if (formContext?.disabled.value || ("disabled" in props && (props as any).disabled !== false)) return;
64
- const newValue = !internalValue.value;
65
- internalValue.value = newValue;
66
- emit("update:modelValue", newValue);
67
- emit("change", newValue);
68
-
69
- if (props.name && formContext && (formContext.validateOn.value === "blur" || formContext.validateOn.value === "both")) {
70
- // trigger validation handled by parent
71
- }
72
- };
73
-
74
- const onBlur = () => {
75
- if (props.name && formContext && (formContext.validateOn.value === "blur" || formContext.validateOn.value === "both")) {
76
- // trigger validation handled by parent
77
- }
78
- emit("blur");
79
- };
80
-
81
- onMounted(() => {
82
- if (!props.name || !formContext) return;
83
- formContext.register({
84
- name: props.name,
85
- getValue: () => internalValue.value,
86
- setValue: (v) => { internalValue.value = !!v; },
87
- setError: (_msg) => {},
88
- });
89
- });
90
-
91
- onUnmounted(() => {
92
- if (props.name && formContext) formContext.unregister(props.name);
93
- });
94
- </script>