@salt-ds/core 1.40.0 → 1.42.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/CHANGELOG.md +63 -0
- package/css/salt-core.css +210 -50
- package/dist-cjs/accordion/AccordionHeader.css.js +1 -1
- package/dist-cjs/avatar/Avatar.css.js +1 -1
- package/dist-cjs/avatar/Avatar.js +9 -8
- package/dist-cjs/avatar/Avatar.js.map +1 -1
- package/dist-cjs/border-item/BorderItem.js.map +1 -1
- package/dist-cjs/border-layout/BorderLayout.js.map +1 -1
- package/dist-cjs/button/Button.css.js +1 -1
- package/dist-cjs/card/Card.css.js +1 -1
- package/dist-cjs/card/Card.js.map +1 -1
- package/dist-cjs/combo-box/ComboBox.js +4 -4
- package/dist-cjs/combo-box/ComboBox.js.map +1 -1
- package/dist-cjs/dialog/Dialog.js +1 -0
- package/dist-cjs/dialog/Dialog.js.map +1 -1
- package/dist-cjs/flex-item/FlexItem.js +3 -8
- package/dist-cjs/flex-item/FlexItem.js.map +1 -1
- package/dist-cjs/flex-layout/FlexLayout.js +4 -9
- package/dist-cjs/flex-layout/FlexLayout.js.map +1 -1
- package/dist-cjs/flex-layout/parseSpacing.js +11 -0
- package/dist-cjs/flex-layout/parseSpacing.js.map +1 -0
- package/dist-cjs/form-field/FormField.css.js +1 -1
- package/dist-cjs/grid-item/GridItem.css.js +1 -1
- package/dist-cjs/grid-item/GridItem.js +7 -0
- package/dist-cjs/grid-item/GridItem.js.map +1 -1
- package/dist-cjs/grid-layout/GridLayout.css.js +1 -1
- package/dist-cjs/grid-layout/GridLayout.js +9 -8
- package/dist-cjs/grid-layout/GridLayout.js.map +1 -1
- package/dist-cjs/interactable-card/InteractableCard.css.js +1 -1
- package/dist-cjs/link/Link.css.js +1 -1
- package/dist-cjs/link/Link.js +11 -2
- package/dist-cjs/link/Link.js.map +1 -1
- package/dist-cjs/link-card/LinkCard.css.js +1 -1
- package/dist-cjs/menu/MenuItem.css.js +1 -1
- package/dist-cjs/option/Option.css.js +1 -1
- package/dist-cjs/pagination/PageButton.css.js +1 -1
- package/dist-cjs/pagination/PageButton.js +2 -3
- package/dist-cjs/pagination/PageButton.js.map +1 -1
- package/dist-cjs/pagination/Paginator.css.js +1 -1
- package/dist-cjs/skip-link/SkipLink.css.js +1 -1
- package/dist-cjs/text/Text.css.js +1 -1
- package/dist-cjs/utils/useFloatingUI/useFloatingUI.js +3 -0
- package/dist-cjs/utils/useFloatingUI/useFloatingUI.js.map +1 -1
- package/dist-cjs/utils/usePreventScroll.js +233 -0
- package/dist-cjs/utils/usePreventScroll.js.map +1 -0
- package/dist-es/accordion/AccordionHeader.css.js +1 -1
- package/dist-es/avatar/Avatar.css.js +1 -1
- package/dist-es/avatar/Avatar.js +9 -8
- package/dist-es/avatar/Avatar.js.map +1 -1
- package/dist-es/border-item/BorderItem.js.map +1 -1
- package/dist-es/border-layout/BorderLayout.js.map +1 -1
- package/dist-es/button/Button.css.js +1 -1
- package/dist-es/card/Card.css.js +1 -1
- package/dist-es/card/Card.js.map +1 -1
- package/dist-es/combo-box/ComboBox.js +4 -4
- package/dist-es/combo-box/ComboBox.js.map +1 -1
- package/dist-es/dialog/Dialog.js +1 -0
- package/dist-es/dialog/Dialog.js.map +1 -1
- package/dist-es/flex-item/FlexItem.js +1 -6
- package/dist-es/flex-item/FlexItem.js.map +1 -1
- package/dist-es/flex-layout/FlexLayout.js +1 -6
- package/dist-es/flex-layout/FlexLayout.js.map +1 -1
- package/dist-es/flex-layout/parseSpacing.js +9 -0
- package/dist-es/flex-layout/parseSpacing.js.map +1 -0
- package/dist-es/form-field/FormField.css.js +1 -1
- package/dist-es/grid-item/GridItem.css.js +1 -1
- package/dist-es/grid-item/GridItem.js +7 -0
- package/dist-es/grid-item/GridItem.js.map +1 -1
- package/dist-es/grid-layout/GridLayout.css.js +1 -1
- package/dist-es/grid-layout/GridLayout.js +7 -6
- package/dist-es/grid-layout/GridLayout.js.map +1 -1
- package/dist-es/interactable-card/InteractableCard.css.js +1 -1
- package/dist-es/link/Link.css.js +1 -1
- package/dist-es/link/Link.js +11 -2
- package/dist-es/link/Link.js.map +1 -1
- package/dist-es/link-card/LinkCard.css.js +1 -1
- package/dist-es/menu/MenuItem.css.js +1 -1
- package/dist-es/option/Option.css.js +1 -1
- package/dist-es/pagination/PageButton.css.js +1 -1
- package/dist-es/pagination/PageButton.js +2 -3
- package/dist-es/pagination/PageButton.js.map +1 -1
- package/dist-es/pagination/Paginator.css.js +1 -1
- package/dist-es/skip-link/SkipLink.css.js +1 -1
- package/dist-es/text/Text.css.js +1 -1
- package/dist-es/utils/useFloatingUI/useFloatingUI.js +3 -0
- package/dist-es/utils/useFloatingUI/useFloatingUI.js.map +1 -1
- package/dist-es/utils/usePreventScroll.js +231 -0
- package/dist-es/utils/usePreventScroll.js.map +1 -0
- package/dist-types/avatar/Avatar.d.ts +5 -1
- package/dist-types/border-item/BorderItem.d.ts +9 -1
- package/dist-types/border-layout/BorderLayout.d.ts +9 -1
- package/dist-types/card/Card.d.ts +1 -1
- package/dist-types/flex-layout/parseSpacing.d.ts +1 -0
- package/dist-types/grid-item/GridItem.d.ts +8 -0
- package/dist-types/grid-layout/GridLayout.d.ts +8 -0
- package/dist-types/link/Link.d.ts +13 -1
- package/dist-types/utils/useFloatingUI/useFloatingUI.d.ts +4 -0
- package/dist-types/utils/usePreventScroll.d.ts +11 -0
- package/package.json +2 -2
|
@@ -24,6 +24,6 @@ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
24
24
|
/**
|
|
25
25
|
* Styling variant. Defaults to "primary".
|
|
26
26
|
*/
|
|
27
|
-
variant?: "primary" | "secondary" | "tertiary";
|
|
27
|
+
variant?: "primary" | "secondary" | "tertiary" | "ghost";
|
|
28
28
|
}
|
|
29
29
|
export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseSpacing(value: number | string | undefined): string | undefined;
|
|
@@ -20,6 +20,14 @@ export declare type GridItemProps<T extends ElementType> = PolymorphicComponentP
|
|
|
20
20
|
* Aligns a grid item inside a cell along the block (column) axis. Defaults to "stretch"
|
|
21
21
|
*/
|
|
22
22
|
verticalAlignment?: GridAlignment;
|
|
23
|
+
/**
|
|
24
|
+
* Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.
|
|
25
|
+
*/
|
|
26
|
+
margin?: ResponsiveProp<number | string>;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.
|
|
29
|
+
*/
|
|
30
|
+
padding?: ResponsiveProp<number | string>;
|
|
23
31
|
}>;
|
|
24
32
|
declare type GridItemComponent = <T extends ElementType = "div">(props: GridItemProps<T>) => ReactElement | null;
|
|
25
33
|
export declare const GridItem: GridItemComponent;
|
|
@@ -21,6 +21,14 @@ export declare type GridLayoutProps<T extends ElementType> = PolymorphicComponen
|
|
|
21
21
|
* Defines the size of the gutter between the rows by setting a density multiplier. Defaults to 1
|
|
22
22
|
*/
|
|
23
23
|
rowGap?: ResponsiveProp<number | string>;
|
|
24
|
+
/**
|
|
25
|
+
* Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.
|
|
26
|
+
*/
|
|
27
|
+
margin?: ResponsiveProp<number | string>;
|
|
28
|
+
/**
|
|
29
|
+
* Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.
|
|
30
|
+
*/
|
|
31
|
+
padding?: ResponsiveProp<number | string>;
|
|
24
32
|
}>;
|
|
25
33
|
declare type GridLayoutComponent = <T extends ElementType = "div">(props: GridLayoutProps<T>) => ReactElement | null;
|
|
26
34
|
export declare const GridLayout: GridLayoutComponent;
|
|
@@ -8,11 +8,23 @@ import { type RenderPropsType } from "../utils";
|
|
|
8
8
|
* @example
|
|
9
9
|
* <LinkExample to="#link">Action</LinkExample>
|
|
10
10
|
*/
|
|
11
|
-
export interface LinkProps extends Omit<ComponentPropsWithoutRef<"a">, "color">, Pick<TextProps<"a">, "maxRows" | "styleAs" | "
|
|
11
|
+
export interface LinkProps extends Omit<ComponentPropsWithoutRef<"a">, "color">, Pick<TextProps<"a">, "maxRows" | "styleAs" | "variant"> {
|
|
12
|
+
/**
|
|
13
|
+
* Icon component displayed for external links. Defaults to `ExternalIcon` from `SemanticIconProvider`.
|
|
14
|
+
*/
|
|
12
15
|
IconComponent?: ComponentType<IconProps> | null;
|
|
13
16
|
/**
|
|
14
17
|
* Render prop to enable customisation of anchor element.
|
|
15
18
|
*/
|
|
16
19
|
render?: RenderPropsType["render"];
|
|
20
|
+
color?: "inherit" | "primary" | "secondary" | "accent";
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* Either "default" or "never".
|
|
24
|
+
* Determines when underline should be applied to the link.
|
|
25
|
+
*
|
|
26
|
+
* @default "default".
|
|
27
|
+
*/
|
|
28
|
+
underline?: "default" | "never";
|
|
17
29
|
}
|
|
18
30
|
export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -21,6 +21,10 @@ export interface FloatingComponentProps extends ComponentPropsWithoutRef<"div">
|
|
|
21
21
|
width?: number;
|
|
22
22
|
height?: number;
|
|
23
23
|
position?: Strategy;
|
|
24
|
+
/**
|
|
25
|
+
* Makes the page unscrollable when the floating component is open.
|
|
26
|
+
*/
|
|
27
|
+
lockScroll?: boolean;
|
|
24
28
|
}
|
|
25
29
|
declare const DefaultFloatingComponent: import("react").ForwardRefExoticComponent<FloatingComponentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
30
|
export interface FloatingComponentContextType {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface PreventScrollOptions {
|
|
2
|
+
/** Whether the scroll lock is disabled. */
|
|
3
|
+
isDisabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Prevents scrolling on the document body on mount, and
|
|
7
|
+
* restores it on unmount. Also ensures that content does not
|
|
8
|
+
* shift due to the scrollbars disappearing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePreventScroll(options?: PreventScrollOptions): void;
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salt-ds/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
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.13.
|
|
17
|
+
"@salt-ds/icons": "^1.13.2",
|
|
18
18
|
"@salt-ds/styles": "0.2.1",
|
|
19
19
|
"@salt-ds/window": "0.1.1",
|
|
20
20
|
"clsx": "^2.0.0"
|