akar 2.0.21 → 2.0.22

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 (39) hide show
  1. package/dist/NumberField/NumberFieldRoot.cjs +9 -2
  2. package/dist/NumberField/NumberFieldRoot.cjs.map +1 -1
  3. package/dist/NumberField/NumberFieldRoot.js +9 -2
  4. package/dist/NumberField/NumberFieldRoot.js.map +1 -1
  5. package/dist/Toast/ToastAction.cjs.map +1 -1
  6. package/dist/Toast/ToastAction.js.map +1 -1
  7. package/dist/Toast/ToastArrow.cjs.map +1 -1
  8. package/dist/Toast/ToastArrow.js.map +1 -1
  9. package/dist/Toast/ToastDescription.cjs +1 -1
  10. package/dist/Toast/ToastDescription.cjs.map +1 -1
  11. package/dist/Toast/ToastDescription.js +1 -1
  12. package/dist/Toast/ToastDescription.js.map +1 -1
  13. package/dist/Toast/ToastRootImpl.cjs +3 -3
  14. package/dist/Toast/ToastRootImpl.js +3 -3
  15. package/dist/Toast/createToastManager.cjs +1 -1
  16. package/dist/Toast/createToastManager.js +1 -1
  17. package/dist/Toast/useToastStore.cjs +1 -3
  18. package/dist/Toast/useToastStore.cjs.map +1 -1
  19. package/dist/Toast/useToastStore.js +1 -3
  20. package/dist/Toast/useToastStore.js.map +1 -1
  21. package/dist/index2.d.cts +12 -12
  22. package/dist/index2.d.cts.map +1 -1
  23. package/dist/index2.d.ts +16 -16
  24. package/dist/index2.d.ts.map +1 -1
  25. package/dist/index3.d.cts +689 -687
  26. package/dist/index3.d.cts.map +1 -1
  27. package/dist/index3.d.ts +687 -685
  28. package/dist/index3.d.ts.map +1 -1
  29. package/dist/internal.d.cts +2 -2
  30. package/dist/internal.d.ts +2 -2
  31. package/dist/internal.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/src/NumberField/NumberFieldRoot.vue +11 -2
  34. package/src/Toast/ToastAction.vue +6 -8
  35. package/src/Toast/ToastArrow.vue +0 -1
  36. package/src/Toast/ToastDescription.vue +1 -4
  37. package/src/Toast/ToastRootImpl.vue +4 -4
  38. package/src/Toast/createToastManager.ts +1 -1
  39. package/src/Toast/useToastStore.ts +1 -3
@@ -1,6 +1,6 @@
1
1
  import "./index2.cjs";
2
2
  import { MenuArrowProps, MenuCheckboxItemEmits, MenuCheckboxItemProps, MenuContentEmits, MenuContentProps, MenuEmits, MenuGroupProps, MenuItemEmits, MenuItemIndicatorProps, MenuItemProps, MenuLabelProps, MenuPortalProps, MenuProps, MenuRadioGroupEmits, MenuRadioGroupProps, MenuRadioItemEmits, MenuRadioItemProps, MenuSeparatorProps, MenuSubContentEmits, MenuSubContentProps, MenuSubEmits, MenuSubProps, MenuSubTriggerProps, PopperAnchorProps, _default$308 as _default$13, _default$309 as _default$8, _default$310 as _default, _default$311 as _default$6, _default$312 as _default$10, _default$313 as _default$3, _default$314 as _default$14, _default$315 as _default$12, _default$316 as _default$2, _default$317 as _default$1, _default$318 as _default$11, _default$319 as _default$7, _default$321 as _default$9, _default$322 as _default$4, _default$323 as _default$5, injectMenuContext, injectMenuRootContext } from "./index3.cjs";
3
- import * as vue24 from "vue";
3
+ import * as vue47 from "vue";
4
4
 
5
5
  //#region src/Menu/MenuAnchor.vue.d.ts
6
6
  interface MenuAnchorProps extends PopperAnchorProps {}
@@ -8,7 +8,7 @@ declare var __VLS_8: {};
8
8
  type __VLS_Slots = {} & {
9
9
  default?: (props: typeof __VLS_8) => any;
10
10
  };
