@appcorp/app-corp-vista 0.0.3 → 0.0.6
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/molecules/vista-drawer-v1.js +9 -2
- package/molecules/vista-text-input-v1.d.ts +3 -0
- package/molecules/vista-text-input-v1.js +28 -0
- package/package.json +3 -1
- package/providers/index.d.ts +4 -0
- package/providers/index.js +14 -0
- package/type/vista-drawer-type.d.ts +6 -0
- package/type/vista-drawer-type.js +7 -0
- package/type/vista-text-input-type.d.ts +19 -0
- package/type/vista-text-input-type.js +2 -0
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
+
var _a;
|
|
5
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
7
|
exports.VistaDrawerV1 = void 0;
|
|
7
8
|
var react_1 = __importDefault(require("react"));
|
|
8
9
|
var react_2 = require("@headlessui/react");
|
|
9
10
|
var outline_1 = require("@heroicons/react/24/outline");
|
|
10
11
|
var vista_button_v1_1 = require("./vista-button-v1");
|
|
12
|
+
var vista_drawer_type_1 = require("../type/vista-drawer-type");
|
|
11
13
|
var vista_button_type_1 = require("../type/vista-button-type");
|
|
14
|
+
var vistaDrawerSizeMap = (_a = {},
|
|
15
|
+
_a[vista_drawer_type_1.VISTA_DRAWER_SIZE.MD] = 'max-w-md',
|
|
16
|
+
_a[vista_drawer_type_1.VISTA_DRAWER_SIZE.LG] = 'max-w-4xl',
|
|
17
|
+
_a[vista_drawer_type_1.VISTA_DRAWER_SIZE.XL] = 'max-w-6xl',
|
|
18
|
+
_a);
|
|
12
19
|
var VistaDrawerV1 = function (_a) {
|
|
13
|
-
var _b = _a.cancelDisabled, cancelDisabled = _b === void 0 ? false : _b, cancelLabel = _a.cancelLabel, cancelPrefixIcon = _a.cancelPrefixIcon, _c = _a.cancelRounded, cancelRounded = _c === void 0 ? vista_button_type_1.VISTA_BUTTON_ROUNDED.MD : _c, _d = _a.cancelSize, cancelSize = _d === void 0 ? vista_button_type_1.VISTA_BUTTON_SIZE.MD : _d, cancelSuffixIcon = _a.cancelSuffixIcon, children = _a.children, description = _a.description, handleCancelOnClick = _a.handleCancelOnClick, handleSaveOnClick = _a.handleSaveOnClick, handleSetIsOpen = _a.handleSetIsOpen, isOpen = _a.isOpen, _e = _a.saveDisabled, saveDisabled = _e === void 0 ? false : _e, saveLabel = _a.saveLabel, savePrefixIcon = _a.savePrefixIcon, _f = _a.saveRounded, saveRounded = _f === void 0 ? vista_button_type_1.VISTA_BUTTON_ROUNDED.MD : _f, _g = _a.saveSize, saveSize = _g === void 0 ? vista_button_type_1.VISTA_BUTTON_SIZE.MD : _g, saveSuffixIcon = _a.saveSuffixIcon, title = _a.title;
|
|
20
|
+
var _b = _a.cancelDisabled, cancelDisabled = _b === void 0 ? false : _b, cancelLabel = _a.cancelLabel, cancelPrefixIcon = _a.cancelPrefixIcon, _c = _a.cancelRounded, cancelRounded = _c === void 0 ? vista_button_type_1.VISTA_BUTTON_ROUNDED.MD : _c, _d = _a.cancelSize, cancelSize = _d === void 0 ? vista_button_type_1.VISTA_BUTTON_SIZE.MD : _d, cancelSuffixIcon = _a.cancelSuffixIcon, children = _a.children, description = _a.description, handleCancelOnClick = _a.handleCancelOnClick, handleSaveOnClick = _a.handleSaveOnClick, handleSetIsOpen = _a.handleSetIsOpen, isOpen = _a.isOpen, _e = _a.saveDisabled, saveDisabled = _e === void 0 ? false : _e, saveLabel = _a.saveLabel, savePrefixIcon = _a.savePrefixIcon, _f = _a.saveRounded, saveRounded = _f === void 0 ? vista_button_type_1.VISTA_BUTTON_ROUNDED.MD : _f, _g = _a.saveSize, saveSize = _g === void 0 ? vista_button_type_1.VISTA_BUTTON_SIZE.MD : _g, saveSuffixIcon = _a.saveSuffixIcon, _h = _a.size, size = _h === void 0 ? vista_drawer_type_1.VISTA_DRAWER_SIZE.MD : _h, title = _a.title;
|
|
14
21
|
return (react_1.default.createElement(react_2.Dialog, { open: isOpen, onClose: handleSetIsOpen, className: "relative z-10" },
|
|
15
22
|
react_1.default.createElement(react_2.DialogBackdrop, { transition: true, className: "fixed inset-0 bg-gray-500/75 transition-opacity duration-500 ease-in-out data-[closed]:opacity-0" }),
|
|
16
23
|
react_1.default.createElement("div", { className: "fixed inset-0" }),
|
|
17
24
|
react_1.default.createElement("div", { className: "fixed inset-0 overflow-hidden" },
|
|
18
25
|
react_1.default.createElement("div", { className: "absolute inset-0 overflow-hidden" },
|
|
19
26
|
react_1.default.createElement("div", { className: "pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10" },
|
|
20
|
-
react_1.default.createElement(react_2.DialogPanel, {
|
|
27
|
+
react_1.default.createElement(react_2.DialogPanel, { className: "pointer-events-auto w-screen transform transition duration-500 ease-in-out data-[closed]:translate-x-full sm:duration-700 ".concat(vistaDrawerSizeMap[size]), transition: true },
|
|
21
28
|
react_1.default.createElement("div", { className: "flex h-full flex-col divide-y divide-gray-200 bg-white shadow-xl" },
|
|
22
29
|
react_1.default.createElement("div", null,
|
|
23
30
|
react_1.default.createElement("div", { className: "flex min-h-0 flex-1 flex-col" },
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.VistaTextInputV1 = void 0;
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var VistaTextInputV1 = function (_a) {
|
|
10
|
+
var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnChange = _a.handleOnChange, id = _a.id, info = _a.info, label = _a.label, optional = _a.optional, placeholder = _a.placeholder, _e = _a.required, required = _e === void 0 ? false : _e, prefix = _a.prefix, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, suffix = _a.suffix, _g = _a.type, type = _g === void 0 ? 'text' : _g, value = _a.value;
|
|
11
|
+
return (react_1.default.createElement("div", null,
|
|
12
|
+
react_1.default.createElement("div", { className: "flex justify-between" },
|
|
13
|
+
react_1.default.createElement("div", { className: "flex items-center gap-2" },
|
|
14
|
+
react_1.default.createElement("label", { htmlFor: id, className: "block text-sm/6 font-medium text-gray-900 dark:text-white" }, label),
|
|
15
|
+
required && react_1.default.createElement("sup", { className: "text-red-500" }, "*")),
|
|
16
|
+
optional && (react_1.default.createElement("span", { id: "".concat(id, "-optional"), className: "text-sm/6 text-gray-500" }, optional))),
|
|
17
|
+
react_1.default.createElement("div", { className: "relative mt-2" },
|
|
18
|
+
prefix && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3" },
|
|
19
|
+
react_1.default.createElement("span", { className: "text-gray-500 sm:text-sm" }, prefix))),
|
|
20
|
+
react_1.default.createElement("input", { autoComplete: id, className: "block w-full rounded-md border-0 bg-white/5 dark:bg-white/5 py-1.5 text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-white/10 focus:ring-2 focus:ring-inset focus:ring-primary disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-300 disabled:ring-gray-200 sm:text-sm/6 dark:disabled:bg-gray-800 dark:disabled:text-gray-400 dark:disabled:ring-gray-700 placeholder:text-gray-500 ".concat(prefix && 'pl-7', " ").concat(className), id: id, disabled: disabled, name: id, onChange: function (e) {
|
|
21
|
+
return handleOnChange(id, e.target.value);
|
|
22
|
+
}, placeholder: placeholder, readOnly: readOnly, type: type, value: value, autoFocus: autoFocus }),
|
|
23
|
+
suffix && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" },
|
|
24
|
+
react_1.default.createElement("span", { id: "price-currency", className: "text-gray-500 sm:text-sm" }, suffix)))),
|
|
25
|
+
info && !error && (react_1.default.createElement("p", { id: "".concat(id, "-info"), className: "mt-2 text-sm text-indigo-500 dark:text-indigo-500" }, info)),
|
|
26
|
+
error && !info && (react_1.default.createElement("p", { id: "".concat(id, "-error"), className: "mt-2 text-sm text-red-500 dark:text-red-500" }, error))));
|
|
27
|
+
};
|
|
28
|
+
exports.VistaTextInputV1 = VistaTextInputV1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/app-corp-vista",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib",
|
|
6
6
|
"build:next": "next build",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@storybook/addon-interactions": "8.4.7",
|
|
47
47
|
"@storybook/addon-links": "8.4.7",
|
|
48
48
|
"@storybook/addon-onboarding": "^8.4.7",
|
|
49
|
+
"@storybook/addon-themes": "^8.4.7",
|
|
49
50
|
"@storybook/blocks": "8.4.7",
|
|
50
51
|
"@storybook/nextjs": "8.4.7",
|
|
51
52
|
"@storybook/react": "8.4.7",
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"husky": "^9.1.7",
|
|
68
69
|
"next": "^15.1.3",
|
|
69
70
|
"next-intl": "^3.26.3",
|
|
71
|
+
"next-themes": "^0.4.4",
|
|
70
72
|
"postcss": "^8",
|
|
71
73
|
"react": "^19.0.0",
|
|
72
74
|
"react-dom": "^19.0.0",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Providers = Providers;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var next_themes_1 = require("next-themes");
|
|
9
|
+
function Providers(_a) {
|
|
10
|
+
var children = _a.children;
|
|
11
|
+
return (react_1.default.createElement("main", { className: "font-primary" },
|
|
12
|
+
react_1.default.createElement(next_themes_1.ThemeProvider, { attribute: "class", defaultTheme: "light", enableSystem: true }, children)));
|
|
13
|
+
}
|
|
14
|
+
;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { VISTA_BUTTON_ROUNDED, VISTA_BUTTON_SIZE } from "./vista-button-type";
|
|
3
|
+
export declare enum VISTA_DRAWER_SIZE {
|
|
4
|
+
MD = "MD",
|
|
5
|
+
LG = "LG",
|
|
6
|
+
XL = "XL"
|
|
7
|
+
}
|
|
3
8
|
export interface VistaDrawerV1Props {
|
|
4
9
|
cancelDisabled?: boolean;
|
|
5
10
|
cancelLabel: string;
|
|
@@ -19,5 +24,6 @@ export interface VistaDrawerV1Props {
|
|
|
19
24
|
saveRounded: VISTA_BUTTON_ROUNDED;
|
|
20
25
|
saveSize: VISTA_BUTTON_SIZE;
|
|
21
26
|
saveSuffixIcon?: ReactNode;
|
|
27
|
+
size?: VISTA_DRAWER_SIZE;
|
|
22
28
|
title: string;
|
|
23
29
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VISTA_DRAWER_SIZE = void 0;
|
|
4
|
+
var VISTA_DRAWER_SIZE;
|
|
5
|
+
(function (VISTA_DRAWER_SIZE) {
|
|
6
|
+
VISTA_DRAWER_SIZE["MD"] = "MD";
|
|
7
|
+
VISTA_DRAWER_SIZE["LG"] = "LG";
|
|
8
|
+
VISTA_DRAWER_SIZE["XL"] = "XL";
|
|
9
|
+
})(VISTA_DRAWER_SIZE || (exports.VISTA_DRAWER_SIZE = VISTA_DRAWER_SIZE = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode, HTMLInputTypeAttribute } from "react";
|
|
2
|
+
export interface VistaTextInputV1Props {
|
|
3
|
+
autoFocus?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
handleOnChange: (k: string, v: string) => void;
|
|
8
|
+
id: string;
|
|
9
|
+
info?: string;
|
|
10
|
+
label: string;
|
|
11
|
+
optional?: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
prefix?: ReactNode;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
suffix?: ReactNode;
|
|
17
|
+
type?: HTMLInputTypeAttribute;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|