@cdx-ui/components 0.0.1-alpha.2 → 0.0.1-alpha.21
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/README.md +2 -2
- package/lib/commonjs/components/Avatar/index.js +156 -0
- package/lib/commonjs/components/Avatar/index.js.map +1 -0
- package/lib/commonjs/components/Avatar/styles.js +80 -0
- package/lib/commonjs/components/Avatar/styles.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/index.js +248 -0
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/styles.js +61 -0
- package/lib/commonjs/components/BottomSheet/styles.js.map +1 -0
- package/lib/commonjs/components/Box/Box.js +1 -0
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +28 -13
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +323 -139
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Card/index.js +104 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Card/styles.js +28 -0
- package/lib/commonjs/components/Card/styles.js.map +1 -0
- package/lib/commonjs/components/Checkbox/index.js +180 -0
- package/lib/commonjs/components/Checkbox/index.js.map +1 -0
- package/lib/commonjs/components/Checkbox/styles.js +68 -0
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -0
- package/lib/commonjs/components/Chip/index.js +103 -0
- package/lib/commonjs/components/Chip/index.js.map +1 -0
- package/lib/commonjs/components/Chip/styles.js +50 -0
- package/lib/commonjs/components/Chip/styles.js.map +1 -0
- package/lib/commonjs/components/Heading/index.js +35 -0
- package/lib/commonjs/components/Heading/index.js.map +1 -0
- package/lib/commonjs/components/Heading/styles.js +24 -0
- package/lib/commonjs/components/Heading/styles.js.map +1 -0
- package/lib/commonjs/components/Icon/index.js +61 -0
- package/lib/commonjs/components/Icon/index.js.map +1 -0
- package/lib/commonjs/components/Input/index.js +10 -16
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +16 -30
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +94 -0
- package/lib/commonjs/components/Link/index.js.map +1 -0
- package/lib/commonjs/components/Link/styles.js +16 -0
- package/lib/commonjs/components/Link/styles.js.map +1 -0
- package/lib/commonjs/components/Select/index.js +11 -12
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +29 -53
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +8 -21
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +8 -21
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/Stack/styles.js +39 -0
- package/lib/commonjs/components/Stack/styles.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js +46 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.web.js +56 -0
- package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -0
- package/lib/commonjs/components/Switch/index.js +13 -0
- package/lib/commonjs/components/Switch/index.js.map +1 -0
- package/lib/commonjs/components/Switch/styles.js +128 -0
- package/lib/commonjs/components/Switch/styles.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +18 -9
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +24 -0
- package/lib/commonjs/components/Text/styles.js.map +1 -0
- package/lib/commonjs/components/VirtualizedList/index.js +19 -0
- package/lib/commonjs/components/VirtualizedList/index.js.map +1 -0
- package/lib/commonjs/components/index.js +120 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/metro/withCdxMetroConfig.js +24 -0
- package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/commonjs/styles/index.js +17 -0
- package/lib/commonjs/styles/index.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +123 -0
- package/lib/commonjs/styles/primitives.js.map +1 -0
- package/lib/module/components/Avatar/index.js +152 -0
- package/lib/module/components/Avatar/index.js.map +1 -0
- package/lib/module/components/Avatar/styles.js +77 -0
- package/lib/module/components/Avatar/styles.js.map +1 -0
- package/lib/module/components/BottomSheet/index.js +242 -0
- package/lib/module/components/BottomSheet/index.js.map +1 -0
- package/lib/module/components/BottomSheet/styles.js +58 -0
- package/lib/module/components/BottomSheet/styles.js.map +1 -0
- package/lib/module/components/Box/Box.js +1 -0
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Button/index.js +29 -14
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +322 -138
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Card/index.js +100 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Card/styles.js +25 -0
- package/lib/module/components/Card/styles.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +176 -0
- package/lib/module/components/Checkbox/index.js.map +1 -0
- package/lib/module/components/Checkbox/styles.js +64 -0
- package/lib/module/components/Checkbox/styles.js.map +1 -0
- package/lib/module/components/Chip/index.js +99 -0
- package/lib/module/components/Chip/index.js.map +1 -0
- package/lib/module/components/Chip/styles.js +46 -0
- package/lib/module/components/Chip/styles.js.map +1 -0
- package/lib/module/components/Heading/index.js +31 -0
- package/lib/module/components/Heading/index.js.map +1 -0
- package/lib/module/components/Heading/styles.js +20 -0
- package/lib/module/components/Heading/styles.js.map +1 -0
- package/lib/module/components/Icon/index.js +57 -0
- package/lib/module/components/Icon/index.js.map +1 -0
- package/lib/module/components/Input/index.js +10 -16
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Input/styles.js +16 -30
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/index.js +85 -0
- package/lib/module/components/Link/index.js.map +1 -0
- package/lib/module/components/Link/styles.js +12 -0
- package/lib/module/components/Link/styles.js.map +1 -0
- package/lib/module/components/Select/index.js +12 -13
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +29 -53
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +8 -21
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +8 -21
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/Stack/styles.js +35 -0
- package/lib/module/components/Stack/styles.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.js +42 -0
- package/lib/module/components/Switch/BaseSwitch.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.web.js +52 -0
- package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -0
- package/lib/module/components/Switch/index.js +9 -0
- package/lib/module/components/Switch/index.js.map +1 -0
- package/lib/module/components/Switch/styles.js +125 -0
- package/lib/module/components/Switch/styles.js.map +1 -0
- package/lib/module/components/Text/index.js +19 -1
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Text/styles.js +20 -0
- package/lib/module/components/Text/styles.js.map +1 -0
- package/lib/module/components/VirtualizedList/index.js +15 -0
- package/lib/module/components/VirtualizedList/index.js.map +1 -0
- package/lib/module/components/index.js +10 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/metro/withCdxMetroConfig.js +20 -0
- package/lib/module/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/module/styles/index.js +4 -0
- package/lib/module/styles/index.js.map +1 -0
- package/lib/module/styles/primitives.js +119 -0
- package/lib/module/styles/primitives.js.map +1 -0
- package/lib/typescript/components/Avatar/index.d.ts +40 -0
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/styles.d.ts +16 -0
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/index.d.ts +61 -0
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts +16 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -0
- package/lib/typescript/components/Box/Box.d.ts +1 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +6 -3
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +14 -8
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +30 -0
- package/lib/typescript/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/components/Card/styles.d.ts +6 -0
- package/lib/typescript/components/Card/styles.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/index.d.ts +46 -0
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/styles.d.ts +18 -0
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -0
- package/lib/typescript/components/Chip/index.d.ts +27 -0
- package/lib/typescript/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/components/Chip/styles.d.ts +12 -0
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -0
- package/lib/typescript/components/Heading/index.d.ts +10 -0
- package/lib/typescript/components/Heading/index.d.ts.map +1 -0
- package/lib/typescript/components/Heading/styles.d.ts +6 -0
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -0
- package/lib/typescript/components/Icon/index.d.ts +27 -0
- package/lib/typescript/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/components/Input/index.d.ts +6 -4
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts +5 -7
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +26 -0
- package/lib/typescript/components/Link/index.d.ts.map +1 -0
- package/lib/typescript/components/Link/styles.d.ts +4 -0
- package/lib/typescript/components/Link/styles.d.ts.map +1 -0
- package/lib/typescript/components/Select/index.d.ts +6 -3
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts +6 -8
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/HStack.d.ts +1 -12
- package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/VStack.d.ts +1 -12
- package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/styles.d.ts +10 -0
- package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts +9 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +15 -0
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -0
- package/lib/typescript/components/Switch/index.d.ts +8 -0
- package/lib/typescript/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/components/Switch/styles.d.ts +26 -0
- package/lib/typescript/components/Switch/styles.d.ts.map +1 -0
- package/lib/typescript/components/Text/index.d.ts +9 -1
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts +6 -0
- package/lib/typescript/components/Text/styles.d.ts.map +1 -0
- package/lib/typescript/components/VirtualizedList/index.d.ts +8 -0
- package/lib/typescript/components/VirtualizedList/index.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +10 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/metro/withCdxMetroConfig.d.ts +19 -0
- package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -0
- package/lib/typescript/styles/index.d.ts +2 -0
- package/lib/typescript/styles/index.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +85 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -0
- package/package.json +22 -13
- package/src/components/Avatar/index.tsx +174 -0
- package/src/components/Avatar/styles.ts +83 -0
- package/src/components/BottomSheet/index.tsx +316 -0
- package/src/components/BottomSheet/styles.ts +79 -0
- package/src/components/Box/Box.tsx +1 -0
- package/src/components/Button/index.tsx +23 -15
- package/src/components/Button/styles.ts +353 -144
- package/src/components/Card/index.tsx +115 -0
- package/src/components/Card/styles.ts +41 -0
- package/src/components/Checkbox/index.tsx +209 -0
- package/src/components/Checkbox/styles.ts +103 -0
- package/src/components/Chip/index.tsx +91 -0
- package/src/components/Chip/styles.ts +51 -0
- package/src/components/Heading/index.tsx +36 -0
- package/src/components/Heading/styles.tsx +26 -0
- package/src/components/Icon/index.tsx +54 -0
- package/src/components/Input/index.tsx +9 -20
- package/src/components/Input/styles.ts +42 -37
- package/src/components/Link/index.tsx +83 -0
- package/src/components/Link/styles.ts +20 -0
- package/src/components/Select/index.tsx +12 -11
- package/src/components/Select/styles.ts +63 -74
- package/src/components/Stack/HStack.tsx +8 -19
- package/src/components/Stack/VStack.tsx +8 -23
- package/src/components/Stack/styles.ts +37 -0
- package/src/components/Switch/BaseSwitch.tsx +38 -0
- package/src/components/Switch/BaseSwitch.web.tsx +69 -0
- package/src/components/Switch/index.tsx +13 -0
- package/src/components/Switch/styles.ts +120 -0
- package/src/components/Text/index.tsx +16 -0
- package/src/components/Text/styles.tsx +26 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +10 -0
- package/src/metro/withCdxMetroConfig.ts +29 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/primitives.ts +107 -0
- package/lib/commonjs/components/Text/Text.js +0 -30
- package/lib/commonjs/components/Text/Text.js.map +0 -1
- package/lib/module/components/Text/Text.js +0 -26
- package/lib/module/components/Text/Text.js.map +0 -1
- package/lib/typescript/components/Text/Text.d.ts +0 -11
- package/lib/typescript/components/Text/Text.d.ts.map +0 -1
- package/src/components/Text/Text.tsx +0 -58
- package/src/components/Text/index.ts +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Styled, theme-aware UI components for the Candescent Design System.
|
|
4
4
|
|
|
5
|
-
Built on top of [`@cdx-ui/primitives`](../primitives/) and [`@cdx-ui/
|
|
5
|
+
Built on top of [`@cdx-ui/primitives`](../primitives/) and [`@cdx-ui/styles`](../styles/), styled via [Uniwind](https://uniwind.dev) + [CVA](https://cva.style).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ import { Button } from '@cdx-ui/components';
|
|
|
24
24
|
|
|
25
25
|
export function Example() {
|
|
26
26
|
return (
|
|
27
|
-
<Button variant="
|
|
27
|
+
<Button variant="strong" color="action" size="default" onPress={() => console.log('pressed')}>
|
|
28
28
|
<Button.Label>Get Started</Button.Label>
|
|
29
29
|
</Button>
|
|
30
30
|
);
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Avatar = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
10
|
+
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _Icon = require("../Icon");
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const SCOPE = 'AVATAR';
|
|
15
|
+
const Root = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
16
|
+
const useAvatarStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
17
|
+
const AvatarPrimitive = (0, _primitives.createAvatar)({
|
|
18
|
+
Root,
|
|
19
|
+
Image: _reactNative.Image,
|
|
20
|
+
Text: _reactNative.Text,
|
|
21
|
+
Icon: _Icon.Icon,
|
|
22
|
+
Badge: _reactNative.View
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// AVATAR ROOT
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
const AvatarRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
30
|
+
size = 'lg',
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
style,
|
|
34
|
+
...props
|
|
35
|
+
}, ref) => {
|
|
36
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarRootVariants)({
|
|
37
|
+
size
|
|
38
|
+
}), className);
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: computedClassName,
|
|
42
|
+
style: style,
|
|
43
|
+
context: {
|
|
44
|
+
size
|
|
45
|
+
},
|
|
46
|
+
...props,
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
AvatarRoot.displayName = 'Avatar';
|
|
51
|
+
|
|
52
|
+
// =============================================================================
|
|
53
|
+
// AVATAR IMAGE
|
|
54
|
+
// =============================================================================
|
|
55
|
+
|
|
56
|
+
const AvatarImage = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
57
|
+
className,
|
|
58
|
+
style,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarImageVariants)(), className);
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Image, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
className: computedClassName,
|
|
65
|
+
style: style,
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
70
|
+
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// AVATAR TEXT
|
|
73
|
+
// =============================================================================
|
|
74
|
+
|
|
75
|
+
const AvatarText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
76
|
+
className,
|
|
77
|
+
children,
|
|
78
|
+
style,
|
|
79
|
+
...props
|
|
80
|
+
}, ref) => {
|
|
81
|
+
const {
|
|
82
|
+
size
|
|
83
|
+
} = useAvatarStyleContext();
|
|
84
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarTextVariants)({
|
|
85
|
+
size
|
|
86
|
+
}), className);
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Text, {
|
|
88
|
+
ref: ref,
|
|
89
|
+
className: computedClassName,
|
|
90
|
+
style: style,
|
|
91
|
+
...props,
|
|
92
|
+
children: children
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
AvatarText.displayName = 'Avatar.Text';
|
|
96
|
+
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// AVATAR ICON
|
|
99
|
+
// =============================================================================
|
|
100
|
+
|
|
101
|
+
const AvatarIcon = ({
|
|
102
|
+
className,
|
|
103
|
+
style,
|
|
104
|
+
...props
|
|
105
|
+
}) => {
|
|
106
|
+
const {
|
|
107
|
+
size
|
|
108
|
+
} = useAvatarStyleContext();
|
|
109
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarIconVariants)({
|
|
110
|
+
size
|
|
111
|
+
}), className);
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Icon, {
|
|
113
|
+
className: computedClassName,
|
|
114
|
+
style: style,
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
AvatarIcon.displayName = 'Avatar.Icon';
|
|
119
|
+
|
|
120
|
+
// =============================================================================
|
|
121
|
+
// AVATAR BADGE
|
|
122
|
+
// =============================================================================
|
|
123
|
+
|
|
124
|
+
const AvatarBadge = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
125
|
+
className,
|
|
126
|
+
children,
|
|
127
|
+
style,
|
|
128
|
+
...props
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const {
|
|
131
|
+
size
|
|
132
|
+
} = useAvatarStyleContext();
|
|
133
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarBadgeVariants)({
|
|
134
|
+
size
|
|
135
|
+
}), className);
|
|
136
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Badge, {
|
|
137
|
+
ref: ref,
|
|
138
|
+
className: computedClassName,
|
|
139
|
+
style: style,
|
|
140
|
+
...props,
|
|
141
|
+
children: children
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
AvatarBadge.displayName = 'Avatar.Badge';
|
|
145
|
+
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// COMPOUND COMPONENT
|
|
148
|
+
// =============================================================================
|
|
149
|
+
|
|
150
|
+
const Avatar = exports.Avatar = Object.assign(AvatarRoot, {
|
|
151
|
+
Image: AvatarImage,
|
|
152
|
+
Text: AvatarText,
|
|
153
|
+
Icon: AvatarIcon,
|
|
154
|
+
Badge: AvatarBadge
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Icon","_styles","_jsxRuntime","SCOPE","Root","withStyleContext","View","useAvatarStyleContext","useStyleContext","AvatarPrimitive","createAvatar","Image","Text","Icon","IconComponent","Badge","AvatarRoot","forwardRef","size","className","children","style","props","ref","computedClassName","cn","avatarRootVariants","jsx","context","displayName","AvatarImage","avatarImageVariants","AvatarText","avatarTextVariants","AvatarIcon","avatarIconVariants","AvatarBadge","avatarBadgeVariants","Avatar","exports","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Avatar/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAOkB,IAAAM,WAAA,GAAAN,OAAA;AAElB,MAAMO,KAAK,GAAG,QAAQ;AAEtB,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C;AACA;AACA;;AAOA,MAAMO,WAAW,gBAAG,IAAAnB,iBAAU,EAC5B,CAAC;EAAEE,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjD,MAAM;IAAEL;EAAK,CAAC,GAAGX,qBAAqB,CAAC,CAAC;EACxC,MAAMiB,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAY,2BAAmB,EAAC;IAAEnB;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAEtE,oBACE,IAAAjB,WAAA,CAAAyB,GAAA,EAAClB,eAAe,CAACM,KAAK;IACpBQ,GAAG,EAAEA,GAAa;IAClBJ,SAAS,EAAEK,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAAF,QAAA,EAERA;EAAQ,CACY,CAAC;AAE5B,CACF,CAAC;AAEDgB,WAAW,CAACP,WAAW,GAAG,cAAc;;AAExC;AACA;AACA;;AASO,MAAMS,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAACzB,UAAU,EAAE;EAC9CL,KAAK,EAAEmB,WAAW;EAClBlB,IAAI,EAAEoB,UAAU;EAChBnB,IAAI,EAAEqB,UAAU;EAChBnB,KAAK,EAAEqB;AACT,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.avatarTextVariants = exports.avatarRootVariants = exports.avatarImageVariants = exports.avatarIconVariants = exports.avatarBadgeVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
var _primitives = require("../../styles/primitives");
|
|
9
|
+
// ── Root ─────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
const avatarRootVariants = exports.avatarRootVariants = (0, _classVarianceAuthority.cva)([_primitives.RADIUS_FULL, 'relative items-center justify-center', _primitives.COLOR_BG_MUTED], {
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
sm: 'w-8 h-8',
|
|
15
|
+
md: 'w-10 h-10',
|
|
16
|
+
lg: 'w-12 h-12',
|
|
17
|
+
xl: 'w-16 h-16',
|
|
18
|
+
'2xl': 'w-20 h-20'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: 'lg'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// ── Image ────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
const avatarImageVariants = exports.avatarImageVariants = (0, _classVarianceAuthority.cva)(['absolute top-0 left-0 w-full h-full', _primitives.RADIUS_FULL, 'overflow-hidden']);
|
|
29
|
+
|
|
30
|
+
// ── Text ─────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
const avatarTextVariants = exports.avatarTextVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY, 'font-semibold'], {
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
sm: 'text-xs',
|
|
36
|
+
md: 'text-sm',
|
|
37
|
+
lg: 'text-base',
|
|
38
|
+
xl: 'text-xl',
|
|
39
|
+
'2xl': 'text-2xl'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
size: 'lg'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ── Icon ─────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
const avatarIconVariants = exports.avatarIconVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY], {
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
sm: 'size-4',
|
|
53
|
+
md: 'size-5',
|
|
54
|
+
lg: 'size-6',
|
|
55
|
+
xl: 'size-8',
|
|
56
|
+
'2xl': 'size-10'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
size: 'lg'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ── Badge ────────────────────────────────────────────────
|
|
65
|
+
|
|
66
|
+
const avatarBadgeVariants = exports.avatarBadgeVariants = (0, _classVarianceAuthority.cva)(['absolute border-2 border-white', _primitives.RADIUS_FULL], {
|
|
67
|
+
variants: {
|
|
68
|
+
size: {
|
|
69
|
+
sm: 'w-2.5 h-2.5 bottom-0 right-0',
|
|
70
|
+
md: 'w-3 h-3 bottom-0 right-0',
|
|
71
|
+
lg: 'w-3.5 h-3.5 bottom-0 right-0',
|
|
72
|
+
xl: 'w-4 h-4 bottom-0.5 right-0.5',
|
|
73
|
+
'2xl': 'w-5 h-5 bottom-0.5 right-0.5'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
size: 'lg'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","_primitives","avatarRootVariants","exports","cva","RADIUS_FULL","COLOR_BG_MUTED","variants","size","sm","md","lg","xl","defaultVariants","avatarImageVariants","avatarTextVariants","COLOR_TEXT_SECONDARY","avatarIconVariants","avatarBadgeVariants"],"sourceRoot":"../../../../src","sources":["components/Avatar/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA;;AAEO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,2BAAG,EACnC,CAACC,uBAAW,EAAE,sCAAsC,EAAEC,0BAAc,CAAC,EACrE;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACf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AA8B;MAClC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BottomSheet = void 0;
|
|
7
|
+
exports.useBottomSheet = useBottomSheet;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
11
|
+
var _bottomSheet = require("@gorhom/bottom-sheet");
|
|
12
|
+
var _utils = require("@cdx-ui/utils");
|
|
13
|
+
var _icons = require("@cdx-ui/icons");
|
|
14
|
+
var _Heading = require("../Heading");
|
|
15
|
+
var _Icon = require("../Icon");
|
|
16
|
+
var _Text = require("../Text");
|
|
17
|
+
var _styles = require("./styles");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
/** Ref type for BottomSheet; forwards the @gorhom modal ref (present, dismiss, snapToIndex, minimize, restore, etc.). */
|
|
21
|
+
|
|
22
|
+
function BottomSheetHeaderComponent({
|
|
23
|
+
title,
|
|
24
|
+
subtitle,
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
onClose,
|
|
28
|
+
closeAccessibilityLabel,
|
|
29
|
+
onBack,
|
|
30
|
+
backAccessibilityLabel = 'Go back'
|
|
31
|
+
}, ref) {
|
|
32
|
+
const hasTitle = title !== undefined && title !== '';
|
|
33
|
+
const hasContent = hasTitle || !!children || !!onBack;
|
|
34
|
+
const computedClassName = (0, _utils.cn)((0, _styles.bottomSheetHeaderVariants)({
|
|
35
|
+
hasTitle: hasContent
|
|
36
|
+
}), className);
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: computedClassName,
|
|
40
|
+
children: [onBack && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
41
|
+
onPress: onBack,
|
|
42
|
+
hitSlop: 12,
|
|
43
|
+
accessibilityRole: "button",
|
|
44
|
+
accessibilityLabel: backAccessibilityLabel,
|
|
45
|
+
className: (0, _utils.cn)((0, _styles.bottomSheetBackButtonVariants)()),
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
47
|
+
as: _icons.ArrowBackIosNew,
|
|
48
|
+
className: (0, _styles.bottomSheetBackIconVariants)()
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
51
|
+
className: "flex-1",
|
|
52
|
+
children: children ?? (hasTitle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
53
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.Heading, {
|
|
54
|
+
size: "xs",
|
|
55
|
+
className: "text-lg",
|
|
56
|
+
children: title
|
|
57
|
+
}), subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
58
|
+
className: (0, _styles.bottomSheetSubtitleVariants)(),
|
|
59
|
+
children: subtitle
|
|
60
|
+
}) : null]
|
|
61
|
+
}) : null)
|
|
62
|
+
}), onClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(BottomSheetCloseButton, {
|
|
63
|
+
onPress: onClose,
|
|
64
|
+
...(closeAccessibilityLabel !== undefined && {
|
|
65
|
+
accessibilityLabel: closeAccessibilityLabel
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
BottomSheetHeaderComponent.displayName = 'BottomSheet.Header';
|
|
71
|
+
const BottomSheetHeader = /*#__PURE__*/(0, _react.forwardRef)(BottomSheetHeaderComponent);
|
|
72
|
+
BottomSheetHeader.displayName = 'BottomSheet.Header';
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// CLOSEBUTTON
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
function BottomSheetCloseButton({
|
|
79
|
+
onPress,
|
|
80
|
+
className,
|
|
81
|
+
accessibilityLabel = 'Close'
|
|
82
|
+
}) {
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
84
|
+
onPress: onPress,
|
|
85
|
+
hitSlop: 12,
|
|
86
|
+
accessibilityRole: "button",
|
|
87
|
+
accessibilityLabel: accessibilityLabel,
|
|
88
|
+
className: (0, _utils.cn)((0, _styles.bottomSheetCloseButtonVariants)(), className),
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
90
|
+
as: _icons.Close,
|
|
91
|
+
className: (0, _styles.bottomSheetCloseIconVariants)()
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
BottomSheetCloseButton.displayName = 'BottomSheet.CloseButton';
|
|
96
|
+
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// CONTENT
|
|
99
|
+
// =============================================================================
|
|
100
|
+
|
|
101
|
+
const BottomSheetContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
102
|
+
children,
|
|
103
|
+
className,
|
|
104
|
+
hasSafeAreaInset,
|
|
105
|
+
style
|
|
106
|
+
}, ref) => {
|
|
107
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
108
|
+
const computedClassName = (0, _utils.cn)((0, _styles.bottomSheetContentVariants)(), className);
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
110
|
+
ref: ref,
|
|
111
|
+
className: computedClassName,
|
|
112
|
+
style: hasSafeAreaInset ? {
|
|
113
|
+
paddingBottom: insets.bottom,
|
|
114
|
+
...style
|
|
115
|
+
} : style,
|
|
116
|
+
pointerEvents: "box-none",
|
|
117
|
+
children: children
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
BottomSheetContent.displayName = 'BottomSheet.Content';
|
|
121
|
+
|
|
122
|
+
// =============================================================================
|
|
123
|
+
// FOOTER
|
|
124
|
+
// =============================================================================
|
|
125
|
+
|
|
126
|
+
const BottomSheetFooter = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
127
|
+
children,
|
|
128
|
+
className,
|
|
129
|
+
style
|
|
130
|
+
}, ref) => {
|
|
131
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
132
|
+
const computedClassName = (0, _utils.cn)((0, _styles.bottomSheetFooterVariants)(), className);
|
|
133
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
134
|
+
ref: ref,
|
|
135
|
+
className: computedClassName,
|
|
136
|
+
style: {
|
|
137
|
+
paddingBottom: Math.max(insets.bottom, 24),
|
|
138
|
+
...style
|
|
139
|
+
},
|
|
140
|
+
pointerEvents: "box-none",
|
|
141
|
+
children: children
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
BottomSheetFooter.displayName = 'BottomSheet.Footer';
|
|
145
|
+
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// MODAL WRAPPER (WITH STYLES)
|
|
148
|
+
// =============================================================================
|
|
149
|
+
|
|
150
|
+
const MAX_DYNAMIC_CONTENT_SIZE = _reactNative.Dimensions.get('window').height * 0.9;
|
|
151
|
+
const CustomBackdrop = props => {
|
|
152
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetBackdrop, {
|
|
153
|
+
...props,
|
|
154
|
+
disappearsOnIndex: -1,
|
|
155
|
+
appearsOnIndex: 0,
|
|
156
|
+
opacity: 0.5,
|
|
157
|
+
pressBehavior: "close"
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const BottomSheetModalStyled = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
161
|
+
handleVisible = true,
|
|
162
|
+
footer,
|
|
163
|
+
...rest
|
|
164
|
+
}, ref) => {
|
|
165
|
+
const renderFooter = (0, _react.useCallback)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetFooter, {
|
|
166
|
+
...props,
|
|
167
|
+
children: footer
|
|
168
|
+
}), [footer]);
|
|
169
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetModal, {
|
|
170
|
+
ref: ref,
|
|
171
|
+
enableDynamicSizing: true,
|
|
172
|
+
maxDynamicContentSize: MAX_DYNAMIC_CONTENT_SIZE,
|
|
173
|
+
handleComponent: handleVisible ? undefined : null,
|
|
174
|
+
handleIndicatorStyle: handleVisible ? _styles.handleIndicatorStyle : undefined,
|
|
175
|
+
backdropComponent: CustomBackdrop,
|
|
176
|
+
backgroundComponent: backgroundProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
177
|
+
...backgroundProps,
|
|
178
|
+
className: (0, _utils.cn)((0, _styles.bottomSheetContainerVariants)())
|
|
179
|
+
}),
|
|
180
|
+
...rest,
|
|
181
|
+
...(footer != null && {
|
|
182
|
+
footerComponent: renderFooter
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
BottomSheetModalStyled.displayName = 'BottomSheet.Modal';
|
|
187
|
+
|
|
188
|
+
// =============================================================================
|
|
189
|
+
// SCROLLVIEW WRAPPER (with footer margin adjustment enabled by default)
|
|
190
|
+
// =============================================================================
|
|
191
|
+
|
|
192
|
+
function BottomSheetScrollViewStyled({
|
|
193
|
+
enableFooterMarginAdjustment = true,
|
|
194
|
+
children,
|
|
195
|
+
...rest
|
|
196
|
+
}) {
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetScrollView, {
|
|
198
|
+
enableFooterMarginAdjustment: enableFooterMarginAdjustment,
|
|
199
|
+
...rest,
|
|
200
|
+
children: children
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
BottomSheetScrollViewStyled.displayName = 'BottomSheet.ScrollView';
|
|
204
|
+
|
|
205
|
+
// =============================================================================
|
|
206
|
+
// VIEW WRAPPER (with footer margin adjustment enabled by default)
|
|
207
|
+
// =============================================================================
|
|
208
|
+
|
|
209
|
+
function BottomSheetViewStyled({
|
|
210
|
+
enableFooterMarginAdjustment = true,
|
|
211
|
+
children,
|
|
212
|
+
...rest
|
|
213
|
+
}) {
|
|
214
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetView, {
|
|
215
|
+
enableFooterMarginAdjustment: enableFooterMarginAdjustment,
|
|
216
|
+
...rest,
|
|
217
|
+
children: children
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
BottomSheetViewStyled.displayName = 'BottomSheet.View';
|
|
221
|
+
|
|
222
|
+
// Display names for gorhom components exposed as BottomSheet.*
|
|
223
|
+
|
|
224
|
+
_bottomSheet.BottomSheetModalProvider.displayName = 'BottomSheet.Provider';
|
|
225
|
+
|
|
226
|
+
// ── Public exports ────────────────────────────────────────
|
|
227
|
+
|
|
228
|
+
const BottomSheet = exports.BottomSheet = {
|
|
229
|
+
Modal: BottomSheetModalStyled,
|
|
230
|
+
Header: BottomSheetHeader,
|
|
231
|
+
Content: BottomSheetContent,
|
|
232
|
+
Footer: BottomSheetFooter,
|
|
233
|
+
Provider: _bottomSheet.BottomSheetModalProvider,
|
|
234
|
+
ScrollView: BottomSheetScrollViewStyled,
|
|
235
|
+
View: BottomSheetViewStyled
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// ── Hooks ────────────────────────────────────────────────
|
|
239
|
+
|
|
240
|
+
function useBottomSheet() {
|
|
241
|
+
const ref = (0, _react.useRef)(null);
|
|
242
|
+
return {
|
|
243
|
+
ref,
|
|
244
|
+
present: () => ref.current?.present(),
|
|
245
|
+
dismiss: () => ref.current?.dismiss()
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_bottomSheet","_utils","_icons","_Heading","_Icon","_Text","_styles","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BottomSheetHeaderComponent","title","subtitle","children","className","onClose","closeAccessibilityLabel","onBack","backAccessibilityLabel","ref","hasTitle","undefined","hasContent","computedClassName","cn","bottomSheetHeaderVariants","jsxs","View","jsx","Pressable","onPress","hitSlop","accessibilityRole","accessibilityLabel","bottomSheetBackButtonVariants","Icon","as","ArrowBackIosNew","bottomSheetBackIconVariants","Heading","size","Text","bottomSheetSubtitleVariants","BottomSheetCloseButton","displayName","BottomSheetHeader","forwardRef","bottomSheetCloseButtonVariants","Close","bottomSheetCloseIconVariants","BottomSheetContent","hasSafeAreaInset","style","insets","useSafeAreaInsets","bottomSheetContentVariants","paddingBottom","bottom","pointerEvents","BottomSheetFooter","bottomSheetFooterVariants","Math","max","MAX_DYNAMIC_CONTENT_SIZE","Dimensions","height","CustomBackdrop","props","BottomSheetBackdrop","disappearsOnIndex","appearsOnIndex","opacity","pressBehavior","BottomSheetModalStyled","handleVisible","footer","rest","renderFooter","useCallback","BottomSheetModal","enableDynamicSizing","maxDynamicContentSize","handleComponent","handleIndicatorStyle","backdropComponent","backgroundComponent","backgroundProps","bottomSheetContainerVariants","footerComponent","BottomSheetScrollViewStyled","enableFooterMarginAdjustment","BottomSheetScrollView","BottomSheetViewStyled","BottomSheetView","BottomSheetModalProvider","BottomSheet","exports","Modal","Header","Content","Footer","Provider","ScrollView","useBottomSheet","useRef","present","current","dismiss"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/index.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAUA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAWkB,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAD,wBAAAY,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAY,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IA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AC,EAAE;EACzD,oBACE,IAAAtF,WAAA,CAAAsC,GAAA,EAAC7C,YAAA,CAAA8G,eAAe;IAACH,4BAA4B,EAAEA,4BAA6B;IAAA,GAAKd,IAAI;IAAA/D,QAAA,EAClFA;EAAQ,CACM,CAAC;AAEtB;AAEA+E,qBAAqB,CAAChD,WAAW,GAAG,kBAAkB;;AAEtD;;AAICkD,qCAAwB,CAAqBlD,WAAW,GAAG,sBAAsB;;AAElF;;AAYO,MAAMmD,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzBE,KAAK,EAAExB,sBAAsB;EAC7ByB,MAAM,EAAErD,iBAAiB;EACzBsD,OAAO,EAAEjD,kBAAkB;EAC3BkD,MAAM,EAAEzC,iBAAiB;EACzB0C,QAAQ,EAAEP,qCAAwB;EAClCQ,UAAU,EAAEb,2BAA2B;EACvC9D,IAAI,EAAEiE;AACR,CAAwB;;AAExB;;AAEO,SAASW,cAAcA,CAAA,EAAG;EAC/B,MAAMpF,GAAG,GAAG,IAAAqF,aAAM,EAAsB,IAAI,CAAC;EAC7C,OAAO;IAAErF,GAAG;IAAEsF,OAAO,EAAEA,CAAA,KAAMtF,GAAG,CAACuF,OAAO,EAAED,OAAO,CAAC,CAAC;IAAEE,OAAO,EAAEA,CAAA,KAAMxF,GAAG,CAACuF,OAAO,EAAEC,OAAO,CAAC;EAAE,CAAC;AAC9F","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.handleIndicatorStyle = exports.bottomSheetSubtitleVariants = exports.bottomSheetHeaderVariants = exports.bottomSheetFooterVariants = exports.bottomSheetContentVariants = exports.bottomSheetContainerVariants = exports.bottomSheetCloseIconVariants = exports.bottomSheetCloseButtonVariants = exports.bottomSheetBackIconVariants = exports.bottomSheetBackButtonVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
var _primitives = require("../../styles/primitives");
|
|
9
|
+
// ── Container ──────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
const bottomSheetContainerVariants = exports.bottomSheetContainerVariants = (0, _classVarianceAuthority.cva)(['rounded-t-3xl border-t border-x overflow-hidden', _primitives.COLOR_BG_PRIMARY, _primitives.COLOR_BORDER_DEFAULT]);
|
|
12
|
+
|
|
13
|
+
// ── Header ─────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
const bottomSheetHeaderVariants = exports.bottomSheetHeaderVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center justify-between min-h-12 px-4 pt-3 pb-2', _primitives.COLOR_BG_PRIMARY, _primitives.COLOR_TEXT_PRIMARY], {
|
|
16
|
+
variants: {
|
|
17
|
+
hasTitle: {
|
|
18
|
+
true: '',
|
|
19
|
+
false: 'justify-end'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
hasTitle: true
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// ── Content ────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
const bottomSheetContentVariants = exports.bottomSheetContentVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_BG_PRIMARY, 'px-4 pb-6']);
|
|
30
|
+
|
|
31
|
+
// ── Footer ─────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
const bottomSheetFooterVariants = exports.bottomSheetFooterVariants = (0, _classVarianceAuthority.cva)(['px-4 pt-3 pb-4 border-t', _primitives.COLOR_BG_PRIMARY, _primitives.COLOR_BORDER_DEFAULT]);
|
|
34
|
+
|
|
35
|
+
// ── Subtitle ────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
const bottomSheetSubtitleVariants = exports.bottomSheetSubtitleVariants = (0, _classVarianceAuthority.cva)(['text-sm', _primitives.COLOR_TEXT_SECONDARY]);
|
|
38
|
+
|
|
39
|
+
// ── Back Button ─────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
const bottomSheetBackButtonVariants = exports.bottomSheetBackButtonVariants = (0, _classVarianceAuthority.cva)(['p-1 -m-1 mr-2 rounded-full active:opacity-70']);
|
|
42
|
+
const bottomSheetBackIconVariants = exports.bottomSheetBackIconVariants = (0, _classVarianceAuthority.cva)(['size-5 text-slate-500']);
|
|
43
|
+
|
|
44
|
+
// ── Close Button ───────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
const bottomSheetCloseButtonVariants = exports.bottomSheetCloseButtonVariants = (0, _classVarianceAuthority.cva)(['p-1 -m-1 rounded-full active:opacity-70']);
|
|
47
|
+
|
|
48
|
+
// ── Close Icon ─────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
const bottomSheetCloseIconVariants = exports.bottomSheetCloseIconVariants = (0, _classVarianceAuthority.cva)(['size-5 text-slate-500']);
|
|
51
|
+
|
|
52
|
+
// ── Handle indicator ────────────────────────────────────────
|
|
53
|
+
// Plain ViewStyle — gorhom's handleIndicatorStyle doesn't accept classNames.
|
|
54
|
+
// slate-300 (#cbd5e1) maps to COLOR_BORDER_STRONG; update when raw token palette is available (TODO).
|
|
55
|
+
const handleIndicatorStyle = exports.handleIndicatorStyle = {
|
|
56
|
+
backgroundColor: '#cbd5e1',
|
|
57
|
+
width: 36,
|
|
58
|
+
height: 4,
|
|
59
|
+
borderRadius: 2
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","_primitives","bottomSheetContainerVariants","exports","cva","COLOR_BG_PRIMARY","COLOR_BORDER_DEFAULT","bottomSheetHeaderVariants","COLOR_TEXT_PRIMARY","variants","hasTitle","true","false","defaultVariants","bottomSheetContentVariants","bottomSheetFooterVariants","bottomSheetSubtitleVariants","COLOR_TEXT_SECONDARY","bottomSheetBackButtonVariants","bottomSheetBackIconVariants","bottomSheetCloseButtonVariants","bottomSheetCloseIconVariants","handleIndicatorStyle","backgroundColor","width","height","borderRadius"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/styles.ts"],"mappings":";;;;;;AACA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA;;AAEO,MAAME,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,IAAAE,2BAAG,EAAC,CAC9C,iDAAiD,EACjDC,4BAAgB,EAChBC,gCAAoB,CACrB,CAAC;;AAEF;;AAEO,MAAMC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,GAAG,IAAAH,2BAAG,EAC1C,CACE,+DAA+D,EAC/DC,4BAAgB,EAChBG,8BAAkB,CACnB,EACD;EACEC,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,QAAQ,EAAE;EACZ;AACF,CACF,CAAC;;AAED;;AAEO,MAAMI,0BAA0B,GAAAX,OAAA,CAAAW,0BAAA,GAAG,IAAAV,2BAAG,EAAC,CAACC,4BAAgB,EAAE,WAAW,CAAC,CAAC;;AAE9E;;AAEO,MAAMU,yBAAyB,GAAAZ,OAAA,CAAAY,yBAAA,GAAG,IAAAX,2BAAG,EAAC,CAC3C,yBAAyB,EACzBC,4BAAgB,EAChBC,gCAAoB,CACrB,CAAC;;AAEF;;AAEO,MAAMU,2BAA2B,GAAAb,OAAA,CAAAa,2BAAA,GAAG,IAAAZ,2BAAG,EAAC,CAAC,SAAS,EAAEa,gCAAoB,CAAC,CAAC;;AAEjF;;AAEO,MAAMC,6BAA6B,GAAAf,OAAA,CAAAe,6BAAA,GAAG,IAAAd,2BAAG,EAAC,CAAC,8CAA8C,CAAC,CAAC;AAE3F,MAAMe,2BAA2B,GAAAhB,OAAA,CAAAgB,2BAAA,GAAG,IAAAf,2BAAG,EAAC,CAAC,uBAAuB,CAAC,CAAC;;AAEzE;;AAEO,MAAMgB,8BAA8B,GAAAjB,OAAA,CAAAiB,8BAAA,GAAG,IAAAhB,2BAAG,EAAC,CAAC,yCAAyC,CAAC,CAAC;;AAE9F;;AAEO,MAAMiB,4BAA4B,GAAAlB,OAAA,CAAAkB,4BAAA,GAAG,IAAAjB,2BAAG,EAAC,CAAC,uBAAuB,CAAC,CAAC;;AAE1E;AACA;AACA;AACO,MAAMkB,oBAA+B,GAAAnB,OAAA,CAAAmB,oBAAA,GAAG;EAC7CC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,CAAC;EACTC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _react = require("react");
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _WrapStringChild = require("../../utils/WrapStringChild");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/** @deprecated Use View instead */
|
|
11
12
|
const Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
12
13
|
style,
|
|
13
14
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_WrapStringChild","_jsxRuntime","Box","exports","forwardRef","style","className","children","textProps","restProps","ref","jsx","View","WrapStringChild","displayName"],"sourceRoot":"../../../../src","sources":["components/Box/Box.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AAA8D,IAAAG,WAAA,GAAAH,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_WrapStringChild","_jsxRuntime","Box","exports","forwardRef","style","className","children","textProps","restProps","ref","jsx","View","WrapStringChild","displayName"],"sourceRoot":"../../../../src","sources":["components/Box/Box.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AAA8D,IAAAG,WAAA,GAAAH,OAAA;AAQ9D;AACO,MAAMI,GAAG,GAAAC,OAAA,CAAAD,GAAA,gBAAG,IAAAE,iBAAU,EAC3B,CAAC;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,SAAS;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAuB,KAAK;EACpF,oBACE,IAAAT,WAAA,CAAAU,GAAA,EAACZ,YAAA,CAAAa,IAAI;IAACF,GAAG,EAAEA,GAAI;IAACL,KAAK,EAAEA,KAAM;IAACC,SAAS,EAAEA,SAAU;IAAA,GAAKG,SAAS;IAAAF,QAAA,eAC/D,IAAAN,WAAA,CAAAU,GAAA,EAACX,gBAAA,CAAAa,eAAe;MAACL,SAAS,EAAEA,SAAU;MAAAD,QAAA,EAAEA;IAAQ,CAAkB;EAAC,CAC/D,CAAC;AAEX,CACF,CAAC;AAEDL,GAAG,CAACY,WAAW,GAAG,KAAK","ignoreList":[]}
|