react-native-system-ui 0.0.3 → 0.0.5
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/dist/cjs/components/area/Area.js +4 -10
- package/dist/cjs/components/avatar/Avatar.js +3 -3
- package/dist/cjs/components/avatar/tokens.js +2 -1
- package/dist/cjs/components/badge/Badge.js +30 -38
- package/dist/cjs/components/button/Button.js +13 -13
- package/dist/cjs/components/button/ButtonGroup.js +8 -8
- package/dist/cjs/components/calendar/Calendar.js +10 -10
- package/dist/cjs/components/cascader/Cascader.js +4 -4
- package/dist/cjs/components/cascader/useCascaderExtend.js +5 -15
- package/dist/cjs/components/checkbox/CheckboxGroup.js +2 -2
- package/dist/cjs/components/circle/Circle.js +2 -2
- package/dist/cjs/components/collapse/Collapse.js +13 -16
- package/dist/cjs/components/config-provider/ConfigProvider.js +1 -1
- package/dist/cjs/components/datetime-picker/DatetimePicker.js +7 -7
- package/dist/cjs/components/dialog/Dialog.js +4 -6
- package/dist/cjs/components/dialog/tokens.js +2 -1
- package/dist/cjs/components/dropdown-menu/DropdownItem.js +53 -52
- package/dist/cjs/components/dropdown-menu/DropdownMenu.js +19 -23
- package/dist/cjs/components/dropdown-menu/tokens.js +20 -3
- package/dist/cjs/components/field/Field.js +6 -6
- package/dist/cjs/components/form/Form.js +5 -9
- package/dist/cjs/components/grid/Grid.js +4 -4
- package/dist/cjs/components/image/Image.js +19 -15
- package/dist/cjs/components/image-preview/ImagePreview.js +62 -60
- package/dist/cjs/components/image-preview/tokens.js +21 -2
- package/dist/cjs/components/index-bar/IndexAnchor.js +7 -6
- package/dist/cjs/components/index-bar/IndexBar.js +38 -44
- package/dist/cjs/components/index-bar/tokens.js +22 -13
- package/dist/cjs/components/index.js +343 -0
- package/dist/cjs/components/input/Input.js +7 -10
- package/dist/cjs/components/notice-bar/NoticeBar.js +69 -95
- package/dist/cjs/components/notify/Notify.js +49 -24
- package/dist/cjs/components/notify/defaults.js +2 -2
- package/dist/cjs/components/notify/imperative.js +1 -1
- package/dist/cjs/components/notify/tokens.js +5 -4
- package/dist/cjs/components/number-keyboard/NumberKeyboard.js +12 -12
- package/dist/cjs/components/number-keyboard/tokens.js +4 -2
- package/dist/cjs/components/overlay/useOverlayStack.js +5 -1
- package/dist/cjs/components/pagination/Pagination.js +2 -2
- package/dist/cjs/components/password-input/PasswordInput.js +35 -27
- package/dist/cjs/components/picker/Picker.js +11 -12
- package/dist/cjs/components/picker/WheelPicker.js +9 -9
- package/dist/cjs/components/picker/tokens.js +4 -2
- package/dist/cjs/components/popup/Popup.js +39 -54
- package/dist/cjs/components/popup/tokens.js +2 -1
- package/dist/cjs/components/portal/Portal.js +5 -0
- package/dist/cjs/components/portal/PortalHost.js +1 -13
- package/dist/cjs/components/pull-refresh/PullRefresh.js +46 -27
- package/dist/cjs/components/radio/RadioGroup.js +2 -2
- package/dist/cjs/components/search/Search.js +52 -67
- package/dist/cjs/components/search/tokens.js +2 -1
- package/dist/cjs/components/selector/Selector.js +3 -3
- package/dist/cjs/components/share-sheet/ShareSheet.js +64 -62
- package/dist/cjs/components/share-sheet/tokens.js +15 -2
- package/dist/cjs/components/sidebar/Sidebar.js +15 -19
- package/dist/cjs/components/sidebar/SidebarItem.js +0 -3
- package/dist/cjs/components/skeleton/Skeleton.js +44 -56
- package/dist/cjs/components/slider/Slider.js +55 -61
- package/dist/cjs/components/stepper/Stepper.js +13 -16
- package/dist/cjs/components/stepper/tokens.js +4 -2
- package/dist/cjs/components/swiper/Swiper.js +21 -42
- package/dist/cjs/components/swiper/useSwiperWeb.js +15 -18
- package/dist/cjs/components/tabbar/Tabbar.js +8 -11
- package/dist/cjs/components/tabbar/TabbarItem.js +0 -3
- package/dist/cjs/components/tabs/Tabs.js +33 -54
- package/dist/cjs/components/tabs/tokens.js +9 -1
- package/dist/cjs/components/tabs/useTabsScroll.js +4 -0
- package/dist/cjs/components/toast/Toast.js +10 -8
- package/dist/cjs/components/toast/tokens.js +5 -1
- package/dist/cjs/components/typography/Typography.js +17 -30
- package/dist/cjs/components/uploader/Uploader.js +49 -46
- package/dist/cjs/components/uploader/tokens.js +27 -1
- package/dist/cjs/components/water-mark/WaterMark.js +16 -16
- package/dist/cjs/hooks/usePresenceAnimation.js +12 -2
- package/dist/es/components/area/Area.js +5 -11
- package/dist/es/components/avatar/Avatar.js +3 -3
- package/dist/es/components/avatar/tokens.js +2 -1
- package/dist/es/components/badge/Badge.js +31 -39
- package/dist/es/components/button/Button.js +14 -14
- package/dist/es/components/button/ButtonGroup.js +7 -7
- package/dist/es/components/calendar/Calendar.js +11 -11
- package/dist/es/components/cascader/Cascader.js +5 -5
- package/dist/es/components/cascader/useCascaderExtend.js +5 -9
- package/dist/es/components/checkbox/CheckboxGroup.js +3 -3
- package/dist/es/components/circle/Circle.js +3 -3
- package/dist/es/components/collapse/Collapse.js +14 -17
- package/dist/es/components/config-provider/ConfigProvider.js +2 -2
- package/dist/es/components/datetime-picker/DatetimePicker.js +8 -8
- package/dist/es/components/dialog/Dialog.js +4 -6
- package/dist/es/components/dialog/tokens.js +2 -1
- package/dist/es/components/dropdown-menu/DropdownItem.js +53 -52
- package/dist/es/components/dropdown-menu/DropdownMenu.js +20 -24
- package/dist/es/components/dropdown-menu/tokens.js +20 -3
- package/dist/es/components/field/Field.js +7 -7
- package/dist/es/components/field/index.js +1 -1
- package/dist/es/components/form/Form.js +6 -10
- package/dist/es/components/grid/Grid.js +3 -3
- package/dist/es/components/image/Image.js +20 -16
- package/dist/es/components/image-preview/ImagePreview.js +63 -61
- package/dist/es/components/image-preview/tokens.js +21 -2
- package/dist/es/components/index-bar/IndexAnchor.js +7 -6
- package/dist/es/components/index-bar/IndexBar.js +39 -45
- package/dist/es/components/index-bar/tokens.js +22 -13
- package/dist/es/components/index.js +50 -1
- package/dist/es/components/input/Input.js +8 -11
- package/dist/es/components/notice-bar/NoticeBar.js +70 -96
- package/dist/es/components/notify/Notify.js +49 -25
- package/dist/es/components/notify/defaults.js +2 -2
- package/dist/es/components/notify/imperative.js +1 -1
- package/dist/es/components/notify/tokens.js +5 -4
- package/dist/es/components/number-keyboard/NumberKeyboard.js +13 -13
- package/dist/es/components/number-keyboard/tokens.js +4 -2
- package/dist/es/components/overlay/useOverlayStack.js +6 -2
- package/dist/es/components/pagination/Pagination.js +3 -3
- package/dist/es/components/password-input/PasswordInput.js +36 -28
- package/dist/es/components/picker/Picker.js +12 -13
- package/dist/es/components/picker/WheelPicker.js +10 -10
- package/dist/es/components/picker/tokens.js +4 -2
- package/dist/es/components/popup/Popup.js +41 -56
- package/dist/es/components/popup/tokens.js +2 -1
- package/dist/es/components/portal/Portal.js +5 -0
- package/dist/es/components/portal/PortalHost.js +1 -13
- package/dist/es/components/pull-refresh/PullRefresh.js +47 -28
- package/dist/es/components/radio/RadioGroup.js +3 -3
- package/dist/es/components/search/Search.js +53 -68
- package/dist/es/components/search/tokens.js +2 -1
- package/dist/es/components/selector/Selector.js +4 -4
- package/dist/es/components/share-sheet/ShareSheet.js +65 -63
- package/dist/es/components/share-sheet/tokens.js +15 -2
- package/dist/es/components/sidebar/Sidebar.js +14 -18
- package/dist/es/components/sidebar/SidebarItem.js +0 -3
- package/dist/es/components/skeleton/Skeleton.js +45 -57
- package/dist/es/components/slider/Slider.js +56 -62
- package/dist/es/components/stepper/Stepper.js +14 -17
- package/dist/es/components/stepper/tokens.js +4 -2
- package/dist/es/components/swiper/Swiper.js +22 -43
- package/dist/es/components/swiper/useSwiperWeb.js +16 -19
- package/dist/es/components/tabbar/Tabbar.js +9 -12
- package/dist/es/components/tabbar/TabbarItem.js +0 -3
- package/dist/es/components/tabs/Tabs.js +34 -55
- package/dist/es/components/tabs/tokens.js +9 -1
- package/dist/es/components/tabs/useTabsScroll.js +4 -0
- package/dist/es/components/toast/Toast.js +10 -8
- package/dist/es/components/toast/tokens.js +5 -1
- package/dist/es/components/typography/Typography.js +18 -31
- package/dist/es/components/uploader/Uploader.js +49 -46
- package/dist/es/components/uploader/tokens.js +27 -1
- package/dist/es/components/water-mark/WaterMark.js +17 -17
- package/dist/es/hooks/usePresenceAnimation.js +12 -2
- package/dist/types/components/dialog/tokens.d.ts +1 -0
- package/dist/types/components/dropdown-menu/tokens.d.ts +17 -0
- package/dist/types/components/field/index.d.ts +1 -1
- package/dist/types/components/image-preview/tokens.d.ts +16 -0
- package/dist/types/components/index-bar/tokens.d.ts +13 -4
- package/dist/types/components/index.d.ts +102 -0
- package/dist/types/components/notify/defaults.d.ts +2 -2
- package/dist/types/components/number-keyboard/tokens.d.ts +1 -0
- package/dist/types/components/password-input/PasswordInput.d.ts +4 -0
- package/dist/types/components/picker/tokens.d.ts +2 -0
- package/dist/types/components/popup/tokens.d.ts +1 -0
- package/dist/types/components/search/tokens.d.ts +1 -0
- package/dist/types/components/share-sheet/tokens.d.ts +13 -0
- package/dist/types/components/stepper/tokens.d.ts +2 -0
- package/dist/types/components/tabs/tokens.d.ts +8 -0
- package/dist/types/components/toast/tokens.d.ts +4 -0
- package/dist/types/components/uploader/tokens.d.ts +25 -0
- package/dist/types/hooks/usePresenceAnimation.d.ts +6 -1
- package/package.json +135 -135
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, useEffect,
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { Animated, Easing, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
4
4
|
import { useControllableValue } from '../../hooks';
|
|
5
5
|
import { nativeDriverEnabled } from '../../platform';
|
|
@@ -67,11 +67,11 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
67
67
|
trigger: 'onChange'
|
|
68
68
|
});
|
|
69
69
|
const value = mergedValue ?? '';
|
|
70
|
-
const maxlength =
|
|
70
|
+
const maxlength = (() => {
|
|
71
71
|
const parsed = parseNumberLike(maxlengthProp, undefined);
|
|
72
72
|
if (parsed === undefined || !Number.isFinite(parsed) || parsed < 0) return undefined;
|
|
73
73
|
return Math.floor(parsed);
|
|
74
|
-
}
|
|
74
|
+
})();
|
|
75
75
|
const valueRef = useRef(value);
|
|
76
76
|
const maxlengthRef = useRef(maxlength);
|
|
77
77
|
valueRef.current = value;
|
|
@@ -109,7 +109,7 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
109
109
|
keyboardRegistry.delete(closeSelf);
|
|
110
110
|
};
|
|
111
111
|
}, [visible, closeSelf]);
|
|
112
|
-
const keys =
|
|
112
|
+
const keys = (() => {
|
|
113
113
|
const shouldShuffle = randomKeyOrder && visible;
|
|
114
114
|
const numbers = shouldShuffle ? shuffle(NUMBER_KEYS) : NUMBER_KEYS;
|
|
115
115
|
const main = numbers.map(text => ({
|
|
@@ -160,7 +160,7 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
160
160
|
text: showDeleteKey ? undefined : ''
|
|
161
161
|
});
|
|
162
162
|
return main;
|
|
163
|
-
}
|
|
163
|
+
})();
|
|
164
164
|
const handleInput = useCallback((text, type) => {
|
|
165
165
|
if (type === 'delete') {
|
|
166
166
|
const currentValue = valueRef.current;
|
|
@@ -180,13 +180,13 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
180
180
|
onInput?.(text);
|
|
181
181
|
setMergedValue(`${currentValue}${text}`);
|
|
182
182
|
}, [closeSelf, onDelete, onInput, setMergedValue]);
|
|
183
|
-
const wrapperShadow =
|
|
183
|
+
const wrapperShadow = createPlatformShadow({
|
|
184
184
|
color: shadow.color,
|
|
185
185
|
opacity: shadow.opacity,
|
|
186
186
|
radius: shadow.radius,
|
|
187
187
|
offsetY: shadow.offsetY,
|
|
188
188
|
elevation: shadow.elevation
|
|
189
|
-
})
|
|
189
|
+
});
|
|
190
190
|
const keyGap = spacing.keyGap;
|
|
191
191
|
const renderKey = useCallback((key, index, isClose = false, fullWidth = false, customHeight) => {
|
|
192
192
|
const isPlaceholder = key.type === '' && !key.text;
|
|
@@ -281,10 +281,10 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
281
281
|
animationRef.current = null;
|
|
282
282
|
};
|
|
283
283
|
}, [animated, visible, effectiveDuration]);
|
|
284
|
-
const translateY =
|
|
284
|
+
const translateY = animated.interpolate({
|
|
285
285
|
inputRange: [0, 1],
|
|
286
286
|
outputRange: [contentHeight || 320, 0]
|
|
287
|
-
})
|
|
287
|
+
});
|
|
288
288
|
const handleLayout = useCallback(e => {
|
|
289
289
|
const {
|
|
290
290
|
height
|
|
@@ -293,7 +293,7 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
293
293
|
}, []);
|
|
294
294
|
const hasHeader = !isCustomTheme && (title || closeButtonText);
|
|
295
295
|
const doubleKeyHeight = sizing.keyHeight * 2 + keyGap;
|
|
296
|
-
const memo =
|
|
296
|
+
const memo = (() => {
|
|
297
297
|
const headerPaddingStyle = {
|
|
298
298
|
paddingHorizontal: spacing.titlePadding
|
|
299
299
|
};
|
|
@@ -374,7 +374,8 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
374
374
|
style: [styles.header, headerPaddingStyle]
|
|
375
375
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
376
376
|
style: [styles.title, styles.titleOverlay, {
|
|
377
|
-
color: colors.title
|
|
377
|
+
color: colors.title,
|
|
378
|
+
fontSize: sizing.titleFontSize
|
|
378
379
|
}],
|
|
379
380
|
numberOfLines: 1
|
|
380
381
|
}, title), resolvedCloseText ? /*#__PURE__*/React.createElement(Pressable, {
|
|
@@ -400,7 +401,7 @@ const NumberKeyboard = /*#__PURE__*/React.memo(props => {
|
|
|
400
401
|
bodyNode,
|
|
401
402
|
safeAreaNode
|
|
402
403
|
};
|
|
403
|
-
}
|
|
404
|
+
})();
|
|
404
405
|
if (!shouldRender && !visible) {
|
|
405
406
|
return null;
|
|
406
407
|
}
|
|
@@ -430,7 +431,6 @@ const styles = StyleSheet.create({
|
|
|
430
431
|
position: 'relative'
|
|
431
432
|
},
|
|
432
433
|
title: {
|
|
433
|
-
fontSize: 16,
|
|
434
434
|
fontWeight: '600'
|
|
435
435
|
},
|
|
436
436
|
titleOverlay: {
|
|
@@ -3,7 +3,8 @@ const createTokens = foundations => {
|
|
|
3
3
|
const {
|
|
4
4
|
palette,
|
|
5
5
|
spacing,
|
|
6
|
-
radii
|
|
6
|
+
radii,
|
|
7
|
+
fontSize
|
|
7
8
|
} = foundations;
|
|
8
9
|
const onPrimary = palette.primary.foreground ?? '#ffffff';
|
|
9
10
|
return {
|
|
@@ -28,7 +29,8 @@ const createTokens = foundations => {
|
|
|
28
29
|
sizing: {
|
|
29
30
|
keyHeight: 54,
|
|
30
31
|
closeHeight: 44,
|
|
31
|
-
fontSize: 28
|
|
32
|
+
fontSize: 28,
|
|
33
|
+
titleFontSize: fontSize.md
|
|
32
34
|
},
|
|
33
35
|
radii: {
|
|
34
36
|
key: radii.xs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useRef, useSyncExternalStore } from 'react';
|
|
2
2
|
import { overlayStackStore } from './OverlayStackStore';
|
|
3
3
|
const useOverlayEntries = () => useSyncExternalStore(overlayStackStore.subscribe, overlayStackStore.getSnapshot, overlayStackStore.getSnapshot);
|
|
4
4
|
export const useOverlayStack = ({
|
|
@@ -7,7 +7,11 @@ export const useOverlayStack = ({
|
|
|
7
7
|
}) => {
|
|
8
8
|
const entries = useOverlayEntries();
|
|
9
9
|
const entryRef = useRef(null);
|
|
10
|
-
const
|
|
10
|
+
const optionsRef = useRef(options);
|
|
11
|
+
if (optionsRef.current.onClose !== options.onClose || optionsRef.current.closeOnBack !== options.closeOnBack || optionsRef.current.lockScroll !== options.lockScroll || optionsRef.current.zIndex !== options.zIndex || optionsRef.current.type !== options.type || optionsRef.current.meta !== options.meta) {
|
|
12
|
+
optionsRef.current = options;
|
|
13
|
+
}
|
|
14
|
+
const stableOptions = optionsRef.current;
|
|
11
15
|
useEffect(() => {
|
|
12
16
|
if (!visible) {
|
|
13
17
|
if (entryRef.current) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useEffect
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import { Pressable, Text, View } from 'react-native';
|
|
4
4
|
import { usePaginationTokens } from './tokens';
|
|
5
5
|
import { useControllableValue } from '../../hooks';
|
|
@@ -39,7 +39,7 @@ const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
39
39
|
const showPageSizeNumber = Number.isFinite(showPageSize) ? Math.floor(showPageSize) : 0;
|
|
40
40
|
const count = pageCountNumber > 0 ? pageCountNumber : totalItemsNumber > 0 && itemsPerPageNumber > 0 ? Math.max(1, Math.ceil(totalItemsNumber / itemsPerPageNumber)) : 1;
|
|
41
41
|
const currentPage = clamp(page, 1, count);
|
|
42
|
-
const pages =
|
|
42
|
+
const pages = (() => {
|
|
43
43
|
const items = [];
|
|
44
44
|
if (mode !== 'multi') return items;
|
|
45
45
|
const limit = Math.max(1, showPageSizeNumber);
|
|
@@ -72,7 +72,7 @@ const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
return items;
|
|
75
|
-
}
|
|
75
|
+
})();
|
|
76
76
|
useEffect(() => {
|
|
77
77
|
if (page !== currentPage) {
|
|
78
78
|
setPage(currentPage);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, useEffect, useImperativeHandle,
|
|
2
|
+
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
3
3
|
import { Pressable, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
4
4
|
import { createComponentTokensHook } from '../../design-system';
|
|
5
5
|
import { useControllableValue } from '../../hooks';
|
|
@@ -7,7 +7,6 @@ import { parseNumberLike } from '../../utils/number';
|
|
|
7
7
|
import { isString, isText } from '../../utils/validate';
|
|
8
8
|
const HIDDEN_INPUT_PROPS = {
|
|
9
9
|
caretHidden: true,
|
|
10
|
-
underlineColorAndroid: 'transparent',
|
|
11
10
|
autoCorrect: false,
|
|
12
11
|
spellCheck: false,
|
|
13
12
|
importantForAutofill: 'no',
|
|
@@ -21,10 +20,12 @@ const createPasswordInputTokens = foundations => ({
|
|
|
21
20
|
muted: foundations.palette.default[500],
|
|
22
21
|
error: foundations.palette.danger[500],
|
|
23
22
|
cursor: foundations.palette.default[800],
|
|
24
|
-
background: '#ffffff'
|
|
23
|
+
background: '#ffffff',
|
|
24
|
+
transparent: 'transparent'
|
|
25
25
|
},
|
|
26
26
|
radii: {
|
|
27
|
-
wrapper: foundations.radii.sm
|
|
27
|
+
wrapper: foundations.radii.sm,
|
|
28
|
+
cellGutter: foundations.radii.none
|
|
28
29
|
},
|
|
29
30
|
sizing: {
|
|
30
31
|
cellHeight: 50,
|
|
@@ -42,10 +43,12 @@ const createPasswordInputTokens = foundations => ({
|
|
|
42
43
|
infoWeight: foundations.typography.weight.regular
|
|
43
44
|
},
|
|
44
45
|
opacity: {
|
|
45
|
-
disabled: 0.6
|
|
46
|
+
disabled: 0.6,
|
|
47
|
+
hidden: 0
|
|
46
48
|
},
|
|
47
49
|
spacing: {
|
|
48
|
-
infoMarginTop: foundations.spacing.sm
|
|
50
|
+
infoMarginTop: foundations.spacing.sm,
|
|
51
|
+
none: foundations.spacing.none
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
54
|
const usePasswordInputTokens = createComponentTokensHook('passwordInput', createPasswordInputTokens);
|
|
@@ -91,8 +94,8 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
91
94
|
const [cursorVisible, setCursorVisible] = useState(true);
|
|
92
95
|
const blinkTimer = useRef(null);
|
|
93
96
|
const [focused, setFocused] = useState(autoFocus);
|
|
94
|
-
const keyboardType =
|
|
95
|
-
const inputMode =
|
|
97
|
+
const keyboardType = type === 'number' ? 'number-pad' : 'default';
|
|
98
|
+
const inputMode = type === 'number' ? 'numeric' : 'text';
|
|
96
99
|
const [code = '', setCode] = useControllableValue(props, {
|
|
97
100
|
defaultValue: ''
|
|
98
101
|
});
|
|
@@ -106,7 +109,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
106
109
|
}
|
|
107
110
|
return next;
|
|
108
111
|
}, [lengthSafe, type]);
|
|
109
|
-
const normalizedCode =
|
|
112
|
+
const normalizedCode = normalizeValue(code);
|
|
110
113
|
const updateValue = useCallback(nextValue => {
|
|
111
114
|
const normalized = normalizeValue(nextValue);
|
|
112
115
|
if (normalized === normalizedCode) return;
|
|
@@ -184,7 +187,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
184
187
|
}
|
|
185
188
|
};
|
|
186
189
|
}, [disabled, focused, showCursor]);
|
|
187
|
-
const cells =
|
|
190
|
+
const cells = Array.from({
|
|
188
191
|
length: lengthSafe
|
|
189
192
|
}, (_, index) => {
|
|
190
193
|
const char = normalizedCode?.[index];
|
|
@@ -196,30 +199,35 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
196
199
|
isFilled,
|
|
197
200
|
showBlink
|
|
198
201
|
};
|
|
199
|
-
})
|
|
200
|
-
const gutterValue =
|
|
202
|
+
});
|
|
203
|
+
const gutterValue = Math.max(0, parseNumberLike(gutter, 0) ?? 0);
|
|
201
204
|
const hasGutter = gutterValue > 0;
|
|
202
205
|
const tip = errorInfo ?? info;
|
|
203
206
|
const tipColor = errorInfo ? colors.error : colors.muted;
|
|
204
|
-
const backgroundColor = hasGutter ?
|
|
205
|
-
const
|
|
207
|
+
const backgroundColor = hasGutter ? colors.transparent : colors.background;
|
|
208
|
+
const hiddenInputProps = {
|
|
209
|
+
...HIDDEN_INPUT_PROPS,
|
|
210
|
+
underlineColorAndroid: colors.transparent
|
|
211
|
+
};
|
|
212
|
+
const cellTextBase = {
|
|
206
213
|
color: colors.text,
|
|
207
214
|
fontSize: sizing.cellTextSize,
|
|
208
215
|
fontWeight: typography.cellTextWeight,
|
|
209
216
|
fontFamily: typography.fontFamily
|
|
210
|
-
}
|
|
211
|
-
const wrapperStyle =
|
|
217
|
+
};
|
|
218
|
+
const wrapperStyle = [styles.wrapper, {
|
|
212
219
|
backgroundColor,
|
|
213
220
|
borderRadius: radii.wrapper,
|
|
221
|
+
paddingHorizontal: spacing.none,
|
|
214
222
|
opacity: disabled ? opacity.disabled : 1
|
|
215
223
|
}, !hasGutter && {
|
|
216
224
|
borderWidth: StyleSheet.hairlineWidth,
|
|
217
225
|
borderColor: colors.border
|
|
218
|
-
}]
|
|
219
|
-
const securityStyle =
|
|
226
|
+
}];
|
|
227
|
+
const securityStyle = [styles.security, {
|
|
220
228
|
borderRadius: hasGutter ? 0 : radii.wrapper,
|
|
221
229
|
backgroundColor
|
|
222
|
-
}]
|
|
230
|
+
}];
|
|
223
231
|
return /*#__PURE__*/React.createElement(View, {
|
|
224
232
|
style: style
|
|
225
233
|
}, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
|
|
@@ -240,7 +248,8 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
240
248
|
}, cellStyle, item.isFilled && cellFilledStyle];
|
|
241
249
|
if (hasGutter) {
|
|
242
250
|
baseCell.push(styles.cellGutter, {
|
|
243
|
-
borderColor: colors.border
|
|
251
|
+
borderColor: colors.border,
|
|
252
|
+
borderRadius: radii.cellGutter
|
|
244
253
|
}, index > 0 && {
|
|
245
254
|
marginLeft: gutterValue
|
|
246
255
|
});
|
|
@@ -285,8 +294,10 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
285
294
|
maxLength: lengthSafe,
|
|
286
295
|
autoFocus: false,
|
|
287
296
|
secureTextEntry: mask
|
|
288
|
-
},
|
|
289
|
-
style: styles.hiddenInput,
|
|
297
|
+
}, hiddenInputProps, {
|
|
298
|
+
style: [styles.hiddenInput, {
|
|
299
|
+
opacity: opacity.hidden
|
|
300
|
+
}],
|
|
290
301
|
onChangeText: handleChangeText,
|
|
291
302
|
onFocus: handleFocus,
|
|
292
303
|
onBlur: handleBlur,
|
|
@@ -304,8 +315,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
304
315
|
export default PasswordInput;
|
|
305
316
|
const styles = StyleSheet.create({
|
|
306
317
|
wrapper: {
|
|
307
|
-
alignSelf: 'stretch'
|
|
308
|
-
paddingHorizontal: 0
|
|
318
|
+
alignSelf: 'stretch'
|
|
309
319
|
},
|
|
310
320
|
security: {
|
|
311
321
|
flexDirection: 'row',
|
|
@@ -319,16 +329,14 @@ const styles = StyleSheet.create({
|
|
|
319
329
|
alignItems: 'center'
|
|
320
330
|
},
|
|
321
331
|
cellGutter: {
|
|
322
|
-
borderWidth: StyleSheet.hairlineWidth
|
|
323
|
-
borderRadius: 0
|
|
332
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
324
333
|
},
|
|
325
334
|
cursor: {
|
|
326
335
|
position: 'absolute',
|
|
327
336
|
left: '50%'
|
|
328
337
|
},
|
|
329
338
|
hiddenInput: {
|
|
330
|
-
...StyleSheet.absoluteFillObject
|
|
331
|
-
opacity: 0
|
|
339
|
+
...StyleSheet.absoluteFillObject
|
|
332
340
|
},
|
|
333
341
|
infoWrapper: {
|
|
334
342
|
alignItems: 'center'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, useEffect,
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { Pressable, Text, View, Platform, StyleSheet } from 'react-native';
|
|
4
4
|
import Loading from '../loading';
|
|
5
5
|
import { withAlpha } from '../../utils/color';
|
|
@@ -15,7 +15,7 @@ export function usePickerValue({
|
|
|
15
15
|
onChange,
|
|
16
16
|
onConfirm
|
|
17
17
|
}) {
|
|
18
|
-
const preparedColumns =
|
|
18
|
+
const preparedColumns = prepareColumns(columns);
|
|
19
19
|
const isControlled = valueProp !== undefined;
|
|
20
20
|
const [innerValue, setInnerValue] = useState(() => {
|
|
21
21
|
const initial = toArrayValue(valueProp ?? defaultValue);
|
|
@@ -33,7 +33,7 @@ export function usePickerValue({
|
|
|
33
33
|
commitValue(next);
|
|
34
34
|
}
|
|
35
35
|
}, [commitValue, isControlled, valueProp]);
|
|
36
|
-
const normalized =
|
|
36
|
+
const normalized = normalizePicker(preparedColumns, innerValue);
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (isControlled) return;
|
|
39
39
|
if (!shallowEqualArray(innerValue, normalized.values)) {
|
|
@@ -149,11 +149,11 @@ const PickerColumn = /*#__PURE__*/React.memo(props => {
|
|
|
149
149
|
swipeDuration
|
|
150
150
|
} = props;
|
|
151
151
|
const restVisible = Math.max(1, Math.floor((visibleItemCount - 1) / 2));
|
|
152
|
-
const selectedIndex =
|
|
152
|
+
const selectedIndex = (() => {
|
|
153
153
|
if (!options.length) return 0;
|
|
154
154
|
const idx = options.findIndex(option => option.value === value);
|
|
155
155
|
return findEnabledIndex(options, idx >= 0 ? idx : 0);
|
|
156
|
-
}
|
|
156
|
+
})();
|
|
157
157
|
const handleChange = useCallback(index => {
|
|
158
158
|
const target = findEnabledIndex(options, index);
|
|
159
159
|
const option = options[target];
|
|
@@ -245,7 +245,6 @@ const Picker = props => {
|
|
|
245
245
|
emitConfirmOnAutoSelect = true,
|
|
246
246
|
maskColor,
|
|
247
247
|
maskType = tokens.defaults.maskType,
|
|
248
|
-
interactionMode = 'auto',
|
|
249
248
|
onChange,
|
|
250
249
|
onConfirm,
|
|
251
250
|
onCancel,
|
|
@@ -349,7 +348,8 @@ const Picker = props => {
|
|
|
349
348
|
}) : null;
|
|
350
349
|
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
351
350
|
style: [styles.container, {
|
|
352
|
-
backgroundColor: tokens.colors.background
|
|
351
|
+
backgroundColor: tokens.colors.background,
|
|
352
|
+
borderRadius: tokens.radius.container
|
|
353
353
|
}, style],
|
|
354
354
|
testID: testID
|
|
355
355
|
}), toolbarPosition === 'top' && toolbar, /*#__PURE__*/React.createElement(View, {
|
|
@@ -377,13 +377,13 @@ const Picker = props => {
|
|
|
377
377
|
color: effectiveMaskColor,
|
|
378
378
|
maskType: maskType
|
|
379
379
|
}))), loading && /*#__PURE__*/React.createElement(View, {
|
|
380
|
-
style: styles.loading
|
|
380
|
+
style: [styles.loading, {
|
|
381
|
+
backgroundColor: tokens.colors.loadingMask
|
|
382
|
+
}]
|
|
381
383
|
}, /*#__PURE__*/React.createElement(Loading, null))), toolbarPosition === 'bottom' && toolbar);
|
|
382
384
|
};
|
|
383
385
|
const styles = StyleSheet.create({
|
|
384
|
-
container: {
|
|
385
|
-
borderRadius: 4
|
|
386
|
-
},
|
|
386
|
+
container: {},
|
|
387
387
|
body: {
|
|
388
388
|
position: 'relative',
|
|
389
389
|
overflow: 'hidden'
|
|
@@ -437,8 +437,7 @@ const styles = StyleSheet.create({
|
|
|
437
437
|
right: 0,
|
|
438
438
|
bottom: 0,
|
|
439
439
|
alignItems: 'center',
|
|
440
|
-
justifyContent: 'center'
|
|
441
|
-
backgroundColor: 'rgba(255,255,255,0.65)'
|
|
440
|
+
justifyContent: 'center'
|
|
442
441
|
}
|
|
443
442
|
});
|
|
444
443
|
Picker.displayName = 'Picker';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, useEffect,
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { FlatList, Platform, View, StyleSheet, PanResponder } from 'react-native';
|
|
4
4
|
import { clamp } from '../../utils';
|
|
5
5
|
import { findEnabledIndex } from './utils';
|
|
@@ -258,8 +258,8 @@ const WheelPickerInner = ({
|
|
|
258
258
|
}]
|
|
259
259
|
}, content);
|
|
260
260
|
}, [itemHeight, renderItem]);
|
|
261
|
-
const webIndex =
|
|
262
|
-
const webRender =
|
|
261
|
+
const webIndex = clamp(Math.round(-webOffset / itemHeight), 0, maxIndex);
|
|
262
|
+
const webRender = (() => {
|
|
263
263
|
if (!isWeb || total <= 0) {
|
|
264
264
|
return {
|
|
265
265
|
items: null,
|
|
@@ -303,24 +303,24 @@ const WheelPickerInner = ({
|
|
|
303
303
|
}
|
|
304
304
|
})
|
|
305
305
|
};
|
|
306
|
-
}
|
|
307
|
-
const webTransform =
|
|
306
|
+
})();
|
|
307
|
+
const webTransform = {
|
|
308
308
|
transform: [{
|
|
309
309
|
translateY: webOffset
|
|
310
310
|
}]
|
|
311
|
-
}
|
|
312
|
-
const webTransitionStyle =
|
|
311
|
+
};
|
|
312
|
+
const webTransitionStyle = webTransition ? {
|
|
313
313
|
transitionProperty: 'transform',
|
|
314
314
|
transitionDuration: `${webTransition}ms`,
|
|
315
315
|
transitionTimingFunction: 'cubic-bezier(0.23, 1, 0.68, 1)',
|
|
316
316
|
willChange: 'transform'
|
|
317
|
-
} : undefined
|
|
317
|
+
} : undefined;
|
|
318
318
|
const handleWebTransitionEnd = useCallback(event => {
|
|
319
319
|
const propertyName = event.nativeEvent?.propertyName ?? event.propertyName;
|
|
320
320
|
if (propertyName && propertyName !== 'transform' && propertyName !== 'webkitTransform') return;
|
|
321
321
|
finalizePendingChange();
|
|
322
322
|
}, [finalizePendingChange]);
|
|
323
|
-
const panResponder =
|
|
323
|
+
const panResponder = PanResponder.create({
|
|
324
324
|
onStartShouldSetPanResponder: () => !readOnly,
|
|
325
325
|
onMoveShouldSetPanResponder: () => !readOnly,
|
|
326
326
|
onPanResponderGrant: () => {
|
|
@@ -365,7 +365,7 @@ const WheelPickerInner = ({
|
|
|
365
365
|
notifyInteractEnd();
|
|
366
366
|
setWebTransition(0);
|
|
367
367
|
}
|
|
368
|
-
})
|
|
368
|
+
});
|
|
369
369
|
if (isWeb) {
|
|
370
370
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
371
371
|
style: [styles.column, {
|
|
@@ -24,7 +24,8 @@ const createPickerTokens = foundations => {
|
|
|
24
24
|
textDisabled: palette.default[400],
|
|
25
25
|
confirm: palette.primary[600],
|
|
26
26
|
cancel: palette.default[600],
|
|
27
|
-
mask: '#ffffff'
|
|
27
|
+
mask: '#ffffff',
|
|
28
|
+
loadingMask: 'rgba(255,255,255,0.65)'
|
|
28
29
|
},
|
|
29
30
|
spacing: {
|
|
30
31
|
toolbarHeight: 44,
|
|
@@ -38,7 +39,8 @@ const createPickerTokens = foundations => {
|
|
|
38
39
|
toolbarWeight: typography.weight.medium
|
|
39
40
|
},
|
|
40
41
|
radius: {
|
|
41
|
-
toolbar: radii.none
|
|
42
|
+
toolbar: radii.none,
|
|
43
|
+
container: radii.xs
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
46
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, useEffect,
|
|
3
|
-
import { Animated,
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Animated, Easing, Pressable, StyleSheet, Text, View, useWindowDimensions } from 'react-native';
|
|
4
4
|
import { SafeAreaView } from '../safe-area-view';
|
|
5
5
|
import { addPopStateListener, nativeDriverEnabled } from '../../platform';
|
|
6
6
|
import { createPlatformShadow } from '../../utils/createPlatformShadow';
|
|
@@ -153,70 +153,59 @@ export const Popup = props => {
|
|
|
153
153
|
const shouldTranslate = placement !== 'center';
|
|
154
154
|
const safeAreaInsetBottom = safeAreaInsetBottomProp ?? false;
|
|
155
155
|
const tokens = usePopupTokens(tokensOverride);
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
const shadow = createPlatformShadow({
|
|
157
|
+
color: tokens.shadow.color,
|
|
158
|
+
opacity: tokens.shadow.opacity,
|
|
159
|
+
radius: tokens.shadow.radius,
|
|
160
|
+
offsetY: tokens.shadow.offsetY,
|
|
161
|
+
elevation: tokens.shadow.elevation
|
|
162
|
+
});
|
|
163
|
+
const dynamicStyles = {
|
|
164
|
+
popup: {
|
|
165
165
|
backgroundColor: tokens.colors.background,
|
|
166
166
|
padding: tokens.spacing.padding,
|
|
167
167
|
...shadow
|
|
168
|
-
}
|
|
169
|
-
|
|
168
|
+
},
|
|
169
|
+
title: {
|
|
170
170
|
color: tokens.colors.title,
|
|
171
171
|
fontSize: tokens.typography.titleSize,
|
|
172
172
|
fontWeight: tokens.typography.titleWeight,
|
|
173
173
|
marginHorizontal: tokens.spacing.descriptionHorizontal,
|
|
174
174
|
textAlign: 'center'
|
|
175
|
-
}
|
|
176
|
-
|
|
175
|
+
},
|
|
176
|
+
titleWrapper: {
|
|
177
177
|
marginTop: tokens.spacing.titleTop,
|
|
178
178
|
marginBottom: tokens.spacing.titleBottom,
|
|
179
179
|
marginHorizontal: tokens.spacing.descriptionHorizontal,
|
|
180
180
|
alignItems: 'center'
|
|
181
|
-
}
|
|
182
|
-
|
|
181
|
+
},
|
|
182
|
+
description: {
|
|
183
183
|
color: tokens.colors.description,
|
|
184
184
|
fontSize: tokens.typography.descriptionSize,
|
|
185
185
|
lineHeight: tokens.typography.descriptionLineHeight
|
|
186
|
-
}
|
|
187
|
-
|
|
186
|
+
},
|
|
187
|
+
descriptionWrapper: {
|
|
188
188
|
marginHorizontal: tokens.spacing.descriptionHorizontal,
|
|
189
189
|
marginBottom: tokens.spacing.descriptionBottom
|
|
190
|
-
}
|
|
191
|
-
|
|
190
|
+
},
|
|
191
|
+
closeIconBase: {
|
|
192
192
|
minWidth: tokens.spacing.closeIconSize,
|
|
193
193
|
minHeight: tokens.spacing.closeIconSize,
|
|
194
|
-
padding:
|
|
195
|
-
}
|
|
196
|
-
|
|
194
|
+
padding: tokens.spacing.closeIconPadding
|
|
195
|
+
},
|
|
196
|
+
closeIconDefault: {
|
|
197
197
|
width: tokens.spacing.closeIconSize,
|
|
198
198
|
height: tokens.spacing.closeIconSize
|
|
199
|
-
}
|
|
200
|
-
|
|
199
|
+
},
|
|
200
|
+
popupSide: {
|
|
201
201
|
width: tokens.layout.sideWidth,
|
|
202
202
|
maxWidth: tokens.layout.maxWidth
|
|
203
|
-
}
|
|
204
|
-
|
|
203
|
+
},
|
|
204
|
+
popupCenter: {
|
|
205
205
|
minWidth: tokens.layout.minWidth,
|
|
206
206
|
maxWidth: tokens.layout.centerMaxWidth
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
popup,
|
|
210
|
-
title,
|
|
211
|
-
titleWrapper,
|
|
212
|
-
description,
|
|
213
|
-
descriptionWrapper,
|
|
214
|
-
closeIconBase,
|
|
215
|
-
closeIconDefault,
|
|
216
|
-
popupSide,
|
|
217
|
-
popupCenter
|
|
218
|
-
};
|
|
219
|
-
}, [tokens]);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
220
209
|
const [mounted, setMounted] = useState(visible);
|
|
221
210
|
const [interactionVisible, setInteractionVisible] = useState(visible);
|
|
222
211
|
const isOpen = visible || interactionVisible;
|
|
@@ -335,22 +324,18 @@ export const Popup = props => {
|
|
|
335
324
|
onStartShouldSetResponder: stopPropagationResponder
|
|
336
325
|
} : overlayRestProps;
|
|
337
326
|
const config = placementConfig[placement];
|
|
338
|
-
const radiusStyle =
|
|
327
|
+
const radiusStyle = buildRadius(round, placement, tokens.radius.round);
|
|
339
328
|
const {
|
|
340
329
|
animated: overlayOpacity
|
|
341
330
|
} = usePresenceAnimation(visible, {
|
|
342
331
|
duration
|
|
343
332
|
});
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
return 0;
|
|
352
|
-
}, [placement]);
|
|
353
|
-
const translateTransform = useMemo(() => {
|
|
333
|
+
const {
|
|
334
|
+
width: windowWidth,
|
|
335
|
+
height: windowHeight
|
|
336
|
+
} = useWindowDimensions();
|
|
337
|
+
const translateDistance = placement === 'left' || placement === 'right' ? windowWidth : placement === 'top' || placement === 'bottom' ? windowHeight : 0;
|
|
338
|
+
const translateTransform = (() => {
|
|
354
339
|
if (!shouldTranslate) return null;
|
|
355
340
|
const outputRange = [translateDistance * direction, 0];
|
|
356
341
|
return config.axis === 'y' ? {
|
|
@@ -364,9 +349,9 @@ export const Popup = props => {
|
|
|
364
349
|
outputRange
|
|
365
350
|
})
|
|
366
351
|
};
|
|
367
|
-
}
|
|
368
|
-
const baseTransform =
|
|
369
|
-
const animatedContentStyle =
|
|
352
|
+
})();
|
|
353
|
+
const baseTransform = translateTransform ? [translateTransform] : [];
|
|
354
|
+
const animatedContentStyle = (() => {
|
|
370
355
|
const extraTransform = contentAnimationStyle?.transform;
|
|
371
356
|
const transform = Array.isArray(extraTransform) ? [...baseTransform, ...extraTransform] : baseTransform;
|
|
372
357
|
const baseStyle = {
|
|
@@ -386,7 +371,7 @@ export const Popup = props => {
|
|
|
386
371
|
};
|
|
387
372
|
}
|
|
388
373
|
return baseStyle;
|
|
389
|
-
}
|
|
374
|
+
})();
|
|
390
375
|
const handleContentLayout = useCallback(event => {
|
|
391
376
|
overlayOnLayout?.(event);
|
|
392
377
|
}, [overlayOnLayout]);
|
|
@@ -27,7 +27,8 @@ export const createPopupTokens = foundations => {
|
|
|
27
27
|
descriptionBottom: spacing.md,
|
|
28
28
|
closeIconTop: spacing.md,
|
|
29
29
|
closeIconRight: spacing.md,
|
|
30
|
-
closeIconSize: 36
|
|
30
|
+
closeIconSize: 36,
|
|
31
|
+
closeIconPadding: spacing.ssm
|
|
31
32
|
},
|
|
32
33
|
typography: {
|
|
33
34
|
titleSize: fontSize.md,
|