@lets-events/react 4.0.0 → 5.0.0

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.
@@ -0,0 +1,34 @@
1
+ import { ComponentProps, ElementType } from 'react';
2
+ import { styled } from '../styles';
3
+ import { Section as SectionRadix } from '@radix-ui/themes';
4
+
5
+ export const SectionStyled = styled(SectionRadix, {
6
+ variants: {
7
+ size: {
8
+ xs: { maxWidth: '576px' },
9
+ sm: { minWidth: '577px', maxWidth: '767px' },
10
+ md: { mixWidth: '768px', maxWidth: '991px' },
11
+ lg: { mixWidth: '992px', maxWidth: '1199px' },
12
+ xl: { mixWidth: '1200px', maxWidth: '1399px' },
13
+ xxl: { mixWidth: '1400px' },
14
+ responsive: { width: '100%', maxWidth: '100%', minWidth: '100%' }
15
+ },
16
+ display: {
17
+ none: { display: 'none' },
18
+ initial: { display: 'initial' },
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ size: 'md',
23
+ display: 'initial'
24
+ },
25
+ });
26
+
27
+ export type SectionProps = ComponentProps<typeof SectionStyled> & {
28
+ as?: ElementType;
29
+ children: React.ReactNode;
30
+ };
31
+
32
+ export function Section({ children, ...props }: SectionProps) {
33
+ return <SectionStyled {...props}>{children}</SectionStyled>;
34
+ }
@@ -0,0 +1,148 @@
1
+ import React, { ComponentProps, ElementType } from 'react'
2
+ import { styled } from '../styles'
3
+ import { Box, Tabs as StepRadix } from "@radix-ui/themes";
4
+
5
+ export const StepStyled = styled('div', {
6
+ fontFamily: '$default',
7
+ color: '$gray100',
8
+ letterSpacing: '0px',
9
+
10
+ })
11
+
12
+ const StepTriggerStyled = styled(StepRadix.Trigger, {
13
+ all: 'unset',
14
+ position: 'relative',
15
+ display: 'flex',
16
+ alignItems: 'center',
17
+ justifyContent: 'center',
18
+ fontSize: '$16',
19
+ fontWeight: '$medium',
20
+
21
+
22
+ minWidth: '32px',
23
+ minHeight: '32px',
24
+ marginRight: '40px',
25
+
26
+
27
+ '&:last-of-type': {
28
+ marginRight: 0,
29
+ },
30
+
31
+
32
+ '& > span:first-of-type': {
33
+ width: '32px',
34
+ height: '32px',
35
+ borderRadius: '$full',
36
+ backgroundColor: '$neutral50',
37
+ border: '1px solid $neutral200',
38
+ color: '$gray700',
39
+ display: 'flex',
40
+ alignItems: 'center',
41
+ justifyContent: 'center',
42
+ zIndex: 1,
43
+ position: 'relative',
44
+
45
+ },
46
+
47
+
48
+ '&[data-state="active"] > span:first-of-type': {
49
+ backgroundColor: '$blue500',
50
+ borderColor: '$blue500',
51
+ color: 'white',
52
+ },
53
+
54
+
55
+ '& > span:last-of-type': {
56
+ display: 'none',
57
+ },
58
+
59
+
60
+ '&:not(:first-of-type)::before': {
61
+ content: '""',
62
+ position: 'absolute',
63
+ top: '50%',
64
+ right: 'calc(100% + 4px)',
65
+ transform: 'translateY(-50%)',
66
+ width: '32px',
67
+ height: '8px',
68
+ borderRadius: '$sm',
69
+ backgroundColor: '$neutral50',
70
+ zIndex: 0,
71
+ },
72
+
73
+
74
+ '&[data-state="active"]::before': {
75
+ backgroundColor: '$blue500',
76
+ },
77
+
78
+ '&[data-filled="true"] > span:first-of-type': {
79
+ backgroundColor: '$blue500',
80
+ borderColor: '$blue500',
81
+ color: 'white',
82
+ },
83
+
84
+ '&[data-filled="true"]::before': {
85
+ backgroundColor: '$blue500',
86
+ },
87
+ });
88
+
89
+ const StepListStyled = styled(StepRadix.List, {
90
+ display: 'flex',
91
+ alignItems: 'center',
92
+ justifyContent: 'flex-start',
93
+ gap: '$4',
94
+
95
+ });
96
+
97
+ export type StepProps = ComponentProps<typeof StepStyled> & {
98
+ children: React.ReactNode,
99
+ defaultValue: number
100
+
101
+ }
102
+ export function Step({ children, defaultValue, ...props }: StepProps) {
103
+ return (
104
+ <StepRadix.Root defaultValue={String(defaultValue)}>
105
+ <StepStyled {...props}>
106
+ {children}
107
+ </StepStyled>
108
+ </StepRadix.Root>
109
+
110
+ )
111
+ }
112
+
113
+ export function StepTrigger({ value, children, currentStep, ...props }: { value: number, children: React.ReactNode | string, currentStep?: number, onClick: () => void }) {
114
+ const isActiveOrPrevious = currentStep !== undefined && value <= currentStep
115
+ console.log(isActiveOrPrevious, 'isActiveOrPrevius', currentStep)
116
+ return (
117
+ <StepTriggerStyled data-filled={isActiveOrPrevious} value={String(value)} {...props}>{children}</StepTriggerStyled>
118
+ )
119
+ }
120
+
121
+ export function StepContent({ value, children, ...props }: { value: number, children: React.ReactNode }) {
122
+ return (
123
+ <StepRadix.Content value={String(value)} {...props}>
124
+ {children}
125
+ </StepRadix.Content>
126
+ )
127
+ }
128
+
129
+ export function StepList({ children, currentStep, ...props }: { children: React.ReactNode, currentStep: number }) {
130
+ return (
131
+ <StepListStyled {...props}>
132
+ {React.Children.map(children, (child) => {
133
+ if (React.isValidElement(child) && child.type === StepTrigger) {
134
+ return React.cloneElement(child, { currentStep } as any)
135
+ }
136
+ return child
137
+ })}
138
+ </StepListStyled>
139
+ )
140
+ }
141
+
142
+ export function StepWrapper({ children, ...props }: { children: React.ReactNode }) {
143
+ return (
144
+ <Box {...props}>
145
+ {children}
146
+ </Box>
147
+ )
148
+ }
@@ -0,0 +1,109 @@
1
+ import { Switch as RadixSwitch } from '@radix-ui/themes'
2
+ import type { ComponentProps } from 'react'
3
+ import { styled } from '../styles'
4
+
5
+ export const SwitchStyled = styled(RadixSwitch, {
6
+ all: 'unset',
7
+ borderRadius: '$full',
8
+ position: 'relative',
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ transition: 'all 0.3s',
13
+ cursor: 'pointer',
14
+
15
+ '&::before': {
16
+ content: '""',
17
+ position: 'absolute',
18
+ borderRadius: '$full',
19
+ pointerEvents: 'none',
20
+ cursor: 'pointer',
21
+ },
22
+ 'span': {
23
+ position: 'absolute',
24
+ top: '50%',
25
+ left: 0,
26
+ transform: 'translate(0, -50%)',
27
+ borderRadius: '50%',
28
+ transition: 'all 0.3s',
29
+ cursor: 'pointer',
30
+ borderWidth: '1px',
31
+ borderStyle: 'solid',
32
+ boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.24)',
33
+ },
34
+
35
+ '&[data-state="checked"] span': {
36
+ left: 'auto',
37
+ transform: 'translate(50%, -50%)',
38
+ },
39
+
40
+ variants: {
41
+ color: {
42
+ brand: {
43
+ '&::before': {
44
+ backgroundColor: '$brand50',
45
+ },
46
+ 'span': {
47
+ backgroundColor: '$dark50',
48
+ borderColor: '$neutral300',
49
+ },
50
+ '&[data-state="checked"] span': {
51
+ backgroundColor: '$brand500',
52
+ borderColor: '$brand500',
53
+ },
54
+ }
55
+ },
56
+ size: {
57
+ sm: {
58
+ width: '32px',
59
+ height: '20px',
60
+ '&::before': {
61
+ width: '$32',
62
+ height: '$12',
63
+ },
64
+
65
+ 'span': {
66
+ width: '$20',
67
+ height: '$20',
68
+ },
69
+ },
70
+ md: {
71
+ width: '40px',
72
+ height: '20px',
73
+ '&::before': {
74
+ width: '40px',
75
+ height: '16px',
76
+ },
77
+ 'span': {
78
+ width: '24px',
79
+ height: '24px',
80
+ },
81
+ },
82
+ lg: {
83
+ width: '56px',
84
+ height: '32px',
85
+ '&::before': {
86
+ width: '56px',
87
+ height: '24px',
88
+ },
89
+ 'span': {
90
+ width: '32px',
91
+ height: '32px',
92
+ },
93
+ },
94
+ },
95
+ },
96
+ defaultVariants: {
97
+ size: 'md',
98
+ color: 'brand',
99
+ },
100
+
101
+ })
102
+ export type SwitchProps = ComponentProps<typeof RadixSwitch> & {
103
+ color?: 'brand'
104
+ size?: 'sm' | 'md' | 'lg'
105
+ }
106
+
107
+ export function Switch(props: SwitchProps) {
108
+ return <SwitchStyled color="brand" defaultChecked {...props} />
109
+ }
@@ -1,26 +1,32 @@
1
1
  import { ComponentProps, ElementType } from 'react'
