@lets-events/react 3.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.
@@ -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
+ }
@@ -34,13 +34,42 @@ export const TextFieldStyled = styled(TextFieldRadix.Root, {
34
34
  cursor: 'not-allowed',
35
35
  },
36
36
  variants: {
37
+ color: {
38
+ default: {
39
+ color: '$dark400',
40
+ border: '1px solid $dark200',
41
+ '&:has(input:focus)': {
42
+ border: '2px solid $brand300',
43
+ },
44
+ '&:has(input:disabled)': {
45
+ backgroundColor: '$dark100',
46
+ color: '$dark400',
47
+ border: '1px solid $dark200',
48
+ cursor: 'not-allowed',
49
+ },
50
+ },
51
+ error:{
52
+ border: '1px solid $error400',
53
+ color: '$error400',
54
+ 'input::placeholder': {
55
+ color: '$error400',
56
+ },
57
+ '& hast(input:focus)': {
58
+ border: '2px solid $error400',
59
+ },
60
+ '&:has(input:disabled)': {
61
+ backgroundColor: '$error50',
62
+ color: '$error300',
63
+ border: '1px solid $error100',
64
+ cursor: 'not-allowed',
65
+ },
66
+ },
67
+
68
+ },
37
69
  isValid: {
38
70
  true: {},
39
71
  false: {
40
- border: '1px solid $error400',
41
- color: '$error400',
42
- backgroundColor: '$error50',
43
- }
72
+ }
44
73
  },
45
74
  },
46
75
 
@@ -101,25 +130,27 @@ export type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
101
130
  name?: string,
102
131
  }
103
132
 
104
- export type TextFieldSlotProps = ComponentProps<typeof TextFieldStyled> & {
133
+ export type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, 'color'> & {
105
134
  placeholder?: string
106
135
  children?: React.ReactNode
107
136
  position?: 'flex-start' | 'flex-end'
108
137
  onClick?: () => void,
138
+ color?: "error" | "success" | undefined
109
139
  }
110
140
 
111
141
  export function TextField({
112
142
  children,
113
143
  isValid,
114
144
  name,
145
+ color,
115
146
  ...props
116
147
  }: TextFieldProps) {
117
148
 
118
149
  return (
119
- <TextFieldStyled isValid={isValid} name={name} {...props}>
150
+ <TextFieldStyled color={color} isValid={isValid} name={name} {...props}>
120
151
  {children}
121
152
  {isValid && (
122
- <TextFieldSlot position='flex-end' name={name}>
153
+ <TextFieldSlot position='flex-end' name={name} color={color as TextFieldSlotProps['color']}>
123
154
  <Icon name='check' />
124
155
  </TextFieldSlot>
125
156
  )}
@@ -139,7 +170,7 @@ export function TextFieldSlot({
139
170
  <>
140
171
  {
141
172
  !!onClick ?
142
- <TextFieldSlotStyled {...props} style={{
173
+ <TextFieldSlotStyled {...{ ...props, color: undefined }} style={{
143
174
  position: 'absolute',
144
175
  left: position === 'flex-end' ? 'none' : 15,
145
176
  right: position === 'flex-start' ? 'none' : 15,
@@ -149,7 +180,7 @@ export function TextFieldSlot({
149
180
  cursor: 'pointer',
150
181
  }} onClick={() => onClick()}>{children}</TextFieldSlotStyled>
151
182
  :
152
- <TextFieldSlotStyled {...props} style={{
183
+ <TextFieldSlotStyled {...{ ...props, color: undefined }} style={{
153
184
  float: position === 'flex-start' ? 'left' : 'right',
154
185
  order: position === 'flex-start' ? 0 : 2,
155
186
  marginLeft: position === 'flex-start' ? 0 : 15,
package/src/index.tsx CHANGED
@@ -1,22 +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'
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'
22
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,24 +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
- },
15
- },
16
-
17
- defaultVariants: {
18
- size: '1',
19
- },
20
- })
21
-
22
- export type BadgeTextProps = ComponentProps<typeof BadgeText> & {
23
- as?: ElementType
24
- }
@@ -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
- }