@ornikar/bumper 2.1.0 → 2.2.1-canary.431a0c996598cbee4e3c07f6b9886d37d2a76679.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.
- package/CHANGELOG.md +24 -0
- package/dist/definitions/animations.d.ts +22 -0
- package/dist/definitions/animations.d.ts.map +1 -0
- package/dist/definitions/components/toast/SafeToastViewport.d.ts +9 -0
- package/dist/definitions/components/toast/SafeToastViewport.d.ts.map +1 -0
- package/dist/definitions/components/toast/ToastProvider.d.ts +10 -0
- package/dist/definitions/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/definitions/components/toast/ToastRenderer.d.ts +8 -0
- package/dist/definitions/components/toast/ToastRenderer.d.ts.map +1 -0
- package/dist/definitions/components/toast/ToastStoreProvider.d.ts +11 -0
- package/dist/definitions/components/toast/ToastStoreProvider.d.ts.map +1 -0
- package/dist/definitions/components/toast/decorators/ToastProviderDecorator.d.ts +2 -0
- package/dist/definitions/components/toast/decorators/ToastProviderDecorator.d.ts.map +1 -0
- package/dist/definitions/components/toast/types.d.ts +8 -0
- package/dist/definitions/components/toast/types.d.ts.map +1 -0
- package/dist/definitions/components/toast/useToast.d.ts +9 -0
- package/dist/definitions/components/toast/useToast.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +9 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/tamagui.config.d.ts +20 -1
- package/dist/definitions/tamagui.config.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +284 -6
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +284 -6
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +286 -2
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +285 -1
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +283 -5
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +282 -5
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +292 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +290 -5
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +20 -8
- package/src/animations.ts +25 -0
- package/src/components/toast/SafeToastViewport.tsx +26 -0
- package/src/components/toast/Toast.stories.tsx +75 -0
- package/src/components/toast/ToastProvider.tsx +33 -0
- package/src/components/toast/ToastRenderer.tsx +26 -0
- package/src/components/toast/ToastStoreProvider.tsx +41 -0
- package/src/components/toast/__snapshots__/Toast.stories.tsx.snap +146 -0
- package/src/components/toast/__snapshots_web__/Toast.stories.tsx.snap +81 -0
- package/src/components/toast/decorators/ToastProviderDecorator.tsx +23 -0
- package/src/components/toast/types.ts +9 -0
- package/src/components/toast/useToast.tsx +35 -0
- package/src/index.ts +15 -0
- package/src/tamagui.config.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.2.1-canary.431a0c996598cbee4e3c07f6b9886d37d2a76679.0](https://github.com/ornikar/kitt/compare/@ornikar/bumper@2.2.0...@ornikar/bumper@2.2.1-canary.431a0c996598cbee4e3c07f6b9886d37d2a76679.0) (2025-12-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add animations config to tamagui ([5dfb532](https://github.com/ornikar/kitt/commit/5dfb532a72e5a8cce98fb776ca96cc9a2e7db73f))
|
|
12
|
+
* add store to handle toast stacking ([9cec684](https://github.com/ornikar/kitt/commit/9cec68473772b1fdc5604f55adf8935806aed83e))
|
|
13
|
+
* add toast exports ([fe5de1b](https://github.com/ornikar/kitt/commit/fe5de1be2b7e94804802dd58691b7d0c07008960))
|
|
14
|
+
* add toats types ([400388e](https://github.com/ornikar/kitt/commit/400388edd0b3b116c27c1979372feb25c841f601))
|
|
15
|
+
* create provider ([56a9b8d](https://github.com/ornikar/kitt/commit/56a9b8d32d7264ae8427ed056fa59446b2d2a177))
|
|
16
|
+
* create toast renderer to handle custom toast ui component ([e38bfdb](https://github.com/ornikar/kitt/commit/e38bfdb7db1dcfd296317d00d5d04613ec2ea6ed))
|
|
17
|
+
* create toast viewport with insets handling ([87fc93b](https://github.com/ornikar/kitt/commit/87fc93b6308bb9f29bb981ddd93fd8f8fa099d9e))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [2.2.0](https://github.com/ornikar/kitt/compare/@ornikar/bumper@2.1.0...@ornikar/bumper@2.2.0) (2025-11-24)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* enable tamagui compiler OSE-21194 ([#2768](https://github.com/ornikar/kitt/issues/2768)) ([85f2073](https://github.com/ornikar/kitt/commit/85f20737db7a71e64de27a015f62dcfe4d5945bc))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [2.1.0](https://github.com/ornikar/kitt/compare/@ornikar/bumper@2.0.1...@ornikar/bumper@2.1.0) (2025-11-21)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const nativeAnimations: import("@tamagui/web").AnimationDriver<{
|
|
2
|
+
fast: {
|
|
3
|
+
damping: number;
|
|
4
|
+
mass: number;
|
|
5
|
+
stiffness: number;
|
|
6
|
+
};
|
|
7
|
+
medium: {
|
|
8
|
+
damping: number;
|
|
9
|
+
mass: number;
|
|
10
|
+
stiffness: number;
|
|
11
|
+
};
|
|
12
|
+
slow: {
|
|
13
|
+
damping: number;
|
|
14
|
+
stiffness: number;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export declare const webAnimations: import("@tamagui/web").AnimationDriver<{
|
|
18
|
+
fast: string;
|
|
19
|
+
medium: string;
|
|
20
|
+
slow: string;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=animations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/animations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAe3B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;EAIxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToastViewportProps } from '@tamagui/toast';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface SafeToastViewportProps {
|
|
4
|
+
name?: ToastViewportProps['name'];
|
|
5
|
+
position?: 'top' | 'bottom';
|
|
6
|
+
portalToRoot?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function SafeToastViewport({ name, position, portalToRoot }: SafeToastViewportProps): ReactNode;
|
|
9
|
+
//# sourceMappingURL=SafeToastViewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SafeToastViewport.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/SafeToastViewport.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAgB,EAAE,YAAoB,EAAE,EAAE,sBAAsB,GAAG,SAAS,CAcrH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ToastProps } from './types';
|
|
3
|
+
export interface ToastProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
position?: 'top' | 'bottom';
|
|
6
|
+
viewportName?: string;
|
|
7
|
+
ToastComponent: React.ComponentType<ToastProps>;
|
|
8
|
+
}
|
|
9
|
+
export declare function ToastProvider({ children, position, viewportName, ToastComponent, }: ToastProviderProps): ReactNode;
|
|
10
|
+
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACjD;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAgB,EAChB,YAAY,EACZ,cAAc,GACf,EAAE,kBAAkB,GAAG,SAAS,CAYhC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ToastProps } from './types';
|
|
3
|
+
interface ToastRendererProps {
|
|
4
|
+
ToastComponent: React.ComponentType<ToastProps>;
|
|
5
|
+
}
|
|
6
|
+
export declare function ToastRenderer({ ToastComponent }: ToastRendererProps): ReactNode;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ToastRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/ToastRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,UAAU,kBAAkB;IAC1B,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACjD;AAED,wBAAgB,aAAa,CAAC,EAAE,cAAc,EAAE,EAAE,kBAAkB,GAAG,SAAS,CAe/E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import type { ToastOptions } from './types';
|
|
3
|
+
interface ToastStore {
|
|
4
|
+
toasts: ToastOptions[];
|
|
5
|
+
addToast: (toast: ToastOptions) => void;
|
|
6
|
+
removeToast: (id: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ToastStoreProvider({ children }: PropsWithChildren): ReactNode;
|
|
9
|
+
export declare const useToastStore: () => ToastStore;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ToastStoreProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastStoreProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/ToastStoreProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,UAAU,UAAU;IAClB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAkBD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,SAAS,CAM7E;AAED,eAAO,MAAM,aAAa,QAAO,UAMhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProviderDecorator.d.ts","sourceRoot":"","sources":["../../../../../src/components/toast/decorators/ToastProviderDecorator.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,kEAiB9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToastOptions } from './types';
|
|
2
|
+
interface UseToastReturn {
|
|
3
|
+
toasts: ToastOptions[];
|
|
4
|
+
showToast: (options: ToastOptions) => void;
|
|
5
|
+
hideToast: (id: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useToast(): UseToastReturn;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=useToast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/useToast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,UAAU,cAAc;IACtB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,wBAAgB,QAAQ,IAAI,cAAc,CAwBzC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { BumperDecorator } from './core/BumperDecorator';
|
|
2
2
|
export { BumperProvider } from './core/BumperProvider';
|
|
3
|
+
export type { HStackProps, StackProps, VStackProps } from './components/primitives/Stacks';
|
|
4
|
+
export { HStack, Stack, VStack } from './components/primitives/Stacks';
|
|
5
|
+
export type { ViewProps } from './components/primitives/View';
|
|
6
|
+
export { View } from './components/primitives/View';
|
|
7
|
+
export type { TypographyTextProps } from './components/typography/Typograhy';
|
|
8
|
+
export { Typography } from './components/typography/Typograhy';
|
|
3
9
|
export { useBreakpointValue } from './components/breakpoints/hooks/useBreakpointValue';
|
|
4
10
|
export { useCurrentBreakpointName } from './components/breakpoints/hooks/useCurrentBreakpointName';
|
|
5
11
|
export { useWindowSize } from './components/breakpoints/hooks/useWindowSize';
|
|
@@ -7,4 +13,7 @@ export type { SwitchBreakpointsProps } from './components/breakpoints/SwitchBrea
|
|
|
7
13
|
export { SwitchBreakpoints } from './components/breakpoints/SwitchBreakpoins';
|
|
8
14
|
export type { ValueForBreakpoint } from './components/breakpoints/utils/breakpointsUtils';
|
|
9
15
|
export { getValueForBreakpoint } from './components/breakpoints/utils/breakpointsUtils';
|
|
16
|
+
export { SafeToastViewport as ToastViewport } from './components/toast/SafeToastViewport';
|
|
17
|
+
export { ToastProvider } from './components/toast/ToastProvider';
|
|
18
|
+
export { useToast } from './components/toast/useToast';
|
|
10
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yDAAyD,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,YAAY,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACvE,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yDAAyD,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,YAAY,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAGxF,OAAO,EAAE,iBAAiB,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -124,7 +124,26 @@ export declare const config: import("@tamagui/core").TamaguiInternalConfig<{
|
|
|
124
124
|
wide: {
|
|
125
125
|
minWidth: number;
|
|
126
126
|
};
|
|
127
|
-
}, {
|
|
127
|
+
}, {
|
|
128
|
+
fast: {
|
|
129
|
+
damping: number;
|
|
130
|
+
mass: number;
|
|
131
|
+
stiffness: number;
|
|
132
|
+
};
|
|
133
|
+
medium: {
|
|
134
|
+
damping: number;
|
|
135
|
+
mass: number;
|
|
136
|
+
stiffness: number;
|
|
137
|
+
};
|
|
138
|
+
slow: {
|
|
139
|
+
damping: number;
|
|
140
|
+
stiffness: number;
|
|
141
|
+
};
|
|
142
|
+
} | {
|
|
143
|
+
fast: string;
|
|
144
|
+
medium: string;
|
|
145
|
+
slow: string;
|
|
146
|
+
}, {
|
|
128
147
|
GTStandard: {
|
|
129
148
|
family: string;
|
|
130
149
|
size: Record<"heading-2xl" | "heading-xl" | "heading-l" | "heading-m" | "heading-s" | "heading-xs" | "body-xl" | "body-l" | "body-m" | "body-s" | "body-xs" | "label-xl" | "label-l" | "label-m" | "label-s", number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tamagui.config.d.ts","sourceRoot":"","sources":["../../src/tamagui.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tamagui.config.d.ts","sourceRoot":"","sources":["../../src/tamagui.config.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBjB,CAAC;AAEH,KAAK,IAAI,GAAG,OAAO,MAAM,CAAC;AAG1B,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,mBAAoB,SAAQ,IAAI;KAAG;CAC9C"}
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import { makeDecorator } from '@storybook/addons';
|
|
2
|
-
import { createFont, createTokens, createTamagui, TamaguiProvider, useMedia } from '@tamagui/core';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { createFont, createTokens, createTamagui, TamaguiProvider, styled, Stack, Text, useMedia } from '@tamagui/core';
|
|
3
|
+
export { Stack, View } from '@tamagui/core';
|
|
4
|
+
import { Platform } from 'react-native';
|
|
6
5
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
6
|
+
import { createAnimations as createAnimations$1 } from '@tamagui/animations-css';
|
|
7
|
+
import { createAnimations } from '@tamagui/animations-react-native';
|
|
8
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
+
import { useContext, createContext, useMemo, useState, useCallback } from 'react';
|
|
11
|
+
import { ToastViewport, Toast, ToastProvider as ToastProvider$1 } from '@tamagui/toast';
|
|
12
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
|
+
import { PortalProvider } from '@tamagui/portal';
|
|
14
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
15
|
+
|
|
16
|
+
const nativeAnimations = createAnimations({
|
|
17
|
+
fast: {
|
|
18
|
+
damping: 20,
|
|
19
|
+
mass: 1.2,
|
|
20
|
+
stiffness: 250
|
|
21
|
+
},
|
|
22
|
+
medium: {
|
|
23
|
+
damping: 10,
|
|
24
|
+
mass: 0.9,
|
|
25
|
+
stiffness: 100
|
|
26
|
+
},
|
|
27
|
+
slow: {
|
|
28
|
+
damping: 20,
|
|
29
|
+
stiffness: 60
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const webAnimations = createAnimations$1({
|
|
33
|
+
fast: 'ease-in 150ms',
|
|
34
|
+
medium: 'ease-in 300ms',
|
|
35
|
+
slow: 'ease-in 450ms'
|
|
36
|
+
});
|
|
7
37
|
|
|
8
38
|
const createColorScale = colorScale => colorScale;
|
|
9
39
|
|
|
@@ -183,6 +213,7 @@ const breakpoints = {
|
|
|
183
213
|
[BreakpointNameEnum.WIDE]: 1280
|
|
184
214
|
};
|
|
185
215
|
|
|
216
|
+
const BODY_VARIANTS = ['body-xl', 'body-l', 'body-m', 'body-s', 'body-xs'];
|
|
186
217
|
const GTStandardFaces = {
|
|
187
218
|
500: {
|
|
188
219
|
normal: 'GTStandardRegular'
|
|
@@ -322,7 +353,8 @@ const config = createTamagui({
|
|
|
322
353
|
styleCompat: 'react-native',
|
|
323
354
|
autocompleteSpecificTokens: true,
|
|
324
355
|
debug: false
|
|
325
|
-
}
|
|
356
|
+
},
|
|
357
|
+
animations: Platform.OS === 'web' ? webAnimations : nativeAnimations
|
|
326
358
|
});
|
|
327
359
|
|
|
328
360
|
// make imports typed
|
|
@@ -347,6 +379,119 @@ const BumperDecorator = makeDecorator({
|
|
|
347
379
|
}
|
|
348
380
|
});
|
|
349
381
|
|
|
382
|
+
const HStack = styled(Stack, {
|
|
383
|
+
name: 'HStack',
|
|
384
|
+
flexDirection: 'row'
|
|
385
|
+
});
|
|
386
|
+
const VStack = styled(Stack, {
|
|
387
|
+
name: 'VStack',
|
|
388
|
+
flexDirection: 'column'
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
function getVariantAndWeightValues(weightProp, variantProp, typographyWeightAncestorValue, typographyVariantAncestorValue) {
|
|
392
|
+
const computedVariant = variantProp || typographyVariantAncestorValue || undefined;
|
|
393
|
+
if (computedVariant) {
|
|
394
|
+
if (BODY_VARIANTS.includes(computedVariant)) {
|
|
395
|
+
const computedWeight = weightProp || typographyWeightAncestorValue || undefined;
|
|
396
|
+
return {
|
|
397
|
+
weight: computedWeight,
|
|
398
|
+
variant: computedVariant
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
return {
|
|
402
|
+
weight: 'semibold',
|
|
403
|
+
variant: computedVariant
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
weight: weightProp,
|
|
408
|
+
variant: undefined
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const TypographyVariantContext = /*#__PURE__*/createContext(null);
|
|
413
|
+
const TypographyWeightContext = /*#__PURE__*/createContext(null);
|
|
414
|
+
const TypograhyColorContext = /*#__PURE__*/createContext(null);
|
|
415
|
+
const InternalTypography = styled(Text, {
|
|
416
|
+
fontFamily: '$GTStandard',
|
|
417
|
+
color: '$content.base.hi',
|
|
418
|
+
'$platform-web': {
|
|
419
|
+
WebkitFontSmoothing: 'antialiased'
|
|
420
|
+
},
|
|
421
|
+
variants: {
|
|
422
|
+
variant: variant => {
|
|
423
|
+
if (!variant) return {};
|
|
424
|
+
return {
|
|
425
|
+
fontSize: `$${variant}`,
|
|
426
|
+
lineHeight: `$${variant}`,
|
|
427
|
+
letterSpacing: `$${variant}`
|
|
428
|
+
};
|
|
429
|
+
},
|
|
430
|
+
weight: {
|
|
431
|
+
regular: {
|
|
432
|
+
fontWeight: '$regular'
|
|
433
|
+
},
|
|
434
|
+
semibold: {
|
|
435
|
+
fontWeight: '$semibold'
|
|
436
|
+
},
|
|
437
|
+
bold: {
|
|
438
|
+
fontWeight: '$bold'
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
defaultVariants: {
|
|
443
|
+
variant: 'body-m',
|
|
444
|
+
weight: 'regular'
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
// Create a type for color props that matches strings containing '$content.'
|
|
449
|
+
|
|
450
|
+
// Remove font-related style props from InternalTypography Props
|
|
451
|
+
|
|
452
|
+
const TypographyText = InternalTypography.styleable((props, ref) => {
|
|
453
|
+
const typographyVariantAncestorValue = useContext(TypographyVariantContext);
|
|
454
|
+
const typographyWeightAncestorValue = useContext(TypographyWeightContext);
|
|
455
|
+
const typographyColorAncestorValue = useContext(TypograhyColorContext);
|
|
456
|
+
const {
|
|
457
|
+
variant,
|
|
458
|
+
weight
|
|
459
|
+
} = getVariantAndWeightValues(props.weight, props.variant, typographyWeightAncestorValue, typographyVariantAncestorValue);
|
|
460
|
+
const color = props.color || typographyColorAncestorValue || undefined;
|
|
461
|
+
let content = /*#__PURE__*/jsx(InternalTypography, _objectSpread(_objectSpread({
|
|
462
|
+
ref: ref
|
|
463
|
+
}, props), {}, {
|
|
464
|
+
color: color,
|
|
465
|
+
weight: weight,
|
|
466
|
+
variant: variant
|
|
467
|
+
}));
|
|
468
|
+
content = props.variant ?
|
|
469
|
+
/*#__PURE__*/
|
|
470
|
+
// If a variant is provided, we set it in the context for children to be able to inherit variant value
|
|
471
|
+
jsx(TypographyVariantContext.Provider, {
|
|
472
|
+
value: props.variant,
|
|
473
|
+
children: content
|
|
474
|
+
}) : content;
|
|
475
|
+
content = props.weight ?
|
|
476
|
+
/*#__PURE__*/
|
|
477
|
+
// If a weight is provided, we set it in the context for children to be able to inherit weight value
|
|
478
|
+
jsx(TypographyWeightContext.Provider, {
|
|
479
|
+
value: props.weight,
|
|
480
|
+
children: content
|
|
481
|
+
}) : content;
|
|
482
|
+
content = props.color ?
|
|
483
|
+
/*#__PURE__*/
|
|
484
|
+
// If a color is provided, we set it in the context for children to be able to inherit color value
|
|
485
|
+
jsx(TypograhyColorContext.Provider, {
|
|
486
|
+
value: props.color,
|
|
487
|
+
children: content
|
|
488
|
+
}) : content;
|
|
489
|
+
return content;
|
|
490
|
+
});
|
|
491
|
+
const Typography = {
|
|
492
|
+
Text: TypographyText
|
|
493
|
+
};
|
|
494
|
+
|
|
350
495
|
function getValueForBreakpoint(breakpoint, {
|
|
351
496
|
base,
|
|
352
497
|
small,
|
|
@@ -399,5 +544,138 @@ function SwitchBreakpoints(values) {
|
|
|
399
544
|
return getValueForBreakpoint(breakpoint, values);
|
|
400
545
|
}
|
|
401
546
|
|
|
402
|
-
|
|
547
|
+
function SafeToastViewport({
|
|
548
|
+
name,
|
|
549
|
+
position = 'top',
|
|
550
|
+
portalToRoot = false
|
|
551
|
+
}) {
|
|
552
|
+
const {
|
|
553
|
+
left,
|
|
554
|
+
top,
|
|
555
|
+
bottom,
|
|
556
|
+
right
|
|
557
|
+
} = useSafeAreaInsets();
|
|
558
|
+
return /*#__PURE__*/jsx(ToastViewport, {
|
|
559
|
+
multipleToasts: true,
|
|
560
|
+
portalToRoot: portalToRoot,
|
|
561
|
+
name: name,
|
|
562
|
+
top: position === 'top' ? top : undefined,
|
|
563
|
+
bottom: position === 'bottom' ? bottom : undefined,
|
|
564
|
+
left: left,
|
|
565
|
+
right: right
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
const useToastState = () => {
|
|
570
|
+
const [toasts, setToasts] = useState([]);
|
|
571
|
+
const removeToast = useCallback(id => {
|
|
572
|
+
setToasts(prevToasts => prevToasts.filter(t => t.id !== id));
|
|
573
|
+
}, []);
|
|
574
|
+
const addToast = useCallback(toast => {
|
|
575
|
+
setToasts(prevToasts => [...prevToasts, toast]);
|
|
576
|
+
}, []);
|
|
577
|
+
return {
|
|
578
|
+
toasts,
|
|
579
|
+
addToast,
|
|
580
|
+
removeToast
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
const ToastStoreContext = /*#__PURE__*/createContext(undefined);
|
|
584
|
+
function ToastStoreProvider({
|
|
585
|
+
children
|
|
586
|
+
}) {
|
|
587
|
+
const {
|
|
588
|
+
toasts,
|
|
589
|
+
addToast,
|
|
590
|
+
removeToast
|
|
591
|
+
} = useToastState();
|
|
592
|
+
const value = useMemo(() => ({
|
|
593
|
+
toasts,
|
|
594
|
+
addToast,
|
|
595
|
+
removeToast
|
|
596
|
+
}), [toasts, addToast, removeToast]);
|
|
597
|
+
return /*#__PURE__*/jsx(ToastStoreContext.Provider, {
|
|
598
|
+
value: value,
|
|
599
|
+
children: children
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
const useToastStore = () => {
|
|
603
|
+
const context = useContext(ToastStoreContext);
|
|
604
|
+
if (!context) {
|
|
605
|
+
throw new Error('useToastStore must be used within a ToastStoreProvider');
|
|
606
|
+
}
|
|
607
|
+
return context;
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
const _excluded = ["title"];
|
|
611
|
+
function useToast() {
|
|
612
|
+
const {
|
|
613
|
+
toasts,
|
|
614
|
+
addToast,
|
|
615
|
+
removeToast
|
|
616
|
+
} = useToastStore();
|
|
617
|
+
const showToast = useCallback(options => {
|
|
618
|
+
const {
|
|
619
|
+
title
|
|
620
|
+
} = options,
|
|
621
|
+
otherOptions = _objectWithoutProperties(options, _excluded);
|
|
622
|
+
const id = `${JSON.stringify(options)}${Math.random()}`;
|
|
623
|
+
addToast(_objectSpread({
|
|
624
|
+
id,
|
|
625
|
+
title
|
|
626
|
+
}, otherOptions));
|
|
627
|
+
}, [addToast]);
|
|
628
|
+
const hideToast = useCallback(id => {
|
|
629
|
+
removeToast(id);
|
|
630
|
+
}, [removeToast]);
|
|
631
|
+
return {
|
|
632
|
+
toasts,
|
|
633
|
+
showToast,
|
|
634
|
+
hideToast
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function ToastRenderer({
|
|
639
|
+
ToastComponent
|
|
640
|
+
}) {
|
|
641
|
+
const {
|
|
642
|
+
toasts,
|
|
643
|
+
hideToast: removeToast
|
|
644
|
+
} = useToast();
|
|
645
|
+
const hideToast = useCallback(id => () => {
|
|
646
|
+
removeToast(id);
|
|
647
|
+
}, [removeToast]);
|
|
648
|
+
return toasts.map(toast => /*#__PURE__*/jsx(Toast, {
|
|
649
|
+
id: toast.id,
|
|
650
|
+
duration: toast.timeout,
|
|
651
|
+
viewportName: toast.viewportName,
|
|
652
|
+
children: /*#__PURE__*/jsx(ToastComponent, _objectSpread(_objectSpread({}, toast), {}, {
|
|
653
|
+
hideToast: hideToast(toast.id)
|
|
654
|
+
}))
|
|
655
|
+
}, toast.id));
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function ToastProvider({
|
|
659
|
+
children,
|
|
660
|
+
position = 'top',
|
|
661
|
+
viewportName,
|
|
662
|
+
ToastComponent
|
|
663
|
+
}) {
|
|
664
|
+
return /*#__PURE__*/jsx(PortalProvider, {
|
|
665
|
+
children: /*#__PURE__*/jsx(ToastProvider$1, {
|
|
666
|
+
swipeDirection: "horizontal",
|
|
667
|
+
children: /*#__PURE__*/jsxs(ToastStoreProvider, {
|
|
668
|
+
children: [children, /*#__PURE__*/jsx(SafeToastViewport, {
|
|
669
|
+
portalToRoot: true,
|
|
670
|
+
name: viewportName,
|
|
671
|
+
position: position
|
|
672
|
+
}), /*#__PURE__*/jsx(ToastRenderer, {
|
|
673
|
+
ToastComponent: ToastComponent
|
|
674
|
+
})]
|
|
675
|
+
})
|
|
676
|
+
})
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export { BumperDecorator, BumperProvider, HStack, SwitchBreakpoints, ToastProvider, SafeToastViewport as ToastViewport, Typography, VStack, getValueForBreakpoint, useBreakpointValue, useCurrentBreakpointName, useToast };
|
|
403
681
|
//# sourceMappingURL=index-metro.es.android.js.map
|