@aerogel/cli 0.0.0-next.13b88f634a31caf3669d61e53e7d3fa95e20488c → 0.0.0-next.24ed4c26fdb36195386fee4a81543fb84f51c979

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 (93) hide show
  1. package/bin/gel +1 -1
  2. package/dist/aerogel-cli.d.ts +1 -1
  3. package/dist/aerogel-cli.js +847 -0
  4. package/dist/aerogel-cli.js.map +1 -0
  5. package/package.json +19 -33
  6. package/src/cli.ts +10 -10
  7. package/src/commands/Command.ts +3 -3
  8. package/src/commands/create.test.ts +2 -2
  9. package/src/commands/create.ts +11 -11
  10. package/src/commands/generate-component.test.ts +1 -1
  11. package/src/commands/generate-component.ts +14 -14
  12. package/src/commands/generate-model.test.ts +1 -1
  13. package/src/commands/generate-model.ts +11 -11
  14. package/src/commands/generate-overrides.ts +10 -10
  15. package/src/commands/generate-service.test.ts +1 -1
  16. package/src/commands/generate-service.ts +14 -14
  17. package/src/commands/info.ts +7 -6
  18. package/src/commands/install.test.ts +1 -15
  19. package/src/commands/install.ts +11 -12
  20. package/src/lib/App.ts +9 -6
  21. package/src/lib/Editor.ts +3 -3
  22. package/src/lib/File.mock.ts +6 -6
  23. package/src/lib/File.ts +2 -2
  24. package/src/lib/Log.mock.ts +3 -3
  25. package/src/lib/Log.test.ts +4 -4
  26. package/src/lib/Log.ts +6 -6
  27. package/src/lib/Shell.mock.ts +1 -1
  28. package/src/lib/Shell.ts +1 -1
  29. package/src/lib/Template.ts +19 -16
  30. package/src/lib/utils/app.ts +2 -2
  31. package/src/lib/utils/edit.ts +2 -2
  32. package/src/lib/utils/paths.ts +15 -7
  33. package/src/plugins/Plugin.ts +7 -7
  34. package/src/plugins/Solid.ts +12 -12
  35. package/src/plugins/Soukai.ts +4 -4
  36. package/src/testing/setup.ts +28 -26
  37. package/.prettierignore +0 -1
  38. package/dist/aerogel-cli.cjs.js +0 -2
  39. package/dist/aerogel-cli.cjs.js.map +0 -1
  40. package/dist/aerogel-cli.esm.js +0 -2
  41. package/dist/aerogel-cli.esm.js.map +0 -1
  42. package/src/plugins/Histoire.ts +0 -113
  43. package/templates/app/.github/workflows/ci.yml +0 -29
  44. package/templates/app/.gitignore.template +0 -2
  45. package/templates/app/.nvmrc +0 -1
  46. package/templates/app/.vscode/launch.json +0 -16
  47. package/templates/app/.vscode/settings.json +0 -10
  48. package/templates/app/README.md +0 -3
  49. package/templates/app/cypress/cypress.config.ts +0 -14
  50. package/templates/app/cypress/e2e/app.cy.ts +0 -9
  51. package/templates/app/cypress/support/e2e.ts +0 -1
  52. package/templates/app/cypress/tsconfig.json +0 -14
  53. package/templates/app/index.html +0 -13
  54. package/templates/app/package.json +0 -67
  55. package/templates/app/postcss.config.js +0 -6
  56. package/templates/app/src/App.vue +0 -12
  57. package/templates/app/src/assets/css/styles.css +0 -3
  58. package/templates/app/src/assets/public/robots.txt +0 -2
  59. package/templates/app/src/lang/en.yaml +0 -3
  60. package/templates/app/src/main.test.ts +0 -9
  61. package/templates/app/src/main.ts +0 -13
  62. package/templates/app/src/types/globals.d.ts +0 -2
  63. package/templates/app/src/types/shims.d.ts +0 -7
  64. package/templates/app/src/types/ts-reset.d.ts +0 -1
  65. package/templates/app/tailwind.config.js +0 -5
  66. package/templates/app/tsconfig.json +0 -19
  67. package/templates/app/vite.config.ts +0 -30
  68. package/templates/component/[component.name].vue +0 -3
  69. package/templates/component-button/[component.name].vue +0 -42
  70. package/templates/component-button-story/[component.name].story.vue +0 -77
  71. package/templates/component-checkbox/[component.name].vue +0 -34
  72. package/templates/component-checkbox-story/[component.name].story.vue +0 -63
  73. package/templates/component-input/[component.name].vue +0 -17
  74. package/templates/component-input-story/[component.name].story.vue +0 -63
  75. package/templates/component-story/[component.name].story.vue +0 -7
  76. package/templates/histoire/histoire.config.ts +0 -7
  77. package/templates/histoire/patches/histoire+0.17.6.patch +0 -13
  78. package/templates/histoire/src/main.histoire.ts +0 -8
  79. package/templates/model/[model.name].schema.ts +0 -7
  80. package/templates/model/[model.name].ts +0 -3
  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/templates/service/[service.name].ts +0 -8
  91. package/tsconfig.json +0 -11
  92. package/vite.config.ts +0 -14
  93. /package/src/{main.ts → index.ts} +0 -0
