@pallasoft/ps-internal-components 1.1.0 → 1.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.
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { PsSearchInputProps } from '../models/ps-search-input-props.js';
3
+ export declare const PsSearchInput: React.ForwardRefExoticComponent<Omit<PsSearchInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PsSearchInput = void 0;
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const React = __importStar(require("react"));
39
+ const lucide_react_1 = require("lucide-react");
40
+ const ps_class_name_service_js_1 = require("../services/ps-class-name-service.js");
41
+ const ps_input_group_js_1 = require("./ps-input-group.js");
42
+ const ps_skeleton_js_1 = require("./ps-skeleton.js");
43
+ const ps_spinner_js_1 = require("./ps-spinner.js");
44
+ exports.PsSearchInput = React.forwardRef(({ className, isLoading = false, isBusy = false, ...props }, ref) => {
45
+ if (isLoading)
46
+ return ((0, jsx_runtime_1.jsx)(ps_skeleton_js_1.PsSkeleton, { className: ps_class_name_service_js_1.PsClassNameService.merge('h-9 w-full rounded-md', className) }));
47
+ return ((0, jsx_runtime_1.jsx)(ps_input_group_js_1.PsInputGroup, { prefix: (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { "aria-hidden": 'true' }), suffix: isBusy ? (0, jsx_runtime_1.jsx)(ps_spinner_js_1.PsSpinner, { className: 'size-4' }) : null, className: className, children: (0, jsx_runtime_1.jsx)("input", { ref: ref, type: 'search', className: 'h-full w-full min-w-0 rounded-none border-0 bg-transparent px-3 py-0 text-base shadow-none outline-none placeholder:text-muted-foreground focus-visible:ring-0 disabled:cursor-not-allowed md:text-sm', ...props }) }));
48
+ });
49
+ exports.PsSearchInput.displayName = 'PsSearchInput';
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Search } from 'lucide-react';
4
+ import { PsClassNameService } from '../services/ps-class-name-service.js';
5
+ import { PsInputGroup } from './ps-input-group.js';
6
+ import { PsSkeleton } from './ps-skeleton.js';
7
+ import { PsSpinner } from './ps-spinner.js';
8
+ export const PsSearchInput = React.forwardRef(({ className, isLoading = false, isBusy = false, ...props }, ref) => {
9
+ if (isLoading)
10
+ return (_jsx(PsSkeleton, { className: PsClassNameService.merge('h-9 w-full rounded-md', className) }));
11
+ return (_jsx(PsInputGroup, { prefix: _jsx(Search, { "aria-hidden": 'true' }), suffix: isBusy ? _jsx(PsSpinner, { className: 'size-4' }) : null, className: className, children: _jsx("input", { ref: ref, type: 'search', className: 'h-full w-full min-w-0 rounded-none border-0 bg-transparent px-3 py-0 text-base shadow-none outline-none placeholder:text-muted-foreground focus-visible:ring-0 disabled:cursor-not-allowed md:text-sm', ...props }) }));
12
+ });
13
+ PsSearchInput.displayName = 'PsSearchInput';
package/dist/esm/index.js CHANGED
@@ -114,6 +114,7 @@ export * from './components/ps-radio-group.js';
114
114
  export * from './components/ps-root-error.js';
115
115
  export * from './components/ps-scroll-area.js';
116
116
  export * from './components/ps-scroll-bar.js';
117
+ export * from './components/ps-search-input.js';
117
118
  export * from './components/ps-select-content.js';
118
119
  export * from './components/ps-select-group.js';
119
120
  export * from './components/ps-select-item.js';
@@ -305,6 +306,7 @@ export * from './models/ps-radio-group-props.js';
305
306
  export * from './models/ps-root-error-props.js';
306
307
  export * from './models/ps-scroll-area-props.js';
307
308
  export * from './models/ps-scroll-bar-props.js';
309
+ export * from './models/ps-search-input-props.js';
308
310
  export * from './models/ps-select-content-props.js';
309
311
  export * from './models/ps-select-item-props.js';
310
312
  export * from './models/ps-select-label-props.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"type":"module"}
package/dist/index.d.ts CHANGED
@@ -114,6 +114,7 @@ export * from './components/ps-radio-group.js';
114
114
  export * from './components/ps-root-error.js';
