@aerogel/core 0.1.1-next.1e4498f367b830c7a83435800066bb8261d179f5 → 0.1.1-next.7f33b133934b479bdeee0808001759d92e987cf9

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.1e4498f367b830c7a83435800066bb8261d179f5",
3
+ "version": "0.1.1-next.7f33b133934b479bdeee0808001759d92e987cf9",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1,7 +1,7 @@
1
1
  import type { PrimitiveProps } from 'reka-ui';
2
2
  import type { HTMLAttributes } from 'vue';
3
3
 
4
- export type ButtonVariant = 'default' | 'secondary' | 'danger' | 'ghost' | 'outline' | 'link';
4
+ export type ButtonVariant = 'default' | 'secondary' | 'danger' | 'warning' | 'ghost' | 'outline' | 'link';
5
5
  export type ButtonSize = 'default' | 'small' | 'large' | 'icon';
6
6
  export interface ButtonProps extends PrimitiveProps {
7
7
  class?: HTMLAttributes['class'];
@@ -1,4 +1,4 @@
1
- export type ToastVariant = 'secondary' | 'danger';
1
+ export type ToastVariant = 'secondary' | 'warning' | 'danger';
2
2
 
3
3
  export interface ToastAction {
4
4
  label: string;
@@ -1,18 +1,9 @@
1
1
  <template>
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
- >
6
- <IconCheveronRight class="size-6 transition-transform group-open:rotate-90" />
7
- <span>{{ $td('ui.advancedOptions', 'Advanced options') }}</span>
8
- </summary>
9
-
10
- <div class="pt-2 pl-4">
11
- <slot />
12
- </div>
13
- </details>
2
+ <Details :label="$td('ui.advancedOptions', 'Advanced options')">
3
+ <slot />
4
+ </Details>
14
5
  </template>
15
6
 
16
7
  <script setup lang="ts">
17
- import IconCheveronRight from '~icons/zondicons/cheveron-right';
8
+ import Details from './Details.vue';
18
9
  </script>
@@ -25,6 +25,7 @@ const renderedClasses = computed(() => variantClasses<Variants<Pick<ButtonProps,
25
25
  default: 'bg-primary-600 text-white focus-visible:outline-primary-600',
26
26
  secondary: 'bg-background text-gray-900 ring-gray-300',
27
27
  danger: 'bg-red-600 text-white focus-visible:outline-red-600',
28
+ warning: 'bg-yellow-600 text-white focus-visible:outline-yellow-600',
28
29
  ghost: 'bg-transparent',
29
30
  outline: 'bg-transparent text-primary-600 ring-primary-600',
30
31
  link: 'text-links',
@@ -0,0 +1,20 @@
1
+ <template>
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
+ >
6
+ <IconCheveronRight class="size-6 transition-transform group-open:rotate-90" />
7
+ <span>{{ label }}</span>
8
+ </summary>
9
+
10
+ <div class="pt-2 pl-4">
11
+ <slot />
12
+ </div>
13
+ </details>
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ import IconCheveronRight from '~icons/zondicons/cheveron-right';
18
+
19
+ defineProps<{ label: string }>();
20
+ </script>
@@ -34,6 +34,7 @@ const renderedClasses = computed(() =>
34
34
  variant: {
35
35
  secondary: 'bg-gray-900 text-white ring-black',
36
36
  danger: 'bg-red-50 text-red-900 ring-red-100',
37
+ warning: 'bg-yellow-50 text-yellow-900 ring-yellow-100',
37
38
  },
38
39
  },
39
40
  defaultVariants: {
@@ -3,6 +3,7 @@ export { default as AlertModal } from './AlertModal.vue';
3
3
  export { default as Button } from './Button.vue';
4
4
  export { default as Checkbox } from './Checkbox.vue';
5
5
  export { default as ConfirmModal } from './ConfirmModal.vue';
6
+ export { default as Details } from './Details.vue';
6
7
  export { default as DropdownMenu } from './DropdownMenu.vue';
7
8
  export { default as DropdownMenuOption } from './DropdownMenuOption.vue';
8
9
  export { default as DropdownMenuOptions } from './DropdownMenuOptions.vue';
@@ -112,6 +112,10 @@ export default class FormController<Fields extends FormFieldDefinitions = FormFi
112
112
  return this._fields[field]?.rules?.split('|') ?? [];
113
113
  }
114
114
 
115
+ public setFieldErrors<T extends keyof Fields>(field: T, errors: string[] | null): void {
116
+ this._errors[field] = errors;
117
+ }
118
+
115
119
  public getFieldType<T extends keyof Fields>(field: T): FormFieldType | null {
116
120
  return this._fields[field]?.type ?? null;
117
121
  }