@salt-ds/core 1.40.0 → 1.41.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/css/salt-core.css +137 -26
  3. package/dist-cjs/avatar/Avatar.css.js +1 -1
  4. package/dist-cjs/avatar/Avatar.js +9 -8
  5. package/dist-cjs/avatar/Avatar.js.map +1 -1
  6. package/dist-cjs/border-item/BorderItem.js.map +1 -1
  7. package/dist-cjs/border-layout/BorderLayout.js.map +1 -1
  8. package/dist-cjs/combo-box/ComboBox.js +4 -4
  9. package/dist-cjs/combo-box/ComboBox.js.map +1 -1
  10. package/dist-cjs/flex-item/FlexItem.js +5 -10
  11. package/dist-cjs/flex-item/FlexItem.js.map +1 -1
  12. package/dist-cjs/flex-layout/FlexLayout.js +6 -11
  13. package/dist-cjs/flex-layout/FlexLayout.js.map +1 -1
  14. package/dist-cjs/flex-layout/parseSpacing.js +11 -0
  15. package/dist-cjs/flex-layout/parseSpacing.js.map +1 -0
  16. package/dist-cjs/form-field/FormField.css.js +1 -1
  17. package/dist-cjs/grid-item/GridItem.css.js +1 -1
  18. package/dist-cjs/grid-item/GridItem.js +7 -0
  19. package/dist-cjs/grid-item/GridItem.js.map +1 -1
  20. package/dist-cjs/grid-layout/GridLayout.css.js +1 -1
  21. package/dist-cjs/grid-layout/GridLayout.js +9 -8
  22. package/dist-cjs/grid-layout/GridLayout.js.map +1 -1
  23. package/dist-cjs/link/Link.css.js +1 -1
  24. package/dist-cjs/link/Link.js +8 -2
  25. package/dist-cjs/link/Link.js.map +1 -1
  26. package/dist-cjs/menu/MenuItem.css.js +1 -1
  27. package/dist-cjs/option/Option.css.js +1 -1
  28. package/dist-es/avatar/Avatar.css.js +1 -1
  29. package/dist-es/avatar/Avatar.js +9 -8
  30. package/dist-es/avatar/Avatar.js.map +1 -1
  31. package/dist-es/border-item/BorderItem.js.map +1 -1
  32. package/dist-es/border-layout/BorderLayout.js.map +1 -1
  33. package/dist-es/combo-box/ComboBox.js +4 -4
  34. package/dist-es/combo-box/ComboBox.js.map +1 -1
  35. package/dist-es/flex-item/FlexItem.js +3 -8
  36. package/dist-es/flex-item/FlexItem.js.map +1 -1
  37. package/dist-es/flex-layout/FlexLayout.js +3 -8
  38. package/dist-es/flex-layout/FlexLayout.js.map +1 -1
  39. package/dist-es/flex-layout/parseSpacing.js +9 -0
  40. package/dist-es/flex-layout/parseSpacing.js.map +1 -0
  41. package/dist-es/form-field/FormField.css.js +1 -1
  42. package/dist-es/grid-item/GridItem.css.js +1 -1
  43. package/dist-es/grid-item/GridItem.js +7 -0
  44. package/dist-es/grid-item/GridItem.js.map +1 -1
  45. package/dist-es/grid-layout/GridLayout.css.js +1 -1
  46. package/dist-es/grid-layout/GridLayout.js +7 -6
  47. package/dist-es/grid-layout/GridLayout.js.map +1 -1
  48. package/dist-es/link/Link.css.js +1 -1
  49. package/dist-es/link/Link.js +8 -2
  50. package/dist-es/link/Link.js.map +1 -1
  51. package/dist-es/menu/MenuItem.css.js +1 -1
  52. package/dist-es/option/Option.css.js +1 -1
  53. package/dist-types/avatar/Avatar.d.ts +5 -1
  54. package/dist-types/border-item/BorderItem.d.ts +9 -1
  55. package/dist-types/border-layout/BorderLayout.d.ts +9 -1
  56. package/dist-types/flex-layout/parseSpacing.d.ts +1 -0
  57. package/dist-types/grid-item/GridItem.d.ts +8 -0
  58. package/dist-types/grid-layout/GridLayout.d.ts +8 -0
  59. package/dist-types/link/Link.d.ts +2 -1
  60. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { type ElementType, type ReactElement } from "react";
2
2
  import { type GridItemProps } from "../grid-item";
3
- import { type PolymorphicComponentPropWithRef } from "../utils";
3
+ import { type PolymorphicComponentPropWithRef, type ResponsiveProp } from "../utils";
4
4
  export declare const BORDER_POSITION: readonly ["north", "west", "center", "east", "south"];
5
5
  export declare type BorderPosition = (typeof BORDER_POSITION)[number];
6
6
  export declare type BorderItemProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
@@ -20,6 +20,14 @@ export declare type BorderItemProps<T extends ElementType> = PolymorphicComponen
20
20
  * Defines if the item should stick to the edges of its container. Defaults to "false"
21
21
  */
22
22
  sticky?: boolean;
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 BorderItemComponent = <T extends ElementType = "div">(props: BorderItemProps<T>) => ReactElement | null;
25
33
  export declare const BorderItem: BorderItemComponent;
@@ -1,7 +1,7 @@
1
1
  import { type ElementType, type ReactElement } from "react";
2
2
  import type { BorderItemProps } from "../border-item";
3
3
  import { type GridLayoutProps } from "../grid-layout";
4
- import { type PolymorphicComponentPropWithRef } from "../utils";
4
+ import { type PolymorphicComponentPropWithRef, type ResponsiveProp } from "../utils";
5
5
  export declare type BorderLayoutProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
6
6
  /**
7
7
  * Defines the size of the gutter between the columns and the rows by setting a density multiplier. Defaults to 0
@@ -19,6 +19,14 @@ export declare type BorderLayoutProps<T extends ElementType> = PolymorphicCompon
19
19
  * Border item components to be rendered.
20
20
  */
21
21
  children: ReactElement<BorderItemProps<T>>[];
22
+ /**
23
+ * 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`.
24
+ */
25
+ margin?: ResponsiveProp<number | string>;
26
+ /**
27
+ * 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`.
28
+ */
29
+ padding?: ResponsiveProp<number | string>;
22
30
  }>;
23
31
  declare type BorderLayoutComponent = <T extends ElementType = "div">(props: BorderLayoutProps<T>) => ReactElement | null;
24
32
  export declare const BorderLayout: BorderLayoutComponent;
@@ -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,12 @@ 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" | "color" | "variant"> {
11
+ export interface LinkProps extends Omit<ComponentPropsWithoutRef<"a">, "color">, Pick<TextProps<"a">, "maxRows" | "styleAs" | "variant"> {
12
12
  IconComponent?: ComponentType<IconProps> | null;
13
13
  /**
14
14
  * Render prop to enable customisation of anchor element.
15
15
  */
16
16
  render?: RenderPropsType["render"];
17
+ color?: "inherit" | "primary" | "secondary" | "accent";
17
18
  }
18
19
  export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salt-ds/core",
3
- "version": "1.40.0",
3
+ "version": "1.41.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.1",
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"