Skip to content

Commit b914ea3

Browse files
chore: wip
1 parent 2ebdca4 commit b914ea3

File tree

28 files changed

+630
-298
lines changed

28 files changed

+630
-298
lines changed

.stacks/core/actions/src/helpers/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function runAction(action: string, options?: ActionOptions): Result<SyncS
4545

4646
return runCommand(cmd, {
4747
cwd: options?.cwd ?? p.projectPath(),
48-
...options
48+
...options,
4949
})
5050
}
5151

.stacks/core/buddy/src/commands/fresh.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import process from 'node:process'
22
import type { CLI, FreshOptions } from '@stacksjs/types'
33
import { runAction } from '@stacksjs/actions'
44
import { intro, outro } from '@stacksjs/cli'
5-
import { projectPath } from '@stacksjs/path'
65
import { Action, ExitCode } from '@stacksjs/types'
76

87
export function fresh(buddy: CLI) {

.stacks/core/types/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* The parsed command-line arguments
33
*/
44

5-
export type { Subprocess, SyncSubprocess } from 'bun'
5+
export type { Subprocess, SyncSubprocess } from 'node:bun'
66

77
export interface OutroOptions extends CliOptions {
88
type?: 'success' | 'error' | 'warning' | 'info'

.stacks/core/ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
"prepublishOnly": "bun --bun run build"
5353
},
5454
"peerDependencies": {
55+
"@iconify-json/heroicons": "^1.1.12",
5556
"@iconify-json/heroicons-outline": "^1.1.7",
5657
"@iconify-json/heroicons-solid": "^1.1.8",
57-
"@iconify-json/heroicons": "^1.1.12",
5858
"@iconify/json": "^2.2.102",
5959
"@julr/unocss-preset-forms": "^0.0.5",
6060
"@stacksjs/build": "workspace:*",
@@ -66,9 +66,9 @@
6666
"vue-tsc": "^1.8.8"
6767
},
6868
"dependencies": {
69+
"@iconify-json/heroicons": "^1.1.12",
6970
"@iconify-json/heroicons-outline": "^1.1.7",
7071
"@iconify-json/heroicons-solid": "^1.1.8",
71-
"@iconify-json/heroicons": "^1.1.12",
7272
"@julr/unocss-preset-forms": "^0.0.5",
7373
"@stacksjs/build": "workspace:*",
7474
"@stacksjs/config": "workspace:*",

.stacks/core/vite/src/desktop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { alias } from '@stacksjs/alias'
66
import * as c from 'kolorist'
77
import pkgjson from '../package.json'
88
import app from '../../../../config/app'
9-
import { cssEngine, inspect, uiEngine, pages, layouts } from './stacks'
9+
import { cssEngine, inspect, layouts, pages, uiEngine } from './stacks'
1010
import { type ViteDevServer as DevServer } from './'
1111
import { defineConfig } from './'
1212

.stacks/core/vite/src/plugin/pages.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ export function pages(options?: Options) {
1313

1414
return VueRouter(newOptions)
1515
}
16-
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<script setup lang="ts">
2+
import { ref, computed } from 'vue'
3+
4+
interface Props {
5+
buttonText: string
6+
loadingText?: string
7+
passedClass: string
8+
}
9+
10+
const {
11+
buttonText,
12+
loadingText,
13+
passedClass,
14+
} = defineProps<Props>()
15+
16+
17+
const loading = ref(false);
18+
19+
const buttonString = computed(() => {
20+
return loading.value ? loadingText : buttonText
21+
})
22+
23+
const getClass = computed(() => {
24+
const disabledClass = ' disabled:opacity-50 disabled:cursor-not-allowed'
25+
return passedClass + disabledClass
26+
})
27+
</script>
28+
29+
<template>
30+
<button
31+
type="button"
32+
class="flex items-center"
33+
:disabled="loading"
34+
:class="getClass"
35+
>
36+
<svg
37+
v-if="loading"
38+
class="w-5 h-5 mr-3 -ml-1 text-white animate-spin"
39+
xmlns="http://www.w3.org/2000/svg"
40+
fill="none"
41+
viewBox="0 0 24 24"
42+
>
43+
<circle
44+
class="opacity-25"
45+
cx="12"
46+
cy="12"
47+
r="10"
48+
stroke="currentColor"
49+
stroke-width="4"
50+
/>
51+
<path
52+
class="opacity-75"
53+
fill="currentColor"
54+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
55+
/>
56+
</svg>
57+
<slot v-if="!loading" name="icon" />
58+
59+
<span>
60+
{{ buttonString }}
61+
</span>
62+
</button>
63+
</template>
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
<script setup lang="ts">
2+
import BaseModal from '../BaseModal.vue'
3+
import AppButton from '../../Buttons/AppButton.vue'
4+
5+
import { computed } from 'vue'
6+
7+
const {
8+
title,
9+
description,
10+
type,
11+
confirmationText,
12+
abortText,
13+
} = defineProps<Props>()
14+
15+
const emit = defineEmits(['cancel', 'confirm'])
16+
17+
interface Props {
18+
title: string
19+
description: String
20+
type: String
21+
confirmationText: String
22+
abortText: String
23+
}
24+
25+
const buttonBackground = computed(() => {
26+
if (type === 'info')
27+
return 'bg-blue-600 hover:bg-blue-700 focus:ring-blue-500'
28+
29+
if (type === 'warning')
30+
return 'bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500'
31+
32+
if (type === 'danger')
33+
return 'bg-red-600 hover:bg-red-700 focus:ring-red-500'
34+
35+
if (type === 'success')
36+
return 'bg-green-600 hover:bg-green-700 focus:ring-green-500'
37+
38+
return 'bg-white-600 hover:bg-gray-50 '
39+
})
40+
41+
function abortAction() {
42+
emit('cancel')
43+
}
44+
function confirmAction() {
45+
emit('confirm')
46+
}
47+
</script>
48+
49+
<template>
50+
<BaseModal @close-modal="abortAction()">
51+
<template #modal-body>
52+
<div class="absolute top-0 right-0 hidden pt-4 pr-4 sm:block">
53+
<button
54+
type="button"
55+
class="text-gray-400 rounded-md dark:text-gray-200 dark-hover:text-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2"
56+
@click="abortAction()"
57+
>
58+
<span class="sr-only">Close</span>
59+
<!-- Heroicon name: outline/x-mark -->
60+
<svg
61+
class="w-6 h-6"
62+
xmlns="http://www.w3.org/2000/svg"
63+
fill="none"
64+
viewBox="0 0 24 24"
65+
stroke-width="1.5"
66+
stroke="currentColor"
67+
aria-hidden="true"
68+
>
69+
<path
70+
stroke-linecap="round"
71+
stroke-linejoin="round"
72+
d="M6 18L18 6M6 6l12 12"
73+
/>
74+
</svg>
75+
</button>
76+
</div>
77+
78+
<div class="sm:flex sm:items-start">
79+
<div
80+
v-if="type === 'warning'"
81+
class="flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-yellow-100 rounded-full sm:mx-0 sm:h-10 sm:w-10"
82+
>
83+
<!-- Heroicon name: outline/exclamation-triangle -->
84+
<svg
85+
class="w-6 h-6 text-yellow-600"
86+
xmlns="http://www.w3.org/2000/svg"
87+
fill="none"
88+
viewBox="0 0 24 24"
89+
stroke-width="1.5"
90+
stroke="currentColor"
91+
aria-hidden="true"
92+
>
93+
<path
94+
stroke-linecap="round"
95+
stroke-linejoin="round"
96+
d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
97+
/>
98+
</svg>
99+
</div>
100+
<div
101+
v-if="type === 'success'"
102+
class="flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-green-100 rounded-full sm:mx-0 sm:h-10 sm:w-10"
103+
>
104+
<svg
105+
class="w-6 h-6 text-green-600"
106+
fill="none"
107+
stroke="currentColor"
108+
stroke-width="1.5"
109+
viewBox="0 0 24 24"
110+
xmlns="http://www.w3.org/2000/svg"
111+
aria-hidden="true"
112+
>
113+
<path
114+
stroke-linecap="round"
115+
stroke-linejoin="round"
116+
d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
117+
/>
118+
</svg>
119+
</div>
120+
<div
121+
v-if="type === 'error'"
122+
class="flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-red-100 rounded-full sm:mx-0 sm:h-10 sm:w-10"
123+
>
124+
<svg
125+
class="w-6 h-6 text-red-600"
126+
fill="none"
127+
stroke="currentColor"
128+
stroke-width="1.5"
129+
viewBox="0 0 24 24"
130+
xmlns="http://www.w3.org/2000/svg"
131+
aria-hidden="true"
132+
>
133+
<path
134+
stroke-linecap="round"
135+
stroke-linejoin="round"
136+
d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
137+
/>
138+
</svg>
139+
</div>
140+
<div
141+
v-if="type === 'info'"
142+
class="flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-blue-100 rounded-full sm:mx-0 sm:h-10 sm:w-10"
143+
>
144+
<svg
145+
class="w-6 h-6 text-blue-600"
146+
fill="none"
147+
stroke="currentColor"
148+
stroke-width="1.5"
149+
viewBox="0 0 24 24"
150+
xmlns="http://www.w3.org/2000/svg"
151+
aria-hidden="true"
152+
>
153+
<path
154+
stroke-linecap="round"
155+
stroke-linejoin="round"
156+
d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"
157+
/>
158+
</svg>
159+
</div>
160+
161+
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
162+
<h3
163+
id="modal-title"
164+
class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100"
165+
>
166+
{{ title }}
167+
</h3>
168+
<div class="mt-2">
169+
<p class="text-sm text-gray-500 dark:text-gray-400">
170+
{{ description }}
171+
</p>
172+
</div>
173+
</div>
174+
</div>
175+
</template>
176+
177+
<template #modal-actions>
178+
<AppButton
179+
:button-text="String(confirmationText)"
180+
loading-text="Confirming..."
181+
:passed-class="`primary-button ${buttonBackground}`"
182+
@click="confirmAction()"
183+
/>
184+
185+
<button
186+
v-if="abortText"
187+
type="button"
188+
class="mr-4 secondary-button"
189+
@click="abortAction()"
190+
>
191+
{{ abortText }}
192+
</button>
193+
</template>
194+
</BaseModal>
195+
</template>

0 commit comments

Comments
 (0)