@obosbbl/grunnmuren-react 1.9.0 → 1.10.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.
@@ -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 Controlled: () => JSX.Element;
10
+ export declare const Uncontrolled: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Default: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Default: () => JSX.Element;
@@ -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;
@@ -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: <T extends import("react").ElementType<any> = "div">(props: CardProps<T> & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<T>>, keyof CardProps<T>>) => JSX.Element;
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: (props: CardContentProps) => JSX.Element;
4
+ export declare const CardContent: import("react").ForwardRefExoticComponent<CardContentProps & import("react").RefAttributes<HTMLDivElement>>;
5
5
  export {};
@@ -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: (props: CardImageProps) => JSX.Element;
6
+ export declare const CardImage: import("react").ForwardRefExoticComponent<CardImageProps & import("react").RefAttributes<HTMLImageElement>>;
7
7
  export {};
@@ -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: (props: CardListProps) => JSX.Element;
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,9 @@
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;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Default: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Default: () => JSX.Element;
@@ -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;
@@ -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,9 @@
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;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Default: () => JSX.Element;
@@ -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;
@@ -0,0 +1,9 @@
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;
@@ -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 Validation: () => JSX.Element;
@@ -488,7 +488,7 @@ function deeplyWrapStrings(children) {
488
488
  }
489
489
  const ButtonColorContext = createContext("standard");
490
490
  const CampaignContext = createContext(true);
491
- const Campaign = (props) => {
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 CampaignBody = (props) => {
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.Body = CampaignBody;
545
- Campaign.Image = CampaignImage;
546
- const Card = (props) => {
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 CardImage = (props) => {
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
- const CardList = (props) => {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "OBOS Grunnmuren design system React components",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "types": "./dist/index.d.ts",
19
19
  "devDependencies": {
20
- "@babel/core": "7.20.7",
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",
@@ -27,13 +27,13 @@
27
27
  "@types/react": "18.0.26",
28
28
  "@types/react-dom": "18.0.10",
29
29
  "@vitejs/plugin-react": "1.3.2",
30
- "postcss": "8.4.20",
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": "3.0.2",
34
+ "rimraf": "4.0.7",
35
35
  "tailwindcss": "3.2.4",
36
- "type-fest": "3.5.0",
36
+ "type-fest": "3.5.2",
37
37
  "vite": "2.9.15",
38
38
  "webpack": "5.75.0",
39
39
  "@obosbbl/grunnmuren-tailwind": "0.8.4"