@salt-ds/lab 1.0.0-alpha.36 → 1.0.0-alpha.38

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.
Files changed (109) hide show
  1. package/css/salt-lab.css +27 -400
  2. package/dist-cjs/calendar/internal/CalendarNavigation.js +4 -8
  3. package/dist-cjs/calendar/internal/CalendarNavigation.js.map +1 -1
  4. package/dist-cjs/combo-box/useCombobox.js.map +1 -1
  5. package/dist-cjs/index.js +2 -8
  6. package/dist-cjs/index.js.map +1 -1
  7. package/dist-cjs/segmented-button-group/SegmentedButtonGroup.css.js +6 -0
  8. package/dist-cjs/segmented-button-group/SegmentedButtonGroup.css.js.map +1 -0
  9. package/dist-cjs/segmented-button-group/SegmentedButtonGroup.js +30 -0
  10. package/dist-cjs/segmented-button-group/SegmentedButtonGroup.js.map +1 -0
  11. package/dist-cjs/tabs-next/TabstripNext.css.js +1 -1
  12. package/dist-es/calendar/internal/CalendarNavigation.js +3 -7
  13. package/dist-es/calendar/internal/CalendarNavigation.js.map +1 -1
  14. package/dist-es/combo-box/useCombobox.js.map +1 -1
  15. package/dist-es/index.js +1 -4
  16. package/dist-es/index.js.map +1 -1
  17. package/dist-es/segmented-button-group/SegmentedButtonGroup.css.js +4 -0
  18. package/dist-es/segmented-button-group/SegmentedButtonGroup.css.js.map +1 -0
  19. package/dist-es/segmented-button-group/SegmentedButtonGroup.js +26 -0
  20. package/dist-es/segmented-button-group/SegmentedButtonGroup.js.map +1 -0
  21. package/dist-es/tabs-next/TabstripNext.css.js +1 -1
  22. package/dist-types/calendar/internal/CalendarNavigation.d.ts +2 -3
  23. package/dist-types/index.d.ts +1 -3
  24. package/dist-types/segmented-button-group/SegmentedButtonGroup.d.ts +4 -0
  25. package/dist-types/segmented-button-group/index.d.ts +1 -0
  26. package/package.json +2 -2
  27. package/dist-cjs/combo-box-next/ComboBoxNext.css.js +0 -6
  28. package/dist-cjs/combo-box-next/ComboBoxNext.css.js.map +0 -1
  29. package/dist-cjs/combo-box-next/ComboBoxNext.js +0 -366
  30. package/dist-cjs/combo-box-next/ComboBoxNext.js.map +0 -1
  31. package/dist-cjs/combo-box-next/useComboBoxNext.js +0 -68
  32. package/dist-cjs/combo-box-next/useComboBoxNext.js.map +0 -1
  33. package/dist-cjs/dropdown-next/DropdownNext.css.js +0 -6
  34. package/dist-cjs/dropdown-next/DropdownNext.css.js.map +0 -1
  35. package/dist-cjs/dropdown-next/DropdownNext.js +0 -335
  36. package/dist-cjs/dropdown-next/DropdownNext.js.map +0 -1
  37. package/dist-cjs/list-control/ListControlContext.js +0 -38
  38. package/dist-cjs/list-control/ListControlContext.js.map +0 -1
  39. package/dist-cjs/list-control/ListControlState.js +0 -192
  40. package/dist-cjs/list-control/ListControlState.js.map +0 -1
  41. package/dist-cjs/option/Option.css.js +0 -6
  42. package/dist-cjs/option/Option.css.js.map +0 -1
  43. package/dist-cjs/option/Option.js +0 -99
  44. package/dist-cjs/option/Option.js.map +0 -1
  45. package/dist-cjs/option/OptionGroup.css.js +0 -6
  46. package/dist-cjs/option/OptionGroup.css.js.map +0 -1
  47. package/dist-cjs/option/OptionGroup.js +0 -44
  48. package/dist-cjs/option/OptionGroup.js.map +0 -1
  49. package/dist-cjs/option/OptionList.css.js +0 -6
  50. package/dist-cjs/option/OptionList.css.js.map +0 -1
  51. package/dist-cjs/option/OptionList.js +0 -40
  52. package/dist-cjs/option/OptionList.js.map +0 -1
  53. package/dist-cjs/pill-input/PillInput.css.js +0 -6
  54. package/dist-cjs/pill-input/PillInput.css.js.map +0 -1
  55. package/dist-cjs/pill-input/PillInput.js +0 -256
  56. package/dist-cjs/pill-input/PillInput.js.map +0 -1
  57. package/dist-cjs/pill-input/useTruncatePills.js +0 -85
  58. package/dist-cjs/pill-input/useTruncatePills.js.map +0 -1
  59. package/dist-cjs/utils/useValueEffect.js +0 -40
  60. package/dist-cjs/utils/useValueEffect.js.map +0 -1
  61. package/dist-es/combo-box-next/ComboBoxNext.css.js +0 -4
  62. package/dist-es/combo-box-next/ComboBoxNext.css.js.map +0 -1
  63. package/dist-es/combo-box-next/ComboBoxNext.js +0 -362
  64. package/dist-es/combo-box-next/ComboBoxNext.js.map +0 -1
  65. package/dist-es/combo-box-next/useComboBoxNext.js +0 -64
  66. package/dist-es/combo-box-next/useComboBoxNext.js.map +0 -1
  67. package/dist-es/dropdown-next/DropdownNext.css.js +0 -4
  68. package/dist-es/dropdown-next/DropdownNext.css.js.map +0 -1
  69. package/dist-es/dropdown-next/DropdownNext.js +0 -331
  70. package/dist-es/dropdown-next/DropdownNext.js.map +0 -1
  71. package/dist-es/list-control/ListControlContext.js +0 -33
  72. package/dist-es/list-control/ListControlContext.js.map +0 -1
  73. package/dist-es/list-control/ListControlState.js +0 -187
  74. package/dist-es/list-control/ListControlState.js.map +0 -1
  75. package/dist-es/option/Option.css.js +0 -4
  76. package/dist-es/option/Option.css.js.map +0 -1
  77. package/dist-es/option/Option.js +0 -95
  78. package/dist-es/option/Option.js.map +0 -1
  79. package/dist-es/option/OptionGroup.css.js +0 -4
  80. package/dist-es/option/OptionGroup.css.js.map +0 -1
  81. package/dist-es/option/OptionGroup.js +0 -40
  82. package/dist-es/option/OptionGroup.js.map +0 -1
  83. package/dist-es/option/OptionList.css.js +0 -4
  84. package/dist-es/option/OptionList.css.js.map +0 -1
  85. package/dist-es/option/OptionList.js +0 -36
  86. package/dist-es/option/OptionList.js.map +0 -1
  87. package/dist-es/pill-input/PillInput.css.js +0 -4
  88. package/dist-es/pill-input/PillInput.css.js.map +0 -1
  89. package/dist-es/pill-input/PillInput.js +0 -252
  90. package/dist-es/pill-input/PillInput.js.map +0 -1
  91. package/dist-es/pill-input/useTruncatePills.js +0 -81
  92. package/dist-es/pill-input/useTruncatePills.js.map +0 -1
  93. package/dist-es/utils/useValueEffect.js +0 -36
  94. package/dist-es/utils/useValueEffect.js.map +0 -1
  95. package/dist-types/combo-box-next/ComboBoxNext.d.ts +0 -17
  96. package/dist-types/combo-box-next/index.d.ts +0 -1
  97. package/dist-types/combo-box-next/useComboBoxNext.d.ts +0 -30
  98. package/dist-types/dropdown-next/DropdownNext.d.ts +0 -99
  99. package/dist-types/dropdown-next/index.d.ts +0 -1
  100. package/dist-types/list-control/ListControlContext.d.ts +0 -21
  101. package/dist-types/list-control/ListControlState.d.ts +0 -70
  102. package/dist-types/option/Option.d.ts +0 -16
  103. package/dist-types/option/OptionGroup.d.ts +0 -12
  104. package/dist-types/option/OptionList.d.ts +0 -5
  105. package/dist-types/option/index.d.ts +0 -2
  106. package/dist-types/pill-input/PillInput.d.ts +0 -48
  107. package/dist-types/pill-input/index.d.ts +0 -1
  108. package/dist-types/pill-input/useTruncatePills.d.ts +0 -8
  109. package/dist-types/utils/useValueEffect.d.ts +0 -4
