@aerogel/cli 0.0.0-next.f9394854509d71d644498ac087706a2f8f8eea1c → 0.1.0-next.a2c47ef9c46c7b0d64e60e038d48772b0444e38a

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 (92) hide show
  1. package/bin/gel +1 -1
  2. package/dist/aerogel-cli.d.ts +1 -1
  3. package/dist/aerogel-cli.js +789 -0
  4. package/dist/aerogel-cli.js.map +1 -0
  5. package/package.json +21 -33
  6. package/src/cli.ts +9 -11
  7. package/src/commands/Command.ts +3 -3
  8. package/src/commands/create.test.ts +2 -25
  9. package/src/commands/create.ts +16 -20
  10. package/src/commands/generate-component.test.ts +1 -61
  11. package/src/commands/generate-component.ts +14 -90
  12. package/src/commands/generate-model.test.ts +2 -2
  13. package/src/commands/generate-model.ts +11 -12
  14. package/src/commands/generate-service.test.ts +1 -1
  15. package/src/commands/generate-service.ts +14 -14
  16. package/src/commands/info.ts +7 -6
  17. package/src/commands/install.test.ts +63 -14
  18. package/src/commands/install.ts +29 -15
  19. package/src/lib/App.ts +50 -48
  20. package/src/lib/Editor.ts +3 -4
  21. package/src/lib/File.mock.ts +12 -6
  22. package/src/lib/File.ts +32 -2
  23. package/src/lib/Log.mock.ts +3 -3
  24. package/src/lib/Log.test.ts +4 -4
  25. package/src/lib/Log.ts +6 -6
  26. package/src/lib/Shell.mock.ts +5 -1
  27. package/src/lib/Shell.ts +1 -1
  28. package/src/lib/Template.ts +19 -16
  29. package/src/lib/utils/app.ts +2 -2
  30. package/src/lib/utils/edit.ts +2 -2
  31. package/src/lib/utils/paths.ts +19 -7
  32. package/src/plugins/LocalFirst.ts +9 -0
  33. package/src/plugins/Plugin.ts +37 -39
  34. package/src/plugins/Solid.ts +15 -22
  35. package/src/plugins/Soukai.ts +8 -7
  36. package/src/testing/setup.ts +34 -26
  37. package/src/utils/package.ts +23 -0
  38. package/templates/app/README.md +1 -1
  39. package/templates/model/[model.name].schema.ts +3 -2
  40. package/.prettierignore +0 -1
  41. package/dist/aerogel-cli.cjs.js +0 -2
  42. package/dist/aerogel-cli.cjs.js.map +0 -1
  43. package/dist/aerogel-cli.esm.js +0 -2
  44. package/dist/aerogel-cli.esm.js.map +0 -1
  45. package/src/commands/generate-overrides.ts +0 -85
  46. package/src/plugins/Histoire.ts +0 -113
  47. package/templates/app/.github/workflows/ci.yml +0 -29
  48. package/templates/app/.gitignore.template +0 -2
  49. package/templates/app/.nvmrc +0 -1
  50. package/templates/app/.vscode/launch.json +0 -16
  51. package/templates/app/.vscode/settings.json +0 -10
  52. package/templates/app/cypress/cypress.config.ts +0 -14
  53. package/templates/app/cypress/e2e/app.cy.ts +0 -9
  54. package/templates/app/cypress/support/e2e.ts +0 -1
  55. package/templates/app/cypress/tsconfig.json +0 -14
  56. package/templates/app/index.html +0 -13
  57. package/templates/app/package.json +0 -67
  58. package/templates/app/postcss.config.js +0 -6
  59. package/templates/app/src/App.vue +0 -12
  60. package/templates/app/src/assets/css/main.css +0 -3
  61. package/templates/app/src/assets/public/robots.txt +0 -2
  62. package/templates/app/src/lang/en.yaml +0 -3
  63. package/templates/app/src/main.test.ts +0 -9
  64. package/templates/app/src/main.ts +0 -13
  65. package/templates/app/src/types/globals.d.ts +0 -2
  66. package/templates/app/src/types/shims.d.ts +0 -7
  67. package/templates/app/src/types/ts-reset.d.ts +0 -1
  68. package/templates/app/tailwind.config.js +0 -5
  69. package/templates/app/tsconfig.json +0 -19
  70. package/templates/app/vite.config.ts +0 -30
  71. package/templates/component-button/[component.name].vue +0 -42
  72. package/templates/component-button-story/[component.name].story.vue +0 -77
  73. package/templates/component-checkbox/[component.name].vue +0 -34
  74. package/templates/component-checkbox-story/[component.name].story.vue +0 -63
  75. package/templates/component-input/[component.name].vue +0 -17
  76. package/templates/component-input-story/[component.name].story.vue +0 -63
  77. package/templates/component-story/[component.name].story.vue +0 -7
  78. package/templates/histoire/histoire.config.ts +0 -7
  79. package/templates/histoire/patches/histoire+0.17.6.patch +0 -13
  80. package/templates/histoire/src/main.histoire.ts +0 -8
  81. package/templates/overrides/components/index.ts +0 -15
  82. package/templates/overrides/components/overrides/AlertModal.vue +0 -11
  83. package/templates/overrides/components/overrides/ConfirmModal.vue +0 -20
  84. package/templates/overrides/components/overrides/ErrorReportModal.vue +0 -35
  85. package/templates/overrides/components/overrides/LoadingModal.vue +0 -12
  86. package/templates/overrides/components/overrides/ModalWrapper.vue +0 -22
  87. package/templates/overrides/components/overrides/SnackbarNotification.vue +0 -34
  88. package/templates/overrides-story/Overrides.story.vue +0 -86
  89. package/templates/postcss-pseudo-classes/postcss.config.js +0 -15
  90. package/tsconfig.json +0 -11
  91. package/vite.config.ts +0 -14
  92. /package/src/{main.ts → index.ts} +0 -0
