@ndla/safelink 3.1.7 → 4.0.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.
@@ -1,4 +1,4 @@
1
- var _excluded = ["outline", "stripped", "link", "lighter", "children", "inverted", "invertedOutline", "to", "buttonSize", "borderShape", "width", "textAlign", "darker", "greyLighter", "greyLightest"];
1
+ var _excluded = ["children", "inverted", "to", "size", "colorTheme", "variant", "shape", "fontWeight"];
2
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
4
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -12,60 +12,33 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
12
12
  *
13
13
  */
14
14
 
15
- import React from 'react';
16
- import { css } from '@emotion/react';
17
- import { appearances, ButtonStyles } from '@ndla/button';
15
+ import React, { forwardRef } from 'react';
16
+ import { buttonStyleV2 } from '@ndla/button';
18
17
  import SafeLink from './SafeLink';
19
18
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
20
- var getStyles = function getStyles(modifiers) {
21
- return Object.keys(modifiers).map(function (key) {
22
- return modifiers[key] ? appearances[key] : undefined;
23
- }).filter(function (appearance) {
24
- return !!appearance;
25
- });
26
- };
27
- var SafeLinkButton = function SafeLinkButton(_ref) {
28
- var outline = _ref.outline,
29
- stripped = _ref.stripped,
30
- link = _ref.link,
31
- lighter = _ref.lighter,
32
- children = _ref.children,
19
+ var SafeLinkButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
20
+ var children = _ref.children,
33
21
  inverted = _ref.inverted,
34
- invertedOutline = _ref.invertedOutline,
35
22
  to = _ref.to,
36
- buttonSize = _ref.buttonSize,
37
- borderShape = _ref.borderShape,
38
- width = _ref.width,
39
- textAlign = _ref.textAlign,
40
- darker = _ref.darker,
41
- greyLighter = _ref.greyLighter,
42
- greyLightest = _ref.greyLightest,
23
+ size = _ref.size,
24
+ colorTheme = _ref.colorTheme,
25
+ variant = _ref.variant,
26
+ shape = _ref.shape,
27
+ fontWeight = _ref.fontWeight,
43
28
  rest = _objectWithoutProperties(_ref, _excluded);
44
- var modifierStyles = getStyles({
45
- link: link,
46
- outline: outline,
47
- lighter: lighter,
48
- stripped: stripped,
49
- inverted: inverted,
50
- invertedOutline: invertedOutline
51
- });
52
- var buttonStyleProps = {
53
- outline: outline,
54
- lighter: lighter,
55
- size: buttonSize,
56
- borderShape: borderShape,
57
- width: width,
58
- textAlign: textAlign,
59
- darker: darker,
60
- greyLighter: greyLighter,
61
- greyLightest: greyLightest
62
- };
63
- var styles = ButtonStyles(buttonStyleProps);
64
29
  return _jsx(SafeLink, _objectSpread(_objectSpread({
65
30
  to: to,
66
- css: /*#__PURE__*/css(modifierStyles, " ", styles, ";;label:SafeLinkButton;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNhZmVMaW5rQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtRmMiLCJmaWxlIjoiU2FmZUxpbmtCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmln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gIG91dGxpbmUsXG4gICAgbGlnaHRlcixcbiAgICBzaXplOiBidXR0b25TaXplLFxuICAgIGJvcmRlclNoYXBlLFxuICAgIHdpZHRoLFxuICAgIHRleHRBbGlnbixcbiAgICBkYXJrZXIsXG4gICAgZ3JleUxpZ2h0ZXIsXG4gICAgZ3JleUxpZ2h0ZXN0LFxuICB9O1xuICBjb25zdCBzdHlsZXMgPSBCdXR0b25TdHlsZXMoYnV0dG9uU3R5bGVQcm9wcyk7XG5cbiAgcmV0dXJuIChcbiAgICA8U2FmZUxpbmtcbiAgICAgIHRvPXt0b31cbiAgICAgIGNzcz17Y3NzYFxuICAgICAgICAke21vZGlmaWVyU3R5bGVzfVxuICAgICAgICAke3N0eWxlc31cbiAgICAgIGB9XG4gICAgICB7Li4ucmVzdH0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9TYWZlTGluaz5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFNhZmVMaW5rQnV0dG9uO1xuIl19 */"))
31
+ ref: ref,
32
+ css: buttonStyleV2({
33
+ colorTheme: colorTheme,
34
+ size: size,
35
+ variant: variant,
36
+ inverted: inverted,
37
+ shape: shape,
38
+ fontWeight: fontWeight
39
+ })
67
40
  }, rest), {}, {
68
41
  children: children
69
42
  }));
70
- };
43
+ });
71
44
  export default SafeLinkButton;
