@appcorp/shadcn 1.1.92 → 1.1.94

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.
@@ -1,24 +1,22 @@
1
1
  import React from "react";
2
- interface UseEnhancedComboboxProps<T extends {
3
- id: string;
4
- name: string;
5
- }> {
2
+ interface UseEnhancedComboboxProps {
6
3
  emptyText?: string;
4
+ error?: string;
7
5
  id: string;
8
6
  info: string;
9
7
  label: string;
10
8
  onValueChange: (value: string) => void;
11
- options: T[];
9
+ options: {
10
+ label: string;
11
+ value: string;
12
+ }[];
12
13
  placeholder: string;
13
14
  required?: boolean;
14
15
  searchEndpoint: string;
15
16
  searchPlaceholder?: string;
16
17
  value: string;
17
18
  }
18
- export declare const useEnhancedCombobox: <T extends {
19
- id: string;
20
- name: string;
21
- }>({ emptyText, id, info, label, onValueChange, options, placeholder, required, searchEndpoint, searchPlaceholder, value, }: UseEnhancedComboboxProps<T>) => {
19
+ export declare const useEnhancedCombobox: ({ emptyText, error, id, info, label, onValueChange, options, placeholder, required, searchEndpoint, searchPlaceholder, value, }: UseEnhancedComboboxProps) => {
22
20
  enhancedComboboxElement: React.JSX.Element;
23
21
  };
24
22
  export {};
@@ -76,7 +76,7 @@ var api_methods_1 = require("@react-pakistan/util-functions/constants/api-method
76
76
  var use_debounce_1 = require("@react-pakistan/util-functions/hooks/use-debounce");
77
77
  var enhanced_combobox_1 = require("../components/enhanced-combobox");
78
78
  var useEnhancedCombobox = function (_a) {
79
- var emptyText = _a.emptyText, id = _a.id, info = _a.info, label = _a.label, onValueChange = _a.onValueChange, options = _a.options, placeholder = _a.placeholder, required = _a.required, searchEndpoint = _a.searchEndpoint, searchPlaceholder = _a.searchPlaceholder, value = _a.value;
79
+ var emptyText = _a.emptyText, error = _a.error, id = _a.id, info = _a.info, label = _a.label, onValueChange = _a.onValueChange, options = _a.options, placeholder = _a.placeholder, required = _a.required, searchEndpoint = _a.searchEndpoint, searchPlaceholder = _a.searchPlaceholder, value = _a.value;
80
80
  var _b = (0, react_1.useState)(""), searchQuery = _b[0], setSearchQuery = _b[1];
81
81
  var _c = (0, react_1.useState)([]), searchOptions = _c[0], setSearchOptions = _c[1];
82
82
  var _d = (0, react_1.useState)(false), loading = _d[0], setLoading = _d[1];
@@ -119,15 +119,16 @@ var useEnhancedCombobox = function (_a) {
119
119
  var mappedOptions = (0, react_1.useMemo)(function () {
120
120
  var opts = searchOptions.length > 0 ? searchOptions : options;
121
121
  return ((opts === null || opts === void 0 ? void 0 : opts.map(function (category) { return ({
122
- label: category.name,
123
- value: category.id,
122
+ label: category.label,
123
+ value: category.value,
124
124
  }); })) || []);
125
125
  }, [searchOptions, options]);
126
126
  var handleSearchChange = (0, react_1.useCallback)(function (query) {
127
127
  setSearchQuery(query);
128
128
  }, []);
129
- var enhancedComboboxElement = (0, react_1.useMemo)(function () { return (react_1.default.createElement(enhanced_combobox_1.EnhancedCombobox, { emptyText: emptyText, id: id, info: info, label: label, loading: loading, onSearchChange: handleSearchChange, onValueChange: onValueChange, options: mappedOptions, placeholder: placeholder, required: required, searchPlaceholder: searchPlaceholder, value: value })); }, [
129
+ var enhancedComboboxElement = (0, react_1.useMemo)(function () { return (react_1.default.createElement(enhanced_combobox_1.EnhancedCombobox, { emptyText: emptyText, error: error, id: id, info: info, label: label, loading: loading, onSearchChange: handleSearchChange, onValueChange: onValueChange, options: mappedOptions, placeholder: placeholder, required: required, searchPlaceholder: searchPlaceholder, value: value })); }, [
130
130
  emptyText,
131
+ error,
131
132
  handleSearchChange,
132
133
  id,
133
134
  info,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/shadcn",
3
- "version": "1.1.92",
3
+ "version": "1.1.94",
4
4
  "scripts": {
5
5
  "build:next": "next build",
6
6
  "build:storybook": "mv ../.pnp.cjs ../.pnp.cjs.bak 2>/dev/null || true && storybook build -c .storybook -o .out && mv ../.pnp.cjs.bak ../.pnp.cjs 2>/dev/null || true",