@ourtrip/ui 1.0.3 → 1.0.5
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 +434 -0
- package/dist/index.js +3 -22
- package/dist/index.js.LICENSE.txt +15 -0
- package/dist/index.js.map +1 -0
- package/dist/types/components/button.d.ts +2 -2
- package/dist/types/components/sheet.d.ts +1 -1
- package/package.json +6 -3
- package/webpack.config.js +31 -0
- package/dist/components/accordion.js +0 -19
- package/dist/components/alert.js +0 -36
- package/dist/components/badge.js +0 -47
- package/dist/components/breadcrumbs.js +0 -22
- package/dist/components/button.js +0 -155
- package/dist/components/card.js +0 -29
- package/dist/components/checkbox.js +0 -24
- package/dist/components/collapse.js +0 -16
- package/dist/components/divider.js +0 -38
- package/dist/components/input.js +0 -58
- package/dist/components/modal.js +0 -10
- package/dist/components/phone.js +0 -53
- package/dist/components/popover.js +0 -35
- package/dist/components/radio.js +0 -38
- package/dist/components/range.js +0 -19
- package/dist/components/select.js +0 -84
- package/dist/components/sheet.js +0 -82
- package/dist/components/stars.js +0 -10
- package/dist/components/step-marker.js +0 -18
- package/dist/components/switch.js +0 -15
- package/dist/components/tag.js +0 -16
- package/dist/components/tooltip.js +0 -9
- package/dist/index.cjs.js +0 -18366
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -18312
- package/dist/index.esm.js.map +0 -1
- package/dist/utils/classes.js +0 -7
- package/dist/utils/validation.js +0 -128
- package/rollup.config.js +0 -29
|
@@ -2,10 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "fill" | "outline" | null | undefined;
|
|
5
|
-
color?: "
|
|
5
|
+
color?: "danger" | "white" | "primary" | "secondary" | "gray" | null | undefined;
|
|
6
6
|
size?: "small" | "normal" | "large" | "icon" | null | undefined;
|
|
7
7
|
shape?: "default" | "rounded" | null | undefined;
|
|
8
|
-
fontWeight?: "
|
|
8
|
+
fontWeight?: "bold" | "normal" | null | undefined;
|
|
9
9
|
fullWidth?: boolean | null | undefined;
|
|
10
10
|
fullHeight?: boolean | null | undefined;
|
|
11
11
|
disabled?: boolean | null | undefined;
|
|
@@ -7,7 +7,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
7
7
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
8
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "
|
|
10
|
+
side?: "bottom" | "right" | "top" | "left" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ourtrip/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "webpack"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [],
|
|
11
11
|
"author": "",
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
"react-dom": "^19.0.0",
|
|
27
27
|
"rollup": "^2.79.2",
|
|
28
28
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
29
|
-
"
|
|
29
|
+
"ts-loader": "^9.5.2",
|
|
30
|
+
"typescript": "^5.8.2",
|
|
31
|
+
"webpack": "^5.98.0",
|
|
32
|
+
"webpack-cli": "^6.0.1"
|
|
30
33
|
},
|
|
31
34
|
"peerDependencies": {
|
|
32
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
mode: 'production',
|
|
5
|
+
entry: './src/index.tsx', // ponto de entrada da sua biblioteca
|
|
6
|
+
output: {
|
|
7
|
+
path: path.resolve(__dirname, 'dist'),
|
|
8
|
+
filename: 'index.js', // bundle final
|
|
9
|
+
library: '@ourtrip/ui', // nome da sua biblioteca
|
|
10
|
+
libraryTarget: 'umd', // gera um bundle compatível com diversos ambientes (CommonJS, AMD, global)
|
|
11
|
+
globalObject: 'this' // necessário para que funcione no Node.js e no browser
|
|
12
|
+
},
|
|
13
|
+
resolve: {
|
|
14
|
+
extensions: ['.ts', '.tsx', '.js']
|
|
15
|
+
},
|
|
16
|
+
// Marque o React e o ReactDOM como "externals" para não incluí-los no bundle final
|
|
17
|
+
externals: {
|
|
18
|
+
react: 'react',
|
|
19
|
+
'react-dom': 'react-dom'
|
|
20
|
+
},
|
|
21
|
+
module: {
|
|
22
|
+
rules: [
|
|
23
|
+
{
|
|
24
|
+
test: /\.tsx?$/,
|
|
25
|
+
use: 'ts-loader',
|
|
26
|
+
exclude: /node_modules/
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
devtool: 'source-map' // gera sourcemaps para facilitar o debug
|
|
31
|
+
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
var Accordion = function (_a) {
|
|
4
|
-
var title = _a.title, text = _a.text;
|
|
5
|
-
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
6
|
-
return (React.createElement("div", { className: 'w-full flex flex-col p-6 border border-gray-200 rounded-default cursor-pointer', onClick: function () { return setOpen(function (prev) { return !prev; }); } },
|
|
7
|
-
React.createElement("div", { className: 'flex items-center gap-6' },
|
|
8
|
-
React.createElement("div", { className: "relative w-10 h-10 rounded-full flex justify-center items-center transition-colors duration-300 ".concat(open ? 'bg-primary-900' : 'bg-gray-100') },
|
|
9
|
-
React.createElement("div", { className: "absolute w-4 h-0.5 rounded transition-transform duration-300 ".concat(open
|
|
10
|
-
? 'bg-primary-900 transform rotate-[-90deg]'
|
|
11
|
-
: 'bg-primary-900 transform rotate-[-180deg]') }),
|
|
12
|
-
React.createElement("div", { className: "absolute w-4 h-0.5 rounded transition-transform duration-300 ".concat(open
|
|
13
|
-
? 'bg-white transform rotate-0'
|
|
14
|
-
: 'bg-primary-900 transform rotate-[-90deg]') })),
|
|
15
|
-
React.createElement("h2", { className: 'font-medium text-lg text-primary-900' }, title)),
|
|
16
|
-
React.createElement("div", { className: "pl-16 overflow-hidden transition-max-height duration-500 ease-in-out ".concat(open ? 'max-h-56' : 'max-h-0') },
|
|
17
|
-
React.createElement("p", { className: 'pt-2.5 text-base text-gray-500 leading-7' }, text))));
|
|
18
|
-
};
|
|
19
|
-
export default Accordion;
|
package/dist/components/alert.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Check, Info, Warning, WarningCircle } from '@phosphor-icons/react';
|
|
4
|
-
var iconByAlertType = {
|
|
5
|
-
danger: React.createElement(WarningCircle, { size: 24 }),
|
|
6
|
-
success: React.createElement(Check, { size: 24 }),
|
|
7
|
-
info: React.createElement(Info, { size: 24 }),
|
|
8
|
-
warning: React.createElement(Warning, { size: 24 })
|
|
9
|
-
};
|
|
10
|
-
var Alert = function (_a) {
|
|
11
|
-
var type = _a.type, variant = _a.variant, children = _a.children;
|
|
12
|
-
var baseClasses = 'rounded-default p-4 flex items-start gap-4';
|
|
13
|
-
var typeVariantClasses = {
|
|
14
|
-
info: {
|
|
15
|
-
fill: 'bg-info-500 text-white',
|
|
16
|
-
outline: 'border border-info-500 text-info-500'
|
|
17
|
-
},
|
|
18
|
-
success: {
|
|
19
|
-
fill: 'bg-success-500 text-white',
|
|
20
|
-
outline: 'border border-success-500 text-success-500'
|
|
21
|
-
},
|
|
22
|
-
danger: {
|
|
23
|
-
fill: 'bg-danger-500 text-white',
|
|
24
|
-
outline: 'border border-danger-500 text-danger-500'
|
|
25
|
-
},
|
|
26
|
-
warning: {
|
|
27
|
-
fill: 'bg-warning-500 text-white',
|
|
28
|
-
outline: 'border border-warning-500 text-warning-500'
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var className = "".concat(baseClasses, " ").concat(typeVariantClasses[type][variant]);
|
|
32
|
-
return (React.createElement("div", { className: className },
|
|
33
|
-
iconByAlertType[type],
|
|
34
|
-
React.createElement("div", null, children)));
|
|
35
|
-
};
|
|
36
|
-
export default Alert;
|
package/dist/components/badge.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
var Badge = function (_a) {
|
|
4
|
-
var children = _a.children, icon = _a.icon, type = _a.type, _b = _a.size, size = _b === void 0 ? 'normal' : _b, mobile = _a.mobile, className = _a.className;
|
|
5
|
-
var baseClasses = "flex items-center rounded-button ".concat(mobile ? 'lg:hidden md:flex' : '', " ").concat(className || '');
|
|
6
|
-
var typeClasses = '';
|
|
7
|
-
var sizeClasses = {
|
|
8
|
-
small: 'px-2 py-1 gap-0',
|
|
9
|
-
normal: 'py-2 px-3 gap-2',
|
|
10
|
-
large: 'py-3 px-4 gap-3'
|
|
11
|
-
}[size];
|
|
12
|
-
var textSizesClasses = {
|
|
13
|
-
small: 'text-xs font-normal',
|
|
14
|
-
normal: 'text-sm font-semibold',
|
|
15
|
-
large: 'text-base font-semibold'
|
|
16
|
-
}[size];
|
|
17
|
-
switch (type) {
|
|
18
|
-
case 'success':
|
|
19
|
-
typeClasses = 'bg-success-100 text-success-600';
|
|
20
|
-
break;
|
|
21
|
-
case 'warning':
|
|
22
|
-
typeClasses = 'bg-warning-100 text-warning-600';
|
|
23
|
-
break;
|
|
24
|
-
case 'danger':
|
|
25
|
-
typeClasses = 'bg-danger-100 text-danger-600';
|
|
26
|
-
break;
|
|
27
|
-
case 'info':
|
|
28
|
-
typeClasses = 'bg-info-100 text-info-900';
|
|
29
|
-
break;
|
|
30
|
-
case 'white':
|
|
31
|
-
typeClasses = 'bg-white text-gray-900';
|
|
32
|
-
break;
|
|
33
|
-
case 'primary':
|
|
34
|
-
typeClasses = 'bg-primary-500 text-white';
|
|
35
|
-
break;
|
|
36
|
-
case 'secondary':
|
|
37
|
-
typeClasses = 'bg-gray-100 text-primary-500';
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
typeClasses = '';
|
|
41
|
-
}
|
|
42
|
-
var textClasses = "font-semibold whitespace-nowrap ".concat(textSizesClasses);
|
|
43
|
-
return (React.createElement("div", { className: "".concat(baseClasses, " ").concat(typeClasses, " ").concat(sizeClasses) },
|
|
44
|
-
icon && React.createElement("span", { className: 'mr-2' }, icon),
|
|
45
|
-
React.createElement("p", { className: textClasses }, children)));
|
|
46
|
-
};
|
|
47
|
-
export default Badge;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
3
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
4
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { CaretRight } from '@phosphor-icons/react';
|
|
7
|
-
var Breadcrumbs = function (_a) {
|
|
8
|
-
var items = _a.items;
|
|
9
|
-
return (React.createElement("div", { className: 'flex items-center gap-2.5' }, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
10
|
-
var isActive = index !== items.length - 1;
|
|
11
|
-
return (React.createElement("div", { key: item.id, className: 'flex items-center gap-2.5' },
|
|
12
|
-
React.createElement("a", { onClick: function () {
|
|
13
|
-
if (isActive) {
|
|
14
|
-
window.open(item.href, '_blank');
|
|
15
|
-
}
|
|
16
|
-
}, className: "no-underline text-blue-900 text-sm ".concat(isActive
|
|
17
|
-
? 'hover:text-blue-500 hover:cursor-pointer'
|
|
18
|
-
: 'cursor-text') }, item.text),
|
|
19
|
-
isActive && React.createElement(CaretRight, null)));
|
|
20
|
-
})));
|
|
21
|
-
};
|
|
22
|
-
export default Breadcrumbs;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
import * as React from 'react';
|
|
25
|
-
import { CircleNotch } from '@phosphor-icons/react';
|
|
26
|
-
import { cva } from 'class-variance-authority';
|
|
27
|
-
import { cn } from '../utils/classes';
|
|
28
|
-
var buttonVariants = cva('flex items-center justify-center gap-2 whitespace-nowrap transition-colors focus:outline-hidden', {
|
|
29
|
-
variants: {
|
|
30
|
-
variant: {
|
|
31
|
-
fill: '',
|
|
32
|
-
outline: 'bg-transparent border'
|
|
33
|
-
},
|
|
34
|
-
color: {
|
|
35
|
-
primary: '',
|
|
36
|
-
secondary: '',
|
|
37
|
-
danger: '',
|
|
38
|
-
gray: '',
|
|
39
|
-
white: ''
|
|
40
|
-
},
|
|
41
|
-
size: {
|
|
42
|
-
small: 'h-[32px] px-4 text-sm',
|
|
43
|
-
normal: 'h-[40px] px-6 text-base',
|
|
44
|
-
large: 'h-[48px] px-8 text-lg',
|
|
45
|
-
icon: 'h-[40px] w-[40px] p-0'
|
|
46
|
-
},
|
|
47
|
-
shape: {
|
|
48
|
-
default: 'rounded-inner',
|
|
49
|
-
rounded: 'rounded-full'
|
|
50
|
-
},
|
|
51
|
-
fontWeight: {
|
|
52
|
-
normal: 'font-normal',
|
|
53
|
-
bold: 'font-medium'
|
|
54
|
-
},
|
|
55
|
-
fullWidth: {
|
|
56
|
-
true: 'w-full',
|
|
57
|
-
false: ''
|
|
58
|
-
},
|
|
59
|
-
fullHeight: {
|
|
60
|
-
true: 'h-full',
|
|
61
|
-
false: ''
|
|
62
|
-
},
|
|
63
|
-
disabled: {
|
|
64
|
-
true: 'bg-gray-200 text-gray-900 border-none cursor-not-allowed hover:bg-gray-200 hover:text-gray-900',
|
|
65
|
-
false: ''
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
compoundVariants: [
|
|
69
|
-
{
|
|
70
|
-
variant: 'fill',
|
|
71
|
-
color: 'primary',
|
|
72
|
-
disabled: false,
|
|
73
|
-
className: 'bg-primary-500 text-white hover:bg-primary-400 active:bg-primary-600'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
variant: 'fill',
|
|
77
|
-
color: 'secondary',
|
|
78
|
-
disabled: false,
|
|
79
|
-
className: 'bg-secondary-500 text-white hover:bg-secondary-400 active:bg-secondary-600'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
variant: 'fill',
|
|
83
|
-
color: 'danger',
|
|
84
|
-
disabled: false,
|
|
85
|
-
className: 'bg-red-500 text-white hover:bg-red-400 active:bg-red-600'
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
variant: 'fill',
|
|
89
|
-
color: 'gray',
|
|
90
|
-
disabled: false,
|
|
91
|
-
className: 'bg-gray-100 text-gray-700 hover:bg-gray-200 active:bg-gray-300'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
variant: 'fill',
|
|
95
|
-
color: 'white',
|
|
96
|
-
disabled: false,
|
|
97
|
-
className: 'bg-white text-black hover:bg-gray-200'
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
variant: 'outline',
|
|
101
|
-
color: 'primary',
|
|
102
|
-
disabled: false,
|
|
103
|
-
className: 'text-primary-500 border-primary-500 hover:text-primary-400 hover:border-primary-400'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
variant: 'outline',
|
|
107
|
-
color: 'secondary',
|
|
108
|
-
disabled: false,
|
|
109
|
-
className: 'text-secondary-500 border-secondary-500 hover:text-secondary-400 hover:border-secondary-400'
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
variant: 'outline',
|
|
113
|
-
color: 'danger',
|
|
114
|
-
disabled: false,
|
|
115
|
-
className: 'text-red-500 border-red-500 hover:text-red-400 hover:border-red-400'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
variant: 'outline',
|
|
119
|
-
color: 'gray',
|
|
120
|
-
disabled: false,
|
|
121
|
-
className: 'text-gray-300 border-gray-300 hover:text-gray-500 hover:border-gray-400'
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
variant: 'outline',
|
|
125
|
-
color: 'white',
|
|
126
|
-
disabled: false,
|
|
127
|
-
className: 'text-white border-white hover:text-gray-200 hover:border-gray-200'
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
defaultVariants: {
|
|
131
|
-
variant: 'fill',
|
|
132
|
-
color: 'primary',
|
|
133
|
-
size: 'normal',
|
|
134
|
-
shape: 'default',
|
|
135
|
-
fontWeight: 'normal',
|
|
136
|
-
fullWidth: false,
|
|
137
|
-
fullHeight: false,
|
|
138
|
-
disabled: false
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
var Button = React.forwardRef(function (_a, ref) {
|
|
142
|
-
var className = _a.className, variant = _a.variant, color = _a.color, size = _a.size, shape = _a.shape, fontWeight = _a.fontWeight, fullWidth = _a.fullWidth, fullHeight = _a.fullHeight, disabled = _a.disabled, _b = _a.loading, loading = _b === void 0 ? false : _b, children = _a.children, props = __rest(_a, ["className", "variant", "color", "size", "shape", "fontWeight", "fullWidth", "fullHeight", "disabled", "loading", "children"]);
|
|
143
|
-
return (React.createElement("button", __assign({ className: cn(buttonVariants({
|
|
144
|
-
variant: variant,
|
|
145
|
-
color: color,
|
|
146
|
-
size: size,
|
|
147
|
-
shape: shape,
|
|
148
|
-
fontWeight: fontWeight,
|
|
149
|
-
fullWidth: fullWidth,
|
|
150
|
-
fullHeight: fullHeight,
|
|
151
|
-
disabled: disabled || loading
|
|
152
|
-
}), className), ref: ref, disabled: disabled || loading }, props), loading ? (React.createElement(CircleNotch, { className: 'animate-spin', weight: 'bold' })) : (children)));
|
|
153
|
-
});
|
|
154
|
-
Button.displayName = 'Button';
|
|
155
|
-
export default Button;
|
package/dist/components/card.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
import React from 'react';
|
|
25
|
-
var Card = function (_a) {
|
|
26
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
|
27
|
-
return (React.createElement("div", __assign({ className: 'p-4 rounded-default border bg-white border-gray-200' }, props), children));
|
|
28
|
-
};
|
|
29
|
-
export default Card;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { memo, useEffect, useState } from 'react';
|
|
3
|
-
import { Check } from '@phosphor-icons/react';
|
|
4
|
-
import Stars from './stars';
|
|
5
|
-
var Checkbox = function (_a) {
|
|
6
|
-
var value = _a.value, onChange = _a.onChange, label = _a.label, trailing = _a.trailing, textColor = _a.textColor, type = _a.type;
|
|
7
|
-
var _b = useState(value || false), checked = _b[0], setChecked = _b[1];
|
|
8
|
-
useEffect(function () {
|
|
9
|
-
if (value !== undefined)
|
|
10
|
-
setChecked(value);
|
|
11
|
-
}, [value]);
|
|
12
|
-
return (React.createElement("div", { className: 'w-full flex items-center justify-between cursor-pointer gap-2 select-none', onClick: function () {
|
|
13
|
-
setChecked(function (prev) { return !prev; });
|
|
14
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
|
|
15
|
-
} },
|
|
16
|
-
React.createElement("div", { className: 'flex items-center gap-2' },
|
|
17
|
-
React.createElement("div", { className: "w-5 h-5 flex items-center justify-center border border-primary-500 rounded-md flex-none mt-[3px] hover:bg-primary-500 ".concat(checked ? 'bg-primary-500' : '') }, checked && React.createElement(Check, { size: 12, color: 'white', weight: 'bold' })),
|
|
18
|
-
label && (React.createElement("p", { className: "flex items-center gap-1 text-sm mt-1 ".concat(textColor === 'primary' ? 'text-primary-900' : 'text-gray-500') }, type === 'stars' ? (React.createElement(Stars, { rate: parseFloat(label.toString()) })) : (label)))),
|
|
19
|
-
trailing !== undefined && (React.createElement("p", { className: 'text-sm text-gray-500' }, trailing))));
|
|
20
|
-
};
|
|
21
|
-
var propsAreEqual = function (prevProps, nextProps) {
|
|
22
|
-
return prevProps.value === nextProps.value && prevProps.label === nextProps.label;
|
|
23
|
-
};
|
|
24
|
-
export default memo(Checkbox, propsAreEqual);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import { CaretDown, CaretUp } from '@phosphor-icons/react';
|
|
4
|
-
var Collapse = function (_a) {
|
|
5
|
-
var title = _a.title, content = _a.content, _b = _a.showPreview, showPreview = _b === void 0 ? false : _b, _c = _a.togglePosition, togglePosition = _c === void 0 ? 'right' : _c, toggleText = _a.toggleText;
|
|
6
|
-
var _d = useState(false), open = _d[0], setOpen = _d[1];
|
|
7
|
-
return (React.createElement("div", { className: "relative flex items-start ".concat(togglePosition === 'right' ? 'flex-row' : 'flex-col', " gap-3"), onClick: function () { return setOpen(function (prev) { return !prev; }); } },
|
|
8
|
-
React.createElement("div", { className: 'mt-1' },
|
|
9
|
-
React.createElement("h3", { className: 'text-sm text-primary-900' }, title),
|
|
10
|
-
React.createElement("div", { className: "overflow-hidden transition-max-height duration-300 ease-in-out ".concat(open ? 'max-h-[1000px]' : showPreview ? 'max-h-12' : 'max-h-0') },
|
|
11
|
-
React.createElement("p", { className: 'mt-1 text-gray-500' }, content))),
|
|
12
|
-
React.createElement("div", { className: 'flex items-center gap-2' },
|
|
13
|
-
toggleText && React.createElement("span", null, open ? toggleText.close : toggleText.open),
|
|
14
|
-
React.createElement("div", { className: 'w-7 h-7 rounded-full bg-gray-100 flex items-center justify-center' }, open ? React.createElement(CaretUp, { size: 18 }) : React.createElement(CaretDown, { size: 18 })))));
|
|
15
|
-
};
|
|
16
|
-
export default Collapse;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import classNames from 'classnames';
|
|
26
|
-
var Divider = function (_a) {
|
|
27
|
-
var _b;
|
|
28
|
-
var _c = _a.orientation, orientation = _c === void 0 ? 'vertical' : _c, fullHeight = _a.fullHeight, className = _a.className, props = __rest(_a, ["orientation", "fullHeight", "className"]);
|
|
29
|
-
var dividerClass = classNames((_b = {
|
|
30
|
-
'w-px h-10 bg-gray-200': orientation === 'vertical' && !fullHeight,
|
|
31
|
-
'w-full h-px bg-gray-200': orientation === 'horizontal',
|
|
32
|
-
'w-px h-full bg-gray-200': orientation === 'vertical' && fullHeight
|
|
33
|
-
},
|
|
34
|
-
_b[className] = className,
|
|
35
|
-
_b));
|
|
36
|
-
return React.createElement("div", __assign({}, props, { className: dividerClass }));
|
|
37
|
-
};
|
|
38
|
-
export default Divider;
|
package/dist/components/input.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
/* eslint-disable no-param-reassign */
|
|
25
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
26
|
-
import React, { forwardRef, useRef } from 'react';
|
|
27
|
-
var Input = forwardRef(function (_a, ref) {
|
|
28
|
-
var id = _a.id, label = _a.label, placeholder = _a.placeholder, _b = _a.color, color = _b === void 0 ? 'white' : _b, dense = _a.dense, floating = _a.floating, border = _a.border, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, focus = _a.focus, error = _a.error, disabled = _a.disabled, props = __rest(_a, ["id", "label", "placeholder", "color", "dense", "floating", "border", "onChange", "onFocus", "onBlur", "focus", "error", "disabled"]);
|
|
29
|
-
var inputRef = useRef(null);
|
|
30
|
-
return (React.createElement("div", { "aria-labelledby": id, onClick: function () { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, className: "flex flex-col w-full ".concat(props.className) },
|
|
31
|
-
React.createElement("div", { onClick: function () {
|
|
32
|
-
var _a;
|
|
33
|
-
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
|
34
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
focus === null || focus === void 0 ? void 0 : focus();
|
|
38
|
-
}
|
|
39
|
-
} },
|
|
40
|
-
label && (React.createElement("label", { htmlFor: id, className: 'mb-2 text-sm text-gray-500' }, label)),
|
|
41
|
-
React.createElement("input", __assign({ id: id, ref: function (e) {
|
|
42
|
-
if (typeof ref === 'function')
|
|
43
|
-
ref(e);
|
|
44
|
-
else if (ref && typeof ref === 'object')
|
|
45
|
-
ref.current = e;
|
|
46
|
-
inputRef.current = e;
|
|
47
|
-
}, placeholder: placeholder, autoComplete: 'off' }, props, { disabled: disabled, onChange: function (event) {
|
|
48
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
49
|
-
}, onFocus: function (event) {
|
|
50
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
51
|
-
}, onBlur: function (e) {
|
|
52
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
53
|
-
}, className: "".concat(color === 'white'
|
|
54
|
-
? 'bg-white disabled:bg-white'
|
|
55
|
-
: 'bg-gray-100 disabled:bg-gray-100', " w-full rounded-button h-[50px] px-4 disabled:cursor-not-allowed placeholder-gray-500 text-primary-900 ").concat(props.className) }))),
|
|
56
|
-
error && React.createElement("span", { className: 'text-sm text-red-600' }, error)));
|
|
57
|
-
});
|
|
58
|
-
export default Input;
|
package/dist/components/modal.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
var Modal = function (_a) {
|
|
4
|
-
var isOpen = _a.isOpen, children = _a.children, onClose = _a.onClose, _b = _a.showCloseButton, showCloseButton = _b === void 0 ? false : _b;
|
|
5
|
-
return isOpen ? (React.createElement("div", { className: 'fixed top-0 left-0 w-full h-full bg-black/50 flex justify-center items-center' },
|
|
6
|
-
React.createElement("div", { className: 'bg-white rounded-default shadow-lg min-w-[350px] relative' },
|
|
7
|
-
showCloseButton ? (React.createElement("button", { type: 'button', className: 'absolute top-[10px] right-[10px] cursor-pointer', onClick: function () { return onClose === null || onClose === void 0 ? void 0 : onClose(); } }, "Fechar")) : null,
|
|
8
|
-
React.createElement("div", { className: 'modal-content' }, children)))) : null;
|
|
9
|
-
};
|
|
10
|
-
export default Modal;
|
package/dist/components/phone.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import Input from './input';
|
|
15
|
-
import { isValidDDD, isValidPhoneNumber } from '../utils/validation';
|
|
16
|
-
var PhoneInput = function (_a) {
|
|
17
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
18
|
-
var t = _a.t, DDI = _a.DDI, phoneDDIKey = _a.phoneDDIKey, phoneAreaCodeKey = _a.phoneAreaCodeKey, phoneNumberKey = _a.phoneNumberKey, registerWithMask = _a.registerWithMask, setFocus = _a.setFocus, errors = _a.errors, ddiClassName = _a.ddiClassName, areaCodeClassName = _a.areaCodeClassName, phoneClassName = _a.phoneClassName, requiredMessage = _a.requiredMessage;
|
|
19
|
-
var host = typeof window !== 'undefined' ? window.location.host : '';
|
|
20
|
-
return (React.createElement("div", { className: 'w-full flex flex-col gap-1' },
|
|
21
|
-
React.createElement("div", { className: 'flex flex-col md:flex-row gap-0.5' },
|
|
22
|
-
React.createElement(Input, __assign({ className: "flex-2 rounded-b-none md:rounded-r-none md:rounded-l-button ".concat(ddiClassName), placeholder: t('fieldsLabels.ddi') }, registerWithMask(phoneDDIKey, ['+9', '+99', '+999'], {
|
|
23
|
-
value: DDI,
|
|
24
|
-
required: requiredMessage
|
|
25
|
-
}), { defaultValue: (host === null || host === void 0 ? void 0 : host.includes('.br')) ? '+55' : '', color: 'gray' })),
|
|
26
|
-
React.createElement(Input, __assign({ className: "flex-2 rounded-none ".concat(areaCodeClassName), placeholder: t('fieldsLabels.areaCode') }, registerWithMask(phoneAreaCodeKey, DDI === '+55' ? '(99)' : '', {
|
|
27
|
-
required: requiredMessage,
|
|
28
|
-
validate: function (value) {
|
|
29
|
-
return DDI === '+55'
|
|
30
|
-
? isValidDDD(value)
|
|
31
|
-
: true || t('validations.invalidPhoneAreaCode');
|
|
32
|
-
},
|
|
33
|
-
oncomplete: function () {
|
|
34
|
-
if (DDI === '+55') {
|
|
35
|
-
setFocus(phoneNumberKey);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}), { color: 'gray' })),
|
|
39
|
-
React.createElement(Input, __assign({ className: "flex-5 rounded-t-none md:rounded-l-none md:rounded-r-button ".concat(phoneClassName), placeholder: t('fieldsLabels.number') }, registerWithMask(phoneNumberKey, DDI === '+55' ? '99999-9999' : '', {
|
|
40
|
-
required: requiredMessage,
|
|
41
|
-
validate: function (value) {
|
|
42
|
-
return DDI === '+55'
|
|
43
|
-
? isValidPhoneNumber(value)
|
|
44
|
-
: true || t('validations.invalidPhoneNumber');
|
|
45
|
-
}
|
|
46
|
-
}), { color: 'gray' }))),
|
|
47
|
-
(((_c = (_b = errors === null || errors === void 0 ? void 0 : errors.phone) === null || _b === void 0 ? void 0 : _b.ddi) === null || _c === void 0 ? void 0 : _c.message) ||
|
|
48
|
-
((_e = (_d = errors === null || errors === void 0 ? void 0 : errors.phone) === null || _d === void 0 ? void 0 : _d.areaCode) === null || _e === void 0 ? void 0 : _e.message) ||
|
|
49
|
-
((_g = (_f = errors === null || errors === void 0 ? void 0 : errors.phone) === null || _f === void 0 ? void 0 : _f.number) === null || _g === void 0 ? void 0 : _g.message)) && (React.createElement("span", { className: 'text-red-600 text-sm' }, ((_j = (_h = errors === null || errors === void 0 ? void 0 : errors.phone) === null || _h === void 0 ? void 0 : _h.ddi) === null || _j === void 0 ? void 0 : _j.message) ||
|
|
50
|
-
((_l = (_k = errors === null || errors === void 0 ? void 0 : errors.phone) === null || _k === void 0 ? void 0 : _k.areaCode) === null || _l === void 0 ? void 0 : _l.message) ||
|
|
51
|
-
((_o = (_m = errors === null || errors === void 0 ? void 0 : errors.phone) === null || _m === void 0 ? void 0 : _m.number) === null || _o === void 0 ? void 0 : _o.message)))));
|
|
52
|
-
};
|
|
53
|
-
export default PhoneInput;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
import * as React from 'react';
|
|
25
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
26
|
-
import { cn } from '../utils/classes';
|
|
27
|
-
var Popover = PopoverPrimitive.Root;
|
|
28
|
-
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
29
|
-
var PopoverContent = React.forwardRef(function (_a, ref) {
|
|
30
|
-
var className = _a.className, _b = _a.align, align = _b === void 0 ? 'center' : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, props = __rest(_a, ["className", "align", "sideOffset"]);
|
|
31
|
-
return (React.createElement(PopoverPrimitive.Portal, null,
|
|
32
|
-
React.createElement(PopoverPrimitive.Content, __assign({ ref: ref, align: align, sideOffset: sideOffset, className: cn('z-50 w-72 rounded-default bg-white p-4 text-popover-foreground shadow-xl outline-hidden data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className) }, props))));
|
|
33
|
-
});
|
|
34
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
35
|
-
export { Popover, PopoverTrigger, PopoverContent };
|