@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
|
@@ -1,48 +1,234 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { Platform } from 'react-native';
|
|
3
4
|
import { cva } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
const chipInteractiveRoot = [TRANSITION_COLORS, 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', DISABLED_CURSOR, Platform.select({
|
|
7
|
+
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(' '),
|
|
8
|
+
default: ''
|
|
9
|
+
})];
|
|
10
|
+
export const chipRootVariants = cva(['flex-row items-center justify-center self-start overflow-hidden', ...chipInteractiveRoot], {
|
|
5
11
|
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
tint: [],
|
|
14
|
+
outline: ['bg-transparent', 'border']
|
|
15
|
+
},
|
|
6
16
|
color: {
|
|
7
|
-
default:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
default: [],
|
|
18
|
+
action: [],
|
|
19
|
+
danger: [],
|
|
20
|
+
warning: [],
|
|
21
|
+
success: [],
|
|
22
|
+
info: []
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
default: 'h-8 max-h-8 min-h-8 gap-1.5 px-3 rounded-lg',
|
|
26
|
+
small: 'h-6 max-h-6 min-h-6 gap-1 px-1.5 rounded-md',
|
|
27
|
+
xsmall: 'h-4 max-h-4 min-h-4 gap-0.5 px-1 rounded-sm'
|
|
12
28
|
}
|
|
13
29
|
},
|
|
30
|
+
compoundVariants: [
|
|
31
|
+
// ── tint × color ────────────────────────────────────────────────────
|
|
32
|
+
{
|
|
33
|
+
variant: 'tint',
|
|
34
|
+
color: 'default',
|
|
35
|
+
className: ['bg-surface-neutral-tint', Platform.select({
|
|
36
|
+
default: 'data-[active=true]:bg-surface-neutral-tint-active',
|
|
37
|
+
web: 'data-[hover=true]:bg-surface-neutral-tint-hover data-[active=true]:data-[hover=true]:bg-surface-neutral-tint-active'
|
|
38
|
+
})]
|
|
39
|
+
}, {
|
|
40
|
+
variant: 'tint',
|
|
41
|
+
color: 'action',
|
|
42
|
+
className: ['bg-surface-action-tint', Platform.select({
|
|
43
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
44
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active'
|
|
45
|
+
})]
|
|
46
|
+
}, {
|
|
47
|
+
variant: 'tint',
|
|
48
|
+
color: 'danger',
|
|
49
|
+
className: ['bg-surface-danger-tint', Platform.select({
|
|
50
|
+
default: 'data-[active=true]:bg-surface-danger-tint-active',
|
|
51
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active'
|
|
52
|
+
})]
|
|
53
|
+
}, {
|
|
54
|
+
variant: 'tint',
|
|
55
|
+
color: 'warning',
|
|
56
|
+
className: ['bg-surface-warning-tint', Platform.select({
|
|
57
|
+
default: 'data-[active=true]:bg-surface-warning-tint-active',
|
|
58
|
+
web: 'data-[hover=true]:bg-surface-warning-tint-hover data-[active=true]:data-[hover=true]:bg-surface-warning-tint-active'
|
|
59
|
+
})]
|
|
60
|
+
}, {
|
|
61
|
+
variant: 'tint',
|
|
62
|
+
color: 'success',
|
|
63
|
+
className: ['bg-surface-success-tint', Platform.select({
|
|
64
|
+
default: 'data-[active=true]:bg-surface-success-tint-active',
|
|
65
|
+
web: 'data-[hover=true]:bg-surface-success-tint-hover data-[active=true]:data-[hover=true]:bg-surface-success-tint-active'
|
|
66
|
+
})]
|
|
67
|
+
}, {
|
|
68
|
+
variant: 'tint',
|
|
69
|
+
color: 'info',
|
|
70
|
+
className: ['bg-surface-info-tint', Platform.select({
|
|
71
|
+
default: 'data-[active=true]:bg-surface-info-tint-active',
|
|
72
|
+
web: 'data-[hover=true]:bg-surface-info-tint-hover data-[active=true]:data-[hover=true]:bg-surface-info-tint-active'
|
|
73
|
+
})]
|
|
74
|
+
},
|
|
75
|
+
// ── outline × color ───────────────────────────────────────────────────
|
|
76
|
+
{
|
|
77
|
+
variant: 'outline',
|
|
78
|
+
color: 'default',
|
|
79
|
+
className: ['border-stroke-primary', Platform.select({
|
|
80
|
+
default: 'data-[active=true]:bg-surface-neutral-tint',
|
|
81
|
+
web: 'data-[hover=true]:bg-surface-neutral-tint-hover data-[active=true]:data-[hover=true]:bg-surface-neutral-tint-active'
|
|
82
|
+
})]
|
|
83
|
+
}, {
|
|
84
|
+
variant: 'outline',
|
|
85
|
+
color: 'action',
|
|
86
|
+
className: ['border-stroke-action', Platform.select({
|
|
87
|
+
default: 'data-[active=true]:bg-surface-action-tint',
|
|
88
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active'
|
|
89
|
+
})]
|
|
90
|
+
}, {
|
|
91
|
+
variant: 'outline',
|
|
92
|
+
color: 'danger',
|
|
93
|
+
className: ['border-stroke-danger', Platform.select({
|
|
94
|
+
default: 'data-[active=true]:bg-surface-danger-tint',
|
|
95
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active'
|
|
96
|
+
})]
|
|
97
|
+
}, {
|
|
98
|
+
variant: 'outline',
|
|
99
|
+
color: 'warning',
|
|
100
|
+
className: ['border-stroke-warning', Platform.select({
|
|
101
|
+
default: 'data-[active=true]:bg-surface-warning-tint',
|
|
102
|
+
web: 'data-[hover=true]:bg-surface-warning-tint-hover data-[active=true]:data-[hover=true]:bg-surface-warning-tint-active'
|
|
103
|
+
})]
|
|
104
|
+
}, {
|
|
105
|
+
variant: 'outline',
|
|
106
|
+
color: 'success',
|
|
107
|
+
className: ['border-stroke-success', Platform.select({
|
|
108
|
+
default: 'data-[active=true]:bg-surface-success-tint',
|
|
109
|
+
web: 'data-[hover=true]:bg-surface-success-tint-hover data-[active=true]:data-[hover=true]:bg-surface-success-tint-active'
|
|
110
|
+
})]
|
|
111
|
+
}, {
|
|
112
|
+
variant: 'outline',
|
|
113
|
+
color: 'info',
|
|
114
|
+
className: ['border-stroke-info', Platform.select({
|
|
115
|
+
default: 'data-[active=true]:bg-surface-info-tint',
|
|
116
|
+
web: 'data-[hover=true]:bg-surface-info-tint-hover data-[active=true]:data-[hover=true]:bg-surface-info-tint-active'
|
|
117
|
+
})]
|
|
118
|
+
}],
|
|
14
119
|
defaultVariants: {
|
|
15
|
-
|
|
120
|
+
variant: 'tint',
|
|
121
|
+
color: 'default',
|
|
122
|
+
size: 'default'
|
|
16
123
|
}
|
|
17
124
|
});
|
|
18
|
-
|
|
19
|
-
// TODO: letter-spacing values (tracking-wider) are not working on web, but the font-mono-medium is.
|
|
20
|
-
export const chipLabelVariants = cva(['label-sm font-mono-medium'], {
|
|
125
|
+
export const chipLabelVariants = cva(['font-medium'], {
|
|
21
126
|
variants: {
|
|
127
|
+
variant: {
|
|
128
|
+
tint: 'text-content-primary',
|
|
129
|
+
outline: 'text-content-primary'
|
|
130
|
+
},
|
|
22
131
|
color: {
|
|
23
|
-
default:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
132
|
+
default: [],
|
|
133
|
+
action: [],
|
|
134
|
+
danger: [],
|
|
135
|
+
warning: [],
|
|
136
|
+
success: [],
|
|
137
|
+
info: []
|
|
138
|
+
},
|
|
139
|
+
size: {
|
|
140
|
+
default: 'body-md',
|
|
141
|
+
small: 'body-sm',
|
|
142
|
+
xsmall: 'body-xs'
|
|
28
143
|
}
|
|
29
144
|
},
|
|
145
|
+
compoundVariants: [{
|
|
146
|
+
variant: 'outline',
|
|
147
|
+
color: 'action',
|
|
148
|
+
className: 'text-content-action'
|
|
149
|
+
}, {
|
|
150
|
+
variant: 'outline',
|
|
151
|
+
color: 'danger',
|
|
152
|
+
className: 'text-content-danger'
|
|
153
|
+
}, {
|
|
154
|
+
variant: 'outline',
|
|
155
|
+
color: 'warning',
|
|
156
|
+
className: 'text-content-warning'
|
|
157
|
+
}, {
|
|
158
|
+
variant: 'outline',
|
|
159
|
+
color: 'success',
|
|
160
|
+
className: 'text-content-success'
|
|
161
|
+
}, {
|
|
162
|
+
variant: 'outline',
|
|
163
|
+
color: 'info',
|
|
164
|
+
className: 'text-content-info'
|
|
165
|
+
}],
|
|
30
166
|
defaultVariants: {
|
|
31
|
-
|
|
167
|
+
variant: 'tint',
|
|
168
|
+
color: 'default',
|
|
169
|
+
size: 'default'
|
|
32
170
|
}
|
|
33
171
|
});
|
|
34
|
-
export const chipIconVariants = cva(['
|
|
172
|
+
export const chipIconVariants = cva(['shrink-0'], {
|
|
35
173
|
variants: {
|
|
174
|
+
size: {
|
|
175
|
+
default: 'size-5',
|
|
176
|
+
small: 'size-4',
|
|
177
|
+
xsmall: 'size-2.5'
|
|
178
|
+
},
|
|
36
179
|
color: {
|
|
37
180
|
default: 'text-content-primary',
|
|
38
|
-
|
|
39
|
-
|
|
181
|
+
action: 'text-content-action',
|
|
182
|
+
danger: 'text-content-danger',
|
|
183
|
+
warning: 'text-content-warning',
|
|
40
184
|
success: 'text-content-success',
|
|
41
|
-
|
|
185
|
+
info: 'text-content-info'
|
|
186
|
+
},
|
|
187
|
+
slot: {
|
|
188
|
+
leading: '',
|
|
189
|
+
trailing: ''
|
|
42
190
|
}
|
|
43
191
|
},
|
|
192
|
+
compoundVariants: [{
|
|
193
|
+
slot: 'leading',
|
|
194
|
+
size: 'default',
|
|
195
|
+
className: '-ml-1.5'
|
|
196
|
+
}, {
|
|
197
|
+
slot: 'leading',
|
|
198
|
+
size: 'small',
|
|
199
|
+
className: '-ml-0.5'
|
|
200
|
+
}, {
|
|
201
|
+
slot: 'leading',
|
|
202
|
+
size: 'xsmall',
|
|
203
|
+
className: '-ml-px'
|
|
204
|
+
}, {
|
|
205
|
+
slot: 'trailing',
|
|
206
|
+
size: 'default',
|
|
207
|
+
className: '-mr-1.5'
|
|
208
|
+
}, {
|
|
209
|
+
slot: 'trailing',
|
|
210
|
+
size: 'small',
|
|
211
|
+
className: '-mr-0.5'
|
|
212
|
+
}, {
|
|
213
|
+
slot: 'trailing',
|
|
214
|
+
size: 'xsmall',
|
|
215
|
+
className: '-mr-px'
|
|
216
|
+
}],
|
|
44
217
|
defaultVariants: {
|
|
218
|
+
size: 'default',
|
|
45
219
|
color: 'default'
|
|
46
220
|
}
|
|
47
221
|
});
|
|
222
|
+
export const chipAvatarVariants = cva(['shrink-0 rounded-full overflow-hidden'], {
|
|
223
|
+
variants: {
|
|
224
|
+
size: {
|
|
225
|
+
default: 'size-5 -ml-1.5',
|
|
226
|
+
small: 'size-4 -ml-0.5',
|
|
227
|
+
xsmall: 'size-2.5 -ml-px'
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
defaultVariants: {
|
|
231
|
+
size: 'default'
|
|
232
|
+
}
|
|
233
|
+
});
|
|
48
234
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cva","chipRootVariants","variants","color","
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","TRANSITION_COLORS","chipInteractiveRoot","select","web","join","default","chipRootVariants","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,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AAC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AAEI,IAAI,EAAE,SAAS;IAAER,IAAI,EAAE,QAAQ;IAAEI,SAAS,EAAE;EAAS,CAAC,EACxD;IAAEI,IAAI,EAAE,UAAU;IAAER,IAAI,EAAE,SAAS;IAAEI,SAAS,EAAE;EAAU,CAAC,EAC3D;IAAEI,IAAI,EAAE,UAAU;IAAER,IAAI,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;AAEF,OAAO,MAAMiB,kBAAkB,GAAG9B,GAAG,CAAC,CAAC,uCAAuC,CAAC,EAAE;EAC/ES,QAAQ,EAAE;IACRU,IAAI,EAAE;MACJZ,OAAO,EAAE,gBAAgB;MACzBa,KAAK,EAAE,gBAAgB;MACvBC,MAAM,EAAE;IACV;EACF,CAAC;EACDG,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=449-377
|
|
4
|
+
// source=packages/components/src/components/Avatar/index.tsx
|
|
5
|
+
// component=Avatar
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// size: 1:1 mapping between Figma and code values
|
|
10
|
+
const size = instance.getEnum('size', {
|
|
11
|
+
'2xs': '2xs',
|
|
12
|
+
xs: 'xs',
|
|
13
|
+
sm: 'sm',
|
|
14
|
+
md: 'md',
|
|
15
|
+
lg: 'lg',
|
|
16
|
+
xl: 'xl',
|
|
17
|
+
'2xl': '2xl'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// type: VARIANT — determines which Avatar sub-component to render.
|
|
21
|
+
// Not a code prop; used only to choose Avatar.Image, Avatar.Text, or Avatar.Icon.
|
|
22
|
+
const type = instance.getEnum('type', {
|
|
23
|
+
image: 'image',
|
|
24
|
+
text: 'text',
|
|
25
|
+
icon: 'icon'
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// icon: INSTANCE_SWAP → Avatar.Icon `as` prop (CdxIcon identifier).
|
|
29
|
+
// Prefer metadata.props.componentName exposed by icon Code Connect templates.
|
|
30
|
+
// Falls back to executeTemplate().example (placeholder pill) when the icon lacks Code Connect.
|
|
31
|
+
const iconResult = instance.getInstanceSwap('icon')?.executeTemplate();
|
|
32
|
+
const iconName = iconResult?.metadata?.props?.componentName;
|
|
33
|
+
const iconSnippet = iconName ?? iconResult?.example;
|
|
34
|
+
const iconImports = iconName ? [`import { ${iconName} } from '@cdx-ui/icons'`] : [];
|
|
35
|
+
|
|
36
|
+
// text: TEXT property — the initials or label rendered inside Avatar.Text
|
|
37
|
+
const textContent = instance.getString('text');
|
|
38
|
+
export default {
|
|
39
|
+
id: 'avatar',
|
|
40
|
+
imports: ["import { Avatar } from '@cdx-ui/components'", ...iconImports],
|
|
41
|
+
example: figma.code`
|
|
42
|
+
<Avatar size="${size}">
|
|
43
|
+
${type === 'image' ? figma.code`<Avatar.Image src="..." />` : null}
|
|
44
|
+
${type === 'text' ? figma.code`<Avatar.Text>${textContent}</Avatar.Text>` : null}
|
|
45
|
+
${type === 'icon' ? figma.code`<Avatar.Icon as={${iconSnippet}} />` : null}
|
|
46
|
+
</Avatar>`
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=Avatar.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","size","getEnum","xs","sm","md","lg","xl","type","image","text","icon","iconResult","getInstanceSwap","executeTemplate","iconName","metadata","props","componentName","iconSnippet","example","iconImports","textContent","getString","id","im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M,GAAGV,KAAK,CAAC4B,IAAI,gBAAgBJ,WAAW,gBAAgB,GAAG,IAAI;AAClF,IAAId,IAAI,KAAK,MAAM,GAAGV,KAAK,CAAC4B,IAAI,oBAAoBP,WAAW,MAAM,GAAG,IAAI;AAC5E;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=444-13403
|
|
4
|
+
// source=packages/components/src/components/Chip/index.tsx
|
|
5
|
+
// component=Chip
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const variant = instance.getEnum('variant', {
|
|
9
|
+
tint: 'tint',
|
|
10
|
+
outline: 'outline'
|
|
11
|
+
});
|
|
12
|
+
const size = instance.getEnum('size', {
|
|
13
|
+
default: 'default',
|
|
14
|
+
small: 'small',
|
|
15
|
+
xsmall: 'xsmall'
|
|
16
|
+
});
|
|
17
|
+
const color = instance.getEnum('color', {
|
|
18
|
+
default: 'default',
|
|
19
|
+
action: 'action',
|
|
20
|
+
danger: 'danger',
|
|
21
|
+
warning: 'warning',
|
|
22
|
+
success: 'success',
|
|
23
|
+
info: 'info'
|
|
24
|
+
});
|
|
25
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
26
|
+
true: true,
|
|
27
|
+
false: undefined
|
|
28
|
+
});
|
|
29
|
+
const disabledProp = figma.helpers.react.renderProp('disabled', isDisabled);
|
|
30
|
+
const showLeadingIcon = instance.getBoolean('Show Leading Icon?');
|
|
31
|
+
const showAvatar = instance.getBoolean('Show Avatar?');
|
|
32
|
+
const showTrailingIcon = instance.getBoolean('Show Trailing Icon?');
|
|
33
|
+
|
|
34
|
+
// INSTANCE_SWAP property names from Figma (Chip.LeadingIcon / Chip.TrailingIcon).
|
|
35
|
+
const leadingIconResult = showLeadingIcon && !showAvatar ? instance.getInstanceSwap('Chip.LeadingIcon')?.executeTemplate() : undefined;
|
|
36
|
+
const trailingIconResult = showTrailingIcon ? instance.getInstanceSwap('Chip.TrailingIcon')?.executeTemplate() : undefined;
|
|
37
|
+
const leadingIconName = leadingIconResult?.metadata?.props?.componentName;
|
|
38
|
+
const trailingIconName = trailingIconResult?.metadata?.props?.componentName;
|
|
39
|
+
const leadingIconSnippet = leadingIconName ?? leadingIconResult?.example;
|
|
40
|
+
const trailingIconSnippet = trailingIconName ?? trailingIconResult?.example;
|
|
41
|
+
const label = instance.findText('Chip.Label').textContent;
|
|
42
|
+
const iconImports = [];
|
|
43
|
+
if (showLeadingIcon && !showAvatar && leadingIconName) {
|
|
44
|
+
iconImports.push(`import { ${leadingIconName} } from '@cdx-ui/icons'`);
|
|
45
|
+
}
|
|
46
|
+
if (showTrailingIcon && trailingIconName) {
|
|
47
|
+
iconImports.push(`import { ${trailingIconName} } from '@cdx-ui/icons'`);
|
|
48
|
+
}
|
|
49
|
+
const avatarImport = showAvatar ? ["import { Avatar } from '@cdx-ui/components'"] : [];
|
|
50
|
+
export default {
|
|
51
|
+
id: 'chip',
|
|
52
|
+
imports: ["import { Chip } from '@cdx-ui/components'", ...avatarImport, ...iconImports],
|
|
53
|
+
example: figma.code`
|
|
54
|
+
<Chip variant="${variant}" size="${size}" color="${color}"${disabledProp}>
|
|
55
|
+
${showAvatar ? figma.code`<Chip.Avatar>
|
|
56
|
+
<Avatar.Image source={{ uri: '...' }} />
|
|
57
|
+
</Chip.Avatar>` : showLeadingIcon ? figma.code`<Chip.Icon as={${leadingIconSnippet}} slot="leading" />` : null}
|
|
58
|
+
<Chip.Label>${label}</Chip.Label>
|
|
59
|
+
${showTrailingIcon ? figma.code`<Chip.Icon as={${trailingIconSnippet}} slot="trailing" />` : null}
|
|
60
|
+
</Chip>`
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=Chip.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","tint","outline","size","default","small","xsmall","color","action","danger","warning","success","info","isDisabled","true","false","undefined","disabledProp","helpers","react","renderProp","showLeadingIcon","getBoolean","showAvatar","showTrailingIcon","leadingIconResult","getInstanceSwap","executeTemplate","trailingIconResult","leadingIconName","metadata","props","componentName","trailingIconName","leadingIconSnippet","example","trailingIconSnippet","label","findText","textContent","iconImports","push","avatarImport","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Chip.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EAC1CC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE;AACX,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGN,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpCI,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACV,CAAC,CAAC;AACF,MAAMC,KAAK,GAAGV,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtCI,OAAO,EAAE,SAAS;EAClBI,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGhB,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDc,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,YAAY,GAAGrB,KAAK,CAACsB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,UAAU,EAAEP,UAAU,CAAC;AAE3E,MAAMQ,eAAe,GAAGxB,QAAQ,CAACyB,UAAU,CAAC,oBAAoB,CAAC;AACjE,MAAMC,UAAU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EAAEvC,KAAK,CAACiD,IAAI;AACrB,iBAAiB9C,OAAO,WAAWI,IAAI,YAAYI,KAAK,IAAIU,YAAY;AACxE,IACIM,UAAU,GACN3B,KAAK,CAACiD,IAAI;AAClB;AACA,iBAAiB,GACTxB,eAAe,GACbzB,KAAK,CAACiD,IAAI,kBAAkBX,kBAAkB,qBAAqB,GACnE,IAAI;AACd,gBACgBG,KAAK;AACrB,IAAIb,gBAAgB,GAAG5B,KAAK,CAACiD,IAAI,kBAAkBT,mBAAmB,sBAAsB,GAAG,IAAI;AACnG;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const avatarRootVariants: (props?: ({
|
|
3
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
3
|
+
size?: "sm" | "md" | "lg" | "2xs" | "xs" | "xl" | "2xl" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export declare const avatarImageVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
6
|
export declare const avatarTextVariants: (props?: ({
|
|
7
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | "lg" | "2xs" | "xs" | "xl" | "2xl" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export declare const avatarIconVariants: (props?: ({
|
|
10
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
10
|
+
size?: "sm" | "md" | "lg" | "2xs" | "xs" | "xl" | "2xl" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
export declare const avatarBadgeVariants: (props?: ({
|
|
13
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
13
|
+
size?: "sm" | "md" | "lg" | "2xs" | "xs" | "xl" | "2xl" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
15
|
export type AvatarVariantProps = VariantProps<typeof avatarRootVariants>;
|
|
16
16
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAIlE,eAAO,MAAM,kBAAkB;;8EAsB9B,CAAC;AAIF,eAAO,MAAM,mBAAmB,oFAK9B,CAAC;AAIH,eAAO,MAAM,kBAAkB;;8EAe7B,CAAC;AAIH,eAAO,MAAM,kBAAkB;;8EAe7B,CAAC;AAIH,eAAO,MAAM,mBAAmB;;8EAkB/B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Text as RNText, View, type TextProps } from 'react-native';
|
|
3
|
+
import { type IChipProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { type WithStyleContextProps } from '@cdx-ui/utils';
|
|
5
|
+
import { type AvatarProps } from '../Avatar';
|
|
3
6
|
import { type IconProps } from '../Icon';
|
|
4
|
-
import {
|
|
5
|
-
export interface ChipProps extends
|
|
6
|
-
children?: ReactNode;
|
|
7
|
+
import { type ChipVariantProps } from './styles';
|
|
8
|
+
export interface ChipProps extends IChipProps, ChipVariantProps, WithStyleContextProps {
|
|
7
9
|
className?: string;
|
|
10
|
+
children?: ReactNode;
|
|
8
11
|
}
|
|
9
12
|
declare const ChipRoot: import("react").ForwardRefExoticComponent<ChipProps & import("react").RefAttributes<View>>;
|
|
10
13
|
export interface ChipLabelProps extends TextProps {
|
|
@@ -13,15 +16,25 @@ export interface ChipLabelProps extends TextProps {
|
|
|
13
16
|
}
|
|
14
17
|
declare const ChipLabel: import("react").ForwardRefExoticComponent<ChipLabelProps & import("react").RefAttributes<RNText>>;
|
|
15
18
|
export interface ChipIconProps extends Omit<IconProps, 'children'> {
|
|
19
|
+
/** Leading (default) or trailing slot — applies the correct negative margin offset. */
|
|
20
|
+
slot?: 'leading' | 'trailing';
|
|
21
|
+
className?: string;
|
|
16
22
|
}
|
|
17
23
|
declare const ChipIcon: {
|
|
18
|
-
({ className, style, as, ...props }: ChipIconProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
({ className, style, as, slot, ...props }: ChipIconProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export interface ChipAvatarProps extends Omit<AvatarProps, 'size'> {
|
|
28
|
+
}
|
|
29
|
+
declare const ChipAvatar: {
|
|
30
|
+
({ className, style, children, ...props }: ChipAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
31
|
displayName: string;
|
|
20
32
|
};
|
|
21
33
|
type ChipCompoundComponent = typeof ChipRoot & {
|
|
22
34
|
Label: typeof ChipLabel;
|
|
23
35
|
Icon: typeof ChipIcon;
|
|
36
|
+
Avatar: typeof ChipAvatar;
|
|
24
37
|
};
|
|
25
38
|
export declare const Chip: ChipCompoundComponent;
|
|
26
|
-
export { type
|
|
39
|
+
export { type ChipVariantProps } from './styles';
|
|
27
40
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources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SAAS,CAAC;IACxB,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,MAAM,EAAE,OAAO,UAAU,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,IAAI,EAIX,qBAAqB,CAAC;AAE5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const chipRootVariants: (props?: ({
|
|
3
|
-
|
|
3
|
+
variant?: "outline" | "tint" | null | undefined;
|
|
4
|
+
color?: "action" | "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
5
|
+
size?: "small" | "default" | "xsmall" | null | undefined;
|
|
4
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
7
|
export declare const chipLabelVariants: (props?: ({
|
|
6
|
-
|
|
8
|
+
variant?: "outline" | "tint" | null | undefined;
|
|
9
|
+
color?: "action" | "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
10
|
+
size?: "small" | "default" | "xsmall" | null | undefined;
|
|
7
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
12
|
export declare const chipIconVariants: (props?: ({
|
|
9
|
-
|
|
13
|
+
size?: "small" | "default" | "xsmall" | null | undefined;
|
|
14
|
+
color?: "action" | "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
15
|
+
slot?: "leading" | "trailing" | null | undefined;
|
|
10
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
-
export
|
|
17
|
+
export declare const chipAvatarVariants: (props?: ({
|
|
18
|
+
size?: "small" | "default" | "xsmall" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
export type ChipVariantProps = VariantProps<typeof chipRootVariants>;
|
|
12
21
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAgBlE,eAAO,MAAM,gBAAgB;;;;8EAqK5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;8EAgC5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;8EAgC3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;8EAW7B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const headingStyle: (props?: ({
|
|
3
|
-
size?: "sm" | "md" | "lg" | "
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | 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
|
|
@@ -13,11 +13,11 @@ declare const spaceMap: {
|
|
|
13
13
|
export type StackSpace = keyof typeof spaceMap;
|
|
14
14
|
export declare const hStackRootVariants: (props?: ({
|
|
15
15
|
reversed?: boolean | null | undefined;
|
|
16
|
-
space?: "sm" | "md" | "lg" | "
|
|
16
|
+
space?: "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | null | undefined;
|
|
17
17
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
18
|
export declare const vStackRootVariants: (props?: ({
|
|
19
19
|
reversed?: boolean | null | undefined;
|
|
20
|
-
space?: "sm" | "md" | "lg" | "
|
|
20
|
+
space?: "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | null | undefined;
|
|
21
21
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const textStyle: (props?: ({
|
|
3
|
-
size?: "sm" | "md" | "lg" | "
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | 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 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/Avatar.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AAmC1B,wBASE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/Chip.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AAwD1B,wBAiBE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.38",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"@gorhom/bottom-sheet": "^5.2.6",
|
|
68
68
|
"class-variance-authority": "^0.7.1",
|
|
69
69
|
"uniwind": "1.6.1",
|
|
70
|
-
"@cdx-ui/primitives": "0.0.1-beta.
|
|
71
|
-
"@cdx-ui/utils": "0.0.1-beta.
|
|
72
|
-
"@cdx-ui/icons": "0.0.1-beta.
|
|
70
|
+
"@cdx-ui/primitives": "0.0.1-beta.38",
|
|
71
|
+
"@cdx-ui/utils": "0.0.1-beta.38",
|
|
72
|
+
"@cdx-ui/icons": "0.0.1-beta.38"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/react": "*",
|
|
@@ -36,7 +36,7 @@ export interface AvatarProps extends ViewProps, IAvatarProps, AvatarVariantProps
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const AvatarRoot = forwardRef<View, AvatarProps>(
|
|
39
|
-
({ size = '
|
|
39
|
+
({ size = 'md', className, children, style, ...props }, ref) => {
|
|
40
40
|
const computedClassName = cn(avatarRootVariants({ size }), className);
|
|
41
41
|
|
|
42
42
|
return (
|