@@ -0,0 +1,42 @@
1
+ var _excluded = ["children", "inverted", "to", "size", "colorTheme", "variant", "fontWeight"];
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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
+ 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; }
7
+ /**
8
+ * Copyright (c) 2022-present, NDLA.
9
+ *
10
+ * This source code is licensed under the GPLv3 license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ *
13
+ */
14
+
15
+ import React, { forwardRef } from 'react';
16
+ import { iconButtonStyle } from '@ndla/button';
17
+ import SafeLink from './SafeLink';
18
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
19
+ var SafeLinkIconButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
20
+ var children = _ref.children,
21
+ inverted = _ref.inverted,
22
+ to = _ref.to,
23
+ size = _ref.size,
24
+ colorTheme = _ref.colorTheme,
25
+ variant = _ref.variant,
26
+ fontWeight = _ref.fontWeight,
27
+ rest = _objectWithoutProperties(_ref, _excluded);
28
+ return _jsx(SafeLink, _objectSpread(_objectSpread({
29
+ to: to,
30
+ ref: ref,
31
+ css: iconButtonStyle({
32
+ colorTheme: colorTheme,
33
+ size: size,
34
+ variant: variant,
35
+ inverted: inverted,
36
+ fontWeight: fontWeight
37
+ })
38
+ }, rest), {}, {
39
+ children: children
40
+ }));
41
+ });
42
+ export default SafeLinkIconButton;
package/es/index.js CHANGED
@@ -9,4 +9,5 @@
9
9
  import SafeLink from './SafeLink';
10
10
  export { default as MissingRouterContext } from './MissingRouterContext';
11
11
  export { default as SafeLinkButton } from './SafeLinkButton';
12
+ export { default as SafeLinkIconButton } from './SafeLinkIconButton';
12
13
  export default SafeLink;
@@ -5,25 +5,13 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { ReactNode } from 'react';
9
- import { SafeLinkProps } from '.';
10
- interface Props extends SafeLinkProps {
11
- outline?: boolean;
12
- stripped?: boolean;
13
- link?: boolean;
14
- lighter?: boolean;
15
- inverted?: boolean;
16
- invertedOutline?: boolean;
8
+ import React, { ReactNode } from 'react';
9
+ import { ButtonStyleProps } from '@ndla/button';
10
+ import { SafeLinkProps } from './SafeLink';
11
+ interface Props extends SafeLinkProps, ButtonStyleProps {
17
12
  children: ReactNode;
18
13
  to: string;
19
14
  className?: string;
20
- buttonSize?: 'normal' | 'medium' | 'large';
21
- borderShape?: 'normal' | 'rounded' | 'sharpened';
22
- width?: 'auto' | 'full';
23
- textAlign?: 'center' | 'left' | 'right';
24
- darker?: boolean;
25
- greyLighter?: boolean;
26
- greyLightest?: boolean;
27
15
  }
28
- declare const SafeLinkButton: ({ outline, stripped, link, lighter, children, inverted, invertedOutline, to, buttonSize, borderShape, width, textAlign, darker, greyLighter, greyLightest, ...rest }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ declare const SafeLinkButton: React.ForwardRefExoticComponent<Pick<Props, "replace" | "type" | "id" | "media" | "state" | "color" | "fontWeight" | "translate" | "hidden" | "slot" | "style" | "title" | "dir" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "role" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "size" | "download" | "hrefLang" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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" | "to" | "rel" | "shape" | "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" | "ping" | "referrerPolicy" | "reloadDocument" | "showNewWindowIcon" | "asAnchor" | "inverted" | "colorTheme" | "variant"> & React.RefAttributes<HTMLAnchorElement>>;
29
17
  export default SafeLinkButton;
@@ -1,71 +1,47 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _react2 = require("@emotion/react");
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
  var _button = require("@ndla/button");
10
10
  var _SafeLink = _interopRequireDefault(require("./SafeLink"));
11
11
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
12
- var _excluded = ["outline", "stripped", "link", "lighter", "children", "inverted", "invertedOutline", "to", "buttonSize", "borderShape", "width", "textAlign", "darker", "greyLighter", "greyLightest"];
12
+ var _excluded = ["children", "inverted", "to", "size", "colorTheme", "variant", "shape", "fontWeight"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
+ 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); }
15
+ 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; }
14
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
18
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
19
  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; }
18
20
  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; }
