@beryl-ui/react 2.1.2 → 2.2.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.
package/README.md CHANGED
@@ -7,85 +7,86 @@
7
7
  <img alt="License" src="https://img.shields.io/github/license/Robson16/beryl-ui?color=10B981&label=license">
8
8
  </p>
9
9
 
10
- Biblioteca de componentes React profissionais do **beryl-ui**, construídos com `styled-components` e `Radix UI` para máxima performance e acessibilidade.
10
+ Professional React component library from **beryl-ui**, built with `styled-components` and `Radix UI` for maximum performance and accessibility.
11
11
 
12
- ## ✨ Componentes Incluídos
12
+ ## ✨ Included Components
13
13
 
14
- * **Avatar**: Imagem de exibição com fallback.
15
- * **Button**: Botão para ações diversas com variantes.
16
- * **Checkbox**: Caixa de seleção.
17
- * **Heading**: Título para seções.
18
- * **MultiStep**: Indicador de progresso para formulários de múltiplos passos.
19
- * **Text**: Componente para textos em geral.
20
- * **TextArea**: Campo de texto de múltiplas linhas.
21
- * **TextInput**: Campo de entrada de texto.
14
+ * **Avatar**: Display image with fallback.
15
+ * **Button**: Button for various actions with variants.
16
+ * **Checkbox**: Selection box.
17
+ * **Heading**: Title for sections.
18
+ * **MultiStep**: Progress indicator for multi-step forms.
19
+ * **Text**: Component for general text.
20
+ * **TextArea**: Multi-line text field.
21
+ * **TextInput**: Text input field.
22
+ * **Toast**: Feedback message for the user (requires `ToastProvider`).
22
23
 