2
2
  import { styled } from '../styles'
3
3
  import { Text as TextRadix } from '@radix-ui/themes'
4
+ import { CSS } from '@stitches/react'
4
5
 
5
- export const Text = styled(TextRadix, {
6
+ export const TextStyle = styled(TextRadix, {
6
7
  fontFamily: '$default',
7
8
  lineHeight: '$base',
8
9
  color: '$gray100',
9
10
  letterSpacing: '$2',
10
11
  fontWeight: '$semibold',
12
+ fontSize: '$sm',
11
13
  variants: {
12
14
  size: {
13
15
  lg: { fontSize: '$56' },
14
16
  md: { fontSize: '$48' },
15
17
  sm: { fontSize: '$36' },
16
- },
17
- },
18
-
19
- defaultVariants: {
20
- size: 'md',
21
- },
18
+ }
19
+ }
22
20
  })
23
21
 
24
- export type TextProps = ComponentProps<typeof Text> & {
25
- as?: ElementType
22
+ export type TextProps = ComponentProps<typeof TextStyle> & {
23
+ as?: ElementType,
24
+ asChild?: boolean
25
+ css?: CSS
26
26
  }
27
+
28
+ export function Text({ ...props }: TextProps) {
29
+ return (
30
+ <TextStyle {...props} />
31
+ )
32
+ }
package/src/index.tsx CHANGED
@@ -1,23 +1,27 @@
1
+ // Icon
1
2
  export * from './components/Icon'
3
+
4
+ // Text
2
5
  export * from './components/Text'
3
- export * from './components/DisplayText'
4
- export * from './components/Headline'
5
- export * from './components/Subtitle'
6
- export * from './components/BodyText'
7
- export * from './components/Label'
8
- export * from './components/BadgeText'
9
- export * from './components/CaptionText'
10
- export * from './components/TooltipText'
11
6
 
7
+ // Components
12
8
  export * from './components/Button'
13
9
  export * from './components/ButtonGroup'
14
10
  export * from './components/Avatar'
15
- export * from './components/Flex'
16
- export * from './components/Box'
17
11
  export * from './components/TextField'
18
12
  export * from './components/RadioGroup'
19
13
  export * from './components/CheckboxGroup'
20
14
  export * from './components/Filter'
21
15
  export * from './components/Dropdown'
22
16
  export * from './components/Badge'
17
+ export * from './components/Modal'
18
+ export * from './components/Alert'
19
+ export * from './components/Switch'
20
+ export * from './components/Step'
23
21
 
22
+ // Layouts
23
+ export * from './components/Flex'
24
+ export * from './components/Box'
25
+ export * from './components/Grid'
26
+ export * from './components/Container'
27
+ export * from './components/Section'
@@ -1,29 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Text } from "@radix-ui/themes";
4
- export const BadgeText = styled(Text, {
5
- fontFamily: '$default',
6
- color: '$gray100',
7
- letterSpacing: '0px',
8
- variants: {
9
- size: {
10
- 1: { fontSize: '$16', lineHeight: '$16', fontWeight: '$regular' },
11
- 2: { fontSize: '$14', lineHeight: '$14', fontWeight: '$regular' },
12
- 3: { fontSize: '$12', lineHeight: '$12', fontWeight: '$regular' },
13
- 4: { fontSize: '$10', lineHeight: '$10', fontWeight: '$regular' },
14
- 'xs': { fontSize: '$10', lineHeight: '$10', fontWeight: '$regular' },
15
- 'sm': { fontSize: '$12', lineHeight: '$12', fontWeight: '$regular' },
16
- 'md': { fontSize: '$14', lineHeight: '$14', fontWeight: '$regular' },
17
- 'xl': { fontSize: '$16', lineHeight: '$16', fontWeight: '$regular' },
18
- },
19
-
20
- },
21
-
22
- defaultVariants: {
23
- size: '1',
24
- },
25
- })
26
-
27
- export type BadgeTextProps = ComponentProps<typeof BadgeText> & {
28
- as?: ElementType
29
- }
@@ -1,24 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Text } from "@radix-ui/themes";
4
- export const BodyText = styled(Text, {
5
- fontFamily: '$default',
6
- color: '$gray100',
7
- fontWeight: '$regular',
8
- variants: {
9
- size: {
10
- 1: { fontSize: '$16', lineHeight: '$24' },
11
- 2: { fontSize: '$14', lineHeight: '$24' },
12
- 3: { fontSize: '$13', lineHeight: '$24' },
13
- 4: { fontSize: '$12', lineHeight: '$16' },
14
- },
15
- },
16
-
17
- defaultVariants: {
18
- size: '1',
19
- },
20
- })
21
-
22
- export type BodyTextProps = ComponentProps<typeof BodyText> & {
23
- as?: ElementType
24
- }
@@ -1,16 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Text } from '@radix-ui/themes'
4
-
5
- export const CaptionText = styled(Text, {
6
- fontFamily: '$default',
7
- color: '$gray100',
8
- letterSpacing: '0px',
9
- fontSize: '$14',
10
- lineHeight: '$16',
11
- fontWeight: '$regular',
12
- })
13
-
14
- export type CaptionTextProps = ComponentProps<typeof CaptionText> & {
15
- as?: ElementType
16
- }
@@ -1,26 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Text } from '@radix-ui/themes'
4
-
5
- export const DisplayText = styled('p', {
6
- fontFamily: '$default',
7
- lineHeight: '$base',
8
- color: '$gray100',
9
- letterSpacing: '$2',
10
- fontWeight: '$semibold',
11
- variants: {
12
- size: {
13
- lg: { fontSize: '$56' },
14
- md: { fontSize: '$48' },
15
- sm: { fontSize: '$36' },
16
- },
17
- },
18
-
19
- defaultVariants: {
20
- size: 'md',
21
- },
22
- })
23
-
24
- export type DisplayTextProps = ComponentProps<typeof DisplayText> & {
25
- as?: ElementType
26
- }
@@ -1,29 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Heading } from '@radix-ui/themes'
4
-
5
- export const Headline = styled(Heading, {
6
- fontFamily: '$default',
7
- color: '$gray100',
8
- letterSpacing: '0px',
9
- variants: {
10
- size: {
11
- 1: { fontSize: '$48', lineHeight: '$64', fontWeight: '$semibold' },
12
- 2: { fontSize: '$32', lineHeight: '$48', fontWeight: '$semibold' },
13
- 3: { fontSize: '$24', lineHeight: '$40', fontWeight: '$semibold' },
14
- 4: { fontSize: '$20', lineHeight: '$36', fontWeight: '$semibold' },
15
- 5: { fontSize: '$18', lineHeight: '$24', fontWeight: '$semibold' },
16
- 6: { fontSize: '$18', lineHeight: '$34', fontWeight: '$medium' },
17
- 7: { fontSize: '$16', lineHeight: '$32', fontWeight: '$semibold' },
18
- 8: { fontSize: '$16', lineHeight: '$32', fontWeight: '$medium' },
19
- },
20
- },
21
-
22
- defaultVariants: {
23
- size: 1,
24
- },
25
- })
26
-
27
- export type HeadlineProps = ComponentProps<typeof Headline> & {
28
- as?: ElementType
29
- }
@@ -1,28 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Text } from '@radix-ui/themes'
4
-
5
- export const Label = styled(Text, {
6
- fontFamily: '$default',
7
- color: '$gray100',
8
- letterSpacing: '0px',
9
- variants: {
10
- size: {
11
- 1: { fontSize: '$18', lineHeight: '$22', fontWeight: '$semibold' },
12
- 2: { fontSize: '$14', lineHeight: '$16', fontWeight: '$medium' },
13
- 3: { fontSize: '$14', lineHeight: '$16', fontWeight: '$regular' },
14
- 4: { fontSize: '$13', lineHeight: '$16', fontWeight: '$semibold', letterSpacing: '2px' },
15
- 5: { fontSize: '$13', lineHeight: '$16', fontWeight: '$medium' },
16
- 6: { fontSize: '$13', lineHeight: '$16', fontWeight: '$regular' },
17
- 7: { fontSize: '$12', lineHeight: '$12', fontWeight: '$regular' },
18
- },
19
- },
20
-
21
- defaultVariants: {
22
- size: '1',
23
- },
24
- })
25
-
26
- export type LabelProps = ComponentProps<typeof Label> & {
27
- as?: ElementType
28
- }
@@ -1,26 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
- import { Text } from '@radix-ui/themes'
4
-
5
- export const Subtitle = styled(Text, {
6
- fontFamily: '$default',
7
- color: '$gray100',
8
- letterSpacing: '0px',
9
- variants: {
10
- size: {
11
- 1: { fontSize: '$20', lineHeight: '$36', fontWeight: '$regular' },
12
- 2: { fontSize: '$18', lineHeight: '$34', fontWeight: '$regular' },
13
- 3: { fontSize: '$16', lineHeight: '$32', fontWeight: '$regular' },
14
- 4: { fontSize: '$14', lineHeight: '$24', fontWeight: '$regular' },
15
- 5: { fontSize: '$14', lineHeight: '$16', fontWeight: '$semibold' },
16
- },
17
- },
18
-
19
- defaultVariants: {
20
- size: 1,
21
- },
22
- })
23
-
24
- export type SubtitleProps = ComponentProps<typeof Subtitle> & {
25
- as?: ElementType
26
- }
@@ -1,15 +0,0 @@
1
- import { ComponentProps, ElementType } from 'react'
2
- import { styled } from '../styles'
3
-
4
- export const TooltipText = styled('span', {
5
- fontFamily: '$default',
6
- color: '$gray100',
7
- letterSpacing: '0px',
8
- fontSize: '$13',
9
- lineHeight: '$16',
10
- fontWeight: '$regular',
11
- })
12
-
13
- export interface TooltipTextProps extends ComponentProps<typeof TooltipText> {
14
- as?: ElementType
15
- }