@@ -1,3 +0,0 @@
1
- home:
2
- title: Aerogel
3
- getStarted: Get started
@@ -1,9 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- describe('App', () => {
4
-
5
- it('works', () => {
6
- expect(true).toBe(true);
7
- });
8
-
9
- });
@@ -1,13 +0,0 @@
1
- import i18n from '@aerogel/plugin-i18n';
2
- import soukai from '@aerogel/plugin-soukai';
3
- import { bootstrap } from '@aerogel/core';
4
-
5
- import './assets/css/main.css';
6
- import App from './App.vue';
7
-
8
- bootstrap(App, {
9
- plugins: [
10
- i18n({ messages: import.meta.glob('@/lang/*.yaml') }),
11
- soukai({ models: import.meta.glob(['@/models/*', '!**/*.test.ts'], { eager: true }) }),
12
- ],
13
- });
@@ -1,2 +0,0 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vue-i18n" />
@@ -1,7 +0,0 @@
1
- declare module '*.vue' {
2
- import type { ComponentOptions } from 'vue';
3
-
4
- const component: ComponentOptions;
5
-
6
- export default component;
7
- }
@@ -1 +0,0 @@
1
- /// <reference types="@total-typescript/ts-reset" />
@@ -1,5 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- module.exports = {
3
- content: ['./index.html', './src/**/*.{vue,ts}', '<% &contentPath %>'],
4
- plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')],
5
- };
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "strict": true,
7
- "jsx": "preserve",
8
- "noUncheckedIndexedAccess": true,
9
- "skipLibCheck": true,
10
- "resolveJsonModule": true,
11
- "esModuleInterop": true,
12
- "lib": ["esnext", "dom"],
13
- "baseUrl": ".",
14
- "paths": {
15
- "@/*": ["./src/*"]
16
- }
17
- },
18
- "include": ["src/**/*.ts", "src/**/*.vue"]
19
- }
@@ -1,30 +0,0 @@
1
- import Aerogel, { AerogelResolver } from '@aerogel/vite';
2
- import Components from 'unplugin-vue-components/vite';
3
- import I18n from '@intlify/unplugin-vue-i18n/vite';
4
- import Icons from 'unplugin-icons/vite';
5
- import IconsResolver from 'unplugin-icons/resolver';
6
- import { defineConfig } from 'vitest/config';
7
- import { resolve } from 'path';
8
-
9
- export default defineConfig({
10
- build: { sourcemap: true },
11
- publicDir: resolve(__dirname, './src/assets/public/'),
12
- plugins: [
13
- Aerogel({ name: '<% app.name %>' }),
14
- Components({
15
- dts: false,
16
- resolvers: [AerogelResolver(), IconsResolver()],
17
- }),
18
- I18n({ include: resolve(__dirname, './src/lang/**/*.yaml') }),
19
- Icons({
20
- iconCustomizer(_, __, props) {
21
- props['aria-hidden'] = 'true';
22
- },
23
- }),
24
- ],
25
- resolve: {
26
- alias: {
27
- '@': resolve(__dirname, './src'),
28
- },
29
- },
30
- });
@@ -1,42 +0,0 @@
1
- <template>
2
- <AGHeadlessButton :class="variantClasses" :disabled="disabled">
3
- <slot />
4
- </AGHeadlessButton>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { Colors, booleanProp, enumProp, removeInteractiveClasses } from '@aerogel/core';
9
- import { computed } from 'vue';
10
-
11
- const props = defineProps({
12
- color: enumProp(Colors, Colors.Primary),
13
- disabled: booleanProp(),
14
- });
15
-
16
- const colorClasses = computed(() => {
17
- switch (props.color) {
18
- case Colors.Secondary:
19
- // Add your custom color classes here.
20
- return '';
21
- case Colors.Clear:
22
- // Add your custom color classes here.
23
- return '';
24
- case Colors.Danger:
25
- // Add your custom color classes here.
26
- return '';
27
- case Colors.Primary:
28
- default:
29
- // Add your custom color classes here.
30
- return '';
31
- }
32
- });
33
-
34
- const variantClasses = computed(() => {
35
- if (props.disabled) {
36
- // Add additional classes for disabled state here.
37
- return removeInteractiveClasses(colorClasses.value);
38
- }
39
-
40
- return colorClasses.value;
41
- });
42
- </script>
@@ -1,77 +0,0 @@
1
- <template>
2
- <Story :layout="{ type: 'grid' }">
3
- <Variant title="Playground">
4
- <<% component.name %> :color="color">
5
- {{ content }}
6
- </<% component.name %>>
7
-
8
- <template #controls>
9
- <HstText v-model="content" title="Content" />
10
- <HstSelect v-model="color" title="Color" :options="colorOptions" />
11
- </template>
12
- </Variant>
13
-
14
- <Variant title="Default">
15
- <<% component.name %>>
16
- Click me!
17
- </<% component.name %>>
18
- </Variant>
19
-
20
- <Variant title="Hover">
21
- <<% component.name %> class=":hover">
22
- Click me!
23
- </<% component.name %>>
24
- </Variant>
25
-
26
- <Variant title="Focus">
27
- <<% component.name %> class=":focus :focus-visible">
28
- Click me!
29
- </<% component.name %>>
30
- </Variant>
31
-
32
- <Variant title="Disabled">
33
- <<% component.name %> disabled>
34
- You can't click me
35
- </<% component.name %>>
36
- </Variant>
37
-
38
- <Variant title="Colors" :layout="{ width: '300px' }">
39
- <div class="flex items-center gap-2">
40
- <<% component.name %> color="primary">
41
- Primary
42
- </<% component.name %>>
43
- <<% component.name %> color="secondary">
44
- Secondary
45
- </<% component.name %>>
46
- <<% component.name %> color="danger">
47
- Danger
48
- </<% component.name %>>
49
- <<% component.name %> color="clear">
50
- Clear
51
- </<% component.name %>>
52
- </div>
53
- </Variant>
54
- </Story>
55
- </template>
56
-
57
- <script setup lang="ts">
58
- import { Colors } from '@aerogel/core';
59
- import { invert } from '@noeldemartin/utils';
60
- import { ref } from 'vue';
61
- import type { Color } from '@aerogel/core';
62
-
63
- const content = ref('Click me!');
64
- const color = ref<Color>(Colors.Primary);
65
- const colorOptions = invert(Colors);
66
- </script>
67
-
68
- <style>
69
- .story-<% component.slug %> {
70
- grid-template-columns: repeat(2, 300px) !important;
71
- }
72
-
73
- .story-<% component.slug %> .variant-playground,
74
- .story-<% component.slug %> .variant-colors{
75
- grid-column: 1 / -1;
76
- }
77
- </style>
@@ -1,34 +0,0 @@
1
- <template>
2
- <AGHeadlessInput
3
- ref="$input"
4
- :name="name"
5
- :class="className"
6
- :label="label"
7
- >
8
- <AGHeadlessInputInput
9
- v-bind="attrs"
10
- type="checkbox"
11
- />
12
- <div v-if="$slots.default">
13
- <AGHeadlessInputLabel>
14
- <slot />
15
- </AGHeadlessInputLabel>
16
- <AGHeadlessInputError />
17
- </div>
18
- </AGHeadlessInput>
19
- </template>
20
-
21
- <script setup lang="ts">
22
- import { AGHeadlessInputLabel, componentRef, stringProp, useInputAttrs } from '@aerogel/core';
23
- import type { IAGHeadlessInput } from '@aerogel/core';
24
-
25
- defineOptions({ inheritAttrs: false });
26
- defineProps({
27
- name: stringProp(),
28
- label: stringProp(),
29
- inputClass: stringProp(''),
30
- });
31
-
32
- const $input = componentRef<IAGHeadlessInput>();
33
- const [attrs, className] = useInputAttrs();
34
- </script>
@@ -1,63 +0,0 @@
1
- <template>
2
- <Story group="base" :layout="{ type: 'grid' }">
3
- <Variant title="Playground">
4
- <AGForm :form="form" class="m-1">
5
- <<% component.name %> name="accept" :form="form">
6
- {{ label }}
7
- </<% component.name %>>
8
- </AGForm>
9
-
10
- <template #controls>
11
- <HstText v-model="label" title="Label" />
12
- </template>
13
- </Variant>
14
-
15
- <Variant title="Default">
16
- <<% component.name %> class="m-1">
17
- Accept Terms & Conditions
18
- </<% component.name %>>
19
- </Variant>
20
-
21
- <Variant title="Hover">
22
- <<% component.name %> class="m-1" input-class=":hover">
23
- Accept Terms & Conditions
24
- </<% component.name %>>
25
- </Variant>
26
-
27
- <Variant title="Focus">
28
- <<% component.name %> class="m-1" input-class=":focus :focus-visible">
29
- Accept Terms & Conditions
30
- </<% component.name %>>
31
- </Variant>
32
-
33
- <Variant title="Error">
34
- <AGForm :form="errorForm" class="m-1">
35
- <<% component.name %> name="accept">
36
- Accept Terms & Conditions
37
- </<% component.name %>>
38
- </AGForm>
39
- </Variant>
40
- </Story>
41
- </template>
42
-
43
- <script setup lang="ts">
44
- import { requiredBooleanInput, useForm } from '@aerogel/core';
45
- import { ref } from 'vue';
46
-
47
- const form = useForm({ accept: requiredBooleanInput(true) });
48
- const errorForm = useForm({ accept: requiredBooleanInput() });
49
- const label = ref('Accept Terms & Conditions');
50
-
51
- form.submit();
52
- errorForm.submit();
53
- </script>
54
-
55
- <style>
56
- .story-<% component.slug %> {
57
- grid-template-columns: repeat(2, 300px) !important;
58
- }
59
-
60
- .story-<% component.slug %> .variant-playground {
61
- grid-column: 1 / -1;
62
- }
63
- </style>
@@ -1,17 +0,0 @@
1
- <template>
2
- <AGHeadlessInput v-bind="props">
3
- <AGHeadlessInputLabel />
4
- <AGHeadlessInputInput v-bind="attrs" />
5
- <AGHeadlessInputDescription />
6
- <AGHeadlessInputError />
7
- </AGHeadlessInput>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import { useInputAttrs, useInputProps } from '@aerogel/core';
12
-
13
- defineOptions({ inheritAttrs: false });
14
-
15
- const props = defineProps(useInputProps());
16
- const [attrs] = useInputAttrs();
17
- </script>
@@ -1,63 +0,0 @@
1
- <template>
2
- <Story :layout="{ type: 'grid' }">
3
- <Variant title="Playground">
4
- <AGForm :form="form">
5
- <<% component.name %> name="food" :label="label" :placeholder="placeholder" />
6
- </AGForm>
7
-
8
- <template #controls>
9
- <HstText v-model="label" title="Label" />
10
- <HstText v-model="placeholder" title="Placeholder" />
11
- <HstCheckbox v-model="hasErrors" title="Errors" />
12
- </template>
13
- </Variant>
14
-
15
- <Variant title="Default">
16
- <<% component.name %> label="What's the best food?" placeholder="Ramen" />
17
- </Variant>
18
-
19
- <Variant title="Hover">
20
- <<% component.name %> label="What's the best food?" placeholder="Ramen" input-class=":hover" />
21
- </Variant>
22
-
23
- <Variant title="Focus">
24
- <<% component.name %> label="What's the best food?" placeholder="Ramen" input-class=":focus :focus-visible" />
25
- </Variant>
26
-
27
- <Variant title="Error">
28
- <AGForm :form="errorForm">
29
- <<% component.name %>
30
- name="food"
31
- label="What's the best food?"
32
- placeholder="Ramen"
33
- class=":focus :focus-visible"
34
- />
35
- </AGForm>
36
- </Variant>
37
- </Story>
38
- </template>
39
-
40
- <script setup lang="ts">
41
- import { requiredStringInput, useForm } from '@aerogel/core';
42
- import { ref, watchEffect } from 'vue';
43
-
44
- const form = useForm({ food: requiredStringInput() });
45
- const errorForm = useForm({ food: requiredStringInput() });
46
- const label = ref('What\'s the best food?');
47
- const placeholder = ref('Ramen');
48
- const hasErrors = ref(false);
49
-
50
- errorForm.submit();
51
-
52
- watchEffect(() => (hasErrors.value ? form.submit() : form.reset()));
53
- </script>
54
-
55
- <style>
56
- .story-<% component.slug %> {
57
- grid-template-columns: repeat(2, 300px) !important;
58
- }
59
-
60
- .story-<% component.slug %> .variant-playground {
61
- grid-column: 1 / -1;
62
- }
63
- </style>
@@ -1,7 +0,0 @@
1
- <template>
2
- <Story>
3
- <Variant title="Primary">
4
- <<% component.name %> />
5
- </Variant>
6
- </Story>
7
- </template>
@@ -1,7 +0,0 @@
1
- import HstAerogel from '@aerogel/histoire/dist/plugin';
2
- import { defineConfig } from 'histoire';
3
-
4
- export default defineConfig({
5
- setupFile: '/src/main.histoire.ts',
6
- plugins: [HstAerogel()],
7
- });
@@ -1,13 +0,0 @@
1
- diff --git a/node_modules/histoire/dist/node/collect/index.js b/node_modules/histoire/dist/node/collect/index.js
2
- index 8ffd507..37be43e 100644
3
- --- a/node_modules/histoire/dist/node/collect/index.js
4
- +++ b/node_modules/histoire/dist/node/collect/index.js
5
- @@ -22,7 +22,7 @@ export function useCollectStories(options, ctx) {
6
- /vite\w*\/dist\/client\/(client|env).mjs/,
7
- ...ctx.config.viteNodeInlineDeps ?? [],
8
- ],
9
- - fallbackCJS: true,
10
- + fallbackCJS: false,
11
- },
12
- transformMode: ctx.config.viteNodeTransformMode,
13
- });
@@ -1,8 +0,0 @@
1
- import '@aerogel/histoire/dist/styles.css';
2
- import { defineSetupAerogel } from '@aerogel/histoire';
3
-
4
- import './assets/css/main.css';
5
-
6
- export const setupVue3 = defineSetupAerogel({
7
- messages: import.meta.glob('@/lang/*.yaml'),
8
- });
@@ -1,15 +0,0 @@
1
- import { UIComponents } from '@aerogel/core';
2
-
3
- import AlertModal from './overrides/AlertModal.vue';
4
- import ConfirmModal from './overrides/ConfirmModal.vue';
5
- import ErrorReportModal from './overrides/ErrorReportModal.vue';
6
- import LoadingModal from './overrides/LoadingModal.vue';
7
- import SnackbarNotification from './overrides/SnackbarNotification.vue';
8
-
9
- export const components = {
10
- [UIComponents.AlertModal]: AlertModal,
11
- [UIComponents.ConfirmModal]: ConfirmModal,
12
- [UIComponents.ErrorReportModal]: ErrorReportModal,
13
- [UIComponents.LoadingModal]: LoadingModal,
14
- [UIComponents.Snackbar]: SnackbarNotification,
15
- };
@@ -1,11 +0,0 @@
1
- <template>
2
- <ModalWrapper :title="title">
3
- <AGMarkdown :text="message" />
4
- </ModalWrapper>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { useAlertModalProps } from '@aerogel/core';
9
-
10
- defineProps(useAlertModalProps());
11
- </script>
@@ -1,20 +0,0 @@
1
- <template>
2
- <ModalWrapper v-slot="{ close }" :title="title" :cancellable="false">
3
- <AGMarkdown :text="message" />
4
- <div class="mt-4 flex flex-row-reverse">
5
- <AGButton :color="acceptColor" @click="close(true)">
6
- {{ renderedAcceptText }}
7
- </AGButton>
8
- <AGButton :color="cancelColor" class="mr-2" @click="close(false)">
9
- {{ renderedCancelText }}
10
- </AGButton>
11
- </div>
12
- </ModalWrapper>
13
- </template>
14
-
15
- <script setup lang="ts">
16
- import { useConfirmModal, useConfirmModalProps } from '@aerogel/core';
17
-
18
- const props = defineProps(useConfirmModalProps());
19
- const { renderedAcceptText, renderedCancelText } = useConfirmModal(props);
20
- </script>
@@ -1,35 +0,0 @@
1
- <template>
2
- <ModalWrapper>
3
- <AGErrorReportModalTitle
4
- :report="report"
5
- :current-report="activeReportIndex + 1"
6
- :total-reports="reports.length"
7
- />
8
- <AGButton color="clear" :disabled="activeReportIndex === 0" @click="activeReportIndex--">
9
- {{ previousReportText }}
10
- </AGButton>
11
- <AGButton color="clear" :disabled="activeReportIndex === reports.length - 1" @click="activeReportIndex++">
12
- {{ nextReportText }}
13
- </AGButton>
14
- <AGErrorReportModalButtons :report="report">
15
- <template
16
- #default="{ url, handler, iconComponent, description }: IAGErrorReportModalButtonsDefaultSlotProps"
17
- >
18
- <AGButton :url="url" :aria-label="description" @click="handler">
19
- <component :is="iconComponent" />
20
- {{ description }}
21
- </AGButton>
22
- </template>
23
- </AGErrorReportModalButtons>
24
- <AGMarkdown v-if="report.description" :text="report.description" />
25
- <pre v-text="details" />
26
- </ModalWrapper>
27
- </template>
28
-
29
- <script setup lang="ts">
30
- import { useErrorReportModal, useErrorReportModalProps } from '@aerogel/core';
31
- import type { IAGErrorReportModalButtonsDefaultSlotProps } from '@aerogel/core';
32
-
33
- const props = defineProps(useErrorReportModalProps());
34
- const { activeReportIndex, details, nextReportText, previousReportText, report } = useErrorReportModal(props);
35
- </script>
@@ -1,12 +0,0 @@
1
- <template>
2
- <ModalWrapper :cancellable="false">
3
- <AGMarkdown :text="renderedMessage" />
4
- </ModalWrapper>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { useLoadingModal, useLoadingModalProps } from '@aerogel/core';
9
-
10
- const props = defineProps(useLoadingModalProps());
11
- const { renderedMessage } = useLoadingModal(props);
12
- </script>
@@ -1,22 +0,0 @@
1
- <template>
2
- <AGHeadlessModal ref="$modal" v-slot="{ close }" v-bind="props">
3
- <AGHeadlessModalPanel>
4
- <AGHeadlessModalTitle v-if="title">
5
- <AGMarkdown :text="title" inline />
6
- </AGHeadlessModalTitle>
7
- <slot :close="close" />
8
- </AGHeadlessModalPanel>
9
- </AGHeadlessModal>
10
- </template>
11
-
12
- <script setup lang="ts">
13
- import { ref } from 'vue';
14
- import { useModalExpose, useModalProps } from '@aerogel/core';
15
- import type { IAGHeadlessModal, IAGModal } from '@aerogel/core';
16
-
17
- const props = defineProps(useModalProps());
18
- const $modal = ref<IAGHeadlessModal>();
19
-
20
- defineOptions({ inheritAttrs: false });
21
- defineExpose<IAGModal>(useModalExpose($modal));
22
- </script>
@@ -1,34 +0,0 @@
1
- <template>
2
- <AGHeadlessSnackbar :class="colorClasses">
3
- <AGMarkdown :text="message" inline />
4
-
5
- <AGButton
6
- v-for="(action, i) of actions"
7
- :key="i"
8
- :color="color"
9
- @click="activate(action)"
10
- >
11
- {{ action.text }}
12
- </AGButton>
13
- </AGHeadlessSnackbar>
14
- </template>
15
-
16
- <script setup lang="ts">
17
- import { computed } from 'vue';
18
- import { Colors, useSnackbar, useSnackbarProps } from '@aerogel/core';
19
-
20
- const props = defineProps(useSnackbarProps());
21
- const { activate } = useSnackbar(props);
22
-
23
- const colorClasses = computed(() => {
24
- switch (props.color) {
25
- case Colors.Danger:
26
- // Add your custom color classes here.
27
- return '';
28
- case Colors.Secondary:
29
- default:
30
- // Add your custom color classes here.
31
- return '';
32
- }
33
- });
34
- </script>