@@ -1,113 +0,0 @@
1
- import File from '@/lib/File';
2
- import Log from '@/lib/Log';
3
- import Plugin from '@/plugins/Plugin';
4
- import Shell from '@/lib/Shell';
5
- import Template from '@/lib/Template';
6
- import { isLinkedLocalApp } from '@/lib/utils/app';
7
- import { packagePath, templatePath } from '@/lib/utils/paths';
8
- import type { Editor } from '@/lib/Editor';
9
- import { formatCodeBlock } from '@noeldemartin/utils';
10
-
11
- export class Histoire extends Plugin {
12
-
13
- private installedPatchPackage: boolean = false;
14
- private installedPostCSSPseudoClasses: boolean = false;
15
-
16
- constructor() {
17
- super('histoire');
18
- }
19
-
20
- public async beforeInstall(): Promise<void> {
21
- this.installedPatchPackage = false;
22
- this.installedPostCSSPseudoClasses = false;
23
- }
24
-
25
- protected async afterInstall(): Promise<void> {
26
- if (!this.installedPatchPackage) {
27
- return;
28
- }
29
-
30
- await Log.animate('Patching dependencies', async () => {
31
- await Shell.run('npx patch-package');
32
- });
33
- }
34
-
35
- protected async updateFiles(editor: Editor): Promise<void> {
36
- await this.updateTailwindConfig(editor, {
37
- content: isLinkedLocalApp()
38
- ? `'${packagePath('histoire')}/dist/**/*.js'`
39
- : '\'./node_modules/@aerogel/histoire/dist/**/*.js\'',
40
- });
41
-
42
- await this.updateNpmScripts(editor);
43
- await this.createConfigFiles();
44
- await super.updateFiles(editor);
45
- }
46
-
47
- protected async installNpmDependencies(): Promise<void> {
48
- // We need this specific version because we're patching it using patch-package
49
- await Shell.run('npm install histoire@0.17.6 --save-dev');
50
-
51
- if (!File.contains('package.json', '"patch-package"')) {
52
- await Shell.run('npm install patch-package --save-dev');
53
-
54
- this.installedPatchPackage = true;
55
- }
56
-
57
- if (!File.contains('package.json', '"postcss-pseudo-classes"')) {
58
- await Shell.run('npm install postcss-pseudo-classes --save-dev');
59
-
60
- this.installedPostCSSPseudoClasses = true;
61
- }
62
-
63
- await super.installNpmDependencies();
64
- }
65
-
66
- protected getLocalPackageName(): string {
67
- return this.name;
68
- }
69
-
70
- protected async updateNpmScripts(editor: Editor): Promise<void> {
71
- Log.info('Updating npm scripts...');
72
-
73
- const packageJson = File.read('package.json');
74
-
75
- if (!packageJson) {
76
- return Log.fail('Could not find package.json file');
77
- }
78
-
79
- File.write(
80
- 'package.json',
81
- packageJson.replace(
82
- '"lint": "noeldemartin-lint src cypress",',
83
- this.installedPatchPackage
84
- ? formatCodeBlock(`
85
- "histoire": "histoire dev",
86
- "lint": "noeldemartin-lint cypress src",
87
- "postinstall": "patch-package",
88
- `)
89
- : formatCodeBlock(`
90
- "histoire": "histoire dev",
91
- "lint": "noeldemartin-lint cypress src",
92
- `),
93
- ),
94
- );
95
-
96
- editor.addModifiedFile('package.json');
97
- }
98
-
99
- protected async createConfigFiles(): Promise<void> {
100
- Log.info('Creating config files...');
101
-
102
- Template.instantiate(templatePath('histoire'));
103
-
104
- if (this.installedPostCSSPseudoClasses) {
105
- Template.instantiate(templatePath('postcss-pseudo-classes'));
106
- }
107
- }
108
-
109
- protected isForDevelopment(): boolean {
110
- return true;
111
- }
112
-
113
- }
@@ -1,29 +0,0 @@
1
- name: CI
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- ci:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v4
10
- - uses: actions/setup-node@v4
11
- with:
12
- node-version-file: '.nvmrc'
13
- - run: npm ci
14
- - run: npm run lint
15
- - run: npm run build
16
- - run: npm run test:ci
17
- - run: npm run cy:test-snapshots:ci
18
- - name: Upload Cypress screenshots
19
- uses: actions/upload-artifact@v4
20
- if: ${{ failure() }}
21
- with:
22
- name: cypress_screenshots
23
- path: cypress/screenshots
24
- - name: Upload Cypress snapshots
25
- uses: actions/upload-artifact@v4
26
- if: ${{ failure() }}
27
- with:
28
- name: cypress_snapshots
29
- path: cypress/snapshots
@@ -1,2 +0,0 @@
1
- /dist
2
- /node_modules
@@ -1 +0,0 @@
1
- lts/hydrogen
@@ -1,16 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "name": "Debug Current Test File",
8
- "autoAttachChildProcesses": true,
9
- "skipFiles": ["<node_internals>/**", "**/node_modules/**"],
10
- "program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
11
- "args": ["run", "${fileBasenameNoExtension}"],
12
- "smartStep": true,
13
- "console": "integratedTerminal"
14
- }
15
- ]
16
- }
@@ -1,10 +0,0 @@
1
- {
2
- "emeraldwalk.runonsave": {
3
- "commands": [
4
- {
5
- "match": ".*",
6
- "cmd": "npx prettier-eslint ${file} --write"
7
- }
8
- ]
9
- }
10
- }
@@ -1,3 +0,0 @@
1
- # <% app.name %>
2
-
3
- App created with [AerogelJS](https://aerogel.js.org)
@@ -1,14 +0,0 @@
1
- import { setupAerogelNodeEvents } from '@aerogel/cypress/config';
2
- import { defineConfig } from 'cypress';
3
-
4
- export default defineConfig({
5
- e2e: {
6
- baseUrl: 'http://localhost:5001',
7
- video: false,
8
- retries: {
9
- runMode: 3,
10
- openMode: 0,
11
- },
12
- setupNodeEvents: setupAerogelNodeEvents,
13
- },
14
- });
@@ -1,9 +0,0 @@
1
- describe('App', () => {
2
-
3
- beforeEach(() => cy.visit('/'));
4
-
5
- it('Shows get started link', () => {
6
- cy.see('Get started');
7
- });
8
-
9
- });
@@ -1 +0,0 @@
1
- import '@aerogel/cypress/support';
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["es5", "dom"],
5
- "types": ["cypress", "node"],
6
- "strict": true,
7
- "baseUrl": ".",
8
- "paths": {
9
- "@/*": ["../src/*"],
10
- "@cy/*": ["./*"]
11
- }
12
- },
13
- "include": ["**/*.ts", "../src/**/*.ts"]
14
- }
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" class="h-full w-full">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>{{ app.name }}</title>
7
- {{ socialMeta() }}
8
- </head>
9
- <body class="h-full w-full text-base font-normal leading-tight text-gray-900 antialiased">
10
- <div id="app" class="loading h-full"></div>
11
- <script type="module" src="./src/main.ts"></script>
12
- </body>
13
- </html>
@@ -1,67 +0,0 @@
1
- {
2
- "name": "<% app.slug %>",
3
- "version": "0.0.0",
4
- "private": true,
5
- "scripts": {
6
- "build": "vite build",
7
- "cy:dev": "concurrently --kill-others \"npm run test:serve-app\" \"npm run cy:open\"",
8
- "cy:open": "cypress open --config-file ./cypress/cypress.config.ts --e2e --browser chromium",
9
- "cy:run": "cypress run --config-file ./cypress/cypress.config.ts",
10
- "cy:test": "start-server-and-test test:serve-app http-get://localhost:5001 cy:run",
11
- "cy:test-snapshots": "docker run -it -u `id -u ${whoami}` -e CYPRESS_SNAPSHOTS=true -v ./:/app -w /app cypress/base:18.16.0 sh -c \"npx cypress install && npm run cy:test\"",
12
- "cy:test-snapshots:ci": "docker run -e CYPRESS_SNAPSHOTS=true -v ./:/app -w /app cypress/base:18.16.0 sh -c \"npx cypress install && npm run cy:test\"",
13
- "dev": "vite",
14
- "lint": "noeldemartin-lint src cypress",
15
- "test": "vitest --run",
16
- "test:ci": "vitest --run --reporter verbose",
17
- "test:serve-app": "vite --port 5001 --mode testing"
18
- },
19
- "dependencies": {
20
- "@aerogel/core": "<% &dependencies.aerogelCore %>",
21
- "@aerogel/plugin-i18n": "<% &dependencies.aerogelPluginI18n %>",
22
- "@aerogel/plugin-soukai": "<% &dependencies.aerogelPluginSoukai %>",
23
- "@intlify/unplugin-vue-i18n": "^0.12.2",
24
- "@noeldemartin/utils": "next",
25
- "@tailwindcss/forms": "^0.5.3",
26
- "@tailwindcss/typography": "^0.5.9",
27
- "soukai": "next",
28
- "tailwindcss": "^3.3.2",
29
- "vue": "^3.3.0",
30
- "vue-i18n": "9.3.0-beta.19"
31
- },
32
- "devDependencies": {
33
- "@aerogel/cli": "<% &dependencies.aerogelCli %>",
34
- "@aerogel/cypress": "<% &dependencies.aerogelCypress %>",
35
- "@aerogel/vite": "<% &dependencies.aerogelVite %>",
36
- "@iconify/json": "^2.2.134",
37
- "@noeldemartin/eslint-config-vue": "next",
38
- "@noeldemartin/scripts": "next",
39
- "@total-typescript/ts-reset": "^0.4.2",
40
- "@types/node": "^20.3.1",
41
- "autoprefixer": "^10.4.14",
42
- "concurrently": "^8.2.0",
43
- "cypress": "^12.17.0",
44
- "eslint": "^8.40.0",
45
- "prettier": "^2.8.8",
46
- "prettier-eslint-cli": "^7.1.0",
47
- "prettier-plugin-tailwindcss": "^0.2.8",
48
- "start-server-and-test": "^2.0.0",
49
- "typescript": "~5.4",
50
- "unplugin-icons": "^0.16.3",
51
- "unplugin-vue-components": "^0.24.1",
52
- "vite": "^4.3.0",
53
- "vitest": "^0.33.0",
54
- "vue-tsc": "^1.8.15"
55
- },
56
- "eslintConfig": {
57
- "extends": [
58
- "@noeldemartin/eslint-config-vue"
59
- ]
60
- },
61
- "prettier": {
62
- "plugins": [
63
- "prettier-plugin-tailwindcss"
64
- ],
65
- "printWidth": 120
66
- }
67
- }
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- };
@@ -1,12 +0,0 @@
1
- <template>
2
- <AGAppLayout class="bg-blue-50">
3
- <main class="flex flex-grow flex-col items-center justify-center">
4
- <h1 class="text-4xl font-semibold">
5
- {{ $t('home.title') }}
6
- </h1>
7
- <a href="https://aerogel.js.org" target="_blank" class="mt-2 underline opacity-75 hover:opacity-100">
8
- {{ $t('home.getStarted') }}
9
- </a>
10
- </main>
11
- </AGAppLayout>
12
- </template>
@@ -1,3 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
@@ -1,2 +0,0 @@
1
- User-agent: *
2
- Disallow:
@@ -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/styles.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,3 +0,0 @@
1
- <template>
2
- <div><% component.name %></div>
3
- </template>
@@ -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>