@appcorp/app-corp-vista 0.0.4 → 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.
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { VistaTextInputV1Props } from '../type/vista-text-input-type';
3
+ export declare const VistaTextInputV1: FC<VistaTextInputV1Props>;
@@ -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.4",
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,4 @@
1
+ import React, { ReactNode } from 'react';
2
+ export declare function Providers({ children }: {
3
+ children: ReactNode;
4
+ }): React.JSX.Element;
@@ -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
+ ;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });