carbon-react 155.0.2 → 155.0.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"react";import n from"invariant";import{StyledNote as r,StyledNoteMain as i,StyledNoteContent as p,StyledTitleWrapper as a,StyledInlineControl as c,StyledFooter as l,StyledFooterContent as m}from"./note.style.js";import s from"./__internal__/status-icon/status-icon.component.js";import{ActionPopover as d}from"../action-popover/action-popover.component.js";import"../action-popover/action-popover-menu/action-popover-menu.component.js";import"../action-popover/action-popover-item/action-popover-item.component.js";import"../action-popover/action-popover-menu-button/action-popover-menu-button.component.js";import"../action-popover/action-popover-divider/action-popover-divider.component.js";import u from"../text-editor/__internal__/read-only-rte.component.js";import f from"../text-editor/text-editor.context.js";import{LinkPreview as v}from"../link-preview/link-preview.component.js";import{Typography as h}from"../typography/typography.component.js";import y from"../../__internal__/utils/helpers/tags/tags.js";function b(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function j(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),n.forEach((function(t){b(e,t,o[t])}))}return e}const O=b=>{var O,g,{createdDate:w,inlineControl:P,name:x,noteContent:_,onLinkAdded:k,previews:C,status:S,title:N,width:D=100}=b,E=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(b,["createdDate","inlineControl","name","noteContent","onLinkAdded","previews","status","title","width"]);return n(D>0,"<Note> width must be greater than 0"),n(!P||o.isValidElement(P)&&P.type===d,"<Note> inlineControl must be an instance of <ActionPopover>"),e(f.Provider,{value:{onLinkAdded:k},children:t(r,(O=j({width:D},E,y("note",E)),g={children:[t(i,{children:[t(p,{children:[N&&("string"==typeof N?e(h,{"data-role":"note-title",fontWeight:"700",fontSize:"16px",lineHeight:"21px",paddingBottom:"16px",variant:"
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"react";import n from"invariant";import{StyledNote as r,StyledNoteMain as i,StyledNoteContent as p,StyledTitleWrapper as a,StyledInlineControl as c,StyledFooter as l,StyledFooterContent as m}from"./note.style.js";import s from"./__internal__/status-icon/status-icon.component.js";import{ActionPopover as d}from"../action-popover/action-popover.component.js";import"../action-popover/action-popover-menu/action-popover-menu.component.js";import"../action-popover/action-popover-item/action-popover-item.component.js";import"../action-popover/action-popover-menu-button/action-popover-menu-button.component.js";import"../action-popover/action-popover-divider/action-popover-divider.component.js";import u from"../text-editor/__internal__/read-only-rte.component.js";import f from"../text-editor/text-editor.context.js";import{LinkPreview as v}from"../link-preview/link-preview.component.js";import{Typography as h}from"../typography/typography.component.js";import y from"../../__internal__/utils/helpers/tags/tags.js";function b(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function j(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),n.forEach((function(t){b(e,t,o[t])}))}return e}const O=b=>{var O,g,{createdDate:w,inlineControl:P,name:x,noteContent:_,onLinkAdded:k,previews:C,status:S,title:N,width:D=100}=b,E=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(b,["createdDate","inlineControl","name","noteContent","onLinkAdded","previews","status","title","width"]);return n(D>0,"<Note> width must be greater than 0"),n(!P||o.isValidElement(P)&&P.type===d,"<Note> inlineControl must be an instance of <ActionPopover>"),e(f.Provider,{value:{onLinkAdded:k},children:t(r,(O=j({width:D},E,y("note",E)),g={children:[t(i,{children:[t(p,{children:[N&&("string"==typeof N?e(h,{"data-role":"note-title",fontWeight:"700",fontSize:"16px",lineHeight:"21px",paddingBottom:"16px",variant:"h3",children:N}):e(a,{children:N})),e(u,{value:_})]}),P&&e(c,{children:P})]}),e(p,{children:o.Children.map(C,(e=>{return o.isValidElement(e)&&(t=e,n=v.displayName,t.type.displayName===n)?o.cloneElement(e,{as:"a",onClose:void 0}):e;var t,n}))}),w&&e(p,{hasPreview:!!o.Children.count(C),children:t(l,{"data-element":"note-footer",children:[x&&e(m,{hasName:!!x,children:x}),e(m,{hasName:!!x,children:w}),(()=>{if(!S)return null;const{text:t,timeStamp:o}=S;return e(m,{hasName:!!x,"data-component":"note-status",children:e(s,{tooltipMessage:o,children:t})})})()]})})]},g=null!=g?g:{},Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(g)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t.push.apply(t,o)}return t}(Object(g)).forEach((function(e){Object.defineProperty(O,e,Object.getOwnPropertyDescriptor(g,e))})),O))})};export{O as Note,O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant"),r=require("./note.style.js"),o=require("./__internal__/status-icon/status-icon.component.js"),i=require("../action-popover/action-popover.component.js");require("../action-popover/action-popover-menu/action-popover-menu.component.js"),require("../action-popover/action-popover-item/action-popover-item.component.js"),require("../action-popover/action-popover-menu-button/action-popover-menu-button.component.js"),require("../action-popover/action-popover-divider/action-popover-divider.component.js");var a=require("../text-editor/__internal__/read-only-rte.component.js"),l=require("../text-editor/text-editor.context.js"),p=require("../link-preview/link-preview.component.js"),c=require("../typography/typography.component.js"),s=require("../../__internal__/utils/helpers/tags/tags.js");function u(e){return e&&e.__esModule?e:{default:e}}var d=u(t),y=u(n);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}const v=t=>{var n,u,{createdDate:f,inlineControl:v,name:m,noteContent:h,onLinkAdded:b,previews:O,status:x,title:g,width:w=100}=t,P=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["createdDate","inlineControl","name","noteContent","onLinkAdded","previews","status","title","width"]);return y.default(w>0,"<Note> width must be greater than 0"),y.default(!v||d.default.isValidElement(v)&&v.type===i.ActionPopover,"<Note> inlineControl must be an instance of <ActionPopover>"),e.jsx(l.default.Provider,{value:{onLinkAdded:b},children:e.jsxs(r.StyledNote,(n=j({width:w},P,s.default("note",P)),u={children:[e.jsxs(r.StyledNoteMain,{children:[e.jsxs(r.StyledNoteContent,{children:[g&&("string"==typeof g?e.jsx(c.Typography,{"data-role":"note-title",fontWeight:"700",fontSize:"16px",lineHeight:"21px",paddingBottom:"16px",variant:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant"),r=require("./note.style.js"),o=require("./__internal__/status-icon/status-icon.component.js"),i=require("../action-popover/action-popover.component.js");require("../action-popover/action-popover-menu/action-popover-menu.component.js"),require("../action-popover/action-popover-item/action-popover-item.component.js"),require("../action-popover/action-popover-menu-button/action-popover-menu-button.component.js"),require("../action-popover/action-popover-divider/action-popover-divider.component.js");var a=require("../text-editor/__internal__/read-only-rte.component.js"),l=require("../text-editor/text-editor.context.js"),p=require("../link-preview/link-preview.component.js"),c=require("../typography/typography.component.js"),s=require("../../__internal__/utils/helpers/tags/tags.js");function u(e){return e&&e.__esModule?e:{default:e}}var d=u(t),y=u(n);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}const v=t=>{var n,u,{createdDate:f,inlineControl:v,name:m,noteContent:h,onLinkAdded:b,previews:O,status:x,title:g,width:w=100}=t,P=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["createdDate","inlineControl","name","noteContent","onLinkAdded","previews","status","title","width"]);return y.default(w>0,"<Note> width must be greater than 0"),y.default(!v||d.default.isValidElement(v)&&v.type===i.ActionPopover,"<Note> inlineControl must be an instance of <ActionPopover>"),e.jsx(l.default.Provider,{value:{onLinkAdded:b},children:e.jsxs(r.StyledNote,(n=j({width:w},P,s.default("note",P)),u={children:[e.jsxs(r.StyledNoteMain,{children:[e.jsxs(r.StyledNoteContent,{children:[g&&("string"==typeof g?e.jsx(c.Typography,{"data-role":"note-title",fontWeight:"700",fontSize:"16px",lineHeight:"21px",paddingBottom:"16px",variant:"h3",children:g}):e.jsx(r.StyledTitleWrapper,{children:g})),e.jsx(a.default,{value:h})]}),v&&e.jsx(r.StyledInlineControl,{children:v})]}),e.jsx(r.StyledNoteContent,{children:d.default.Children.map(O,(e=>{return d.default.isValidElement(e)&&(t=e,n=p.LinkPreview.displayName,t.type.displayName===n)?d.default.cloneElement(e,{as:"a",onClose:void 0}):e;var t,n}))}),f&&e.jsx(r.StyledNoteContent,{hasPreview:!!d.default.Children.count(O),children:e.jsxs(r.StyledFooter,{"data-element":"note-footer",children:[m&&e.jsx(r.StyledFooterContent,{hasName:!!m,children:m}),e.jsx(r.StyledFooterContent,{hasName:!!m,children:f}),(()=>{if(!x)return null;const{text:t,timeStamp:n}=x;return e.jsx(r.StyledFooterContent,{hasName:!!m,"data-component":"note-status",children:e.jsx(o.default,{tooltipMessage:n,children:t})})})()]})})]},u=null!=u?u:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(u)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(u)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(u,e))})),n))})};exports.Note=v,exports.default=v;
|