@aerogel/core 0.1.1-next.38e999a09609d7c9cfa836fe396028ab230f6c89 → 0.1.1-next.47ee6e5e3485291a8763a804016f87a051476893

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aerogel/core",
3
- "version": "0.1.1-next.38e999a09609d7c9cfa836fe396028ab230f6c89",
3
+ "version": "0.1.1-next.47ee6e5e3485291a8763a804016f87a051476893",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex min-h-full flex-col text-base leading-tight font-normal text-gray-900 antialiased">
2
+ <div class="text-primary-text flex min-h-full flex-col text-base leading-tight font-normal antialiased">
3
3
  <slot v-if="$errors.hasStartupErrors" name="startup-crash">
4
4
  <component :is="$ui.requireComponent('startup-crash')" />
5
5
  </slot>
@@ -6,7 +6,7 @@ export type ModalContentInstance = Nullable<InstanceType<typeof DialogContent>>;
6
6
  export interface ModalProps {
7
7
  persistent?: boolean;
8
8
  fullscreen?: boolean;
9
- fullscreenMobile?: boolean;
9
+ fullscreenOnMobile?: boolean;
10
10
  title?: string;
11
11
  titleHidden?: boolean;
12
12
  description?: string;
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <details class="group">
3
- <summary
4
- class="-ml-2 flex w-[max-content] items-center rounded-lg py-2 pr-3 pl-1 hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700"
5
- >
3
+ <summary :class="renderedSummaryClasses">
6
4
  <IconCheveronRight class="size-6 transition-transform group-open:rotate-90" />
7
- <span>{{ label }}</span>
5
+ <slot name="label">
6
+ <span>{{ label ?? $td('ui.details', 'Details') }}</span>
7
+ </slot>
8
8
  </summary>
9
9
 
10
- <div class="pt-2 pl-4">
10
+ <div :class="renderedContentClasses">
11
11
  <slot />
12
12
  </div>
13
13
  </details>
@@ -15,6 +15,19 @@
15
15
 
16
16
  <script setup lang="ts">
17
17
  import IconCheveronRight from '~icons/zondicons/cheveron-right';
18
+ import { classes } from '@aerogel/core/utils';
19
+ import { type HTMLAttributes, computed } from 'vue';
18
20
 
19
- defineProps<{ label: string }>();
21
+ const {
22
+ label = undefined,
23
+ contentClass,
24
+ summaryClass,
25
+ } = defineProps<{ label?: string; contentClass?: HTMLAttributes['class']; summaryClass?: HTMLAttributes['class'] }>();
26
+ const renderedContentClasses = computed(() => classes('pt-2 pl-4', contentClass));
27
+ const renderedSummaryClasses = computed(() =>
28
+ classes(
29
+ '-ml-2 flex w-[max-content] items-center rounded-lg py-2 pr-3 pl-1',
30
+ 'hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700',
31
+ summaryClass,
32
+ ));
20
33
  </script>
@@ -95,7 +95,7 @@ const {
95
95
  persistent,
96
96
  closeHidden,
97
97
  fullscreen,
98
- fullscreenMobile,
98
+ fullscreenOnMobile,
99
99
  ...props
100
100
  } = defineProps<
101
101
  ModalProps & {
@@ -126,7 +126,7 @@ const renderedContentClass = computed(() =>
126
126
  { 'pt-4': !title || titleHidden, 'max-h-[90vh]': !renderFullscreen.value },
127
127
  contentClass,
128
128
  ));
129
- const renderFullscreen = computed(() => fullscreen || (fullscreenMobile && UI.mobile));
129
+ const renderFullscreen = computed(() => fullscreen || (fullscreenOnMobile && UI.mobile));
130
130
  const renderedWrapperClass = computed(() =>
131
131
  classes(
132
132
  'isolate fixed z-50 flex flex-col overflow-hidden bg-white text-left duration-300',
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Modal :title="$td('settings.title', 'Settings')">
2
+ <Modal :title="$td('settings.title', 'Settings')" :fullscreen-on-mobile="$app.settingsFullscreenOnMobile">
3
3
  <component :is="setting.component" v-for="(setting, key) in settings" :key />
4
4
  </Modal>
5
5
  </template>
package/src/index.css CHANGED
@@ -20,6 +20,7 @@
20
20
  --color-primary-950: color-mix(in oklab, var(--color-primary-600) 50%, black);
21
21
 
22
22
  --color-background: oklch(1 0 0);
23
+ --color-primary-text: var(--color-gray-900);
23
24
  --color-links: var(--color-primary);
24
25
 
25
26
  --breakpoint-content: var(--breakpoint-md);
@@ -24,6 +24,7 @@ export default defineServiceState({
24
24
  version: Aerogel.version,
25
25
  sourceUrl: Aerogel.sourceUrl,
26
26
  settings: [] as AppSetting[],
27
+ settingsFullscreenOnMobile: false,
27
28
  },
28
29
  computed: {
29
30
  development: (state) => state.environment === 'development',
@@ -30,6 +30,10 @@ export class AppService extends Service {
30
30
  this.settings.push(markRaw(setting));
31
31
  }
32
32
 
33
+ public setSettingsFullscreenOnMobile(fullscreenOnMobile: boolean): void {
34
+ this.settingsFullscreenOnMobile = fullscreenOnMobile;
35
+ }
36
+
33
37
  public async whenReady<T>(callback: () => T): Promise<T> {
34
38
  const result = await this.ready.then(callback);
35
39
 
@@ -56,6 +56,10 @@ export default definePlugin({
56
56
  app.use(getPiniaStore());
57
57
  options.settings?.forEach((setting) => App.addSetting(setting));
58
58
 
59
+ if (options.settingsFullscreenOnMobile !== undefined) {
60
+ App.setSettingsFullscreenOnMobile(options.settingsFullscreenOnMobile);
61
+ }
62
+
59
63
  await bootServices(app, services);
60
64
  },
61
65
  });
@@ -64,6 +68,7 @@ declare module '@aerogel/core/bootstrap/options' {
64
68
  export interface AerogelOptions {
65
69
  services?: Record<string, Service>;
66
70
  settings?: AppSetting[];
71
+ settingsFullscreenOnMobile?: boolean;
67
72
  }
68
73
  }
69
74