@cdx-ui/components 0.0.1-beta.36 → 0.0.1-beta.38
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 +1 -1
- package/lib/commonjs/components/Avatar/styles.js +36 -29
- package/lib/commonjs/components/Avatar/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +78 -9
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +207 -21
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/figma/Avatar.figma.js +54 -0
- package/lib/commonjs/figma/Avatar.figma.js.map +1 -0
- package/lib/commonjs/figma/Chip.figma.js +68 -0
- package/lib/commonjs/figma/Chip.figma.js.map +1 -0
- package/lib/module/components/Avatar/index.js +1 -1
- package/lib/module/components/Avatar/styles.js +36 -29
- package/lib/module/components/Avatar/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +82 -13
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Chip/styles.js +206 -20
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/figma/Avatar.figma.js +48 -0
- package/lib/module/figma/Avatar.figma.js.map +1 -0
- package/lib/module/figma/Chip.figma.js +62 -0
- package/lib/module/figma/Chip.figma.js.map +1 -0
- package/lib/typescript/components/Avatar/styles.d.ts +4 -4
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +19 -6
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +13 -4
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts +1 -1
- package/lib/typescript/components/Stack/styles.d.ts +2 -2
- package/lib/typescript/components/Text/styles.d.ts +1 -1
- package/lib/typescript/figma/Avatar.figma.d.ts +8 -0
- package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Chip.figma.d.ts +8 -0
- package/lib/typescript/figma/Chip.figma.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Avatar/styles.ts +49 -34
- package/src/components/Chip/index.tsx +104 -27
- package/src/components/Chip/styles.ts +232 -18
|
@@ -27,7 +27,7 @@ const AvatarPrimitive = (0, _primitives.createAvatar)({
|
|
|
27
27
|
// =============================================================================
|
|
28
28
|
|
|
29
29
|
const AvatarRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
30
|
-
size = '
|
|
30
|
+
size = 'md',
|
|
31
31
|
className,
|
|
32
32
|
children,
|
|
33
33
|
style,
|
|
@@ -5,76 +5,83 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.avatarTextVariants = exports.avatarRootVariants = exports.avatarImageVariants = exports.avatarIconVariants = exports.avatarBadgeVariants = void 0;
|
|
7
7
|
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
-
var _primitives = require("../../styles/primitives");
|
|
9
8
|
// ── Root ─────────────────────────────────────────────────
|
|
10
9
|
|
|
11
|
-
const avatarRootVariants = exports.avatarRootVariants = (0, _classVarianceAuthority.cva)([
|
|
10
|
+
const avatarRootVariants = exports.avatarRootVariants = (0, _classVarianceAuthority.cva)(['rounded-[var(--border-radius-round)]', 'relative items-center justify-center', 'bg-surface-tertiary'], {
|
|
12
11
|
variants: {
|
|
13
12
|
size: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
'2xs': 'w-3 h-3',
|
|
14
|
+
xs: 'w-[18px] h-[18px]',
|
|
15
|
+
sm: 'w-6 h-6',
|
|
16
|
+
md: 'w-8 h-8',
|
|
17
|
+
lg: 'w-10 h-10',
|
|
18
|
+
xl: 'w-12 h-12',
|
|
19
|
+
'2xl': 'w-14 h-14'
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
defaultVariants: {
|
|
22
|
-
size: '
|
|
23
|
+
size: 'md'
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
// ── Image ────────────────────────────────────────────────
|
|
27
28
|
|
|
28
|
-
const avatarImageVariants = exports.avatarImageVariants = (0, _classVarianceAuthority.cva)(['absolute top-0 left-0 w-full h-full',
|
|
29
|
+
const avatarImageVariants = exports.avatarImageVariants = (0, _classVarianceAuthority.cva)(['absolute top-0 left-0 w-full h-full', 'rounded-[var(--border-radius-round)]', 'overflow-hidden', 'border border-stroke-secondary']);
|
|
29
30
|
|
|
30
31
|
// ── Text ─────────────────────────────────────────────────
|
|
31
32
|
|
|
32
|
-
const avatarTextVariants = exports.avatarTextVariants = (0, _classVarianceAuthority.cva)([
|
|
33
|
+
const avatarTextVariants = exports.avatarTextVariants = (0, _classVarianceAuthority.cva)(['text-content-primary', 'font-medium'], {
|
|
33
34
|
variants: {
|
|
34
35
|
size: {
|
|
36
|
+
'2xs': 'text-[6px]',
|
|
37
|
+
xs: 'text-[9px]',
|
|
35
38
|
sm: 'text-xs',
|
|
36
|
-
md: 'text-
|
|
37
|
-
lg: 'text-
|
|
38
|
-
xl: 'text-
|
|
39
|
-
'2xl': 'text-
|
|
39
|
+
md: 'text-base',
|
|
40
|
+
lg: 'text-xl',
|
|
41
|
+
xl: 'text-2xl',
|
|
42
|
+
'2xl': 'text-[28px]'
|
|
40
43
|
}
|
|
41
44
|
},
|
|
42
45
|
defaultVariants: {
|
|
43
|
-
size: '
|
|
46
|
+
size: 'md'
|
|
44
47
|
}
|
|
45
48
|
});
|
|
46
49
|
|
|
47
50
|
// ── Icon ─────────────────────────────────────────────────
|
|
48
51
|
|
|
49
|
-
const avatarIconVariants = exports.avatarIconVariants = (0, _classVarianceAuthority.cva)([
|
|
52
|
+
const avatarIconVariants = exports.avatarIconVariants = (0, _classVarianceAuthority.cva)(['text-content-primary'], {
|
|
50
53
|
variants: {
|
|
51
54
|
size: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
'2xs': 'size-1.5',
|
|
56
|
+
xs: 'size-[9px]',
|
|
57
|
+
sm: 'size-3',
|
|
58
|
+
md: 'size-4',
|
|
59
|
+
lg: 'size-5',
|
|
60
|
+
xl: 'size-6',
|
|
61
|
+
'2xl': 'size-7'
|
|
57
62
|
}
|
|
58
63
|
},
|
|
59
64
|
defaultVariants: {
|
|
60
|
-
size: '
|
|
65
|
+
size: 'md'
|
|
61
66
|
}
|
|
62
67
|
});
|
|
63
68
|
|
|
64
69
|
// ── Badge ────────────────────────────────────────────────
|
|
65
70
|
|
|
66
|
-
const avatarBadgeVariants = exports.avatarBadgeVariants = (0, _classVarianceAuthority.cva)(['absolute border-
|
|
71
|
+
const avatarBadgeVariants = exports.avatarBadgeVariants = (0, _classVarianceAuthority.cva)(['absolute border-white', 'rounded-[var(--border-radius-round)]', 'bottom-0 right-0'], {
|
|
67
72
|
variants: {
|
|
68
73
|
size: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
'2xs': 'w-1.5 h-1.5 border translate-x-[21%] translate-y-[21%]',
|
|
75
|
+
xs: 'w-2 h-2 border translate-x-[17%] translate-y-[17%]',
|
|
76
|
+
sm: 'w-2.5 h-2.5 border-2 translate-x-[15%] translate-y-[15%]',
|
|
77
|
+
md: 'w-3 h-3 border-2 translate-x-[11%] translate-y-[11%]',
|
|
78
|
+
lg: 'w-3.5 h-3.5 border-2 translate-x-[8%] translate-y-[8%]',
|
|
79
|
+
xl: 'w-4 h-4 border-2 translate-x-[6%] translate-y-[6%]',
|
|
80
|
+
'2xl': 'w-5 h-5 border-2 translate-x-[9%] translate-y-[9%]'
|
|
74
81
|
}
|
|
75
82
|
},
|
|
76
83
|
defaultVariants: {
|
|
77
|
-
size: '
|
|
84
|
+
size: 'md'
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
87
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classVarianceAuthority","require","
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","avatarRootVariants","exports","cva","variants","size","xs","sm","md","lg","xl","defaultVariants","avatarImageVariants","avatarTextVariants","avatarIconVariants","avatarBadgeVariants"],"sourceRoot":"../../../../src","sources":["components/Avatar/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAEA;;AAEO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,2BAAG,EACnC,CACE,sCAAsC,EACtC,sCAAsC,EACtC,qBAAqB,CACtB,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJ,KAAK,EAAE,SAAS;MAChBC,EAAE,EAAE,mBAAmB;MACvBC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACf,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfN,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEO,MAAMO,mBAAmB,GAAAV,OAAA,CAAAU,mBAAA,GAAG,IAAAT,2BAAG,EAAC,CACrC,qCAAqC,EACrC,sCAAsC,EACtC,iBAAiB,EACjB,gCAAgC,CACjC,CAAC;;AAEF;;AAEO,MAAMU,kBAAkB,GAAAX,OAAA,CAAAW,kBAAA,GAAG,IAAAV,2BAAG,EAAC,CAAC,sBAAsB,EAAE,aAAa,CAAC,EAAE;EAC7EC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJ,KAAK,EAAE,YAAY;MACnBC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,UAAU;MACd,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfN,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEO,MAAMS,kBAAkB,GAAAZ,OAAA,CAAAY,kBAAA,GAAG,IAAAX,2BAAG,EAAC,CAAC,sBAAsB,CAAC,EAAE;EAC9DC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJ,KAAK,EAAE,UAAU;MACjBC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZ,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfN,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEO,MAAMU,mBAAmB,GAAAb,OAAA,CAAAa,mBAAA,GAAG,IAAAZ,2BAAG,EACpC,CAAC,uBAAuB,EAAE,sCAAsC,EAAE,kBAAkB,CAAC,EACrF;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJ,KAAK,EAAE,wDAAwD;MAC/DC,EAAE,EAAE,oDAAoD;MACxDC,EAAE,EAAE,0DAA0D;MAC9DC,EAAE,EAAE,sDAAsD;MAC1DC,EAAE,EAAE,wDAAwD;MAC5DC,EAAE,EAAE,oDAAoD;MACxD,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfN,IAAI,EAAE;EACR;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -6,43 +6,74 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Chip = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
10
|
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _Avatar = require("../Avatar");
|
|
10
12
|
var _Icon = require("../Icon");
|
|
11
13
|
var _styles = require("./styles");
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
15
|
const SCOPE = 'CHIP';
|
|
14
|
-
const
|
|
16
|
+
const RootView = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
17
|
+
const RootPressable = (0, _utils.withStyleContext)(_reactNative.Pressable, SCOPE);
|
|
18
|
+
const ChipPrimitive = (0, _primitives.createChip)({
|
|
19
|
+
View: RootView,
|
|
20
|
+
Pressable: RootPressable
|
|
21
|
+
});
|
|
15
22
|
const useChipStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
16
23
|
|
|
17
24
|
// =============================================================================
|
|
18
|
-
//
|
|
25
|
+
// ROOT
|
|
19
26
|
// =============================================================================
|
|
20
27
|
|
|
21
28
|
const ChipRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
22
29
|
children,
|
|
30
|
+
variant = 'tint',
|
|
31
|
+
size = 'default',
|
|
23
32
|
color = 'default',
|
|
24
33
|
className,
|
|
25
34
|
style,
|
|
35
|
+
asChild,
|
|
26
36
|
...props
|
|
27
37
|
}, ref) => {
|
|
38
|
+
const parentContextValues = (0, _utils.useParentContext)();
|
|
39
|
+
const styleContextValues = (0, _react.useMemo)(() => ({
|
|
40
|
+
...parentContextValues,
|
|
41
|
+
[SCOPE]: {
|
|
42
|
+
variant,
|
|
43
|
+
size,
|
|
44
|
+
color
|
|
45
|
+
}
|
|
46
|
+
}), [parentContextValues, variant, size, color]);
|
|
28
47
|
const computedClassName = (0, _utils.cn)((0, _styles.chipRootVariants)({
|
|
48
|
+
variant,
|
|
49
|
+
size,
|
|
29
50
|
color
|
|
30
51
|
}), className);
|
|
31
|
-
|
|
52
|
+
const root = /*#__PURE__*/(0, _jsxRuntime.jsx)(ChipPrimitive, {
|
|
32
53
|
ref: ref,
|
|
54
|
+
asChild: asChild,
|
|
33
55
|
className: computedClassName,
|
|
34
|
-
style: style,
|
|
35
56
|
context: {
|
|
57
|
+
variant,
|
|
58
|
+
size,
|
|
36
59
|
color
|
|
37
60
|
},
|
|
61
|
+
style: style,
|
|
38
62
|
...props,
|
|
39
63
|
children: children
|
|
40
64
|
});
|
|
65
|
+
if (asChild) {
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
67
|
+
value: styleContextValues,
|
|
68
|
+
children: root
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return root;
|
|
41
72
|
});
|
|
42
73
|
ChipRoot.displayName = 'Chip';
|
|
43
74
|
|
|
44
75
|
// =============================================================================
|
|
45
|
-
//
|
|
76
|
+
// LABEL
|
|
46
77
|
// =============================================================================
|
|
47
78
|
|
|
48
79
|
const ChipLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
@@ -52,9 +83,13 @@ const ChipLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
52
83
|
...props
|
|
53
84
|
}, ref) => {
|
|
54
85
|
const {
|
|
86
|
+
size,
|
|
87
|
+
variant,
|
|
55
88
|
color
|
|
56
89
|
} = useChipStyleContext();
|
|
57
90
|
const computedClassName = (0, _utils.cn)((0, _styles.chipLabelVariants)({
|
|
91
|
+
size,
|
|
92
|
+
variant,
|
|
58
93
|
color
|
|
59
94
|
}), className);
|
|
60
95
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
@@ -68,20 +103,24 @@ const ChipLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
68
103
|
ChipLabel.displayName = 'Chip.Label';
|
|
69
104
|
|
|
70
105
|
// =============================================================================
|
|
71
|
-
//
|
|
106
|
+
// ICON
|
|
72
107
|
// =============================================================================
|
|
73
108
|
|
|
74
109
|
const ChipIcon = ({
|
|
75
110
|
className,
|
|
76
111
|
style,
|
|
77
112
|
as,
|
|
113
|
+
slot,
|
|
78
114
|
...props
|
|
79
115
|
}) => {
|
|
80
116
|
const {
|
|
117
|
+
size,
|
|
81
118
|
color
|
|
82
119
|
} = useChipStyleContext();
|
|
83
120
|
const computedClassName = (0, _utils.cn)((0, _styles.chipIconVariants)({
|
|
84
|
-
|
|
121
|
+
size,
|
|
122
|
+
color,
|
|
123
|
+
slot
|
|
85
124
|
}), className);
|
|
86
125
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
87
126
|
as: as,
|
|
@@ -93,11 +132,41 @@ const ChipIcon = ({
|
|
|
93
132
|
ChipIcon.displayName = 'Chip.Icon';
|
|
94
133
|
|
|
95
134
|
// =============================================================================
|
|
96
|
-
//
|
|
135
|
+
// AVATAR
|
|
136
|
+
// =============================================================================
|
|
137
|
+
|
|
138
|
+
const ChipAvatar = ({
|
|
139
|
+
className,
|
|
140
|
+
style,
|
|
141
|
+
children,
|
|
142
|
+
...props
|
|
143
|
+
}) => {
|
|
144
|
+
const {
|
|
145
|
+
size
|
|
146
|
+
} = useChipStyleContext();
|
|
147
|
+
// chipAvatarVariants sets w/h and the leading slot negative margin.
|
|
148
|
+
// Avatar renders with size="sm" (its smallest named size) but chipAvatarVariants
|
|
149
|
+
// overrides the w/h via tailwind-merge so the chip size wins.
|
|
150
|
+
const computedClassName = (0, _utils.cn)((0, _styles.chipAvatarVariants)({
|
|
151
|
+
size
|
|
152
|
+
}), className);
|
|
153
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
154
|
+
size: "sm",
|
|
155
|
+
className: computedClassName,
|
|
156
|
+
style: style,
|
|
157
|
+
...props,
|
|
158
|
+
children: children
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
ChipAvatar.displayName = 'Chip.Avatar';
|
|
162
|
+
|
|
163
|
+
// =============================================================================
|
|
164
|
+
// COMPOUND EXPORT
|
|
97
165
|
// =============================================================================
|
|
98
166
|
|
|
99
167
|
const Chip = exports.Chip = Object.assign(ChipRoot, {
|
|
100
168
|
Label: ChipLabel,
|
|
101
|
-
Icon: ChipIcon
|
|
169
|
+
Icon: ChipIcon,
|
|
170
|
+
Avatar: ChipAvatar
|
|
102
171
|
});
|
|
103
172
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_Icon","_styles","_jsxRuntime","SCOPE","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Avatar","_Icon","_styles","_jsxRuntime","SCOPE","RootView","withStyleContext","View","RootPressable","Pressable","ChipPrimitive","createChip","useChipStyleContext","useStyleContext","ChipRoot","forwardRef","children","variant","size","color","className","style","asChild","props","ref","parentContextValues","useParentContext","styleContextValues","useMemo","computedClassName","cn","chipRootVariants","root","jsx","context","ParentContext","Provider","value","displayName","ChipLabel","chipLabelVariants","Text","ChipIcon","as","slot","chipIconVariants","Icon","ChipAvatar","chipAvatarVariants","Avatar","Chip","exports","Object","assign","Label"],"sourceRoot":"../../../../src","sources":["components/Chip/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAQA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAMkB,IAAAO,WAAA,GAAAP,OAAA;AAElB,MAAMQ,KAAK,GAAG,MAAM;AAEpB,MAAMC,QAAQ,GAAG,IAAAC,uBAAgB,EAACC,iBAAI,EAAEH,KAAK,CAAC;AAC9C,MAAMI,aAAa,GAAG,IAAAF,uBAAgB,EAACG,sBAAS,EAAEL,KAAK,CAAC;AAExD,MAAMM,aAAa,GAAG,IAAAC,sBAAU,EAAC;EAC/BJ,IAAI,EAAEF,QAAQ;EACdI,SAAS,EAAED;AACb,CAAC,CAAC;AAEF,MAAMI,mBAAmB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACT,KAAK,CAAqB;;AAE5E;AACA;AACA;;AAOA,MAAMU,QAAQ,gBAAG,IAAAC,iBAAU,EACzB,CACE;EACEC,QAAQ;EACRC,OAAO,GAAG,MAA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AAC,KAAK;EAChF,MAAM;IAAEL;EAAK,CAAC,GAAGN,mBAAmB,CAAC,CAAC;EACtC;EACA;EACA;EACA,MAAMiB,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAkB,0BAAkB,EAAC;IAAE9B;EAAK,CAAC,CAAC,EAAEE,SAAS,CAAC;EAErE,oBACE,IAAAjB,WAAA,CAAA8B,GAAA,EAACjC,OAAA,CAAAiD,MAAM;IAAC/B,IAAI,EAAC,IAAI;IAACE,SAAS,EAAES,iBAAkB;IAACR,KAAK,EAAEA,KAAM;IAAA,GAAKE,KAAK;IAAAP,QAAA,EACpEA;EAAQ,CACH,CAAC;AAEb,CAAC;AAED+B,UAAU,CAACT,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAQO,MAAMY,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAGE,MAAM,CAACC,MAAM,CAACvC,QAAQ,EAAE;EAC1CwC,KAAK,EAAEf,SAAS;EAChBO,IAAI,EAAEJ,QAAQ;EACdO,MAAM,EAAEF;AACV,CAAC,CAA0B","ignoreList":[]}
|
|
@@ -3,50 +3,236 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.chipRootVariants = exports.chipLabelVariants = exports.chipIconVariants = void 0;
|
|
6
|
+
exports.chipRootVariants = exports.chipLabelVariants = exports.chipIconVariants = exports.chipAvatarVariants = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
7
8
|
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
-
|
|
9
|
+
var _primitives = require("../../styles/primitives");
|
|
10
|
+
const chipInteractiveRoot = [_primitives.TRANSITION_COLORS, 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', _primitives.DISABLED_CURSOR, _reactNative.Platform.select({
|
|
11
|
+
web: ['outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[var(--color-stroke-focus)] web:data-[focus-visible=true]:ring-offset-1'].join(' '),
|
|
12
|
+
default: ''
|
|
13
|
+
})];
|
|
14
|
+
const chipRootVariants = exports.chipRootVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center justify-center self-start overflow-hidden', ...chipInteractiveRoot], {
|
|
9
15
|
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
tint: [],
|
|
18
|
+
outline: ['bg-transparent', 'border']
|
|
19
|
+
},
|
|
10
20
|
color: {
|
|
11
|
-
default:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
default: [],
|
|
22
|
+
action: [],
|
|
23
|
+
danger: [],
|
|
24
|
+
warning: [],
|
|
25
|
+
success: [],
|
|
26
|
+
info: []
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
default: 'h-8 max-h-8 min-h-8 gap-1.5 px-3 rounded-lg',
|
|
30
|
+
small: 'h-6 max-h-6 min-h-6 gap-1 px-1.5 rounded-md',
|
|
31
|
+
xsmall: 'h-4 max-h-4 min-h-4 gap-0.5 px-1 rounded-sm'
|
|
16
32
|
}
|
|
17
33
|
},
|
|
34
|
+
compoundVariants: [
|
|
35
|
+
// ── tint × color ────────────────────────────────────────────────────
|
|
36
|
+
{
|
|
37
|
+
variant: 'tint',
|
|
38
|
+
color: 'default',
|
|
39
|
+
className: ['bg-surface-neutral-tint', _reactNative.Platform.select({
|
|
40
|
+
default: 'data-[active=true]:bg-surface-neutral-tint-active',
|
|
41
|
+
web: 'data-[hover=true]:bg-surface-neutral-tint-hover data-[active=true]:data-[hover=true]:bg-surface-neutral-tint-active'
|
|
42
|
+
})]
|
|
43
|
+
}, {
|
|
44
|
+
variant: 'tint',
|
|
45
|
+
color: 'action',
|
|
46
|
+
className: ['bg-surface-action-tint', _reactNative.Platform.select({
|
|
47
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
48
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active'
|
|
49
|
+
})]
|
|
50
|
+
}, {
|
|
51
|
+
variant: 'tint',
|
|
52
|
+
color: 'danger',
|
|
53
|
+
className: ['bg-surface-danger-tint', _reactNative.Platform.select({
|
|
54
|
+
default: 'data-[active=true]:bg-surface-danger-tint-active',
|
|
55
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active'
|
|
56
|
+
})]
|
|
57
|
+
}, {
|
|
58
|
+
variant: 'tint',
|
|
59
|
+
color: 'warning',
|
|
60
|
+
className: ['bg-surface-warning-tint', _reactNative.Platform.select({
|
|
61
|
+
default: 'data-[active=true]:bg-surface-warning-tint-active',
|
|
62
|
+
web: 'data-[hover=true]:bg-surface-warning-tint-hover data-[active=true]:data-[hover=true]:bg-surface-warning-tint-active'
|
|
63
|
+
})]
|
|
64
|
+
}, {
|
|
65
|
+
variant: 'tint',
|
|
66
|
+
color: 'success',
|
|
67
|
+
className: ['bg-surface-success-tint', _reactNative.Platform.select({
|
|
68
|
+
default: 'data-[active=true]:bg-surface-success-tint-active',
|
|
69
|
+
web: 'data-[hover=true]:bg-surface-success-tint-hover data-[active=true]:data-[hover=true]:bg-surface-success-tint-active'
|
|
70
|
+
})]
|
|
71
|
+
}, {
|
|
72
|
+
variant: 'tint',
|
|
73
|
+
color: 'info',
|
|
74
|
+
className: ['bg-surface-info-tint', _reactNative.Platform.select({
|
|
75
|
+
default: 'data-[active=true]:bg-surface-info-tint-active',
|
|
76
|
+
web: 'data-[hover=true]:bg-surface-info-tint-hover data-[active=true]:data-[hover=true]:bg-surface-info-tint-active'
|
|
77
|
+
})]
|
|
78
|
+
},
|
|
79
|
+
// ── outline × color ───────────────────────────────────────────────────
|
|
80
|
+
{
|
|
81
|
+
variant: 'outline',
|
|
82
|
+
color: 'default',
|
|
83
|
+
className: ['border-stroke-primary', _reactNative.Platform.select({
|
|
84
|
+
default: 'data-[active=true]:bg-surface-neutral-tint',
|
|
85
|
+
web: 'data-[hover=true]:bg-surface-neutral-tint-hover data-[active=true]:data-[hover=true]:bg-surface-neutral-tint-active'
|
|
86
|
+
})]
|
|
87
|
+
}, {
|
|
88
|
+
variant: 'outline',
|
|
89
|
+
color: 'action',
|
|
90
|
+
className: ['border-stroke-action', _reactNative.Platform.select({
|
|
91
|
+
default: 'data-[active=true]:bg-surface-action-tint',
|
|
92
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active'
|
|
93
|
+
})]
|
|
94
|
+
}, {
|
|
95
|
+
variant: 'outline',
|
|
96
|
+
color: 'danger',
|
|
97
|
+
className: ['border-stroke-danger', _reactNative.Platform.select({
|
|
98
|
+
default: 'data-[active=true]:bg-surface-danger-tint',
|
|
99
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active'
|
|
100
|
+
})]
|
|
101
|
+
}, {
|
|
102
|
+
variant: 'outline',
|
|
103
|
+
color: 'warning',
|
|
104
|
+
className: ['border-stroke-warning', _reactNative.Platform.select({
|
|
105
|
+
default: 'data-[active=true]:bg-surface-warning-tint',
|
|
106
|
+
web: 'data-[hover=true]:bg-surface-warning-tint-hover data-[active=true]:data-[hover=true]:bg-surface-warning-tint-active'
|
|
107
|
+
})]
|
|
108
|
+
}, {
|
|
109
|
+
variant: 'outline',
|
|
110
|
+
color: 'success',
|
|
111
|
+
className: ['border-stroke-success', _reactNative.Platform.select({
|
|
112
|
+
default: 'data-[active=true]:bg-surface-success-tint',
|
|
113
|
+
web: 'data-[hover=true]:bg-surface-success-tint-hover data-[active=true]:data-[hover=true]:bg-surface-success-tint-active'
|
|
114
|
+
})]
|
|
115
|
+
}, {
|
|
116
|
+
variant: 'outline',
|
|
117
|
+
color: 'info',
|
|
118
|
+
className: ['border-stroke-info', _reactNative.Platform.select({
|
|
119
|
+
default: 'data-[active=true]:bg-surface-info-tint',
|
|
120
|
+
web: 'data-[hover=true]:bg-surface-info-tint-hover data-[active=true]:data-[hover=true]:bg-surface-info-tint-active'
|
|
121
|
+
})]
|
|
122
|
+
}],
|
|
18
123
|
defaultVariants: {
|
|
19
|
-
|
|
124
|
+
variant: 'tint',
|
|
125
|
+
color: 'default',
|
|
126
|
+
size: 'default'
|
|
20
127
|
}
|
|
21
128
|
});
|
|
22
|
-
|
|
23
|
-
// TODO: letter-spacing values (tracking-wider) are not working on web, but the font-mono-medium is.
|
|
24
|
-
const chipLabelVariants = exports.chipLabelVariants = (0, _classVarianceAuthority.cva)(['label-sm font-mono-medium'], {
|
|
129
|
+
const chipLabelVariants = exports.chipLabelVariants = (0, _classVarianceAuthority.cva)(['font-medium'], {
|
|
25
130
|
variants: {
|
|
131
|
+
variant: {
|
|
132
|
+
tint: 'text-content-primary',
|
|
133
|
+
outline: 'text-content-primary'
|
|
134
|
+
},
|
|
26
135
|
color: {
|
|
27
|
-
default:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
136
|
+
default: [],
|
|
137
|
+
action: [],
|
|
138
|
+
danger: [],
|
|
139
|
+
warning: [],
|
|
140
|
+
success: [],
|
|
141
|
+
info: []
|
|
142
|
+
},
|
|
143
|
+
size: {
|
|
144
|
+
default: 'body-md',
|
|
145
|
+
small: 'body-sm',
|
|
146
|
+
xsmall: 'body-xs'
|
|
32
147
|
}
|
|
33
148
|
},
|
|
149
|
+
compoundVariants: [{
|
|
150
|
+
variant: 'outline',
|
|
151
|
+
color: 'action',
|
|
152
|
+
className: 'text-content-action'
|
|
153
|
+
}, {
|
|
154
|
+
variant: 'outline',
|
|
155
|
+
color: 'danger',
|
|
156
|
+
className: 'text-content-danger'
|
|
157
|
+
}, {
|
|
158
|
+
variant: 'outline',
|
|
159
|
+
color: 'warning',
|
|
160
|
+
className: 'text-content-warning'
|
|
161
|
+
}, {
|
|
162
|
+
variant: 'outline',
|
|
163
|
+
color: 'success',
|
|
164
|
+
className: 'text-content-success'
|
|
165
|
+
}, {
|
|
166
|
+
variant: 'outline',
|
|
167
|
+
color: 'info',
|
|
168
|
+
className: 'text-content-info'
|
|
169
|
+
}],
|
|
34
170
|
defaultVariants: {
|
|
35
|
-
|
|
171
|
+
variant: 'tint',
|
|
172
|
+
color: 'default',
|
|
173
|
+
size: 'default'
|
|
36
174
|
}
|
|
37
175
|
});
|
|
38
|
-
const chipIconVariants = exports.chipIconVariants = (0, _classVarianceAuthority.cva)(['
|
|
176
|
+
const chipIconVariants = exports.chipIconVariants = (0, _classVarianceAuthority.cva)(['shrink-0'], {
|
|
39
177
|
variants: {
|
|
178
|
+
size: {
|
|
179
|
+
default: 'size-5',
|
|
180
|
+
small: 'size-4',
|
|
181
|
+
xsmall: 'size-2.5'
|
|
182
|
+
},
|
|
40
183
|
color: {
|
|
41
184
|
default: 'text-content-primary',
|
|
42
|
-
|
|
43
|
-
|
|
185
|
+
action: 'text-content-action',
|
|
186
|
+
danger: 'text-content-danger',
|
|
187
|
+
warning: 'text-content-warning',
|
|
44
188
|
success: 'text-content-success',
|
|
45
|
-
|
|
189
|
+
info: 'text-content-info'
|
|
190
|
+
},
|
|
191
|
+
slot: {
|
|
192
|
+
leading: '',
|
|
193
|
+
trailing: ''
|
|
46
194
|
}
|
|
47
195
|
},
|
|
196
|
+
compoundVariants: [{
|
|
197
|
+
slot: 'leading',
|
|
198
|
+
size: 'default',
|
|
199
|
+
className: '-ml-1.5'
|
|
200
|
+
}, {
|
|
201
|
+
slot: 'leading',
|
|
202
|
+
size: 'small',
|
|
203
|
+
className: '-ml-0.5'
|
|
204
|
+
}, {
|
|
205
|
+
slot: 'leading',
|
|
206
|
+
size: 'xsmall',
|
|
207
|
+
className: '-ml-px'
|
|
208
|
+
}, {
|
|
209
|
+
slot: 'trailing',
|
|
210
|
+
size: 'default',
|
|
211
|
+
className: '-mr-1.5'
|
|
212
|
+
}, {
|
|
213
|
+
slot: 'trailing',
|
|
214
|
+
size: 'small',
|
|
215
|
+
className: '-mr-0.5'
|
|
216
|
+
}, {
|
|
217
|
+
slot: 'trailing',
|
|
218
|
+
size: 'xsmall',
|
|
219
|
+
className: '-mr-px'
|
|
220
|
+
}],
|
|
48
221
|
defaultVariants: {
|
|
222
|
+
size: 'default',
|
|
49
223
|
color: 'default'
|
|
50
224
|
}
|
|
51
225
|
});
|
|
226
|
+
const chipAvatarVariants = exports.chipAvatarVariants = (0, _classVarianceAuthority.cva)(['shrink-0 rounded-full overflow-hidden'], {
|
|
227
|
+
variants: {
|
|
228
|
+
size: {
|
|
229
|
+
default: 'size-5 -ml-1.5',
|
|
230
|
+
small: 'size-4 -ml-0.5',
|
|
231
|
+
xsmall: 'size-2.5 -ml-px'
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
defaultVariants: {
|
|
235
|
+
size: 'default'
|
|
236
|
+
}
|
|
237
|
+
});
|
|
52
238
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","chipInteractiveRoot","TRANSITION_COLORS","DISABLED_CURSOR","Platform","select","web","join","default","chipRootVariants","exports","cva","variants","variant","tint","outline","color","action","danger","warning","success","info","size","small","xsmall","compoundVariants","className","defaultVariants","chipLabelVariants","chipIconVariants","slot","leading","trailing","chipAvatarVariants"],"sourceRoot":"../../../../src","sources":["components/Chip/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,MAAMG,mBAAmB,GAAG,CAC1BC,6BAAiB,EACjB,wDAAwD,EACxDC,2BAAe,EACfC,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,CACH,cAAc,EACd,iJAAiJ,CAClJ,CAACC,IAAI,CAAC,GAAG,CAAC;EACXC,OAAO,EAAE;AACX,CAAC,CAAC,CACH;AAEM,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD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AI,EAAE,OAAO;IAAEI,SAAS,EAAE;EAAU,CAAC,EACzD;IAAEI,IAAI,EAAE,UAAU;IAAER,IAAI,EAAE,QAAQ;IAAEI,SAAS,EAAE;EAAS,CAAC,CAC1D;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE,SAAS;IACfN,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEK,MAAMiB,kBAAkB,GAAAvB,OAAA,CAAAuB,kBAAA,GAAG,IAAAtB,2BAAG,EAAC,CAAC,uCAAuC,CAAC,EAAE;EAC/EC,QAAQ,EAAE;IACRU,IAAI,EAAE;MACJd,OAAO,EAAE,gBAAgB;MACzBe,KAAK,EAAE,gBAAgB;MACvBC,MAAM,EAAE;IACV;EACF,CAAC;EACDG,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=449-377
|
|
10
|
+
// source=packages/components/src/components/Avatar/index.tsx
|
|
11
|
+
// component=Avatar
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
|
|
15
|
+
// size: 1:1 mapping between Figma and code values
|
|
16
|
+
const size = instance.getEnum('size', {
|
|
17
|
+
'2xs': '2xs',
|
|
18
|
+
xs: 'xs',
|
|
19
|
+
sm: 'sm',
|
|
20
|
+
md: 'md',
|
|
21
|
+
lg: 'lg',
|
|
22
|
+
xl: 'xl',
|
|
23
|
+
'2xl': '2xl'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// type: VARIANT — determines which Avatar sub-component to render.
|
|
27
|
+
// Not a code prop; used only to choose Avatar.Image, Avatar.Text, or Avatar.Icon.
|
|
28
|
+
const type = instance.getEnum('type', {
|
|
29
|
+
image: 'image',
|
|
30
|
+
text: 'text',
|
|
31
|
+
icon: 'icon'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// icon: INSTANCE_SWAP → Avatar.Icon `as` prop (CdxIcon identifier).
|
|
35
|
+
// Prefer metadata.props.componentName exposed by icon Code Connect templates.
|
|
36
|
+
// Falls back to executeTemplate().example (placeholder pill) when the icon lacks Code Connect.
|
|
37
|
+
const iconResult = instance.getInstanceSwap('icon')?.executeTemplate();
|
|
38
|
+
const iconName = iconResult?.metadata?.props?.componentName;
|
|
39
|
+
const iconSnippet = iconName ?? iconResult?.example;
|
|
40
|
+
const iconImports = iconName ? [`import { ${iconName} } from '@cdx-ui/icons'`] : [];
|
|
41
|
+
|
|
42
|
+
// text: TEXT property — the initials or label rendered inside Avatar.Text
|
|
43
|
+
const textContent = instance.getString('text');
|
|
44
|
+
var _default = exports.default = {
|
|
45
|
+
id: 'avatar',
|
|
46
|
+
imports: ["import { Avatar } from '@cdx-ui/components'", ...iconImports],
|
|
47
|
+
example: _figma.default.code`
|
|
48
|
+
<Avatar size="${size}">
|
|
49
|
+
${type === 'image' ? _figma.default.code`<Avatar.Image src="..." />` : null}
|
|
50
|
+
${type === 'text' ? _figma.default.code`<Avatar.Text>${textContent}</Avatar.Text>` : null}
|
|
51
|
+
${type === 'icon' ? _figma.default.code`<Avatar.Icon as={${iconSnippet}} />` : null}
|
|
52
|
+
</Avatar>`
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=Avatar.figma.js.map
|