23
- > Para uma documentação interativa e exemplos de uso de cada componente, visite nosso **Storybook de documentação**.
24
+ > For interactive documentation and usage examples for each component, visit our [**Storybook online**](https://robson16.github.io/beryl-ui/).
24
25
 
25
- ## 🚀 Instalação
26
+ ## 🚀 Installation
26
27
 
27
- Para usar os componentes React em seu projeto, instale o pacote via npm, yarn ou pnpm:
28
+ To use the React components in your project, install the package via npm, yarn, or pnpm:
28
29
 
29
30
  ```bash
30
31
  npm install @beryl-ui/react styled-components
31
- # ou
32
+ # or
32
33
  yarn add @beryl-ui/react styled-components
33
- # ou
34
+ # or
34
35
  pnpm add @beryl-ui/react styled-components
35
36
  ```
36
37
 
37
- ## ⚙️ Configuração
38
+ ## ⚙️ Configuration
38
39
 
39
- Para que os componentes funcionem corretamente com o tema padrão, você precisa envolver sua aplicação com o `ThemeProvider` do `styled-components` e aplicar os estilos globais.
40
+ For the components to work correctly with the default theme, you need to wrap your application with the `ThemeProvider` from `styled-components` and apply the global styles.
40
41
 
41
42
  ```tsx
42
- // Em seu arquivo principal (ex: App.tsx)
43
- import { globalStyles } from '@beryl-ui/react/styles' // Importe os estilos globais
43
+ // In your main file (e.g: App.tsx)
44
+ import { globalStyles } from '@beryl-ui/react/styles' // Import global styles
44
45
  import { ThemeProvider } from 'styled-components'
45
- import { defaultTheme } from '@beryl-ui/react/styles' // Importe o tema padrão
46
+ import { defaultTheme } from '@beryl-ui/react/styles' // Import the default theme
46
47
 
47
- globalStyles() // Aplique os estilos globais
48
+ globalStyles() // Apply global styles
48
49
 
49
50
  export function App() {
50
51
  return (
51
52
  <ThemeProvider theme={defaultTheme}>
52
- {/* ... seus componentes e rotas que usarão o design system ... */}
53
+ {/* ... your components and routes that will use the design system ... */}
53
54
  </ThemeProvider>
54
55
  )
55
56
  }
56
57
  ```
57
58
 
58
- ## 💡 Uso Básico
59
+ ## 💡 Basic Usage
59
60
 
60
- Exemplo de como usar um componente `Button`:
61
+ Example of how to use a `Button` component:
61
62
 
62
63
  ```tsx
63
64
  import { Button } from '@beryl-ui/react'
64
65
 
65
66
  function MyComponent() {
66
67
  return (
67
- <Button onClick={() => alert('Clicado!')}>
68
- Clique aqui
68
+ <Button onClick={() => alert('Clicked!')}>
69
+ Click here
69
70
  </Button>
70
71
  )
71
72
  }
72
73
  ```
73
74
 
74
- ## 🛠️ Desenvolvimento Local (para contribuidores)
75
+ ## 🛠️ Local Development (for contributors)
75
76
 
76
- Se você está contribuindo para este pacote especificamente dentro do monorepo:
77
+ If you are contributing to this package specifically within the monorepo:
77
78
 
78
- 1. **Navegue até a pasta do pacote:**
79
+ 1. **Navigate to the package folder:**
79
80
  ```bash
80
81
  cd packages/react
81
82
  ```
82
- 2. **Execute o modo de desenvolvimento:**
83
- Para compilar o pacote em modo `watch` e ver as alterações em tempo real (geralmente usado em conjunto com o Storybook do monorepo):
83
+ 2. **Run development mode:**
84
+ To compile the package in `watch` mode and see changes in real-time (usually used in conjunction with the monorepo's Storybook):
84
85
  ```bash
85
86
  npm run dev
86
87
  ```
87
- (Este script `dev` é definido no `package.json` de `packages/react` e usa `tsup` para observar as mudanças).
88
+ (This `dev` script is defined in the `package.json` of `packages/react` and uses `tsup` to watch for changes).
88
89
 
89
- ## 📄 Licença
90
+ ## 📄 License
90
91
 
91
- Este pacote está sob a licença MIT. Veja o arquivo LICENSE.md na raiz do repositório para mais detalhes.
92
+ This package is under the MIT license. See the LICENSE.md file in the root of the repository for more details.
package/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ComponentProps, ElementType } from 'react';
3
+ import { ComponentProps, ElementType, ReactElement, ReactNode } from 'react';
4
4
  import * as styled_components_dist_types from 'styled-components/dist/types';
5
5
  import * as styled_components from 'styled-components';
6
6
  import * as Avatar$1 from '@radix-ui/react-avatar';
7
7
  import * as Checkbox$1 from '@radix-ui/react-checkbox';
8
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
8
9
 
9
10
  declare const AvatarImage: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<Omit<Avatar$1.AvatarImageProps & react.RefAttributes<HTMLImageElement>, "ref"> & {
10
11
  ref?: ((instance: HTMLImageElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLImageElement> | null | undefined;
@@ -27,19 +28,16 @@ declare namespace Box {
27
28
  var displayName: string;
28
29
  }
29
30
 
30
- interface ButtonProps$1 {
31
- variant?: 'primary' | 'secondary' | 'tertiary';
32
- size?: 'sm' | 'md';
31
+ interface ButtonContainerProps {
32
+ variant?: "primary" | "secondary" | "tertiary";
33
+ size?: "sm" | "md";
33
34
  }
34
- declare const ButtonContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonProps$1>> & string;
35
35
 
36
- interface ButtonProps extends ComponentProps<typeof ButtonContainer> {
36
+ interface ButtonProps extends ComponentProps<"button">, ButtonContainerProps {
37
37
  as?: ElementType;
38
+ children?: ReactElement;
38
39
  }
39
- declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
40
- declare namespace Button {
41
- var displayName: string;
42
- }
40
+ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
43
41
 
44
42
  declare const CheckboxContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<Omit<Checkbox$1.CheckboxProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
45
43
  ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
@@ -53,17 +51,14 @@ declare namespace Checkbox {
53
51
  }
54
52
 
55
53
  interface HeadingContainerProps {
56
- size?: 'sm' | 'md' | 'lg' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
54
+ size?: "sm" | "md" | "lg" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
57
55
  }
58
- declare const HeadingContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, HeadingContainerProps>> & string;
59
56
 
60
- interface HeadingProps extends ComponentProps<typeof HeadingContainer> {
57
+ interface HeadingProps extends ComponentProps<"h2">, HeadingContainerProps {
61
58
  as?: ElementType;
59
+ children?: ReactNode;
62
60
  }
63
- declare function Heading(props: HeadingProps): react_jsx_runtime.JSX.Element;
64
- declare namespace Heading {
65
- var displayName: string;
66
- }
61
+ declare const Heading: react.ForwardRefExoticComponent<Omit<HeadingProps, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
67
62
 
68
63
  interface MultiStepProps {
69
64
  size: number;
@@ -75,17 +70,14 @@ declare namespace MultiStep {
75
70
  }
76
71
 
77
72
  interface TextContainerProps {
78
- size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
73
+ size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
79
74
  }
80
- declare const TextContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, TextContainerProps>> & string;
81
75
 
82
- interface TextProps extends ComponentProps<typeof TextContainer> {
76
+ interface TextProps extends ComponentProps<"p">, TextContainerProps {
83
77
  as?: ElementType;
78
+ children?: ReactNode;
84
79
  }
85
- declare function Text(props: TextProps): react_jsx_runtime.JSX.Element;
86
- declare namespace Text {
87
- var displayName: string;
88
- }
80
+ declare const Text: react.ForwardRefExoticComponent<Omit<TextProps, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
89
81
 
90
82
  declare const TextAreaContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, never>> & string;
91
83
 
@@ -95,11 +87,37 @@ declare const TextArea: react.ForwardRefExoticComponent<Omit<TextAreaProps, "ref
95
87
 
96
88
  declare const Input: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
97
89
 
98
- interface TextInputProps extends Omit<ComponentProps<typeof Input>, 'prefix'> {
90
+ interface TextInputProps extends Omit<ComponentProps<typeof Input>, "prefix"> {
99
91
  prefix?: string;
100
92
  }
101
93
  declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
102
94
 
95
+ interface ToastData {
96
+ id: string;
97
+ title: string;
98
+ description?: string;
99
+ }
100
+ type ToastProps = Omit<ToastData, "id">;
101
+ interface ToastContextData {
102
+ showToast: (props: ToastProps) => void;
103
+ }
104
+ interface ToastProviderProps {
105
+ children: ReactNode;
106
+ }
107
+ declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
108
+ declare const useToast: () => ToastContextData;
109
+
110
+ interface TooltipProps extends Omit<ComponentProps<typeof RadixTooltip.Root>, "children"> {
111
+ children: ReactNode;
112
+ content: string | ReactNode;
113
+ contentProps?: Omit<ComponentProps<typeof RadixTooltip.Content>, "ref">;
114
+ }
115
+ declare function Tooltip({ children, content, contentProps, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
116
+ declare namespace Tooltip {
117
+ var displayName: string;
118
+ }
119
+ declare const TooltipProvider: react.FC<RadixTooltip.TooltipProviderProps>;
120
+
103
121
  declare const theme: {
104
122
  colors: {
105
123
  white: string;
@@ -130,23 +148,23 @@ declare const theme: {
130
148
  md: string;
131
149
  lg: string;
132
150
  xl: string;
133
- '2xl': string;
134
- '4xl': string;
135
- '5xl': string;
136
- '6xl': string;
137
- '7xl': string;
138
- '8xl': string;
139
- '9xl': string;
151
+ "2xl": string;
152
+ "4xl": string;
153
+ "5xl": string;
154
+ "6xl": string;
155
+ "7xl": string;
156
+ "8xl": string;
157
+ "9xl": string;
140
158
  };
141
159
  fontWeights: {
142
160
  thin: string;
143
- 'extra-light': string;
161
+ "extra-light": string;
144
162
  light: string;
145
163
  regular: string;
146
164
  medium: string;
147
- 'semi-bold': string;
165
+ "semi-bold": string;
148
166
  bold: string;
149
- 'extra-bold': string;
167
+ "extra-bold": string;
150
168
  black: string;
151
169
  };
152
170
  fonts: {
@@ -186,4 +204,4 @@ declare const theme: {
186
204
  };
187
205
  };
188
206
 
189
- export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Heading, type HeadingProps, MultiStep, type MultiStepProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, theme };
207
+ export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Heading, type HeadingProps, MultiStep, type MultiStepProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, type ToastProps, ToastProvider, Tooltip, type TooltipProps, TooltipProvider, theme, useToast };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ComponentProps, ElementType } from 'react';
3
+ import { ComponentProps, ElementType, ReactElement, ReactNode } from 'react';
4
4
  import * as styled_components_dist_types from 'styled-components/dist/types';
5
5
  import * as styled_components from 'styled-components';
6
6
  import * as Avatar$1 from '@radix-ui/react-avatar';
7
7
  import * as Checkbox$1 from '@radix-ui/react-checkbox';
8
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
8
9
 
9
10
  declare const AvatarImage: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<Omit<Avatar$1.AvatarImageProps & react.RefAttributes<HTMLImageElement>, "ref"> & {
10
11
  ref?: ((instance: HTMLImageElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLImageElement> | null | undefined;
@@ -27,19 +28,16 @@ declare namespace Box {
27
28
  var displayName: string;
28
29
  }
29
30
 
30
- interface ButtonProps$1 {
31
- variant?: 'primary' | 'secondary' | 'tertiary';
32
- size?: 'sm' | 'md';
31
+ interface ButtonContainerProps {
32
+ variant?: "primary" | "secondary" | "tertiary";
33
+ size?: "sm" | "md";
33
34
  }
34
- declare const ButtonContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonProps$1>> & string;
35
35
 
36
- interface ButtonProps extends ComponentProps<typeof ButtonContainer> {
36
+ interface ButtonProps extends ComponentProps<"button">, ButtonContainerProps {
37
37
  as?: ElementType;
38
+ children?: ReactElement;
38
39
  }
39
- declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
40
- declare namespace Button {
41
- var displayName: string;
42
- }
40
+ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
43
41
 
44
42
  declare const CheckboxContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<Omit<Checkbox$1.CheckboxProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
45
43
  ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
@@ -53,17 +51,14 @@ declare namespace Checkbox {
53
51
  }
54
52
 
55
53
  interface HeadingContainerProps {
56
- size?: 'sm' | 'md' | 'lg' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
54
+ size?: "sm" | "md" | "lg" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
57
55
  }
58
- declare const HeadingContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, HeadingContainerProps>> & string;
59
56
 
60
- interface HeadingProps extends ComponentProps<typeof HeadingContainer> {
57
+ interface HeadingProps extends ComponentProps<"h2">, HeadingContainerProps {
61
58
  as?: ElementType;
59
+ children?: ReactNode;
62
60
  }
63
- declare function Heading(props: HeadingProps): react_jsx_runtime.JSX.Element;
64
- declare namespace Heading {
65
- var displayName: string;
66
- }
61
+ declare const Heading: react.ForwardRefExoticComponent<Omit<HeadingProps, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
67
62
 
68
63
  interface MultiStepProps {
69
64
  size: number;
@@ -75,17 +70,14 @@ declare namespace MultiStep {
75
70
  }
76
71
 
77
72
  interface TextContainerProps {
78
- size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
73
+ size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
79
74
  }
80
- declare const TextContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, TextContainerProps>> & string;
81
75
 
82
- interface TextProps extends ComponentProps<typeof TextContainer> {
76
+ interface TextProps extends ComponentProps<"p">, TextContainerProps {
83
77
  as?: ElementType;
78
+ children?: ReactNode;
84
79
  }
85
- declare function Text(props: TextProps): react_jsx_runtime.JSX.Element;
86
- declare namespace Text {
87
- var displayName: string;
88
- }
80
+ declare const Text: react.ForwardRefExoticComponent<Omit<TextProps, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
89
81
 
90
82
  declare const TextAreaContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, never>> & string;
91
83
 
@@ -95,11 +87,37 @@ declare const TextArea: react.ForwardRefExoticComponent<Omit<TextAreaProps, "ref
95
87
 
96
88
  declare const Input: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
97
89
 
98
- interface TextInputProps extends Omit<ComponentProps<typeof Input>, 'prefix'> {
90
+ interface TextInputProps extends Omit<ComponentProps<typeof Input>, "prefix"> {
99
91
  prefix?: string;
100
92
  }
101
93
  declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
102
94
 
95
+ interface ToastData {
96
+ id: string;
97
+ title: string;
98
+ description?: string;
99
+ }
100
+ type ToastProps = Omit<ToastData, "id">;
101
+ interface ToastContextData {
102
+ showToast: (props: ToastProps) => void;
103
+ }
104
+ interface ToastProviderProps {
105
+ children: ReactNode;
106
+ }
107
+ declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
108
+ declare const useToast: () => ToastContextData;
109
+
110
+ interface TooltipProps extends Omit<ComponentProps<typeof RadixTooltip.Root>, "children"> {
111
+ children: ReactNode;
112
+ content: string | ReactNode;
113
+ contentProps?: Omit<ComponentProps<typeof RadixTooltip.Content>, "ref">;
114
+ }
115
+ declare function Tooltip({ children, content, contentProps, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
116
+ declare namespace Tooltip {
117
+ var displayName: string;
118
+ }
119
+ declare const TooltipProvider: react.FC<RadixTooltip.TooltipProviderProps>;
120
+
103
121
  declare const theme: {
104
122
  colors: {
105
123
  white: string;
@@ -130,23 +148,23 @@ declare const theme: {
130
148
  md: string;
131
149
  lg: string;
132
150
  xl: string;
133
- '2xl': string;
134
- '4xl': string;
135
- '5xl': string;
136
- '6xl': string;
137
- '7xl': string;
138
- '8xl': string;
139
- '9xl': string;
151
+ "2xl": string;
152
+ "4xl": string;
153
+ "5xl": string;
154
+ "6xl": string;
155
+ "7xl": string;
156
+ "8xl": string;
157
+ "9xl": string;
140
158
  };
141
159
  fontWeights: {
142
160
  thin: string;
143
- 'extra-light': string;
161
+ "extra-light": string;
144
162
  light: string;
145
163
  regular: string;
146
164
  medium: string;
147
- 'semi-bold': string;
165
+ "semi-bold": string;
148
166
  bold: string;
149
- 'extra-bold': string;
167
+ "extra-bold": string;
150
168
  black: string;
151
169
  };
152
170
  fonts: {
@@ -186,4 +204,4 @@ declare const theme: {
186
204
  };
187
205
  };
188
206
 
189
- export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Heading, type HeadingProps, MultiStep, type MultiStepProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, theme };
207
+ export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Heading, type HeadingProps, MultiStep, type MultiStepProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, type ToastProps, ToastProvider, Tooltip, type TooltipProps, TooltipProvider, theme, useToast };
package/dist/index.js CHANGED
@@ -68,7 +68,11 @@ __export(index_exports, {
68
68
  Text: () => Text,
69
69
  TextArea: () => TextArea,
70
70
  TextInput: () => TextInput,
71
- theme: () => theme
71
+ ToastProvider: () => ToastProvider,
72
+ Tooltip: () => Tooltip2,
73
+ TooltipProvider: () => TooltipProvider,
74
+ theme: () => theme,
75
+ useToast: () => useToast
72
76
  });
73
77
  module.exports = __toCommonJS(index_exports);
74
78
 
@@ -132,6 +136,9 @@ function Box(props) {
132
136
  }
133
137
  Box.displayName = "Box";
134
138
 
139
+ // src/components/Button/index.tsx
140
+ var import_react = require("react");
141
+
135
142
  // src/components/Button/styles.ts
136
143
  var import_styled_components3 = require("styled-components");
137
144
  var ButtonContainer = import_styled_components3.styled.button`
@@ -227,9 +234,11 @@ var ButtonContainer = import_styled_components3.styled.button`
227
234
 
228
235
  // src/components/Button/index.tsx
229
236
  var import_jsx_runtime3 = require("react/jsx-runtime");
230
- function Button(props) {
231
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonContainer, __spreadValues({}, props));
232
- }
237
+ var Button = (0, import_react.forwardRef)(
238
+ (props, ref) => {
239
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonContainer, __spreadValues({ ref }, props));
240
+ }
241
+ );
233
242
  Button.displayName = "Button";
234
243
 
235
244
  // src/components/Checkbox/index.tsx
@@ -254,11 +263,11 @@ var CheckboxContainer = (0, import_styled_components4.styled)(Checkbox.Root)`
254
263
  border: 2px solid ${({ theme: theme2 }) => theme2.colors.gray900};
255
264
 
256
265
  &:focus,
257
- &[data-state='checked'] {
266
+ &[data-state="checked"] {
258
267
  border: 2px solid ${({ theme: theme2 }) => theme2.colors.emerald300};
259
268
  }
260
269
 
261
- &[data-state='checked'] {
270
+ &[data-state="checked"] {
262
271
  background-color: ${({ theme: theme2 }) => theme2.colors.emerald300};
263
272
  }
264
273
  `;
@@ -275,11 +284,11 @@ var CheckboxIndicator = (0, import_styled_components4.styled)(Checkbox.Indicator
275
284
  width: ${({ theme: theme2 }) => theme2.space[4]};
276
285
  height: ${({ theme: theme2 }) => theme2.space[4]};
277
286
 
278
- &[data-state='checked'] {
287
+ &[data-state="checked"] {
279
288
  animation: ${slideIn} 200ms ease-out;
280
289
  }
281
290
 
282
- &[data-state='unchecked'] {
291
+ &[data-state="unchecked"] {
283
292
  animation: ${slideOut} 200ms ease-out;
284
293
  }
285
294
  `;
@@ -291,6 +300,9 @@ function Checkbox2(props) {
291
300
  }
292
301
  Checkbox2.displayName = "Checkbox";
293
302
 
303
+ // src/components/Heading/index.tsx
304
+ var import_react2 = require("react");
305
+
294
306
  // src/components/Heading/styles.ts
295
307
  var import_styled_components5 = require("styled-components");
296
308
  var sizeVariants = {
@@ -330,14 +342,19 @@ var HeadingContainer = import_styled_components5.styled.h2`
330
342
 
331
343
  // src/components/Heading/index.tsx
332
344
  var import_jsx_runtime5 = require("react/jsx-runtime");
333
- function Heading(props) {
334
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HeadingContainer, __spreadValues({}, props));
335
- }
345
+ var Heading = (0, import_react2.forwardRef)(
346
+ (props, ref) => {
347
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HeadingContainer, __spreadValues({ ref }, props));
348
+ }
349
+ );
336
350
  Heading.displayName = "Heading";
337
351
 
338
352
  // src/components/MultiStep/styles.ts
339
353
  var import_styled_components7 = require("styled-components");
340
354
 
355
+ // src/components/Text/index.tsx
356
+ var import_react3 = require("react");
357
+
341
358
  // src/components/Text/styles.ts
342
359
  var import_styled_components6 = require("styled-components");
343
360
  var TextContainer = import_styled_components6.styled.p`
@@ -351,9 +368,11 @@ var TextContainer = import_styled_components6.styled.p`
351
368
 
352
369
  // src/components/Text/index.tsx
353
370
  var import_jsx_runtime6 = require("react/jsx-runtime");
354
- function Text(props) {
355
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TextContainer, __spreadValues({}, props));
356
- }
371
+ var Text = (0, import_react3.forwardRef)(
372
+ (props, ref) => {
373
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TextContainer, __spreadValues({ ref }, props));
374
+ }
375
+ );
357
376
  Text.displayName = "Text";
358
377
 
359
378
  // src/components/MultiStep/styles.ts
@@ -395,7 +414,7 @@ function MultiStep({ size, currentStep = 1 }) {
395
414
  MultiStep.displayName = "MultiStep";
396
415
 
397
416
  // src/components/TextArea/index.tsx
398
- var import_react = require("react");
417
+ var import_react4 = require("react");
399
418
 
400
419
  // src/components/TextArea/styles.ts
401
420
  var import_styled_components8 = require("styled-components");
@@ -429,13 +448,13 @@ var TextAreaContainer = import_styled_components8.styled.textarea`
429
448
 
430
449
  // src/components/TextArea/index.tsx
431
450
  var import_jsx_runtime8 = require("react/jsx-runtime");
432
- var TextArea = (0, import_react.forwardRef)((props, ref) => {
451
+ var TextArea = (0, import_react4.forwardRef)((props, ref) => {
433
452
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TextAreaContainer, __spreadValues({ ref }, props));
434
453
  });
435
454
  TextArea.displayName = "TextArea";
436
455
 
437
456
  // src/components/TextInput/index.tsx
438
- var import_react2 = require("react");
457
+ var import_react5 = require("react");
439
458
 
440
459
  // src/components/TextInput/styles.ts
441
460
  var import_styled_components9 = require("styled-components");
@@ -494,7 +513,7 @@ var Input = import_styled_components9.styled.input`
494
513
 
495
514
  // src/components/TextInput/index.tsx
496
515
  var import_jsx_runtime9 = require("react/jsx-runtime");
497
- var TextInput = (0, import_react2.forwardRef)(
516
+ var TextInput = (0, import_react5.forwardRef)(
498
517
  (_a, ref) => {
499
518
  var _b = _a, { prefix } = _b, props = __objRest(_b, ["prefix"]);
500
519
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(TextInputContainer, { children: [
@@ -505,6 +524,187 @@ var TextInput = (0, import_react2.forwardRef)(
505
524
  );
506
525
  TextInput.displayName = "TextInput";
507
526
 
527
+ // src/components/Toast/index.tsx
528
+ var RadixToast = __toESM(require("@radix-ui/react-toast"));
529
+ var import_phosphor_react3 = require("phosphor-react");
530
+ var import_react6 = require("react");
531
+
532
+ // src/components/Toast/styles.ts
533
+ var Toast = __toESM(require("@radix-ui/react-toast"));
534
+ var import_styled_components10 = require("styled-components");
535
+ var VIEWPORT_PADDING = 32;
536
+ var hide = import_styled_components10.keyframes`
537
+ from { opacity: 1; }
538
+ to { opacity: 0; }
539
+ `;
540
+ var slideIn2 = import_styled_components10.keyframes`
541
+ from { transform: translateX(calc(100% + ${VIEWPORT_PADDING}px)); }
542
+ to { transform: translateX(0); }
543
+ `;
544
+ var swipeOut = import_styled_components10.keyframes`
545
+ from { transform: translateX(var(--radix-toast-swipe-end-x)); }
546
+ to { transform: translateX(calc(100% + ${VIEWPORT_PADDING}px)); }
547
+ `;
548
+ var ToastViewport = (0, import_styled_components10.styled)(Toast.Viewport)`
549
+ position: fixed;
550
+ bottom: 0;
551
+ right: 0;
552
+ display: flex;
553
+ flex-direction: column;
554
+ padding: ${VIEWPORT_PADDING}px;
555
+ gap: 10px;
556
+ width: 390px;
557
+ max-width: 100vw;
558
+ margin: 0;
559
+ list-style: none;
560
+ z-index: 999999;
561
+ outline: none;
562
+ `;
563
+ var ToastRoot = (0, import_styled_components10.styled)(Toast.Root)`
564
+ display: grid;
565
+ grid-template-areas: "title action" "description action";
566
+ grid-template-columns: auto max-content;
567
+ column-gap: ${({ theme: theme2 }) => theme2.space[5]};
568
+ padding: ${({ theme: theme2 }) => `${theme2.space[3]} ${theme2.space[5]}`};
569
+ border: 1px solid ${({ theme: theme2 }) => theme2.colors.gray600};
570
+ border-radius: ${({ theme: theme2 }) => theme2.radii.sm};
571
+ background-color: ${({ theme: theme2 }) => theme2.colors.gray800};
572
+
573
+ &[data-state="open"] {
574
+ animation: ${slideIn2} 150ms cubic-bezier(0.16, 1, 0.3, 1);
575
+ }
576
+
577
+ &[data-state="closed"] {
578
+ animation: ${hide} 100ms ease-in;
579
+ }
580
+
581
+ &[data-swipe="move"] {
582
+ transform: translateX(var(--radix-toast-swipe-move-x));
583
+ }
584
+
585
+ &[data-swipe="cancel"] {
586
+ transform: translateX(0);
587
+ transition: transform 200ms ease-out;
588
+ }
589
+
590
+ &[data-swipe="end"] {
591
+ animation: ${swipeOut} 100ms ease-out;
592
+ }
593
+ `;
594
+ var ToastTitle = (0, import_styled_components10.styled)(Toast.Title)`
595
+ grid-area: title;
596
+ font-family: ${({ theme: theme2 }) => theme2.fonts.default};
597
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes.xl};
598
+ font-weight: ${({ theme: theme2 }) => theme2.fontWeights.bold};
599
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights.base};
600
+ color: ${({ theme: theme2 }) => theme2.colors.white};
601
+ `;
602
+ var ToastDescription = (0, import_styled_components10.styled)(Toast.Description)`
603
+ grid-area: description;
604
+ margin-top: ${({ theme: theme2 }) => theme2.space[1]};
605
+ font-family: ${({ theme: theme2 }) => theme2.fonts.default};
606
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes.sm};
607
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights.base};
608
+ color: ${({ theme: theme2 }) => theme2.colors.gray200};
609
+ `;
610
+ var ToastClose = (0, import_styled_components10.styled)(Toast.Close)`
611
+ grid-area: action;
612
+ all: unset;
613
+ width: ${({ theme: theme2 }) => theme2.space[5]};
614
+ height: ${({ theme: theme2 }) => theme2.space[5]};
615
+ color: ${({ theme: theme2 }) => theme2.colors.gray200};
616
+ cursor: pointer;
617
+ `;
618
+
619
+ // src/components/Toast/index.tsx
620
+ var import_jsx_runtime10 = require("react/jsx-runtime");
621
+ var ToastContext = (0, import_react6.createContext)({});
622
+ function ToastProvider({ children }) {
623
+ const [toasts, setToasts] = (0, import_react6.useState)([]);
624
+ function showToast({ title, description }) {
625
+ const newToast = {
626
+ id: (/* @__PURE__ */ new Date()).getTime().toString(),
627
+ title,
628
+ description
629
+ };
630
+ setToasts((prev) => [...prev, newToast]);
631
+ }
632
+ function handleOpenChange(open, toastId) {
633
+ if (!open) {
634
+ setToasts((prev) => prev.filter((toast) => toast.id !== toastId));
635
+ }
636
+ }
637
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastContext.Provider, { value: { showToast }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(RadixToast.Provider, { swipeDirection: "right", children: [
638
+ children,
639
+ toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
640
+ ToastRoot,
641
+ {
642
+ onOpenChange: (open) => handleOpenChange(open, toast.id),
643
+ children: [
644
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
645
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastTitle, { children: toast.title }),
646
+ toast.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastDescription, { children: toast.description })
647
+ ] }),
648
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react3.X, { weight: "light", size: 20 }) })
649
+ ]
650
+ },
651
+ toast.id
652
+ )),
653
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastViewport, {})
654
+ ] }) });
655
+ }
656
+ var useToast = () => {
657
+ const context = (0, import_react6.useContext)(ToastContext);
658
+ if (!context) {
659
+ throw new Error("useToast must be used within a ToastProvider");
660
+ }
661
+ return context;
662
+ };
663
+
664
+ // src/components/Tooltip/index.tsx
665
+ var RadixTooltip = __toESM(require("@radix-ui/react-tooltip"));
666
+
667
+ // src/components/Tooltip/styles.ts
668
+ var Tooltip = __toESM(require("@radix-ui/react-tooltip"));
669
+ var import_styled_components11 = require("styled-components");
670
+ var TooltipContent = (0, import_styled_components11.styled)(Tooltip.Content)`
671
+ padding: ${({ theme: theme2 }) => `${theme2.space[3]} ${theme2.space[4]}`};
672
+ background: ${({ theme: theme2 }) => theme2.colors.gray900};
673
+ color: ${({ theme: theme2 }) => theme2.colors.gray100};
674
+ font-family: ${({ theme: theme2 }) => theme2.fonts.default};
675
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes.sm};
676
+ font-weight: ${({ theme: theme2 }) => theme2.fontWeights.medium};
677
+ border-radius: ${({ theme: theme2 }) => theme2.radii.sm};
678
+ user-select: none;
679
+ box-shadow: 4px 16px 24px rgba(0, 0, 0, 0.25);
680
+ `;
681
+ var TooltipArrow = (0, import_styled_components11.styled)(Tooltip.Arrow)`
682
+ fill: ${({ theme: theme2 }) => theme2.colors.gray900};
683
+ `;
684
+
685
+ // src/components/Tooltip/index.tsx
686
+ var import_jsx_runtime11 = require("react/jsx-runtime");
687
+ function Tooltip2(_a) {
688
+ var _b = _a, {
689
+ children,
690
+ content,
691
+ contentProps
692
+ } = _b, props = __objRest(_b, [
693
+ "children",
694
+ "content",
695
+ "contentProps"
696
+ ]);
697
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(RadixTooltip.Root, __spreadProps(__spreadValues({}, props), { children: [
698
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixTooltip.Trigger, { asChild: true, children }),
699
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixTooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(TooltipContent, __spreadProps(__spreadValues({ sideOffset: 5 }, contentProps), { children: [
700
+ content,
701
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipArrow, {})
702
+ ] })) })
703
+ ] }));
704
+ }
705
+ var TooltipProvider = RadixTooltip.Provider;
706
+ Tooltip2.displayName = "Tooltip";
707
+
508
708
  // src/styles/theme.ts
509
709
  var import_tokens = require("@beryl-ui/tokens");
510
710
  var theme = {
@@ -527,5 +727,9 @@ var theme = {
527
727
  Text,
528
728
  TextArea,
529
729
  TextInput,
530
- theme
730
+ ToastProvider,
731
+ Tooltip,
732
+ TooltipProvider,
733
+ theme,
734
+ useToast
531
735
  });
package/dist/index.mjs CHANGED
@@ -90,6 +90,9 @@ function Box(props) {
90
90
  }
91
91
  Box.displayName = "Box";
92
92
 
93
+ // src/components/Button/index.tsx
94
+ import { forwardRef } from "react";
95
+
93
96
  // src/components/Button/styles.ts
94
97
  import { css, styled as styled3 } from "styled-components";
95
98
  var ButtonContainer = styled3.button`
@@ -185,9 +188,11 @@ var ButtonContainer = styled3.button`
185
188
 
186
189
  // src/components/Button/index.tsx
187
190
  import { jsx as jsx3 } from "react/jsx-runtime";
188
- function Button(props) {
189
- return /* @__PURE__ */ jsx3(ButtonContainer, __spreadValues({}, props));
190
- }
191
+ var Button = forwardRef(
192
+ (props, ref) => {
193
+ return /* @__PURE__ */ jsx3(ButtonContainer, __spreadValues({ ref }, props));
194
+ }
195
+ );
191
196
  Button.displayName = "Button";
192
197
 
193
198
  // src/components/Checkbox/index.tsx
@@ -212,11 +217,11 @@ var CheckboxContainer = styled4(Checkbox.Root)`
212
217
  border: 2px solid ${({ theme: theme2 }) => theme2.colors.gray900};
213
218
 
214
219
  &:focus,
215
- &[data-state='checked'] {
220
+ &[data-state="checked"] {
216
221
  border: 2px solid ${({ theme: theme2 }) => theme2.colors.emerald300};
217
222
  }
218
223
 
219
- &[data-state='checked'] {
224
+ &[data-state="checked"] {
220
225
  background-color: ${({ theme: theme2 }) => theme2.colors.emerald300};
221
226
  }
222
227
  `;
@@ -233,11 +238,11 @@ var CheckboxIndicator = styled4(Checkbox.Indicator)`
233
238
  width: ${({ theme: theme2 }) => theme2.space[4]};
234
239
  height: ${({ theme: theme2 }) => theme2.space[4]};
235
240
 
236
- &[data-state='checked'] {
241
+ &[data-state="checked"] {
237
242
  animation: ${slideIn} 200ms ease-out;
238
243
  }
239
244
 
240
- &[data-state='unchecked'] {
245
+ &[data-state="unchecked"] {
241
246
  animation: ${slideOut} 200ms ease-out;
242
247
  }
243
248
  `;
@@ -249,6 +254,9 @@ function Checkbox2(props) {
249
254
  }
250
255
  Checkbox2.displayName = "Checkbox";
251
256
 
257
+ // src/components/Heading/index.tsx
258
+ import { forwardRef as forwardRef2 } from "react";
259
+
252
260
  // src/components/Heading/styles.ts
253
261
  import { css as css2, styled as styled5 } from "styled-components";
254
262
  var sizeVariants = {
@@ -288,14 +296,19 @@ var HeadingContainer = styled5.h2`
288
296
 
289
297
  // src/components/Heading/index.tsx
290
298
  import { jsx as jsx5 } from "react/jsx-runtime";
291
- function Heading(props) {
292
- return /* @__PURE__ */ jsx5(HeadingContainer, __spreadValues({}, props));
293
- }
299
+ var Heading = forwardRef2(
300
+ (props, ref) => {
301
+ return /* @__PURE__ */ jsx5(HeadingContainer, __spreadValues({ ref }, props));
302
+ }
303
+ );
294
304
  Heading.displayName = "Heading";
295
305
 
296
306
  // src/components/MultiStep/styles.ts
297
307
  import { styled as styled7 } from "styled-components";
298
308
 
309
+ // src/components/Text/index.tsx
310
+ import { forwardRef as forwardRef3 } from "react";
311
+
299
312
  // src/components/Text/styles.ts
300
313
  import { styled as styled6 } from "styled-components";
301
314
  var TextContainer = styled6.p`
@@ -309,9 +322,11 @@ var TextContainer = styled6.p`
309
322
 
310
323
  // src/components/Text/index.tsx
311
324
  import { jsx as jsx6 } from "react/jsx-runtime";
312
- function Text(props) {
313
- return /* @__PURE__ */ jsx6(TextContainer, __spreadValues({}, props));
314
- }
325
+ var Text = forwardRef3(
326
+ (props, ref) => {
327
+ return /* @__PURE__ */ jsx6(TextContainer, __spreadValues({ ref }, props));
328
+ }
329
+ );
315
330
  Text.displayName = "Text";
316
331
 
317
332
  // src/components/MultiStep/styles.ts
@@ -353,7 +368,7 @@ function MultiStep({ size, currentStep = 1 }) {
353
368
  MultiStep.displayName = "MultiStep";
354
369
 
355
370
  // src/components/TextArea/index.tsx
356
- import { forwardRef } from "react";
371
+ import { forwardRef as forwardRef4 } from "react";
357
372
 
358
373
  // src/components/TextArea/styles.ts
359
374
  import { styled as styled8 } from "styled-components";
@@ -387,13 +402,13 @@ var TextAreaContainer = styled8.textarea`
387
402
 
388
403
  // src/components/TextArea/index.tsx
389
404
  import { jsx as jsx8 } from "react/jsx-runtime";
390
- var TextArea = forwardRef((props, ref) => {
405
+ var TextArea = forwardRef4((props, ref) => {
391
406
  return /* @__PURE__ */ jsx8(TextAreaContainer, __spreadValues({ ref }, props));
392
407
  });
393
408
  TextArea.displayName = "TextArea";
394
409
 
395
410
  // src/components/TextInput/index.tsx
396
- import { forwardRef as forwardRef2 } from "react";
411
+ import { forwardRef as forwardRef5 } from "react";
397
412
 
398
413
  // src/components/TextInput/styles.ts
399
414
  import { styled as styled9 } from "styled-components";
@@ -452,7 +467,7 @@ var Input = styled9.input`
452
467
 
453
468
  // src/components/TextInput/index.tsx
454
469
  import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
455
- var TextInput = forwardRef2(
470
+ var TextInput = forwardRef5(
456
471
  (_a, ref) => {
457
472
  var _b = _a, { prefix } = _b, props = __objRest(_b, ["prefix"]);
458
473
  return /* @__PURE__ */ jsxs3(TextInputContainer, { children: [
@@ -463,6 +478,187 @@ var TextInput = forwardRef2(
463
478
  );
464
479
  TextInput.displayName = "TextInput";
465
480
 
481
+ // src/components/Toast/index.tsx
482
+ import * as RadixToast from "@radix-ui/react-toast";
483
+ import { X } from "phosphor-react";
484
+ import { createContext, useContext, useState } from "react";
485
+
486
+ // src/components/Toast/styles.ts
487
+ import * as Toast from "@radix-ui/react-toast";
488
+ import { keyframes as keyframes2, styled as styled10 } from "styled-components";
489
+ var VIEWPORT_PADDING = 32;
490
+ var hide = keyframes2`
491
+ from { opacity: 1; }
492
+ to { opacity: 0; }
493
+ `;
494
+ var slideIn2 = keyframes2`
495
+ from { transform: translateX(calc(100% + ${VIEWPORT_PADDING}px)); }
496
+ to { transform: translateX(0); }
497
+ `;
498
+ var swipeOut = keyframes2`
499
+ from { transform: translateX(var(--radix-toast-swipe-end-x)); }
500
+ to { transform: translateX(calc(100% + ${VIEWPORT_PADDING}px)); }
501
+ `;
502
+ var ToastViewport = styled10(Toast.Viewport)`
503
+ position: fixed;
504
+ bottom: 0;
505
+ right: 0;
506
+ display: flex;
507
+ flex-direction: column;
508
+ padding: ${VIEWPORT_PADDING}px;
509
+ gap: 10px;
510
+ width: 390px;
511
+ max-width: 100vw;
512
+ margin: 0;
513
+ list-style: none;
514
+ z-index: 999999;
515
+ outline: none;
516
+ `;
517
+ var ToastRoot = styled10(Toast.Root)`
518
+ display: grid;
519
+ grid-template-areas: "title action" "description action";
520
+ grid-template-columns: auto max-content;
521
+ column-gap: ${({ theme: theme2 }) => theme2.space[5]};
522
+ padding: ${({ theme: theme2 }) => `${theme2.space[3]} ${theme2.space[5]}`};
523
+ border: 1px solid ${({ theme: theme2 }) => theme2.colors.gray600};
524
+ border-radius: ${({ theme: theme2 }) => theme2.radii.sm};
525
+ background-color: ${({ theme: theme2 }) => theme2.colors.gray800};
526
+
527
+ &[data-state="open"] {
528
+ animation: ${slideIn2} 150ms cubic-bezier(0.16, 1, 0.3, 1);
529
+ }
530
+
531
+ &[data-state="closed"] {
532
+ animation: ${hide} 100ms ease-in;
533
+ }
534
+
535
+ &[data-swipe="move"] {
536
+ transform: translateX(var(--radix-toast-swipe-move-x));
537
+ }
538
+
539
+ &[data-swipe="cancel"] {
540
+ transform: translateX(0);
541
+ transition: transform 200ms ease-out;
542
+ }
543
+
544
+ &[data-swipe="end"] {
545
+ animation: ${swipeOut} 100ms ease-out;
546
+ }
547
+ `;
548
+ var ToastTitle = styled10(Toast.Title)`
549
+ grid-area: title;
550
+ font-family: ${({ theme: theme2 }) => theme2.fonts.default};
551
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes.xl};
552
+ font-weight: ${({ theme: theme2 }) => theme2.fontWeights.bold};
553
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights.base};
554
+ color: ${({ theme: theme2 }) => theme2.colors.white};
555
+ `;
556
+ var ToastDescription = styled10(Toast.Description)`
557
+ grid-area: description;
558
+ margin-top: ${({ theme: theme2 }) => theme2.space[1]};
559
+ font-family: ${({ theme: theme2 }) => theme2.fonts.default};
560
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes.sm};
561
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights.base};
562
+ color: ${({ theme: theme2 }) => theme2.colors.gray200};
563
+ `;
564
+ var ToastClose = styled10(Toast.Close)`
565
+ grid-area: action;
566
+ all: unset;
567
+ width: ${({ theme: theme2 }) => theme2.space[5]};
568
+ height: ${({ theme: theme2 }) => theme2.space[5]};
569
+ color: ${({ theme: theme2 }) => theme2.colors.gray200};
570
+ cursor: pointer;
571
+ `;
572
+
573
+ // src/components/Toast/index.tsx
574
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
575
+ var ToastContext = createContext({});
576
+ function ToastProvider({ children }) {
577
+ const [toasts, setToasts] = useState([]);
578
+ function showToast({ title, description }) {
579
+ const newToast = {
580
+ id: (/* @__PURE__ */ new Date()).getTime().toString(),
581
+ title,
582
+ description
583
+ };
584
+ setToasts((prev) => [...prev, newToast]);
585
+ }
586
+ function handleOpenChange(open, toastId) {
587
+ if (!open) {
588
+ setToasts((prev) => prev.filter((toast) => toast.id !== toastId));
589
+ }
590
+ }
591
+ return /* @__PURE__ */ jsx10(ToastContext.Provider, { value: { showToast }, children: /* @__PURE__ */ jsxs4(RadixToast.Provider, { swipeDirection: "right", children: [
592
+ children,
593
+ toasts.map((toast) => /* @__PURE__ */ jsxs4(
594
+ ToastRoot,
595
+ {
596
+ onOpenChange: (open) => handleOpenChange(open, toast.id),
597
+ children: [
598
+ /* @__PURE__ */ jsxs4("div", { children: [
599
+ /* @__PURE__ */ jsx10(ToastTitle, { children: toast.title }),
600
+ toast.description && /* @__PURE__ */ jsx10(ToastDescription, { children: toast.description })
601
+ ] }),
602
+ /* @__PURE__ */ jsx10(ToastClose, { asChild: true, children: /* @__PURE__ */ jsx10(X, { weight: "light", size: 20 }) })
603
+ ]
604
+ },
605
+ toast.id
606
+ )),
607
+ /* @__PURE__ */ jsx10(ToastViewport, {})
608
+ ] }) });
609
+ }
610
+ var useToast = () => {
611
+ const context = useContext(ToastContext);
612
+ if (!context) {
613
+ throw new Error("useToast must be used within a ToastProvider");
614
+ }
615
+ return context;
616
+ };
617
+
618
+ // src/components/Tooltip/index.tsx
619
+ import * as RadixTooltip from "@radix-ui/react-tooltip";
620
+
621
+ // src/components/Tooltip/styles.ts
622
+ import * as Tooltip from "@radix-ui/react-tooltip";
623
+ import { styled as styled11 } from "styled-components";
624
+ var TooltipContent = styled11(Tooltip.Content)`
625
+ padding: ${({ theme: theme2 }) => `${theme2.space[3]} ${theme2.space[4]}`};
626
+ background: ${({ theme: theme2 }) => theme2.colors.gray900};
627
+ color: ${({ theme: theme2 }) => theme2.colors.gray100};
628
+ font-family: ${({ theme: theme2 }) => theme2.fonts.default};
629
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes.sm};
630
+ font-weight: ${({ theme: theme2 }) => theme2.fontWeights.medium};
631
+ border-radius: ${({ theme: theme2 }) => theme2.radii.sm};
632
+ user-select: none;
633
+ box-shadow: 4px 16px 24px rgba(0, 0, 0, 0.25);
634
+ `;
635
+ var TooltipArrow = styled11(Tooltip.Arrow)`
636
+ fill: ${({ theme: theme2 }) => theme2.colors.gray900};
637
+ `;
638
+
639
+ // src/components/Tooltip/index.tsx
640
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
641
+ function Tooltip2(_a) {
642
+ var _b = _a, {
643
+ children,
644
+ content,
645
+ contentProps
646
+ } = _b, props = __objRest(_b, [
647
+ "children",
648
+ "content",
649
+ "contentProps"
650
+ ]);
651
+ return /* @__PURE__ */ jsxs5(RadixTooltip.Root, __spreadProps(__spreadValues({}, props), { children: [
652
+ /* @__PURE__ */ jsx11(RadixTooltip.Trigger, { asChild: true, children }),
653
+ /* @__PURE__ */ jsx11(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs5(TooltipContent, __spreadProps(__spreadValues({ sideOffset: 5 }, contentProps), { children: [
654
+ content,
655
+ /* @__PURE__ */ jsx11(TooltipArrow, {})
656
+ ] })) })
657
+ ] }));
658
+ }
659
+ var TooltipProvider = RadixTooltip.Provider;
660
+ Tooltip2.displayName = "Tooltip";
661
+
466
662
  // src/styles/theme.ts
467
663
  import {
468
664
  colors,
@@ -492,5 +688,9 @@ export {
492
688
  Text,
493
689
  TextArea,
494
690
  TextInput,
495
- theme
691
+ ToastProvider,
692
+ Tooltip2 as Tooltip,
693
+ TooltipProvider,
694
+ theme,
695
+ useToast
496
696
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beryl-ui/react",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "React components for the beryl-ui Design System.",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -53,6 +53,8 @@
53
53
  "@beryl-ui/tokens": "*",
54
54
  "@radix-ui/react-avatar": "^1.1.11",
55
55
  "@radix-ui/react-checkbox": "^1.3.3",
56
+ "@radix-ui/react-toast": "^1.2.15",
57
+ "@radix-ui/react-tooltip": "^1.2.8",
56
58
  "phosphor-react": "^1.4.1"
57
59
  }
58
- }
60
+ }