11
- declare const __VLS_base: vue24.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue24.ComponentOptionsMixin, vue24.ComponentOptionsMixin, {}, string, vue24.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue24.ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_base: vue47.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue47.ComponentProvideOptions, false, {}, any>;
12
12
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
13
  declare const _default$15: typeof __VLS_export;
14
14
  type __VLS_WithSlots<T, S> = T & {
@@ -1,6 +1,6 @@
1
1
  import "./index2.js";
2
2
  import { MenuArrowProps, MenuCheckboxItemEmits, MenuCheckboxItemProps, MenuContentEmits, MenuContentProps, MenuEmits, MenuGroupProps, MenuItemEmits, MenuItemIndicatorProps, MenuItemProps, MenuLabelProps, MenuPortalProps, MenuProps, MenuRadioGroupEmits, MenuRadioGroupProps, MenuRadioItemEmits, MenuRadioItemProps, MenuSeparatorProps, MenuSubContentEmits, MenuSubContentProps, MenuSubEmits, MenuSubProps, MenuSubTriggerProps, PopperAnchorProps, _default$308 as _default$13, _default$309 as _default$8, _default$310 as _default, _default$311 as _default$6, _default$312 as _default$10, _default$313 as _default$3, _default$314 as _default$14, _default$315 as _default$12, _default$316 as _default$2, _default$317 as _default$1, _default$318 as _default$11, _default$319 as _default$7, _default$321 as _default$9, _default$322 as _default$4, _default$323 as _default$5, injectMenuContext, injectMenuRootContext } from "./index3.js";
3
- import * as vue773 from "vue";
3
+ import * as vue1817 from "vue";
4
4
 
5
5
  //#region src/Menu/MenuAnchor.vue.d.ts
6
6
  interface MenuAnchorProps extends PopperAnchorProps {}
@@ -8,7 +8,7 @@ declare var __VLS_8: {};
8
8
  type __VLS_Slots = {} & {
9
9
  default?: (props: typeof __VLS_8) => any;
10
10
  };
11
- declare const __VLS_base: vue773.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue773.ComponentOptionsMixin, vue773.ComponentOptionsMixin, {}, string, vue773.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue773.ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_base: vue1817.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue1817.ComponentOptionsMixin, vue1817.ComponentOptionsMixin, {}, string, vue1817.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1817.ComponentProvideOptions, false, {}, any>;
12
12
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
13
  declare const _default$15: typeof __VLS_export;
14
14
  type __VLS_WithSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","names":[],"sources":["../src/Menu/MenuAnchor.vue"],"sourcesContent":[],"mappings":";;;;;UAoBU,eAAA,SAAwB;YAsC9B;KACC,WAAA;EAvCK,OAAA,CAAA,EAAA,CAAA,KAAA,EAAgB,OAwCG,OAxCK,EAAA,GAAA,GAAA;AAAiB,CAAA;AAsC7B,cAKhB,UAJU,EAIA,MAAA,CAAA,eAHoB,CAGpB,eAHoB,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAGpB,MAAA,CAAA,qBAAA,EAAA,MAAA,CAAA,qBAAA,EAHoB,CAAA,CAAA,EAAA,MAAA,EAGpB,MAAA,CAAA,WAAA,EAAA,QAHoB,CAGpB,eAHoB,CAAA,GAGpB,QAHoB,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAGpB,MAAA,CAAA,uBAAA,EAHoB,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;AAAA,cAM9B,YADJ,EACyB,eADzB,CAAA,OACgD,UADhD,EAC4D,WAD5D,CAAA;cACwC,WADxC,EAAA,OAE0B,YAF1B;KAGG,eALW,CAAA,CAAA,EAAA,CAAA,CAAA,GAKa,CALb,GAAA;EAAA,MAAA,EAAA;IAAA,MAAA,EAON,CAPM;EAAA,CAAA;CAAA"}
1
+ {"version":3,"file":"internal.d.ts","names":[],"sources":["../src/Menu/MenuAnchor.vue"],"sourcesContent":[],"mappings":";;;;;UAoBU,eAAA,SAAwB;YAsC9B;KACC,WAAA;EAvCK,OAAA,CAAA,EAAA,CAAA,KAAA,EAAgB,OAwCG,OAxCK,EAAA,GAAA,GAAA;AAAiB,CAAA;AAsC7B,cAKhB,UAJU,EAIA,OAAA,CAAA,eAHoB,CAGpB,eAHoB,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAGpB,OAAA,CAAA,qBAAA,EAAA,OAAA,CAAA,qBAAA,EAHoB,CAAA,CAAA,EAAA,MAAA,EAGpB,OAAA,CAAA,WAAA,EAAA,QAHoB,CAGpB,eAHoB,CAAA,GAGpB,QAHoB,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAGpB,OAAA,CAAA,uBAAA,EAHoB,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;AAAA,cAM9B,YADJ,EACyB,eADzB,CAAA,OACgD,UADhD,EAC4D,WAD5D,CAAA;cACwC,WADxC,EAAA,OAE0B,YAF1B;KAGG,eALW,CAAA,CAAA,EAAA,CAAA,CAAA,GAKa,CALb,GAAA;EAAA,MAAA,EAAA;IAAA,MAAA,EAON,CAPM;EAAA,CAAA;CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "akar",
3
3
  "type": "module",
4
- "version": "2.0.21",
4
+ "version": "2.0.22",
5
5
  "description": "Vue UI primitives components",
6
6
  "author": "Vinicunca Contributors (https://github.com/vinicunca)",
7
7
  "license": "MIT",
@@ -35,6 +35,8 @@ export interface NumberFieldRootProps extends PrimitiveProps, FormFieldProps {
35
35
  invertWheelChange?: boolean;
36
36
  /** Id of the element */
37
37
  id?: string;
38
+ /** The value the first increment or decrement sets when the field is empty. It is clamped to `min`/`max` but not snapped to `step`. Defaults to `min`, or `0` when `min` is not set. */
39
+ startingValue?: number;
38
40
  }
39
41
 
40
42
  // `undefined` is emitted when the input is cleared. Documented here rather than on the member
@@ -87,7 +89,7 @@ const props = withDefaults(defineProps<NumberFieldRootProps>(), {
87
89
  focusOnChange: true,
88
90
  });
89
91
  const emits = defineEmits<NumberFieldRootEmits>();
90
- const { disabled, readonly, disableWheelChange, invertWheelChange, min, max, step, stepSnapping, allowInvalid, formatOptions, id, locale: propLocale } = toRefs(props);
92
+ const { disabled, readonly, disableWheelChange, invertWheelChange, min, max, step, stepSnapping, allowInvalid, formatOptions, id, locale: propLocale, startingValue } = toRefs(props);
91
93
 
92
94
  const modelValue = useVModel(props, 'modelValue', emits, {
93
95
  defaultValue: props.defaultValue,
@@ -157,7 +159,14 @@ function handleChangingValue(type: 'increase' | 'decrease', multiplier = 1) {
157
159
  if (isNaN(currentInputValue)) {
158
160
  // Route the fallback through clampInputValue so the min/max contract still holds
159
161
  // (e.g. a negative max would otherwise be violated by the bare 0 fallback).
160
- modelValue.value = clampInputValue(min.value ?? 0);
162
+ // `startingValue` is used as given: kept within min/max, but not snapped to the step grid
163
+ // (a starting price of 40 with step 3 stays 40). The next tick aligns it via getNextValue.
164
+ modelValue.value = startingValue.value === undefined
165
+ ? clampInputValue(min.value ?? 0)
166
+ : numberParser.parse(numberFormatter.format(clamp(startingValue.value, {
167
+ min: min.value,
168
+ max: max.value,
169
+ })));
161
170
  return;
162
171
  }
163
172
 
@@ -5,6 +5,8 @@ export interface ToastActionProps extends ToastCloseProps {
5
5
  /**
6
6
  * A short description for an alternate way to carry out the action. For screen reader users
7
7
  * who will not be able to navigate to the button easily/quickly.
8
+ *
9
+ * A rendered action requires `altText`, unless the toast passed to `ToastRoot` has `actionProps.altText`.
8
10
  * @example <ToastAction altText="Goto account settings to upgrade">Upgrade</ToastAction>
9
11
  * @example <ToastAction altText="Undo (Alt+U)">Undo</ToastAction>
10
12
  */
@@ -25,17 +27,13 @@ import { useForwardExpose } from '@/shared';
25
27
  import ToastAnnounceExclude from './ToastAnnounceExclude.vue';
26
28
  import { injectToastRootContext } from './ToastRootImpl.vue';
27
29
 
28
- const props = withDefaults(
29
- defineProps<ToastActionProps>(),
30
- {
31
- as: 'button',
32
- closeOnClick: true,
33
- },
34
- );
30
+ const props = withDefaults(defineProps<ToastActionProps>(), {
31
+ as: 'button',
32
+ closeOnClick: true,
33
+ });
35
34
 
36
35
  const rootContext = injectToastRootContext();
37
36
  const { forwardRef } = useForwardExpose();
38
-
39
37
  const slots = useSlots();
40
38
 
41
39
  const actionProps = computed(() => rootContext.toast.value?.actionProps);
@@ -27,7 +27,6 @@ const props = withDefaults(defineProps<ToastArrowProps>(), {
27
27
  height: 5,
28
28
  as: 'svg',
29
29
  });
30
-
31
30
  useForwardExpose();
32
31
  </script>
33
32
 
@@ -1,18 +1,16 @@
1
1
  <script lang="ts">
2
2
  import type { PrimitiveProps } from '@/Primitive';
3
3
  import { useForwardExpose } from '@/shared';
4
- import { injectToastRootContext } from './ToastRootImpl.vue';
5
4
 
6
5
  export interface ToastDescriptionProps extends PrimitiveProps {}
7
6
  </script>
8
7
 
9
8
  <script setup lang="ts">
10
9
  import { Primitive } from '@/Primitive';
10
+ import { injectToastRootContext } from './ToastRootImpl.vue';
11
11
 
12
12
  const props = defineProps<ToastDescriptionProps>();
13
-
14
13
  useForwardExpose();
15
-
16
14
  const rootContext = injectToastRootContext(null);
17
15
  </script>
18
16
 
@@ -23,6 +21,5 @@ const rootContext = injectToastRootContext(null);
23
21
  v-bind="props"
24
22
  >
25
23
  <slot>{{ rootContext?.toast.value?.description }}</slot>
26
- <slot />
27
24
  </Primitive>
28
25
  </template>
@@ -112,7 +112,7 @@ function startTimer(duration: number) {
112
112
  function handleClose(event?: PointerEvent) {
113
113
  const isNonPointerEvent = event?.pointerType === '';
114
114
 
115
- // reka: update to only perform focus when user focus via keyboard
115
+ // akar: update to only perform focus when user focus via keyboard
116
116
  // focus viewport if focus is within toast to read the remaining toast
117
117
  // count to SR users and ensure focus isn't lost
118
118
  const isFocusInToast = currentElement.value?.contains(getActiveElement());
@@ -269,9 +269,9 @@ provideToastRootContext({ onClose: handleClose, toast: toRef(props, 'toast') });
269
269
  :inert="stack.limited || undefined"
270
270
  :style="{
271
271
  ...(providerContext.disableSwipe.value ? undefined : { userSelect: 'none', touchAction: 'none' }),
272
- '--reka-toast-index': stack.index,
273
- '--reka-toast-offset-y': `${stack.offsetY}px`,
274
- '--reka-toast-height': stackEntry.height ? `${stackEntry.height}px` : undefined,
272
+ '--akar-toast-index': stack.index,
273
+ '--akar-toast-offset-y': `${stack.offsetY}px`,
274
+ '--akar-toast-height': stackEntry.height ? `${stackEntry.height}px` : undefined,
275
275
  }"
276
276
  @pointerdown.left="(event: PointerEvent) => {
277
277
  if (providerContext.disableSwipe.value) return;
@@ -121,7 +121,7 @@ let count = 0;
121
121
 
122
122
  export function generateToastId() {
123
123
  count = (count + 1) % Number.MAX_SAFE_INTEGER;
124
- return `reka-toast-${count}`;
124
+ return `akar-toast-${count}`;
125
125
  }
126
126
 
127
127
  function resolvePromiseState<Value, Data extends object>(
@@ -59,9 +59,7 @@ export function useToastStore(): ToastStore {
59
59
  }
60
60
 
61
61
  toasts.value = toasts.value.map((toast) => closing.includes(toast) ? { ...toast, open: false } : toast);
62
- closing.forEach((toast) => {
63
- toast.onClose?.();
64
- });
62
+ closing.forEach((toast) => toast.onClose?.());
65
63
  }
66
64
 
67
65
  function update(id: string, updates: ToastUpdateOptions | ((prevToast: ToastObject) => ToastUpdateOptions)) {