@contentful/f36-note
Advanced tools
Comparing version 4.0.1-next-v4-6859.2287 to 4.0.1-next-v4-7604.2322
@@ -1,2 +0,2 @@ | ||
var e=p(require("@babel/runtime/helpers/extends")),{cx:r,css:n}=require("emotion"),t=p(require("react")),{Flex:o}=require("@contentful/f36-core"),{Button:a}=require("@contentful/f36-button"),{Text:i,Heading:c}=require("@contentful/f36-typography"),{CheckCircleIcon:l,InfoCircleIcon:s,CloseIcon:u,WarningIcon:d,ErrorCircleIcon:g}=require("@contentful/f36-icons"),{Icon:m}=require("@contentful/f36-icon"),f=p(require("@contentful/f36-tokens"));function p(e){return e&&e.__esModule?e.default:e}var b,C,h,v,I={};b=I,C="Note",h=()=>k,Object.defineProperty(b,C,{get:h,set:v,enumerable:!0,configurable:!0});const y=e=>{switch(e){case"primary":return{backgroundColor:f.blue100,borderColor:f.blue300,a:{color:f.blue700}};case"positive":return{backgroundColor:f.green100,borderColor:f.green300,a:{color:f.green700}};case"negative":return{backgroundColor:f.red100,borderColor:f.red300,a:{color:f.red700}};case"warning":return{backgroundColor:f.orange100,borderColor:f.orange300,a:{color:f.orange700}};default:return{}}},E={primary:s,positive:l,negative:g,warning:d},k=t.forwardRef(((l,s)=>{const{children:d,className:g,withCloseButton:p=!1,variant:b="primary",onClose:C,testId:h="cf-ui-note",title:v,...I}=l,k={container:({variant:e})=>n({borderRadius:f.borderRadiusMedium,border:"1px solid",...y(e)},""),title:n({color:f.gray800,fontSize:f.fontSizeL,lineHeight:f.lineHeightL,marginBottom:f.spacingXs},""),description:n({color:f.gray700},""),close:n({padding:f.spacingXs,marginTop:`-${f.spacingXs}`,marginRight:`-${f.spacingXs}`,"&:hover, &:active":{backgroundColor:"transparent"}},""),closeIcon:n({color:f.gray600},"")};return t.createElement(o,e({},I,{as:"article",className:r(k.container({variant:b,withCloseButton:p}),g),testId:h,ref:s,padding:"spacingM",alignItems:"flex-start"}),t.createElement(o,{marginRight:"spacingS"},t.createElement(m,{as:E[b],variant:b,size:v?"medium":"small"})),t.createElement("div",null,v&&t.createElement(c,{as:"h2",className:k.title},v),t.createElement(i,{as:"p",lineHeight:"lineHeightM",className:k.description},d)),p&&t.createElement(a,{variant:"transparent",icon:t.createElement(u,{className:k.closeIcon}),onClick:C,testId:`${h}-close`,label:"Dismiss",className:k.close}))}));var q,N;k.displayName="Note",q=module.exports,N=I,Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(q,e,{enumerable:!0,get:function(){return N[e]}})})); | ||
var e=p(require("@babel/runtime/helpers/extends")),{cx:r,css:n}=require("emotion"),t=p(require("react")),{Flex:o}=require("@contentful/f36-core"),{Button:a}=require("@contentful/f36-button"),{Heading:i,Text:c}=require("@contentful/f36-typography"),{CloseIcon:l,WarningIcon:s,InfoCircleIcon:u,CheckCircleIcon:d,ErrorCircleIcon:g}=require("@contentful/f36-icons"),{Icon:m}=require("@contentful/f36-icon"),f=p(require("@contentful/f36-tokens"));function p(e){return e&&e.__esModule?e.default:e}var b,C,h,v,I={};b=I,C="Note",h=()=>k,Object.defineProperty(b,C,{get:h,set:v,enumerable:!0,configurable:!0});const y=e=>{switch(e){case"primary":return{backgroundColor:f.blue100,borderColor:f.blue300,a:{color:f.blue700}};case"positive":return{backgroundColor:f.green100,borderColor:f.green300,a:{color:f.green700}};case"negative":return{backgroundColor:f.red100,borderColor:f.red300,a:{color:f.red700}};case"warning":return{backgroundColor:f.orange100,borderColor:f.orange300,a:{color:f.orange700}};default:return{}}},E={primary:u,positive:d,negative:g,warning:s},k=t.forwardRef(((s,u)=>{const{children:d,className:g,withCloseButton:p=!1,variant:b="primary",onClose:C,testId:h="cf-ui-note",title:v,...I}=s,k={container:({variant:e})=>n({borderRadius:f.borderRadiusMedium,border:"1px solid",...y(e)},""),title:n({color:f.gray800,fontSize:f.fontSizeL,lineHeight:f.lineHeightL,marginBottom:f.spacingXs},""),description:n({color:f.gray700},""),close:n({padding:f.spacingXs,marginTop:`-${f.spacingXs}`,marginRight:`-${f.spacingXs}`,"&:hover, &:active":{backgroundColor:"transparent"}},""),closeIcon:n({color:f.gray600},"")};return t.createElement(o,e({},I,{as:"article",className:r(k.container({variant:b,withCloseButton:p}),g),testId:h,ref:u,padding:"spacingM",alignItems:"flex-start"}),t.createElement(o,{marginRight:"spacingS"},t.createElement(m,{as:E[b],variant:b,size:v?"medium":"small"})),t.createElement("div",null,v&&t.createElement(i,{as:"h2",className:k.title},v),t.createElement(c,{as:"p",lineHeight:"lineHeightM",className:k.description},d)),p&&t.createElement(a,{variant:"transparent",icon:t.createElement(l,{className:k.closeIcon}),onClick:C,testId:`${h}-close`,"aria-label":"Dismiss",className:k.close}))}));var q,N;k.displayName="Note",q=module.exports,N=I,Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(q,e,{enumerable:!0,get:function(){return N[e]}})})); | ||
//# sourceMappingURL=main.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"@babel/runtime/helpers/esm/extends";import{cx as r,css as o}from"emotion";import t from"react";import{Flex as a}from"@contentful/f36-core";import{Button as n}from"@contentful/f36-button";import{Heading as i,Text as s}from"@contentful/f36-typography";import{ErrorCircleIcon as c,CheckCircleIcon as l,WarningIcon as m,CloseIcon as g,InfoCircleIcon as d}from"@contentful/f36-icons";import{Icon as p}from"@contentful/f36-icon";import u from"@contentful/f36-tokens";var f,b,C,h;f={},b="Note",C=()=>y,Object.defineProperty(f,b,{get:C,set:h,enumerable:!0,configurable:!0});const v=e=>{switch(e){case"primary":return{backgroundColor:u.blue100,borderColor:u.blue300,a:{color:u.blue700}};case"positive":return{backgroundColor:u.green100,borderColor:u.green300,a:{color:u.green700}};case"negative":return{backgroundColor:u.red100,borderColor:u.red300,a:{color:u.red700}};case"warning":return{backgroundColor:u.orange100,borderColor:u.orange300,a:{color:u.orange700}};default:return{}}},I={primary:d,positive:l,negative:c,warning:m},y=t.forwardRef(((c,l)=>{const{children:m,className:d,withCloseButton:f=!1,variant:b="primary",onClose:C,testId:h="cf-ui-note",title:y,...N}=c,E={container:({variant:e})=>o({borderRadius:u.borderRadiusMedium,border:"1px solid",...v(e)},""),title:o({color:u.gray800,fontSize:u.fontSizeL,lineHeight:u.lineHeightL,marginBottom:u.spacingXs},""),description:o({color:u.gray700},""),close:o({padding:u.spacingXs,marginTop:`-${u.spacingXs}`,marginRight:`-${u.spacingXs}`,"&:hover, &:active":{backgroundColor:"transparent"}},""),closeIcon:o({color:u.gray600},"")};return t.createElement(a,e({},N,{as:"article",className:r(E.container({variant:b,withCloseButton:f}),d),testId:h,ref:l,padding:"spacingM",alignItems:"flex-start"}),t.createElement(a,{marginRight:"spacingS"},t.createElement(p,{as:I[b],variant:b,size:y?"medium":"small"})),t.createElement("div",null,y&&t.createElement(i,{as:"h2",className:E.title},y),t.createElement(s,{as:"p",lineHeight:"lineHeightM",className:E.description},m)),f&&t.createElement(n,{variant:"transparent",icon:t.createElement(g,{className:E.closeIcon}),onClick:C,testId:`${h}-close`,label:"Dismiss",className:E.close}))}));y.displayName="Note";export{y as Note}; | ||
import e from"@babel/runtime/helpers/esm/extends";import{cx as r,css as o}from"emotion";import t from"react";import{Flex as a}from"@contentful/f36-core";import{Button as n}from"@contentful/f36-button";import{Heading as i,Text as s}from"@contentful/f36-typography";import{ErrorCircleIcon as c,WarningIcon as l,CheckCircleIcon as m,CloseIcon as g,InfoCircleIcon as d}from"@contentful/f36-icons";import{Icon as p}from"@contentful/f36-icon";import u from"@contentful/f36-tokens";var f,b,C,h;f={},b="Note",C=()=>y,Object.defineProperty(f,b,{get:C,set:h,enumerable:!0,configurable:!0});const v=e=>{switch(e){case"primary":return{backgroundColor:u.blue100,borderColor:u.blue300,a:{color:u.blue700}};case"positive":return{backgroundColor:u.green100,borderColor:u.green300,a:{color:u.green700}};case"negative":return{backgroundColor:u.red100,borderColor:u.red300,a:{color:u.red700}};case"warning":return{backgroundColor:u.orange100,borderColor:u.orange300,a:{color:u.orange700}};default:return{}}},I={primary:d,positive:m,negative:c,warning:l},y=t.forwardRef(((c,l)=>{const{children:m,className:d,withCloseButton:f=!1,variant:b="primary",onClose:C,testId:h="cf-ui-note",title:y,...N}=c,E={container:({variant:e})=>o({borderRadius:u.borderRadiusMedium,border:"1px solid",...v(e)},""),title:o({color:u.gray800,fontSize:u.fontSizeL,lineHeight:u.lineHeightL,marginBottom:u.spacingXs},""),description:o({color:u.gray700},""),close:o({padding:u.spacingXs,marginTop:`-${u.spacingXs}`,marginRight:`-${u.spacingXs}`,"&:hover, &:active":{backgroundColor:"transparent"}},""),closeIcon:o({color:u.gray600},"")};return t.createElement(a,e({},N,{as:"article",className:r(E.container({variant:b,withCloseButton:f}),d),testId:h,ref:l,padding:"spacingM",alignItems:"flex-start"}),t.createElement(a,{marginRight:"spacingS"},t.createElement(p,{as:I[b],variant:b,size:y?"medium":"small"})),t.createElement("div",null,y&&t.createElement(i,{as:"h2",className:E.title},y),t.createElement(s,{as:"p",lineHeight:"lineHeightM",className:E.description},m)),f&&t.createElement(n,{variant:"transparent",icon:t.createElement(g,{className:E.closeIcon}),onClick:C,testId:`${h}-close`,"aria-label":"Dismiss",className:E.close}))}));y.displayName="Note";export{y as Note}; | ||
//# sourceMappingURL=module.js.map |
import React from "react"; | ||
import { CommonProps, PolymorphicComponentProps } from "@contentful/f36-core"; | ||
import { CommonProps, PropsWithHTMLElement } from "@contentful/f36-core"; | ||
type NoteVariant = 'negative' | 'positive' | 'primary' | 'warning'; | ||
@@ -25,10 +25,32 @@ type NoteInternalProps = CommonProps & { | ||
*/ | ||
onClose?: Function; | ||
onClose?: React.MouseEventHandler<HTMLButtonElement>; | ||
}; | ||
export type NoteProps = PolymorphicComponentProps<'article', NoteInternalProps>; | ||
export type NoteProps = PropsWithHTMLElement<NoteInternalProps, 'article'>; | ||
/** | ||
* @description: Note provides context and information about a situation or action. | ||
*/ | ||
export const Note: React.ForwardRefExoticComponent<Pick<NoteProps, "hidden" | "dir" | "slot" | "title" | "color" | "translate" | "prefix" | "children" | "key" | "as" | keyof CommonProps | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "variant" | "withCloseButton" | "onClose"> & React.RefAttributes<HTMLElement>>; | ||
export const Note: React.ForwardRefExoticComponent<Omit<Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof React.HTMLAttributes<HTMLElement>>, never>, "title" | "children" | "variant" | keyof CommonProps | "withCloseButton" | "onClose"> & CommonProps & { | ||
/** | ||
* Determines style variation of Note component | ||
*/ | ||
variant?: NoteVariant; | ||
/** | ||
* Sets title in the Note | ||
*/ | ||
title?: string; | ||
/** | ||
* Children of Note | ||
*/ | ||
children?: React.ReactNode; | ||
/** | ||
* Defines if the close button should be rendered | ||
* @default false | ||
*/ | ||
withCloseButton?: boolean; | ||
/** | ||
* Callback for handling closing | ||
*/ | ||
onClose?: React.MouseEventHandler<HTMLButtonElement>; | ||
} & React.RefAttributes<HTMLElement>>; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@contentful/f36-note", | ||
"version": "4.0.1-next-v4-6859.2287+1c884886", | ||
"version": "4.0.1-next-v4-7604.2322+0bee7360", | ||
"description": "Forma 36: Note component", | ||
@@ -10,7 +10,7 @@ "scripts": { | ||
"@babel/runtime": "^7.6.2", | ||
"@contentful/f36-button": "4.0.1-next-v4-6859.2287+1c884886", | ||
"@contentful/f36-core": "4.0.1-next-v4-6859.2287+1c884886", | ||
"@contentful/f36-icons": "4.0.1-next-v4-6859.2287+1c884886", | ||
"@contentful/f36-tokens": "4.0.1-next-v4-6859.2287+1c884886", | ||
"@contentful/f36-typography": "4.0.1-next-v4-6859.2287+1c884886", | ||
"@contentful/f36-button": "4.0.1-next-v4-7604.2322+0bee7360", | ||
"@contentful/f36-core": "4.0.1-next-v4-7604.2322+0bee7360", | ||
"@contentful/f36-icons": "4.0.1-next-v4-7604.2322+0bee7360", | ||
"@contentful/f36-tokens": "4.0.1-next-v4-7604.2322+0bee7360", | ||
"@contentful/f36-typography": "4.0.1-next-v4-7604.2322+0bee7360", | ||
"emotion": "^10.0.17" | ||
@@ -42,3 +42,3 @@ }, | ||
}, | ||
"gitHead": "1c884886dfbd1a17e16a1c06523e23861922e466" | ||
"gitHead": "0bee7360d2456674a913f221d51a3b08d75a14bb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
252
59743
7
Updated@contentful/f36-button@4.0.1-next-v4-7604.2322+0bee7360
Updated@contentful/f36-core@4.0.1-next-v4-7604.2322+0bee7360
Updated@contentful/f36-icons@4.0.1-next-v4-7604.2322+0bee7360
Updated@contentful/f36-tokens@4.0.1-next-v4-7604.2322+0bee7360
Updated@contentful/f36-typography@4.0.1-next-v4-7604.2322+0bee7360