@obosbbl/grunnmuren-react 2.0.0 → 2.0.2

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/package.json CHANGED
@@ -1,40 +1,42 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Grunnmuren components in React",
5
+ "repository": {
6
+ "url": "https://github.com/code-obos/grunnmuren"
7
+ },
5
8
  "license": "MIT",
9
+ "sideEffects": false,
6
10
  "type": "module",
7
11
  "exports": {
8
- "./button": {
9
- "types": "./dist/Button/Button.d.ts",
10
- "default": "./dist/Button/Button.mjs"
12
+ ".": {
13
+ "types": "./dist/index.d.mts",
14
+ "default": "./dist/index.mjs"
11
15
  }
12
16
  },
13
- "sideEffects": false,
14
17
  "files": [
15
18
  "dist"
16
19
  ],
17
- "repository": {
18
- "url": "https://github.com/code-obos/grunnmuren"
19
- },
20
20
  "dependencies": {
21
- "cva": "1.0.0-beta.1"
21
+ "@obosbbl/grunnmuren-icons-react": "^2.0.0",
22
+ "@react-aria/form": "^3.0.14",
23
+ "@react-aria/interactions": "^3.24.1",
24
+ "@react-aria/utils": "^3.28.1",
25
+ "@react-stately/form": "^3.1.2",
26
+ "@react-stately/utils": "^3.10.5",
27
+ "@types/node": "^22.0.0",
28
+ "cva": "^1.0.0-0",
29
+ "react-aria": "^3.38.1",
30
+ "react-aria-components": "^1.7.1",
31
+ "react-stately": "^3.35.0"
22
32
  },
23
33
  "peerDependencies": {
24
- "react": "^18"
34
+ "react": "^19"
25
35
  },
26
- "unbuild": {
27
- "entries": [
28
- "./src/Button/Button.tsx"
29
- ],
30
- "declaration": true,
31
- "rollup": {
32
- "esbuild": {
33
- "jsx": "automatic"
34
- }
35
- }
36
+ "devDependencies": {
37
+ "tailwindcss": "4.0.17"
36
38
  },
37
39
  "scripts": {
38
- "build": "unbuild"
40
+ "build": "bunchee"
39
41
  }
40
42
  }
@@ -1,71 +0,0 @@
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 };
@@ -1,71 +0,0 @@
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 };
@@ -1,86 +0,0 @@
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 };