19
- var getStyles = function getStyles(modifiers) {
20
- return Object.keys(modifiers).map(function (key) {
21
- return modifiers[key] ? _button.appearances[key] : undefined;
22
- }).filter(function (appearance) {
23
- return !!appearance;
24
- });
25
- };
26
- var SafeLinkButton = function SafeLinkButton(_ref) {
27
- var outline = _ref.outline,
28
- stripped = _ref.stripped,
29
- link = _ref.link,
30
- lighter = _ref.lighter,
31
- children = _ref.children,
21
+ var SafeLinkButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
22
+ var children = _ref.children,
32
23
  inverted = _ref.inverted,
33
- invertedOutline = _ref.invertedOutline,
34
24
  to = _ref.to,
35
- buttonSize = _ref.buttonSize,
36
- borderShape = _ref.borderShape,
37
- width = _ref.width,
38
- textAlign = _ref.textAlign,
39
- darker = _ref.darker,
40
- greyLighter = _ref.greyLighter,
41
- greyLightest = _ref.greyLightest,
25
+ size = _ref.size,
26
+ colorTheme = _ref.colorTheme,
27
+ variant = _ref.variant,
28
+ shape = _ref.shape,
29
+ fontWeight = _ref.fontWeight,
42
30
  rest = _objectWithoutProperties(_ref, _excluded);
43
- var modifierStyles = getStyles({
44
- link: link,
45
- outline: outline,
46
- lighter: lighter,
47
- stripped: stripped,
48
- inverted: inverted,
49
- invertedOutline: invertedOutline
50
- });
51
- var buttonStyleProps = {
52
- outline: outline,
53
- lighter: lighter,
54
- size: buttonSize,
55
- borderShape: borderShape,
56
- width: width,
57
- textAlign: textAlign,
58
- darker: darker,
59
- greyLighter: greyLighter,
60
- greyLightest: greyLightest
61
- };
62
- var styles = (0, _button.ButtonStyles)(buttonStyleProps);
63
31
  return (0, _jsxRuntime.jsx)(_SafeLink["default"], _objectSpread(_objectSpread({
64
32
  to: to,
65
- css: /*#__PURE__*/(0, _react2.css)(modifierStyles, " ", styles, ";;label:SafeLinkButton;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNhZmVMaW5rQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtRmMiLCJmaWxlIjoiU2FmZUxpbmtCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTktcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgUmVhY3QsIHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgYXBwZWFyYW5jZXMsIEJ1dHRvblN0eWxlcywgQnV0dG9uQXBwZWFyYW5jZSB9IGZyb20gJ0BuZGxhL2J1dHRvbic7XG5pbXBvcnQgU2FmZUxpbmsgZnJvbSAnLi9TYWZlTGluayc7XG5pbXBvcnQgeyBTYWZlTGlua1Byb3BzIH0gZnJvbSAnLic7XG5cbnR5cGUgU3R5bGVzUHJvcHMgPSBSZWNvcmQ8QnV0dG9uQXBwZWFyYW5jZSwgYm9vbGVhbiB8IHVuZGVmaW5lZD47XG5cbmNvbnN0IGdldFN0eWxlcyA9IChtb2RpZmllcnM6IFBhcnRpYWw8U3R5bGVzUHJvcHM+KS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JTaGFwZSxcbiAgd2lkdGgsXG4gIHRleHRBbGlnbixcbiAgZGFya2VyLFxuICBncmV5TGlnaHRlcixcbiAgZ3JleUxpZ2h0ZXN0LFxuICAuLi5yZXN0XG59OiBQcm9wcykgPT4ge1xuICBjb25zdCBtb2RpZmllclN0eWxlcyA9IGdldFN0eWxlcyh7XG4gICAgbGluayxcbiAgICBvdXRsaW5lLFxuICAgIGxpZ2h0ZXIsXG4gICAgc3RyaXBwZWQsXG4gICAgaW52ZXJ0ZWQsXG4gICAgaW52ZXJ0ZWRPdXRsaW5lLFxuICB9KTtcblxuICBjb25zdCBidXR0b25TdHlsZVByb3BzID0ge1xuICAgIG91dGxpbmUsXG4gICAgbGlnaHRlcixcbiAgICBzaXplOiBidXR0b25TaXplLFxuICAgIGJvcmRlclNoYXBlLFxuICAgIHdpZHRoLFxuICAgIHRleHRBbGlnbixcbiAgICBkYXJrZXIsXG4gICAgZ3JleUxpZ2h0ZXIsXG4gICAgZ3JleUxpZ2h0ZXN0LFxuICB9O1xuICBjb25zdCBzdHlsZXMgPSBCdXR0b25TdHlsZXMoYnV0dG9uU3R5bGVQcm9wcyk7XG5cbiAgcmV0dXJuIChcbiAgICA8U2FmZUxpbmtcbiAgICAgIHRvPXt0b31cbiAgICAgIGNzcz17Y3NzYFxuICAgICAgICAke21vZGlmaWVyU3R5bGVzfVxuICAgICAgICAke3N0eWxlc31cbiAgICAgIGB9XG4gICAgICB7Li4ucmVzdH0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9TYWZlTGluaz5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFNhZmVMaW5rQnV0dG9uO1xuIl19 */"))
33
+ ref: ref,
34
+ css: (0, _button.buttonStyleV2)({
35
+ colorTheme: colorTheme,
36
+ size: size,
37
+ variant: variant,
38
+ inverted: inverted,
39
+ shape: shape,
40
+ fontWeight: fontWeight
41
+ })
66
42
  }, rest), {}, {
67
43
  children: children
68
44
  }));
