@scm-manager/ui-buttons 2.43.0 → 2.43.1-20230318-085802

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.
package/build/index.d.ts CHANGED
@@ -32,11 +32,23 @@ declare const Button: React.ForwardRefExoticComponent<BaseButtonProps & React.Bu
32
32
  */
33
33
  declare const LinkButton: React.ForwardRefExoticComponent<BaseButtonProps & LinkProps<unknown> & React.RefAttributes<HTMLAnchorElement>>;
34
34
  /**
35
- * Styled html anchor
35
+ * Styled html anchor.
36
+ *
37
+ * External links open in a new browser tab with rel flags "noopener" and "noreferrer" set by default.
36
38
  *
37
39
  * @beta
38
40
  * @since 2.41.0
39
41
  */
40
42
  declare const ExternalLinkButton: React.ForwardRefExoticComponent<BaseButtonProps & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
41
43
 
42
- export { Button, ButtonVariants, ExternalLinkButton, LinkButton };
44
+ declare type Props = React.HTMLProps<HTMLElement> & {
45
+ children?: string;
46
+ };
47
+ /**
48
+ * @beta
49
+ * @since 2.44.0
50
+ * @see https://bulma.io/documentation/elements/icon/
51
+ */
52
+ declare const Icon: React.ForwardRefExoticComponent<Pick<Props, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "default" | "type" | "className" | "key" | "dateTime" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "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" | "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" | "list" | "as" | "name" | "alt" | "src" | "href" | "disabled" | "action" | "download" | "hrefLang" | "media" | "rel" | "target" | "value" | "size" | "open" | "step" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "method" | "min" | "width" | "crossOrigin" | "classID" | "useMap" | "wmode" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "acceptCharset" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "sizes" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "integrity" | "charSet" | "content" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "start" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "wrap" | "kind" | "srcLang" | "poster"> & React.RefAttributes<HTMLElement>>;
53
+
54
+ export { Button, ButtonVariants, ExternalLinkButton, Icon, LinkButton };
package/build/index.js CHANGED
@@ -29,6 +29,7 @@ __export(src_exports, {
29
29
  Button: () => Button,
30
30
  ButtonVariants: () => ButtonVariants,
31
31
  ExternalLinkButton: () => ExternalLinkButton,
32
+ Icon: () => Icon_default,
32
33
  LinkButton: () => LinkButton
33
34
  });
34
35
  module.exports = __toCommonJS(src_exports);
@@ -71,16 +72,37 @@ var LinkButton = import_react.default.forwardRef(
71
72
  );
72
73
  var ExternalLinkButton = import_react.default.forwardRef(
73
74
  ({ className, variant, isLoading, testId, children, ...props }, ref) => /* @__PURE__ */ import_react.default.createElement("a", {
75
+ target: "_blank",
76
+ rel: "noreferrer noopener",
74
77
  ...props,
75
78
  className: (0, import_classnames.default)(createButtonClasses(variant, isLoading), className),
76
79
  ref,
77
80
  ...(0, import_ui_components.createAttributesForTesting)(testId)
78
81
  }, children)
79
82
  );
83
+
84
+ // src/Icon.tsx
85
+ var import_react2 = __toESM(require("react"));
86
+ var import_classnames2 = __toESM(require("classnames"));
87
+ var Icon = import_react2.default.forwardRef(({ children, className, ...props }, ref) => {
88
+ return /* @__PURE__ */ import_react2.default.createElement("span", {
89
+ className: (0, import_classnames2.default)(className, "icon"),
90
+ ...props,
91
+ ref
92
+ }, /* @__PURE__ */ import_react2.default.createElement("i", {
93
+ className: (0, import_classnames2.default)(`fas fa-fw fa-${children}`, {
94
+ "fa-xs": className == null ? void 0 : className.includes("is-small"),
95
+ "fa-lg": className == null ? void 0 : className.includes("is-medium"),
96
+ "fa-2x": className == null ? void 0 : className.includes("is-large")
97
+ })
98
+ }));
99
+ });
100
+ var Icon_default = Icon;
80
101
  // Annotate the CommonJS export names for ESM import in node:
81
102
  0 && (module.exports = {
82
103
  Button,
83
104
  ButtonVariants,
84
105
  ExternalLinkButton,
106
+ Icon,
85
107
  LinkButton
86
108
  });
package/build/index.mjs CHANGED
@@ -36,15 +36,36 @@ var LinkButton = React.forwardRef(
36
36
  );
37
37
  var ExternalLinkButton = React.forwardRef(
38
38
  ({ className, variant, isLoading, testId, children, ...props }, ref) => /* @__PURE__ */ React.createElement("a", {
39
+ target: "_blank",
40
+ rel: "noreferrer noopener",
39
41
  ...props,
40
42
  className: classNames(createButtonClasses(variant, isLoading), className),
41
43
  ref,
42
44
  ...createAttributesForTesting(testId)
43
45
  }, children)
44
46
  );
47
+
48
+ // src/Icon.tsx
49
+ import React2 from "react";
50
+ import classNames2 from "classnames";
51
+ var Icon = React2.forwardRef(({ children, className, ...props }, ref) => {
52
+ return /* @__PURE__ */ React2.createElement("span", {
53
+ className: classNames2(className, "icon"),
54
+ ...props,
55
+ ref
56
+ }, /* @__PURE__ */ React2.createElement("i", {
57
+ className: classNames2(`fas fa-fw fa-${children}`, {
58
+ "fa-xs": className == null ? void 0 : className.includes("is-small"),
59
+ "fa-lg": className == null ? void 0 : className.includes("is-medium"),
60
+ "fa-2x": className == null ? void 0 : className.includes("is-large")
61
+ })
62
+ }));
63
+ });
64
+ var Icon_default = Icon;
45
65
  export {
46
66
  Button,
47
67
  ButtonVariants,
48
68
  ExternalLinkButton,
69
+ Icon_default as Icon,
49
70
  LinkButton
50
71
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-buttons",
3
- "version": "2.43.0",
3
+ "version": "2.43.1-20230318-085802",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.mjs",
@@ -24,11 +24,11 @@
24
24
  "react-dom": "^17.0.1",
25
25
  "react-router-dom": "^5.3.1",
26
26
  "classnames": "^2.2.6",
27
- "@scm-manager/ui-components": "2.43.0"
27
+ "@scm-manager/ui-components": "2.43.1-20230318-085802"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@scm-manager/prettier-config": "^2.11.1",
31
- "@scm-manager/ui-api": "2.43.0",
31
+ "@scm-manager/ui-api": "2.43.1-20230318-085802",
32
32
  "@scm-manager/eslint-config": "^2.17.0",
33
33
  "@babel/core": "^7.17.8",
34
34
  "@scm-manager/tsconfig": "^2.12.0",