@obosbbl/grunnmuren-react 1.14.9 → 2.0.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/LICENSE +1 -1
- package/dist/Button/Button.d.mts +71 -0
- package/dist/Button/Button.d.ts +70 -15
- package/dist/Button/Button.mjs +86 -0
- package/package.json +21 -44
- package/README.md +0 -45
- package/dist/Accordion/Accordion.d.ts +0 -27
- package/dist/Accordion/index.d.ts +0 -1
- package/dist/Accordion/stories/Accordion.stories.d.ts +0 -9
- package/dist/Alert/Alert.d.ts +0 -9
- package/dist/Alert/index.d.ts +0 -1
- package/dist/Alert/stories/Alert.stories.d.ts +0 -5
- package/dist/Banner/Banner.d.ts +0 -11
- package/dist/Banner/BannerImage.d.ts +0 -6
- package/dist/Banner/index.d.ts +0 -2
- package/dist/Banner/stories/Banner.stories.d.ts +0 -5
- package/dist/Button/ButtonColorContext.d.ts +0 -3
- package/dist/Button/index.d.ts +0 -2
- package/dist/Button/stories/Button.stories.d.ts +0 -31
- package/dist/Campaign/Campaign.d.ts +0 -26
- package/dist/Campaign/index.d.ts +0 -1
- package/dist/Campaign/stories/Campaign.stories.d.ts +0 -9
- package/dist/Card/Card.d.ts +0 -8
- package/dist/Card/CardContent.d.ts +0 -5
- package/dist/Card/CardImage.d.ts +0 -7
- package/dist/Card/CardLinkOverlay.d.ts +0 -4
- package/dist/Card/CardList.d.ts +0 -7
- package/dist/Card/index.d.ts +0 -5
- package/dist/Card/stories/Card.stories.d.ts +0 -34
- package/dist/Checkbox/Checkbox.d.ts +0 -13
- package/dist/Checkbox/index.d.ts +0 -1
- package/dist/Checkbox/stories/Checkbox.stories.d.ts +0 -8
- package/dist/Chip/Chip.d.ts +0 -10
- package/dist/Chip/index.d.ts +0 -1
- package/dist/Chip/stories/Chip.stories.d.ts +0 -5
- package/dist/Footer/Footer.d.ts +0 -7
- package/dist/Footer/index.d.ts +0 -1
- package/dist/Footer/stories/Footer.stories.d.ts +0 -5
- package/dist/Form/Form.d.ts +0 -9
- package/dist/Form/FormError.d.ts +0 -4
- package/dist/Form/FormErrorMessage.d.ts +0 -5
- package/dist/Form/FormHelperText.d.ts +0 -5
- package/dist/Form/FormLabel.d.ts +0 -7
- package/dist/Form/FormSuccess.d.ts +0 -6
- package/dist/Form/MultiStep/FormStep.d.ts +0 -17
- package/dist/Form/MultiStep/FormStepContext.d.ts +0 -20
- package/dist/Form/MultiStep/FormStepHeader.d.ts +0 -18
- package/dist/Form/MultiStep/index.d.ts +0 -3
- package/dist/Form/index.d.ts +0 -7
- package/dist/Form/stories/Form.stories.d.ts +0 -14
- package/dist/Hero/Hero.d.ts +0 -21
- package/dist/Hero/HeroActions.d.ts +0 -7
- package/dist/Hero/HeroContent.d.ts +0 -9
- package/dist/Hero/HeroImage.d.ts +0 -9
- package/dist/Hero/index.d.ts +0 -4
- package/dist/Hero/stories/Hero.stories.d.ts +0 -33
- package/dist/Hero/utils.d.ts +0 -2
- package/dist/Input/Input.d.ts +0 -11
- package/dist/Input/index.d.ts +0 -1
- package/dist/Input/stories/Input.stories.d.ts +0 -8
- package/dist/Link/Link.d.ts +0 -8
- package/dist/Link/index.d.ts +0 -1
- package/dist/Navbar/Navbar.d.ts +0 -6
- package/dist/Navbar/NavbarCollapsible.d.ts +0 -6
- package/dist/Navbar/NavbarContent.d.ts +0 -7
- package/dist/Navbar/NavbarContext.d.ts +0 -6
- package/dist/Navbar/NavbarExpandedMobileContent.d.ts +0 -9
- package/dist/Navbar/NavbarItem.d.ts +0 -7
- package/dist/Navbar/NavbarItems.d.ts +0 -6
- package/dist/Navbar/NavbarMenuButton.d.ts +0 -4
- package/dist/Navbar/index.d.ts +0 -6
- package/dist/Navbar/stories/Navbar.stories.d.ts +0 -5
- package/dist/Pagination/Pagination.d.ts +0 -23
- package/dist/Pagination/index.d.ts +0 -1
- package/dist/Pagination/stories/Pagination.stories.d.ts +0 -24
- package/dist/Radio/Radio.d.ts +0 -5
- package/dist/Radio/RadioContext.d.ts +0 -10
- package/dist/Radio/RadioGroup.d.ts +0 -20
- package/dist/Radio/index.d.ts +0 -2
- package/dist/Radio/stories/Radio.stories.d.ts +0 -12
- package/dist/Select/Select.d.ts +0 -21
- package/dist/Select/SelectPlain.d.ts +0 -15
- package/dist/Select/index.d.ts +0 -1
- package/dist/Select/stories/Select.stories.d.ts +0 -26
- package/dist/Snackbar/Snackbar.d.ts +0 -8
- package/dist/Snackbar/SnackbarButton.d.ts +0 -6
- package/dist/Snackbar/SnackbarContent.d.ts +0 -5
- package/dist/Snackbar/index.d.ts +0 -3
- package/dist/Snackbar/stories/Snackbar.stories.d.ts +0 -9
- package/dist/StepList/StepList.d.ts +0 -25
- package/dist/StepList/index.d.ts +0 -1
- package/dist/StepList/stories/StepList.stories.d.ts +0 -19
- package/dist/TextArea/TextArea.d.ts +0 -15
- package/dist/TextArea/index.d.ts +0 -1
- package/dist/TextArea/stories/TextArea.stories.d.ts +0 -8
- package/dist/TextField/TextField.d.ts +0 -19
- package/dist/TextField/index.d.ts +0 -1
- package/dist/TextField/stories/TextField.stories.d.ts +0 -9
- package/dist/__stories__/Icon.stories.d.ts +0 -8
- package/dist/__stories__/PageLayout.stories.d.ts +0 -5
- package/dist/__stories__/Typography.stories.d.ts +0 -9
- package/dist/grunnmuren.mjs +0 -1552
- package/dist/hooks/index.d.ts +0 -5
- package/dist/hooks/useBlockBackgroundColor.d.ts +0 -2
- package/dist/hooks/useFallbackId.d.ts +0 -4
- package/dist/hooks/useFormControlValidity.d.ts +0 -15
- package/dist/hooks/usePrefersReducedMotion.d.ts +0 -1
- package/dist/hooks/useScreenMaxWidthMd.d.ts +0 -1
- package/dist/index.d.ts +0 -22
- package/dist/utils/index.d.ts +0 -2
package/LICENSE
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'cva';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figma: https://www.figma.com/file/9OvSg0ZXI5E1eQYi7AWiWn/Grunnmuren-2.0-%E2%94%82-Designsystem?node-id=30%3A2574&mode=dev
|
|
6
|
+
*/
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "primary" | "secondary" | "tertiary" | undefined;
|
|
9
|
+
color?: "default" | "mint" | "white" | undefined;
|
|
10
|
+
} & ({
|
|
11
|
+
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
} | null | undefined)[] | {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
} | null | undefined)[] | {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
} | null | undefined)[] | {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
} | null | undefined)[] | {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
} | null | undefined)[] | {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
} | null | undefined)[] | {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
} | null | undefined)[] | {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
} | null | undefined)[] | {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
} | null | undefined)[] | {
|
|
30
|
+
[x: string]: any;
|
|
31
|
+
} | null | undefined)[] | {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
} | null | undefined)[] | {
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
} | null | undefined;
|
|
36
|
+
className?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
class?: undefined;
|
|
39
|
+
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
} | null | undefined)[] | {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
} | null | undefined)[] | {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
} | null | undefined)[] | {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
} | null | undefined)[] | {
|
|
48
|
+
[x: string]: any;
|
|
49
|
+
} | null | undefined)[] | {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
} | null | undefined)[] | {
|
|
52
|
+
[x: string]: any;
|
|
53
|
+
} | null | undefined)[] | {
|
|
54
|
+
[x: string]: any;
|
|
55
|
+
} | null | undefined)[] | {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
} | null | undefined)[] | {
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
} | null | undefined)[] | {
|
|
60
|
+
[x: string]: any;
|
|
61
|
+
} | null | undefined)[] | {
|
|
62
|
+
[x: string]: any;
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
})) | undefined) => string;
|
|
65
|
+
type ButtonProps = VariantProps<typeof buttonVariants> & {
|
|
66
|
+
className?: string;
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
};
|
|
69
|
+
declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
export { Button, type ButtonProps, buttonVariants };
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,16 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'cva';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figma: https://www.figma.com/file/9OvSg0ZXI5E1eQYi7AWiWn/Grunnmuren-2.0-%E2%94%82-Designsystem?node-id=30%3A2574&mode=dev
|
|
6
|
+
*/
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "primary" | "secondary" | "tertiary" | undefined;
|
|
9
|
+
color?: "default" | "mint" | "white" | undefined;
|
|
10
|
+
} & ({
|
|
11
|
+
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
} | null | undefined)[] | {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
} | null | undefined)[] | {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
} | null | undefined)[] | {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
} | null | undefined)[] | {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
} | null | undefined)[] | {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
} | null | undefined)[] | {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
} | null | undefined)[] | {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
} | null | undefined)[] | {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
} | null | undefined)[] | {
|
|
30
|
+
[x: string]: any;
|
|
31
|
+
} | null | undefined)[] | {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
} | null | undefined)[] | {
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
} | null | undefined;
|
|
36
|
+
className?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
class?: undefined;
|
|
39
|
+
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
} | null | undefined)[] | {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
} | null | undefined)[] | {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
} | null | undefined)[] | {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
} | null | undefined)[] | {
|
|
48
|
+
[x: string]: any;
|
|
49
|
+
} | null | undefined)[] | {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
} | null | undefined)[] | {
|
|
52
|
+
[x: string]: any;
|
|
53
|
+
} | null | undefined)[] | {
|
|
54
|
+
[x: string]: any;
|
|
55
|
+
} | null | undefined)[] | {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
} | null | undefined)[] | {
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
} | null | undefined)[] | {
|
|
60
|
+
[x: string]: any;
|
|
61
|
+
} | null | undefined)[] | {
|
|
62
|
+
[x: string]: any;
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
})) | undefined) => string;
|
|
65
|
+
type ButtonProps = VariantProps<typeof buttonVariants> & {
|
|
5
66
|
className?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/** @default button */
|
|
12
|
-
type?: 'button' | 'submit' | 'reset';
|
|
13
|
-
/** @default primary */
|
|
14
|
-
variant?: 'primary' | 'secondary';
|
|
15
|
-
}
|
|
16
|
-
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
};
|
|
69
|
+
declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
export { Button, type ButtonProps, buttonVariants };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cva } from 'cva';
|
|
3
|
+
|
|
4
|
+
const buttonVariants = cva({
|
|
5
|
+
base: "cursor-pointer rounded-x-small px-4 py-2 font-medium transition-all duration-200 hover:rounded-[0.25rem] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
6
|
+
variants: {
|
|
7
|
+
/**
|
|
8
|
+
* The variant of the button
|
|
9
|
+
* @default primary
|
|
10
|
+
*/
|
|
11
|
+
variant: {
|
|
12
|
+
primary: "border-none",
|
|
13
|
+
secondary: "border-2",
|
|
14
|
+
tertiary: "underline"
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* Adjusts the color of the button for usage on different backgrounds.
|
|
18
|
+
* @default default
|
|
19
|
+
*/
|
|
20
|
+
color: {
|
|
21
|
+
default: "focus-visible:ring-black",
|
|
22
|
+
mint: "focus-visible:ring-mint focus-visible:ring-offset-green-dark",
|
|
23
|
+
white: "focus-visible:ring-white focus-visible:ring-offset-blue"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
color: "default",
|
|
29
|
+
variant: "primary",
|
|
30
|
+
// Darken bg by 20% on hover. The color is manually crafted
|
|
31
|
+
className: "bg-green text-white hover:bg-[#006c4e] active:bg-[#007352]"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
color: "default",
|
|
35
|
+
variant: "secondary",
|
|
36
|
+
className: "border-green bg-white text-black"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
color: "mint",
|
|
40
|
+
variant: "primary",
|
|
41
|
+
// Darken bg by 20% on hover. The color is manually crafted
|
|
42
|
+
className: "active:[#9ddac6] bg-mint text-black hover:bg-[#8dd4bd]"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
color: "mint",
|
|
46
|
+
variant: "secondary",
|
|
47
|
+
className: "border-mint text-mint"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
color: "mint",
|
|
51
|
+
variant: "tertiary",
|
|
52
|
+
className: "text-mint"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
color: "white",
|
|
56
|
+
variant: "primary",
|
|
57
|
+
className: "bg-white text-black hover:bg-sky active:bg-sky-light"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
color: "white",
|
|
61
|
+
variant: "secondary",
|
|
62
|
+
className: "border-white text-white"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
color: "white",
|
|
66
|
+
variant: "tertiary",
|
|
67
|
+
className: "text-white"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
variant: "primary",
|
|
72
|
+
color: "default"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
function Button(props) {
|
|
76
|
+
const { className, variant, color, ...rest } = props;
|
|
77
|
+
return /* @__PURE__ */ jsx(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
className: buttonVariants({ className, color, variant }),
|
|
81
|
+
...rest
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { Button, buttonVariants };
|
package/package.json
CHANGED
|
@@ -1,63 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Grunnmuren components in React",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
7
|
-
"url": "https://github.com/code-obos/grunnmuren",
|
|
8
|
-
"directory": "packages/react"
|
|
9
|
-
},
|
|
6
|
+
"type": "module",
|
|
10
7
|
"exports": {
|
|
11
|
-
"
|
|
12
|
-
|
|
8
|
+
"./button": {
|
|
9
|
+
"types": "./dist/Button/Button.d.ts",
|
|
10
|
+
"default": "./dist/Button/Button.mjs"
|
|
11
|
+
}
|
|
13
12
|
},
|
|
13
|
+
"sideEffects": false,
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"@storybook/addon-controls": "7.4.5",
|
|
20
|
-
"@storybook/addon-docs": "7.4.5",
|
|
21
|
-
"@storybook/addon-styling": "1.3.7",
|
|
22
|
-
"@storybook/builder-vite": "7.4.4",
|
|
23
|
-
"@storybook/react": "7.4.5",
|
|
24
|
-
"@storybook/react-vite": "7.4.4",
|
|
25
|
-
"@types/react": "18.2.22",
|
|
26
|
-
"@types/react-dom": "18.2.7",
|
|
27
|
-
"@vitejs/plugin-react": "4.0.4",
|
|
28
|
-
"autoprefixer": "10.4.16",
|
|
29
|
-
"postcss": "8.4.30",
|
|
30
|
-
"react": "18.2.0",
|
|
31
|
-
"react-dom": "18.2.0",
|
|
32
|
-
"require-from-string": "2.0.2",
|
|
33
|
-
"rimraf": "5.0.1",
|
|
34
|
-
"storybook": "7.4.5",
|
|
35
|
-
"tailwindcss": "3.3.3",
|
|
36
|
-
"type-fest": "4.3.1",
|
|
37
|
-
"vite": "4.4.9",
|
|
38
|
-
"@obosbbl/grunnmuren-tailwind": "0.9.1"
|
|
17
|
+
"repository": {
|
|
18
|
+
"url": "https://github.com/code-obos/grunnmuren"
|
|
39
19
|
},
|
|
40
20
|
"dependencies": {
|
|
41
|
-
"
|
|
42
|
-
"clsx": "2.0.0",
|
|
43
|
-
"react-collapsed": "4.0.4",
|
|
44
|
-
"react-merge-refs": "2.0.2",
|
|
45
|
-
"@obosbbl/grunnmuren-icons": "^0.7.0"
|
|
21
|
+
"cva": "1.0.0-beta.1"
|
|
46
22
|
},
|
|
47
23
|
"peerDependencies": {
|
|
48
|
-
"@obosbbl/grunnmuren-tailwind": "^0.9.1",
|
|
49
24
|
"react": "^18"
|
|
50
25
|
},
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
26
|
+
"unbuild": {
|
|
27
|
+
"entries": [
|
|
28
|
+
"./src/Button/Button.tsx"
|
|
29
|
+
],
|
|
30
|
+
"declaration": true,
|
|
31
|
+
"rollup": {
|
|
32
|
+
"esbuild": {
|
|
33
|
+
"jsx": "automatic"
|
|
34
|
+
}
|
|
54
35
|
}
|
|
55
36
|
},
|
|
56
37
|
"scripts": {
|
|
57
|
-
"build": "
|
|
58
|
-
"build:lib": "vite build",
|
|
59
|
-
"build:types": "tsc --emitDeclarationOnly --declaration && rimraf 'dist/**/stories/'",
|
|
60
|
-
"dev": "storybook dev -p 6006 --ci",
|
|
61
|
-
"build:storybook": "storybook build"
|
|
38
|
+
"build": "unbuild"
|
|
62
39
|
}
|
|
63
40
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# @obosbbl/grunnmuren-react
|
|
2
|
-
|
|
3
|
-
Grunnmuren React components
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install @obosbbl/grunnmuren-react
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
You need to setup and configure [`@obosbbl/grunnmuren-tailwind`](../tailwind/) as well.
|
|
12
|
-
|
|
13
|
-
## Develop
|
|
14
|
-
|
|
15
|
-
Install packages in the root folder
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
cd ../..
|
|
19
|
-
pnpm install
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Build the icons
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
cd packages/icons
|
|
26
|
-
pnpm run build
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Finally, start up development server from this folder
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
pnpm dev
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Changeset
|
|
36
|
-
|
|
37
|
-
All updates should be marked with a changeset.
|
|
38
|
-
|
|
39
|
-
In the root folder, run
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
pnpm changeset
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
an followed the steps.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface AccordionProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
-
}
|
|
4
|
-
export declare const Accordion: {
|
|
5
|
-
(props: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
Item: (props: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
Header: <T extends React.ElementType<any> = "h3">(props: AccordionHeaderProps<T> & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "as">) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
Content: (props: AccordionContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
export interface AccordionItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
11
|
-
defaultOpen?: boolean;
|
|
12
|
-
open?: boolean;
|
|
13
|
-
onChange?: (open: boolean) => void;
|
|
14
|
-
}
|
|
15
|
-
export declare const AccordionItem: (props: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
interface AccordionHeaderProps<T extends React.ElementType> {
|
|
17
|
-
/**
|
|
18
|
-
* The heading element that wraps the accordion item's button. Should always be an element with `role="heading"`
|
|
19
|
-
* or a HTML heading tag. Change this to an appropriate heading level for your page.
|
|
20
|
-
* @default h3 */
|
|
21
|
-
as?: T;
|
|
22
|
-
}
|
|
23
|
-
export declare const AccordionHeader: <T extends React.ElementType<any> = "h3">(props: AccordionHeaderProps<T> & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "as">) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
interface AccordionContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
25
|
-
}
|
|
26
|
-
export declare const AccordionContent: (props: AccordionContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Accordion';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
title: string;
|
|
3
|
-
parameters: {
|
|
4
|
-
layout: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const Controlled: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare const Uncontrolled: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/Alert/Alert.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface AlertProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
heading: string;
|
|
6
|
-
/** @default alert */
|
|
7
|
-
severity?: 'alert' | 'info';
|
|
8
|
-
}
|
|
9
|
-
export declare const Alert: (props: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Alert/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Alert';
|
package/dist/Banner/Banner.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BlockBackgroundColor } from '../hooks';
|
|
3
|
-
interface BannerProps {
|
|
4
|
-
bgColor?: BlockBackgroundColor;
|
|
5
|
-
className?: string;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
heading: string;
|
|
8
|
-
image: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const Banner: (props: BannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
package/dist/Banner/index.d.ts
DELETED
package/dist/Button/index.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare const Composition: {
|
|
2
|
-
readonly Text: "Text";
|
|
3
|
-
readonly Icon: "Icon";
|
|
4
|
-
readonly TextIcon: "Text Icon";
|
|
5
|
-
readonly IconText: "Icon Text";
|
|
6
|
-
};
|
|
7
|
-
type CompositionValue = (typeof Composition)[keyof typeof Composition];
|
|
8
|
-
declare const _default: {
|
|
9
|
-
title: string;
|
|
10
|
-
argTypes: {
|
|
11
|
-
composition: {
|
|
12
|
-
options: ("Text" | "Icon" | "Text Icon" | "Icon Text")[];
|
|
13
|
-
control: string;
|
|
14
|
-
defaultValue: "Text";
|
|
15
|
-
};
|
|
16
|
-
disabled: {
|
|
17
|
-
control: string;
|
|
18
|
-
defaultValue: boolean;
|
|
19
|
-
};
|
|
20
|
-
loading: {
|
|
21
|
-
control: string;
|
|
22
|
-
defaultValue: boolean;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
27
|
-
export declare const Default: (props: {
|
|
28
|
-
composition: CompositionValue;
|
|
29
|
-
disabled: boolean;
|
|
30
|
-
loading: boolean;
|
|
31
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface CampaignProps<T extends React.ElementType> {
|
|
3
|
-
/** @default div */
|
|
4
|
-
as?: T;
|
|
5
|
-
body: React.ReactElement;
|
|
6
|
-
/** Use the `body` and `image` props. */
|
|
7
|
-
children?: never;
|
|
8
|
-
image: React.ReactElement;
|
|
9
|
-
/**
|
|
10
|
-
* Setting this to false changes the ordering of the body and the image on >= medium sceens.
|
|
11
|
-
* Use this to alternate the image's positon with lists of Campaigns.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
rightAlignBody?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface CampaignBodyProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
17
|
-
}
|
|
18
|
-
export declare const CampaignBody: import("react").ForwardRefExoticComponent<CampaignBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
-
export interface CampaignImageProps extends React.ComponentPropsWithoutRef<'img'> {
|
|
20
|
-
}
|
|
21
|
-
export declare const CampaignImage: import("react").ForwardRefExoticComponent<CampaignImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
22
|
-
declare const Campaign: import("react").ForwardRefExoticComponent<Omit<CampaignProps<import("react").ElementType<any>> & Omit<Omit<any, "ref">, keyof CampaignProps<T>>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
23
|
-
Body: import("react").ForwardRefExoticComponent<CampaignBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
-
Image: import("react").ForwardRefExoticComponent<CampaignImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
25
|
-
};
|
|
26
|
-
export { Campaign };
|
package/dist/Campaign/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Campaign';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
title: string;
|
|
3
|
-
parameters: {
|
|
4
|
-
layout: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare const WithCustomImageComponent: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/Card/Card.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface CardProps<T extends React.ElementType> {
|
|
3
|
-
/** @default div */
|
|
4
|
-
as?: T;
|
|
5
|
-
/** @default white */
|
|
6
|
-
bgColor?: 'white' | 'gray';
|
|
7
|
-
}
|
|
8
|
-
export declare const Card: import("react").ForwardRefExoticComponent<Omit<CardProps<import("react").ElementType<any>> & Omit<Omit<any, "ref">, keyof CardProps<T>>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Card/CardImage.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface CardImageProps extends React.ComponentPropsWithoutRef<'img'> {
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const CardImage: import("react").ForwardRefExoticComponent<CardImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
7
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface CardLinkOverlayProps extends React.ComponentPropsWithoutRef<'a'> {
|
|
3
|
-
}
|
|
4
|
-
export declare const CardLinkOverlay: import("react").ForwardRefExoticComponent<CardLinkOverlayProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
package/dist/Card/CardList.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BlockBackgroundColor } from '../hooks';
|
|
3
|
-
interface CardListProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
4
|
-
bgColor?: BlockBackgroundColor;
|
|
5
|
-
}
|
|
6
|
-
export declare const CardList: import("react").ForwardRefExoticComponent<CardListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export {};
|
package/dist/Card/index.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { CardProps } from '../../';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
parameters: {
|
|
5
|
-
layout: string;
|
|
6
|
-
};
|
|
7
|
-
argTypes: {
|
|
8
|
-
bgColor: {
|
|
9
|
-
options: string[];
|
|
10
|
-
control: {
|
|
11
|
-
type: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export default _default;
|
|
17
|
-
export declare const Default: {
|
|
18
|
-
(props: CardProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
args: {
|
|
20
|
-
bgColor: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export declare const Link: {
|
|
24
|
-
(props: CardProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
args: {
|
|
26
|
-
bgColor: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export declare const CardList: {
|
|
30
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
parameters: {
|
|
32
|
-
layout: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* CSS inspired by https://moderncss.dev/pure-css-custom-checkbox-style/
|
|
4
|
-
*/
|
|
5
|
-
export interface CheckboxProps extends React.ComponentPropsWithRef<'input'> {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Error message for the form control */
|
|
9
|
-
error?: string;
|
|
10
|
-
/** Disables the built in HTML5 validation. If using custom validation for an entire form, consider setting `noValidate` on the form element instead. @default false */
|
|
11
|
-
disableValidation?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|