@useblu/ocean-components
Advanced tools
Comparing version 0.1.0-beta.1 to 0.1.0-beta.2
export { default as Typography } from './Typography'; | ||
export * from './Typography'; | ||
export { default as Grid } from './Grid'; | ||
export * from './Grid'; |
@@ -115,3 +115,3 @@ import React from 'react'; | ||
var Typography = React.forwardRef(function Typography(_a, ref) { | ||
var variant = _a.variant, children = _a.children, className = _a.className, rest = __rest(_a, ["variant", "children", "className"]); | ||
var children = _a.children, variant = _a.variant, className = _a.className, rest = __rest(_a, ["children", "variant", "className"]); | ||
var Component = defaultTypesMapping[variant]; | ||
@@ -121,3 +121,62 @@ return (React.createElement(Component, __assign({ ref: ref, className: classnames("ods-typography ods-typography__" + variant, className) }, rest), children)); | ||
export { Typography }; | ||
var Container = React.forwardRef(function Container(_a, ref) { | ||
var children = _a.children, _b = _a.fluid, fluid = _b === void 0 ? false : _b, className = _a.className, rest = __rest(_a, ["children", "fluid", "className"]); | ||
var prefix = 'ods-container'; | ||
var suffix = typeof fluid === 'string' ? "-" + fluid : '-fluid'; | ||
return (React.createElement("div", __assign({ ref: ref, className: classnames(fluid ? "" + prefix + suffix : prefix, className) }, rest), children)); | ||
}); | ||
var Row = React.forwardRef(function Row(_a, ref) { | ||
var _b; | ||
var children = _a.children, className = _a.className, _c = _a.noGutters, noGutters = _c === void 0 ? false : _c, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, rest = __rest(_a, ["children", "className", "noGutters", "xs", "sm", "md", "lg", "xl"]); | ||
return (React.createElement("div", __assign({ ref: ref, className: classnames('ods-row', noGutters && 'ods-no-gutters', (_b = {}, | ||
_b["ods-row-cols-" + xs] = xs, | ||
_b["ods-row-cols-sm-" + sm] = sm, | ||
_b["ods-row-cols-md-" + md] = md, | ||
_b["ods-row-cols-lg-" + lg] = lg, | ||
_b["ods-row-cols-xl-" + xl] = xl, | ||
_b), className) }, rest), children)); | ||
}); | ||
var DEVICE_SIZES = [ | ||
'xs', | ||
'sm', | ||
'md', | ||
'lg', | ||
'xl', | ||
]; | ||
var Col = React.forwardRef(function Col(_a, ref) { | ||
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]); | ||
var prefix = 'ods-col'; | ||
var classes = []; | ||
var hasAnySpan = false; | ||
DEVICE_SIZES.forEach(function (brkPoint) { | ||
var _a; | ||
var propValue = rest[brkPoint]; | ||
delete rest[brkPoint]; | ||
var span; | ||
var offset; | ||
if (typeof propValue === 'object' && propValue) { | ||
(_a = propValue.span, span = _a === void 0 ? true : _a, offset = propValue.offset); | ||
} | ||
else { | ||
span = propValue; | ||
} | ||
var infix = brkPoint !== 'xs' ? "-" + brkPoint : ''; | ||
if (span) { | ||
hasAnySpan = true; | ||
classes.push(span === true ? "" + prefix + infix : "" + prefix + infix + "-" + span); | ||
} | ||
if (offset) | ||
classes.push("ods-offset" + infix + "-" + offset); | ||
}); | ||
// plain 'ods-col' | ||
if (!hasAnySpan) | ||
classes.unshift(prefix); | ||
return (React.createElement("div", __assign({ ref: ref, className: classnames(classes, className) }, rest), children)); | ||
}); | ||
var index = { Container: Container, Row: Row, Col: Col }; | ||
export { index as Grid, Typography }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -121,3 +121,3 @@ 'use strict'; | ||
var Typography = React.forwardRef(function Typography(_a, ref) { | ||
var variant = _a.variant, children = _a.children, className = _a.className, rest = __rest(_a, ["variant", "children", "className"]); | ||
var children = _a.children, variant = _a.variant, className = _a.className, rest = __rest(_a, ["children", "variant", "className"]); | ||
var Component = defaultTypesMapping[variant]; | ||
@@ -127,3 +127,63 @@ return (React.createElement(Component, __assign({ ref: ref, className: classnames("ods-typography ods-typography__" + variant, className) }, rest), children)); | ||
var Container = React.forwardRef(function Container(_a, ref) { | ||
var children = _a.children, _b = _a.fluid, fluid = _b === void 0 ? false : _b, className = _a.className, rest = __rest(_a, ["children", "fluid", "className"]); | ||
var prefix = 'ods-container'; | ||
var suffix = typeof fluid === 'string' ? "-" + fluid : '-fluid'; | ||
return (React.createElement("div", __assign({ ref: ref, className: classnames(fluid ? "" + prefix + suffix : prefix, className) }, rest), children)); | ||
}); | ||
var Row = React.forwardRef(function Row(_a, ref) { | ||
var _b; | ||
var children = _a.children, className = _a.className, _c = _a.noGutters, noGutters = _c === void 0 ? false : _c, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, rest = __rest(_a, ["children", "className", "noGutters", "xs", "sm", "md", "lg", "xl"]); | ||
return (React.createElement("div", __assign({ ref: ref, className: classnames('ods-row', noGutters && 'ods-no-gutters', (_b = {}, | ||
_b["ods-row-cols-" + xs] = xs, | ||
_b["ods-row-cols-sm-" + sm] = sm, | ||
_b["ods-row-cols-md-" + md] = md, | ||
_b["ods-row-cols-lg-" + lg] = lg, | ||
_b["ods-row-cols-xl-" + xl] = xl, | ||
_b), className) }, rest), children)); | ||
}); | ||
var DEVICE_SIZES = [ | ||
'xs', | ||
'sm', | ||
'md', | ||
'lg', | ||
'xl', | ||
]; | ||
var Col = React.forwardRef(function Col(_a, ref) { | ||
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]); | ||
var prefix = 'ods-col'; | ||
var classes = []; | ||
var hasAnySpan = false; | ||
DEVICE_SIZES.forEach(function (brkPoint) { | ||
var _a; | ||
var propValue = rest[brkPoint]; | ||
delete rest[brkPoint]; | ||
var span; | ||
var offset; | ||
if (typeof propValue === 'object' && propValue) { | ||
(_a = propValue.span, span = _a === void 0 ? true : _a, offset = propValue.offset); | ||
} | ||
else { | ||
span = propValue; | ||
} | ||
var infix = brkPoint !== 'xs' ? "-" + brkPoint : ''; | ||
if (span) { | ||
hasAnySpan = true; | ||
classes.push(span === true ? "" + prefix + infix : "" + prefix + infix + "-" + span); | ||
} | ||
if (offset) | ||
classes.push("ods-offset" + infix + "-" + offset); | ||
}); | ||
// plain 'ods-col' | ||
if (!hasAnySpan) | ||
classes.unshift(prefix); | ||
return (React.createElement("div", __assign({ ref: ref, className: classnames(classes, className) }, rest), children)); | ||
}); | ||
var index = { Container: Container, Row: Row, Col: Col }; | ||
exports.Grid = index; | ||
exports.Typography = Typography; | ||
//# sourceMappingURL=index.js.map |
@@ -14,6 +14,2 @@ import React from 'react'; | ||
children: React.ReactNode; | ||
/** | ||
* The CSS class name of the wrapper element. | ||
*/ | ||
className?: string; | ||
} & React.ComponentPropsWithoutRef<'span'>; | ||
@@ -29,7 +25,3 @@ declare const Typography: React.ForwardRefExoticComponent<{ | ||
children: React.ReactNode; | ||
/** | ||
* The CSS class name of the wrapper element. | ||
*/ | ||
className?: string | undefined; | ||
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "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" | "children" | "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"> & React.RefAttributes<unknown>>; | ||
export default Typography; |
{ | ||
"name": "@useblu/ocean-components", | ||
"version": "0.1.0-beta.1", | ||
"version": "0.1.0-beta.2", | ||
"description": "React components that implement Ocean's Design System.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# ocean-ds | ||
## Useful resources for setup configuration: | ||
1. Article "Creating a React Component Library using Rollup, Typescript, Sass and Storybook" | ||
- https://blog.harveydelaney.com/creating-your-own-react-component-library/ | ||
2. Boilerplate of the project "Zero-config CLI for TypeScript package development" by Formik creator | ||
- https://github.com/jaredpalmer/tsdx/tree/master/src | ||
3. Boilerplate of the project "CLI for creating reusable react libraries." | ||
- https://github.com/transitive-bullshit/react-modern-library-boilerplate | ||
## Useful resources for typescript: | ||
1. Cheatsheets for experienced React developers getting started with TypeScript | ||
- https://react-typescript-cheatsheet.netlify.app/ | ||
2. TypeScript Deep Dive | ||
- https://basarat.gitbook.io/typescript/ | ||
## Libraries for example: | ||
1. Full typescript, very acessible, made by brazilians <3 | ||
- https://github.com/reakit/reakit/tree/master/packages/reakit/src | ||
2. Very flexible and most loved framework | ||
- https://github.com/ant-design/ant-design/tree/master/components | ||
3. Closest design and very contributed library | ||
- https://github.com/mui-org/material-ui/tree/next/packages/material-ui/src |
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
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
155103
15
579
27