@obosbbl/grunnmuren-react 1.9.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.
- package/dist/Accordion/stories/Accordion.stories.d.ts +10 -0
- package/dist/Alert/stories/Alert.stories.d.ts +6 -0
- package/dist/Banner/stories/Banner.stories.d.ts +6 -0
- package/dist/Button/stories/Button.stories.d.ts +32 -0
- package/dist/Campaign/Campaign.d.ts +4 -5
- package/dist/Campaign/stories/Campaign.stories.d.ts +10 -0
- package/dist/Card/Card.d.ts +1 -1
- package/dist/Card/CardContent.d.ts +1 -1
- package/dist/Card/CardImage.d.ts +1 -1
- package/dist/Card/CardList.d.ts +1 -1
- package/dist/Card/stories/Card.stories.d.ts +35 -0
- package/dist/Checkbox/stories/Checkbox.stories.d.ts +9 -0
- package/dist/Chip/stories/Chip.stories.d.ts +6 -0
- package/dist/Footer/stories/Footer.stories.d.ts +6 -0
- package/dist/Form/stories/Form.stories.d.ts +14 -0
- package/dist/Hero/Hero.d.ts +2 -2
- package/dist/Hero/HeroActions.d.ts +2 -2
- package/dist/Hero/HeroContent.d.ts +2 -2
- package/dist/Hero/HeroImage.d.ts +2 -1
- package/dist/Hero/stories/Hero.stories.d.ts +34 -0
- package/dist/Input/stories/Input.stories.d.ts +9 -0
- package/dist/Navbar/stories/Navbar.stories.d.ts +6 -0
- package/dist/Pagination/stories/Pagination.stories.d.ts +25 -0
- package/dist/Radio/stories/Radio.stories.d.ts +13 -0
- package/dist/Select/stories/Select.stories.d.ts +27 -0
- package/dist/Snackbar/stories/Snackbar.stories.d.ts +10 -0
- package/dist/StepList/stories/StepList.stories.d.ts +20 -0
- package/dist/TextArea/stories/TextArea.stories.d.ts +9 -0
- package/dist/TextField/stories/TextField.stories.d.ts +10 -0
- package/dist/grunnmuren.es.js +58 -37
- package/package.json +6 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Composition: {
|
|
3
|
+
readonly Text: "Text";
|
|
4
|
+
readonly Icon: "Icon";
|
|
5
|
+
readonly TextIcon: "Text Icon";
|
|
6
|
+
readonly IconText: "Icon Text";
|
|
7
|
+
};
|
|
8
|
+
type CompositionValue = (typeof Composition)[keyof typeof Composition];
|
|
9
|
+
declare const _default: {
|
|
10
|
+
title: string;
|
|
11
|
+
argTypes: {
|
|
12
|
+
composition: {
|
|
13
|
+
options: ("Text" | "Icon" | "Text Icon" | "Icon Text")[];
|
|
14
|
+
control: string;
|
|
15
|
+
defaultValue: "Text";
|
|
16
|
+
};
|
|
17
|
+
disabled: {
|
|
18
|
+
control: string;
|
|
19
|
+
defaultValue: boolean;
|
|
20
|
+
};
|
|
21
|
+
loading: {
|
|
22
|
+
control: string;
|
|
23
|
+
defaultValue: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
export declare const Default: (props: {
|
|
29
|
+
composition: CompositionValue;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
loading: boolean;
|
|
32
|
+
}) => JSX.Element;
|
|
@@ -13,13 +13,12 @@ interface CampaignProps<T extends React.ElementType> {
|
|
|
13
13
|
*/
|
|
14
14
|
rightAlignBody?: boolean;
|
|
15
15
|
}
|
|
16
|
-
declare const Campaign: {
|
|
17
|
-
<T extends import("react").ElementType<any> = "div">(props: CampaignProps<T> & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<T>>, keyof CampaignProps<T>>): JSX.Element;
|
|
18
|
-
Body: (props: CampaignBodyProps) => JSX.Element;
|
|
19
|
-
Image: (props: CampaignImageProps) => JSX.Element;
|
|
20
|
-
};
|
|
21
16
|
interface CampaignBodyProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
22
17
|
}
|
|
23
18
|
interface CampaignImageProps extends React.ComponentPropsWithoutRef<'img'> {
|
|
24
19
|
}
|
|
20
|
+
declare const Campaign: import("react").ForwardRefExoticComponent<Pick<CampaignProps<import("react").ElementType<any>> & Omit<Pick<any, string | number | symbol>, keyof CampaignProps<T>>, string | number | symbol> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
21
|
+
Body: import("react").ForwardRefExoticComponent<CampaignBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
Image: import("react").ForwardRefExoticComponent<CampaignImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
23
|
+
};
|
|
25
24
|
export { Campaign };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Default: () => JSX.Element;
|
|
10
|
+
export declare const WithCustomImageComponent: () => JSX.Element;
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export interface CardProps<T extends React.ElementType> {
|
|
|
5
5
|
/** @default white */
|
|
6
6
|
bgColor?: 'white' | 'gray';
|
|
7
7
|
}
|
|
8
|
-
export declare const Card: <
|
|
8
|
+
export declare const Card: import("react").ForwardRefExoticComponent<Pick<CardProps<import("react").ElementType<any>> & Omit<Pick<any, string | number | symbol>, keyof CardProps<T>>, string | number | symbol> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface CardContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
}
|
|
4
|
-
export declare const CardContent: (
|
|
4
|
+
export declare const CardContent: import("react").ForwardRefExoticComponent<CardContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export {};
|
package/dist/Card/CardImage.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ interface CardImageProps extends React.ComponentPropsWithoutRef<'img'> {
|
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
5
|
}
|
|
6
|
-
export declare const CardImage: (
|
|
6
|
+
export declare const CardImage: import("react").ForwardRefExoticComponent<CardImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
7
7
|
export {};
|
package/dist/Card/CardList.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { BlockBackgroundColor } from '../hooks';
|
|
|
3
3
|
interface CardListProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
4
4
|
bgColor?: BlockBackgroundColor;
|
|
5
5
|
}
|
|
6
|
-
export declare const CardList: (
|
|
6
|
+
export declare const CardList: import("react").ForwardRefExoticComponent<CardListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CardProps } from '../../';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
bgColor: {
|
|
10
|
+
options: string[];
|
|
11
|
+
control: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Default: {
|
|
19
|
+
(props: CardProps<'div'>): JSX.Element;
|
|
20
|
+
args: {
|
|
21
|
+
bgColor: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const Link: {
|
|
25
|
+
(props: CardProps<'div'>): JSX.Element;
|
|
26
|
+
args: {
|
|
27
|
+
bgColor: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare const CardList: {
|
|
31
|
+
(): JSX.Element;
|
|
32
|
+
parameters: {
|
|
33
|
+
layout: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const metadata: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export default metadata;
|
|
9
|
+
export declare const Label: () => JSX.Element;
|
|
10
|
+
export declare const ErrorMessage: () => JSX.Element;
|
|
11
|
+
export declare const Success: () => JSX.Element;
|
|
12
|
+
export declare const HelperText: () => JSX.Element;
|
|
13
|
+
export declare const Form: () => JSX.Element;
|
|
14
|
+
export declare const FormError: () => JSX.Element;
|
package/dist/Hero/Hero.d.ts
CHANGED
|
@@ -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: (
|
|
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: (
|
|
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: (
|
|
8
|
+
export declare const HeroContent: import("react").ForwardRefExoticComponent<HeroContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export {};
|
package/dist/Hero/HeroImage.d.ts
CHANGED
|
@@ -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: (
|
|
8
|
+
export declare const HeroImage: import("react").ForwardRefExoticComponent<HeroImageProps & import("react").RefAttributes<HTMLPictureElement>>;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HeroProps } from '../../';
|
|
3
|
+
declare const metadata: {
|
|
4
|
+
title: string;
|
|
5
|
+
argTypes: {
|
|
6
|
+
contentPosition: {
|
|
7
|
+
options: string[];
|
|
8
|
+
control: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
bgColor: {
|
|
13
|
+
options: string[];
|
|
14
|
+
control: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default metadata;
|
|
21
|
+
export declare function WithImage(props: HeroProps): JSX.Element;
|
|
22
|
+
export declare namespace WithImage {
|
|
23
|
+
var args: {
|
|
24
|
+
readonly contentPosition: "below-center";
|
|
25
|
+
readonly bgColor: "white";
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare function WithoutImage(props: HeroProps): JSX.Element;
|
|
29
|
+
export declare namespace WithoutImage {
|
|
30
|
+
var args: {
|
|
31
|
+
contentPosition: string;
|
|
32
|
+
bgColor: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const metadata: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: string;
|
|
6
|
+
};
|
|
7
|
+
argTypes: {
|
|
8
|
+
pageCount: {
|
|
9
|
+
control: {
|
|
10
|
+
type: string;
|
|
11
|
+
min: number;
|
|
12
|
+
max: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default metadata;
|
|
18
|
+
export declare const Default: {
|
|
19
|
+
(props: {
|
|
20
|
+
pageCount: number;
|
|
21
|
+
}): JSX.Element;
|
|
22
|
+
args: {
|
|
23
|
+
pageCount: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const metadata: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export default metadata;
|
|
9
|
+
export declare const Uncontrolled: () => JSX.Element;
|
|
10
|
+
export declare const Controlled: () => JSX.Element;
|
|
11
|
+
export declare const WithLabelAndHelpText: () => JSX.Element;
|
|
12
|
+
export declare const WithLongLabelThatBreaksLines: () => JSX.Element;
|
|
13
|
+
export declare const WithErrorText: () => JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectProps } from '../';
|
|
3
|
+
declare const metadata: {
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
description: {
|
|
10
|
+
defaultValue: string;
|
|
11
|
+
control: string;
|
|
12
|
+
};
|
|
13
|
+
size: {
|
|
14
|
+
defaultValue: string;
|
|
15
|
+
options: string[];
|
|
16
|
+
control: {
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
required: {
|
|
21
|
+
defaultValue: boolean;
|
|
22
|
+
control: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default metadata;
|
|
27
|
+
export declare const Default: (props: SelectProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const metadata: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export default metadata;
|
|
9
|
+
export declare const Default: () => JSX.Element;
|
|
10
|
+
export declare const SnackbarWithContent: () => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StepListProps } from '../..';
|
|
3
|
+
declare const metadata: {
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
align: {
|
|
10
|
+
defaultValue: string;
|
|
11
|
+
options: string[];
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default metadata;
|
|
19
|
+
export declare const Numbered: (props: StepListProps) => JSX.Element;
|
|
20
|
+
export declare const Icons: (props: StepListProps) => JSX.Element;
|
package/dist/grunnmuren.es.js
CHANGED
|
@@ -488,7 +488,7 @@ function deeplyWrapStrings(children) {
|
|
|
488
488
|
}
|
|
489
489
|
const ButtonColorContext = createContext("standard");
|
|
490
490
|
const CampaignContext = createContext(true);
|
|
491
|
-
const
|
|
491
|
+
const CampaignInner = (props, ref) => {
|
|
492
492
|
const _a = props, {
|
|
493
493
|
as: Component = "div",
|
|
494
494
|
body: Body,
|
|
@@ -505,23 +505,26 @@ const Campaign = (props) => {
|
|
|
505
505
|
return /* @__PURE__ */ jsxs(Component, __spreadProps(__spreadValues({
|
|
506
506
|
className: cx(className, "grid gap-8 md:grid-flow-col md:grid-cols-[50%,50%] md:gap-0")
|
|
507
507
|
}, rest), {
|
|
508
|
+
ref,
|
|
508
509
|
children: [/* @__PURE__ */ jsx(CampaignContext.Provider, {
|
|
509
510
|
value: rightAlignBody,
|
|
510
511
|
children: Image
|
|
511
512
|
}), Body]
|
|
512
513
|
}));
|
|
513
514
|
};
|
|
514
|
-
const
|
|
515
|
+
const CampaignBase = forwardRef(CampaignInner);
|
|
516
|
+
const CampaignBody = forwardRef((props, ref) => {
|
|
515
517
|
const _a = props, {
|
|
516
518
|
className
|
|
517
519
|
} = _a, rest = __objRest(_a, [
|
|
518
520
|
"className"
|
|
519
521
|
]);
|
|
520
522
|
return /* @__PURE__ */ jsx("div", __spreadValues({
|
|
521
|
-
className: cx(className, "md:mx-18 self-center")
|
|
523
|
+
className: cx(className, "md:mx-18 self-center"),
|
|
524
|
+
ref
|
|
522
525
|
}, rest));
|
|
523
|
-
};
|
|
524
|
-
const CampaignImage = (props) => {
|
|
526
|
+
});
|
|
527
|
+
const CampaignImage = forwardRef((props, ref) => {
|
|
525
528
|
const _a = props, {
|
|
526
529
|
className: classNameProp,
|
|
527
530
|
children
|
|
@@ -534,16 +537,20 @@ const CampaignImage = (props) => {
|
|
|
534
537
|
if (isValidElement(children)) {
|
|
535
538
|
const child = Children.only(children);
|
|
536
539
|
return cloneElement(child, __spreadValues({
|
|
537
|
-
className
|
|
540
|
+
className,
|
|
541
|
+
ref
|
|
538
542
|
}, rest));
|
|
539
543
|
}
|
|
540
544
|
return /* @__PURE__ */ jsx("img", __spreadValues({
|
|
541
|
-
className
|
|
545
|
+
className,
|
|
546
|
+
ref
|
|
542
547
|
}, rest));
|
|
543
|
-
};
|
|
544
|
-
Campaign
|
|
545
|
-
|
|
546
|
-
|
|
548
|
+
});
|
|
549
|
+
const Campaign = Object.assign({}, CampaignBase, {
|
|
550
|
+
Body: CampaignBody,
|
|
551
|
+
Image: CampaignImage
|
|
552
|
+
});
|
|
553
|
+
const CardInner = (props, ref) => {
|
|
547
554
|
const _a = props, {
|
|
548
555
|
as: Component = "div",
|
|
549
556
|
className,
|
|
@@ -553,25 +560,30 @@ const Card = (props) => {
|
|
|
553
560
|
"className",
|
|
554
561
|
"bgColor"
|
|
555
562
|
]);
|
|
556
|
-
return /* @__PURE__ */ jsx(Component, __spreadValues({
|
|
563
|
+
return /* @__PURE__ */ jsx(Component, __spreadProps(__spreadValues({
|
|
557
564
|
className: cx(className, "relative overflow-hidden rounded-3xl", {
|
|
558
565
|
"border-2 border-solid bg-white": bgColor === "white",
|
|
559
566
|
"bg-gray-light": bgColor === "gray"
|
|
560
567
|
})
|
|
561
|
-
}, rest)
|
|
568
|
+
}, rest), {
|
|
569
|
+
ref
|
|
570
|
+
}));
|
|
562
571
|
};
|
|
563
|
-
const
|
|
572
|
+
const Card = forwardRef(CardInner);
|
|
573
|
+
const CardImage = forwardRef((props, ref) => {
|
|
564
574
|
const _a = props, {
|
|
565
575
|
className
|
|
566
576
|
} = _a, rest = __objRest(_a, [
|
|
567
577
|
"className"
|
|
568
578
|
]);
|
|
569
|
-
return /* @__PURE__ */ jsx("img", __spreadValues({
|
|
579
|
+
return /* @__PURE__ */ jsx("img", __spreadProps(__spreadValues({
|
|
570
580
|
className: cx(className, "w-full object-cover"),
|
|
571
581
|
loading: "lazy"
|
|
572
|
-
}, rest)
|
|
573
|
-
|
|
574
|
-
|
|
582
|
+
}, rest), {
|
|
583
|
+
ref
|
|
584
|
+
}));
|
|
585
|
+
});
|
|
586
|
+
const CardList = forwardRef((props, ref) => {
|
|
575
587
|
const _a = props, {
|
|
576
588
|
bgColor: bgColorProp,
|
|
577
589
|
className
|
|
@@ -582,21 +594,25 @@ const CardList = (props) => {
|
|
|
582
594
|
const bgColor = useBlockBackgroundColor(bgColorProp);
|
|
583
595
|
return /* @__PURE__ */ jsx("div", {
|
|
584
596
|
className: cx(bgColor, className),
|
|
585
|
-
children: /* @__PURE__ */ jsx("div", __spreadValues({
|
|
597
|
+
children: /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({
|
|
586
598
|
className: "container grid grid-cols-1 gap-12 py-16 md:grid-cols-2 md:py-20 lg:py-24"
|
|
587
|
-
}, rest)
|
|
599
|
+
}, rest), {
|
|
600
|
+
ref
|
|
601
|
+
}))
|
|
588
602
|
});
|
|
589
|
-
};
|
|
590
|
-
const CardContent = (props) => {
|
|
603
|
+
});
|
|
604
|
+
const CardContent = forwardRef((props, ref) => {
|
|
591
605
|
const _a = props, {
|
|
592
606
|
className
|
|
593
607
|
} = _a, rest = __objRest(_a, [
|
|
594
608
|
"className"
|
|
595
609
|
]);
|
|
596
|
-
return /* @__PURE__ */ jsx("div", __spreadValues({
|
|
610
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({
|
|
597
611
|
className: cx(className, "p-8 md:px-10")
|
|
598
|
-
}, rest)
|
|
599
|
-
|
|
612
|
+
}, rest), {
|
|
613
|
+
ref
|
|
614
|
+
}));
|
|
615
|
+
});
|
|
600
616
|
const CardLinkOverlay = forwardRef((props, ref) => {
|
|
601
617
|
const _a = props, {
|
|
602
618
|
className
|
|
@@ -840,7 +856,7 @@ const HeroContext = createContext({
|
|
|
840
856
|
contentPosition: "below-center",
|
|
841
857
|
hasImage: false
|
|
842
858
|
});
|
|
843
|
-
const Hero = (props) => {
|
|
859
|
+
const Hero = forwardRef((props, ref) => {
|
|
844
860
|
const _a = props, {
|
|
845
861
|
bgColor = "white",
|
|
846
862
|
children,
|
|
@@ -873,23 +889,25 @@ const Hero = (props) => {
|
|
|
873
889
|
gridTemplateAreas: '"hero"'
|
|
874
890
|
} : void 0
|
|
875
891
|
}, rest), {
|
|
892
|
+
ref,
|
|
876
893
|
children: [image, children]
|
|
877
894
|
}))
|
|
878
895
|
})
|
|
879
896
|
});
|
|
880
|
-
};
|
|
881
|
-
const HeroImage = (props) => {
|
|
897
|
+
});
|
|
898
|
+
const HeroImage = forwardRef((props, ref) => {
|
|
882
899
|
const {
|
|
883
900
|
contentPosition
|
|
884
901
|
} = useContext(HeroContext);
|
|
885
902
|
return /* @__PURE__ */ jsxs("picture", {
|
|
886
|
-
className: cx("aspect-w-6 aspect-h-7 block", {
|
|
903
|
+
className: cx(props.className, "aspect-w-6 aspect-h-7 block", {
|
|
887
904
|
"sm:aspect-w-8 sm:aspect-h-4": contentPosition !== "vertical-split",
|
|
888
905
|
"sm:aspect-w-8 sm:aspect-h-8": contentPosition === "vertical-split"
|
|
889
906
|
}),
|
|
890
907
|
style: contentPosition !== "vertical-split" && contentPosition !== "below-center" && contentPosition !== "below-left" ? {
|
|
891
908
|
gridArea: "hero"
|
|
892
909
|
} : void 0,
|
|
910
|
+
ref,
|
|
893
911
|
children: [/* @__PURE__ */ jsx("source", {
|
|
894
912
|
media: "(min-width: 768px)",
|
|
895
913
|
srcSet: props.mdSrc
|
|
@@ -900,8 +918,8 @@ const HeroImage = (props) => {
|
|
|
900
918
|
alt: props.alt
|
|
901
919
|
})]
|
|
902
920
|
});
|
|
903
|
-
};
|
|
904
|
-
const HeroContent = (props) => {
|
|
921
|
+
});
|
|
922
|
+
const HeroContent = forwardRef((props, ref) => {
|
|
905
923
|
const {
|
|
906
924
|
bgColor,
|
|
907
925
|
contentPosition,
|
|
@@ -941,15 +959,16 @@ const HeroContent = (props) => {
|
|
|
941
959
|
style: usesGridArea ? {
|
|
942
960
|
gridArea: "hero"
|
|
943
961
|
} : void 0,
|
|
962
|
+
ref,
|
|
944
963
|
children: [/* @__PURE__ */ jsx("h1", {
|
|
945
964
|
children: heading
|
|
946
965
|
}), description && /* @__PURE__ */ jsx("p", {
|
|
947
|
-
className: "text-lg md:text-xl",
|
|
966
|
+
className: "text-lg font-semibold md:text-xl",
|
|
948
967
|
children: description
|
|
949
968
|
}), children]
|
|
950
969
|
}));
|
|
951
|
-
};
|
|
952
|
-
const HeroActions = (props) => {
|
|
970
|
+
});
|
|
971
|
+
const HeroActions = forwardRef((props, ref) => {
|
|
953
972
|
const _a = props, {
|
|
954
973
|
className
|
|
955
974
|
} = _a, rest = __objRest(_a, [
|
|
@@ -958,12 +977,14 @@ const HeroActions = (props) => {
|
|
|
958
977
|
const {
|
|
959
978
|
contentPosition
|
|
960
979
|
} = useContext(HeroContext);
|
|
961
|
-
return /* @__PURE__ */ jsx("div", __spreadValues({
|
|
980
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({
|
|
962
981
|
className: cx(className, "grid items-center justify-center justify-items-center gap-4 md:grid-flow-col", {
|
|
963
982
|
"md:justify-start": contentPosition === "vertical-split" || contentPosition === "below-left"
|
|
964
983
|
})
|
|
965
|
-
}, rest)
|
|
966
|
-
|
|
984
|
+
}, rest), {
|
|
985
|
+
ref
|
|
986
|
+
}));
|
|
987
|
+
});
|
|
967
988
|
const Input = forwardRef((props, ref) => {
|
|
968
989
|
const _a = props, {
|
|
969
990
|
className,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "OBOS Grunnmuren design system React components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
],
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@babel/core": "7.20.
|
|
20
|
+
"@babel/core": "7.20.12",
|
|
21
21
|
"@storybook/addon-controls": "6.5.15",
|
|
22
22
|
"@storybook/addon-docs": "6.5.15",
|
|
23
23
|
"@storybook/addon-postcss": "2.0.0",
|
|
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.
|
|
27
|
+
"@types/react": "18.0.27",
|
|
28
28
|
"@types/react-dom": "18.0.10",
|
|
29
29
|
"@vitejs/plugin-react": "1.3.2",
|
|
30
|
-
"postcss": "8.4.
|
|
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": "
|
|
34
|
+
"rimraf": "4.1.2",
|
|
35
35
|
"tailwindcss": "3.2.4",
|
|
36
|
-
"type-fest": "3.5.
|
|
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"
|