@obosbbl/grunnmuren-react 0.1.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 +21 -0
- package/README.md +11 -0
- package/dist/Alert/Alert.d.ts +9 -0
- package/dist/Alert/index.d.ts +1 -0
- package/dist/Banner/Banner.d.ts +11 -0
- package/dist/Banner/BannerImage.d.ts +6 -0
- package/dist/Banner/index.d.ts +2 -0
- package/dist/Button/Button.d.ts +14 -0
- package/dist/Button/ButtonColorContext.d.ts +3 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Card/Card.d.ts +8 -0
- package/dist/Card/CardContent.d.ts +5 -0
- package/dist/Card/CardImage.d.ts +7 -0
- package/dist/Card/CardLinkOverlay.d.ts +4 -0
- package/dist/Card/CardList.d.ts +7 -0
- package/dist/Card/index.d.ts +5 -0
- package/dist/Checkbox/Checkbox.d.ts +9 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Footer/Footer.d.ts +7 -0
- package/dist/Footer/index.d.ts +1 -0
- package/dist/Form/Form.d.ts +9 -0
- package/dist/Form/FormError.d.ts +4 -0
- package/dist/Form/FormErrorMessage.d.ts +5 -0
- package/dist/Form/FormHelperText.d.ts +5 -0
- package/dist/Form/FormLabel.d.ts +6 -0
- package/dist/Form/FormSuccess.d.ts +6 -0
- package/dist/Form/index.d.ts +6 -0
- package/dist/Hero/Hero.d.ts +21 -0
- package/dist/Hero/HeroActions.d.ts +7 -0
- package/dist/Hero/HeroContent.d.ts +9 -0
- package/dist/Hero/HeroImage.d.ts +8 -0
- package/dist/Hero/index.d.ts +4 -0
- package/dist/Hero/utils.d.ts +2 -0
- package/dist/IconLegacy/IconLegacy.d.ts +20 -0
- package/dist/IconLegacy/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +8 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Link/Link.d.ts +8 -0
- package/dist/Link/index.d.ts +1 -0
- package/dist/Navbar/Navbar.d.ts +6 -0
- package/dist/Navbar/NavbarCollapsible.d.ts +6 -0
- package/dist/Navbar/NavbarContent.d.ts +7 -0
- package/dist/Navbar/NavbarContext.d.ts +6 -0
- package/dist/Navbar/NavbarExpandedMobileContent.d.ts +9 -0
- package/dist/Navbar/NavbarItem.d.ts +7 -0
- package/dist/Navbar/NavbarItems.d.ts +6 -0
- package/dist/Navbar/NavbarMenuButton.d.ts +5 -0
- package/dist/Navbar/index.d.ts +6 -0
- package/dist/Select/Select.d.ts +7 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/Snackbar/Snackbar.d.ts +8 -0
- package/dist/Snackbar/SnackbarButton.d.ts +6 -0
- package/dist/Snackbar/SnackbarContent.d.ts +5 -0
- package/dist/Snackbar/index.d.ts +3 -0
- package/dist/TextArea/TextArea.d.ts +11 -0
- package/dist/TextArea/index.d.ts +1 -0
- package/dist/TextField/TextField.d.ts +12 -0
- package/dist/TextField/index.d.ts +1 -0
- package/dist/grunnmuren.es.js +1078 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useBlockBackgroundColor.d.ts +2 -0
- package/dist/hooks/useComposedRefs.d.ts +25 -0
- package/dist/hooks/useFallbackId.d.ts +4 -0
- package/dist/hooks/useFormControlValidity.d.ts +14 -0
- package/dist/hooks/useMedia.d.ts +1 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +1 -0
- package/dist/hooks/useScreenMaxWidthMd.d.ts +1 -0
- package/dist/index.d.ts +16 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 OBOS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Alert';
|
|
@@ -0,0 +1,11 @@
|
|
|
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) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type ButtonColor = 'standard' | 'white' | 'light-green';
|
|
3
|
+
export interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
color?: 'standard' | 'white' | 'light-green';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
href?: string;
|
|
9
|
+
/** @default button */
|
|
10
|
+
type?: 'button' | 'submit' | 'reset';
|
|
11
|
+
/** @default primary */
|
|
12
|
+
variant?: 'primary' | 'secondary';
|
|
13
|
+
}
|
|
14
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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: <T extends import("react").ElementType<any> = "div">(props: CardProps<T> & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<T>>, keyof CardProps<T>>) => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
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>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
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: (props: CardListProps) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
9
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Pick<CheckboxProps, "className" | "children" | "form" | "slot" | "style" | "title" | "pattern" | "list" | "role" | "key" | "alt" | "crossOrigin" | "height" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "autoComplete" | "accept" | "capture" | "checked" | "multiple" | "maxLength" | "minLength" | "enterKeyHint" | "max" | "min" | "readOnly" | "required" | "size"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Checkbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Footer';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface FormProps extends React.ComponentPropsWithoutRef<'form'> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
heading?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Form: (props: FormProps) => JSX.Element;
|
|
7
|
+
export interface FormHeadingProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
8
|
+
}
|
|
9
|
+
export declare const FormHeading: (props: FormHeadingProps) => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const HeroContext: import("react").Context<{
|
|
3
|
+
bgColor: HeroColor;
|
|
4
|
+
contentPosition: HeroContentPosition;
|
|
5
|
+
hasImage: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare type HeroColor = 'green' | 'blue' | 'white';
|
|
8
|
+
export declare type HeroContentPosition = 'below-center' | 'below-left' | 'top-left' | 'bottom-left' | 'top-right' | 'bottom-right' | 'center' | 'vertical-split';
|
|
9
|
+
export interface HeroProps {
|
|
10
|
+
/** @default white */
|
|
11
|
+
bgColor?: HeroColor;
|
|
12
|
+
className?: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/** Positioning of the content relative to the image. Only affects wider screens
|
|
15
|
+
* @default below-center
|
|
16
|
+
*/
|
|
17
|
+
contentPosition?: HeroContentPosition;
|
|
18
|
+
/** Instance of HeroImage */
|
|
19
|
+
image?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare const Hero: (props: HeroProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type IconName = keyof typeof iconMap;
|
|
3
|
+
interface IconLegacyProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
name: IconName;
|
|
6
|
+
children?: never;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* NB! This component should only be used for compatibility reasons.
|
|
11
|
+
* It uses old icon names and it causes all the referenced icons to be inluded in the application bundle.
|
|
12
|
+
* Import icons from @obosbbl/grunnmuren-icons instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const IconLegacy: (props: IconLegacyProps) => JSX.Element;
|
|
15
|
+
declare const iconMap: {
|
|
16
|
+
readonly mapmarker: (props: import("react").SVGProps<SVGSVGElement>) => JSX.Element;
|
|
17
|
+
readonly smartphone: (props: import("react").SVGProps<SVGSVGElement>) => JSX.Element;
|
|
18
|
+
readonly envelope: (props: import("react").SVGProps<SVGSVGElement>) => JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './IconLegacy';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface InputProps extends React.ComponentPropsWithoutRef<'input'> {
|
|
3
|
+
as?: string;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
/** Render input as invalid. Sets `aria-invalid` to true */
|
|
6
|
+
isInvalid?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Link';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface NavbarExpandedMobileContentProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Helper component that only renders when the navbar is expanded and on a small screen
|
|
7
|
+
* Simplifies having a totally different navbar layout than on desktop
|
|
8
|
+
*/
|
|
9
|
+
export declare const NavbarExpandedMobileContent: (props: NavbarExpandedMobileContentProps) => JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface NavbarItemProps extends React.ComponentPropsWithoutRef<'a'> {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const NavbarItem: import("react").ForwardRefExoticComponent<NavbarItemProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SelectProps extends React.ComponentPropsWithoutRef<'select'> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Select';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface TextAreaProps extends React.ComponentPropsWithoutRef<'textarea'> {
|
|
3
|
+
children?: never;
|
|
4
|
+
/** Help text for the form control */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Error message for the form control */
|
|
7
|
+
error?: string;
|
|
8
|
+
/** Label for the form control */
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TextArea';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface TextFieldProps extends React.ComponentPropsWithoutRef<'input'> {
|
|
3
|
+
children?: never;
|
|
4
|
+
/** Help text for the form control */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Error message for the form control */
|
|
7
|
+
error?: string;
|
|
8
|
+
/** Label for the form control */
|
|
9
|
+
label: string;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TextField';
|