@lets-events/react 12.10.15 → 12.10.16
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +396 -392
- package/dist/index.d.ts +396 -392
- package/dist/index.js +10 -10
- package/dist/index.mjs +10 -10
- package/package.json +1 -1
- package/src/components/Badge.tsx +15 -6
- package/src/components/Button/index.tsx +3 -1
- package/src/components/Flex.tsx +4 -4
- package/src/components/Text.tsx +4 -3
package/dist/index.js
CHANGED
|
@@ -11927,12 +11927,12 @@ var generateUniqueFilename = (originalName) => {
|
|
|
11927
11927
|
return `${timestamp}_${random}.${extension}`;
|
|
11928
11928
|
};
|
|
11929
11929
|
var UploadService = class {
|
|
11930
|
-
static getPresignedUrl(filename, contentType,
|
|
11930
|
+
static getPresignedUrl(filename, contentType, config5) {
|
|
11931
11931
|
return __async(this, null, function* () {
|
|
11932
11932
|
var _a;
|
|
11933
|
-
const apiUrl =
|
|
11934
|
-
const presignedUrlEndpoint = (_a =
|
|
11935
|
-
const bucket =
|
|
11933
|
+
const apiUrl = config5.apiUrl;
|
|
11934
|
+
const presignedUrlEndpoint = (_a = config5.endpoints) == null ? void 0 : _a.presignedUrl;
|
|
11935
|
+
const bucket = config5.s3Bucket;
|
|
11936
11936
|
try {
|
|
11937
11937
|
const response = yield fetch(`${apiUrl}${presignedUrlEndpoint}`, {
|
|
11938
11938
|
method: "POST",
|
|
@@ -11956,12 +11956,12 @@ var UploadService = class {
|
|
|
11956
11956
|
}
|
|
11957
11957
|
});
|
|
11958
11958
|
}
|
|
11959
|
-
static uploadToS3(file,
|
|
11959
|
+
static uploadToS3(file, config5, onProgress) {
|
|
11960
11960
|
return __async(this, null, function* () {
|
|
11961
11961
|
try {
|
|
11962
11962
|
const uniqueFilename = generateUniqueFilename(file.name);
|
|
11963
11963
|
const blob = new Blob([file], { type: file.type });
|
|
11964
|
-
const s3Url = `${
|
|
11964
|
+
const s3Url = `${config5.s3Url}/${uniqueFilename}`;
|
|
11965
11965
|
return new Promise((resolve, reject) => {
|
|
11966
11966
|
const xhr = new XMLHttpRequest();
|
|
11967
11967
|
xhr.upload.addEventListener("progress", (event) => {
|
|
@@ -12000,12 +12000,12 @@ var UploadService = class {
|
|
|
12000
12000
|
}
|
|
12001
12001
|
});
|
|
12002
12002
|
}
|
|
12003
|
-
static uploadViaAPI(file,
|
|
12003
|
+
static uploadViaAPI(file, config5, onProgress) {
|
|
12004
12004
|
return __async(this, null, function* () {
|
|
12005
12005
|
try {
|
|
12006
12006
|
const formData = new FormData();
|
|
12007
12007
|
formData.append("file", file);
|
|
12008
|
-
const bucket =
|
|
12008
|
+
const bucket = config5.s3Bucket;
|
|
12009
12009
|
formData.append("bucket", bucket);
|
|
12010
12010
|
const xhr = new XMLHttpRequest();
|
|
12011
12011
|
return new Promise((resolve, reject) => {
|
|
@@ -12041,8 +12041,8 @@ var UploadService = class {
|
|
|
12041
12041
|
xhr.addEventListener("error", () => {
|
|
12042
12042
|
reject(new Error("Erro de rede durante upload"));
|
|
12043
12043
|
});
|
|
12044
|
-
const apiUrl =
|
|
12045
|
-
const uploadEndpoint = (_a =
|
|
12044
|
+
const apiUrl = config5.apiUrl;
|
|
12045
|
+
const uploadEndpoint = (_a = config5.endpoints) == null ? void 0 : _a.upload;
|
|
12046
12046
|
xhr.open("POST", `${apiUrl}${uploadEndpoint}`);
|
|
12047
12047
|
xhr.send(formData);
|
|
12048
12048
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -11819,12 +11819,12 @@ var generateUniqueFilename = (originalName) => {
|
|
|
11819
11819
|
return `${timestamp}_${random}.${extension}`;
|
|
11820
11820
|
};
|
|
11821
11821
|
var UploadService = class {
|
|
11822
|
-
static getPresignedUrl(filename, contentType,
|
|
11822
|
+
static getPresignedUrl(filename, contentType, config5) {
|
|
11823
11823
|
return __async(this, null, function* () {
|
|
11824
11824
|
var _a;
|
|
11825
|
-
const apiUrl =
|
|
11826
|
-
const presignedUrlEndpoint = (_a =
|
|
11827
|
-
const bucket =
|
|
11825
|
+
const apiUrl = config5.apiUrl;
|
|
11826
|
+
const presignedUrlEndpoint = (_a = config5.endpoints) == null ? void 0 : _a.presignedUrl;
|
|
11827
|
+
const bucket = config5.s3Bucket;
|
|
11828
11828
|
try {
|
|
11829
11829
|
const response = yield fetch(`${apiUrl}${presignedUrlEndpoint}`, {
|
|
11830
11830
|
method: "POST",
|
|
@@ -11848,12 +11848,12 @@ var UploadService = class {
|
|
|
11848
11848
|
}
|
|
11849
11849
|
});
|
|
11850
11850
|
}
|
|
11851
|
-
static uploadToS3(file,
|
|
11851
|
+
static uploadToS3(file, config5, onProgress) {
|
|
11852
11852
|
return __async(this, null, function* () {
|
|
11853
11853
|
try {
|
|
11854
11854
|
const uniqueFilename = generateUniqueFilename(file.name);
|
|
11855
11855
|
const blob = new Blob([file], { type: file.type });
|
|
11856
|
-
const s3Url = `${
|
|
11856
|
+
const s3Url = `${config5.s3Url}/${uniqueFilename}`;
|
|
11857
11857
|
return new Promise((resolve, reject) => {
|
|
11858
11858
|
const xhr = new XMLHttpRequest();
|
|
11859
11859
|
xhr.upload.addEventListener("progress", (event) => {
|
|
@@ -11892,12 +11892,12 @@ var UploadService = class {
|
|
|
11892
11892
|
}
|
|
11893
11893
|
});
|
|
11894
11894
|
}
|
|
11895
|
-
static uploadViaAPI(file,
|
|
11895
|
+
static uploadViaAPI(file, config5, onProgress) {
|
|
11896
11896
|
return __async(this, null, function* () {
|
|
11897
11897
|
try {
|
|
11898
11898
|
const formData = new FormData();
|
|
11899
11899
|
formData.append("file", file);
|
|
11900
|
-
const bucket =
|
|
11900
|
+
const bucket = config5.s3Bucket;
|
|
11901
11901
|
formData.append("bucket", bucket);
|
|
11902
11902
|
const xhr = new XMLHttpRequest();
|
|
11903
11903
|
return new Promise((resolve, reject) => {
|
|
@@ -11933,8 +11933,8 @@ var UploadService = class {
|
|
|
11933
11933
|
xhr.addEventListener("error", () => {
|
|
11934
11934
|
reject(new Error("Erro de rede durante upload"));
|
|
11935
11935
|
});
|
|
11936
|
-
const apiUrl =
|
|
11937
|
-
const uploadEndpoint = (_a =
|
|
11936
|
+
const apiUrl = config5.apiUrl;
|
|
11937
|
+
const uploadEndpoint = (_a = config5.endpoints) == null ? void 0 : _a.upload;
|
|
11938
11938
|
xhr.open("POST", `${apiUrl}${uploadEndpoint}`);
|
|
11939
11939
|
xhr.send(formData);
|
|
11940
11940
|
});
|
package/package.json
CHANGED
package/src/components/Badge.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { styled } from "../styles";
|
|
1
|
+
import React, { ComponentProps, CSSProperties, ElementType, ReactNode } from "react";
|
|
2
|
+
import type { CSS } from "@stitches/react";
|
|
3
|
+
import { styled, config } from "../styles";
|
|
4
4
|
import { Badge as BadgeRadix } from "@radix-ui/themes";
|
|
5
5
|
export const BadgeStyled = styled(BadgeRadix, {
|
|
6
6
|
fontFamily: "$default",
|
|
@@ -103,15 +103,24 @@ export const BadgeStyled = styled(BadgeRadix, {
|
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
-
export type BadgeProps =
|
|
106
|
+
export type BadgeProps = {
|
|
107
107
|
as?: ElementType;
|
|
108
|
+
asChild?: boolean;
|
|
109
|
+
color?: "primary" | "dark" | "light" | "red" | "green" | "yellow" | "orange" | "blue" | "pink" | "purple" | "grey" | "disable";
|
|
110
|
+
size?: "xs" | "sm" | "md" | "xl";
|
|
111
|
+
fontWeight?: "regular" | "medium" | "semibold" | "bold";
|
|
112
|
+
radii?: "full";
|
|
108
113
|
icon?: boolean;
|
|
109
|
-
children:
|
|
114
|
+
children: ReactNode;
|
|
115
|
+
id?: string;
|
|
116
|
+
className?: string;
|
|
117
|
+
style?: CSSProperties;
|
|
118
|
+
css?: CSS<typeof config>;
|
|
110
119
|
};
|
|
111
120
|
|
|
112
121
|
export function Badge({ asChild, children, ...props }: BadgeProps) {
|
|
113
122
|
return (
|
|
114
|
-
<BadgeStyled {...props}>
|
|
123
|
+
<BadgeStyled {...(props as ComponentProps<typeof BadgeStyled>)}>
|
|
115
124
|
{React.Children.map(children, (child) => {
|
|
116
125
|
if (React.isValidElement(child)) {
|
|
117
126
|
return React.cloneElement(child, { size: props.size } as any);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ComponentProps, CSSProperties, ReactNode, useMemo } from "react";
|
|
2
|
+
import type { CSS } from "@stitches/react";
|
|
2
3
|
import { ButtonStyled, SpinningDiv } from "./styledComponents";
|
|
4
|
+
import { config } from "../../styles";
|
|
3
5
|
import { Button as ButtonRadix } from "@radix-ui/themes";
|
|
4
6
|
import Icon, { IconProps } from "../Icon";
|
|
5
7
|
import { Flex } from "../Flex";
|
|
@@ -31,7 +33,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
31
33
|
children?: ReactNode;
|
|
32
34
|
className?: string;
|
|
33
35
|
style?: CSSProperties;
|
|
34
|
-
css?:
|
|
36
|
+
css?: CSS<typeof config>;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export function Button({ asChild, children, loading, ...props }: ButtonProps) {
|
package/src/components/Flex.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, CSSProperties, ElementType, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { CSS } from '@stitches/react';
|
|
3
|
+
import { styled, config } from '../styles'
|
|
3
4
|
import { Flex as FlexRadix } from "@radix-ui/themes";
|
|
4
5
|
export const FlexStyled = styled(FlexRadix, {
|
|
5
6
|
variants: {
|
|
@@ -104,8 +105,7 @@ export const FlexStyled = styled(FlexRadix, {
|
|
|
104
105
|
|
|
105
106
|
})
|
|
106
107
|
|
|
107
|
-
type
|
|
108
|
-
type GapValue = NonNullable<StitchesFlexProps['gap']>;
|
|
108
|
+
type GapValue = NonNullable<ComponentProps<typeof FlexStyled>['gap']>;
|
|
109
109
|
|
|
110
110
|
export type FlexProps = {
|
|
111
111
|
as?: ElementType;
|
|
@@ -119,7 +119,7 @@ export type FlexProps = {
|
|
|
119
119
|
gapY?: Exclude<GapValue, 0 | '0'>;
|
|
120
120
|
className?: string;
|
|
121
121
|
style?: CSSProperties;
|
|
122
|
-
css?:
|
|
122
|
+
css?: CSS<typeof config>;
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
export function Flex({ children, ...props }: FlexProps) {
|
package/src/components/Text.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CSSProperties, ElementType, ReactNode } from "react";
|
|
2
|
+
import type { CSS } from "@stitches/react";
|
|
3
|
+
import { styled, config } from "../styles";
|
|
3
4
|
import { Text as TextRadix } from "@radix-ui/themes";
|
|
4
5
|
import { typographyValues } from "../types/typographyValues";
|
|
5
6
|
|
|
@@ -37,7 +38,7 @@ export type TextProps = {
|
|
|
37
38
|
"aria-hidden"?: boolean | "true" | "false";
|
|
38
39
|
className?: string;
|
|
39
40
|
style?: CSSProperties;
|
|
40
|
-
css?:
|
|
41
|
+
css?: CSS<typeof config>;
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
export function Text({ color, ...props }: TextProps) {
|