@dfds-ui/icons 0.9.6 → 0.9.7

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.
@@ -0,0 +1,30 @@
1
+ import React, { ComponentPropsWithRef } from 'react';
2
+ import * as systemIcons from './system';
3
+ declare type SystemIcon = keyof typeof systemIcons;
4
+ declare type Size = 's' | 'm' | 'l' | 'xl';
5
+ export declare type SystemIconProps = {
6
+ /**
7
+ * Name of the icon in the System set of icons.
8
+ */
9
+ icon: SystemIcon;
10
+ /**
11
+ * Predefined size to use.
12
+ */
13
+ size?: Size;
14
+ /**
15
+ * Class name to be assigned to the component.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Setting the `inline` prop to `true` will set negative margins which will compensate for the existing padding/space
20
+ * that appears inside the icon's sources. Use this only when inline icons inside a text-block.
21
+ *
22
+ * NB! Using `inline` will result in the `size` prop being ignored.
23
+ */
24
+ inline?: boolean;
25
+ } & ComponentPropsWithRef<'svg'>;
26
+ /**
27
+ * The `SystemIcon` component is a helper component for displaying icons in the **system** set in "sane" sizes.
28
+ */
29
+ export declare const SystemIcon: React.ForwardRefExoticComponent<Pick<SystemIconProps, "string" | "filter" | "values" | "fill" | "max" | "type" | "inline" | "accumulate" | "offset" | "key" | "id" | "media" | "origin" | "height" | "width" | "end" | "name" | "alignmentBaseline" | "baselineShift" | "clip" | "clipPath" | "clipRule" | "color" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "style" | "path" | "method" | "target" | "lang" | "className" | "children" | "tabIndex" | "size" | "orientation" | "local" | "x" | "y" | "icon" | "mathematical" | "azimuth" | "colorRendering" | "glyphOrientationVertical" | "vectorEffect" | "additive" | "unicodeRange" | "crossOrigin" | "href" | "min" | "role" | "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" | "accentHeight" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "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" | "css"> & React.RefAttributes<SVGSVGElement>>;
30
+ export {};
package/SystemIcon.js ADDED
@@ -0,0 +1,46 @@
1
+ var _excluded = ["icon", "size", "className", "inline"];
2
+
3
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+
7
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
+
9
+ import { css } from '@emotion/react';
10
+ import React, { forwardRef } from 'react';
11
+ import * as systemIcons from './system';
12
+ import { jsx as ___EmotionJSX } from "@emotion/react";
13
+ var sizes = {
14
+ s: '1rem',
15
+ m: '1.5rem',
16
+ l: '2rem',
17
+ xl: '2.5rem'
18
+ };
19
+
20
+ var inlineCss = function inlineCss(size) {
21
+ return /*#__PURE__*/css("margin-top:calc(-", size, " / 6);margin-bottom:calc(-", size, " / 6);" + (process.env.NODE_ENV === "production" ? "" : ";label:inlineCss;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9TeXN0ZW1JY29uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3Q3VDIiwiZmlsZSI6Ii4uL3NyYy9TeXN0ZW1JY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IFJlYWN0LCB7IENvbXBvbmVudFByb3BzV2l0aFJlZiwgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0ICogYXMgc3lzdGVtSWNvbnMgZnJvbSAnLi9zeXN0ZW0nXG5cbnR5cGUgU3lzdGVtSWNvbiA9IGtleW9mIHR5cGVvZiBzeXN0ZW1JY29uc1xuXG50eXBlIFNpemUgPSAncycgfCAnbScgfCAnbCcgfCAneGwnXG5cbmV4cG9ydCB0eXBlIFN5c3RlbUljb25Qcm9wcyA9IHtcbiAgLyoqXG4gICAqIE5hbWUgb2YgdGhlIGljb24gaW4gdGhlIFN5c3RlbSBzZXQgb2YgaWNvbnMuXG4gICAqL1xuICBpY29uOiBTeXN0ZW1JY29uXG5cbiAgLyoqXG4gICAqIFByZWRlZmluZWQgc2l6ZSB0byB1c2UuXG4gICAqL1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cbmV4cG9ydCBjb25zdCBTeXN0ZW1JY29uID0gZm9yd2FyZFJlZjxTVkdTVkdFbGVtZW50LCBTeXN0ZW1JY29uUHJvcHM+KFxuICAoeyBpY29uLCBzaXplID0gJ20nLCBjbGFzc05hbWUsIGlubGluZSwgLi4ucmVzdCB9LCByZWYpID0+IHtcbiAgICBjb25zdCBJY29uID0gc3lzdGVtSWNvbnNbaWNvbl1cbiAgICBjb25zdCBzaXplVmFsdWUgPSBpbmxpbmUgPyAnMS41ZW0nIDogc2l6ZXNbc2l6ZV1cbiAgICByZXR1cm4gKFxuICAgICAgPEljb25cbiAgICAgICAgY2xhc3NOYW1lPXtjbGFzc05hbWV9XG4gICAgICAgIGhlaWdodD17c2l6ZVZhbHVlfVxuICAgICAgICB3aWR0aD17c2l6ZVZhbHVlfVxuICAgICAgICBjc3M9e2lubGluZSAmJiBpbmxpbmVDc3Moc2l6ZVZhbHVlKX1cbiAgICAgICAgey4uLnJlc3R9XG4gICAgICAgIHJlZj17cmVmfVxuICAgICAgLz5cbiAgICApXG4gIH1cbilcbiJdfQ== */");
22
+ };
23
+ /**
24
+ * The `SystemIcon` component is a helper component for displaying icons in the **system** set in "sane" sizes.
25
+ */
26
+
27
+
28
+ export var SystemIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
29
+ var icon = _ref.icon,
30
+ _ref$size = _ref.size,
31
+ size = _ref$size === void 0 ? 'm' : _ref$size,
32
+ className = _ref.className,
33
+ inline = _ref.inline,
34
+ rest = _objectWithoutProperties(_ref, _excluded);
35
+
36
+ var Icon = systemIcons[icon];
37
+ var sizeValue = inline ? '1.5em' : sizes[size];
38
+ return ___EmotionJSX(Icon, _extends({
39
+ className: className,
40
+ height: sizeValue,
41
+ width: sizeValue,
42
+ css: inline && inlineCss(sizeValue)
43
+ }, rest, {
44
+ ref: ref
45
+ }));
46
+ });
@@ -0,0 +1,30 @@
1
+ import React, { ComponentPropsWithRef } from 'react';
2
+ import * as systemIcons from './system';
3
+ declare type SystemIcon = keyof typeof systemIcons;
4
+ declare type Size = 's' | 'm' | 'l' | 'xl';
5
+ export declare type SystemIconProps = {
6
+ /**
7
+ * Name of the icon in the System set of icons.
8
+ */
9
+ icon: SystemIcon;
10
+ /**
11
+ * Predefined size to use.
12
+ */
13
+ size?: Size;
14
+ /**
15
+ * Class name to be assigned to the component.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Setting the `inline` prop to `true` will set negative margins which will compensate for the existing padding/space
20
+ * that appears inside the icon's sources. Use this only when inline icons inside a text-block.
21
+ *
22
+ * NB! Using `inline` will result in the `size` prop being ignored.
23
+ */
24
+ inline?: boolean;
25
+ } & ComponentPropsWithRef<'svg'>;
26
+ /**
27
+ * The `SystemIcon` component is a helper component for displaying icons in the **system** set in "sane" sizes.
28
+ */
29
+ export declare const SystemIcon: React.ForwardRefExoticComponent<Pick<SystemIconProps, "string" | "filter" | "values" | "fill" | "max" | "type" | "inline" | "accumulate" | "offset" | "key" | "id" | "media" | "origin" | "height" | "width" | "end" | "name" | "alignmentBaseline" | "baselineShift" | "clip" | "clipPath" | "clipRule" | "color" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "style" | "path" | "method" | "target" | "lang" | "className" | "children" | "tabIndex" | "size" | "orientation" | "local" | "x" | "y" | "icon" | "mathematical" | "azimuth" | "colorRendering" | "glyphOrientationVertical" | "vectorEffect" | "additive" | "unicodeRange" | "crossOrigin" | "href" | "min" | "role" | "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" | "accentHeight" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "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" | "css"> & React.RefAttributes<SVGSVGElement>>;
30
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SystemIcon = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _react2 = _interopRequireWildcard(require("react"));
11
+
12
+ var systemIcons = _interopRequireWildcard(require("./system"));
13
+
14
+ const _excluded = ["icon", "size", "className", "inline"];
15
+
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
20
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
+
22
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
+
24
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
25
+
26
+ const sizes = {
27
+ s: '1rem',
28
+ m: '1.5rem',
29
+ l: '2rem',
30
+ xl: '2.5rem'
31
+ };
32
+
33
+ const inlineCss = size => /*#__PURE__*/(0, _react.css)("margin-top:calc(-", size, " / 6);margin-bottom:calc(-", size, " / 6);" + (process.env.NODE_ENV === "production" ? "" : ";label:inlineCss;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9TeXN0ZW1JY29uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3Q3VDIiwiZmlsZSI6Ii4uLy4uL3NyYy9TeXN0ZW1JY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IFJlYWN0LCB7IENvbXBvb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pemVzOiB7IFtrIGluIFNpemVdOiBzdHJpbmcgfSA9IHtcbiAgczogJzFyZW0nLFxuICBtOiAnMS41cmVtJyxcbiAgbDogJzJyZW0nLFxuICB4bDogJzIuNXJlbScsXG59XG5cbmNvbnN0IGlubGluZUNzcyA9IChzaXplOiBzdHJpbmcpID0+IGNzc2BcbiAgbWFyZ2luLXRvcDogY2FsYygtJHtzaXplfSAvIDYpO1xuICBtYXJnaW4tYm90dG9tOiBjYWxjKC0ke3NpemV9IC8gNik7XG5gXG4vKipcbiAqIFRoZSBgU3lzdGVtSWNvbmAgY29tcG9uZW50IGlzIGEgaGVscGVyIGNvbXBvbmVudCBmb3IgZGlzcGxheWluZyBpY29ucyBpbiB0aGUgKipzeXN0ZW0qKiBzZXQgaW4gXCJzYW5lXCIgc2l6ZXMuXG4gKi9cbmV4cG9ydCBjb25zdCBTeXN0ZW1JY29uID0gZm9yd2FyZFJlZjxTVkdTVkdFbGVtZW50LCBTeXN0ZW1JY29uUHJvcHM+KFxuICAoeyBpY29uLCBzaXplID0gJ20nLCBjbGFzc05hbWUsIGlubGluZSwgLi4ucmVzdCB9LCByZWYpID0+IHtcbiAgICBjb25zdCBJY29uID0gc3lzdGVtSWNvbnNbaWNvbl1cbiAgICBjb25zdCBzaXplVmFsdWUgPSBpbmxpbmUgPyAnMS41ZW0nIDogc2l6ZXNbc2l6ZV1cbiAgICByZXR1cm4gKFxuICAgICAgPEljb25cbiAgICAgICAgY2xhc3NOYW1lPXtjbGFzc05hbWV9XG4gICAgICAgIGhlaWdodD17c2l6ZVZhbHVlfVxuICAgICAgICB3aWR0aD17c2l6ZVZhbHVlfVxuICAgICAgICBjc3M9e2lubGluZSAmJiBpbmxpbmVDc3Moc2l6ZVZhbHVlKX1cbiAgICAgICAgey4uLnJlc3R9XG4gICAgICAgIHJlZj17cmVmfVxuICAgICAgLz5cbiAgICApXG4gIH1cbilcbiJdfQ== */");
34
+ /**
35
+ * The `SystemIcon` component is a helper component for displaying icons in the **system** set in "sane" sizes.
36
+ */
37
+
38
+
39
+ const SystemIcon = /*#__PURE__*/(0, _react2.forwardRef)((_ref, ref) => {
40
+ let icon = _ref.icon,
41
+ _ref$size = _ref.size,
42
+ size = _ref$size === void 0 ? 'm' : _ref$size,
43
+ className = _ref.className,
44
+ inline = _ref.inline,
45
+ rest = _objectWithoutProperties(_ref, _excluded);
46
+
47
+ const Icon = systemIcons[icon];
48
+ const sizeValue = inline ? '1.5em' : sizes[size];
49
+ return (0, _react.jsx)(Icon, _extends({
50
+ className: className,
51
+ height: sizeValue,
52
+ width: sizeValue,
53
+ css: inline && inlineCss(sizeValue)
54
+ }, rest, {
55
+ ref: ref
56
+ }));
57
+ });
58
+ exports.SystemIcon = SystemIcon;
package/cjs/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './pax';
7
7
  export * from './flags';
8
8
  export * from './social-media';
9
9
  export * from './logistics';
10
+ export * from './SystemIcon';
package/cjs/index.js CHANGED
@@ -117,4 +117,18 @@ Object.keys(_logistics).forEach(function (key) {
117
117
  });
118
118
  });
