@obosbbl/grunnmuren-react 0.2.1 → 0.3.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/Stepper/Stepper.d.ts +13 -0
- package/dist/Stepper/index.d.ts +1 -0
- package/dist/grunnmuren.es.js +42 -4
- package/dist/index.d.ts +1 -0
- package/package.json +18 -11
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface StepperProps extends React.ComponentPropsWithoutRef<'ol'> {
|
|
3
|
+
}
|
|
4
|
+
export declare const Stepper: (props: StepperProps) => JSX.Element;
|
|
5
|
+
interface StepProps extends React.ComponentPropsWithoutRef<'li'> {
|
|
6
|
+
/** Content for the Step item's bullet */
|
|
7
|
+
bullet: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Step: (props: StepProps) => JSX.Element;
|
|
10
|
+
interface StepBulletProps extends React.ComponentPropsWithoutRef<'span'> {
|
|
11
|
+
}
|
|
12
|
+
export declare const StepBullet: (props: StepBulletProps) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Stepper';
|
package/dist/grunnmuren.es.js
CHANGED
|
@@ -753,7 +753,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
753
753
|
size,
|
|
754
754
|
prefix,
|
|
755
755
|
as,
|
|
756
|
-
type
|
|
756
|
+
type: typeProp
|
|
757
757
|
} = _a, rest = __objRest(_a, [
|
|
758
758
|
"className",
|
|
759
759
|
"isInvalid",
|
|
@@ -763,7 +763,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
763
763
|
"type"
|
|
764
764
|
]);
|
|
765
765
|
const Component = as != null ? as : "input";
|
|
766
|
-
const
|
|
766
|
+
const type = getType(Component, typeProp);
|
|
767
767
|
return /* @__PURE__ */ jsxs("div", {
|
|
768
768
|
className: classNames(className, "relative flex items-center rounded-md border-[1px] border-b-[3px] focus-within:-ml-[2px] focus-within:-mt-[2px] focus-within:border-[3px] focus-within:shadow", {
|
|
769
769
|
"border-gray-dark focus-within:border-blue": !isInvalid,
|
|
@@ -779,10 +779,16 @@ const Input = forwardRef((props, ref) => {
|
|
|
779
779
|
ref,
|
|
780
780
|
className: "focus:none placeholder-gray w-full rounded-md border-none px-4 py-3 outline-none",
|
|
781
781
|
size,
|
|
782
|
-
type
|
|
782
|
+
type
|
|
783
783
|
}, rest))]
|
|
784
784
|
});
|
|
785
785
|
});
|
|
786
|
+
function getType(Component, type) {
|
|
787
|
+
if (type != null)
|
|
788
|
+
return type;
|
|
789
|
+
if (Component === "input")
|
|
790
|
+
return "text";
|
|
791
|
+
}
|
|
786
792
|
const Link = (props) => {
|
|
787
793
|
let iconClass = "";
|
|
788
794
|
if (props.icon) {
|
|
@@ -987,6 +993,38 @@ const SnackbarContent = (props) => {
|
|
|
987
993
|
children: props.children
|
|
988
994
|
}));
|
|
989
995
|
};
|
|
996
|
+
const Stepper = (props) => {
|
|
997
|
+
return /* @__PURE__ */ jsx("ol", __spreadValues({}, props));
|
|
998
|
+
};
|
|
999
|
+
const Step = (props) => {
|
|
1000
|
+
const _a = props, {
|
|
1001
|
+
className,
|
|
1002
|
+
children,
|
|
1003
|
+
bullet
|
|
1004
|
+
} = _a, rest = __objRest(_a, [
|
|
1005
|
+
"className",
|
|
1006
|
+
"children",
|
|
1007
|
+
"bullet"
|
|
1008
|
+
]);
|
|
1009
|
+
return /* @__PURE__ */ jsxs("li", __spreadProps(__spreadValues({
|
|
1010
|
+
className: classNames(className, "group relative flex gap-4 pb-8 text-sm last:pb-0 md:gap-8 md:pb-12 md:text-base")
|
|
1011
|
+
}, rest), {
|
|
1012
|
+
children: [/* @__PURE__ */ jsx(StepBullet, {
|
|
1013
|
+
children: bullet
|
|
1014
|
+
}), children]
|
|
1015
|
+
}));
|
|
1016
|
+
};
|
|
1017
|
+
const StepBullet = (props) => {
|
|
1018
|
+
const _a = props, {
|
|
1019
|
+
className
|
|
1020
|
+
} = _a, rest = __objRest(_a, [
|
|
1021
|
+
"className"
|
|
1022
|
+
]);
|
|
1023
|
+
return /* @__PURE__ */ jsx("span", __spreadValues({
|
|
1024
|
+
"aria-hidden": true,
|
|
1025
|
+
className: classNames(className, "text-green border-gray-light after:bg-gray-light grid h-10 w-10 flex-none place-content-center rounded-full border-2 text-sm font-bold after:absolute after:left-5 after:top-10 after:bottom-0 after:w-0.5 group-last:after:hidden md:h-20 md:w-20 md:text-xl md:after:left-10 md:after:top-20")
|
|
1026
|
+
}, rest));
|
|
1027
|
+
};
|
|
990
1028
|
const TextArea = forwardRef((props, ref) => {
|
|
991
1029
|
const _a = props, {
|
|
992
1030
|
description,
|
|
@@ -1091,4 +1129,4 @@ const TextField = forwardRef((props, ref) => {
|
|
|
1091
1129
|
})]
|
|
1092
1130
|
});
|
|
1093
1131
|
});
|
|
1094
|
-
export { Alert, Banner, BannerImage, Button, ButtonColorContext, Card, CardContent, CardImage, CardLinkOverlay, CardList, Checkbox, Footer, Form, FormError, FormErrorMessage, FormHeading, FormHelperText, FormLabel, FormSuccess, Hero, HeroActions, HeroContent, HeroContext, HeroImage, IconLegacy, Input, Link, Navbar, NavbarCollapsible, NavbarContent, NavbarExpandedMobileContent, NavbarItem, NavbarItems, Snackbar, SnackbarButton, SnackbarContent, TextArea, TextField, assignRef, useBlockBackgroundColor, useComposedRefs, useFallbackId, useFormControlValidity, useMedia, usePrefersReducedMotion, useScreenMaxWidthMd };
|
|
1132
|
+
export { Alert, Banner, BannerImage, Button, ButtonColorContext, Card, CardContent, CardImage, CardLinkOverlay, CardList, Checkbox, Footer, Form, FormError, FormErrorMessage, FormHeading, FormHelperText, FormLabel, FormSuccess, Hero, HeroActions, HeroContent, HeroContext, HeroImage, IconLegacy, Input, Link, Navbar, NavbarCollapsible, NavbarContent, NavbarExpandedMobileContent, NavbarItem, NavbarItems, Snackbar, SnackbarButton, SnackbarContent, Step, StepBullet, Stepper, TextArea, TextField, assignRef, useBlockBackgroundColor, useComposedRefs, useFallbackId, useFormControlValidity, useMedia, usePrefersReducedMotion, useScreenMaxWidthMd };
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "OBOS Grunnmuren design system React components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,30 +17,37 @@
|
|
|
17
17
|
],
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@babel/core": "7.
|
|
21
|
-
"@
|
|
22
|
-
"@storybook/addon-
|
|
20
|
+
"@babel/core": "7.18.2",
|
|
21
|
+
"@obosbbl/grunnmuren-tailwind": "^0.3.1",
|
|
22
|
+
"@storybook/addon-controls": "6.5.5",
|
|
23
|
+
"@storybook/addon-docs": "6.5.5",
|
|
23
24
|
"@storybook/addon-postcss": "2.0.0",
|
|
24
|
-
"@storybook/builder-webpack5": "6.5.
|
|
25
|
-
"@storybook/manager-webpack5": "6.5.
|
|
26
|
-
"@storybook/react": "6.5.
|
|
25
|
+
"@storybook/builder-webpack5": "6.5.5",
|
|
26
|
+
"@storybook/manager-webpack5": "6.5.5",
|
|
27
|
+
"@storybook/react": "6.5.5",
|
|
27
28
|
"@types/react": "18.0.9",
|
|
28
|
-
"@types/react-dom": "18.0.
|
|
29
|
+
"@types/react-dom": "18.0.5",
|
|
29
30
|
"@vitejs/plugin-react": "1.3.2",
|
|
30
|
-
"postcss": "8.4.
|
|
31
|
+
"postcss": "8.4.14",
|
|
31
32
|
"react": "18.1.0",
|
|
32
33
|
"react-dom": "18.1.0",
|
|
34
|
+
"require-from-string": "2.0.2",
|
|
33
35
|
"tailwindcss": "3.0.24",
|
|
34
36
|
"vite": "2.9.9",
|
|
35
37
|
"webpack": "5.72.1"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"@obosbbl/grunnmuren-icons": "^0.3.0",
|
|
39
|
-
"@obosbbl/grunnmuren-tailwind": "^0.3.0",
|
|
40
41
|
"clsx": "1.1.1"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
|
-
"react": "^18"
|
|
44
|
+
"react": "^18",
|
|
45
|
+
"@obosbbl/grunnmuren-tailwind": "^0.3.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@obosbbl/grunnmuren-tailwind": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
44
51
|
},
|
|
45
52
|
"scripts": {
|
|
46
53
|
"build": "pnpm run build:lib && pnpm run build:types",
|