@@ -1,36 +0,0 @@
1
- import { useState, useRef } from 'react';
2
- import { useIsomorphicLayoutEffect } from '@salt-ds/core';
3
- import { useEventCallback } from './useEventCallback.js';
4
-
5
- function useValueEffect(defaultValue) {
6
- let [value, setValue] = useState(defaultValue);
7
- let effect = useRef(null);
8
- let nextRef = useEventCallback(() => {
9
- if (!effect.current) {
10
- return;
11
- }
12
- let newValue = effect.current.next();
13
- if (newValue.done) {
14
- effect.current = null;
15
- return;
16
- }
17
- if (value === newValue.value) {
18
- nextRef();
19
- } else {
20
- setValue(newValue.value);
21
- }
22
- });
23
- useIsomorphicLayoutEffect(() => {
24
- if (effect.current) {
25
- nextRef();
26
- }
27
- });
28
- let queue = useEventCallback((fn) => {
29
- effect.current = fn(value);
30
- nextRef();
31
- });
32
- return [value, queue];
33
- }
34
-
35
- export { useValueEffect };
36
- //# sourceMappingURL=useValueEffect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useValueEffect.js","sources":["../src/utils/useValueEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { Dispatch, MutableRefObject, useRef, useState } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"@salt-ds/core\";\nimport { useEventCallback } from \"./useEventCallback\";\n\ntype SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;\n\n// This hook works like `useState`, but when setting the value, you pass a generator function\n// that can yield multiple values. Each yielded value updates the state and waits for the next\n// layout effect, then continues the generator. This allows sequential updates to state to be\n// written linearly.\nexport function useValueEffect<S>(\n defaultValue: S | (() => S)\n): [S, Dispatch<SetValueAction<S>>] {\n let [value, setValue] = useState(defaultValue);\n let effect: MutableRefObject<Generator<S> | null> =\n useRef<Generator<S> | null>(null);\n\n // Store the function in a ref so we can always access the current version\n // which has the proper `value` in scope.\n let nextRef = useEventCallback(() => {\n if (!effect.current) {\n return;\n }\n // Run the generator to the next yield.\n let newValue = effect.current.next();\n\n // If the generator is done, reset the effect.\n if (newValue.done) {\n effect.current = null;\n return;\n }\n\n // If the value is the same as the current value,\n // then continue to the next yield. Otherwise,\n // set the value in state and wait for the next layout effect.\n if (value === newValue.value) {\n nextRef();\n } else {\n setValue(newValue.value);\n }\n });\n\n useIsomorphicLayoutEffect(() => {\n // If there is an effect currently running, continue to the next yield.\n if (effect.current) {\n nextRef();\n }\n });\n\n let queue: Dispatch<SetValueAction<S>> = useEventCallback((fn) => {\n effect.current = fn(value);\n nextRef();\n });\n\n return [value, queue];\n}\n"],"names":[],"mappings":";;;;AAsBO,SAAS,eACd,YACkC,EAAA;AAClC,EAAA,IAAI,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,YAAY,CAAA,CAAA;AAC7C,EAAI,IAAA,MAAA,GACF,OAA4B,IAAI,CAAA,CAAA;AAIlC,EAAI,IAAA,OAAA,GAAU,iBAAiB,MAAM;AACnC,IAAI,IAAA,CAAC,OAAO,OAAS,EAAA;AACnB,MAAA,OAAA;AAAA,KACF;AAEA,IAAI,IAAA,QAAA,GAAW,MAAO,CAAA,OAAA,CAAQ,IAAK,EAAA,CAAA;AAGnC,IAAA,IAAI,SAAS,IAAM,EAAA;AACjB,MAAA,MAAA,CAAO,OAAU,GAAA,IAAA,CAAA;AACjB,MAAA,OAAA;AAAA,KACF;AAKA,IAAI,IAAA,KAAA,KAAU,SAAS,KAAO,EAAA;AAC5B,MAAQ,OAAA,EAAA,CAAA;AAAA,KACH,MAAA;AACL,MAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AAAA,KACzB;AAAA,GACD,CAAA,CAAA;AAED,EAAA,yBAAA,CAA0B,MAAM;AAE9B,IAAA,IAAI,OAAO,OAAS,EAAA;AAClB,MAAQ,OAAA,EAAA,CAAA;AAAA,KACV;AAAA,GACD,CAAA,CAAA;AAED,EAAI,IAAA,KAAA,GAAqC,gBAAiB,CAAA,CAAC,EAAO,KAAA;AAChE,IAAO,MAAA,CAAA,OAAA,GAAU,GAAG,KAAK,CAAA,CAAA;AACzB,IAAQ,OAAA,EAAA,CAAA;AAAA,GACT,CAAA,CAAA;AAED,EAAO,OAAA,CAAC,OAAO,KAAK,CAAA,CAAA;AACtB;;;;"}
@@ -1,17 +0,0 @@
1
- import { ReactNode, Ref } from "react";
2
- import { UseComboBoxNextProps } from "./useComboBoxNext";
3
- import { PillInputProps } from "../pill-input";
4
- export declare type ComboBoxNextProps<Item = string> = {
5
- /**
6
- * The options to display in the combo box.
7
- */
8
- children?: ReactNode;
9
- } & UseComboBoxNextProps<Item> & PillInputProps;
10
- export declare const ComboBoxNext: <Item = string>(props: {
11
- /**
12
- * The options to display in the combo box.
13
- */
14
- children?: ReactNode;
15
- } & import("../list-control/ListControlState").ListControlProps<Item> & Pick<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "defaultValue" | "value"> & PillInputProps & {
16
- ref?: Ref<HTMLDivElement> | undefined;
17
- }) => JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./ComboBoxNext";
@@ -1,30 +0,0 @@
1
- import { ListControlProps } from "../list-control/ListControlState";
2
- import { ComponentPropsWithoutRef, SyntheticEvent } from "react";
3
- import { OptionValue } from "../list-control/ListControlContext";
4
- export declare type UseComboBoxNextProps<Item> = ListControlProps<Item> & Pick<ComponentPropsWithoutRef<"input">, "value" | "defaultValue">;
5
- export declare function useComboBoxNext<Item>(props: UseComboBoxNextProps<Item>): {
6
- select: (event: SyntheticEvent, option: OptionValue<Item>) => void;
7
- valueState: string | number | readonly string[] | undefined;
8
- setValueState: import("react").Dispatch<import("react").SetStateAction<string | number | readonly string[] | undefined>>;
9
- multiselect: boolean;
10
- openState: boolean;
11
- setOpen: (newOpen: boolean, reason?: import("../list-control/ListControlState").OpenChangeReason | undefined, key?: string | undefined) => void;
12
- openKey: import("react").MutableRefObject<string | undefined>;
13
- activeState: OptionValue<Item> | undefined;
14
- setActive: (option?: OptionValue<Item> | undefined) => void;
15
- selectedState: Item[];
16
- setSelectedState: import("react").Dispatch<import("react").SetStateAction<Item[]>>;
17
- clear: (event: SyntheticEvent<Element, Event>) => void;
18
- focusVisibleState: boolean;
19
- setFocusVisibleState: import("react").Dispatch<import("react").SetStateAction<boolean>>;
20
- focusedState: boolean;
21
- setFocusedState: import("react").Dispatch<import("react").SetStateAction<boolean>>;
22
- listRef: import("react").RefObject<HTMLDivElement>;
23
- options: HTMLElement[];
24
- register: (optionValue: OptionValue<Item>, element: HTMLElement) => () => void;
25
- getOptionAtIndex: (index: number) => OptionValue<Item>;
26
- getIndexOfOption: (option: OptionValue<Item>) => number;
27
- getOptionsMatching: (predicate: (option: OptionValue<Item>) => boolean) => OptionValue<Item>[];
28
- getOptionFromSearch: (search: string, startFrom?: OptionValue<Item> | undefined) => OptionValue<Item> | undefined;
29
- valueToString: (item: Item) => string;
30
- };
@@ -1,99 +0,0 @@
1
- import { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
2
- import { ListControlProps } from "../list-control/ListControlState";
3
- import { ValidationStatus } from "@salt-ds/core";
4
- export declare type DropdownNextProps<Item = string> = {
5
- /**
6
- * If `true`, the dropdown will be disabled.
7
- */
8
- disabled?: boolean;
9
- /**
10
- * If `true`, the dropdown will be read-only.
11
- */
12
- readOnly?: boolean;
13
- /**
14
- * The options to display in the dropdown.
15
- */
16
- children?: ReactNode;
17
- /**
18
- * The marker to use in an empty read only dropdown.
19
- * Use `''` to disable this feature. Defaults to '—'.
20
- */
21
- emptyReadOnlyMarker?: string;
22
- /**
23
- * If `true`, the dropdown will be multiselect.
24
- */
25
- multiselect?: boolean;
26
- /**
27
- * The text shown when the dropdown has no value.
28
- */
29
- placeholder?: string;
30
- /**
31
- * If `true`, the dropdown will be required.
32
- */
33
- required?: boolean;
34
- /**
35
- * Start adornment component
36
- */
37
- startAdornment?: ReactNode;
38
- /**
39
- * Styling variant. Defaults to "primary".
40
- */
41
- variant?: "primary" | "secondary";
42
- /**
43
- * The content of the dropdown shown in the button. The component will be controlled if this prop is provided.
44
- */
45
- value?: string;
46
- /**
47
- * Validation status, one of "error" | "warning" | "success".
48
- */
49
- validationStatus?: Exclude<ValidationStatus, "info">;
50
- } & Omit<ComponentPropsWithoutRef<"button">, "value" | "defaultValue"> & ListControlProps<Item>;
51
- export declare const DropdownNext: <Item = string>(props: {
52
- /**
53
- * If `true`, the dropdown will be disabled.
54
- */
55
- disabled?: boolean | undefined;
56
- /**
57
- * If `true`, the dropdown will be read-only.
58
- */
59
- readOnly?: boolean | undefined;
60
- /**
61
- * The options to display in the dropdown.
62
- */
63
- children?: ReactNode;
64
- /**
65
- * The marker to use in an empty read only dropdown.
66
- * Use `''` to disable this feature. Defaults to '—'.
67
- */
68
- emptyReadOnlyMarker?: string | undefined;
69
- /**
70
- * If `true`, the dropdown will be multiselect.
71
- */
72
- multiselect?: boolean | undefined;
73
- /**
74
- * The text shown when the dropdown has no value.
75
- */
76
- placeholder?: string | undefined;
77
- /**
78
- * If `true`, the dropdown will be required.
79
- */
80
- required?: boolean | undefined;
81
- /**
82
- * Start adornment component
83
- */
84
- startAdornment?: ReactNode;
85
- /**
86
- * Styling variant. Defaults to "primary".
87
- */
88
- variant?: "primary" | "secondary" | undefined;
89
- /**
90
- * The content of the dropdown shown in the button. The component will be controlled if this prop is provided.
91
- */
92
- value?: string | undefined;
93
- /**
94
- * Validation status, one of "error" | "warning" | "success".
95
- */
96
- validationStatus?: "error" | "warning" | "success" | undefined;
97
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "defaultValue" | "value"> & ListControlProps<Item> & {
98
- ref?: Ref<HTMLButtonElement> | undefined;
99
- }) => JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./DropdownNext";
@@ -1,21 +0,0 @@
1
- import { SyntheticEvent } from "react";
2
- export interface OptionValue<Item> {
3
- id: string;
4
- disabled: boolean;
5
- value: Item;
6
- }
7
- export declare type OpenChangeReason = "input" | "manual";
8
- export interface ListControlContextValue<Item> {
9
- openState: boolean;
10
- setOpen: (newOpen: boolean, openChangeReason?: OpenChangeReason) => void;
11
- register: (optionValue: OptionValue<Item>, element: HTMLElement) => () => void;
12
- selectedState: unknown[];
13
- select: (event: SyntheticEvent, option: OptionValue<Item>) => void;
14
- activeState?: OptionValue<Item>;
15
- setActive: (option: OptionValue<Item>) => void;
16
- multiselect: boolean;
17
- focusVisibleState: boolean;
18
- valueToString: (item: Item) => string;
19
- }
20
- export declare const ListControlContext: import("react").Context<ListControlContextValue<any>>;
21
- export declare function useListControlContext<Item>(): ListControlContextValue<Item>;
@@ -1,70 +0,0 @@
1
- import { SyntheticEvent } from "react";
2
- import { OptionValue } from "./ListControlContext";
3
- export declare type OpenChangeReason = "input" | "manual";
4
- export declare type ListControlProps<Item> = {
5
- /**
6
- * If true, the control will be disabled.
7
- */
8
- disabled?: boolean;
9
- /**
10
- * If true, the control will be read-only.
11
- */
12
- readOnly?: boolean;
13
- /**
14
- * If true, the list will be open by default.
15
- */
16
- defaultOpen?: boolean;
17
- /**
18
- * If true, the list will be open. Useful for controlling the component.
19
- */
20
- open?: boolean;
21
- /**
22
- * Callback fired when the open state changes.
23
- */
24
- onOpenChange?: (newOpen: boolean, reason?: OpenChangeReason) => void;
25
- /**
26
- * The default selected options. If this is provided `defaultValue` should be provided as well.
27
- */
28
- defaultSelected?: Item[];
29
- /**
30
- * The selected options. The component will be controlled if this prop is provided.
31
- */
32
- selected?: Item[];
33
- /**
34
- * Callback fired when the selected options change.
35
- */
36
- onSelectionChange?: (event: SyntheticEvent, newSelected: Item[]) => void;
37
- /**
38
- * If true, multiple options can be selected.
39
- */
40
- multiselect?: boolean;
41
- /**
42
- * Callback used to convert an option's `value` to a string. This is needed when the value is different to the display value or the value is not a string.
43
- */
44
- valueToString?: (item: Item) => string;
45
- };
46
- export declare function defaultValueToString<Item>(item: Item): string;
47
- export declare function useListControl<Item>(props: ListControlProps<Item>): {
48
- multiselect: boolean;
49
- openState: boolean;
50
- setOpen: (newOpen: boolean, reason?: OpenChangeReason | undefined, key?: string | undefined) => void;
51
- openKey: import("react").MutableRefObject<string | undefined>;
52
- activeState: OptionValue<Item> | undefined;
53
- setActive: (option?: OptionValue<Item> | undefined) => void;
54
- selectedState: Item[];
55
- setSelectedState: import("react").Dispatch<import("react").SetStateAction<Item[]>>;
56
- select: (event: SyntheticEvent, option: OptionValue<Item>) => void;
57
- clear: (event: SyntheticEvent) => void;
58
- focusVisibleState: boolean;
59
- setFocusVisibleState: import("react").Dispatch<import("react").SetStateAction<boolean>>;
60
- focusedState: boolean;
61
- setFocusedState: import("react").Dispatch<import("react").SetStateAction<boolean>>;
62
- listRef: import("react").RefObject<HTMLDivElement>;
63
- options: HTMLElement[];
64
- register: (optionValue: OptionValue<Item>, element: HTMLElement) => () => void;
65
- getOptionAtIndex: (index: number) => OptionValue<Item>;
66
- getIndexOfOption: (option: OptionValue<Item>) => number;
67
- getOptionsMatching: (predicate: (option: OptionValue<Item>) => boolean) => OptionValue<Item>[];
68
- getOptionFromSearch: (search: string, startFrom?: OptionValue<Item> | undefined) => OptionValue<Item> | undefined;
69
- valueToString: (item: Item) => string;
70
- };
@@ -1,16 +0,0 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
- export interface OptionProps extends ComponentPropsWithoutRef<"div"> {
3
- /**
4
- * If `true`, the option will be disabled.
5
- */
6
- disabled?: boolean;
7
- /**
8
- * The value of the option.
9
- */
10
- value: unknown;
11
- /**
12
- * The content of the option.
13
- */
14
- children?: ReactNode;
15
- }
16
- export declare const Option: import("react").ForwardRefExoticComponent<OptionProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,12 +0,0 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
- export interface OptionGroupProps extends ComponentPropsWithoutRef<"div"> {
3
- /**
4
- * The label of the option group.
5
- */
6
- label?: string;
7
- /**
8
- * Options to be rendered inside the option group.
9
- */
10
- children?: ReactNode;
11
- }
12
- export declare const OptionGroup: import("react").ForwardRefExoticComponent<OptionGroupProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,5 +0,0 @@
1
- import { ComponentPropsWithoutRef } from "react";
2
- export interface OptionListProps extends ComponentPropsWithoutRef<"div"> {
3
- collapsed?: boolean;
4
- }
5
- export declare const OptionList: import("react").ForwardRefExoticComponent<OptionListProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,2 +0,0 @@
1
- export * from "./Option";
2
- export * from "./OptionGroup";
@@ -1,48 +0,0 @@
1
- import { SyntheticEvent, ComponentPropsWithoutRef, InputHTMLAttributes, ReactNode, Ref } from "react";
2
- export interface PillInputProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue">, Pick<ComponentPropsWithoutRef<"input">, "disabled" | "value" | "defaultValue" | "placeholder"> {
3
- /**
4
- * The marker to use in an empty read only Input.
5
- * Use `''` to disable this feature. Defaults to '—'.
6
- */
7
- emptyReadOnlyMarker?: string;
8
- /**
9
- * End adornment component
10
- */
11
- endAdornment?: ReactNode;
12
- /**
13
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
14
- */
15
- inputProps?: InputHTMLAttributes<HTMLInputElement>;
16
- /**
17
- * Optional ref for the input component
18
- */
19
- inputRef?: Ref<HTMLInputElement>;
20
- /**
21
- * If `true`, the component is read only.
22
- */
23
- readOnly?: boolean;
24
- /**
25
- * The tokens to display in the input.
26
- */
27
- pills?: any[];
28
- onPillRemove?: (event: SyntheticEvent, index: number) => void;
29
- /**
30
- * Start adornment component
31
- */
32
- startAdornment?: ReactNode;
33
- /**
34
- * Alignment of text within container. Defaults to "left"
35
- */
36
- textAlign?: "left" | "center" | "right";
37
- /**
38
- * Validation status.
39
- */
40
- validationStatus?: "error" | "warning" | "success";
41
- /**
42
- * Styling variant. Defaults to "primary".
43
- */
44
- variant?: "primary" | "secondary";
45
- hidePillClose?: boolean;
46
- truncate?: boolean;
47
- }
48
- export declare const PillInput: import("react").ForwardRefExoticComponent<PillInputProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +0,0 @@
1
- export * from "./PillInput";
@@ -1,8 +0,0 @@
1
- export declare function useTruncatePills({ pills, enable, }: {
2
- pills: string[];
3
- enable?: boolean;
4
- }): {
5
- pillListRef: import("react").RefObject<HTMLDivElement>;
6
- visibleCount: number;
7
- visiblePills: string[];
8
- };
@@ -1,4 +0,0 @@
1
- import { Dispatch } from "react";
2
- declare type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;
3
- export declare function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>];
4
- export {};