119
119
 
120
+ var _SystemIcon = require("./SystemIcon");
121
+
122
+ Object.keys(_SystemIcon).forEach(function (key) {
123
+ if (key === "default" || key === "__esModule") return;
124
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
125
+ if (key in exports && exports[key] === _SystemIcon[key]) return;
126
+ Object.defineProperty(exports, key, {
127
+ enumerable: true,
128
+ get: function get() {
129
+ return _SystemIcon[key];
130
+ }
131
+ });
132
+ });
133
+
120
134
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './pax';
7
7
  export * from './flags';
8
8
  export * from './social-media';
9
9
  export * from './logistics';
10
+ export * from './SystemIcon';
package/index.js CHANGED
@@ -6,4 +6,5 @@ export * from './links';
6
6
  export * from './pax';
7
7
  export * from './flags';
8
8
  export * from './social-media';
9
- export * from './logistics';
9
+ export * from './logistics';
10
+ export * from './SystemIcon';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Shared icons within DFDS",
4
4
  "license": "MIT",
5
5
  "private": false,
6
- "version": "0.9.6",
6
+ "version": "0.9.7",
7
7
  "sideEffects": false,
8
8
  "main": "./cjs/index.js",
9
9
  "module": "./index.js",
@@ -15,7 +15,7 @@
15
15
  "react": ">= 16.8.0",
16
16
  "react-dom": ">= 16.8.0"
17
17
  },
18
- "gitHead": "d77e4e1ccf007cb60c5c2a1eac072eadc5c9b492",
18
+ "gitHead": "725c7e10278d5653e6b3f09c52b61245cfadaa94",
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  }