@v-miniapp/ui-react 1.0.37 → 1.0.39

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 (203) hide show
  1. package/dist/components/alert/alert.d.ts +12 -0
  2. package/dist/components/alert/index.d.ts +1 -0
  3. package/dist/components/app/components/app.d.ts +13 -0
  4. package/dist/components/app/components/bottom-tab-bar.d.ts +2 -0
  5. package/dist/components/app/components/link.d.ts +8 -0
  6. package/dist/components/app/components/navigation-analytic.d.ts +2 -0
  7. package/dist/components/app/components/navigation-bar.d.ts +2 -0
  8. package/dist/components/app/components/page-layout.d.ts +3 -0
  9. package/dist/components/app/components/pages-render.d.ts +2 -0
  10. package/dist/components/app/context/location-key.d.ts +4 -0
  11. package/dist/components/app/hooks/use-app-pause.d.ts +1 -0
  12. package/dist/components/app/hooks/use-app-resume.d.ts +1 -0
  13. package/dist/components/app/hooks/use-app-state.d.ts +7 -0
  14. package/dist/components/app/hooks/use-bottom-tab-bar.d.ts +13 -0
  15. package/dist/components/app/hooks/use-custom-icon-event.d.ts +1 -0
  16. package/dist/components/app/hooks/use-did-hide.d.ts +1 -0
  17. package/dist/components/app/hooks/use-did-show.d.ts +1 -0
  18. package/dist/components/app/hooks/use-history.d.ts +2 -0
  19. package/dist/components/app/hooks/use-location.d.ts +1 -0
  20. package/dist/components/app/hooks/use-navigate.d.ts +1 -0
  21. package/dist/components/app/hooks/use-navigation-bar.d.ts +12 -0
  22. package/dist/components/app/hooks/use-navigation-type.d.ts +1 -0
  23. package/dist/components/app/hooks/use-page-config.d.ts +1 -0
  24. package/dist/components/app/hooks/use-page-layout.d.ts +14 -0
  25. package/dist/components/app/hooks/use-page-scroll.d.ts +5 -0
  26. package/dist/components/app/hooks/use-page-state.d.ts +6 -0
  27. package/dist/components/app/hooks/use-settings-changed.d.ts +3 -0
  28. package/dist/components/app/index.d.ts +18 -0
  29. package/dist/components/app/stores/app.d.ts +24 -0
  30. package/dist/components/app/stores/app.selector.d.ts +11 -0
  31. package/dist/components/app/types/app.d.ts +55 -0
  32. package/dist/components/app/types/navigation.d.ts +30 -0
  33. package/dist/components/app/utils/animation.d.ts +2 -0
  34. package/dist/components/app/utils/data-theme.d.ts +5 -0
  35. package/dist/components/app/utils/history.d.ts +7 -0
  36. package/dist/components/avatar/avatar.d.ts +15 -0
  37. package/dist/components/avatar/index.d.ts +1 -0
  38. package/dist/components/badge/badge.d.ts +8 -0
  39. package/dist/components/badge/index.d.ts +1 -0
  40. package/dist/components/bottom-tab-bar/bottom-tab-bar.d.ts +22 -0
  41. package/dist/components/bottom-tab-bar/index.d.ts +1 -0
  42. package/dist/components/button/button.const.d.ts +3 -0
  43. package/dist/components/button/button.d.ts +20 -0
  44. package/dist/components/button/index.d.ts +1 -0
  45. package/dist/components/calendar/calendar-range-sheet.d.ts +14 -0
  46. package/dist/components/calendar/calendar-single-sheet.d.ts +14 -0
  47. package/dist/components/calendar/calendar.d.ts +10 -0
  48. package/dist/components/calendar/default-render.d.ts +3 -0
  49. package/dist/components/calendar/index.d.ts +1 -0
  50. package/dist/components/calendar/range-picker.d.ts +11 -0
  51. package/dist/components/calendar/single-picker.d.ts +9 -0
  52. package/dist/components/calendar/utils.d.ts +60 -0
  53. package/dist/components/carousel/carousel.d.ts +15 -0
  54. package/dist/components/carousel/index.d.ts +1 -0
  55. package/dist/components/carousel/use-carousel.d.ts +27 -0
  56. package/dist/components/checkbox/check-icon.d.ts +6 -0
  57. package/dist/components/checkbox/checkbox.d.ts +24 -0
  58. package/dist/components/checkbox/indeterminate-icon.d.ts +6 -0
  59. package/dist/components/checkbox/index.d.ts +1 -0
  60. package/dist/components/chip/chip.d.ts +16 -0
  61. package/dist/components/chip/index.d.ts +1 -0
  62. package/dist/components/date-field/date-field-range.d.ts +76 -0
  63. package/dist/components/date-field/date-field.d.ts +56 -0
  64. package/dist/components/date-field/index.d.ts +2 -0
  65. package/dist/components/date-field/input.d.ts +6 -0
  66. package/dist/components/date-picker/date-picker-base.d.ts +32 -0
  67. package/dist/components/date-picker/date-picker-item.d.ts +14 -0
  68. package/dist/components/date-picker/date-picker-sheet.d.ts +14 -0
  69. package/dist/components/date-picker/date-picker.constant.d.ts +8 -0
  70. package/dist/components/date-picker/date-picker.d.ts +17 -0
  71. package/dist/components/date-picker/date-picker.utils.d.ts +31 -0
  72. package/dist/components/date-picker/index.d.ts +2 -0
  73. package/dist/components/dialog/dialog.d.ts +20 -0
  74. package/dist/components/dialog/index.d.ts +1 -0
  75. package/dist/components/dropdown/dropdown-base.d.ts +6 -0
  76. package/dist/components/dropdown/dropdown.d.ts +33 -0
  77. package/dist/components/dropdown/index.d.ts +2 -0
  78. package/dist/components/error/error-boundary.d.ts +15 -0
  79. package/dist/components/error/error.d.ts +10 -0
  80. package/dist/components/error/index.d.ts +1 -0
  81. package/dist/components/freeze/index.d.ts +11 -0
  82. package/dist/components/icon/icon-mapping.d.ts +246 -0
  83. package/dist/components/icon/icon.d.ts +29 -0
  84. package/dist/components/icon/index.d.ts +1 -0
  85. package/dist/components/image/image.d.ts +10 -0
  86. package/dist/components/image/index.d.ts +1 -0
  87. package/dist/components/index.d.ts +43 -0
  88. package/dist/components/input-wrapper/index.d.ts +1 -0
  89. package/dist/components/input-wrapper/input-wrapper.d.ts +33 -0
  90. package/dist/components/label/index.d.ts +1 -0
  91. package/dist/components/label/label.d.ts +11 -0
  92. package/dist/components/layout/app.d.ts +3 -0
  93. package/dist/components/layout/index.d.ts +2 -0
  94. package/dist/components/layout/page-loading.d.ts +6 -0
  95. package/dist/components/layout/page.d.ts +18 -0
  96. package/dist/components/list-item/index.d.ts +1 -0
  97. package/dist/components/list-item/list-item.d.ts +12 -0
  98. package/dist/components/navigation-bar/index.d.ts +1 -0
  99. package/dist/components/navigation-bar/navigation-bar.d.ts +26 -0
  100. package/dist/components/number-field/index.d.ts +1 -0
  101. package/dist/components/number-field/number-field.d.ts +23 -0
  102. package/dist/components/old-date-picker/date-picker-base.d.ts +32 -0
  103. package/dist/components/old-date-picker/date-picker-item.d.ts +11 -0
  104. package/dist/components/old-date-picker/date-picker-sheet.d.ts +14 -0
  105. package/dist/components/old-date-picker/date-picker.constant.d.ts +3 -0
  106. package/dist/components/old-date-picker/date-picker.d.ts +21 -0
  107. package/dist/components/old-date-picker/index.d.ts +2 -0
  108. package/dist/components/option-item/index.d.ts +1 -0
  109. package/dist/components/option-item/option-item.d.ts +10 -0
  110. package/dist/components/pagination/index.d.ts +1 -0
  111. package/dist/components/pagination/pagination.d.ts +7 -0
  112. package/dist/components/pull-to-refresh/index.d.ts +1 -0
  113. package/dist/components/pull-to-refresh/pull-to-refresh.d.ts +17 -0
  114. package/dist/components/radio/index.d.ts +1 -0
  115. package/dist/components/radio/radio.d.ts +19 -0
  116. package/dist/components/rating/index.d.ts +1 -0
  117. package/dist/components/rating/rating.d.ts +12 -0
  118. package/dist/components/rating/star.d.ts +6 -0
  119. package/dist/components/search-field/index.d.ts +1 -0
  120. package/dist/components/search-field/search-field.d.ts +4 -0
  121. package/dist/components/section/index.d.ts +3 -0
  122. package/dist/components/section/section-content.d.ts +3 -0
  123. package/dist/components/section/section-title.d.ts +12 -0
  124. package/dist/components/section/section.d.ts +6 -0
  125. package/dist/components/seo/index.d.ts +2 -0
  126. package/dist/components/seo/seo.d.ts +7 -0
  127. package/dist/components/seo/seo.type.d.ts +85 -0
  128. package/dist/components/sheet/index.d.ts +4 -0
  129. package/dist/components/sheet/sheet-body.d.ts +6 -0
  130. package/dist/components/sheet/sheet-footer.d.ts +5 -0
  131. package/dist/components/sheet/sheet-header.d.ts +11 -0
  132. package/dist/components/sheet/sheet.d.ts +11 -0
  133. package/dist/components/skeleton/index.d.ts +1 -0
  134. package/dist/components/skeleton/skeleton.d.ts +13 -0
  135. package/dist/components/switch/index.d.ts +1 -0
  136. package/dist/components/switch/switch.d.ts +16 -0
  137. package/dist/components/tab-bar/index.d.ts +1 -0
  138. package/dist/components/tab-bar/tab-bar.d.ts +26 -0
  139. package/dist/components/tab-bar/tab.d.ts +6 -0
  140. package/dist/components/text-area/index.d.ts +1 -0
  141. package/dist/components/text-area/text-area.d.ts +15 -0
  142. package/dist/components/text-field/index.d.ts +1 -0
  143. package/dist/components/text-field/text-field.d.ts +18 -0
  144. package/dist/components/toast/index.d.ts +1 -0
  145. package/dist/components/toast/toast-provider.d.ts +2 -0
  146. package/dist/components/toast/toast.d.ts +20 -0
  147. package/dist/components/toast/toast.store.d.ts +25 -0
  148. package/dist/components/tooltip/index.d.ts +1 -0
  149. package/dist/components/tooltip/tooltip.d.ts +10 -0
  150. package/dist/components/typography/index.d.ts +1 -0
  151. package/dist/components/typography/typography.d.ts +13 -0
  152. package/dist/components/uploader/helper.d.ts +5 -0
  153. package/dist/components/uploader/index.d.ts +1 -0
  154. package/dist/components/uploader/type.d.ts +9 -0
  155. package/dist/components/uploader/uploader.d.ts +18 -0
  156. package/dist/components/visibility-sensor/index.d.ts +1 -0
  157. package/dist/components/visibility-sensor/visibility-sensor.d.ts +9 -0
  158. package/dist/external/index.js +15758 -0
  159. package/dist/external/styles.css +1 -0
  160. package/dist/hooks/use-analytic.d.ts +1 -0
  161. package/dist/hooks/use-is-using-app.d.ts +1 -0
  162. package/dist/hooks/use-is-using-locales.d.ts +1 -0
  163. package/dist/hooks/use-swipe-navigation.d.ts +2 -0
  164. package/dist/index.d.ts +3 -0
  165. package/dist/index.js +7677 -0
  166. package/dist/locales/defaultResources/en.d.ts +27 -0
  167. package/dist/locales/defaultResources/vi.d.ts +27 -0
  168. package/dist/locales/fns.d.ts +6 -0
  169. package/dist/locales/hooks.d.ts +9 -0
  170. package/dist/locales/index.d.ts +4 -0
  171. package/dist/locales/provider.d.ts +6 -0
  172. package/dist/locales/store.d.ts +13 -0
  173. package/dist/locales/types.d.ts +37 -0
  174. package/dist/locales/utils.d.ts +2 -0
  175. package/dist/styles.css +1 -0
  176. package/dist/styles.d.ts +1 -0
  177. package/dist/tailwind/colors.css +369 -0
  178. package/dist/tailwind/styles.css +5 -0
  179. package/dist/types/colors.d.ts +3 -0
  180. package/dist/types/util.d.ts +1 -0
  181. package/dist/utils/analytic.d.ts +17 -0
  182. package/dist/utils/bound.d.ts +1 -0
  183. package/dist/utils/can-use-dom.d.ts +1 -0
  184. package/dist/utils/classname.d.ts +3 -0
  185. package/dist/utils/colors.d.ts +2 -0
  186. package/dist/utils/colors.gen.d.ts +368 -0
  187. package/dist/utils/convert-px.d.ts +1 -0
  188. package/dist/utils/date.d.ts +2 -0
  189. package/dist/utils/deep-clone.d.ts +1 -0
  190. package/dist/utils/dev-log.d.ts +3 -0
  191. package/dist/utils/event-emitter.d.ts +7 -0
  192. package/dist/utils/get-scroll-parent.d.ts +3 -0
  193. package/dist/utils/is-dev.d.ts +1 -0
  194. package/dist/utils/omit.d.ts +1 -0
  195. package/dist/utils/render-node.d.ts +2 -0
  196. package/dist/utils/rubberband.d.ts +2 -0
  197. package/dist/utils/sleep.d.ts +1 -0
  198. package/dist/utils/supports-passive.d.ts +1 -0
  199. package/dist/utils/to-css-length.d.ts +1 -0
  200. package/dist/utils/url.d.ts +1 -0
  201. package/dist/vsf/choose-image.d.ts +4 -0
  202. package/dist/vsf/index.d.ts +1 -0
  203. package/package.json +3 -53
