react-native-terra-ui 0.9.1 → 0.10.1
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 +23 -0
- package/lib/module/components/avatar/Avatar.js +7 -2
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/header/header-buttons.js +1 -1
- package/lib/module/components/header/header-buttons.js.map +1 -1
- package/lib/module/components/icon/Icon.js +2 -2
- package/lib/module/components/toast/Toast.js +1 -1
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toast/ToastProvider.js +9 -236
- package/lib/module/components/toast/ToastProvider.js.map +1 -1
- package/lib/module/components/toast/hooks/use-toast-manager.js +96 -0
- package/lib/module/components/toast/hooks/use-toast-manager.js.map +1 -0
- package/lib/module/components/toast/parts/ToastAnimatedItem.js +34 -50
- package/lib/module/components/toast/parts/ToastAnimatedItem.js.map +1 -1
- package/lib/module/components/toast/parts/ToastOverlay.ios.js +36 -0
- package/lib/module/components/toast/parts/ToastOverlay.ios.js.map +1 -0
- package/lib/module/components/toast/parts/ToastOverlay.js +34 -0
- package/lib/module/components/toast/parts/ToastOverlay.js.map +1 -0
- package/lib/module/components/toast/parts/ToastViewport.js +91 -0
- package/lib/module/components/toast/parts/ToastViewport.js.map +1 -0
- package/lib/module/theme/defaults/icons.js +26 -19
- package/lib/module/theme/defaults/icons.js.map +1 -1
- package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
- package/lib/typescript/src/components/toast/ToastProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/hooks/use-toast-manager.d.ts +6 -0
- package/lib/typescript/src/components/toast/hooks/use-toast-manager.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts +3 -2
- package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/parts/ToastOverlay.d.ts +28 -0
- package/lib/typescript/src/components/toast/parts/ToastOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/parts/ToastOverlay.ios.d.ts +28 -0
- package/lib/typescript/src/components/toast/parts/ToastOverlay.ios.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/parts/ToastViewport.d.ts +11 -0
- package/lib/typescript/src/components/toast/parts/ToastViewport.d.ts.map +1 -0
- package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -1
- package/lib/typescript/src/theme/types.d.ts +1 -1
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +6 -1
- package/src/components/header/header-buttons.tsx +1 -1
- package/src/components/icon/Icon.tsx +2 -2
- package/src/components/toast/Toast.tsx +1 -1
- package/src/components/toast/ToastProvider.tsx +7 -288
- package/src/components/toast/hooks/use-toast-manager.tsx +114 -0
- package/src/components/toast/parts/ToastAnimatedItem.tsx +32 -50
- package/src/components/toast/parts/ToastOverlay.ios.tsx +30 -0
- package/src/components/toast/parts/ToastOverlay.tsx +28 -0
- package/src/components/toast/parts/ToastViewport.tsx +104 -0
- package/src/theme/defaults/icons.tsx +22 -15
- package/src/theme/types.ts +6 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { jsx as _jsx
|
|
4
|
+
import Animated, { Easing, Keyframe, useAnimatedStyle, withSpring, withTiming } from "react-native-reanimated";
|
|
5
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export const enteringTop = new Keyframe({
|
|
8
8
|
0: {
|
|
9
9
|
opacity: 1,
|
|
@@ -72,16 +72,7 @@ export const exitingBottom = new Keyframe({
|
|
|
72
72
|
easing: Easing.bezier(0.4, 0, 1, 1)
|
|
73
73
|
}
|
|
74
74
|
}).duration(150);
|
|
75
|
-
const
|
|
76
|
-
const opacityTimingConfig = {
|
|
77
|
-
duration: 300
|
|
78
|
-
};
|
|
79
|
-
const translateYValue = [0, 10];
|
|
80
|
-
const translateYTimingConfig = {
|
|
81
|
-
duration: 300
|
|
82
|
-
};
|
|
83
|
-
const scaleValue = [1, 0.97];
|
|
84
|
-
const scaleTimingConfig = {
|
|
75
|
+
const timingConfig = {
|
|
85
76
|
duration: 300
|
|
86
77
|
};
|
|
87
78
|
export function ToastAnimatedItem({
|
|
@@ -91,60 +82,54 @@ export function ToastAnimatedItem({
|
|
|
91
82
|
index,
|
|
92
83
|
maxVisibleToasts,
|
|
93
84
|
placement,
|
|
94
|
-
total
|
|
85
|
+
total,
|
|
86
|
+
frontId
|
|
95
87
|
}) {
|
|
88
|
+
const depth = total - index - 1;
|
|
89
|
+
const isVisible = depth < maxVisibleToasts;
|
|
96
90
|
const containerStyle = useAnimatedStyle(() => {
|
|
97
|
-
const
|
|
98
|
-
const lastToastId = heightEntries[heightEntries.length - 1]?.[0];
|
|
99
|
-
const lastToastHeight = lastToastId ? heights.value[lastToastId] : undefined;
|
|
100
|
-
const totalValue = total.value;
|
|
91
|
+
const lastToastHeight = heights.value[frontId];
|
|
101
92
|
const sign = placement === "top" ? 1 : -1;
|
|
102
|
-
const inputRange = [totalValue - 1, totalValue - 2];
|
|
103
|
-
const opacityInputRange = [totalValue - maxVisibleToasts, totalValue - maxVisibleToasts - 1];
|
|
104
|
-
const opacity = interpolate(index, opacityInputRange, opacityValue);
|
|
105
|
-
const translateY = interpolate(index, inputRange, [translateYValue[0], translateYValue[1] * sign], Extrapolation.CLAMP);
|
|
106
|
-
const scale = interpolate(index, inputRange, scaleValue, {
|
|
107
|
-
extrapolateLeft: Extrapolation.CLAMP
|
|
108
|
-
});
|
|
109
93
|
return {
|
|
110
94
|
height: lastToastHeight ? withSpring(lastToastHeight, {
|
|
111
95
|
damping: 100,
|
|
112
96
|
stiffness: 1200,
|
|
113
97
|
mass: 3
|
|
114
98
|
}) : undefined,
|
|
115
|
-
|
|
116
|
-
opacity: withTiming(opacity, opacityTimingConfig),
|
|
99
|
+
opacity: withTiming(isVisible ? 1 : 0, timingConfig),
|
|
117
100
|
transform: [{
|
|
118
|
-
translateY: withTiming(
|
|
101
|
+
translateY: withTiming(Math.min(depth, 1) * 10 * sign, timingConfig)
|
|
119
102
|
}, {
|
|
120
|
-
scale: withTiming(
|
|
103
|
+
scale: withTiming(Math.max(0, 1 - depth * 0.03), timingConfig)
|
|
121
104
|
}],
|
|
122
105
|
zIndex: 1000 + index
|
|
123
106
|
};
|
|
124
107
|
});
|
|
125
|
-
return /*#__PURE__*/
|
|
108
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
126
109
|
entering: placement === "top" ? enteringTop : enteringBottom,
|
|
127
110
|
exiting: placement === "top" ? exitingTop : exitingBottom,
|
|
128
111
|
pointerEvents: "box-none",
|
|
129
112
|
style: [styles.position, placement === "top" ? styles.top : styles.bottom],
|
|
130
|
-
children:
|
|
113
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
131
114
|
style: containerStyle,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"aria-hidden":
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
115
|
+
pointerEvents: isVisible ? "box-none" : "none",
|
|
116
|
+
accessibilityElementsHidden: !isVisible,
|
|
117
|
+
importantForAccessibility: isVisible ? "auto" : "no-hide-descendants",
|
|
118
|
+
"aria-hidden": !isVisible,
|
|
119
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
120
|
+
style: [styles.content, placement === "top" ? styles.top : styles.bottom],
|
|
121
|
+
onLayout: event => {
|
|
122
|
+
const height = event.nativeEvent.layout.height;
|
|
123
|
+
if (heights.value[id] !== height) {
|
|
124
|
+
heights.value = {
|
|
125
|
+
...heights.value,
|
|
126
|
+
[id]: height
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
children: children
|
|
131
|
+
})
|
|
132
|
+
})
|
|
148
133
|
});
|
|
149
134
|
}
|
|
150
135
|
const styles = StyleSheet.create({
|
|
@@ -159,11 +144,10 @@ const styles = StyleSheet.create({
|
|
|
159
144
|
bottom: {
|
|
160
145
|
bottom: 0
|
|
161
146
|
},
|
|
162
|
-
|
|
147
|
+
content: {
|
|
163
148
|
position: "absolute",
|
|
164
149
|
left: 0,
|
|
165
|
-
right: 0
|
|
166
|
-
opacity: 0
|
|
150
|
+
right: 0
|
|
167
151
|
}
|
|
168
152
|
});
|
|
169
153
|
//# sourceMappingURL=ToastAnimatedItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Animated","Easing","Keyframe","useAnimatedStyle","withSpring","withTiming","StyleSheet","jsx","_jsx","enteringTop","opacity","transform","translateY","easing","out","cubic","duration","exitingTop","scale","bezier","enteringBottom","exitingBottom","timingConfig","ToastAnimatedItem","children","heights","id","index","maxVisibleToasts","placement","total","frontId","depth","isVisible","containerStyle","lastToastHeight","value","sign","height","damping","stiffness","mass","undefined","Math","min","max","zIndex","View","entering","exiting","pointerEvents","style","styles","position","top","bottom","accessibilityElementsHidden","importantForAccessibility","content","onLayout","event","nativeEvent","layout","create","left","right"],"sourceRoot":"../../../../../src","sources":["components/toast/parts/ToastAnimatedItem.tsx"],"mappings":";;;AAGA,OAAOA,QAAQ,IACbC,MAAM,EACNC,QAAQ,EAERC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAChC,SAASC,UAAU,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAepD,OAAO,MAAMC,WAAW,GAAG,IAAIP,QAAQ,CAAC;EACtC,CAAC,EAAE;IACDQ,OAAO,EAAE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AACV,EAAE,CAAC,KAAKY,MAAM,EAAE;YAChCb,OAAO,CAACW,KAAK,GAAG;cAAE,GAAGX,OAAO,CAACW,KAAK;cAAE,CAACV,EAAE,GAAGY;YAAO,CAAC;UACpD;QACF,CAAE;QAAAd,QAAA,EAEDA;MAAQ,CACL;IAAC,CACM;EAAC,CACH,CAAC;AAEpB;AAEA,MAAM4B,MAAM,GAAG9C,UAAU,CAACyD,MAAM,CAAC;EAC/BV,QAAQ,EAAE;IACRA,QAAQ,EAAE,UAAU;IACpBW,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT,CAAC;EACDX,GAAG,EAAE;IACHA,GAAG,EAAE;EACP,CAAC;EACDC,MAAM,EAAE;IACNA,MAAM,EAAE;EACV,CAAC;EACDG,OAAO,EAAE;IACPL,QAAQ,EAAE,UAAU;IACpBW,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { FullWindowOverlay } from "react-native-screens";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Lifts the toast viewport into a window of its own, above every presented
|
|
7
|
+
* view controller.
|
|
8
|
+
*
|
|
9
|
+
* Without this, a toast raised from a screen presented as `modal` or
|
|
10
|
+
* `formSheet` is invisible. `ToastProvider` sits above the app's navigator, so
|
|
11
|
+
* its viewport belongs to the root view controller's view; UIKit presents a
|
|
12
|
+
* sheet as a *separate* view controller on top of that one. They are different
|
|
13
|
+
* presentation layers, so no `zIndex` or `elevation` can lift the viewport over
|
|
14
|
+
* the sheet — the toast is mounted and animating, just underneath. The reader
|
|
15
|
+
* presses something, the app reports the result, and nothing appears.
|
|
16
|
+
*
|
|
17
|
+
* `FullWindowOverlay` hosts its children in its own `UIWindow`, which sits
|
|
18
|
+
* above presented controllers, so the viewport paints over a sheet the same way
|
|
19
|
+
* it paints over an ordinary screen.
|
|
20
|
+
*
|
|
21
|
+
* It covers the whole window, but it does not swallow the app's touches:
|
|
22
|
+
* `RNSFullWindowOverlay`'s `pointInside:` walks its subviews and answers NO
|
|
23
|
+
* anywhere they are not, so presses fall through to whatever is underneath.
|
|
24
|
+
*
|
|
25
|
+
* Mounted only alongside a non-empty viewport — `ToastViewport` returns `null`
|
|
26
|
+
* before reaching this — so an idle app carries no extra window.
|
|
27
|
+
*/
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
export function ToastOverlay({
|
|
30
|
+
children
|
|
31
|
+
}) {
|
|
32
|
+
return /*#__PURE__*/_jsx(FullWindowOverlay, {
|
|
33
|
+
children: children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=ToastOverlay.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FullWindowOverlay","jsx","_jsx","ToastOverlay","children"],"sourceRoot":"../../../../../src","sources":["components/toast/parts/ToastOverlay.ios.tsx"],"mappings":";;AAEA,SAASA,iBAAiB,QAAQ,sBAAsB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA,SAAAC,GAAA,IAAAC,IAAA;AAuBA,OAAO,SAASC,YAAYA,CAAC;EAAEC;AAAkC,CAAC,EAAE;EAClE,oBAAOF,IAAA,CAACF,iBAAiB;IAAAI,QAAA,EAAEA;EAAQ,CAAoB,CAAC;AAC1D","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* Hosts the toast viewport where it already is, because on Android it is
|
|
6
|
+
* already in the right place.
|
|
7
|
+
*
|
|
8
|
+
* The iOS variant explains the problem: a sheet there is a separate view
|
|
9
|
+
* controller, so a toast in the root tree paints underneath it. Android does
|
|
10
|
+
* not have that problem for these screens. `react-native-screens` handles
|
|
11
|
+
* `formSheet` as a `StackPresentation` inside the screen stack (see
|
|
12
|
+
* `Screen.kt`), which lives in the Activity's own window — the same window as
|
|
13
|
+
* this provider — so the viewport's `elevation: 9999` puts it on top the
|
|
14
|
+
* ordinary way. Verified on an API 36 emulator: a toast raised from a
|
|
15
|
+
* `formSheet` route renders over that sheet.
|
|
16
|
+
*
|
|
17
|
+
* Not to be confused with `ScreenModalFragment`, which *is* a
|
|
18
|
+
* `BottomSheetDialogFragment` and so does carry its own `Window`. It backs a
|
|
19
|
+
* different presentation, not the `formSheet` route above. A toast raised from
|
|
20
|
+
* something hosted in a real `Dialog` — that fragment, or React Native's own
|
|
21
|
+
* `Modal` — would still be behind it, and `elevation` cannot cross windows.
|
|
22
|
+
* Untested, and left alone: `FullWindowOverlay` is iOS-only (elsewhere it warns
|
|
23
|
+
* and renders a plain `View`), so the remedy there would be to own a window
|
|
24
|
+
* too, via a React Native `Modal`, which brings its own back-button and
|
|
25
|
+
* touch-capture behaviour.
|
|
26
|
+
*/
|
|
27
|
+
export function ToastOverlay({
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
31
|
+
children: children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ToastOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ToastOverlay","children","_jsx","_Fragment"],"sourceRoot":"../../../../../src","sources":["components/toast/parts/ToastOverlay.tsx"],"mappings":";;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAC;EAAEC;AAAkC,CAAC,EAAE;EAClE,oBAAOC,IAAA,CAAAC,SAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { Keyboard, Platform } from "react-native";
|
|
5
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
6
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
7
|
+
import { ToastAnimatedItem } from "./ToastAnimatedItem.js";
|
|
8
|
+
import { ToastOverlay } from "./ToastOverlay";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export function ToastViewport({
|
|
11
|
+
placement,
|
|
12
|
+
toasts,
|
|
13
|
+
manager,
|
|
14
|
+
maxVisibleToasts,
|
|
15
|
+
offset
|
|
16
|
+
}) {
|
|
17
|
+
const safeAreaInsets = useSafeAreaInsets();
|
|
18
|
+
const heights = useSharedValue({});
|
|
19
|
+
const keyboardHeight = useSharedValue(0);
|
|
20
|
+
const baseBottom = offset?.bottom ?? safeAreaInsets.bottom + (Platform.OS === "ios" ? 6 : 12);
|
|
21
|
+
const baseTop = offset?.top ?? safeAreaInsets.top + (Platform.OS === "ios" ? 0 : 12);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (placement !== "bottom") return;
|
|
24
|
+
const showEvent = Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow";
|
|
25
|
+
const hideEvent = Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide";
|
|
26
|
+
const showSub = Keyboard.addListener(showEvent, e => {
|
|
27
|
+
keyboardHeight.value = withTiming(e.endCoordinates.height);
|
|
28
|
+
});
|
|
29
|
+
const hideSub = Keyboard.addListener(hideEvent, () => {
|
|
30
|
+
keyboardHeight.value = withTiming(0);
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
showSub.remove();
|
|
34
|
+
hideSub.remove();
|
|
35
|
+
};
|
|
36
|
+
}, [keyboardHeight, placement]);
|
|
37
|
+
const gap = Platform.OS === "ios" ? 6 : 12;
|
|
38
|
+
const keyboardStyle = useAnimatedStyle(() => {
|
|
39
|
+
if (placement === "top") return {
|
|
40
|
+
top: baseTop
|
|
41
|
+
};
|
|
42
|
+
if (keyboardHeight.value > 0) {
|
|
43
|
+
return {
|
|
44
|
+
bottom: keyboardHeight.value + gap
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
bottom: baseBottom
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const activeIds = new Set(toasts.map(toast => toast.id));
|
|
53
|
+
const nextHeights = {};
|
|
54
|
+
for (const [id, height] of Object.entries(heights.value)) {
|
|
55
|
+
if (activeIds.has(id)) {
|
|
56
|
+
nextHeights[id] = height;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
heights.value = nextHeights;
|
|
60
|
+
}, [heights, toasts]);
|
|
61
|
+
const frontToast = toasts[toasts.length - 1];
|
|
62
|
+
if (!frontToast) return null;
|
|
63
|
+
return /*#__PURE__*/_jsx(ToastOverlay, {
|
|
64
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
65
|
+
pointerEvents: "box-none",
|
|
66
|
+
style: [{
|
|
67
|
+
position: "absolute",
|
|
68
|
+
zIndex: 9999,
|
|
69
|
+
elevation: 9999,
|
|
70
|
+
left: offset?.left ?? safeAreaInsets.left + 12,
|
|
71
|
+
right: offset?.right ?? safeAreaInsets.right + 12
|
|
72
|
+
}, keyboardStyle],
|
|
73
|
+
children: toasts.map((toast, index) => /*#__PURE__*/_jsx(ToastAnimatedItem, {
|
|
74
|
+
heights: heights,
|
|
75
|
+
id: toast.id,
|
|
76
|
+
index: index,
|
|
77
|
+
maxVisibleToasts: maxVisibleToasts,
|
|
78
|
+
placement: placement,
|
|
79
|
+
total: toasts.length,
|
|
80
|
+
frontId: frontToast.id,
|
|
81
|
+
children: toast.component({
|
|
82
|
+
id: toast.id,
|
|
83
|
+
index,
|
|
84
|
+
hide: manager.hide,
|
|
85
|
+
show: manager.show
|
|
86
|
+
})
|
|
87
|
+
}, toast.id))
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=ToastViewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","Keyboard","Platform","Animated","useAnimatedStyle","useSharedValue","withTiming","useSafeAreaInsets","ToastAnimatedItem","ToastOverlay","jsx","_jsx","ToastViewport","placement","toasts","manager","maxVisibleToasts","offset","safeAreaInsets","heights","keyboardHeight","baseBottom","bottom","OS","baseTop","top","showEvent","hideEvent","showSub","addListener","e","value","endCoordinates","height","hideSub","remove","gap","keyboardStyle","activeIds","Set","map","toast","id","nextHeights","Object","entries","has","frontToast","length","children","View","pointerEvents","style","position","zIndex","elevation","left","right","index","total","frontId","component","hide","show"],"sourceRoot":"../../../../../src","sources":["components/toast/parts/ToastViewport.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAEjD,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAChG,SAASC,iBAAiB,QAAQ,gCAAgC;AAGlE,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AAAyB,SAAAC,GAAA,IAAAC,IAAA;AAU9C,OAAO,SAASC,aAAaA,CAAC;EAAEC,SAAS;EAAEC,MAAM;EAAEC,OAAO;EAAEC,gBAAgB;EAAEC;AAA2B,CAAC,EAAE;EAC1G,MAAMC,cAAc,GAAGX,iBAAiB,CAAC,CAAC;EAC1C,MAAMY,OAAO,GAAGd,cAAc,CAA0B,CAAC,CAAC,CAAC;EAC3D,MAAMe,cAAc,GAAGf,cAAc,CAAC,CAAC,CAAC;EAExC,MAAMgB,UAAU,GAAGJ,MAAM,EAAEK,MAAM,IAAIJ,cA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kBACvB/C,IAAA,CAACH,iBAAiB;QAEhBW,OAAO,EAAEA,OAAQ;QACjBuB,EAAE,EAAED,KAAK,CAACC,EAAG;QACbgB,KAAK,EAAEA,KAAM;QACb1C,gBAAgB,EAAEA,gBAAiB;QACnCH,SAAS,EAAEA,SAAU;QACrB8C,KAAK,EAAE7C,MAAM,CAACkC,MAAO;QACrBY,OAAO,EAAEb,UAAU,CAACL,EAAG;QAAAO,QAAA,EAEtBR,KAAK,CAACoB,SAAS,CAAC;UACfnB,EAAE,EAAED,KAAK,CAACC,EAAE;UACZgB,KAAK;UACLI,IAAI,EAAE/C,OAAO,CAAC+C,IAAI;UAClBC,IAAI,EAAEhD,OAAO,CAACgD;QAChB,CAAC;MAAC,GAdGtB,KAAK,CAACC,EAeM,CACpB;IAAC,CACW;EAAC,CACJ,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -20,6 +20,12 @@ const strokeProps = (color, strokeWidth) => ({
|
|
|
20
20
|
strokeLinecap: "round",
|
|
21
21
|
strokeLinejoin: "round"
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
// Every registry icon draws through this: one 24×24 viewBox rendered at exactly
|
|
25
|
+
// the requested `size`, so `<Icon size={24} />` is the same optical weight
|
|
26
|
+
// whichever name it resolves to. A glyph that needs to sit smaller than its box
|
|
27
|
+
// (Avatar's person fallback) asks for a smaller `size` — it must not shrink
|
|
28
|
+
// itself here, or it would scale differently from every other icon.
|
|
23
29
|
const SvgIcon = ({
|
|
24
30
|
size,
|
|
25
31
|
children
|
|
@@ -49,18 +55,18 @@ const PathIcon = ({
|
|
|
49
55
|
};
|
|
50
56
|
|
|
51
57
|
// Lucide chevron geometry scaled 20% from the 24×24 viewBox center (45° arms unchanged).
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
d: `M${
|
|
58
|
+
const CHEVRON_CENTER = 12;
|
|
59
|
+
const CHEVRON_OPEN = 3 * 1.2;
|
|
60
|
+
const CHEVRON_ARM = 6 * 1.2;
|
|
61
|
+
const ChevronLeftIcon = props => /*#__PURE__*/_jsx(PathIcon, {
|
|
62
|
+
d: `M${CHEVRON_CENTER + CHEVRON_OPEN} ${CHEVRON_CENTER + CHEVRON_ARM}L${CHEVRON_CENTER - CHEVRON_OPEN} ${CHEVRON_CENTER} ${CHEVRON_CENTER + CHEVRON_OPEN} ${CHEVRON_CENTER - CHEVRON_ARM}`,
|
|
57
63
|
...props
|
|
58
64
|
});
|
|
59
|
-
const
|
|
60
|
-
d: `M${
|
|
65
|
+
const ChevronRightIcon = props => /*#__PURE__*/_jsx(PathIcon, {
|
|
66
|
+
d: `M${CHEVRON_CENTER - CHEVRON_OPEN} ${CHEVRON_CENTER + CHEVRON_ARM}L${CHEVRON_CENTER + CHEVRON_OPEN} ${CHEVRON_CENTER} ${CHEVRON_CENTER - CHEVRON_OPEN} ${CHEVRON_CENTER - CHEVRON_ARM}`,
|
|
61
67
|
...props
|
|
62
68
|
});
|
|
63
|
-
const
|
|
69
|
+
const XIcon = props => /*#__PURE__*/_jsx(PathIcon, {
|
|
64
70
|
d: "M18 6L6 18M6 6l12 12",
|
|
65
71
|
...props
|
|
66
72
|
});
|
|
@@ -151,6 +157,10 @@ const DangerIcon = props => {
|
|
|
151
157
|
})]
|
|
152
158
|
});
|
|
153
159
|
};
|
|
160
|
+
const CheckIcon = props => /*#__PURE__*/_jsx(PathIcon, {
|
|
161
|
+
d: "M20 6 9 17l-5-5",
|
|
162
|
+
...props
|
|
163
|
+
});
|
|
154
164
|
export const PersonIcon = props => {
|
|
155
165
|
const {
|
|
156
166
|
color,
|
|
@@ -158,12 +168,8 @@ export const PersonIcon = props => {
|
|
|
158
168
|
strokeWidth
|
|
159
169
|
} = resolveIconProps(props);
|
|
160
170
|
const stroke = strokeProps(color, strokeWidth);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
width: iconSize,
|
|
164
|
-
height: iconSize,
|
|
165
|
-
viewBox: "0 0 24 24",
|
|
166
|
-
fill: "none",
|
|
171
|
+
return /*#__PURE__*/_jsxs(SvgIcon, {
|
|
172
|
+
size: size,
|
|
167
173
|
children: [/*#__PURE__*/_jsx(Circle, {
|
|
168
174
|
cx: 12,
|
|
169
175
|
cy: 8,
|
|
@@ -176,13 +182,14 @@ export const PersonIcon = props => {
|
|
|
176
182
|
});
|
|
177
183
|
};
|
|
178
184
|
export const defaultIcons = {
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"
|
|
185
|
+
"terra.chevron-left": ChevronLeftIcon,
|
|
186
|
+
"terra.chevron-right": ChevronRightIcon,
|
|
187
|
+
"terra.x": XIcon,
|
|
188
|
+
"terra.check": CheckIcon,
|
|
189
|
+
"terra.person": PersonIcon,
|
|
182
190
|
"status.info": InfoIcon,
|
|
183
191
|
"status.success": SuccessIcon,
|
|
184
192
|
"status.warning": WarningIcon,
|
|
185
|
-
"status.danger": DangerIcon
|
|
186
|
-
person: PersonIcon
|
|
193
|
+
"status.danger": DangerIcon
|
|
187
194
|
};
|
|
188
195
|
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Svg","Circle","Path","jsx","_jsx","jsxs","_jsxs","DEFAULT_SIZE","DEFAULT_COLOR","DEFAULT_STROKE_WIDTH","resolveIconProps","size","color","strokeWidth","strokeProps","stroke","strokeLinecap","strokeLinejoin","SvgIcon","children","width","height","viewBox","fill","PathIcon","d","props","
|
|
1
|
+
{"version":3,"names":["Svg","Circle","Path","jsx","_jsx","jsxs","_jsxs","DEFAULT_SIZE","DEFAULT_COLOR","DEFAULT_STROKE_WIDTH","resolveIconProps","size","color","strokeWidth","strokeProps","stroke","strokeLinecap","strokeLinejoin","SvgIcon","children","width","height","viewBox","fill","PathIcon","d","props","CHEVRON_CENTER","CHEVRON_OPEN","CHEVRON_ARM","ChevronLeftIcon","ChevronRightIcon","XIcon","InfoIcon","cx","cy","r","SuccessIcon","WarningIcon","DangerIcon","CheckIcon","Person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AAEd,CAAC;AAED,OAAO,MAAM2B,YAA+D,GAAG;EAC7E,oBAAoB,EAAEZ,eAAe;EACrC,qBAAqB,EAAEC,gBAAgB;EACvC,SAAS,EAAEC,KAAK;EAChB,aAAa,EAAEQ,SAAS;EACxB,cAAc,EAAEC,UAAU;EAC1B,aAAa,EAAER,QAAQ;EACvB,gBAAgB,EAAEI,WAAW;EAC7B,gBAAgB,EAAEC,WAAW;EAC7B,eAAe,EAAEC;AACnB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAA2B,MAAM,YAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAA2B,MAAM,YAAS,CAAC;AA8CpE,wBAAgB,MAAM,CAAC,EACrB,IAAW,EACX,KAAgB,EAChB,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,UAAoB,EACpB,KAAmB,EACnB,OAAiB,EACjB,KAAK,EACL,GAAG,IAAI,EACR,EAAE,WAAW,+BA6Db"}
|
|
@@ -11,11 +11,11 @@ export interface IconProps extends Omit<ViewProps, "children"> {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Renders an icon from the Terra UI icon registry (`configureTerraUI({ icons })`
|
|
14
|
-
* plus built-in semantic names like `
|
|
14
|
+
* plus built-in semantic names like `terra.chevron-left`).
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```tsx
|
|
18
|
-
* <Icon name="
|
|
18
|
+
* <Icon name="terra.x" size={24} color="text.primary" />
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAS,CAAC;AAIhE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,gBAAwB,EACxB,eAAsB,EACtB,gBAAoB,EACpB,MAAM,GACP,EAAE,kBAAkB,+BAwBpB;AAED,wBAAgB,QAAQ,IAAI,YAAY,CAMvC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ToastItem, ToastManager, ToastPlacement } from "../types.js";
|
|
2
|
+
export declare function useToastManager(defaultPlacement: ToastPlacement, defaultDuration: number): {
|
|
3
|
+
toasts: ToastItem[];
|
|
4
|
+
manager: ToastManager;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=use-toast-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-toast-manager.d.ts","sourceRoot":"","sources":["../../../../../../src/components/toast/hooks/use-toast-manager.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,SAAS,EACT,YAAY,EACZ,cAAc,EAEf,MAAM,aAAU,CAAC;AAmBlB,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM;;;EAoFxF"}
|
|
@@ -8,11 +8,12 @@ export interface ToastAnimatedItemProps {
|
|
|
8
8
|
index: number;
|
|
9
9
|
maxVisibleToasts: number;
|
|
10
10
|
placement: ToastPlacement;
|
|
11
|
-
total:
|
|
11
|
+
total: number;
|
|
12
|
+
frontId: ToastId;
|
|
12
13
|
}
|
|
13
14
|
export declare const enteringTop: import("react-native-reanimated").ReanimatedKeyframe;
|
|
14
15
|
export declare const exitingTop: import("react-native-reanimated").ReanimatedKeyframe;
|
|
15
16
|
export declare const enteringBottom: import("react-native-reanimated").ReanimatedKeyframe;
|
|
16
17
|
export declare const exitingBottom: import("react-native-reanimated").ReanimatedKeyframe;
|
|
17
|
-
export declare function ToastAnimatedItem({ children, heights, id, index, maxVisibleToasts, placement, total, }: ToastAnimatedItemProps): import("react").JSX.Element;
|
|
18
|
+
export declare function ToastAnimatedItem({ children, heights, id, index, maxVisibleToasts, placement, total, frontId, }: ToastAnimatedItemProps): import("react").JSX.Element;
|
|
18
19
|
//# sourceMappingURL=ToastAnimatedItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastAnimatedItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/toast/parts/ToastAnimatedItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAiB,
|
|
1
|
+
{"version":3,"file":"ToastAnimatedItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/toast/parts/ToastAnimatedItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAiB,EAGf,KAAK,WAAW,EAIjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAU,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,sDAUR,CAAC;AAEjB,eAAO,MAAM,UAAU,sDAUP,CAAC;AAEjB,eAAO,MAAM,cAAc,sDAUX,CAAC;AAEjB,eAAO,MAAM,aAAa,sDAUV,CAAC;AAIjB,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,OAAO,EACP,EAAE,EACF,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,OAAO,GACR,EAAE,sBAAsB,+BAqDxB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hosts the toast viewport where it already is, because on Android it is
|
|
4
|
+
* already in the right place.
|
|
5
|
+
*
|
|
6
|
+
* The iOS variant explains the problem: a sheet there is a separate view
|
|
7
|
+
* controller, so a toast in the root tree paints underneath it. Android does
|
|
8
|
+
* not have that problem for these screens. `react-native-screens` handles
|
|
9
|
+
* `formSheet` as a `StackPresentation` inside the screen stack (see
|
|
10
|
+
* `Screen.kt`), which lives in the Activity's own window — the same window as
|
|
11
|
+
* this provider — so the viewport's `elevation: 9999` puts it on top the
|
|
12
|
+
* ordinary way. Verified on an API 36 emulator: a toast raised from a
|
|
13
|
+
* `formSheet` route renders over that sheet.
|
|
14
|
+
*
|
|
15
|
+
* Not to be confused with `ScreenModalFragment`, which *is* a
|
|
16
|
+
* `BottomSheetDialogFragment` and so does carry its own `Window`. It backs a
|
|
17
|
+
* different presentation, not the `formSheet` route above. A toast raised from
|
|
18
|
+
* something hosted in a real `Dialog` — that fragment, or React Native's own
|
|
19
|
+
* `Modal` — would still be behind it, and `elevation` cannot cross windows.
|
|
20
|
+
* Untested, and left alone: `FullWindowOverlay` is iOS-only (elsewhere it warns
|
|
21
|
+
* and renders a plain `View`), so the remedy there would be to own a window
|
|
22
|
+
* too, via a React Native `Modal`, which brings its own back-button and
|
|
23
|
+
* touch-capture behaviour.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ToastOverlay({ children }: {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=ToastOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/toast/parts/ToastOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEjE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Lifts the toast viewport into a window of its own, above every presented
|
|
4
|
+
* view controller.
|
|
5
|
+
*
|
|
6
|
+
* Without this, a toast raised from a screen presented as `modal` or
|
|
7
|
+
* `formSheet` is invisible. `ToastProvider` sits above the app's navigator, so
|
|
8
|
+
* its viewport belongs to the root view controller's view; UIKit presents a
|
|
9
|
+
* sheet as a *separate* view controller on top of that one. They are different
|
|
10
|
+
* presentation layers, so no `zIndex` or `elevation` can lift the viewport over
|
|
11
|
+
* the sheet — the toast is mounted and animating, just underneath. The reader
|
|
12
|
+
* presses something, the app reports the result, and nothing appears.
|
|
13
|
+
*
|
|
14
|
+
* `FullWindowOverlay` hosts its children in its own `UIWindow`, which sits
|
|
15
|
+
* above presented controllers, so the viewport paints over a sheet the same way
|
|
16
|
+
* it paints over an ordinary screen.
|
|
17
|
+
*
|
|
18
|
+
* It covers the whole window, but it does not swallow the app's touches:
|
|
19
|
+
* `RNSFullWindowOverlay`'s `pointInside:` walks its subviews and answers NO
|
|
20
|
+
* anywhere they are not, so presses fall through to whatever is underneath.
|
|
21
|
+
*
|
|
22
|
+
* Mounted only alongside a non-empty viewport — `ToastViewport` returns `null`
|
|
23
|
+
* before reaching this — so an idle app carries no extra window.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ToastOverlay({ children }: {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=ToastOverlay.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastOverlay.ios.d.ts","sourceRoot":"","sources":["../../../../../../src/components/toast/parts/ToastOverlay.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToastItem, ToastManager, ToastPlacement, ToastProviderProps } from "../types.js";
|
|
2
|
+
interface ToastViewportProps {
|
|
3
|
+
placement: ToastPlacement;
|
|
4
|
+
toasts: ToastItem[];
|
|
5
|
+
manager: ToastManager;
|
|
6
|
+
maxVisibleToasts: number;
|
|
7
|
+
offset?: ToastProviderProps["offset"];
|
|
8
|
+
}
|
|
9
|
+
export declare function ToastViewport({ placement, toasts, manager, maxVisibleToasts, offset }: ToastViewportProps): import("react").JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ToastViewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../../../../../src/components/toast/parts/ToastViewport.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAW,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAU,CAAC;AAIrG,UAAU,kBAAkB;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;CACvC;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,kBAAkB,sCAqFzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/defaults/icons.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAkB,qBAAqB,EAAE,MAAM,aAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/defaults/icons.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAkB,qBAAqB,EAAE,MAAM,aAAU,CAAC;AAkH1F,eAAO,MAAM,UAAU,EAAE,kBAUxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAU1E,CAAC"}
|