@dinofront/design_system 1.4.1 → 1.5.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.
- package/dist/components/SelectV2/SelectV2.i18n.d.ts +10 -0
- package/dist/components/SelectV2/SelectV2.types.d.ts +9 -1
- package/dist/components/SelectV2/useVisibleTagCount.d.ts +21 -0
- package/dist/components/TableV2/TableV2.types.d.ts +1 -0
- package/dist/components/TableV2/index.d.ts +1 -1
- package/dist/index.js +1356 -1236
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/locale.d.ts +3 -0
- package/package.json +4 -16
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TranslationLocale } from '../../types';
|
|
2
|
+
interface SelectV2Translations {
|
|
3
|
+
placeholder: string;
|
|
4
|
+
noResults: string;
|
|
5
|
+
loadingMessage: string;
|
|
6
|
+
selectAllLabel: (count: number) => string;
|
|
7
|
+
createLabel: (value: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SELECT_V2_TRANSLATIONS: Record<TranslationLocale, SelectV2Translations>;
|
|
10
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseProps, OptionValue } from '../../types';
|
|
2
|
+
import { BaseProps, OptionValue, TranslationLocale } from '../../types';
|
|
3
3
|
export type SelectV2Size = 'sm' | 'md' | 'lg';
|
|
4
4
|
export interface SelectV2Option {
|
|
5
5
|
value: OptionValue;
|
|
@@ -56,6 +56,11 @@ export interface SelectV2BaseProps extends BaseProps {
|
|
|
56
56
|
virtualized?: boolean;
|
|
57
57
|
/** Shown when the list is empty (no matches, or nothing loaded yet). Defaults to `'No results'`. */
|
|
58
58
|
emptyText?: string;
|
|
59
|
+
/** Language for built-in strings ("Select all", "No results", the async
|
|
60
|
+
* loading message, and the default create-option label). Explicit
|
|
61
|
+
* `placeholder`/`emptyText`/`formatCreateLabel` props still take
|
|
62
|
+
* precedence over the translated defaults. Default `'en-US'`. */
|
|
63
|
+
locale?: TranslationLocale;
|
|
59
64
|
id?: string;
|
|
60
65
|
className?: string;
|
|
61
66
|
wrapperClassName?: string;
|
|
@@ -70,4 +75,7 @@ export type SelectV2Props = (SelectV2BaseProps & {
|
|
|
70
75
|
value?: OptionValue[];
|
|
71
76
|
defaultValue?: OptionValue[];
|
|
72
77
|
onChange?: (values: OptionValue[]) => void;
|
|
78
|
+
/** Keeps selected chips on a single line instead of wrapping, collapsing
|
|
79
|
+
* whatever doesn't fit into a trailing "+N" badge. Default `false`. */
|
|
80
|
+
singleLine?: boolean;
|
|
73
81
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface UseVisibleTagCountOptions {
|
|
3
|
+
/** Element to search within for the live value-container node
|
|
4
|
+
* (marked with `.sv2-value-container`). */
|
|
5
|
+
wrapperRef: RefObject<HTMLElement | null>;
|
|
6
|
+
/** Hidden row rendering one measuring chip per selected option plus a
|
|
7
|
+
* measuring badge, mirroring the real chip/badge markup exactly. */
|
|
8
|
+
measureRef: RefObject<HTMLElement | null>;
|
|
9
|
+
total: number;
|
|
10
|
+
/** Joined label text — changes whenever the rendered chip content would
|
|
11
|
+
* change, so a recompute is triggered even if `total` stays the same. */
|
|
12
|
+
labelsKey: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Computes how many multi-value chips fit on one line of the live control,
|
|
16
|
+
* reserving room for a trailing "+N" badge, by measuring a hidden mirror
|
|
17
|
+
* row against the real value-container's content-box width. Recomputes on
|
|
18
|
+
* container resize and whenever the selection changes. Returns `undefined`
|
|
19
|
+
* when disabled, meaning "show every chip" (default, unrestricted). */
|
|
20
|
+
export declare function useVisibleTagCount({ wrapperRef, measureRef, total, labelsKey, enabled, }: UseVisibleTagCountOptions): number | undefined;
|
|
21
|
+
export {};
|
|
@@ -30,6 +30,7 @@ export interface TableV2RowAction<TData> {
|
|
|
30
30
|
destructive?: boolean;
|
|
31
31
|
disabled?: (row: TData) => boolean;
|
|
32
32
|
}
|
|
33
|
+
export type { Column, ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnResizeMode, OnChangeFn, PaginationState, Row, RowSelectionState, SortingState, VisibilityState, } from '@tanstack/react-table';
|
|
33
34
|
export interface TableV2Props<TData, TValue = unknown> extends BaseProps {
|
|
34
35
|
data: TData[];
|
|
35
36
|
columns: ColumnDef<TData, TValue>[];
|
|
@@ -6,4 +6,4 @@ export { TableV2ColumnVisibilityMenu } from './TableV2ColumnVisibility';
|
|
|
6
6
|
export { TableV2Toolbar } from './TableV2Toolbar';
|
|
7
7
|
export { TableV2Pagination } from './TableV2Pagination';
|
|
8
8
|
export { TableV2Skeleton } from './TableV2Skeleton';
|
|
9
|
-
export type { TableV2Align, TableV2Density, TableV2FilterOption, TableV2FilterVariant, TableV2Props, TableV2RowAction, } from './TableV2.types';
|
|
9
|
+
export type { TableV2Align, TableV2Density, TableV2FilterOption, TableV2FilterVariant, TableV2Props, TableV2RowAction, Column, ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnResizeMode, OnChangeFn, PaginationState, Row, RowSelectionState, SortingState, VisibilityState, } from './TableV2.types';
|