69
- };
45
+ });
70
46
  var _default = SafeLinkButton;
71
47
  exports["default"] = _default;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2022-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import React, { ReactNode } from 'react';
9
+ import { ButtonStyleProps } from '@ndla/button';
10
+ import { SafeLinkProps } from './SafeLink';
11
+ interface Props extends SafeLinkProps, ButtonStyleProps {
12
+ children: ReactNode;
13
+ to: string;
14
+ className?: string;
15
+ }
16
+ declare const SafeLinkIconButton: React.ForwardRefExoticComponent<Pick<Props, "replace" | "type" | "id" | "media" | "state" | "color" | "fontWeight" | "translate" | "hidden" | "slot" | "style" | "title" | "dir" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "role" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "size" | "download" | "hrefLang" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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" | "to" | "rel" | "shape" | "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" | "ping" | "referrerPolicy" | "reloadDocument" | "showNewWindowIcon" | "asAnchor" | "inverted" | "colorTheme" | "variant"> & React.RefAttributes<HTMLAnchorElement>>;
17
+ export default SafeLinkIconButton;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _button = require("@ndla/button");
10
+ var _SafeLink = _interopRequireDefault(require("./SafeLink"));
11
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
12
+ var _excluded = ["children", "inverted", "to", "size", "colorTheme", "variant", "fontWeight"];
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
+ 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); }
15
+ 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; }
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ 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; }
20
+ 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; }
21
+ var SafeLinkIconButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
22
+ var children = _ref.children,
23
+ inverted = _ref.inverted,
24
+ to = _ref.to,
25
+ size = _ref.size,
26
+ colorTheme = _ref.colorTheme,
27
+ variant = _ref.variant,
28
+ fontWeight = _ref.fontWeight,
29
+ rest = _objectWithoutProperties(_ref, _excluded);
30
+ return (0, _jsxRuntime.jsx)(_SafeLink["default"], _objectSpread(_objectSpread({
31
+ to: to,
32
+ ref: ref,
33
+ css: (0, _button.iconButtonStyle)({
34
+ colorTheme: colorTheme,
35
+ size: size,
36
+ variant: variant,
37
+ inverted: inverted,
38
+ fontWeight: fontWeight
39
+ })
40
+ }, rest), {}, {
41
+ children: children
42
+ }));
43
+ });
44
+ var _default = SafeLinkIconButton;
45
+ exports["default"] = _default;
package/lib/index.d.ts CHANGED
@@ -8,5 +8,6 @@
8
8
  import SafeLink from './SafeLink';
9
9
  export { default as MissingRouterContext } from './MissingRouterContext';
10
10
  export { default as SafeLinkButton } from './SafeLinkButton';
11
+ export { default as SafeLinkIconButton } from './SafeLinkIconButton';
11
12
  export type { SafeLinkProps } from './SafeLink';
12
13
  export default SafeLink;
package/lib/index.js CHANGED
@@ -15,10 +15,17 @@ Object.defineProperty(exports, "SafeLinkButton", {
15
15
  return _SafeLinkButton["default"];
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "SafeLinkIconButton", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _SafeLinkIconButton["default"];
22
+ }
23
+ });
18
24
  exports["default"] = void 0;
19
25
  var _SafeLink = _interopRequireDefault(require("./SafeLink"));
20
26
  var _MissingRouterContext = _interopRequireDefault(require("./MissingRouterContext"));
21
27
  var _SafeLinkButton = _interopRequireDefault(require("./SafeLinkButton"));
28
+ var _SafeLinkIconButton = _interopRequireDefault(require("./SafeLinkIconButton"));
22
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
30
  /**
24
31
  * Copyright (c) 2016-present, NDLA.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/safelink",
3
- "version": "3.1.7",
3
+ "version": "4.0.0",
4
4
  "description": "SafeLink component for NDLA",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -26,7 +26,7 @@
26
26
  "es"
27
27
  ],
28
28
  "dependencies": {
29
- "@ndla/button": "^7.0.3",
29
+ "@ndla/button": "^7.0.5",
30
30
  "@ndla/icons": "^2.1.1"
31
31
  },
32
32
  "peerDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "48dd90f1aea68b7f7107d331ea9ca9df4e51b3be"
42
+ "gitHead": "2cbff26d49ef6ed78bb1d789d6cca7b69461b269"
43
43
  }