115
115
  export * from './components/ps-scroll-area.js';
116
116
  export * from './components/ps-scroll-bar.js';
117
+ export * from './components/ps-search-input.js';
117
118
  export * from './components/ps-select-content.js';
118
119
  export * from './components/ps-select-group.js';
119
120
  export * from './components/ps-select-item.js';
@@ -305,6 +306,7 @@ export * from './models/ps-radio-group-props.js';
305
306
  export * from './models/ps-root-error-props.js';
306
307
  export * from './models/ps-scroll-area-props.js';
307
308
  export * from './models/ps-scroll-bar-props.js';
309
+ export * from './models/ps-search-input-props.js';
308
310
  export * from './models/ps-select-content-props.js';
309
311
  export * from './models/ps-select-item-props.js';
310
312
  export * from './models/ps-select-label-props.js';
package/dist/index.js CHANGED
@@ -130,6 +130,7 @@ __exportStar(require("./components/ps-radio-group.js"), exports);
130
130
  __exportStar(require("./components/ps-root-error.js"), exports);
131
131
  __exportStar(require("./components/ps-scroll-area.js"), exports);
132
132
  __exportStar(require("./components/ps-scroll-bar.js"), exports);
133
+ __exportStar(require("./components/ps-search-input.js"), exports);
133
134
  __exportStar(require("./components/ps-select-content.js"), exports);
134
135
  __exportStar(require("./components/ps-select-group.js"), exports);
135
136
  __exportStar(require("./components/ps-select-item.js"), exports);
@@ -321,6 +322,7 @@ __exportStar(require("./models/ps-radio-group-props.js"), exports);
321
322
  __exportStar(require("./models/ps-root-error-props.js"), exports);
322
323
  __exportStar(require("./models/ps-scroll-area-props.js"), exports);
323
324
  __exportStar(require("./models/ps-scroll-bar-props.js"), exports);
325
+ __exportStar(require("./models/ps-search-input-props.js"), exports);
324
326
  __exportStar(require("./models/ps-select-content-props.js"), exports);
325
327
  __exportStar(require("./models/ps-select-item-props.js"), exports);
326
328
  __exportStar(require("./models/ps-select-label-props.js"), exports);
@@ -0,0 +1,4 @@
1
+ import type { PsFieldInputProps } from './ps-field-input-props.js';
2
+ export interface PsSearchInputProps extends PsFieldInputProps {
3
+ isBusy?: boolean;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-internal-components",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "Shared Pallasoft internal UI: app header, app switcher and shadcn primitives for staff tools",
6
6
  "main": "./dist/index.js",
@@ -12,6 +12,7 @@
12
12
  "exports": {
13
13
  ".": {
14
14
  "types": "./dist/index.d.ts",
15
+ "import": "./dist/esm/index.js",
15
16
  "module": "./dist/esm/index.js",
16
17
  "require": "./dist/index.js",
17
18
  "default": "./dist/index.js"
@@ -19,6 +20,7 @@
19
20
  "./theme.css": "./src/styles/theme.css",
20
21
  "./tailwind-preset": {
21
22
  "types": "./dist/pallasoft-internal-tailwind-preset.d.ts",
23
+ "import": "./dist/esm/pallasoft-internal-tailwind-preset.js",
22
24
  "module": "./dist/esm/pallasoft-internal-tailwind-preset.js",
23
25
  "require": "./dist/pallasoft-internal-tailwind-preset.js",
24
26
  "default": "./dist/pallasoft-internal-tailwind-preset.js"
@@ -30,7 +32,7 @@
30
32
  ],
31
33
  "scripts": {
32
34
  "husky:prepare": "npx husky",
33
- "build": "tsc && tsc -p tsconfig.esm.json",
35
+ "build": "tsc && tsc -p tsconfig.esm.json && node -e \"require('fs').writeFileSync('dist/esm/package.json', JSON.stringify({ type: 'module' }))\"",
34
36
  "setup:graphify": "sh scripts/graphify-setup.sh",
35
37
  "update:graphify": "sh scripts/graphify-update.sh",
36
38
  "lint": "npm run lint:eslint",