@@ -0,0 +1,12 @@
1
+ import { IOverride } from '../../types/util';
2
+ import { ComponentPropsWithRef, FC, ReactNode } from 'react';
3
+ import { IIconProps } from '../icon';
4
+ export type IAlertType = 'informative' | 'positive' | 'negative';
5
+ export type IAlertProps = IOverride<ComponentPropsWithRef<'div'>, {
6
+ type?: IAlertType;
7
+ title?: ReactNode;
8
+ message?: ReactNode;
9
+ closeable?: boolean | IIconProps | ReactNode;
10
+ action?: ReactNode;
11
+ }>;
12
+ export declare const Alert: FC<IAlertProps>;
@@ -0,0 +1 @@
1
+ export * from './alert';
@@ -0,0 +1,13 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { IAppConfig } from '../types/app';
3
+ import { ILocalesConfig, IResourceKey, ITemplateParams } from '../../../locales/types';
4
+ export type IAppConfigContext = {
5
+ t: (key: IResourceKey, params?: ITemplateParams) => ReactNode;
6
+ };
7
+ export type IAppConfigFunction = (context: IAppConfigContext) => IAppConfig;
8
+ export type IAppProps = ComponentPropsWithRef<'div'> & {
9
+ config: IAppConfig | IAppConfigFunction;
10
+ localesConfig?: ILocalesConfig;
11
+ };
12
+ export declare const AppInner: ({ config: configProp }: IAppProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const App: ({ className, config, localesConfig, ...props }: IAppProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const BottomTabBarLayout: FC<PropsWithChildren>;
@@ -0,0 +1,8 @@
1
+ import { ComponentProps, FC } from 'react';
2
+ import { INavigatePathnameOptions, INavigateDeltaOptions } from '../types/navigation';
3
+ export type ILinkProps = Omit<ComponentProps<'a'>, 'href' | 'onClick'> & (({
4
+ to: number;
5
+ } & INavigateDeltaOptions) | ({
6
+ to: string;
7
+ } & INavigatePathnameOptions));
8
+ export declare const Link: FC<ILinkProps>;
@@ -0,0 +1,2 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const NavigationAnalytic: FC<PropsWithChildren>;
@@ -0,0 +1,2 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const NavigationBarLayout: FC<PropsWithChildren>;
@@ -0,0 +1,3 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const getPageId: (locationKey: string) => string;
3
+ export declare const PageLayout: FC<PropsWithChildren>;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const PagesRender: FC;
@@ -0,0 +1,4 @@
1
+ export type ILocationKeyState = {
2
+ locationKey: string | null;
3
+ };
4
+ export declare const LocationKeyContext: import('react').Context<ILocationKeyState>;
@@ -0,0 +1 @@
1
+ export declare const useAppPause: (onPause: () => void) => void;
@@ -0,0 +1 @@
1
+ export declare const useAppResume: (onResume: () => void) => void;
@@ -0,0 +1,7 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { IAppState } from '../types/app';
3
+ export declare const useAppState: () => {
4
+ config: import('..').IAppConfig;
5
+ appState: IAppState;
6
+ setAppState: Dispatch<SetStateAction<IAppState>>;
7
+ };
@@ -0,0 +1,13 @@
1
+ import { IAppBottomTabBarState } from '../types/app';
2
+ export declare const useBottomTabBar: () => {
3
+ state: IAppBottomTabBarState;
4
+ pageState: IAppBottomTabBarState | undefined;
5
+ appState: IAppBottomTabBarState | undefined;
6
+ hidden: boolean;
7
+ setPageBottomTabBar: (bottomTabBar: Partial<IAppBottomTabBarState>) => void;
8
+ setAppBottomTabBar: (bottomTabBar: Partial<IAppBottomTabBarState>) => void;
9
+ removePageBottomTabBar: () => void;
10
+ removeAppBottomTabBar: () => void;
11
+ resetPageBottomTabBar: () => void;
12
+ resetAppBottomTabBar: () => void;
13
+ };
@@ -0,0 +1 @@
1
+ export declare const useCustomIconEvent: (onCustomIconEvent: (index: number) => void) => void;
@@ -0,0 +1 @@
1
+ export declare const useDidHide: (func?: () => void) => boolean;
@@ -0,0 +1 @@
1
+ export declare const useDidShow: (func?: () => void) => boolean;
@@ -0,0 +1,2 @@
1
+ export declare const useHistory: () => import('..').IHistory;
2
+ export declare const useHistories: () => import('..').IHistory[];
@@ -0,0 +1 @@
1
+ export declare const useLocation: () => import('..').ILocation;
@@ -0,0 +1 @@
1
+ export declare const useNavigate: () => import('..').INavigate;
@@ -0,0 +1,12 @@
1
+ import { IAppNavigationBarState } from '../types/app';
2
+ export declare const useNavigationBar: () => {
3
+ state: IAppNavigationBarState;
4
+ pageState: IAppNavigationBarState | undefined;
5
+ appState: IAppNavigationBarState | undefined;
6
+ setPageNavigationBar: (navigationBar: Partial<IAppNavigationBarState>) => void;
7
+ setAppNavigationBar: (navigationBar: Partial<IAppNavigationBarState>) => void;
8
+ removePageNavigationBar: () => void;
9
+ removeAppNavigationBar: () => void;
10
+ resetPageNavigationBar: () => void;
11
+ resetAppNavigationBar: () => void;
12
+ };
@@ -0,0 +1 @@
1
+ export declare const useNavigationType: () => import('..').IHistoryAction;
@@ -0,0 +1 @@
1
+ export declare const usePageConfig: () => import('..').IPageConfig | undefined;
@@ -0,0 +1,14 @@
1
+ import { IAppPageLayoutState } from '../types/app';
2
+ export declare const usePageLayout: () => {
3
+ state: IAppPageLayoutState;
4
+ pageState: IAppPageLayoutState | undefined;
5
+ appState: IAppPageLayoutState | undefined;
6
+ setPagePagelayout: (pageLayoutState: Partial<IAppPageLayoutState>) => void;
7
+ setAppPageLayout: (pageLayoutState: Partial<IAppPageLayoutState>) => void;
8
+ removePagePagelayout: () => void;
9
+ removeAppPageLayout: () => void;
10
+ resetPagePagelayout: () => void;
11
+ resetAppPageLayout: () => void;
12
+ };
13
+ export declare const usePullToRefresh: (onRefresh: () => Promise<unknown> | unknown) => void;
14
+ export declare const useLoadMore: (onEndReached: () => void) => void;
@@ -0,0 +1,5 @@
1
+ import { ThrottleOptions } from 'ahooks/lib/useThrottle/throttleOptions';
2
+ export type IUsePageScrollOptions = {
3
+ throttle?: ThrottleOptions;
4
+ };
5
+ export declare const usePageScroll: (callback: (target: HTMLDivElement, event: Event) => void, options?: IUsePageScrollOptions) => void;
@@ -0,0 +1,6 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { IPageState } from '../types/app';
3
+ export declare const usePageState: () => {
4
+ pageState: IPageState | undefined;
5
+ setPageState: Dispatch<SetStateAction<IPageState | undefined>>;
6
+ };
@@ -0,0 +1,3 @@
1
+ type ISettings = Record<string, unknown>;
2
+ export declare const useSettingsChanged: (onSettingsChanged: (settings: ISettings) => void) => void;
3
+ export {};
@@ -0,0 +1,18 @@
1
+ export * from './components/app';
2
+ export * from './components/link';
3
+ export * from './hooks/use-did-hide';
4
+ export * from './hooks/use-did-show';
5
+ export * from './hooks/use-history';
6
+ export * from './hooks/use-location';
7
+ export * from './hooks/use-navigate';
8
+ export * from './hooks/use-navigation-bar';
9
+ export * from './hooks/use-navigation-type';
10
+ export * from './hooks/use-page-layout';
11
+ export * from './hooks/use-page-scroll';
12
+ export * from './hooks/use-app-pause';
13
+ export * from './hooks/use-app-resume';
14
+ export * from './hooks/use-settings-changed';
15
+ export * from './hooks/use-custom-icon-event';
16
+ export * from './utils/data-theme';
17
+ export type * from './types/app';
18
+ export type * from './types/navigation';
@@ -0,0 +1,24 @@
1
+ import { IAppConfig, IAppState, IPageState } from '../types/app';
2
+ import { IHistory, INavigate } from '../types/navigation';
3
+ import { EventEmitter } from '../../../utils/event-emitter';
4
+ export type IAppStoreState = {
5
+ config: IAppConfig;
6
+ initialized: boolean;
7
+ appState: IAppState;
8
+ pageStates: Partial<Record<string, IPageState>>;
9
+ histories: IHistory[];
10
+ init: (config: IAppConfig) => void;
11
+ navigate: INavigate;
12
+ };
13
+ type IBeforeLocationChangeData = {
14
+ history: IHistory;
15
+ histories: IHistory[];
16
+ nextHistory: IHistory;
17
+ nextHistories: IHistory[];
18
+ };
19
+ export declare const navigationEventEmitter: EventEmitter<{
20
+ beforeLocationChangeP1: IBeforeLocationChangeData;
21
+ beforeLocationChangeP2: IBeforeLocationChangeData;
22
+ }>;
23
+ export declare const useAppStore: import('zustand').UseBoundStore<import('zustand').StoreApi<IAppStoreState>>;
24
+ export {};
@@ -0,0 +1,11 @@
1
+ import { IAppStoreState } from './app';
2
+ export declare const historiesSelector: (state: IAppStoreState) => import('..').IHistory[];
3
+ export declare const lastHistorySelector: (state: IAppStoreState) => import('..').IHistory;
4
+ export declare const historySelector: (locationKey: string | null) => (state: IAppStoreState) => import('..').IHistory | undefined;
5
+ export declare const lastLocationSelector: (state: IAppStoreState) => import('..').ILocation;
6
+ export declare const pageStatesSelector: (state: IAppStoreState) => Partial<Record<string, import('..').IPageState>>;
7
+ export declare const pageStateSelector: (locationKey: string | null) => (state: IAppStoreState) => import('..').IPageState | undefined;
8
+ export declare const lastPageStateSelector: (state: IAppStoreState) => import('..').IPageState | undefined;
9
+ export declare const pageConfigsSelector: (state: IAppStoreState) => import('..').IPageConfig[];
10
+ export declare const pageConfigSelector: (locationKey: string | null) => (state: IAppStoreState) => import('..').IPageConfig | undefined;
11
+ export declare const lastPageConfigSelector: (state: IAppStoreState) => import('..').IPageConfig | undefined;
@@ -0,0 +1,55 @@
1
+ import { ComponentType, PropsWithChildren } from 'react';
2
+ import { INavigationAnimationType } from './navigation';
3
+ import { INavigationBarProps } from '../../navigation-bar';
4
+ import { IBottomTabBarItem, IBottomTabBarProps } from '../../bottom-tab-bar';
5
+ import { IPageBaseProps } from '../../layout';
6
+ export type IAppAnimationState = {
7
+ type?: INavigationAnimationType;
8
+ };
9
+ export type IAppKeepAliveState = {
10
+ enable?: boolean;
11
+ maxStack?: number;
12
+ freeze?: boolean;
13
+ freezeDelay?: number;
14
+ };
15
+ export type IAppPageLayoutState = IPageBaseProps & {
16
+ hidden?: boolean;
17
+ scrollRestoration?: boolean;
18
+ };
19
+ export type IAppNavigationBarState = INavigationBarProps & {
20
+ hidden?: boolean;
21
+ };
22
+ export type IAppBottomTabBarState = Partial<Omit<IBottomTabBarProps, 'activeId' | 'items'>> & {
23
+ items: Array<IBottomTabBarItem & {
24
+ path: string;
25
+ params?: Record<string, string>;
26
+ }>;
27
+ hidden?: boolean;
28
+ };
29
+ export type ILayout = ComponentType<PropsWithChildren>;
30
+ export type IAppState = {
31
+ animation?: IAppAnimationState;
32
+ navigationBar?: IAppNavigationBarState;
33
+ bottomTabBar?: IAppBottomTabBarState;
34
+ keepAlive?: IAppKeepAliveState;
35
+ pageLayout?: IAppPageLayoutState;
36
+ Layouts?: ILayout[];
37
+ };
38
+ export type IPageState = Omit<IAppState, 'keepAlive'> & {
39
+ keepAlive?: boolean;
40
+ freeze?: boolean;
41
+ freezeDelay?: number;
42
+ };
43
+ export type IPageConfig = {
44
+ pathname: string;
45
+ Component: ComponentType;
46
+ Layouts?: ILayout[];
47
+ bottomTabBarId?: string;
48
+ } & IPageState;
49
+ export type IDarkModeConfig = {
50
+ defaultEnabled?: boolean;
51
+ };
52
+ export type IAppConfig = {
53
+ pages: IPageConfig[];
54
+ darkMode?: IDarkModeConfig;
55
+ } & IAppState;
@@ -0,0 +1,30 @@
1
+ import { IAppAnimationState, IPageState } from './app';
2
+ export type INavigationAnimationType = 'none' | 'slide_up' | 'slide_left' | 'fade_in';
3
+ export type INavigatePathnameOptions = {
4
+ replace?: boolean;
5
+ params?: Record<string, string>;
6
+ state?: any;
7
+ } & IPageState;
8
+ export type INavigateDeltaOptions = {
9
+ animation?: IAppAnimationState;
10
+ };
11
+ export type INavigate = {
12
+ (to: string, options?: INavigatePathnameOptions): void;
13
+ (to: number, options?: INavigateDeltaOptions): void;
14
+ };
15
+ export type IHistoryAction = 'POP' | 'REPLACE' | 'PUSH';
16
+ export type ILocation = {
17
+ key: string;
18
+ pathname: string;
19
+ params?: Record<string, string>;
20
+ state?: any;
21
+ };
22
+ export type IHistoryState = {
23
+ locations: ILocation[];
24
+ idx: number;
25
+ type: 'vsf-router';
26
+ };
27
+ export type IHistory = {
28
+ action: IHistoryAction;
29
+ location: ILocation;
30
+ };
@@ -0,0 +1,2 @@
1
+ import { IHistoryAction, INavigationAnimationType } from '../types/navigation';
2
+ export declare const setupAnimation: (animationType: INavigationAnimationType, action: IHistoryAction) => void;
@@ -0,0 +1,5 @@
1
+ import { IDarkModeConfig } from '../types/app';
2
+ export declare const initDataTheme: (darkMode?: IDarkModeConfig) => void;
3
+ export declare const getDataTheme: () => 'dark' | 'light';
4
+ export declare const setDataTheme: (theme: "dark" | "light") => void;
5
+ export declare const toggleDataTheme: () => void;
@@ -0,0 +1,7 @@
1
+ import { IAppConfig, IPageConfig } from '../types/app';
2
+ import { IHistory, IHistoryState, ILocation } from '../types/navigation';
3
+ export declare const PAGE_PATH_NAME = "__pagePath";
4
+ export declare const initHistories: (config: IAppConfig) => IHistory[];
5
+ export declare const getPageByPathname: (pages: IPageConfig[], pathname: string) => IPageConfig | undefined;
6
+ export declare const getHistoryState: (histories: IHistory[]) => IHistoryState;
7
+ export declare const getUrlFromLocation: (location: ILocation) => URL;
@@ -0,0 +1,15 @@
1
+ import { IColor } from '../../types/colors';
2
+ import { IOverride } from '../../types/util';
3
+ import { ComponentProps, FC } from 'react';
4
+ import { ITypographySize } from '../typography';
5
+ export type IAvatarShape = 'circle' | 'rounded';
6
+ export type IAvatarProps = IOverride<ComponentProps<'img'>, {
7
+ size?: number;
8
+ shape?: IAvatarShape;
9
+ border?: boolean;
10
+ label?: string;
11
+ labelColor?: IColor;
12
+ labelSize?: ITypographySize;
13
+ color?: IColor;
14
+ }>;
15
+ export declare const Avatar: FC<IAvatarProps>;
@@ -0,0 +1 @@
1
+ export * from './avatar';
@@ -0,0 +1,8 @@
1
+ import { IOverride } from '../../types/util';
2
+ import { ComponentProps, FC } from 'react';
3
+ export type IBadgeProps = IOverride<ComponentProps<'div'>, {
4
+ outline?: boolean;
5
+ }>;
6
+ export declare const Badge: FC<IBadgeProps>;
7
+ export type IBadgeContainerProps = ComponentProps<'div'>;
8
+ export declare const BadgeContainer: FC<IBadgeContainerProps>;
@@ -0,0 +1 @@
1
+ export * from './badge';
@@ -0,0 +1,22 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { IIconProps } from '../icon';
3
+ import { IColor } from '../../types/colors';
4
+ export type IBottomTabBarItem = {
5
+ id: string;
6
+ name: string;
7
+ icon?: IIconProps | ReactNode;
8
+ activeIcon?: IIconProps | ReactNode;
9
+ };
10
+ export type IBottomTabBarProps = {
11
+ className?: string;
12
+ items: IBottomTabBarItem[];
13
+ activeId?: string;
14
+ indicator?: boolean;
15
+ setCssVariable?: boolean;
16
+ bgColor?: IColor;
17
+ color?: IColor;
18
+ activeColor?: IColor;
19
+ onItemClick?: (item: IBottomTabBarItem, index: number) => void;
20
+ safeAreaBottomOffset?: boolean;
21
+ };
22
+ export declare const BottomTabBar: FC<IBottomTabBarProps>;
@@ -0,0 +1 @@
1
+ export * from './bottom-tab-bar';
@@ -0,0 +1,3 @@
1
+ import { ITypographySize } from '../typography';
2
+ import { IButtonSize } from './button';
3
+ export declare const buttonLabelSizeMapping: Record<IButtonSize, ITypographySize>;
@@ -0,0 +1,20 @@
1
+ import { ComponentPropsWithRef, FC, ReactNode } from 'react';
2
+ import { IIconProps } from '../icon';
3
+ import { IOverride } from '../../types/util';
4
+ export type IButtonShape = 'rounded' | 'pill';
5
+ export type IButtonSize = 'large' | 'medium';
6
+ export type IButtonType = 'solid' | 'solid-subtle' | 'outline' | 'ghost';
7
+ export type IButtonTheme = 'default' | 'brand' | 'neutral' | 'neutral-inverse';
8
+ export type IButtonProps = IOverride<ComponentPropsWithRef<'button'>, {
9
+ shape?: IButtonShape;
10
+ size?: IButtonSize;
11
+ type?: IButtonType;
12
+ theme?: IButtonTheme;
13
+ disabled?: boolean;
14
+ loading?: boolean;
15
+ leadingIcon?: IIconProps | ReactNode;
16
+ trailingIcon?: IIconProps | ReactNode;
17
+ htmlType?: ComponentPropsWithRef<'button'>['type'];
18
+ block?: boolean;
19
+ }>;
20
+ export declare const Button: FC<IButtonProps>;
@@ -0,0 +1 @@
1
+ export * from './button';
@@ -0,0 +1,14 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { IButtonProps } from '../button';
3
+ import { IOverride } from '../../types/util';
4
+ import { IRange, IRangePickerProps } from '../calendar/range-picker';
5
+ export type ICalendarRangeSheetProps = IOverride<Omit<IRangePickerProps, 'value' | 'onChange' | 'defaultValue' | 'onPick'>, {
6
+ title?: ReactNode;
7
+ confirmButton?: IButtonProps;
8
+ open?: boolean;
9
+ onCancel?: () => void;
10
+ value?: IRange | null;
11
+ defaultValue?: IRange | null;
12
+ onSelect?: (value: IRange) => void;
13
+ }>;
14
+ export declare const CalendarRangeSheet: FC<ICalendarRangeSheetProps>;
@@ -0,0 +1,14 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { IButtonProps } from '../button';
3
+ import { IOverride } from '../../types/util';
4
+ import { ISinglePickerProps } from '../calendar/single-picker';
5
+ export type ICalendarSingleSheetProps = IOverride<Omit<ISinglePickerProps, 'value' | 'onChange' | 'defaultValue'>, {
6
+ title?: ReactNode;
7
+ confirmButton?: IButtonProps;
8
+ open?: boolean;
9
+ onCancel?: () => void;
10
+ value?: Date | null;
11
+ defaultValue?: Date | null;
12
+ onSelect?: (value: Date) => void;
13
+ }>;
14
+ export declare const CalendarSingleSheet: FC<ICalendarSingleSheetProps>;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { ISinglePickerProps } from './single-picker';
3
+ import { IRangePickerProps } from './range-picker';
4
+ export type ICalendarProps = (ISinglePickerProps & {
5
+ type?: 'single';
6
+ }) | (IRangePickerProps & {
7
+ type: 'range';
8
+ });
9
+ declare const Calendar: FC<ICalendarProps>;
10
+ export { Calendar };
@@ -0,0 +1,3 @@
1
+ import { IAppLanguage } from '../../locales';
2
+ import { IRenderText } from './utils';
3
+ export declare const getRenderText: (argLang?: IAppLanguage, renderText?: IRenderText) => IRenderText;
@@ -0,0 +1 @@
1
+ export * from './calendar';
@@ -0,0 +1,11 @@
1
+ import { ComponentPropsWithRef, FC } from 'react';
2
+ import { ICommonPickerProps } from './utils';
3
+ import { IOverride } from '../../types/util';
4
+ export type IRange = [Date | null, Date | null];
5
+ export type IRangePickerProps = IOverride<ComponentPropsWithRef<'div'>, {
6
+ value?: IRange | null;
7
+ onChange?: (value: IRange) => void;
8
+ onPick?: (value: IRange) => void;
9
+ defaultValue?: IRange | null;
10
+ } & ICommonPickerProps>;
11
+ export declare const RangePicker: FC<IRangePickerProps>;
@@ -0,0 +1,9 @@
1
+ import { ICommonPickerProps } from './utils';
2
+ import { ComponentPropsWithRef, FC } from 'react';
3
+ import { IOverride } from '../../types/util';
4
+ export type ISinglePickerProps = IOverride<ComponentPropsWithRef<'div'>, {
5
+ value?: Date | null;
6
+ onChange?: (value: Date) => void;
7
+ defaultValue?: Date | null;
8
+ } & ICommonPickerProps>;
9
+ export declare const SinglePicker: FC<ISinglePickerProps>;
@@ -0,0 +1,60 @@
1
+ import { ReactNode } from 'react';
2
+ import { IAppLanguage } from '../../locales';
3
+ export declare const Weekday: {
4
+ readonly SUNDAY: 0;
5
+ readonly MONDAY: 1;
6
+ readonly TUESDAY: 2;
7
+ readonly WEDNESDAY: 3;
8
+ readonly THURSDAY: 4;
9
+ readonly FRIDAY: 5;
10
+ readonly SATURDAY: 6;
11
+ };
12
+ export type IWeekday = (typeof Weekday)[keyof typeof Weekday];
13
+ export declare const Month: {
14
+ readonly JANUARY: 0;
15
+ readonly FEBRUARY: 1;
16
+ readonly MARCH: 2;
17
+ readonly APRIL: 3;
18
+ readonly MAY: 4;
19
+ readonly JUNE: 5;
20
+ readonly JULY: 6;
21
+ readonly AUGUST: 7;
22
+ readonly SEPTEMBER: 8;
23
+ readonly OCTOBER: 9;
24
+ readonly NOVEMBER: 10;
25
+ readonly DECEMBER: 11;
26
+ };
27
+ export type IMonth = (typeof Month)[keyof typeof Month];
28
+ export interface IDateFns {
29
+ getNumDaysInMonth(month: IMonth, year: number): number;
30
+ isSame(date1: Date, date2: Date): boolean;
31
+ isBefore(date1: Date, date2: Date): boolean;
32
+ isAfter(date1: Date, date2: Date): boolean;
33
+ isSameOrBefore(date1: Date, date2: Date): boolean;
34
+ isSameOrAfter(date1: Date, date2: Date): boolean;
35
+ }
36
+ declare class DateFns implements IDateFns {
37
+ getNumDaysInMonth(month: IMonth, year: number): number;
38
+ isSame(date1: Date, date2: Date): boolean;
39
+ isBefore(date1: Date, date2: Date): boolean;
40
+ isAfter(date1: Date, date2: Date): boolean;
41
+ isSameOrBefore(date1: Date, date2: Date): boolean;
42
+ isSameOrAfter(date1: Date, date2: Date): boolean;
43
+ }
44
+ export declare const dateFns: DateFns;
45
+ export type INavigationMode = 'month' | 'month-year' | 'time-only';
46
+ export type ILang = 'vi' | 'en';
47
+ export type IRenderText = {
48
+ date?: ((date: Date) => ReactNode) | ReactNode;
49
+ dateSubText?: ((date: Date) => ReactNode) | ReactNode;
50
+ headerLabel?: ((month: IMonth, year: number) => ReactNode) | ReactNode;
51
+ weekday?: ((weekday: IWeekday) => ReactNode) | ReactNode;
52
+ };
53
+ export type ICommonPickerProps = {
54
+ lang?: IAppLanguage;
55
+ navigationMode?: INavigationMode;
56
+ renderText?: IRenderText;
57
+ minDate?: Date;
58
+ maxDate?: Date;
59
+ };
60
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ComponentProps, FC, ReactNode } from 'react';
2
+ import { ICarouselInstance, ICarouselOptions } from './use-carousel';
3
+ import { IOverride } from '../../types/util';
4
+ export type ICarouselProps = {
5
+ className?: string;
6
+ children: ReactNode;
7
+ carousel?: ICarouselInstance;
8
+ options?: ICarouselOptions;
9
+ pagination?: boolean;
10
+ };
11
+ export declare const Carousel: import('react').ForwardRefExoticComponent<ICarouselProps & import('react').RefAttributes<ICarouselInstance>>;
12
+ export type ICarouselItemProps = IOverride<ComponentProps<'div'>, {
13
+ width?: string | number;
14
+ }>;
15
+ export declare const CarouselItem: FC<ICarouselItemProps>;
@@ -0,0 +1 @@
1
+ export * from './carousel';
@@ -0,0 +1,27 @@
1
+ export type ICarouselAlign = 'start' | 'center' | 'end';
2
+ export type ICarouselOptions = {
3
+ align?: ICarouselAlign;
4
+ initialIndex?: number;
5
+ loop?: boolean;
6
+ duration?: number;
7
+ autoplay?: boolean;
8
+ delay?: number;
9
+ autoHeight?: boolean;
10
+ gap?: number;
11
+ };
12
+ export type ICarouselViewPortRef = <ViewportElement extends HTMLElement>(instance: ViewportElement | null) => void;
13
+ export type ICarouselToOptions = {
14
+ jump?: boolean;
15
+ };
16
+ export type ICarouselInstance = {
17
+ ref: ICarouselViewPortRef;
18
+ next: (options: ICarouselToOptions) => void;
19
+ prev: (options: ICarouselToOptions) => void;
20
+ toSlide: (index: number, options: ICarouselToOptions) => void;
21
+ activeIndex: number;
22
+ canNext: boolean;
23
+ canPrev: boolean;
24
+ snaps: number[];
25
+ options: ICarouselOptions;
26
+ };
27
+ export declare const useCarousel: (options?: ICarouselOptions) => ICarouselInstance;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface ICheckIconProps extends React.SVGProps<SVGSVGElement> {
3
+ fill?: string;
4
+ }
5
+ declare const CheckIcon: React.FC<ICheckIconProps>;
6
+ export default CheckIcon;