@juspay/blend-design-system 0.0.28-beta → 0.0.28
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/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelectMenu.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelectTrigger.d.ts +1 -1
- package/dist/components/MultiSelect/types.d.ts +6 -0
- package/dist/components/Select/selectUtils.d.ts +29 -0
- package/dist/components/SingleSelect/SingleSelect.d.ts +1 -1
- package/dist/components/SingleSelect/SingleSelectMenu.d.ts +3 -1
- package/dist/components/SingleSelect/types.d.ts +2 -0
- package/dist/main.js +15289 -15162
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MultiSelectProps } from './types';
|
|
2
|
-
declare const MultiSelect: ({ selectedValues, onChange, items, label, sublabel, disabled, helpIconHintText, name, required, variant, selectionTagType, slot, hintText, placeholder, size, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, customTrigger, useDrawerOnMobile, minMenuWidth, maxMenuWidth, maxMenuHeight, alignment, side, sideOffset, alignOffset, inline, onBlur, onFocus, error, errorMessage, showActionButtons, primaryAction, secondaryAction, showItemDividers, showHeaderBorder, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, itemsToRender, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MultiSelect: ({ selectedValues, onChange, items, label, sublabel, disabled, helpIconHintText, name, required, variant, selectionTagType, slot, hintText, placeholder, size, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, customTrigger, useDrawerOnMobile, minMenuWidth, maxMenuWidth, maxMenuHeight, alignment, side, sideOffset, alignOffset, inline, onBlur, onFocus, error, errorMessage, showActionButtons, primaryAction, secondaryAction, showItemDividers, showHeaderBorder, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, itemsToRender, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MultiSelect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MultiSelectMenuProps } from './types';
|
|
2
|
-
declare const MultiSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, disabled, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, onSelectAll, alignment, side, sideOffset, alignOffset, open, onOpenChange, showActionButtons, primaryAction, secondaryAction, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, skeleton, }: MultiSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MultiSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, disabled, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, onSelectAll, alignment, side, sideOffset, alignOffset, open, onOpenChange, showActionButtons, primaryAction, secondaryAction, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, skeleton, size, variant, allowCustomValue, customValueLabel, }: MultiSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MultiSelectMenu;
|
|
@@ -23,5 +23,5 @@ export type MultiSelectTriggerProps = {
|
|
|
23
23
|
maxTriggerWidth?: number;
|
|
24
24
|
minTriggerWidth?: number;
|
|
25
25
|
};
|
|
26
|
-
declare const MultiSelectTrigger: ({ selectedValues, slot, variant, size, isSmallScreen, onChange, name, label, placeholder, required,
|
|
26
|
+
declare const MultiSelectTrigger: ({ selectedValues, slot, variant, size, isSmallScreen, onChange, name, label, placeholder, required, open, onClick, multiSelectTokens, inline, error, disabled, maxTriggerWidth, minTriggerWidth, }: MultiSelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export default MultiSelectTrigger;
|
|
@@ -120,6 +120,8 @@ export type MultiSelectProps = {
|
|
|
120
120
|
show?: boolean;
|
|
121
121
|
variant?: SkeletonVariant;
|
|
122
122
|
};
|
|
123
|
+
allowCustomValue?: boolean;
|
|
124
|
+
customValueLabel?: string;
|
|
123
125
|
};
|
|
124
126
|
export type MultiSelectMenuProps = {
|
|
125
127
|
items: MultiSelectMenuGroupType[];
|
|
@@ -168,4 +170,8 @@ export type MultiSelectMenuProps = {
|
|
|
168
170
|
show?: boolean;
|
|
169
171
|
variant?: SkeletonVariant;
|
|
170
172
|
};
|
|
173
|
+
size?: MultiSelectMenuSize;
|
|
174
|
+
variant?: MultiSelectVariant;
|
|
175
|
+
allowCustomValue?: boolean;
|
|
176
|
+
customValueLabel?: string;
|
|
171
177
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type BaseMenuItemType = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
subMenu?: BaseMenuItemType[];
|
|
5
|
+
};
|
|
6
|
+
type BaseMenuGroupType<T extends BaseMenuItemType = BaseMenuItemType> = {
|
|
7
|
+
groupLabel?: string;
|
|
8
|
+
items: T[];
|
|
9
|
+
showSeparator?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Checks if the search text exactly matches any existing item's label or value
|
|
13
|
+
* @param searchText - The text to search for
|
|
14
|
+
* @param groups - Array of menu groups to search in
|
|
15
|
+
* @returns true if an exact match is found, false otherwise
|
|
16
|
+
*/
|
|
17
|
+
export declare const hasExactMatch: <T extends BaseMenuItemType>(searchText: string, groups: BaseMenuGroupType<T>[]) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns filtered items with optional custom value item appended
|
|
20
|
+
* @param baseFilteredItems - Already filtered items
|
|
21
|
+
* @param searchText - Current search text
|
|
22
|
+
* @param hasMatch - Whether an exact match exists
|
|
23
|
+
* @param allowCustomValue - Whether custom values are allowed
|
|
24
|
+
* @param enableSearch - Whether search is enabled
|
|
25
|
+
* @param customValueLabel - Label prefix for custom value (default: "Specify")
|
|
26
|
+
* @returns Filtered groups with custom value item if applicable
|
|
27
|
+
*/
|
|
28
|
+
export declare const getFilteredItemsWithCustomValue: <T extends BaseMenuItemType, G extends BaseMenuGroupType<T> = BaseMenuGroupType<T>>(baseFilteredItems: G[], searchText: string, hasMatch: boolean, allowCustomValue: boolean, enableSearch: boolean, customValueLabel?: string) => G[];
|
|
29
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SingleSelectProps } from './types';
|
|
2
|
-
declare const SingleSelect: ({ label, subLabel, hintText, required, helpIconText, placeholder, error, errorMessage, size, items, name, variant, disabled, selected, onSelect, enableSearch, searchPlaceholder, slot, customTrigger, useDrawerOnMobile, alignment, side, sideOffset, alignOffset, minMenuWidth, maxMenuWidth, maxMenuHeight, onBlur, onFocus, inline, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const SingleSelect: ({ label, subLabel, hintText, required, helpIconText, placeholder, error, errorMessage, size, items, name, variant, disabled, selected, onSelect, enableSearch, searchPlaceholder, slot, customTrigger, useDrawerOnMobile, alignment, side, sideOffset, alignOffset, minMenuWidth, maxMenuWidth, maxMenuHeight, onBlur, onFocus, inline, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default SingleSelect;
|
|
@@ -33,6 +33,8 @@ type SingleSelectMenuProps = {
|
|
|
33
33
|
show?: boolean;
|
|
34
34
|
variant?: SkeletonVariant;
|
|
35
35
|
};
|
|
36
|
+
allowCustomValue?: boolean;
|
|
37
|
+
customValueLabel?: string;
|
|
36
38
|
};
|
|
37
|
-
declare const SingleSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, enableSearch, searchPlaceholder, disabled, alignment, side, sideOffset, alignOffset, open, onOpenChange, size, variant, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, skeleton, }: SingleSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare const SingleSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, enableSearch, searchPlaceholder, disabled, alignment, side, sideOffset, alignOffset, open, onOpenChange, size, variant, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, skeleton, allowCustomValue, customValueLabel, }: SingleSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
40
|
export default SingleSelectMenu;
|