@giv-igniteui/react 2.0.0 → 2.0.1
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/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +1718 -5
- package/dist/index.d.ts +1718 -5
- package/dist/index.js +54 -16
- package/dist/index.mjs +45 -15
- package/package.json +1 -1
- package/src/components/Avatar/index.tsx +18 -18
- package/src/components/Avatar/styles.ts +29 -29
- package/src/components/Box.tsx +12 -12
- package/src/components/Button.tsx +87 -84
- package/src/components/Checkbox/index.tsx +20 -20
- package/src/components/Checkbox/styles.ts +55 -55
- package/src/components/Heading.tsx +27 -27
- package/src/components/MultiStep/index.tsx +23 -23
- package/src/components/MultiStep/styles.ts +33 -33
- package/src/components/Text.tsx +32 -32
- package/src/components/TextArea.tsx +34 -34
- package/src/components/TextInput/index.tsx +19 -17
- package/src/components/TextInput/styles.ts +58 -43
- package/src/index.tsx +11 -9
- package/src/styles/index.ts +36 -36
- package/tsconfig.json +5 -5
package/dist/index.js
CHANGED
@@ -67,7 +67,15 @@ __export(index_exports, {
|
|
67
67
|
MultiStep: () => MultiStep,
|
68
68
|
Text: () => Text,
|
69
69
|
TextArea: () => TextArea,
|
70
|
-
TextInput: () => TextInput
|
70
|
+
TextInput: () => TextInput,
|
71
|
+
config: () => config,
|
72
|
+
createTheme: () => createTheme,
|
73
|
+
css: () => css,
|
74
|
+
getCssText: () => getCssText,
|
75
|
+
globalCss: () => globalCss,
|
76
|
+
keyframes: () => keyframes,
|
77
|
+
styled: () => styled,
|
78
|
+
theme: () => theme
|
71
79
|
});
|
72
80
|
module.exports = __toCommonJS(index_exports);
|
73
81
|
|
@@ -86,7 +94,8 @@ var colors = {
|
|
86
94
|
ignite300: "#00B37E",
|
87
95
|
ignite500: "#00875F",
|
88
96
|
ignite700: "#015F43",
|
89
|
-
ignite900: "#00291D"
|
97
|
+
ignite900: "#00291D",
|
98
|
+
test: "#FFF"
|
90
99
|
};
|
91
100
|
var space = {
|
92
101
|
1: "0.25rem",
|
@@ -174,7 +183,7 @@ var {
|
|
174
183
|
|
175
184
|
// src/components/Box.tsx
|
176
185
|
var Box = styled("div", {
|
177
|
-
padding: "$
|
186
|
+
padding: "$6",
|
178
187
|
borderRadius: "$md",
|
179
188
|
backgroundColor: "$gray800",
|
180
189
|
border: "1px solid $gray600"
|
@@ -239,8 +248,8 @@ var Avatar = __toESM(require("@radix-ui/react-avatar"));
|
|
239
248
|
var AvatarContainer = styled(Avatar.Root, {
|
240
249
|
borderRadius: "$full",
|
241
250
|
display: "inline-block",
|
242
|
-
width: "$
|
243
|
-
height: "$
|
251
|
+
width: "$16",
|
252
|
+
height: "$16",
|
244
253
|
overflow: "hidden"
|
245
254
|
});
|
246
255
|
var AvatarImage = styled(Avatar.Image, {
|
@@ -297,6 +306,9 @@ var Button = styled("button", {
|
|
297
306
|
"&:disabled": {
|
298
307
|
cursor: "not-allowed"
|
299
308
|
},
|
309
|
+
"&:focus": {
|
310
|
+
boxShadow: "0 0 0 2px $colors$gray-100"
|
311
|
+
},
|
300
312
|
variants: {
|
301
313
|
variant: {
|
302
314
|
primary: {
|
@@ -347,6 +359,9 @@ var Button = styled("button", {
|
|
347
359
|
});
|
348
360
|
Button.displayName = "Button";
|
349
361
|
|
362
|
+
// src/components/TextInput/index.tsx
|
363
|
+
var import_react2 = require("react");
|
364
|
+
|
350
365
|
// src/components/TextInput/styles.ts
|
351
366
|
var TextInputContainer = styled("div", {
|
352
367
|
backgroundColor: "$gray900",
|
@@ -355,13 +370,26 @@ var TextInputContainer = styled("div", {
|
|
355
370
|
boxSizing: "border-box",
|
356
371
|
border: "2px solid $gray900",
|
357
372
|
display: "flex",
|
358
|
-
alignItems: "
|
373
|
+
alignItems: "center",
|
374
|
+
variants: {
|
375
|
+
size: {
|
376
|
+
sm: {
|
377
|
+
padding: "$3"
|
378
|
+
},
|
379
|
+
md: {
|
380
|
+
padding: "$4"
|
381
|
+
}
|
382
|
+
}
|
383
|
+
},
|
359
384
|
"&:has(input:focus)": {
|
360
385
|
borderColor: "$ignite300"
|
361
386
|
},
|
362
387
|
"&:has(input:disabled)": {
|
363
388
|
opacity: 0.5,
|
364
389
|
cursor: "not-allowed"
|
390
|
+
},
|
391
|
+
defaultVariants: {
|
392
|
+
size: "md"
|
365
393
|
}
|
366
394
|
});
|
367
395
|
var Prefix = styled("span", {
|
@@ -384,20 +412,22 @@ var Input = styled("input", {
|
|
384
412
|
"&:disabled": {
|
385
413
|
cursor: "not-allowed"
|
386
414
|
},
|
387
|
-
"
|
415
|
+
"&::placeholder": {
|
388
416
|
color: "$gray400"
|
389
417
|
}
|
390
418
|
});
|
391
419
|
|
392
420
|
// src/components/TextInput/index.tsx
|
393
421
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
}
|
422
|
+
var TextInput = (0, import_react2.forwardRef)(
|
423
|
+
(_a, ref) => {
|
424
|
+
var _b = _a, { prefix } = _b, props = __objRest(_b, ["prefix"]);
|
425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(TextInputContainer, { children: [
|
426
|
+
!!prefix && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Prefix, { children: prefix }),
|
427
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Input, __spreadValues({ ref }, props))
|
428
|
+
] });
|
429
|
+
}
|
430
|
+
);
|
401
431
|
TextInput.displayName = "TextInput";
|
402
432
|
|
403
433
|
// src/components/TextArea.tsx
|
@@ -449,7 +479,7 @@ var CheckboxContainer = styled(Checkbox.Root, {
|
|
449
479
|
'&[data-state="checked"]': {
|
450
480
|
backgroundColor: "$ignite300"
|
451
481
|
},
|
452
|
-
|
482
|
+
'&:focus, &[data-state="checked"]': {
|
453
483
|
border: "2px solid $ignite300"
|
454
484
|
}
|
455
485
|
});
|
@@ -542,5 +572,13 @@ MultiStep.displayName = "MultiStep";
|
|
542
572
|
MultiStep,
|
543
573
|
Text,
|
544
574
|
TextArea,
|
545
|
-
TextInput
|
575
|
+
TextInput,
|
576
|
+
config,
|
577
|
+
createTheme,
|
578
|
+
css,
|
579
|
+
getCssText,
|
580
|
+
globalCss,
|
581
|
+
keyframes,
|
582
|
+
styled,
|
583
|
+
theme
|
546
584
|
});
|
package/dist/index.mjs
CHANGED
@@ -45,7 +45,8 @@ var colors = {
|
|
45
45
|
ignite300: "#00B37E",
|
46
46
|
ignite500: "#00875F",
|
47
47
|
ignite700: "#015F43",
|
48
|
-
ignite900: "#00291D"
|
48
|
+
ignite900: "#00291D",
|
49
|
+
test: "#FFF"
|
49
50
|
};
|
50
51
|
var space = {
|
51
52
|
1: "0.25rem",
|
@@ -133,7 +134,7 @@ var {
|
|
133
134
|
|
134
135
|
// src/components/Box.tsx
|
135
136
|
var Box = styled("div", {
|
136
|
-
padding: "$
|
137
|
+
padding: "$6",
|
137
138
|
borderRadius: "$md",
|
138
139
|
backgroundColor: "$gray800",
|
139
140
|
border: "1px solid $gray600"
|
@@ -198,8 +199,8 @@ import * as Avatar from "@radix-ui/react-avatar";
|
|
198
199
|
var AvatarContainer = styled(Avatar.Root, {
|
199
200
|
borderRadius: "$full",
|
200
201
|
display: "inline-block",
|
201
|
-
width: "$
|
202
|
-
height: "$
|
202
|
+
width: "$16",
|
203
|
+
height: "$16",
|
203
204
|
overflow: "hidden"
|
204
205
|
});
|
205
206
|
var AvatarImage = styled(Avatar.Image, {
|
@@ -256,6 +257,9 @@ var Button = styled("button", {
|
|
256
257
|
"&:disabled": {
|
257
258
|
cursor: "not-allowed"
|
258
259
|
},
|
260
|
+
"&:focus": {
|
261
|
+
boxShadow: "0 0 0 2px $colors$gray-100"
|
262
|
+
},
|
259
263
|
variants: {
|
260
264
|
variant: {
|
261
265
|
primary: {
|
@@ -306,6 +310,9 @@ var Button = styled("button", {
|
|
306
310
|
});
|
307
311
|
Button.displayName = "Button";
|
308
312
|
|
313
|
+
// src/components/TextInput/index.tsx
|
314
|
+
import { forwardRef } from "react";
|
315
|
+
|
309
316
|
// src/components/TextInput/styles.ts
|
310
317
|
var TextInputContainer = styled("div", {
|
311
318
|
backgroundColor: "$gray900",
|
@@ -314,13 +321,26 @@ var TextInputContainer = styled("div", {
|
|
314
321
|
boxSizing: "border-box",
|
315
322
|
border: "2px solid $gray900",
|
316
323
|
display: "flex",
|
317
|
-
alignItems: "
|
324
|
+
alignItems: "center",
|
325
|
+
variants: {
|
326
|
+
size: {
|
327
|
+
sm: {
|
328
|
+
padding: "$3"
|
329
|
+
},
|
330
|
+
md: {
|
331
|
+
padding: "$4"
|
332
|
+
}
|
333
|
+
}
|
334
|
+
},
|
318
335
|
"&:has(input:focus)": {
|
319
336
|
borderColor: "$ignite300"
|
320
337
|
},
|
321
338
|
"&:has(input:disabled)": {
|
322
339
|
opacity: 0.5,
|
323
340
|
cursor: "not-allowed"
|
341
|
+
},
|
342
|
+
defaultVariants: {
|
343
|
+
size: "md"
|
324
344
|
}
|
325
345
|
});
|
326
346
|
var Prefix = styled("span", {
|
@@ -343,20 +363,22 @@ var Input = styled("input", {
|
|
343
363
|
"&:disabled": {
|
344
364
|
cursor: "not-allowed"
|
345
365
|
},
|
346
|
-
"
|
366
|
+
"&::placeholder": {
|
347
367
|
color: "$gray400"
|
348
368
|
}
|
349
369
|
});
|
350
370
|
|
351
371
|
// src/components/TextInput/index.tsx
|
352
372
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
}
|
373
|
+
var TextInput = forwardRef(
|
374
|
+
(_a, ref) => {
|
375
|
+
var _b = _a, { prefix } = _b, props = __objRest(_b, ["prefix"]);
|
376
|
+
return /* @__PURE__ */ jsxs2(TextInputContainer, { children: [
|
377
|
+
!!prefix && /* @__PURE__ */ jsx2(Prefix, { children: prefix }),
|
378
|
+
/* @__PURE__ */ jsx2(Input, __spreadValues({ ref }, props))
|
379
|
+
] });
|
380
|
+
}
|
381
|
+
);
|
360
382
|
TextInput.displayName = "TextInput";
|
361
383
|
|
362
384
|
// src/components/TextArea.tsx
|
@@ -408,7 +430,7 @@ var CheckboxContainer = styled(Checkbox.Root, {
|
|
408
430
|
'&[data-state="checked"]': {
|
409
431
|
backgroundColor: "$ignite300"
|
410
432
|
},
|
411
|
-
|
433
|
+
'&:focus, &[data-state="checked"]': {
|
412
434
|
border: "2px solid $ignite300"
|
413
435
|
}
|
414
436
|
});
|
@@ -500,5 +522,13 @@ export {
|
|
500
522
|
MultiStep,
|
501
523
|
Text,
|
502
524
|
TextArea,
|
503
|
-
TextInput
|
525
|
+
TextInput,
|
526
|
+
config,
|
527
|
+
createTheme,
|
528
|
+
css,
|
529
|
+
getCssText,
|
530
|
+
globalCss,
|
531
|
+
keyframes,
|
532
|
+
styled,
|
533
|
+
theme
|
504
534
|
};
|
package/package.json
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
import { ComponentProps } from 'react'
|
2
|
-
import { AvatarContainer, AvatarImage, AvatarFallback } from './styles'
|
3
|
-
import { User } from 'phosphor-react'
|
4
|
-
|
5
|
-
export interface AvatarProps extends ComponentProps<typeof AvatarImage> {}
|
6
|
-
|
7
|
-
export function Avatar(props: AvatarProps) {
|
8
|
-
return (
|
9
|
-
<AvatarContainer>
|
10
|
-
<AvatarImage {...props} />
|
11
|
-
<AvatarFallback delayMs={600}>
|
12
|
-
<User />
|
13
|
-
</AvatarFallback>
|
14
|
-
</AvatarContainer>
|
15
|
-
)
|
16
|
-
}
|
17
|
-
|
18
|
-
Avatar.displayName = 'Avatar'
|
1
|
+
import { ComponentProps } from 'react'
|
2
|
+
import { AvatarContainer, AvatarImage, AvatarFallback } from './styles'
|
3
|
+
import { User } from 'phosphor-react'
|
4
|
+
|
5
|
+
export interface AvatarProps extends ComponentProps<typeof AvatarImage> {}
|
6
|
+
|
7
|
+
export function Avatar(props: AvatarProps) {
|
8
|
+
return (
|
9
|
+
<AvatarContainer>
|
10
|
+
<AvatarImage {...props} />
|
11
|
+
<AvatarFallback delayMs={600}>
|
12
|
+
<User />
|
13
|
+
</AvatarFallback>
|
14
|
+
</AvatarContainer>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
Avatar.displayName = 'Avatar'
|
@@ -1,29 +1,29 @@
|
|
1
|
-
import * as Avatar from '@radix-ui/react-avatar'
|
2
|
-
import { styled } from '../../styles'
|
3
|
-
|
4
|
-
export const AvatarContainer = styled(Avatar.Root, {
|
5
|
-
borderRadius: '$full',
|
6
|
-
display: 'inline-block',
|
7
|
-
width: '$
|
8
|
-
height: '$
|
9
|
-
overflow: 'hidden',
|
10
|
-
})
|
11
|
-
export const AvatarImage = styled(Avatar.Image, {
|
12
|
-
width: '100%',
|
13
|
-
height: '100%',
|
14
|
-
objectFit: 'cover',
|
15
|
-
borderRadius: '$full',
|
16
|
-
})
|
17
|
-
export const AvatarFallback = styled(Avatar.Fallback, {
|
18
|
-
width: '100%',
|
19
|
-
height: '100%',
|
20
|
-
display: 'flex',
|
21
|
-
alignItems: 'center',
|
22
|
-
justifyContent: 'center',
|
23
|
-
backgroundColor: '$gray600',
|
24
|
-
color: '$gray800',
|
25
|
-
svg: {
|
26
|
-
width: '$6',
|
27
|
-
height: '$6',
|
28
|
-
},
|
29
|
-
})
|
1
|
+
import * as Avatar from '@radix-ui/react-avatar'
|
2
|
+
import { styled } from '../../styles'
|
3
|
+
|
4
|
+
export const AvatarContainer = styled(Avatar.Root, {
|
5
|
+
borderRadius: '$full',
|
6
|
+
display: 'inline-block',
|
7
|
+
width: '$16',
|
8
|
+
height: '$16',
|
9
|
+
overflow: 'hidden',
|
10
|
+
})
|
11
|
+
export const AvatarImage = styled(Avatar.Image, {
|
12
|
+
width: '100%',
|
13
|
+
height: '100%',
|
14
|
+
objectFit: 'cover',
|
15
|
+
borderRadius: '$full',
|
16
|
+
})
|
17
|
+
export const AvatarFallback = styled(Avatar.Fallback, {
|
18
|
+
width: '100%',
|
19
|
+
height: '100%',
|
20
|
+
display: 'flex',
|
21
|
+
alignItems: 'center',
|
22
|
+
justifyContent: 'center',
|
23
|
+
backgroundColor: '$gray600',
|
24
|
+
color: '$gray800',
|
25
|
+
svg: {
|
26
|
+
width: '$6',
|
27
|
+
height: '$6',
|
28
|
+
},
|
29
|
+
})
|
package/src/components/Box.tsx
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { ComponentProps } from 'react'
|
2
|
-
import { styled } from '../styles'
|
3
|
-
|
4
|
-
export const Box = styled('div', {
|
5
|
-
padding: '$
|
6
|
-
borderRadius: '$md',
|
7
|
-
backgroundColor: '$gray800',
|
8
|
-
border: '1px solid $gray600',
|
9
|
-
})
|
10
|
-
|
11
|
-
export interface BoxProps extends ComponentProps<typeof Box> {}
|
12
|
-
Box.displayName = 'Box'
|
1
|
+
import { ComponentProps } from 'react'
|
2
|
+
import { styled } from '../styles'
|
3
|
+
|
4
|
+
export const Box = styled('div', {
|
5
|
+
padding: '$6',
|
6
|
+
borderRadius: '$md',
|
7
|
+
backgroundColor: '$gray800',
|
8
|
+
border: '1px solid $gray600',
|
9
|
+
})
|
10
|
+
|
11
|
+
export interface BoxProps extends ComponentProps<typeof Box> {}
|
12
|
+
Box.displayName = 'Box'
|
@@ -1,84 +1,87 @@
|
|
1
|
-
import { ComponentProps, ElementType } from 'react'
|
2
|
-
import { styled } from '../styles'
|
3
|
-
|
4
|
-
export const Button = styled('button', {
|
5
|
-
all: 'unset',
|
6
|
-
borderRadius: '$sm',
|
7
|
-
fontSize: '$sm',
|
8
|
-
fontWeight: '$medium',
|
9
|
-
fontFamily: '$default',
|
10
|
-
textAlign: 'center',
|
11
|
-
minWidth: 120,
|
12
|
-
boxSizing: 'border-box',
|
13
|
-
display: 'flex',
|
14
|
-
alignItems: 'center',
|
15
|
-
justifyContent: 'center',
|
16
|
-
gap: '$2',
|
17
|
-
cursor: 'pointer',
|
18
|
-
padding: '0 $4',
|
19
|
-
|
20
|
-
svg: {
|
21
|
-
width: '$4',
|
22
|
-
height: '$4',
|
23
|
-
},
|
24
|
-
|
25
|
-
'&:disabled': {
|
26
|
-
cursor: 'not-allowed',
|
27
|
-
},
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
'&:disabled': {
|
39
|
-
|
40
|
-
},
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
color: '$
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
'&:disabled': {
|
61
|
-
|
62
|
-
},
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
height:
|
71
|
-
},
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
2
|
+
import { styled } from '../styles'
|
3
|
+
|
4
|
+
export const Button = styled('button', {
|
5
|
+
all: 'unset',
|
6
|
+
borderRadius: '$sm',
|
7
|
+
fontSize: '$sm',
|
8
|
+
fontWeight: '$medium',
|
9
|
+
fontFamily: '$default',
|
10
|
+
textAlign: 'center',
|
11
|
+
minWidth: 120,
|
12
|
+
boxSizing: 'border-box',
|
13
|
+
display: 'flex',
|
14
|
+
alignItems: 'center',
|
15
|
+
justifyContent: 'center',
|
16
|
+
gap: '$2',
|
17
|
+
cursor: 'pointer',
|
18
|
+
padding: '0 $4',
|
19
|
+
|
20
|
+
svg: {
|
21
|
+
width: '$4',
|
22
|
+
height: '$4',
|
23
|
+
},
|
24
|
+
|
25
|
+
'&:disabled': {
|
26
|
+
cursor: 'not-allowed',
|
27
|
+
},
|
28
|
+
'&:focus': {
|
29
|
+
boxShadow: '0 0 0 2px $colors$gray-100',
|
30
|
+
},
|
31
|
+
|
32
|
+
variants: {
|
33
|
+
variant: {
|
34
|
+
primary: {
|
35
|
+
color: '$white',
|
36
|
+
background: '$ignite500',
|
37
|
+
|
38
|
+
'&:not(:disabled):hover': {
|
39
|
+
background: '$ignite300',
|
40
|
+
},
|
41
|
+
'&:disabled': {
|
42
|
+
backgroundColor: '$gray200',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
secondary: {
|
46
|
+
color: '$ignite300',
|
47
|
+
border: '2px solid $ignite300',
|
48
|
+
'&:not(:disabled):hover': {
|
49
|
+
background: '$ignite500',
|
50
|
+
color: '$white',
|
51
|
+
},
|
52
|
+
'&:disabled': {
|
53
|
+
color: '$gray200',
|
54
|
+
borderColor: '$gray200',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
tertiary: {
|
58
|
+
color: '$gray100',
|
59
|
+
|
60
|
+
'&:not(:disabled):hover': {
|
61
|
+
background: '$white',
|
62
|
+
},
|
63
|
+
'&:disabled': {
|
64
|
+
color: '$gray600',
|
65
|
+
},
|
66
|
+
},
|
67
|
+
},
|
68
|
+
size: {
|
69
|
+
sm: {
|
70
|
+
height: 38,
|
71
|
+
},
|
72
|
+
md: {
|
73
|
+
height: 46,
|
74
|
+
},
|
75
|
+
},
|
76
|
+
},
|
77
|
+
defaultVariants: {
|
78
|
+
variant: 'primary',
|
79
|
+
size: 'md',
|
80
|
+
},
|
81
|
+
})
|
82
|
+
|
83
|
+
export interface ButtonProps extends ComponentProps<typeof Button> {
|
84
|
+
as?: ElementType
|
85
|
+
}
|
86
|
+
|
87
|
+
Button.displayName = 'Button'
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import { Check } from 'phosphor-react'
|
2
|
-
import { CheckboxContainer, CheckboxIndicator } from './styles'
|
3
|
-
import { ComponentProps } from 'react'
|
4
|
-
|
5
|
-
export interface CheckboxProps
|
6
|
-
extends ComponentProps<typeof CheckboxContainer> {}
|
7
|
-
|
8
|
-
// asChild: Funciona como um elemento filho: assim, CheckboxIndicator não criará um novo elemento na tela
|
9
|
-
|
10
|
-
export function Checkbox(props: CheckboxProps) {
|
11
|
-
return (
|
12
|
-
<CheckboxContainer {...props}>
|
13
|
-
<CheckboxIndicator asChild>
|
14
|
-
<Check weight="bold" />
|
15
|
-
</CheckboxIndicator>
|
16
|
-
</CheckboxContainer>
|
17
|
-
)
|
18
|
-
}
|
19
|
-
|
20
|
-
Checkbox.displayName = 'Checkbox'
|
1
|
+
import { Check } from 'phosphor-react'
|
2
|
+
import { CheckboxContainer, CheckboxIndicator } from './styles'
|
3
|
+
import { ComponentProps } from 'react'
|
4
|
+
|
5
|
+
export interface CheckboxProps
|
6
|
+
extends ComponentProps<typeof CheckboxContainer> {}
|
7
|
+
|
8
|
+
// asChild: Funciona como um elemento filho: assim, CheckboxIndicator não criará um novo elemento na tela
|
9
|
+
|
10
|
+
export function Checkbox(props: CheckboxProps) {
|
11
|
+
return (
|
12
|
+
<CheckboxContainer {...props}>
|
13
|
+
<CheckboxIndicator asChild>
|
14
|
+
<Check weight="bold" />
|
15
|
+
</CheckboxIndicator>
|
16
|
+
</CheckboxContainer>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
|
20
|
+
Checkbox.displayName = 'Checkbox'
|