@liguelead/design-system 0.0.11 → 0.0.13

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.
@@ -2,7 +2,8 @@ import {
2
2
  spacing,
3
3
  fontSize,
4
4
  fontWeight,
5
- radius
5
+ radius,
6
+ shadow
6
7
  } from '@liguelead/foundation'
7
8
  import { parseColor } from '../../utils'
8
9
  import styled, { css } from 'styled-components'
@@ -32,8 +33,9 @@ export const CheckboxWrapper = styled.label`
32
33
  export const CustomCheckbox = styled.span<{
33
34
  checked: boolean
34
35
  disabled?: boolean
36
+ error?: boolean
35
37
  }>`
36
- ${({ checked, theme, disabled }) => css`
38
+ ${({ checked, theme, disabled, error }) => css`
37
39
  width: ${spacing.spacing16}px;
38
40
  height: ${spacing.spacing16}px;
39
41
  border: 1px solid ${checked
@@ -52,11 +54,17 @@ export const CustomCheckbox = styled.span<{
52
54
  overflow: hidden;
53
55
 
54
56
  ${disabled &&
55
- css`
56
- background-color: transparent;
57
- border-color: ${parseColor(theme.colors.neutral400)}70;
58
- cursor: not-allowed;
59
- `}
57
+ css`
58
+ background-color: transparent;
59
+ border-color: ${parseColor(theme.colors.neutral400)}70;
60
+ cursor: not-allowed;
61
+ `}
62
+
63
+ ${error &&
64
+ css`
65
+ border-color: ${parseColor(theme.colors.danger200)};
66
+ box-shadow: ${shadow.errorShadow};
67
+ `}
60
68
 
61
69
  &::after {
62
70
  content: '';
@@ -98,18 +106,19 @@ export const Label = styled.span<{ disabled?: boolean }>`
98
106
 
99
107
  color: ${({ theme, disabled }) =>
100
108
  disabled
101
- ? `${parseColor(theme.colors.neutral1100)}70`
102
- : parseColor(theme.colors.neutral1100)};
109
+ ? `${parseColor(theme.colors.textDark)}70`
110
+ : parseColor(theme.colors.textDark)};
103
111
  `
104
112
 
105
- export const CustomLabel = styled(Text)<{ disabled?: boolean }>`
113
+ export const CustomLabel = styled(Text)<{ disabled?: boolean; error?: boolean }>`
106
114
  font-size: ${fontSize.fontSize12}px;
107
115
  font-weight: ${fontWeight.fontWeight400};
108
116
  line-height: 8px;
109
117
 
110
- color: ${({ theme, disabled }) =>
118
+ color: ${({ theme, disabled, error }) =>
111
119
  disabled
112
120
  ? `${parseColor(theme.colors.textMedium)}70`
121
+ : error
122
+ ? parseColor(theme.colors.danger200)
113
123
  : parseColor(theme.colors.textMedium)};
114
-
115
124
  `
@@ -21,6 +21,8 @@ const Checkbox: React.FC<CheckboxProps> = ({
21
21
  disabled = false,
22
22
  register,
23
23
  className,
24
+ error,
25
+ children,
24
26
  description,
25
27
  ...rest
26
28
  }) => {
@@ -64,8 +66,8 @@ const Checkbox: React.FC<CheckboxProps> = ({
64
66
  <CustomCheckbox
65
67
  checked={internalChecked}
66
68
  disabled={disabled}
67
- onClick={handleRipple}
68
- >
69
+ error={!!error}
70
+ onClick={handleRipple}>
69
71
  {ripples.map(ripple => (
70
72
  <RippleContainer
71
73
  key={ripple.id}
@@ -82,13 +84,12 @@ const Checkbox: React.FC<CheckboxProps> = ({
82
84
  ))}
83
85
  </CustomCheckbox>
84
86
  <div>
85
- {label && <Label disabled={disabled}>{label}</Label>}
86
- <CustomLabel
87
- disabled={disabled}
88
- weight="fontWeight400"
89
- >
90
- {description}
91
- </CustomLabel>
87
+ {label ? <Label disabled={disabled}>{label}</Label> : children}
88
+ {(description || error) && (
89
+ <CustomLabel disabled={disabled} weight="fontWeight400">
90
+ {error?.message || description}
91
+ </CustomLabel>
92
+ )}
92
93
  </div>
93
94
  </CheckboxWrapper>
94
95
  )
@@ -1,9 +1,11 @@
1
- import { UseFormRegisterReturn } from 'react-hook-form'
1
+ import { FieldValues, UseFormRegisterReturn } from 'react-hook-form'
2
2
 
3
- export interface CheckboxProps {
3
+ export interface CheckboxProps<TFieldValues extends FieldValues = FieldValues> {
4
4
  label?: string
5
5
  checked?: boolean
6
+ error?: TFieldValues
6
7
  description?: string
8
+ children?: React.ReactNode
7
9
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
8
10
  disabled?: boolean
9
11
  register?: UseFormRegisterReturn<string>
@@ -2,16 +2,22 @@ import styled, { css } from 'styled-components'
2
2
  import { spacing, fontSize, fontWeight, shadow, lineHeight } from '@liguelead/foundation'
3
3
  import { parseColor } from '../../utils'
4
4
 
5
- export const OptWrapper = styled.div`
6
- display: flex;
7
- gap: ${spacing.spacing16}px;
8
- `
9
-
10
5
  interface OptBoxProps {
11
6
  $disabled?: boolean;
12
7
  $error?: boolean;
13
8
  }
14
9
 
10
+ export const OptWrapper = styled.div`
11
+ display: flex;
12
+ gap: ${spacing.spacing8}px;
13
+ `
14
+
15
+ export const OptContainer = styled.div`
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: ${spacing.spacing4}px;
19
+ `
20
+
15
21
  export const OptBox = styled.input<OptBoxProps>`
16
22
  width: ${spacing.spacing36}px;
17
23
  height: ${spacing.spacing36}px;
@@ -36,7 +42,7 @@ export const OptBox = styled.input<OptBoxProps>`
36
42
  $error
37
43
  ? css`
38
44
  border-color: ${parseColor(theme.colors.danger200)};
39
- box-shadow: 0 0 0 3px ${parseColor(theme.colors.danger100)}40;
45
+ box-shadow: ${shadow.errorShadow};
40
46
  `
41
47
  : css`
42
48
  border-color: ${parseColor(theme.colors.neutral700)};
@@ -55,9 +61,9 @@ export const OptBox = styled.input<OptBoxProps>`
55
61
  `
56
62
 
57
63
  export const OtpSeparator = styled.span`
58
- color: ${({ theme }) => parseColor(theme.colors.neutral700)};
59
- font-size: 20px;
60
- user-select: none;
64
+ width: 14px;
65
+ border: 1px solid ${({ theme }) => parseColor(theme.colors.neutral700)};
66
+ border-radius: 8px;
61
67
  `
62
68
 
63
69
  export const OtpSeparatorContainer = styled.div`
@@ -67,7 +73,6 @@ export const OtpSeparatorContainer = styled.div`
67
73
 
68
74
  export const OptHelperText = styled.span<{ $error?: boolean }>`
69
75
  display: block;
70
- margin-top: ${spacing.spacing8}px;
71
76
  font-size: ${fontSize.fontSize12}px;
72
77
  line-height: ${lineHeight.lineHeight16}px;
73
78
  color: ${({ theme, $error }) =>
@@ -6,6 +6,7 @@ import {
6
6
  OtpSeparator,
7
7
  OptHelperText,
8
8
  OtpSeparatorContainer,
9
+ OptContainer,
9
10
  } from './InputOpt.styles'
10
11
 
11
12
  import {
@@ -17,6 +18,9 @@ import {
17
18
  focusFirstEmpty
18
19
  } from './utils'
19
20
 
21
+ import Text from '../Text'
22
+ import RequiredAsterisk from '../RequiredAsterisk'
23
+
20
24
  const InputOpt: React.FC<InputOptProps> = ({
21
25
  length = 6,
22
26
  value,
@@ -25,7 +29,8 @@ const InputOpt: React.FC<InputOptProps> = ({
25
29
  autoFocus = true,
26
30
  disabled = false,
27
31
  placeholderChar = '',
28
- name = 'otp',
32
+ label,
33
+ requiredSymbol = false,
29
34
  className,
30
35
  inputMode = 'numeric',
31
36
  helperText,
@@ -105,9 +110,19 @@ const InputOpt: React.FC<InputOptProps> = ({
105
110
  }
106
111
 
107
112
  return (
108
- <>
113
+ <OptContainer
114
+ className={`${className || ''} ${error ? 'error' : ''}`.trim()}
115
+ >
116
+ {label && (
117
+ <Text
118
+ size="body02"
119
+ tag='label'
120
+ weight='fontWeight500'
121
+ >
122
+ {label} {requiredSymbol && <RequiredAsterisk/> }
123
+ </Text>
124
+ )}
109
125
  <OptWrapper
110
- className={`${className || ''} ${error ? 'error' : ''}`.trim()}
111
126
  aria-disabled={disabled}
112
127
  aria-invalid={!!error}
113
128
  role="group"
@@ -134,7 +149,7 @@ const InputOpt: React.FC<InputOptProps> = ({
134
149
  />
135
150
  {(i + 1) % 2 === 0 && i < length - 1 && (
136
151
  <OtpSeparatorContainer>
137
- <OtpSeparator>-</OtpSeparator>
152
+ <OtpSeparator/>
138
153
  </OtpSeparatorContainer>
139
154
  )}
140
155
  </React.Fragment>
@@ -146,7 +161,7 @@ const InputOpt: React.FC<InputOptProps> = ({
146
161
  {helperText}
147
162
  </OptHelperText>
148
163
  )}
149
- </>
164
+ </OptContainer>
150
165
  )
151
166
  }
152
167
 
@@ -6,7 +6,8 @@ export interface InputOptProps {
6
6
  autoFocus?: boolean;
7
7
  disabled?: boolean;
8
8
  placeholderChar?: string;
9
- name?: string;
9
+ label?: string;
10
+ requiredSymbol?: boolean;
10
11
  className?: string;
11
12
  inputMode?: 'numeric' | 'text';
12
13
  helperText?: string;
@@ -0,0 +1,6 @@
1
+ import { parseColor } from "package/utils"
2
+ import styled from "styled-components"
3
+
4
+ export const StyledAsterisk = styled.span`
5
+ color: ${({ theme }) => parseColor(theme.colors.primary)};
6
+ `
@@ -0,0 +1,7 @@
1
+ import { StyledAsterisk } from "./RequiredAsterisk.style";
2
+
3
+ const RequiredAsterisk = () => {
4
+ return <StyledAsterisk>*</StyledAsterisk>;
5
+ };
6
+
7
+ export default RequiredAsterisk;
@@ -0,0 +1 @@
1
+ export { default } from "./RequiredAsterisk";
@@ -1,27 +1,30 @@
1
1
  import { parseColor } from '../../utils'
2
2
  import { useTheme } from 'styled-components'
3
3
  import { TextFieldStates } from './Select.types'
4
+ import { shadow } from '@liguelead/foundation'
4
5
 
5
6
  export const SelectStates = (state: keyof TextFieldStates) => {
6
7
  const theme = useTheme()
7
8
  const states: TextFieldStates = {
8
9
  error: {
9
10
  input: `
10
- border: 1px solid ${parseColor(theme.colors.danger100)};
11
+ border: 1px solid ${parseColor(theme.colors.danger200)};
11
12
  color: ${parseColor(theme.colors.textDark)};
12
13
  &:focus {
13
- border-color: ${parseColor(theme.colors.danger100)};
14
+ border-color: ${parseColor(theme.colors.danger200)};
15
+ box-shadow: ${shadow.errorShadow};
14
16
  }
15
17
  `,
16
- label: `color: ${parseColor(theme.colors.danger100)};`,
17
- helperText: `color: ${parseColor(theme.colors.danger100)};`
18
+ label: `color: ${parseColor(theme.colors.textDark)};`,
19
+ helperText: `color: ${parseColor(theme.colors.danger200)};`
18
20
  },
19
21
  default: {
20
22
  input: `
21
- border: 1px solid ${parseColor(theme.colors.neutral700)};
23
+ border: 1px solid ${parseColor(theme.colors.neutral400)};
22
24
  color: ${parseColor(theme.colors.textDark)};
23
25
  &:focus {
24
- border-color: ${parseColor(theme.colors.primary)};
26
+ border-color: ${parseColor(theme.colors.neutral700)};
27
+ box-shadow: ${shadow.focusShadow};
25
28
  }
26
29
  `,
27
30
  label: `color: ${parseColor(theme.colors.textDark)};`,
@@ -32,7 +35,7 @@ export const SelectStates = (state: keyof TextFieldStates) => {
32
35
  border: 1px solid ${parseColor(theme.colors.neutral400)};
33
36
  color: ${parseColor(theme.colors.neutral600)};
34
37
  `,
35
- label: `color: ${parseColor(theme.colors.neutral1100)};`,
38
+ label: `color: ${parseColor(theme.colors.textDark)};`,
36
39
  helperText: `color: ${parseColor(theme.colors.textMedium)};`
37
40
  }
38
41
  }
@@ -22,14 +22,13 @@ export const InputWrapper = styled.div`
22
22
 
23
23
  export const Label = styled.label`
24
24
  display: block;
25
- font-weight: ${fontWeight.fontWeight600};
26
- margin-bottom: ${spacing.spacing4}px;
25
+ font-weight: ${fontWeight.fontWeight500};
27
26
  font-size: ${fontSize.fontSize14}px;
28
27
  `
29
28
 
30
29
  export const HelperText = styled.span<{ error?: boolean }>`
31
30
  font-size: ${fontSize.fontSize12}px;
32
- line-height: ${lineHeight.lineHeight12}px;
31
+ line-height: ${lineHeight.lineHeight16}px;
33
32
  `
34
33
 
35
34
  export const IconWrapper = styled.div<{
@@ -145,6 +144,9 @@ export const BorderWrapper = styled.div`
145
144
  export const Wrapper = styled.div<StyledInputProps>`
146
145
  position: relative;
147
146
  width: 100%;
147
+ display: flex;
148
+ flex-direction: column;
149
+ gap: ${spacing.spacing4}px;
148
150
  cursor: pointer;
149
151
  ${({ $themefication, size }) => `
150
152
  ${StyledInput} {
@@ -15,6 +15,7 @@ import { SelectStates } from './Select.states'
15
15
  import { textFieldSizes } from './Select.sizes'
16
16
  import { SelectProps, StateInterface } from './Select.types'
17
17
  import getState from '../TextField/utils/getState'
18
+ import RequiredAsterisk from '../RequiredAsterisk'
18
19
 
19
20
  const Select = forwardRef<HTMLInputElement, SelectProps>(
20
21
  (
@@ -26,8 +27,10 @@ const Select = forwardRef<HTMLInputElement, SelectProps>(
26
27
  leftIcon,
27
28
  size = 'md',
28
29
  options,
30
+ placeholder,
29
31
  className,
30
32
  disabled = false,
33
+ requiredSymbol = false,
31
34
  handleLeftIcon,
32
35
  register
33
36
  },
@@ -60,10 +63,12 @@ const Select = forwardRef<HTMLInputElement, SelectProps>(
60
63
  <Wrapper
61
64
  className={className}
62
65
  size={textFieldSize}
63
- $themefication={textFieldState}>
66
+ $themefication={textFieldState}
67
+ >
64
68
  <input
65
69
  type="hidden"
66
70
  value={selectValue}
71
+ placeholder={placeholder}
67
72
  ref={instance => {
68
73
  if (typeof ref === 'function') {
69
74
  ref(instance)
@@ -75,7 +80,9 @@ const Select = forwardRef<HTMLInputElement, SelectProps>(
75
80
  onChange={register?.onChange}
76
81
  onBlur={register?.onBlur}
77
82
  />
78
- <Label>{label}</Label>
83
+ <Label>
84
+ {label} {requiredSymbol && <RequiredAsterisk />}
85
+ </Label>
79
86
  {disabled ? (
80
87
  <InputWrapper className="is-disabled">
81
88
  {leftIcon && (
@@ -4,6 +4,8 @@ export interface SelectProps<TFieldValues extends FieldValues = FieldValues> {
4
4
  disabled?: boolean
5
5
  error?: TFieldValues
6
6
  label?: string
7
+ placeholder?: string
8
+ requiredSymbol? :boolean
7
9
  options: Array<{ label: string; value: string }>
8
10
  value?: string
9
11
  defaultValue?: string
@@ -17,7 +19,7 @@ export interface SelectProps<TFieldValues extends FieldValues = FieldValues> {
17
19
 
18
20
  export interface StateInterface {
19
21
  input: string
20
- label: string
22
+ label?: string
21
23
  helperText: string
22
24
  }
23
25
 
@@ -25,8 +25,8 @@ export const TextFieldStates = (state: keyof TextFieldStates) => {
25
25
  box-shadow: ${shadow.errorShadow};
26
26
  }
27
27
  `,
28
- label: `color: ${parseColor(theme.colors.danger100)};`,
29
- helperText: `color: ${parseColor(theme.colors.danger100)};`,
28
+ label: `color: ${parseColor(theme.colors.textDark)};`,
29
+ helperText: `color: ${parseColor(theme.colors.danger200)};`,
30
30
  },
31
31
  default: {
32
32
  input: `
@@ -46,6 +46,7 @@ export const TextFieldStates = (state: keyof TextFieldStates) => {
46
46
  box-shadow: 0 1px 2px 0 #0000000D;
47
47
  opacity: 0.5;
48
48
  `,
49
+ label: `color: ${parseColor(theme.colors.textDark)};`,
49
50
  helperText: `color: ${parseColor(theme.colors.neutral500)};`,
50
51
  }
51
52
  }
@@ -21,8 +21,7 @@ export const InputWrapper = styled.div`
21
21
 
22
22
  export const Label = styled.label`
23
23
  display: block;
24
- font-weight: ${fontWeight.fontWeight600};
25
- margin-bottom: ${spacing.spacing4}px;
24
+ font-weight: ${fontWeight.fontWeight500};
26
25
  font-size: ${fontSize.fontSize14}px;
27
26
  `
28
27
 
@@ -65,6 +64,9 @@ export const StyledInput = styled.input.withConfig({
65
64
  export const Wrapper = styled.div<StyledInputProps>`
66
65
  position: relative;
67
66
  width: 100%;
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: ${spacing.spacing4}px;
68
70
  ${({ $themefication, size }) => `
69
71
  ${StyledInput} {
70
72
  ${$themefication.input}
@@ -75,11 +77,7 @@ export const Wrapper = styled.div<StyledInputProps>`
75
77
  ${size.label}
76
78
  }
77
79
  ${HelperText} {
78
- ${$themefication.label}
80
+ ${$themefication.helperText}
79
81
  }
80
82
  `}
81
83
  `
82
-
83
- export const RequiredAsterisk = styled.span`
84
- color: ${({ theme }) => parseColor(theme.colors.primary)};
85
- `
@@ -2,17 +2,17 @@ import React, { forwardRef, useState } from 'react'
2
2
  import { TextFieldProps } from './TextField.types'
3
3
  import { StateInterface, TextFieldStates } from './TextField.states'
4
4
  import {
5
- Label,
6
5
  HelperText,
7
6
  IconWrapper,
8
7
  InputWrapper,
8
+ Label,
9
9
  StyledInput,
10
- Wrapper,
11
- RequiredAsterisk
10
+ Wrapper
12
11
  } from './TextField.styles'
13
12
  import { textFieldSizes } from './TextField.sizes'
14
13
  import { Eye, EyeClosed } from '@phosphor-icons/react'
15
14
  import getState from './utils/getState'
15
+ import RequiredAsterisk from '../RequiredAsterisk'
16
16
 
17
17
  const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
18
18
  (
@@ -31,6 +31,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
31
31
  type = 'text',
32
32
  value,
33
33
  register,
34
+ requiredSymbol = false,
34
35
  placeholder,
35
36
  ...props
36
37
  },
@@ -72,7 +73,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
72
73
  $themefication={textFieldState}
73
74
  >
74
75
  <Label>
75
- {label} {props.required && <RequiredAsterisk>*</RequiredAsterisk>}
76
+ {label} {requiredSymbol && <RequiredAsterisk />}
76
77
  </Label>
77
78
  <InputWrapper>
78
79
  {leftIcon && (
@@ -17,6 +17,7 @@ export interface TextFieldProps<TFieldValues extends FieldValues = FieldValues>
17
17
  leftIcon?: React.ReactNode
18
18
  rightIcon?: React.ReactNode
19
19
  error?: TFieldValues
20
+ requiredSymbol?: boolean
20
21
  type?: 'text' | 'password' | 'email' | 'number'
21
22
  register?: UseFormRegisterReturn<string>
22
23
  }
@@ -0,0 +1,100 @@
1
+ import styled, { css } from 'styled-components'
2
+ import { parseColor } from '../../utils'
3
+ import { ToastContainer } from 'react-toastify'
4
+
5
+ export const ToasterStyledContainer = styled(ToastContainer)`
6
+ ${({ theme }) => css`
7
+
8
+ /* Colored Theme */
9
+
10
+ .Toastify__toast-theme--colored.Toastify__toast--success {
11
+ background-color: ${parseColor(theme.colors?.success100)};
12
+ color: ${parseColor(theme.colors?.textLight)};
13
+
14
+ .Toastify__progress-bar-theme--colored {
15
+ background: ${parseColor(theme.colors?.success50)};
16
+ opacity: 0.5;
17
+ }
18
+ }
19
+
20
+ .Toastify__toast-theme--colored.Toastify__toast--error {
21
+ background-color: ${parseColor(theme.colors?.danger200)};
22
+ color: ${parseColor(theme.colors?.textLight)};
23
+
24
+ .Toastify__progress-bar-theme--colored {
25
+ background: ${parseColor(theme.colors?.danger50)};
26
+ opacity: 0.5;
27
+ }
28
+ }
29
+
30
+ .Toastify__toast-theme--colored.Toastify__toast--warning {
31
+ background-color: ${parseColor(theme.colors?.warning100)};
32
+ color: ${parseColor(theme.colors?.textDark)};
33
+
34
+ .Toastify__progress-bar-theme--colored {
35
+ background: ${parseColor(theme.colors?.warning50)};
36
+ opacity: 0.5;
37
+ }
38
+ }
39
+
40
+ .Toastify__toast-theme--colored.Toastify__toast--info {
41
+ background-color: ${parseColor(theme.colors?.info100)};
42
+ color: ${parseColor(theme.colors?.textLight)};
43
+
44
+ .Toastify__progress-bar-theme--colored {
45
+ background: ${parseColor(theme.colors?.info50)};
46
+ opacity: 0.5;
47
+ }
48
+ }
49
+
50
+ /* Light Theme */
51
+
52
+ .Toastify__toast-theme--light.Toastify__toast--success {
53
+ color: ${parseColor(theme.colors?.textDark)};
54
+
55
+ .Toastify__toast-icon {
56
+ color: ${parseColor(theme.colors?.success100)};
57
+ }
58
+
59
+ .Toastify__progress-bar-theme--light {
60
+ background: ${parseColor(theme.colors?.success100)};
61
+ }
62
+ }
63
+
64
+ .Toastify__toast-theme--light.Toastify__toast--error {
65
+ color: ${parseColor(theme.colors?.textDark)};
66
+
67
+ .Toastify__toast-icon {
68
+ color: ${parseColor(theme.colors?.danger200)};
69
+ }
70
+ .Toastify__progress-bar-theme--light {
71
+ background: ${parseColor(theme.colors?.danger200)};
72
+ }
73
+ }
74
+
75
+ .Toastify__toast-theme--light.Toastify__toast--warning {
76
+ color: ${parseColor(theme.colors?.textDark)};
77
+
78
+ .Toastify__toast-icon {
79
+ color: ${parseColor(theme.colors?.warning100)};
80
+ }
81
+
82
+ .Toastify__progress-bar-theme--light {
83
+ background: ${parseColor(theme.colors?.warning100)};
84
+ }
85
+ }
86
+
87
+ .Toastify__toast-theme--light.Toastify__toast--info {
88
+ color: ${parseColor(theme.colors?.textDark)};
89
+
90
+ .Toastify__toast-icon {
91
+ color: ${parseColor(theme.colors?.info100)};
92
+ }
93
+
94
+ .Toastify__progress-bar-theme--light {
95
+ background: ${parseColor(theme.colors?.info100)};
96
+ }
97
+ }
98
+
99
+ `}
100
+ `
@@ -0,0 +1,26 @@
1
+ import { toast, ToastOptions } from "react-toastify"
2
+
3
+ const defaultOptions: ToastOptions = {
4
+ position: 'top-right',
5
+ hideProgressBar: false,
6
+ closeOnClick: true,
7
+ pauseOnHover: true,
8
+ draggable: true,
9
+ theme: 'light'
10
+ }
11
+
12
+ const Toaster = {
13
+ success: (message: string, options?: ToastOptions) =>
14
+ toast.success(message, { ...defaultOptions, ...options }),
15
+
16
+ error: (message: string, options?: ToastOptions) =>
17
+ toast.error(message, { ...defaultOptions, ...options }),
18
+
19
+ warning: (message: string, options?: ToastOptions) =>
20
+ toast.warning(message, { ...defaultOptions, ...options }),
21
+
22
+ info: (message: string, options?: ToastOptions) =>
23
+ toast.info(message, { ...defaultOptions, ...options })
24
+ }
25
+
26
+ export default Toaster;
@@ -0,0 +1,10 @@
1
+ import 'react-toastify/dist/ReactToastify.css'
2
+ import { ToasterStyledContainer } from './Toaster.style'
3
+
4
+ const ToastProvider = () => {
5
+ return(
6
+ <ToasterStyledContainer newestOnTop />
7
+ )
8
+ }
9
+
10
+ export default ToastProvider;
@@ -0,0 +1,2 @@
1
+ export { default as ToastProvider } from './ToasterProvider';
2
+ export { default as Toaster } from './Toaster';
@@ -12,3 +12,4 @@ export { default as Select } from './Select'
12
12
  export { default as SegmentedButton } from './SegmentedButton'
13
13
  export { default as LinkButton } from './LinkButton'
14
14
  export { default as RadioButton } from './RadioButton'
15
+ export { ToastProvider, Toaster } from './Toaster'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liguelead/design-system",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "main": "components/index.ts",
6
6
  "publishConfig": {