@cdx-ui/components 0.0.1-alpha.16 → 0.0.1-alpha.18
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/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/VirtualizedList/index.js +19 -0
- package/lib/commonjs/components/VirtualizedList/index.js.map +1 -0
- package/lib/commonjs/components/index.js +24 -0
- package/lib/commonjs/components/index.js.map +1 -1
- 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/VirtualizedList/index.js +15 -0
- package/lib/module/components/VirtualizedList/index.js.map +1 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- 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/Button/styles.d.ts +3 -3
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -4
- package/lib/typescript/components/Heading/styles.d.ts +1 -1
- package/lib/typescript/components/Input/styles.d.ts +3 -3
- package/lib/typescript/components/Select/styles.d.ts +5 -5
- package/lib/typescript/components/Stack/styles.d.ts +2 -2
- package/lib/typescript/components/Switch/styles.d.ts +2 -2
- package/lib/typescript/components/Text/styles.d.ts +1 -1
- 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 +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/package.json +8 -4
- package/src/components/Avatar/index.tsx +174 -0
- package/src/components/Avatar/styles.ts +83 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +2 -0
|
@@ -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,MAAMC,IAAI,GAAG,IAAAC,uBAAgB,EAACC,iBAAI,EAAEH,KAAK,CAAC;AAE1C,MAAMI,qBAAqB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACL,KAAK,CAAuB;AAEhF,MAAMM,eAAe,GAAG,IAAAC,wBAAY,EAAC;EACnCN,IAAI;EACJO,KAAK,EAALA,kBAAK;EACLC,IAAI,EAAJA,iBAAI;EACJC,IAAI,EAAEC,UAAa;EACnBC,KAAK,EAAET;AACT,CAAC,CAAC;;AAEF;AACA;AACA;;AAOA,MAAMU,UAAU,gBAAG,IAAAC,iBAAU,EAC3B,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,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;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACf,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEO,MAAMM,mBAAmB,GAAAX,OAAA,CAAAW,mBAAA,GAAG,IAAAV,2BAAG,EAAC,CACrC,qCAAqC,EACrCC,uBAAW,EACX,iBAAiB,CAClB,CAAC;;AAEF;;AAEO,MAAMU,kBAAkB,GAAAZ,OAAA,CAAAY,kBAAA,GAAG,IAAAX,2BAAG,EAAC,CAACY,gCAAoB,EAAE,eAAe,CAAC,EAAE;EAC7ET,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,SAAS;MACb,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEO,MAAMS,kBAAkB,GAAAd,OAAA,CAAAc,kBAAA,GAAG,IAAAb,2BAAG,EAAC,CAACY,gCAAoB,CAAC,EAAE;EAC5DT,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZ,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEO,MAAMU,mBAAmB,GAAAf,OAAA,CAAAe,mBAAA,GAAG,IAAAd,2BAAG,EAAC,CAAC,gCAAgC,EAAEC,uBAAW,CAAC,EAAE;EACtFE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,8BAA8B;MAClCC,EAAE,EAAE,0BAA0B;MAC9BC,EAAE,EAAE,8BAA8B;MAClCC,EAAE,EAAE,8BAA8B;MAClC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VirtualizedList = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _flashList = require("@shopify/flash-list");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function VirtualizedListInner(props, ref) {
|
|
11
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_flashList.FlashList, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
role: "list",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const VirtualizedList = exports.VirtualizedList = /*#__PURE__*/(0, _react.forwardRef)(VirtualizedListInner);
|
|
18
|
+
VirtualizedList.displayName = 'VirtualizedList';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_flashList","_jsxRuntime","VirtualizedListInner","props","ref","jsx","FlashList","role","VirtualizedList","exports","forwardRef","displayName"],"sourceRoot":"../../../../src","sources":["components/VirtualizedList/index.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAwF,IAAAE,WAAA,GAAAF,OAAA;AAKxF,SAASG,oBAAoBA,CAC3BC,KAA8B,EAC9BC,GAAkC,EAClC;EACA,oBAAO,IAAAH,WAAA,CAAAI,GAAA,EAACL,UAAA,CAAAM,SAAS;IAACF,GAAG,EAAEA,GAAI;IAACG,IAAI,EAAC,MAAM;IAAA,GAAKJ;EAAK,CAAG,CAAC;AACvD;AAEO,MAAMK,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAG,IAAAE,iBAAU,EAACR,oBAAoB,CAEtC;AAEvBM,eAAe,CAA8BG,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -19,6 +19,18 @@ Object.defineProperty(exports, "VStack", {
|
|
|
19
19
|
return _Stack.VStack;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
+
var _Avatar = require("./Avatar");
|
|
23
|
+
Object.keys(_Avatar).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
+
if (key in exports && exports[key] === _Avatar[key]) return;
|
|
27
|
+
Object.defineProperty(exports, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _Avatar[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
22
34
|
var _Box = require("./Box");
|
|
23
35
|
Object.keys(_Box).forEach(function (key) {
|
|
24
36
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -91,6 +103,18 @@ Object.keys(_Select).forEach(function (key) {
|
|
|
91
103
|
}
|
|
92
104
|
});
|
|
93
105
|
});
|
|
106
|
+
var _VirtualizedList = require("./VirtualizedList");
|
|
107
|
+
Object.keys(_VirtualizedList).forEach(function (key) {
|
|
108
|
+
if (key === "default" || key === "__esModule") return;
|
|
109
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
110
|
+
if (key in exports && exports[key] === _VirtualizedList[key]) return;
|
|
111
|
+
Object.defineProperty(exports, key, {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () {
|
|
114
|
+
return _VirtualizedList[key];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
94
118
|
var _Switch = require("./Switch");
|
|
95
119
|
Object.keys(_Switch).forEach(function (key) {
|
|
96
120
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_Avatar","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Box","_Button","_Checkbox","_Input","_Link","_Select","_VirtualizedList","_Switch","_Stack","_Heading","_Text","_Icon"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAA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A;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAoB,KAAA,CAAApB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAY,KAAA,CAAApB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Image, Text, View } from 'react-native';
|
|
5
|
+
import { createAvatar } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
7
|
+
import { Icon as IconComponent } from '../Icon';
|
|
8
|
+
import { avatarBadgeVariants, avatarIconVariants, avatarTextVariants, avatarImageVariants, avatarRootVariants } from './styles';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const SCOPE = 'AVATAR';
|
|
11
|
+
const Root = withStyleContext(View, SCOPE);
|
|
12
|
+
const useAvatarStyleContext = () => useStyleContext(SCOPE);
|
|
13
|
+
const AvatarPrimitive = createAvatar({
|
|
14
|
+
Root,
|
|
15
|
+
Image,
|
|
16
|
+
Text,
|
|
17
|
+
Icon: IconComponent,
|
|
18
|
+
Badge: View
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// AVATAR ROOT
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
const AvatarRoot = /*#__PURE__*/forwardRef(({
|
|
26
|
+
size = 'lg',
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
style,
|
|
30
|
+
...props
|
|
31
|
+
}, ref) => {
|
|
32
|
+
const computedClassName = cn(avatarRootVariants({
|
|
33
|
+
size
|
|
34
|
+
}), className);
|
|
35
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive, {
|
|
36
|
+
ref: ref,
|
|
37
|
+
className: computedClassName,
|
|
38
|
+
style: style,
|
|
39
|
+
context: {
|
|
40
|
+
size
|
|
41
|
+
},
|
|
42
|
+
...props,
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
AvatarRoot.displayName = 'Avatar';
|
|
47
|
+
|
|
48
|
+
// =============================================================================
|
|
49
|
+
// AVATAR IMAGE
|
|
50
|
+
// =============================================================================
|
|
51
|
+
|
|
52
|
+
const AvatarImage = /*#__PURE__*/forwardRef(({
|
|
53
|
+
className,
|
|
54
|
+
style,
|
|
55
|
+
...props
|
|
56
|
+
}, ref) => {
|
|
57
|
+
const computedClassName = cn(avatarImageVariants(), className);
|
|
58
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Image, {
|
|
59
|
+
ref: ref,
|
|
60
|
+
className: computedClassName,
|
|
61
|
+
style: style,
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
66
|
+
|
|
67
|
+
// =============================================================================
|
|
68
|
+
// AVATAR TEXT
|
|
69
|
+
// =============================================================================
|
|
70
|
+
|
|
71
|
+
const AvatarText = /*#__PURE__*/forwardRef(({
|
|
72
|
+
className,
|
|
73
|
+
children,
|
|
74
|
+
style,
|
|
75
|
+
...props
|
|
76
|
+
}, ref) => {
|
|
77
|
+
const {
|
|
78
|
+
size
|
|
79
|
+
} = useAvatarStyleContext();
|
|
80
|
+
const computedClassName = cn(avatarTextVariants({
|
|
81
|
+
size
|
|
82
|
+
}), className);
|
|
83
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Text, {
|
|
84
|
+
ref: ref,
|
|
85
|
+
className: computedClassName,
|
|
86
|
+
style: style,
|
|
87
|
+
...props,
|
|
88
|
+
children: children
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
AvatarText.displayName = 'Avatar.Text';
|
|
92
|
+
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// AVATAR ICON
|
|
95
|
+
// =============================================================================
|
|
96
|
+
|
|
97
|
+
const AvatarIcon = ({
|
|
98
|
+
className,
|
|
99
|
+
style,
|
|
100
|
+
...props
|
|
101
|
+
}) => {
|
|
102
|
+
const {
|
|
103
|
+
size
|
|
104
|
+
} = useAvatarStyleContext();
|
|
105
|
+
const computedClassName = cn(avatarIconVariants({
|
|
106
|
+
size
|
|
107
|
+
}), className);
|
|
108
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Icon, {
|
|
109
|
+
className: computedClassName,
|
|
110
|
+
style: style,
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
AvatarIcon.displayName = 'Avatar.Icon';
|
|
115
|
+
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// AVATAR BADGE
|
|
118
|
+
// =============================================================================
|
|
119
|
+
|
|
120
|
+
const AvatarBadge = /*#__PURE__*/forwardRef(({
|
|
121
|
+
className,
|
|
122
|
+
children,
|
|
123
|
+
style,
|
|
124
|
+
...props
|
|
125
|
+
}, ref) => {
|
|
126
|
+
const {
|
|
127
|
+
size
|
|
128
|
+
} = useAvatarStyleContext();
|
|
129
|
+
const computedClassName = cn(avatarBadgeVariants({
|
|
130
|
+
size
|
|
131
|
+
}), className);
|
|
132
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Badge, {
|
|
133
|
+
ref: ref,
|
|
134
|
+
className: computedClassName,
|
|
135
|
+
style: style,
|
|
136
|
+
...props,
|
|
137
|
+
children: children
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
AvatarBadge.displayName = 'Avatar.Badge';
|
|
141
|
+
|
|
142
|
+
// =============================================================================
|
|
143
|
+
// COMPOUND COMPONENT
|
|
144
|
+
// =============================================================================
|
|
145
|
+
|
|
146
|
+
export const Avatar = Object.assign(AvatarRoot, {
|
|
147
|
+
Image: AvatarImage,
|
|
148
|
+
Text: AvatarText,
|
|
149
|
+
Icon: AvatarIcon,
|
|
150
|
+
Badge: AvatarBadge
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Image","Text","View","createAvatar","cn","useStyleContext","withStyleContext","Icon","IconComponent","avatarBadgeVariants","avatarIconVariants","avatarTextVariants","avatarImageVariants","avatarRootVariants","jsx","_jsx","SCOPE","Root","useAvatarStyleContext","AvatarPrimitive","Badge","AvatarRoot","size","className","children","style","props","ref","computedClassName","context","displayName","AvatarImage","AvatarText","AvatarIcon","AvatarBadge","Avatar","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Avatar/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,KAAK,EAAEC,IAAI,EAAEC,IAAI,QAAyD,cAAc;AACjG,SAASC,YAAY,QAAmD,oBAAoB;AAC5F,SAASC,EAAE,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,eAAe;AACrE,SAASC,IAAI,IAAIC,aAAa,QAAwB,SAAS;AAC/D,SAEEC,mBAAmB,EACnBC,kBAAkB,EAClBC,kBAAkB,EAClBC,mBAAmB,EACnBC,kBAAkB,QACb,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,MAAMC,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAGX,gBAAgB,CAACJ,IAAI,EAAEc,KAAK,CAAC;AAE1C,MAAME,qBAAqB,GAAGA,CAAA,KAAMb,eAAe,CAACW,KAAK,CAAuB;AAEhF,MAAMG,eAAe,GAAGhB,YAAY,CAAC;EACnCc,IAAI;EACJjB,KAAK;EACLC,IAAI;EACJM,IAAI,EAAEC,aAAa;EACnBY,KAAK,EAAElB;AACT,CAAC,CAAC;;AAEF;AACA;AACA;;AAOA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AAE5B,CACF,CAAC;AAEDU,WAAW,CAACJ,WAAW,GAAG,cAAc;;AAExC;AACA;AACA;;AASA,OAAO,MAAMK,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAChB,UAAU,EAAE;EAC9CrB,KAAK,EAAE+B,WAAW;EAClB9B,IAAI,EAAE+B,UAAU;EAChBzB,IAAI,EAAE0B,UAAU;EAChBb,KAAK,EAAEc;AACT,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { COLOR_BG_MUTED, COLOR_TEXT_SECONDARY, RADIUS_FULL } from '../../styles/primitives';
|
|
5
|
+
|
|
6
|
+
// ── Root ─────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
export const avatarRootVariants = cva([RADIUS_FULL, 'relative items-center justify-center', COLOR_BG_MUTED], {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: 'w-8 h-8',
|
|
12
|
+
md: 'w-10 h-10',
|
|
13
|
+
lg: 'w-12 h-12',
|
|
14
|
+
xl: 'w-16 h-16',
|
|
15
|
+
'2xl': 'w-20 h-20'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: 'lg'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// ── Image ────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
export const avatarImageVariants = cva(['absolute top-0 left-0 w-full h-full', RADIUS_FULL, 'overflow-hidden']);
|
|
26
|
+
|
|
27
|
+
// ── Text ─────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
export const avatarTextVariants = cva([COLOR_TEXT_SECONDARY, 'font-semibold'], {
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: 'text-xs',
|
|
33
|
+
md: 'text-sm',
|
|
34
|
+
lg: 'text-base',
|
|
35
|
+
xl: 'text-xl',
|
|
36
|
+
'2xl': 'text-2xl'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
size: 'lg'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ── Icon ─────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
export const avatarIconVariants = cva([COLOR_TEXT_SECONDARY], {
|
|
47
|
+
variants: {
|
|
48
|
+
size: {
|
|
49
|
+
sm: 'size-4',
|
|
50
|
+
md: 'size-5',
|
|
51
|
+
lg: 'size-6',
|
|
52
|
+
xl: 'size-8',
|
|
53
|
+
'2xl': 'size-10'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
size: 'lg'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ── Badge ────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
export const avatarBadgeVariants = cva(['absolute border-2 border-white', RADIUS_FULL], {
|
|
64
|
+
variants: {
|
|
65
|
+
size: {
|
|
66
|
+
sm: 'w-2.5 h-2.5 bottom-0 right-0',
|
|
67
|
+
md: 'w-3 h-3 bottom-0 right-0',
|
|
68
|
+
lg: 'w-3.5 h-3.5 bottom-0 right-0',
|
|
69
|
+
xl: 'w-4 h-4 bottom-0.5 right-0.5',
|
|
70
|
+
'2xl': 'w-5 h-5 bottom-0.5 right-0.5'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
size: 'lg'
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","COLOR_BG_MUTED","COLOR_TEXT_SECONDARY","RADIUS_FULL","avatarRootVariants","variants","size","sm","md","lg","xl","defaultVariants","avatarImageVariants","avatarTextVariants","avatarIconVariants","avatarBadgeVariants"],"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,OAAO,MAAMS,mBAAmB,GAAGf,GAAG,CAAC,CAAC,gCAAgC,EAAEG,WAAW,CAAC,EAAE;EACtFE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,8BAA8B;MAClCC,EAAE,EAAE,0BAA0B;MAC9BC,EAAE,EAAE,8BAA8B;MAClCC,EAAE,EAAE,8BAA8B;MAClC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { FlashList } from '@shopify/flash-list';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
function VirtualizedListInner(props, ref) {
|
|
7
|
+
return /*#__PURE__*/_jsx(FlashList, {
|
|
8
|
+
ref: ref,
|
|
9
|
+
role: "list",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export const VirtualizedList = /*#__PURE__*/forwardRef(VirtualizedListInner);
|
|
14
|
+
VirtualizedList.displayName = 'VirtualizedList';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","FlashList","jsx","_jsx","VirtualizedListInner","props","ref","role","VirtualizedList","displayName"],"sourceRoot":"../../../../src","sources":["components/VirtualizedList/index.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,SAAS,QAAgD,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKxF,SAASC,oBAAoBA,CAC3BC,KAA8B,EAC9BC,GAAkC,EAClC;EACA,oBAAOH,IAAA,CAACF,SAAS;IAACK,GAAG,EAAEA,GAAI;IAACC,IAAI,EAAC,MAAM;IAAA,GAAKF;EAAK,CAAG,CAAC;AACvD;AAEA,OAAO,MAAMG,eAAe,gBAAGR,UAAU,CAACI,oBAAoB,CAEtC;AAEvBI,eAAe,CAA8BC,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
export * from './Avatar';
|
|
3
4
|
export * from './Box';
|
|
4
5
|
export * from './Button';
|
|
5
6
|
export * from './Checkbox';
|
|
6
7
|
export * from './Input';
|
|
7
8
|
export * from './Link';
|
|
8
9
|
export * from './Select';
|
|
10
|
+
export * from './VirtualizedList';
|
|
9
11
|
export * from './Switch';
|
|
10
12
|
export { HStack, VStack } from './Stack';
|
|
11
13
|
export * from './Heading';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,UAAU;AACxB,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Image, Text, View, type ImageProps, type TextProps, type ViewProps } from 'react-native';
|
|
3
|
+
import { type IAvatarImageProps, type IAvatarProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { type IconProps } from '../Icon';
|
|
5
|
+
import { type AvatarVariantProps } from './styles';
|
|
6
|
+
export interface AvatarProps extends ViewProps, IAvatarProps, AvatarVariantProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const AvatarRoot: import("react").ForwardRefExoticComponent<AvatarProps & import("react").RefAttributes<View>>;
|
|
11
|
+
export interface AvatarImageProps extends Omit<ImageProps, 'source'>, IAvatarImageProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const AvatarImage: import("react").ForwardRefExoticComponent<AvatarImageProps & import("react").RefAttributes<Image>>;
|
|
15
|
+
export interface AvatarTextProps extends TextProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const AvatarText: import("react").ForwardRefExoticComponent<AvatarTextProps & import("react").RefAttributes<Text>>;
|
|
20
|
+
export interface AvatarIconProps extends Omit<IconProps, 'children'> {
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const AvatarIcon: {
|
|
24
|
+
({ className, style, ...props }: AvatarIconProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export interface AvatarBadgeProps extends ViewProps {
|
|
28
|
+
className?: string;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
declare const AvatarBadge: import("react").ForwardRefExoticComponent<AvatarBadgeProps & import("react").RefAttributes<View>>;
|
|
32
|
+
type AvatarCompoundComponent = typeof AvatarRoot & {
|
|
33
|
+
Image: typeof AvatarImage;
|
|
34
|
+
Text: typeof AvatarText;
|
|
35
|
+
Icon: typeof AvatarIcon;
|
|
36
|
+
Badge: typeof AvatarBadge;
|
|
37
|
+
};
|
|
38
|
+
export declare const Avatar: AvatarCompoundComponent;
|
|
39
|
+
export type { AvatarVariantProps };
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAgB,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EACL,KAAK,kBAAkB,EAMxB,MAAM,UAAU,CAAC;AAoBlB,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,YAAY,EAAE,kBAAkB;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,8FAgBf,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,iBAAiB;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,oGAWf,CAAC;AAQH,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,kGAgBf,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU;qCAAoC,eAAe;;CAKlE,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,mGAgBhB,CAAC;AAQF,KAAK,uBAAuB,GAAG,OAAO,UAAU,GAAG;IACjD,KAAK,EAAE,OAAO,WAAW,CAAC;IAC1B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,KAAK,EAAE,OAAO,WAAW,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,MAAM,EAKb,uBAAuB,CAAC;AAE9B,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const avatarRootVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const avatarImageVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const avatarTextVariants: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const avatarIconVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
export declare const avatarBadgeVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
export type AvatarVariantProps = VariantProps<typeof avatarRootVariants>;
|
|
16
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,eAAO,MAAM,kBAAkB;;8EAgB9B,CAAC;AAIF,eAAO,MAAM,mBAAmB,oFAI9B,CAAC;AAIH,eAAO,MAAM,kBAAkB;;8EAa7B,CAAC;AAIH,eAAO,MAAM,kBAAkB;;8EAa7B,CAAC;AAIH,eAAO,MAAM,mBAAmB;;8EAa9B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -2,14 +2,14 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export declare const buttonRootVariants: (props?: ({
|
|
3
3
|
variant?: "strong" | "outline" | "ghost" | null | undefined;
|
|
4
4
|
color?: "action" | "danger" | "warning" | "success" | "info" | null | undefined;
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "small" | "default" | null | undefined;
|
|
6
6
|
mode?: "light" | "dark" | null | undefined;
|
|
7
7
|
fullWidth?: boolean | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export declare const buttonTextVariants: (props?: ({
|
|
10
10
|
variant?: "strong" | "outline" | "ghost" | null | undefined;
|
|
11
11
|
color?: "action" | "danger" | "warning" | "success" | "info" | null | undefined;
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "small" | "default" | null | undefined;
|
|
13
13
|
mode?: "light" | "dark" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
15
|
export declare const buttonSpinnerVariants: (props?: ({
|
|
@@ -22,7 +22,7 @@ export declare const buttonGroupVariants: (props?: ({
|
|
|
22
22
|
isAttached?: boolean | null | undefined;
|
|
23
23
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
24
|
export declare const buttonIconVariants: (props?: ({
|
|
25
|
-
size?: "
|
|
25
|
+
size?: "small" | "default" | null | undefined;
|
|
26
26
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
27
|
export type ButtonVariantProps = VariantProps<typeof buttonRootVariants>;
|
|
28
28
|
export type ButtonGroupVariantProps = VariantProps<typeof buttonGroupVariants>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const checkboxRootVariants: (props?: ({
|
|
3
|
-
size?: "
|
|
3
|
+
size?: "small" | "default" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export declare const checkboxIndicatorVariants: (props?: ({
|
|
6
|
-
size?: "
|
|
6
|
+
size?: "small" | "default" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export declare const checkboxIconVariants: (props?: ({
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "small" | "default" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
export declare const checkboxLabelVariants: (props?: ({
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "small" | "default" | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
14
|
export declare const checkboxGroupVariants: (props?: ({
|
|
15
15
|
direction?: "row" | "column" | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const headingStyle: (props?: ({
|
|
3
|
-
size?: "
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export type HeadingVariantProps = VariantProps<typeof headingStyle>;
|
|
6
6
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const inputRootVariants: (props?: ({
|
|
3
3
|
variant?: "outline" | null | undefined;
|
|
4
|
-
size?: "
|
|
4
|
+
size?: "small" | "default" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const inputFieldVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "small" | "default" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export declare const inputSlotVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
10
|
export declare const inputIconVariants: (props?: ({
|
|
11
|
-
size?: "
|
|
11
|
+
size?: "small" | "default" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
export declare const inputFieldPlaceholderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
14
|
export type InputVariantProps = VariantProps<typeof inputRootVariants>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const selectTriggerVariants: (props?: ({
|
|
3
3
|
variant?: "outline" | null | undefined;
|
|
4
|
-
size?: "
|
|
4
|
+
size?: "small" | "default" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const selectValueVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "small" | "default" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export declare const selectIconVariants: (props?: ({
|
|
10
|
-
size?: "
|
|
10
|
+
size?: "small" | "default" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
export declare const selectContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
13
13
|
export declare const selectItemVariants: (props?: ({
|
|
14
|
-
size?: "
|
|
14
|
+
size?: "small" | "default" | null | undefined;
|
|
15
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
16
|
export declare const selectItemLabelVariants: (props?: ({
|
|
17
|
-
size?: "
|
|
17
|
+
size?: "small" | "default" | null | undefined;
|
|
18
18
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
19
|
export type SelectVariantProps = VariantProps<typeof selectTriggerVariants>;
|
|
20
20
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type StackSpace = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
2
|
export declare const hStackRootVariants: (props?: ({
|
|
3
3
|
reversed?: boolean | null | undefined;
|
|
4
|
-
space?: "
|
|
4
|
+
space?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const vStackRootVariants: (props?: ({
|
|
7
7
|
reversed?: boolean | null | undefined;
|
|
8
|
-
space?: "
|
|
8
|
+
space?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -12,14 +12,14 @@ export declare const switchIosBgVariants: (props?: ({
|
|
|
12
12
|
isInvalid?: boolean | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
14
|
export declare const switchTrackVariants: (props?: ({
|
|
15
|
-
size?: "
|
|
15
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
17
|
export declare const switchWebTrackColorVariants: (props?: ({
|
|
18
18
|
isChecked?: boolean | null | undefined;
|
|
19
19
|
isInvalid?: boolean | null | undefined;
|
|
20
20
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
21
|
export declare const switchThumbVariants: (props?: ({
|
|
22
|
-
size?: "
|
|
22
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
23
23
|
isChecked?: boolean | null | undefined;
|
|
24
24
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
25
25
|
export type SwitchVariantProps = VariantProps<typeof switchTrackVariants>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const textStyle: (props?: ({
|
|
3
|
-
size?: "
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export type TextVariantProps = VariantProps<typeof textStyle>;
|
|
6
6
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ForwardedRef, ReactElement } from 'react';
|
|
2
|
+
import { type FlashListProps, type FlashListRef } from '@shopify/flash-list';
|
|
3
|
+
export type VirtualizedListRef = FlashListRef<unknown>;
|
|
4
|
+
export type VirtualizedListProps<T = unknown> = FlashListProps<T>;
|
|
5
|
+
export declare const VirtualizedList: <T>(props: VirtualizedListProps<T> & {
|
|
6
|
+
ref?: ForwardedRef<FlashListRef<T>>;
|
|
7
|
+
}) => ReactElement | null;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/VirtualizedList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAa,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AACvD,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;AASlE,eAAO,MAAM,eAAe,EAAuC,CAAC,CAAC,EACnE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,KACrE,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
export * from './Avatar';
|
|
1
2
|
export * from './Box';
|
|
2
3
|
export * from './Button';
|
|
3
4
|
export * from './Checkbox';
|
|
4
5
|
export * from './Input';
|
|
5
6
|
export * from './Link';
|
|
6
7
|
export * from './Select';
|
|
8
|
+
export * from './VirtualizedList';
|
|
7
9
|
export * from './Switch';
|
|
8
10
|
export { HStack, VStack } from './Stack';
|
|
9
11
|
export * from './Heading';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.18",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -41,12 +41,16 @@
|
|
|
41
41
|
]
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
+
"@shopify/flash-list": ">=2.0.0",
|
|
44
45
|
"react": "^18.2.0 || ^19.0.0",
|
|
45
46
|
"react-native": ">=0.76.0",
|
|
46
47
|
"react-native-reanimated": ">=3.0.0",
|
|
47
48
|
"react-native-web": ">=0.19.0"
|
|
48
49
|
},
|
|
49
50
|
"peerDependenciesMeta": {
|
|
51
|
+
"@shopify/flash-list": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
50
54
|
"react-native": {
|
|
51
55
|
"optional": true
|
|
52
56
|
},
|
|
@@ -60,9 +64,9 @@
|
|
|
60
64
|
"dependencies": {
|
|
61
65
|
"class-variance-authority": "^0.7.1",
|
|
62
66
|
"uniwind": "1.4.1",
|
|
63
|
-
"@cdx-ui/
|
|
64
|
-
"@cdx-ui/
|
|
65
|
-
"@cdx-ui/icons": "0.0.1-alpha.
|
|
67
|
+
"@cdx-ui/primitives": "0.0.1-alpha.18",
|
|
68
|
+
"@cdx-ui/utils": "0.0.1-alpha.18",
|
|
69
|
+
"@cdx-ui/icons": "0.0.1-alpha.18"
|
|
66
70
|
},
|
|
67
71
|
"devDependencies": {
|
|
68
72
|
"@types/react": "*",
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
+
import { Image, Text, View, type ImageProps, type TextProps, type ViewProps } from 'react-native';
|
|
3
|
+
import { createAvatar, type IAvatarImageProps, type IAvatarProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
5
|
+
import { Icon as IconComponent, type IconProps } from '../Icon';
|
|
6
|
+
import {
|
|
7
|
+
type AvatarVariantProps,
|
|
8
|
+
avatarBadgeVariants,
|
|
9
|
+
avatarIconVariants,
|
|
10
|
+
avatarTextVariants,
|
|
11
|
+
avatarImageVariants,
|
|
12
|
+
avatarRootVariants,
|
|
13
|
+
} from './styles';
|
|
14
|
+
|
|
15
|
+
const SCOPE = 'AVATAR';
|
|
16
|
+
|
|
17
|
+
const Root = withStyleContext(View, SCOPE);
|
|
18
|
+
|
|
19
|
+
const useAvatarStyleContext = () => useStyleContext(SCOPE) as AvatarVariantProps;
|
|
20
|
+
|
|
21
|
+
const AvatarPrimitive = createAvatar({
|
|
22
|
+
Root,
|
|
23
|
+
Image,
|
|
24
|
+
Text,
|
|
25
|
+
Icon: IconComponent,
|
|
26
|
+
Badge: View,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// AVATAR ROOT
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
export interface AvatarProps extends ViewProps, IAvatarProps, AvatarVariantProps {
|
|
34
|
+
className?: string;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const AvatarRoot = forwardRef<View, AvatarProps>(
|
|
39
|
+
({ size = 'lg', className, children, style, ...props }, ref) => {
|
|
40
|
+
const computedClassName = cn(avatarRootVariants({ size }), className);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<AvatarPrimitive
|
|
44
|
+
ref={ref as never}
|
|
45
|
+
className={computedClassName}
|
|
46
|
+
style={style}
|
|
47
|
+
context={{ size }}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</AvatarPrimitive>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
AvatarRoot.displayName = 'Avatar';
|
|
57
|
+
|
|
58
|
+
// =============================================================================
|
|
59
|
+
// AVATAR IMAGE
|
|
60
|
+
// =============================================================================
|
|
61
|
+
|
|
62
|
+
export interface AvatarImageProps extends Omit<ImageProps, 'source'>, IAvatarImageProps {
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const AvatarImage = forwardRef<Image, AvatarImageProps>(({ className, style, ...props }, ref) => {
|
|
67
|
+
const computedClassName = cn(avatarImageVariants(), className);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<AvatarPrimitive.Image
|
|
71
|
+
ref={ref as never}
|
|
72
|
+
className={computedClassName}
|
|
73
|
+
style={style}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
80
|
+
|
|
81
|
+
// =============================================================================
|
|
82
|
+
// AVATAR TEXT
|
|
83
|
+
// =============================================================================
|
|
84
|
+
|
|
85
|
+
export interface AvatarTextProps extends TextProps {
|
|
86
|
+
className?: string;
|
|
87
|
+
children?: ReactNode;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const AvatarText = forwardRef<Text, AvatarTextProps>(
|
|
91
|
+
({ className, children, style, ...props }, ref) => {
|
|
92
|
+
const { size } = useAvatarStyleContext();
|
|
93
|
+
const computedClassName = cn(avatarTextVariants({ size }), className);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<AvatarPrimitive.Text
|
|
97
|
+
ref={ref as never}
|
|
98
|
+
className={computedClassName}
|
|
99
|
+
style={style}
|
|
100
|
+
{...props}
|
|
101
|
+
>
|
|
102
|
+
{children}
|
|
103
|
+
</AvatarPrimitive.Text>
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
AvatarText.displayName = 'Avatar.Text';
|
|
109
|
+
|
|
110
|
+
// =============================================================================
|
|
111
|
+
// AVATAR ICON
|
|
112
|
+
// =============================================================================
|
|
113
|
+
|
|
114
|
+
export interface AvatarIconProps extends Omit<IconProps, 'children'> {
|
|
115
|
+
className?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const AvatarIcon = ({ className, style, ...props }: AvatarIconProps) => {
|
|
119
|
+
const { size } = useAvatarStyleContext();
|
|
120
|
+
const computedClassName = cn(avatarIconVariants({ size }), className);
|
|
121
|
+
|
|
122
|
+
return <AvatarPrimitive.Icon className={computedClassName} style={style} {...props} />;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
AvatarIcon.displayName = 'Avatar.Icon';
|
|
126
|
+
|
|
127
|
+
// =============================================================================
|
|
128
|
+
// AVATAR BADGE
|
|
129
|
+
// =============================================================================
|
|
130
|
+
|
|
131
|
+
export interface AvatarBadgeProps extends ViewProps {
|
|
132
|
+
className?: string;
|
|
133
|
+
children?: ReactNode;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const AvatarBadge = forwardRef<View, AvatarBadgeProps>(
|
|
137
|
+
({ className, children, style, ...props }, ref) => {
|
|
138
|
+
const { size } = useAvatarStyleContext();
|
|
139
|
+
const computedClassName = cn(avatarBadgeVariants({ size }), className);
|
|
140
|
+
|
|
141
|
+
return (
|
|
142
|
+
<AvatarPrimitive.Badge
|
|
143
|
+
ref={ref as never}
|
|
144
|
+
className={computedClassName}
|
|
145
|
+
style={style}
|
|
146
|
+
{...props}
|
|
147
|
+
>
|
|
148
|
+
{children}
|
|
149
|
+
</AvatarPrimitive.Badge>
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
AvatarBadge.displayName = 'Avatar.Badge';
|
|
155
|
+
|
|
156
|
+
// =============================================================================
|
|
157
|
+
// COMPOUND COMPONENT
|
|
158
|
+
// =============================================================================
|
|
159
|
+
|
|
160
|
+
type AvatarCompoundComponent = typeof AvatarRoot & {
|
|
161
|
+
Image: typeof AvatarImage;
|
|
162
|
+
Text: typeof AvatarText;
|
|
163
|
+
Icon: typeof AvatarIcon;
|
|
164
|
+
Badge: typeof AvatarBadge;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const Avatar = Object.assign(AvatarRoot, {
|
|
168
|
+
Image: AvatarImage,
|
|
169
|
+
Text: AvatarText,
|
|
170
|
+
Icon: AvatarIcon,
|
|
171
|
+
Badge: AvatarBadge,
|
|
172
|
+
}) as AvatarCompoundComponent;
|
|
173
|
+
|
|
174
|
+
export type { AvatarVariantProps };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { COLOR_BG_MUTED, COLOR_TEXT_SECONDARY, RADIUS_FULL } from '../../styles/primitives';
|
|
3
|
+
|
|
4
|
+
// ── Root ─────────────────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
export const avatarRootVariants = cva(
|
|
7
|
+
[RADIUS_FULL, 'relative items-center justify-center', COLOR_BG_MUTED],
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: 'w-8 h-8',
|
|
12
|
+
md: 'w-10 h-10',
|
|
13
|
+
lg: 'w-12 h-12',
|
|
14
|
+
xl: 'w-16 h-16',
|
|
15
|
+
'2xl': 'w-20 h-20',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: 'lg',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// ── Image ────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
export const avatarImageVariants = cva([
|
|
27
|
+
'absolute top-0 left-0 w-full h-full',
|
|
28
|
+
RADIUS_FULL,
|
|
29
|
+
'overflow-hidden',
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
// ── Text ─────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
export const avatarTextVariants = cva([COLOR_TEXT_SECONDARY, 'font-semibold'], {
|
|
35
|
+
variants: {
|
|
36
|
+
size: {
|
|
37
|
+
sm: 'text-xs',
|
|
38
|
+
md: 'text-sm',
|
|
39
|
+
lg: 'text-base',
|
|
40
|
+
xl: 'text-xl',
|
|
41
|
+
'2xl': 'text-2xl',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
size: 'lg',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// ── Icon ─────────────────────────────────────────────────
|
|
50
|
+
|
|
51
|
+
export const avatarIconVariants = cva([COLOR_TEXT_SECONDARY], {
|
|
52
|
+
variants: {
|
|
53
|
+
size: {
|
|
54
|
+
sm: 'size-4',
|
|
55
|
+
md: 'size-5',
|
|
56
|
+
lg: 'size-6',
|
|
57
|
+
xl: 'size-8',
|
|
58
|
+
'2xl': 'size-10',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
size: 'lg',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// ── Badge ────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
export const avatarBadgeVariants = cva(['absolute border-2 border-white', RADIUS_FULL], {
|
|
69
|
+
variants: {
|
|
70
|
+
size: {
|
|
71
|
+
sm: 'w-2.5 h-2.5 bottom-0 right-0',
|
|
72
|
+
md: 'w-3 h-3 bottom-0 right-0',
|
|
73
|
+
lg: 'w-3.5 h-3.5 bottom-0 right-0',
|
|
74
|
+
xl: 'w-4 h-4 bottom-0.5 right-0.5',
|
|
75
|
+
'2xl': 'w-5 h-5 bottom-0.5 right-0.5',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
defaultVariants: {
|
|
79
|
+
size: 'lg',
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export type AvatarVariantProps = VariantProps<typeof avatarRootVariants>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ForwardedRef, ReactElement } from 'react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { FlashList, type FlashListProps, type FlashListRef } from '@shopify/flash-list';
|
|
4
|
+
|
|
5
|
+
export type VirtualizedListRef = FlashListRef<unknown>;
|
|
6
|
+
export type VirtualizedListProps<T = unknown> = FlashListProps<T>;
|
|
7
|
+
|
|
8
|
+
function VirtualizedListInner<T>(
|
|
9
|
+
props: VirtualizedListProps<T>,
|
|
10
|
+
ref: ForwardedRef<FlashListRef<T>>,
|
|
11
|
+
) {
|
|
12
|
+
return <FlashList ref={ref} role="list" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const VirtualizedList = forwardRef(VirtualizedListInner) as <T>(
|
|
16
|
+
props: VirtualizedListProps<T> & { ref?: ForwardedRef<FlashListRef<T>> },
|
|
17
|
+
) => ReactElement | null;
|
|
18
|
+
|
|
19
|
+
(VirtualizedList as { displayName?: string }).displayName = 'VirtualizedList';
|
package/src/components/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
export * from './Avatar';
|
|
1
2
|
export * from './Box';
|
|
2
3
|
export * from './Button';
|
|
3
4
|
export * from './Checkbox';
|
|
4
5
|
export * from './Input';
|
|
5
6
|
export * from './Link';
|
|
6
7
|
export * from './Select';
|
|
8
|
+
export * from './VirtualizedList';
|
|
7
9
|
export * from './Switch';
|
|
8
10
|
export { HStack, VStack } from './Stack';
|
|
9
11
|
export * from './Heading';
|