@obosbbl/grunnmuren-react 1.10.0 → 1.11.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.
@@ -6,7 +6,7 @@ export declare const HeroContext: import("react").Context<{
6
6
  }>;
7
7
  export type HeroColor = 'green' | 'blue' | 'white';
8
8
  export type HeroContentPosition = 'below-center' | 'below-left' | 'top-left' | 'bottom-left' | 'top-right' | 'bottom-right' | 'center' | 'vertical-split';
9
- export interface HeroProps {
9
+ export interface HeroProps extends React.ComponentPropsWithoutRef<'div'> {
10
10
  /** @default white */
11
11
  bgColor?: HeroColor;
12
12
  className?: string;
@@ -18,4 +18,4 @@ export interface HeroProps {
18
18
  /** Instance of HeroImage */
19
19
  image?: React.ReactNode;
20
20
  }
21
- export declare const Hero: (props: HeroProps) => JSX.Element;
21
+ export declare const Hero: import("react").ForwardRefExoticComponent<HeroProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- interface HeroActionsProps {
2
+ interface HeroActionsProps extends React.ComponentPropsWithoutRef<'div'> {
3
3
  className?: string;
4
4
  children?: React.ReactNode;
5
5
  }
6
- export declare const HeroActions: (props: HeroActionsProps) => JSX.Element;
6
+ export declare const HeroActions: import("react").ForwardRefExoticComponent<HeroActionsProps & import("react").RefAttributes<HTMLDivElement>>;
7
7
  export {};
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- interface HeroContentProps {
2
+ interface HeroContentProps extends React.ComponentPropsWithoutRef<'div'> {
3
3
  children?: React.ReactNode;
4
4
  className?: string;
5
5
  heading: string;
6
6
  description?: string;
7
7
  }
8
- export declare const HeroContent: (props: HeroContentProps) => JSX.Element;
8
+ export declare const HeroContent: import("react").ForwardRefExoticComponent<HeroContentProps & import("react").RefAttributes<HTMLDivElement>>;
9
9
  export {};
@@ -3,6 +3,7 @@ interface HeroImageProps {
3
3
  src: string;
4
4
  mdSrc: string;
5
5
  alt?: string;
6
+ className?: string;
6
7
  }
7
- export declare const HeroImage: (props: HeroImageProps) => JSX.Element;
8
+ export declare const HeroImage: import("react").ForwardRefExoticComponent<HeroImageProps & import("react").RefAttributes<HTMLPictureElement>>;
8
9
  export {};
@@ -856,7 +856,7 @@ const HeroContext = createContext({
856
856
  contentPosition: "below-center",
857
857
  hasImage: false
858
858
  });
859
- const Hero = (props) => {
859
+ const Hero = forwardRef((props, ref) => {
860
860
  const _a = props, {
861
861
  bgColor = "white",
862
862
  children,
@@ -889,23 +889,25 @@ const Hero = (props) => {
889
889
  gridTemplateAreas: '"hero"'
890
890
  } : void 0
891
891
  }, rest), {
892
+ ref,
892
893
  children: [image, children]
893
894
  }))
894
895
  })
895
896
  });
896
- };
897
- const HeroImage = (props) => {
897
+ });
898
+ const HeroImage = forwardRef((props, ref) => {
898
899
  const {
899
900
  contentPosition
900
901
  } = useContext(HeroContext);
901
902
  return /* @__PURE__ */ jsxs("picture", {
902
- className: cx("aspect-w-6 aspect-h-7 block", {
903
+ className: cx(props.className, "aspect-w-6 aspect-h-7 block", {
903
904
  "sm:aspect-w-8 sm:aspect-h-4": contentPosition !== "vertical-split",
904
905
  "sm:aspect-w-8 sm:aspect-h-8": contentPosition === "vertical-split"
905
906
  }),
906
907
  style: contentPosition !== "vertical-split" && contentPosition !== "below-center" && contentPosition !== "below-left" ? {
907
908
  gridArea: "hero"
908
909
  } : void 0,
910
+ ref,
909
911
  children: [/* @__PURE__ */ jsx("source", {
910
912
  media: "(min-width: 768px)",
911
913
  srcSet: props.mdSrc
@@ -916,8 +918,8 @@ const HeroImage = (props) => {
916
918
  alt: props.alt
917
919
  })]
918
920
  });
919
- };
920
- const HeroContent = (props) => {
921
+ });
922
+ const HeroContent = forwardRef((props, ref) => {
921
923
  const {
922
924
  bgColor,
923
925
  contentPosition,
@@ -957,15 +959,16 @@ const HeroContent = (props) => {
957
959
  style: usesGridArea ? {
958
960
  gridArea: "hero"
959
961
  } : void 0,
962
+ ref,
960
963
  children: [/* @__PURE__ */ jsx("h1", {
961
964
  children: heading
962
965
  }), description && /* @__PURE__ */ jsx("p", {
963
- className: "text-lg md:text-xl",
966
+ className: "text-lg font-semibold md:text-xl",
964
967
  children: description
965
968
  }), children]
966
969
  }));
967
- };
968
- const HeroActions = (props) => {
970
+ });
971
+ const HeroActions = forwardRef((props, ref) => {
969
972
  const _a = props, {
970
973
  className
971
974
  } = _a, rest = __objRest(_a, [
@@ -974,12 +977,14 @@ const HeroActions = (props) => {
974
977
  const {
975
978
  contentPosition
976
979
  } = useContext(HeroContext);
977
- return /* @__PURE__ */ jsx("div", __spreadValues({
980
+ return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({
978
981
  className: cx(className, "grid items-center justify-center justify-items-center gap-4 md:grid-flow-col", {
979
982
  "md:justify-start": contentPosition === "vertical-split" || contentPosition === "below-left"
980
983
  })
981
- }, rest));
982
- };
984
+ }, rest), {
985
+ ref
986
+ }));
987
+ });
983
988
  const Input = forwardRef((props, ref) => {
984
989
  const _a = props, {
985
990
  className,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "OBOS Grunnmuren design system React components",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -24,16 +24,16 @@
24
24
  "@storybook/builder-webpack5": "6.5.15",
25
25
  "@storybook/manager-webpack5": "6.5.15",
26
26
  "@storybook/react": "6.5.15",
27
- "@types/react": "18.0.26",
27
+ "@types/react": "18.0.27",
28
28
  "@types/react-dom": "18.0.10",
29
29
  "@vitejs/plugin-react": "1.3.2",
30
30
  "postcss": "8.4.21",
31
31
  "react": "18.2.0",
32
32
  "react-dom": "18.2.0",
33
33
  "require-from-string": "2.0.2",
34
- "rimraf": "4.0.7",
34
+ "rimraf": "4.1.2",
35
35
  "tailwindcss": "3.2.4",
36
- "type-fest": "3.5.2",
36
+ "type-fest": "3.5.3",
37
37
  "vite": "2.9.15",
38
38
  "webpack": "5.75.0",
39
39
  "@obosbbl/grunnmuren-tailwind": "0.8.4"