@dinofront/design_system 1.2.1 → 1.2.2
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/Accordion/Accordion.types.d.ts +7 -7
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +8 -6
- package/dist/components/Radio/Radio.types.d.ts +13 -6
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +5 -5
- package/dist/components/Tabs/Tabs.types.d.ts +7 -7
- package/dist/hooks/useOnOutsideClick.d.ts +1 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +989 -977
- package/dist/index.js.map +1 -1
- package/dist/lib/optionValue.d.ts +10 -0
- package/dist/types/base.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OptionValue } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two option/radio values for equality the same way every
|
|
4
|
+
* component in this library does: coerced to `String(...)` first, since
|
|
5
|
+
* `OptionValue` (and `RadioValue`, which adds `boolean`) may mix strings and
|
|
6
|
+
* numbers. `undefined` never equals anything, including another `undefined`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isSameOptionValue: (a: OptionValue | boolean | undefined, b: OptionValue | boolean | undefined) => boolean;
|
|
9
|
+
/** Whether `v` is present in `list`, compared via `isSameOptionValue`. */
|
|
10
|
+
export declare const includesOptionValue: (list: readonly (OptionValue | boolean)[], v: OptionValue | boolean) => boolean;
|
package/dist/types/base.d.ts
CHANGED
|
@@ -3,3 +3,11 @@ export interface BaseProps {
|
|
|
3
3
|
/** Rendered as `data-test-id` for test selectors. */
|
|
4
4
|
dataTestId?: string;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* An option/item identity that can be a string or a number — compared
|
|
8
|
+
* internally via `String(...)`. Note: values are compared via `String(...)`,
|
|
9
|
+
* so within one options array a numeric `1` and a string `'1'` are treated
|
|
10
|
+
* as the same option — don't mix the two representations for what should be
|
|
11
|
+
* distinct options.
|
|
12
|
+
*/
|
|
13
|
+
export type OptionValue = string | number;
|