@moubing/bing-ui 0.3.1 → 0.5.0

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 (36) hide show
  1. package/README.md +51 -10
  2. package/dist/bing-ui.css +1 -1
  3. package/dist/bing-ui.es.js +7741 -6898
  4. package/dist/bing-ui.umd.js +42 -42
  5. package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue.d.ts +1 -1
  6. package/dist/components/BingCarouselTransition/BingCarouselTransition.vue.d.ts +1 -1
  7. package/dist/components/BingCodeBlock/BingCodeBlock.types.d.ts +5 -1
  8. package/dist/components/BingCodeBlock/BingCodeBlock.vue.d.ts +2 -1
  9. package/dist/components/BingCodeBlock/index.d.ts +1 -1
  10. package/dist/components/BingDatePicker/BingDatePicker.types.d.ts +2 -0
  11. package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +1 -0
  12. package/dist/components/BingDeckTransition/BingDeckTransition.vue.d.ts +1 -1
  13. package/dist/components/BingDialog/BingDialog.types.d.ts +2 -0
  14. package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -3
  15. package/dist/components/BingFilePreview/BingFilePreview.types.d.ts +2 -0
  16. package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +1 -0
  17. package/dist/components/BingScrollbar/BingScrollbar.types.d.ts +6 -0
  18. package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -0
  19. package/dist/components/BingScrollbar/index.d.ts +1 -1
  20. package/dist/components/BingSelect/BingSelect.types.d.ts +3 -0
  21. package/dist/components/BingSelect/BingSelect.vue.d.ts +1 -0
  22. package/dist/components/BingSelect/index.d.ts +1 -1
  23. package/dist/components/BingSortableList/BingSortableList.vue.d.ts +2 -2
  24. package/dist/components/BingTable/BingTable.types.d.ts +2 -0
  25. package/dist/components/BingTable/BingTable.vue.d.ts +9 -8
  26. package/dist/components/BingTable/BingTableHeaderCell.vue.d.ts +20 -0
  27. package/dist/components/BingTabs/BingTabs.types.d.ts +2 -0
  28. package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -1
  29. package/dist/components/BingToast/BingToast.types.d.ts +2 -0
  30. package/dist/components/BingToast/BingToast.vue.d.ts +1 -0
  31. package/dist/components/BingTreeSelect/BingTreeSelect.types.d.ts +3 -0
  32. package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +1 -0
  33. package/dist/components/BingTreeSelect/index.d.ts +1 -1
  34. package/dist/motion/index.d.ts +1 -0
  35. package/dist/motion/smoothScroll.d.ts +45 -0
  36. package/package.json +2 -2
@@ -11,11 +11,11 @@ declare const __VLS_base: import('vue').DefineComponent<BingAppSwitcherTransitio
11
11
  onChange?: ((payload: import('./BingAppSwitcherTransition.types').BingAppSwitcherTransitionChangePayload) => any) | undefined;
12
12
  }>, {
13
13
  disabled: boolean;
14
+ respectReducedMotion: boolean;
14
15
  ariaLabel: string;
15
16
  modelValue: BingTabValue;
16
17
  items: import('./BingAppSwitcherTransition.types').BingAppSwitcherTransitionItem[];
17
18
  loop: boolean;
18
- respectReducedMotion: boolean;
19
19
  showTabs: boolean;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -11,11 +11,11 @@ declare const __VLS_base: import('vue').DefineComponent<BingCarouselTransitionPr
11
11
  onChange?: ((payload: import('./BingCarouselTransition.types').BingCarouselTransitionChangePayload) => any) | undefined;
12
12
  }>, {
13
13
  disabled: boolean;
14
+ respectReducedMotion: boolean;
14
15
  ariaLabel: string;
15
16
  modelValue: BingTabValue;
16
17
  items: import('./BingCarouselTransition.types').BingCarouselTransitionItem[];
17
18
  loop: boolean;
18
- respectReducedMotion: boolean;
19
19
  showTabs: boolean;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,11 +1,14 @@
1
1
  import { BingResizableProps } from '../BingResizable/BingResizable.types';
2
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
2
3
  export type BingCodeBlockHighlightLine = number | [number, number];
4
+ export type BingCodeBlockTheme = 'auto' | 'vitesse-light' | 'vitesse-dark' | 'github-light' | 'github-dark' | 'light-plus' | 'dark-plus' | (string & {});
3
5
  export interface BingCodeBlockResizableOptions extends Pick<BingResizableProps, 'defaultSize' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight' | 'mode' | 'snapMode' | 'directions' | 'step' | 'disabled' | 'lockAspectRatio' | 'contain' | 'showSize' | 'handleSize' | 'ariaLabel'> {
4
6
  }
