@dinofront/design_system 1.11.0 → 1.12.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.
|
@@ -4,8 +4,9 @@ interface SelectV2Translations {
|
|
|
4
4
|
noResults: string;
|
|
5
5
|
loadingMessage: string;
|
|
6
6
|
selectAllLabel: (count: number) => string;
|
|
7
|
-
|
|
7
|
+
clearAllLabel: (count: number) => string;
|
|
8
8
|
createLabel: (value: string) => string;
|
|
9
|
+
saveSelectionLabel: string;
|
|
9
10
|
}
|
|
10
11
|
export declare const SELECT_V2_TRANSLATIONS: Record<TranslationLocale, SelectV2Translations>;
|
|
11
12
|
export {};
|
|
@@ -66,6 +66,19 @@ export interface SelectV2BaseProps extends BaseProps, Partial<SelectV2ReactSelec
|
|
|
66
66
|
* `placeholder`/`emptyText`/`formatCreateLabel` props still take
|
|
67
67
|
* precedence over the translated defaults. Default `'en-US'`. */
|
|
68
68
|
locale?: TranslationLocale;
|
|
69
|
+
/** Enables a "save selection" checkbox pinned above the option list. When
|
|
70
|
+
* checked, the current selection is written to `localStorage` under this
|
|
71
|
+
* key and kept in sync on every subsequent change, until unchecked —
|
|
72
|
+
* which clears it. On mount, if the select is
|
|
73
|
+
* uncontrolled and a saved selection exists for this key, it's restored
|
|
74
|
+
* automatically, taking priority over `defaultValue`. When the select is
|
|
75
|
+
* controlled (`value` passed), saving/clearing still works but the saved
|
|
76
|
+
* value is never auto-restored into `value` — read it yourself if you
|
|
77
|
+
* need that. */
|
|
78
|
+
storageKey?: string;
|
|
79
|
+
/** Label for the "save selection" checkbox row. Defaults to a translated
|
|
80
|
+
* built-in string. */
|
|
81
|
+
saveSelectionLabel?: ReactNode;
|
|
69
82
|
id?: string;
|
|
70
83
|
className?: string;
|
|
71
84
|
wrapperClassName?: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClassNamesConfig, GroupBase } from 'react-select';
|
|
2
|
+
import { SelectV2Option, SelectV2Size } from './SelectV2.types';
|
|
3
|
+
export declare const MULTI_VALUE_CLASS = "flex items-center gap-1 rounded-md bg-bg-subtle pl-2 pr-1 py-0.5 max-w-full";
|
|
4
|
+
export declare const MULTI_VALUE_LABEL_CLASS = "truncate text-p-sm text-fg-default";
|
|
5
|
+
export declare const MULTI_VALUE_REMOVE_CLASS = "rounded-sm text-fg-secondary hover:bg-bg-container hover:text-fg-default cursor-pointer";
|
|
6
|
+
export declare const MULTI_VALUE_BADGE_CLASS = "flex items-center rounded-md bg-bg-info-lighter px-2 py-0.5 text-p-sm text-blue-800 dark:text-blue-300 shrink-0";
|
|
7
|
+
export declare function optionLabelText(option: SelectV2Option): string;
|
|
8
|
+
export declare function matchesSearch(option: SelectV2Option, inputValue: string): boolean;
|
|
9
|
+
export declare function readStoredSelection(storageKey: string): unknown;
|
|
10
|
+
export declare function hasStoredSelection(storageKey: string): boolean;
|
|
11
|
+
export declare function writeStoredSelection(storageKey: string, value: unknown): void;
|
|
12
|
+
export declare function clearStoredSelection(storageKey: string): void;
|
|
13
|
+
export declare function buildClassNames(size: SelectV2Size, hasError: boolean, singleLine: boolean): ClassNamesConfig<SelectV2Option, boolean, GroupBase<SelectV2Option>>;
|