@salt-ds/core 1.46.1 → 1.47.1
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/CHANGELOG.md +29 -0
- package/css/salt-core.css +240 -224
- package/dist-cjs/accordion/Accordion.css.js +1 -1
- package/dist-cjs/accordion/AccordionGroup.css.js +1 -1
- package/dist-cjs/accordion/AccordionHeader.css.js +1 -1
- package/dist-cjs/banner/Banner.css.js +1 -1
- package/dist-cjs/border-item/BorderItem.js +33 -32
- package/dist-cjs/border-item/BorderItem.js.map +1 -1
- package/dist-cjs/border-layout/BorderLayout.js +3 -1
- package/dist-cjs/border-layout/BorderLayout.js.map +1 -1
- package/dist-cjs/button/Button.css.js +1 -1
- package/dist-cjs/button/Button.js +2 -1
- package/dist-cjs/button/Button.js.map +1 -1
- package/dist-cjs/card/Card.css.js +1 -1
- package/dist-cjs/checkbox/Checkbox.css.js +1 -1
- package/dist-cjs/checkbox/CheckboxIcon.css.js +1 -1
- package/dist-cjs/dialog/Dialog.css.js +1 -1
- package/dist-cjs/dialog/DialogContent.css.js +1 -1
- package/dist-cjs/divider/Divider.css.js +1 -1
- package/dist-cjs/dropdown/Dropdown.css.js +1 -1
- package/dist-cjs/file-drop-zone/FileDropZone.css.js +1 -1
- package/dist-cjs/flex-item/FlexItem.js +46 -48
- package/dist-cjs/flex-item/FlexItem.js.map +1 -1
- package/dist-cjs/flex-layout/FlexLayout.css.js +1 -1
- package/dist-cjs/flex-layout/FlexLayout.js +60 -62
- package/dist-cjs/flex-layout/FlexLayout.js.map +1 -1
- package/dist-cjs/flow-layout/FlowLayout.js +3 -5
- package/dist-cjs/flow-layout/FlowLayout.js.map +1 -1
- package/dist-cjs/form-field/FormField.js +6 -2
- package/dist-cjs/form-field/FormField.js.map +1 -1
- package/dist-cjs/form-field/FormFieldHelperText.css.js +1 -1
- package/dist-cjs/form-field/FormFieldHelperText.js +7 -1
- package/dist-cjs/form-field/FormFieldHelperText.js.map +1 -1
- package/dist-cjs/form-field/FormFieldLabel.js +15 -3
- package/dist-cjs/form-field/FormFieldLabel.js.map +1 -1
- package/dist-cjs/form-field-context/FormFieldContext.js.map +1 -1
- package/dist-cjs/grid-item/GridItem.js +51 -53
- package/dist-cjs/grid-item/GridItem.js.map +1 -1
- package/dist-cjs/grid-layout/GridLayout.js +49 -51
- package/dist-cjs/grid-layout/GridLayout.js.map +1 -1
- package/dist-cjs/input/Input.css.js +1 -1
- package/dist-cjs/interactable-card/InteractableCard.css.js +1 -1
- package/dist-cjs/link-card/LinkCard.css.js +1 -1
- package/dist-cjs/list-box/ListBox.css.js +1 -1
- package/dist-cjs/list-box/ListBox.js +5 -0
- package/dist-cjs/list-box/ListBox.js.map +1 -1
- package/dist-cjs/menu/MenuBase.js +1 -1
- package/dist-cjs/menu/MenuBase.js.map +1 -1
- package/dist-cjs/menu/MenuGroup.css.js +1 -1
- package/dist-cjs/menu/MenuItem.css.js +1 -1
- package/dist-cjs/menu/MenuPanel.css.js +1 -1
- package/dist-cjs/menu/MenuTrigger.js +32 -29
- package/dist-cjs/menu/MenuTrigger.js.map +1 -1
- package/dist-cjs/multiline-input/MultilineInput.css.js +1 -1
- package/dist-cjs/navigation-item/NavigationItem.css.js +1 -1
- package/dist-cjs/option/Option.css.js +1 -1
- package/dist-cjs/option/Option.js +1 -0
- package/dist-cjs/option/Option.js.map +1 -1
- package/dist-cjs/option/OptionGroup.css.js +1 -1
- package/dist-cjs/option/OptionList.css.js +1 -1
- package/dist-cjs/overlay/OverlayPanel.css.js +1 -1
- package/dist-cjs/overlay/OverlayPanelContent.css.js +1 -1
- package/dist-cjs/overlay/OverlayPanelContent.js +1 -1
- package/dist-cjs/overlay/OverlayPanelContent.js.map +1 -1
- package/dist-cjs/overlay/OverlayTrigger.js +17 -11
- package/dist-cjs/overlay/OverlayTrigger.js.map +1 -1
- package/dist-cjs/pagination/PageButton.css.js +1 -1
- package/dist-cjs/pill/Pill.css.js +1 -1
- package/dist-cjs/pill-input/PillInput.css.js +1 -1
- package/dist-cjs/pill-input/PillInput.js +5 -3
- package/dist-cjs/pill-input/PillInput.js.map +1 -1
- package/dist-cjs/progress/CircularProgress/CircularProgress.css.js +1 -1
- package/dist-cjs/progress/LinearProgress/LinearProgress.css.js +1 -1
- package/dist-cjs/radio-button/RadioButton.css.js +1 -1
- package/dist-cjs/radio-button/RadioButtonIcon.css.js +1 -1
- package/dist-cjs/segmented-button-group/SegmentedButtonGroup.css.js +1 -1
- package/dist-cjs/slider/internal/SliderThumb.css.js +1 -1
- package/dist-cjs/slider/internal/SliderTooltip.css.js +1 -1
- package/dist-cjs/slider/internal/SliderTrack.css.js +1 -1
- package/dist-cjs/spinner/Spinner.css.js +1 -1
- package/dist-cjs/split-layout/SplitLayout.js +2 -1
- package/dist-cjs/split-layout/SplitLayout.js.map +1 -1
- package/dist-cjs/stack-layout/StackLayout.css.js +1 -1
- package/dist-cjs/stack-layout/StackLayout.js +4 -2
- package/dist-cjs/stack-layout/StackLayout.js.map +1 -1
- package/dist-cjs/stepper/internal/StepConnector.css.js +1 -1
- package/dist-cjs/switch/Switch.css.js +1 -1
- package/dist-cjs/tag/Tag.css.js +1 -1
- package/dist-cjs/text/Text.js.map +1 -1
- package/dist-cjs/theme/Theme.js.map +1 -1
- package/dist-cjs/toast/Toast.css.js +1 -1
- package/dist-cjs/toggle-button/ToggleButton.css.js +1 -1
- package/dist-cjs/toggle-button-group/ToggleButtonGroup.css.js +1 -1
- package/dist-cjs/tooltip/Tooltip.css.js +1 -1
- package/dist-cjs/tooltip/Tooltip.js.map +1 -1
- package/dist-es/accordion/Accordion.css.js +1 -1
- package/dist-es/accordion/AccordionGroup.css.js +1 -1
- package/dist-es/accordion/AccordionHeader.css.js +1 -1
- package/dist-es/banner/Banner.css.js +1 -1
- package/dist-es/border-item/BorderItem.js +33 -32
- package/dist-es/border-item/BorderItem.js.map +1 -1
- package/dist-es/border-layout/BorderLayout.js +3 -1
- package/dist-es/border-layout/BorderLayout.js.map +1 -1
- package/dist-es/button/Button.css.js +1 -1
- package/dist-es/button/Button.js +2 -1
- package/dist-es/button/Button.js.map +1 -1
- package/dist-es/card/Card.css.js +1 -1
- package/dist-es/checkbox/Checkbox.css.js +1 -1
- package/dist-es/checkbox/CheckboxIcon.css.js +1 -1
- package/dist-es/dialog/Dialog.css.js +1 -1
- package/dist-es/dialog/DialogContent.css.js +1 -1
- package/dist-es/divider/Divider.css.js +1 -1
- package/dist-es/dropdown/Dropdown.css.js +1 -1
- package/dist-es/file-drop-zone/FileDropZone.css.js +1 -1
- package/dist-es/flex-item/FlexItem.js +46 -48
- package/dist-es/flex-item/FlexItem.js.map +1 -1
- package/dist-es/flex-layout/FlexLayout.css.js +1 -1
- package/dist-es/flex-layout/FlexLayout.js +60 -62
- package/dist-es/flex-layout/FlexLayout.js.map +1 -1
- package/dist-es/flow-layout/FlowLayout.js +3 -5
- package/dist-es/flow-layout/FlowLayout.js.map +1 -1
- package/dist-es/form-field/FormField.js +7 -3
- package/dist-es/form-field/FormField.js.map +1 -1
- package/dist-es/form-field/FormFieldHelperText.css.js +1 -1
- package/dist-es/form-field/FormFieldHelperText.js +7 -1
- package/dist-es/form-field/FormFieldHelperText.js.map +1 -1
- package/dist-es/form-field/FormFieldLabel.js +15 -3
- package/dist-es/form-field/FormFieldLabel.js.map +1 -1
- package/dist-es/form-field-context/FormFieldContext.js.map +1 -1
- package/dist-es/grid-item/GridItem.js +51 -53
- package/dist-es/grid-item/GridItem.js.map +1 -1
- package/dist-es/grid-layout/GridLayout.js +49 -51
- package/dist-es/grid-layout/GridLayout.js.map +1 -1
- package/dist-es/input/Input.css.js +1 -1
- package/dist-es/interactable-card/InteractableCard.css.js +1 -1
- package/dist-es/link-card/LinkCard.css.js +1 -1
- package/dist-es/list-box/ListBox.css.js +1 -1
- package/dist-es/list-box/ListBox.js +5 -0
- package/dist-es/list-box/ListBox.js.map +1 -1
- package/dist-es/menu/MenuBase.js +1 -1
- package/dist-es/menu/MenuBase.js.map +1 -1
- package/dist-es/menu/MenuGroup.css.js +1 -1
- package/dist-es/menu/MenuItem.css.js +1 -1
- package/dist-es/menu/MenuPanel.css.js +1 -1
- package/dist-es/menu/MenuTrigger.js +33 -30
- package/dist-es/menu/MenuTrigger.js.map +1 -1
- package/dist-es/multiline-input/MultilineInput.css.js +1 -1
- package/dist-es/navigation-item/NavigationItem.css.js +1 -1
- package/dist-es/option/Option.css.js +1 -1
- package/dist-es/option/Option.js +1 -0
- package/dist-es/option/Option.js.map +1 -1
- package/dist-es/option/OptionGroup.css.js +1 -1
- package/dist-es/option/OptionList.css.js +1 -1
- package/dist-es/overlay/OverlayPanel.css.js +1 -1
- package/dist-es/overlay/OverlayPanelContent.css.js +1 -1
- package/dist-es/overlay/OverlayPanelContent.js +1 -1
- package/dist-es/overlay/OverlayPanelContent.js.map +1 -1
- package/dist-es/overlay/OverlayTrigger.js +18 -12
- package/dist-es/overlay/OverlayTrigger.js.map +1 -1
- package/dist-es/pagination/PageButton.css.js +1 -1
- package/dist-es/pill/Pill.css.js +1 -1
- package/dist-es/pill-input/PillInput.css.js +1 -1
- package/dist-es/pill-input/PillInput.js +5 -3
- package/dist-es/pill-input/PillInput.js.map +1 -1
- package/dist-es/progress/CircularProgress/CircularProgress.css.js +1 -1
- package/dist-es/progress/LinearProgress/LinearProgress.css.js +1 -1
- package/dist-es/radio-button/RadioButton.css.js +1 -1
- package/dist-es/radio-button/RadioButtonIcon.css.js +1 -1
- package/dist-es/segmented-button-group/SegmentedButtonGroup.css.js +1 -1
- package/dist-es/slider/internal/SliderThumb.css.js +1 -1
- package/dist-es/slider/internal/SliderTooltip.css.js +1 -1
- package/dist-es/slider/internal/SliderTrack.css.js +1 -1
- package/dist-es/spinner/Spinner.css.js +1 -1
- package/dist-es/split-layout/SplitLayout.js +2 -1
- package/dist-es/split-layout/SplitLayout.js.map +1 -1
- package/dist-es/stack-layout/StackLayout.css.js +1 -1
- package/dist-es/stack-layout/StackLayout.js +4 -2
- package/dist-es/stack-layout/StackLayout.js.map +1 -1
- package/dist-es/stepper/internal/StepConnector.css.js +1 -1
- package/dist-es/switch/Switch.css.js +1 -1
- package/dist-es/tag/Tag.css.js +1 -1
- package/dist-es/text/Text.js.map +1 -1
- package/dist-es/theme/Theme.js.map +1 -1
- package/dist-es/toast/Toast.css.js +1 -1
- package/dist-es/toggle-button/ToggleButton.css.js +1 -1
- package/dist-es/toggle-button-group/ToggleButtonGroup.css.js +1 -1
- package/dist-es/tooltip/Tooltip.css.js +1 -1
- package/dist-es/tooltip/Tooltip.js.map +1 -1
- package/dist-types/aria-announcer/AriaAnnouncerContext.d.ts +2 -2
- package/dist-types/aria-announcer/useAriaAnnouncer.d.ts +2 -2
- package/dist-types/avatar/Avatar.d.ts +1 -1
- package/dist-types/border-item/BorderItem.d.ts +4 -4
- package/dist-types/border-layout/BorderLayout.d.ts +3 -3
- package/dist-types/breakpoints/BreakpointProvider.d.ts +1 -1
- package/dist-types/button/Button.d.ts +3 -3
- package/dist-types/combo-box/ComboBox.d.ts +3 -12
- package/dist-types/combo-box/useComboBox.d.ts +3 -3
- package/dist-types/dialog/DialogContext.d.ts +3 -2
- package/dist-types/dropdown/Dropdown.d.ts +3 -52
- package/dist-types/flex-item/FlexItem.d.ts +4 -4
- package/dist-types/flex-layout/FlexLayout.d.ts +7 -7
- package/dist-types/flow-layout/FlowLayout.d.ts +3 -3
- package/dist-types/form-field/FormField.d.ts +1 -1
- package/dist-types/form-field/FormFieldLabel.d.ts +1 -1
- package/dist-types/form-field-context/FormFieldContext.d.ts +3 -1
- package/dist-types/grid-item/GridItem.d.ts +5 -5
- package/dist-types/grid-layout/GridLayout.d.ts +3 -3
- package/dist-types/interactable-card/InteractableCardGroupContext.d.ts +1 -1
- package/dist-types/list-box/ListBox.d.ts +3 -20
- package/dist-types/list-control/ListControlContext.d.ts +1 -1
- package/dist-types/list-control/ListControlState.d.ts +5 -5
- package/dist-types/menu/MenuContext.d.ts +1 -1
- package/dist-types/menu/MenuTrigger.d.ts +1 -1
- package/dist-types/overlay/OverlayContext.d.ts +1 -1
- package/dist-types/overlay/OverlayTrigger.d.ts +1 -1
- package/dist-types/pagination/usePagination.d.ts +1 -1
- package/dist-types/salt-provider/SaltProvider.d.ts +4 -4
- package/dist-types/semantic-icon-provider/SemanticIconProvider.d.ts +1 -1
- package/dist-types/slider/internal/useRangeSliderThumb.d.ts +1 -1
- package/dist-types/slider/internal/useSliderThumb.d.ts +1 -1
- package/dist-types/slider/internal/utils.d.ts +5 -5
- package/dist-types/spinner/Spinner.d.ts +2 -2
- package/dist-types/split-layout/SplitLayout.d.ts +3 -3
- package/dist-types/stack-layout/StackLayout.d.ts +3 -3
- package/dist-types/status-adornment/ErrorAdornment.d.ts +1 -1
- package/dist-types/status-adornment/StatusAdornment.d.ts +1 -1
- package/dist-types/status-adornment/SuccessAdornment.d.ts +1 -1
- package/dist-types/status-adornment/WarningAdornment.d.ts +1 -1
- package/dist-types/status-indicator/ValidationStatus.d.ts +1 -1
- package/dist-types/stepper/Step.d.ts +4 -4
- package/dist-types/stepper/Stepper.d.ts +1 -1
- package/dist-types/text/Text.d.ts +3 -3
- package/dist-types/theme/Accent.d.ts +2 -2
- package/dist-types/theme/ActionFont.d.ts +2 -2
- package/dist-types/theme/Corner.d.ts +2 -2
- package/dist-types/theme/Density.d.ts +1 -1
- package/dist-types/theme/HeadingFont.d.ts +2 -2
- package/dist-types/theme/Mode.d.ts +1 -1
- package/dist-types/theme/Theme.d.ts +3 -3
- package/dist-types/toggle-button-group/ToggleButtonGroupContext.d.ts +1 -1
- package/dist-types/tooltip/useAriaAnnounce.d.ts +1 -1
- package/dist-types/tooltip/useTooltip.d.ts +3 -3
- package/dist-types/types.d.ts +1 -1
- package/dist-types/utils/createChainedFunction.d.ts +1 -1
- package/dist-types/utils/inferElementType.d.ts +1 -1
- package/dist-types/utils/makePrefixer.d.ts +1 -1
- package/dist-types/utils/polymorphicTypes.d.ts +5 -5
- package/dist-types/utils/useFloatingUI/useFloatingUI.d.ts +3 -13
- package/dist-types/utils/useResponsiveProp.d.ts +2 -2
- package/dist-types/utils/useValueEffect.d.ts +1 -1
- package/dist-types/viewport/ViewportProvider.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SyntheticEvent } from "react";
|
|
2
2
|
import type { OptionValue } from "./ListControlContext";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type OpenChangeReason = "input" | "manual";
|
|
4
|
+
export type ListControlProps<Item> = {
|
|
5
5
|
/**
|
|
6
6
|
* If true, the control will be disabled.
|
|
7
7
|
*/
|
|
@@ -47,10 +47,10 @@ export declare function defaultValueToString<Item>(item: Item): string;
|
|
|
47
47
|
export declare function useListControl<Item>(props: ListControlProps<Item>): {
|
|
48
48
|
multiselect: boolean;
|
|
49
49
|
openState: boolean;
|
|
50
|
-
setOpen: (newOpen: boolean, reason?: OpenChangeReason
|
|
50
|
+
setOpen: (newOpen: boolean, reason?: OpenChangeReason, key?: string) => void;
|
|
51
51
|
openKey: import("react").MutableRefObject<string | undefined>;
|
|
52
52
|
activeState: OptionValue<Item> | undefined;
|
|
53
|
-
setActive: (option?: OptionValue<Item>
|
|
53
|
+
setActive: (option?: OptionValue<Item>) => void;
|
|
54
54
|
selectedState: Item[];
|
|
55
55
|
setSelectedState: import("react").Dispatch<import("react").SetStateAction<Item[]>>;
|
|
56
56
|
select: (event: SyntheticEvent, option: OptionValue<Item>) => void;
|
|
@@ -71,7 +71,7 @@ export declare function useListControl<Item>(props: ListControlProps<Item>): {
|
|
|
71
71
|
data: OptionValue<Item>;
|
|
72
72
|
element: HTMLElement;
|
|
73
73
|
}[];
|
|
74
|
-
getOptionFromSearch: (search: string, startFrom?: OptionValue<Item>
|
|
74
|
+
getOptionFromSearch: (search: string, startFrom?: OptionValue<Item>) => OptionValue<Item> | undefined;
|
|
75
75
|
getOptionAfter: (option: OptionValue<Item>) => {
|
|
76
76
|
data: OptionValue<Item>;
|
|
77
77
|
element: HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { useInteractions } from "@floating-ui/react";
|
|
2
2
|
import { type Dispatch, type MutableRefObject, type SetStateAction } from "react";
|
|
3
3
|
import { type UseFloatingUIReturn } from "../utils";
|
|
4
|
-
|
|
4
|
+
type UseInteractionsReturn = ReturnType<typeof useInteractions>;
|
|
5
5
|
export interface MenuContextValue extends Pick<UseInteractionsReturn, "getItemProps" | "getReferenceProps" | "getFloatingProps">, Partial<Pick<UseFloatingUIReturn, "context" | "refs">> {
|
|
6
6
|
openState: boolean;
|
|
7
7
|
activeIndex: number | null;
|
|
@@ -5,4 +5,4 @@ export interface MenuTriggerProps {
|
|
|
5
5
|
*/
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
8
|
+
export declare const MenuTrigger: import("react").ForwardRefExoticComponent<MenuTriggerProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -2,4 +2,4 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
export interface OverlayTriggerProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
}
|
|
5
|
-
export declare
|
|
5
|
+
export declare const OverlayTrigger: import("react").ForwardRefExoticComponent<OverlayTriggerProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PageRange = [number, number];
|
|
2
2
|
export declare function usePagination(page: number, count: number, boundaryCount: number, siblingCount: number): readonly [PageRange | undefined, PageRange, PageRange | undefined];
|
|
@@ -25,7 +25,7 @@ export interface ThemeContextProps {
|
|
|
25
25
|
export declare const DensityContext: import("react").Context<"touch" | "high" | "low" | "medium">;
|
|
26
26
|
export declare const ThemeContext: import("react").Context<ThemeContextProps>;
|
|
27
27
|
export declare const BreakpointContext: import("react").Context<Breakpoints>;
|
|
28
|
-
|
|
28
|
+
type TargetElement = "root" | "scope" | "child";
|
|
29
29
|
interface SaltProviderBaseProps {
|
|
30
30
|
/**
|
|
31
31
|
* Either "root", "scope" or "child".
|
|
@@ -77,7 +77,7 @@ interface SaltProviderThatInjectsThemeElement extends SaltProviderBaseProps {
|
|
|
77
77
|
interface SaltProviderThatClassesToRoot extends SaltProviderThatInjectsThemeElement {
|
|
78
78
|
applyClassesTo: "root";
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
type SaltProviderProps = SaltProviderThatAppliesClassesToChild | SaltProviderThatInjectsThemeElement | SaltProviderThatClassesToRoot;
|
|
81
81
|
export declare function SaltProvider({ enableStyleInjection, ...restProps }: SaltProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
82
82
|
interface SaltProviderNextAdditionalProps {
|
|
83
83
|
/**
|
|
@@ -105,9 +105,9 @@ interface SaltProviderNextAdditionalProps {
|
|
|
105
105
|
*/
|
|
106
106
|
actionFont?: ActionFont;
|
|
107
107
|
}
|
|
108
|
-
export
|
|
108
|
+
export type SaltProviderNextProps = SaltProviderProps & SaltProviderNextAdditionalProps;
|
|
109
109
|
/** @deprecated use `SaltProviderNextProps` */
|
|
110
|
-
export
|
|
110
|
+
export type UNSTABLE_SaltProviderNextProps = SaltProviderNextProps;
|
|
111
111
|
export declare function SaltProviderNext({ enableStyleInjection, ...restProps }: SaltProviderNextProps): import("react/jsx-runtime").JSX.Element;
|
|
112
112
|
/** @deprecated use `SaltProviderNext` */
|
|
113
113
|
export declare const UNSTABLE_SaltProviderNext: typeof SaltProviderNext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChangeEvent, type Dispatch, type RefObject, type SetStateAction } from "react";
|
|
2
2
|
import type { SliderProps } from "../Slider";
|
|
3
|
-
|
|
3
|
+
type UseRangeSliderThumbProps = Pick<SliderProps, "min" | "max" | "step"> & {
|
|
4
4
|
decimalPlaces: number;
|
|
5
5
|
handleInputChange: (event: ChangeEvent<HTMLInputElement>, thumbIndex: number) => void;
|
|
6
6
|
inputRefs: RefObject<HTMLInputElement>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChangeEvent, type Dispatch, type RefObject, type SetStateAction } from "react";
|
|
2
2
|
import type { SliderProps } from "../Slider";
|
|
3
|
-
|
|
3
|
+
type UseSliderThumbProps = Pick<SliderProps, "min" | "max" | "step"> & {
|
|
4
4
|
decimalPlaces: number;
|
|
5
5
|
handleInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
inputRef: RefObject<HTMLInputElement>;
|
|
@@ -5,16 +5,16 @@ export declare const calculatePercentage: (value: number, max: number, min: numb
|
|
|
5
5
|
export declare const clamp: (value: number, max: number, min: number, step: number, decimalPlaces: number, marks?: {
|
|
6
6
|
value: number;
|
|
7
7
|
label: string;
|
|
8
|
-
}[]
|
|
8
|
+
}[], restrictToMarks?: boolean) => number;
|
|
9
9
|
export declare const clampRange: (range: [number, number], max: number, min: number, step: number, decimalPlaces: number, marks?: {
|
|
10
10
|
value: number;
|
|
11
11
|
label: string;
|
|
12
|
-
}[]
|
|
12
|
+
}[], restrictToMarks?: boolean) => [number, number];
|
|
13
13
|
export declare const getClickedPosition: (sliderRef: RefObject<HTMLDivElement>, clientX: number, max: number, min: number, step: number, decimalPlaces: number, marks?: {
|
|
14
14
|
label: string;
|
|
15
15
|
value: number;
|
|
16
|
-
}[]
|
|
17
|
-
export declare const getKeyboardValue: (event: React.KeyboardEvent, value: number, step: number, stepMultiplier: number, max: number, min: number, restrictToMarks?: boolean
|
|
16
|
+
}[], restrictToMarks?: boolean) => number | undefined;
|
|
17
|
+
export declare const getKeyboardValue: (event: React.KeyboardEvent, value: number, step: number, stepMultiplier: number, max: number, min: number, restrictToMarks?: boolean, marks?: {
|
|
18
18
|
label: string;
|
|
19
19
|
value: number;
|
|
20
|
-
}[]
|
|
20
|
+
}[]) => number;
|
|
@@ -6,8 +6,8 @@ import { type HTMLAttributes } from "react";
|
|
|
6
6
|
* <Spinner size="small" | "medium" | "large" />
|
|
7
7
|
*/
|
|
8
8
|
export declare const SpinnerSizeValues: readonly ["default", "large", "small", "medium"];
|
|
9
|
-
|
|
10
|
-
export
|
|
9
|
+
type SpinnerSize = (typeof SpinnerSizeValues)[number];
|
|
10
|
+
export type SpinnerSVGSize = Exclude<SpinnerSize, "default">;
|
|
11
11
|
export interface SpinnerProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
12
|
/**
|
|
13
13
|
* Determines the interval on which the component will continue to announce the aria-label. Defaults to 5000ms (5s)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ElementType, type
|
|
1
|
+
import { type ElementType, type FunctionComponent, type ReactNode } from "react";
|
|
2
2
|
import { type FlexLayoutProps } from "../flex-layout";
|
|
3
3
|
import { type PolymorphicComponentPropWithRef } from "../utils";
|
|
4
|
-
export
|
|
4
|
+
export type SplitLayoutProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
|
|
5
5
|
/**
|
|
6
6
|
* Defines the default behavior for how flex items are laid out along the cross axis on the current line.
|
|
7
7
|
*/
|
|
@@ -31,6 +31,6 @@ export declare type SplitLayoutProps<T extends ElementType> = PolymorphicCompone
|
|
|
31
31
|
*/
|
|
32
32
|
padding?: FlexLayoutProps<ElementType>["padding"];
|
|
33
33
|
}>;
|
|
34
|
-
|
|
34
|
+
type SplitLayoutComponent = <T extends ElementType = "div">(props: SplitLayoutProps<T>) => ReturnType<FunctionComponent>;
|
|
35
35
|
export declare const SplitLayout: SplitLayoutComponent;
|
|
36
36
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ElementType, type
|
|
1
|
+
import { type ElementType, type FunctionComponent } from "react";
|
|
2
2
|
import { type FlexLayoutProps, type LayoutDirection, type LayoutSeparator } from "../flex-layout";
|
|
3
3
|
import { type PolymorphicComponentPropWithRef, type ResponsiveProp } from "../utils";
|
|
4
|
-
export
|
|
4
|
+
export type StackLayoutProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
|
|
5
5
|
/**
|
|
6
6
|
* Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is "stretch".
|
|
7
7
|
*/
|
|
@@ -27,6 +27,6 @@ export declare type StackLayoutProps<T extends ElementType> = PolymorphicCompone
|
|
|
27
27
|
*/
|
|
28
28
|
padding?: FlexLayoutProps<ElementType>["padding"];
|
|
29
29
|
}>;
|
|
30
|
-
|
|
30
|
+
type StackLayoutComponent = <T extends ElementType = "div">(props: StackLayoutProps<T>) => ReturnType<FunctionComponent>;
|
|
31
31
|
export declare const StackLayout: StackLayoutComponent;
|
|
32
32
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IconProps } from "@salt-ds/icons";
|
|
2
|
-
export
|
|
2
|
+
export type ErrorAdornmentIconProps = IconProps;
|
|
3
3
|
export declare const ErrorAdornmentIcon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconProps } from "@salt-ds/icons";
|
|
2
2
|
import type { ValidationStatus } from "../status-indicator";
|
|
3
|
-
export
|
|
3
|
+
export type AdornmentValidationStatus = Exclude<ValidationStatus, "info">;
|
|
4
4
|
export interface StatusAdornmentProps extends IconProps {
|
|
5
5
|
/**
|
|
6
6
|
* Status adornment to be displayed.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IconProps } from "@salt-ds/icons";
|
|
2
|
-
export
|
|
2
|
+
export type SuccessAdornmentIconProps = IconProps;
|
|
3
3
|
export declare const SuccessAdornmentIcon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IconProps } from "@salt-ds/icons";
|
|
2
|
-
export
|
|
2
|
+
export type WarningAdornmentIconProps = IconProps;
|
|
3
3
|
export declare const WarningAdornmentIcon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const VALIDATION_NAMED_STATUS: readonly ["error", "warning", "success", "info"];
|
|
2
|
-
export
|
|
2
|
+
export type ValidationStatus = (typeof VALIDATION_NAMED_STATUS)[number];
|
|
@@ -30,10 +30,10 @@ export interface StepProps extends Omit<ComponentPropsWithoutRef<"li">, "onToggl
|
|
|
30
30
|
*/
|
|
31
31
|
onToggle?: ButtonProps["onClick"];
|
|
32
32
|
}
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
33
|
+
export type StepId = string;
|
|
34
|
+
export type StepStatus = "warning" | "error";
|
|
35
|
+
export type StepStage = "pending" | "locked" | "completed" | "inprogress" | "active";
|
|
36
|
+
export type StepDepth = number;
|
|
37
37
|
export interface StepProps extends Omit<ComponentPropsWithoutRef<"li">, "onToggle"> {
|
|
38
38
|
label?: ReactNode;
|
|
39
39
|
description?: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
-
export
|
|
2
|
+
export type StepperOrientation = "horizontal" | "vertical";
|
|
3
3
|
export interface StepperProps extends ComponentPropsWithoutRef<"ol"> {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the stepper: defaults to horizontal.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ElementType, type
|
|
1
|
+
import { type ElementType, type FunctionComponent } from "react";
|
|
2
2
|
import { type PolymorphicComponentPropWithRef } from "../utils";
|
|
3
3
|
import type { ValidationStatus } from "../status-indicator";
|
|
4
|
-
export
|
|
4
|
+
export type TextProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
|
|
5
5
|
/**
|
|
6
6
|
* Applies disabled styling when true
|
|
7
7
|
*/
|
|
@@ -21,6 +21,6 @@ export declare type TextProps<T extends ElementType> = PolymorphicComponentPropW
|
|
|
21
21
|
variant?: "primary" | "secondary";
|
|
22
22
|
color?: "inherit" | "primary" | "secondary" | ValidationStatus;
|
|
23
23
|
}>;
|
|
24
|
-
|
|
24
|
+
type TextComponent = <T extends ElementType = "div">(props: TextProps<T>) => ReturnType<FunctionComponent>;
|
|
25
25
|
export declare const Text: TextComponent;
|
|
26
26
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const AccentValues: readonly ["blue", "teal"];
|
|
2
2
|
/** @deprecated use `AccentValues` */
|
|
3
3
|
export declare const UNSTABLE_AccentValues: readonly ["blue", "teal"];
|
|
4
|
-
export
|
|
4
|
+
export type Accent = (typeof AccentValues)[number];
|
|
5
5
|
/** @deprecated use `Accent` */
|
|
6
|
-
export
|
|
6
|
+
export type UNSTABLE_Accent = Accent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const ActionFontValues: readonly ["Open Sans", "Amplitude"];
|
|
2
2
|
/** @deprecated use `ActionFontValues` */
|
|
3
3
|
export declare const UNSTABLE_ActionFontValues: readonly ["Open Sans", "Amplitude"];
|
|
4
|
-
export
|
|
4
|
+
export type ActionFont = (typeof ActionFontValues)[number];
|
|
5
5
|
/** @deprecated use `ActionFont` */
|
|
6
|
-
export
|
|
6
|
+
export type UNSTABLE_ActionFont = ActionFont;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const CornerValues: readonly ["sharp", "rounded"];
|
|
2
2
|
/** @deprecated use `CornerValues` */
|
|
3
3
|
export declare const UNSTABLE_CornerValues: readonly ["sharp", "rounded"];
|
|
4
|
-
export
|
|
4
|
+
export type Corner = (typeof CornerValues)[number];
|
|
5
5
|
/** @deprecated Use `Corner` */
|
|
6
|
-
export
|
|
6
|
+
export type UNSTABLE_Corner = Corner;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const DensityValues: readonly ["high", "medium", "low", "touch"];
|
|
2
|
-
export
|
|
2
|
+
export type Density = (typeof DensityValues)[number];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const HeadingFontValues: readonly ["Open Sans", "Amplitude"];
|
|
2
2
|
/** @deprecated use `HeadingFontValues` */
|
|
3
3
|
export declare const UNSTABLE_HeadingFontValues: readonly ["Open Sans", "Amplitude"];
|
|
4
|
-
export
|
|
4
|
+
export type HeadingFont = (typeof HeadingFontValues)[number];
|
|
5
5
|
/** @deprecated Use `HeadingFont` */
|
|
6
|
-
export
|
|
6
|
+
export type UNSTABLE_HeadingFont = HeadingFont;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const ModeValues: readonly ["light", "dark"];
|
|
2
|
-
export
|
|
2
|
+
export type Mode = (typeof ModeValues)[number];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export declare const getCharacteristicValue: (themeName: ThemeName, characteristicName: characteristic, variant: string, scopeElement?: HTMLElement
|
|
1
|
+
export type characteristic = "accent" | "actionable" | "container" | "draggable" | "editable" | "focused" | "measured" | "navigable" | "overlayable" | "selectable" | "separable" | "status" | "taggable" | "target" | "text" | "differential";
|
|
2
|
+
export type ThemeName = string;
|
|
3
|
+
export declare const getCharacteristicValue: (themeName: ThemeName, characteristicName: characteristic, variant: string, scopeElement?: HTMLElement) => string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SyntheticEvent } from "react";
|
|
2
2
|
import type { ButtonAppearance, ButtonSentiment } from "../button";
|
|
3
|
-
export
|
|
3
|
+
export type Value = string | readonly string[] | number | undefined;
|
|
4
4
|
export interface ToggleButtonGroupContextValue {
|
|
5
5
|
appearance?: Extract<ButtonAppearance, "bordered" | "solid">;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -35,11 +35,11 @@ export declare function useTooltip(props?: UseTooltipProps): {
|
|
|
35
35
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
36
36
|
isPositioned: boolean;
|
|
37
37
|
update: () => void;
|
|
38
|
-
floatingStyles:
|
|
38
|
+
floatingStyles: React.CSSProperties;
|
|
39
39
|
open: boolean;
|
|
40
|
-
onOpenChange: (open: boolean, event?: Event
|
|
40
|
+
onOpenChange: (open: boolean, event?: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
|
|
41
41
|
events: import("@floating-ui/react").FloatingEvents;
|
|
42
|
-
dataRef:
|
|
42
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
43
43
|
nodeId: string | undefined;
|
|
44
44
|
floatingId: string;
|
|
45
45
|
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
package/dist-types/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
type ChainedFunction<Args extends any[], This> = ((this: This, ...args: Args) => any) | undefined | null;
|
|
2
2
|
export declare function createChainedFunction<Args extends any[], This>(...funcs: ChainedFunction<Args, This>[]): (this: This, ...args: Args) => any;
|
|
3
3
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
|
|
2
|
-
export
|
|
2
|
+
export type inferElementType<T> = T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] extends DetailedHTMLProps<AnchorHTMLAttributes<any>, infer Elem> ? Elem : never : HTMLElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ClassNamePrefixer = (...names: string[]) => string;
|
|
2
2
|
export declare const makePrefixer: (prefix: string) => ClassNamePrefixer;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType, PropsWithChildren } from "react";
|
|
2
|
-
|
|
2
|
+
type AsProp<T extends ElementType> = {
|
|
3
3
|
/**
|
|
4
4
|
* The HTML element used for the root node.
|
|
5
5
|
*/
|
|
6
6
|
as?: T;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
8
|
+
type PropsToOmit<T extends ElementType, P> = keyof (AsProp<T> & P);
|
|
9
|
+
type PolymorphicComponentProp<T extends ElementType, Props> = PropsWithChildren<Props & AsProp<T>> & Omit<ComponentPropsWithoutRef<T>, PropsToOmit<T, Props>>;
|
|
10
|
+
export type PolymorphicRef<T extends ElementType> = ComponentPropsWithRef<T>["ref"];
|
|
11
|
+
export type PolymorphicComponentPropWithRef<T extends ElementType, Props> = PolymorphicComponentProp<T, Props> & {
|
|
12
12
|
ref?: PolymorphicRef<T>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -41,7 +41,7 @@ export interface UseFloatingUIProps extends Pick<UseFloatingOptions, "placement"
|
|
|
41
41
|
*/
|
|
42
42
|
middleware?: Middleware[];
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
type GetMiddleware = (middleware: Middleware[]) => Middleware[];
|
|
45
45
|
interface FloatingPlatformContextType {
|
|
46
46
|
platform: Platform;
|
|
47
47
|
middleware: GetMiddleware;
|
|
@@ -58,19 +58,9 @@ export declare function useFloatingPlatform(): FloatingPlatformContextType;
|
|
|
58
58
|
export declare const DEFAULT_FLOATING_UI_MIDDLEWARE: {
|
|
59
59
|
name: string;
|
|
60
60
|
options?: any;
|
|
61
|
-
fn: (state:
|
|
62
|
-
x: number;
|
|
63
|
-
y: number;
|
|
64
|
-
placement: import("@floating-ui/utils").Placement;
|
|
65
|
-
strategy: Strategy;
|
|
66
|
-
platform: import("@floating-ui/core").Platform;
|
|
67
|
-
initialPlacement: import("@floating-ui/utils").Placement;
|
|
68
|
-
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
69
|
-
rects: import("@floating-ui/utils").ElementRects;
|
|
70
|
-
elements: import("@floating-ui/dom").Elements;
|
|
71
|
-
}) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
|
|
61
|
+
fn: (state: import("@floating-ui/dom").MiddlewareState) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
|
|
72
62
|
}[];
|
|
73
|
-
|
|
63
|
+
type UseFloatingRefs = ReturnType<typeof useFloating>["refs"];
|
|
74
64
|
export interface UseFloatingUIReturn extends ReturnType<typeof useFloating> {
|
|
75
65
|
reference: UseFloatingRefs["setReference"];
|
|
76
66
|
floating: UseFloatingRefs["setFloating"];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Breakpoints } from "../breakpoints";
|
|
2
|
-
|
|
2
|
+
type BreakpointProp<T> = {
|
|
3
3
|
[K in keyof Breakpoints]?: T;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type ResponsiveProp<T> = T | BreakpointProp<T>;
|
|
6
6
|
export declare const getCurrentBreakpoint: (breakpoints: Breakpoints, width: number) => keyof Breakpoints;
|
|
7
7
|
export declare const useCurrentBreakpoint: () => keyof Breakpoints;
|
|
8
8
|
export declare const useOrderedBreakpoints: () => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Dispatch } from "react";
|
|
2
|
-
|
|
2
|
+
type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;
|
|
3
3
|
export declare function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>];
|
|
4
4
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
declare const ViewportContext: import("react").Context<number | null>;
|
|
3
|
-
|
|
3
|
+
type ViewportProviderProps = {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
};
|
|
6
6
|
declare const ViewportProvider: ({ children }: ViewportProviderProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salt-ds/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@floating-ui/react": "^0.26.28",
|
|
17
|
-
"@salt-ds/icons": "^1.
|
|
17
|
+
"@salt-ds/icons": "^1.14.0",
|
|
18
18
|
"@salt-ds/styles": "0.2.1",
|
|
19
19
|
"@salt-ds/window": "0.1.1",
|
|
20
20
|
"clsx": "^2.0.0"
|