5
7
  export interface BingCodeBlockProps {
6
8
  code: string;
7
9
  language?: string;
8
- theme?: string;
10
+ /** Shiki theme name. `auto` follows the global Bing UI light/dark/system theme. */
11
+ theme?: BingCodeBlockTheme;
9
12
  title?: string;
10
13
  languageLabel?: string;
11
14
  copyable?: boolean;
@@ -16,6 +19,7 @@ export interface BingCodeBlockProps {
16
19
  highlightLines?: BingCodeBlockHighlightLine[];
17
20
  width?: string | number;
18
21
  maxHeight?: string | number;
22
+ smoothScroll?: SmoothScrollValue;
19
23
  resizable?: boolean;
20
24
  resizableOptions?: BingCodeBlockResizableOptions;
21
25
  wrap?: boolean;
@@ -12,8 +12,9 @@ declare const __VLS_export: import('vue').DefineComponent<BingCodeBlockProps, {}
12
12
  width: string | number;
13
13
  title: string;
14
14
  ariaLabel: string;
15
+ smoothScroll: import('../..').SmoothScrollValue;
15
16
  wrap: boolean;
16
- theme: string;
17
+ theme: import('./BingCodeBlock.types').BingCodeBlockTheme;
17
18
  language: string;
18
19
  languageLabel: string;
19
20
  copyable: boolean;
@@ -1,2 +1,2 @@
1
1
  export { default as BingCodeBlock } from './BingCodeBlock.vue';
2
- export type { BingCodeBlockCopyPayload, BingCodeBlockEmits, BingCodeBlockHighlightLine, BingCodeBlockProps, BingCodeBlockResizableOptions, } from './BingCodeBlock.types';
2
+ export type { BingCodeBlockCopyPayload, BingCodeBlockEmits, BingCodeBlockHighlightLine, BingCodeBlockProps, BingCodeBlockResizableOptions, BingCodeBlockTheme, } from './BingCodeBlock.types';
@@ -1,4 +1,5 @@
1
1
  import { Dayjs } from 'dayjs';
2
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
2
3
  import { BingGlassEffectProps } from '../../utils/glass';
3
4
  export type BingDatePickerType = 'date' | 'datetime' | 'month' | 'year' | 'time';
4
5
  export type BingDatePickerSize = 'sm' | 'md' | 'lg';
@@ -46,6 +47,7 @@ export interface BingDatePickerProps extends BingGlassEffectProps {
46
47
  hourStep?: number;
47
48
  minuteStep?: number;
48
49
  secondStep?: number;
50
+ smoothScroll?: SmoothScrollValue;
49
51
  showShortcuts?: boolean;
50
52
  panelMaxHeight?: string | number;
51
53
  ariaLabel?: string;
@@ -25,6 +25,7 @@ declare const __VLS_export: import('vue').DefineComponent<BingDatePickerProps, B
25
25
  modelValue: BingDatePickerModelValue;
26
26
  size: import('./BingDatePicker.types').BingDatePickerSize;
27
27
  block: boolean;
28
+ smoothScroll: import('../..').SmoothScrollValue;
28
29
  glassBlur: string | number;
29
30
  glassOpacity: number;
30
31
  glassSaturation: number;
@@ -12,10 +12,10 @@ declare const __VLS_base: import('vue').DefineComponent<BingDeckTransitionProps,
12
12
  onChange?: ((payload: import('./BingDeckTransition.types').BingDeckTransitionChangePayload) => any) | undefined;
13
13
  }>, {
14
14
  disabled: boolean;
15
+ respectReducedMotion: boolean;
15
16
  modelValue: BingTabValue;
16
17
  items: import('./BingDeckTransition.types').BingDeckTransitionItem[];
17
18
  loop: boolean;
18
- respectReducedMotion: boolean;
19
19
  showControls: boolean;
20
20
  controlLabel: string;
21
21
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,4 +1,5 @@
1
1
  import { BingGlassEffectProps } from '../../utils/glass';
2
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
2
3
  export type BingDialogCloseReason = 'close' | 'cancel' | 'overlay' | 'escape' | 'confirm';
3
4
  export interface BingDialogOverlayOrb {
4
5
  id?: string;
@@ -19,6 +20,7 @@ export interface BingDialogProps extends BingGlassEffectProps {
19
20
  width?: string | number;
20
21
  zIndex?: number;
21
22
  lockScroll?: boolean;
23
+ smoothScroll?: SmoothScrollValue;
22
24
  closeOnOverlay?: boolean;
23
25
  closeOnEsc?: boolean;
24
26
  closeOnConfirm?: boolean;
@@ -2,7 +2,7 @@ import { BingDialogCloseReason, BingDialogOverlayOrb, BingDialogProps } from './
2
2
  declare function closeDialog(reason: BingDialogCloseReason): void;
3
3
  declare function handleCancel(): void;
4
4
  declare function handleConfirm(): void;
5
- declare var __VLS_7: {}, __VLS_28: {}, __VLS_30: {
5
+ declare var __VLS_7: {}, __VLS_36: {}, __VLS_38: {
6
6
  close: typeof closeDialog;
7
7
  cancel: typeof handleCancel;
8
8
  confirm: typeof handleConfirm;
@@ -10,9 +10,9 @@ declare var __VLS_7: {}, __VLS_28: {}, __VLS_30: {
10
10
  type __VLS_Slots = {} & {
11
11
  title?: (props: typeof __VLS_7) => any;
12
12
  } & {
13
- default?: (props: typeof __VLS_28) => any;
13
+ default?: (props: typeof __VLS_36) => any;
14
14
  } & {
15
- footer?: (props: typeof __VLS_30) => any;
15
+ footer?: (props: typeof __VLS_38) => any;
16
16
  };
17
17
  declare const __VLS_base: import('vue').DefineComponent<BingDialogProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
18
  "update:modelValue": (value: boolean) => any;
@@ -31,6 +31,7 @@ declare const __VLS_base: import('vue').DefineComponent<BingDialogProps, {}, {},
31
31
  glass: boolean;
32
32
  ariaLabel: string;
33
33
  modelValue: boolean;
34
+ smoothScroll: import('../..').SmoothScrollValue;
34
35
  glassBlur: string | number;
35
36
  glassOpacity: number;
36
37
  glassSaturation: number;
@@ -1,4 +1,5 @@
1
1
  import { BingGlassEffectProps } from '../../utils/glass';
2
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
2
3
  export type BingFilePreviewKind = 'auto' | 'image' | 'pdf' | 'text' | 'json' | 'csv' | 'docx' | 'xlsx' | 'pptx' | 'office' | 'unknown';
3
4
  export type BingFilePreviewResolvedKind = Exclude<BingFilePreviewKind, 'auto'>;
4
5
  export type BingFilePreviewCloseReason = 'close' | 'overlay' | 'escape';
@@ -26,6 +27,7 @@ export interface BingFilePreviewProps extends BingGlassEffectProps {
26
27
  zIndex?: number;
27
28
  width?: string | number;
28
29
  height?: string | number;
30
+ smoothScroll?: SmoothScrollValue;
29
31
  lockScroll?: boolean;
30
32
  closeOnEsc?: boolean;
31
33
  closeOnOverlay?: boolean;
@@ -21,6 +21,7 @@ declare const __VLS_export: import('vue').DefineComponent<BingFilePreviewProps,
21
21
  ariaLabel: string;
22
22
  modelValue: boolean;
23
23
  size: number;
24
+ smoothScroll: import('../..').SmoothScrollValue;
24
25
  name: string;
25
26
  glassBlur: string | number;
26
27
  glassOpacity: number;
@@ -1,3 +1,5 @@
1
+ import { SmoothScrollOptions, SmoothScrollValue } from '../../motion/smoothScroll';
2
+ export type BingScrollbarSmoothOptions = SmoothScrollOptions;
1
3
  export interface BingScrollbarProps {
2
4
  height?: string | number;
3
5
  maxHeight?: string | number;
@@ -7,14 +9,18 @@ export interface BingScrollbarProps {
7
9
  horizontal?: boolean;
8
10
  always?: boolean;
9
11
  disabled?: boolean;
12
+ focusable?: boolean;
10
13
  ariaLabel?: string;
14
+ smooth?: SmoothScrollValue;
11
15
  }
12
16
  export interface BingScrollbarEmits {
13
17
  scroll: [event: Event];
14
18
  }
15
19
  export interface BingScrollbarExpose {
20
+ handleWheel: (event: WheelEvent) => boolean;
16
21
  scrollBy: (options: ScrollToOptions | number) => void;
17
22
  scrollTo: (options: ScrollToOptions | number) => void;
23
+ stop: () => void;
18
24
  update: () => void;
19
25
  viewport: HTMLElement | null;
20
26
  }
@@ -15,8 +15,10 @@ declare const __VLS_base: import('vue').DefineComponent<BingScrollbarProps, Bing
15
15
  ariaLabel: string;
16
16
  horizontal: boolean;
17
17
  vertical: boolean;
18
+ focusable: boolean;
18
19
  minThumbSize: number;
19
20
  overflowTolerance: number;
21
+ smooth: import('../..').SmoothScrollValue;
20
22
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
23
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
24
  declare const _default: typeof __VLS_export;
@@ -1,2 +1,2 @@
1
1
  export { default as BingScrollbar } from './BingScrollbar.vue';
2
- export type { BingScrollbarEmits, BingScrollbarExpose, BingScrollbarProps, } from './BingScrollbar.types';
2
+ export type { BingScrollbarEmits, BingScrollbarExpose, BingScrollbarProps, BingScrollbarSmoothOptions, } from './BingScrollbar.types';
@@ -1,9 +1,11 @@
1
1
  import { BingGlassEffectProps } from '../../utils/glass';
2
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
2
3
  export type BingSelectValue = string | number;
3
4
  export type BingSelectModelValue = BingSelectValue | BingSelectValue[] | null;
4
5
  export type BingSelectSize = 'sm' | 'md' | 'lg';
5
6
  export type BingSelectVirtualMode = boolean | 'auto';
6
7
  export type BingSelectSearchable = boolean | 'auto';
8
+ export type BingSelectSmoothScroll = SmoothScrollValue;
7
9
  export type BingSelectPanelPlacement = 'auto' | 'top' | 'bottom' | 'left' | 'right';
8
10
  export type BingSelectPanelAlign = 'start' | 'middle' | 'end';
9
11
  export type BingSelectOptionMetaValue = string | number | boolean | null | undefined;
@@ -31,6 +33,7 @@ export interface BingSelectProps extends BingGlassEffectProps {
31
33
  searchable?: BingSelectSearchable;
32
34
  searchPlaceholder?: string;
33
35
  noSearchResultsText?: string;
36
+ smoothScroll?: BingSelectSmoothScroll;
34
37
  size?: BingSelectSize;
35
38
  block?: boolean;
36
39
  width?: string | number;
@@ -38,6 +38,7 @@ declare const __VLS_base: import('vue').DefineComponent<BingSelectProps, {}, {},
38
38
  modelValue: BingSelectModelValue;
39
39
  size: import('./BingSelect.types').BingSelectSize;
40
40
  block: boolean;
41
+ smoothScroll: import('./BingSelect.types').BingSelectSmoothScroll;
41
42
  glassBlur: string | number;
42
43
  glassOpacity: number;
43
44
  glassSaturation: number;
@@ -1,2 +1,2 @@
1
1
  export { default as BingSelect } from './BingSelect.vue';
2
- export type { BingSelectChangePayload, BingSelectEmits, BingSelectModelValue, BingSelectOption, BingSelectProps, BingSelectSize, BingSelectValue, BingSelectVirtualMode, } from './BingSelect.types';
2
+ export type { BingSelectChangePayload, BingSelectEmits, BingSelectModelValue, BingSelectOption, BingSelectProps, BingSelectSize, BingSelectSmoothScroll, BingSelectValue, BingSelectVirtualMode, } from './BingSelect.types';
@@ -27,15 +27,15 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
27
27
  }>, {
28
28
  disabled: boolean;
29
29
  order: BingSortableListKey[];
30
+ duration: number;
31
+ keyboard: boolean;
30
32
  ariaLabel: string;
31
33
  items: any[];
32
- duration: number;
33
34
  flip: boolean;
34
35
  itemKey: import('./BingSortableList.types').BingSortableListItemKey<any>;
35
36
  axis: import('./BingSortableList.types').BingSortableListAxis;
36
37
  itemDisabled: import('./BingSortableList.types').BingSortableListItemDisabled<any>;
37
38
  disabledKeys: BingSortableListKey[];
38
- keyboard: boolean;
39
39
  reorderMode: import('./BingSortableList.types').BingSortableListReorderMode;
40
40
  settleDuration: number;
41
41
  dragThreshold: number;
@@ -1,3 +1,4 @@
1
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
1
2
  export type BingTableKey = string | number;
2
3
  export type BingTableAlign = 'left' | 'center' | 'right';
3
4
  export type BingTableFixed = 'left' | 'right';
@@ -75,6 +76,7 @@ export interface BingTableProps {
75
76
  childrenKey?: string;
76
77
  height?: number | string;
77
78
  maxHeight?: number | string;
79
+ smoothScroll?: SmoothScrollValue;
78
80
  size?: BingTableSize;
79
81
  bordered?: boolean;
80
82
  striped?: boolean;
@@ -5,17 +5,17 @@ interface BingTableResolvedColumn extends BingTableColumn {
5
5
  declare var __VLS_1: {
6
6
  selectedRowKeys: BingTableKey[];
7
7
  visibleColumns: BingTableResolvedColumn[];
8
- }, __VLS_72: `header-${string}`, __VLS_73: {
8
+ }, __VLS_96: `header-${string}`, __VLS_97: {
9
9
  column: BingTableResolvedColumn;
10
- }, __VLS_81: `header-${string}`, __VLS_82: {
10
+ }, __VLS_105: `header-${string}`, __VLS_106: {
11
11
  column: BingTableResolvedColumn;
12
- }, __VLS_113: `cell-${string}`, __VLS_114: {
12
+ }, __VLS_137: `cell-${string}`, __VLS_138: {
13
13
  row: BingTableRow;
14
14
  column: BingTableResolvedColumn;
15
15
  value: unknown;
16
16
  rowIndex: number;
17
17
  level: number;
18
- }, __VLS_116: {
18
+ }, __VLS_140: {
19
19
  row: BingTableRow;
20
20
  column: BingTableResolvedColumn;
21
21
  value: unknown;
@@ -23,15 +23,15 @@ declare var __VLS_1: {
23
23
  level: number;
24
24
  };
25
25
  type __VLS_Slots = {} & {
26
- [K in NonNullable<typeof __VLS_72>]?: (props: typeof __VLS_73) => any;
26
+ [K in NonNullable<typeof __VLS_96>]?: (props: typeof __VLS_97) => any;
27
27
  } & {
28
- [K in NonNullable<typeof __VLS_81>]?: (props: typeof __VLS_82) => any;
28
+ [K in NonNullable<typeof __VLS_105>]?: (props: typeof __VLS_106) => any;
29
29
  } & {
30
- [K in NonNullable<typeof __VLS_113>]?: (props: typeof __VLS_114) => any;
30
+ [K in NonNullable<typeof __VLS_137>]?: (props: typeof __VLS_138) => any;
31
31
  } & {
32
32
  toolbar?: (props: typeof __VLS_1) => any;
33
33
  } & {
34
- cell?: (props: typeof __VLS_116) => any;
34
+ cell?: (props: typeof __VLS_140) => any;
35
35
  };
36
36
  declare const __VLS_base: import('vue').DefineComponent<BingTableProps, BingTableExpose, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
37
37
  scroll: (event: Event) => any;
@@ -82,6 +82,7 @@ declare const __VLS_base: import('vue').DefineComponent<BingTableProps, BingTabl
82
82
  data: BingTableRow[];
83
83
  ariaLabel: string;
84
84
  size: import('./BingTable.types').BingTableSize;
85
+ smoothScroll: import('../..').SmoothScrollValue;
85
86
  loading: boolean;
86
87
  page: number;
87
88
  emptyText: string;
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ columnKey: string;
3
+ index: number;
4
+ disabled?: boolean;
5
+ };
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
+ disabled: boolean;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -1,3 +1,4 @@
1
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
1
2
  export type BingTabValue = string | number;
2
3
  export type BingTabsSize = 'sm' | 'md' | 'lg';
3
4
  export type BingTabsVariant = 'pill' | 'glass' | 'soft';
@@ -20,6 +21,7 @@ export interface BingTabsProps {
20
21
  loop?: boolean;
21
22
  animated?: boolean;
22
23
  respectReducedMotion?: boolean;
24
+ smoothScroll?: SmoothScrollValue;
23
25
  ariaLabel?: string;
24
26
  }
25
27
  export interface BingTabsChangePayload {
@@ -19,6 +19,7 @@ declare const __VLS_base: import('vue').DefineComponent<BingTabsProps, {}, {}, {
19
19
  onBlur?: ((payload: BingTabsFocusPayload) => any) | undefined;
20
20
  }>, {
21
21
  disabled: boolean;
22
+ respectReducedMotion: boolean;
22
23
  ariaLabel: string;
23
24
  modelValue: BingTabValue;
24
25
  items: BingTabItem[];
@@ -28,7 +29,7 @@ declare const __VLS_base: import('vue').DefineComponent<BingTabsProps, {}, {}, {
28
29
  block: boolean;
29
30
  loop: boolean;
30
31
  animated: boolean;
31
- respectReducedMotion: boolean;
32
+ smoothScroll: import('../..').SmoothScrollValue;
32
33
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
35
  declare const _default: typeof __VLS_export;
@@ -1,3 +1,4 @@
1
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
1
2
  export declare const BING_TOAST_POSITIONS: readonly ["top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"];
2
3
  export declare const BING_TOAST_POSITION_ALIASES: readonly ["top-center", "bottom-center"];
3
4
  export declare const BING_TOAST_POSITION_OPTIONS: readonly ["top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right", "top-center", "bottom-center"];
@@ -37,6 +38,7 @@ export interface BingToastProps {
37
38
  gap?: string | number;
38
39
  width?: string | number;
39
40
  max?: number;
41
+ smoothScroll?: SmoothScrollValue;
40
42
  }
41
43
  export interface BingToastEmits {
42
44
  close: [toast: BingToastItem];
@@ -7,6 +7,7 @@ declare const __VLS_export: import('vue').DefineComponent<BingToastProps, {}, {}
7
7
  gap: string | number;
8
8
  width: string | number;
9
9
  zIndex: number;
10
+ smoothScroll: import('../..').SmoothScrollValue;
10
11
  max: number;
11
12
  offset: string | number;
12
13
  viewportPosition: import('./BingToast.types').BingToastViewportPosition;
@@ -1,9 +1,11 @@
1
1
  import { BingGlassEffectProps } from '../../utils/glass';
2
+ import { SmoothScrollValue } from '../../motion/smoothScroll';
2
3
  export type BingTreeSelectValue = string | number;
3
4
  export type BingTreeSelectModelValue = BingTreeSelectValue | BingTreeSelectValue[] | null;
4
5
  export type BingTreeSelectSize = 'sm' | 'md' | 'lg';
5
6
  export type BingTreeSelectVirtualMode = boolean | 'auto';
6
7
  export type BingTreeSelectSearchable = boolean | 'auto';
8
+ export type BingTreeSelectSmoothScroll = SmoothScrollValue;
7
9
  export type BingTreeSelectPanelPlacement = 'auto' | 'top' | 'bottom' | 'left' | 'right';
8
10
  export type BingTreeSelectPanelAlign = 'start' | 'middle' | 'end';
9
11
  export type BingTreeSelectNodeMetaValue = string | number | boolean | null | undefined;
@@ -36,6 +38,7 @@ export interface BingTreeSelectProps extends BingGlassEffectProps {
36
38
  searchable?: BingTreeSelectSearchable;
37
39
  searchPlaceholder?: string;
38
40
  noSearchResultsText?: string;
41
+ smoothScroll?: BingTreeSelectSmoothScroll;
39
42
  defaultExpandedValues?: BingTreeSelectValue[];
40
43
  defaultExpandAll?: boolean;
41
44
  size?: BingTreeSelectSize;
@@ -45,6 +45,7 @@ declare const __VLS_base: import('vue').DefineComponent<BingTreeSelectProps, {},
45
45
  modelValue: BingTreeSelectModelValue;
46
46
  size: import('./BingTreeSelect.types').BingTreeSelectSize;
47
47
  block: boolean;
48
+ smoothScroll: import('./BingTreeSelect.types').BingTreeSelectSmoothScroll;
48
49
  glassBlur: string | number;
49
50
  glassOpacity: number;
50
51
  glassSaturation: number;
@@ -1,2 +1,2 @@
1
1
  export { default as BingTreeSelect } from './BingTreeSelect.vue';
2
- export type { BingTreeSelectChangePayload, BingTreeSelectEmits, BingTreeSelectExpandPayload, BingTreeSelectModelValue, BingTreeSelectNode, BingTreeSelectProps, BingTreeSelectSearchable, BingTreeSelectSize, BingTreeSelectValue, BingTreeSelectVirtualMode, } from './BingTreeSelect.types';
2
+ export type { BingTreeSelectChangePayload, BingTreeSelectEmits, BingTreeSelectExpandPayload, BingTreeSelectModelValue, BingTreeSelectNode, BingTreeSelectProps, BingTreeSelectSearchable, BingTreeSelectSize, BingTreeSelectSmoothScroll, BingTreeSelectValue, BingTreeSelectVirtualMode, } from './BingTreeSelect.types';
@@ -11,3 +11,4 @@ export declare const motion: {
11
11
  };
12
12
  };
13
13
  export declare function prefersReducedMotion(): boolean;
14
+ export * from './smoothScroll';
@@ -0,0 +1,45 @@
1
+ export interface SmoothScrollOptions {
2
+ duration?: number;
3
+ stepSize?: number;
4
+ pulseScale?: number;
5
+ accelerationDelta?: number;
6
+ accelerationMax?: number;
7
+ keyboardStep?: number;
8
+ keyboard?: boolean;
9
+ smoothTouchpad?: boolean;
10
+ respectReducedMotion?: boolean;
11
+ }
12
+ export type SmoothScrollValue = boolean | SmoothScrollOptions;
13
+ export interface ResolvedSmoothScrollOptions {
14
+ duration: number;
15
+ stepSize: number;
16
+ pulseScale: number;
17
+ accelerationDelta: number;
18
+ accelerationMax: number;
19
+ keyboardStep: number;
20
+ keyboard: boolean;
21
+ smoothTouchpad: boolean;
22
+ respectReducedMotion: boolean;
23
+ }
24
+ export interface SmoothScrollAxes {
25
+ horizontal: boolean;
26
+ vertical: boolean;
27
+ }
28
+ export interface SmoothScrollControllerOptions {
29
+ getElement: () => HTMLElement | null;
30
+ getOptions?: () => SmoothScrollOptions | undefined;
31
+ getAxes?: () => SmoothScrollAxes;
32
+ isEnabled?: () => boolean;
33
+ }
34
+ export interface SmoothScrollController {
35
+ cancel: () => void;
36
+ handleKeydown: (event: KeyboardEvent) => boolean;
37
+ handleWheel: (event: WheelEvent) => boolean;
38
+ isAnimating: () => boolean;
39
+ }
40
+ export declare const defaultSmoothScrollOptions: Readonly<ResolvedSmoothScrollOptions>;
41
+ export declare const compactSmoothScrollOptions: Readonly<SmoothScrollOptions>;
42
+ export declare function resolveComponentSmoothScroll(value: SmoothScrollValue | undefined, preset?: SmoothScrollOptions, enforced?: SmoothScrollOptions): false | SmoothScrollOptions;
43
+ export declare function resolveSmoothScrollOptions(options: SmoothScrollOptions | undefined): ResolvedSmoothScrollOptions;
44
+ export declare function pulseEase(progress: number, scale?: number): number;
45
+ export declare function createSmoothScrollController(controllerOptions: SmoothScrollControllerOptions): SmoothScrollController;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moubing/bing-ui",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -64,7 +64,7 @@
64
64
  "preview": "vite preview",
65
65
  "test": "vitest",
66
66
  "test:run": "vitest run",
67
- "test:browser": "vitest --config vitest.browser.config.ts --passWithNoTests",
67
+ "test:browser": "vitest run --config vitest.browser.config.ts --passWithNoTests",
68
68
  "test:visual": "playwright test",
69
69
  "storybook": "node scripts/storybook-dev.mjs",
70
70
  "build-storybook": "cross-env STORYBOOK=true storybook build",