x-star-design 0.0.2 → 0.0.4

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.
@@ -11,7 +11,7 @@ export type StatusTagStyle = {
11
11
  export interface StatusTagProps {
12
12
  shape: StatusTagShape;
13
13
  status: StatusTagType;
14
- children: React.ReactNode;
14
+ children?: React.ReactNode;
15
15
  required?: boolean;
16
16
  hover?: boolean;
17
17
  className?: string;
@@ -13,14 +13,14 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  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; }
15
15
  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; }
16
- import correctSVG from '@/assets/status-tag/correct.svg';
17
- import diamondSVG from '@/assets/status-tag/diamond.svg';
18
- import filledSVG from '@/assets/status-tag/filled.svg';
19
- import halfCorrectSVG from '@/assets/status-tag/half-correct.svg';
20
- import pendingSVG from '@/assets/status-tag/pending.svg';
21
- import wrongSVG from '@/assets/status-tag/wrong.svg';
22
16
  import classNames from 'classnames';
23
17
  import React, { useRef, useState } from 'react';
18
+ import correctSVG from "../assets/status-tag/correct.svg";
19
+ import diamondSVG from "../assets/status-tag/diamond.svg";
20
+ import filledSVG from "../assets/status-tag/filled.svg";
21
+ import halfCorrectSVG from "../assets/status-tag/half-correct.svg";
22
+ import pendingSVG from "../assets/status-tag/pending.svg";
23
+ import wrongSVG from "../assets/status-tag/wrong.svg";
24
24
  import { prefix } from "../utils/global";
25
25
  var StatusTag = function StatusTag(_ref) {
26
26
  var _statusCSSMap$get, _statusCSSMap$get2, _statusCSSMap$get3, _classNames;
@@ -101,7 +101,7 @@ var StatusTag = function StatusTag(_ref) {
101
101
  }, props.style),
102
102
  onMouseEnter: handleMouseEnter,
103
103
  onMouseLeave: handleMouseLeave
104
- }, hover ? (_statusCSSMap$get = statusCSSMap.get(status)) !== null && _statusCSSMap$get !== void 0 && _statusCSSMap$get.icon && !showContent ? (_statusCSSMap$get2 = statusCSSMap.get(status)) === null || _statusCSSMap$get2 === void 0 ? void 0 : _statusCSSMap$get2.icon : children : (_statusCSSMap$get3 = statusCSSMap.get(status)) === null || _statusCSSMap$get3 === void 0 ? void 0 : _statusCSSMap$get3.icon, required && /*#__PURE__*/React.createElement("img", {
104
+ }, statusCSSMap !== null && statusCSSMap !== void 0 && (_statusCSSMap$get = statusCSSMap.get(status)) !== null && _statusCSSMap$get !== void 0 && _statusCSSMap$get.icon ? hover ? showContent ? children : statusCSSMap === null || statusCSSMap === void 0 ? void 0 : (_statusCSSMap$get2 = statusCSSMap.get(status)) === null || _statusCSSMap$get2 === void 0 ? void 0 : _statusCSSMap$get2.icon : statusCSSMap === null || statusCSSMap === void 0 ? void 0 : (_statusCSSMap$get3 = statusCSSMap.get(status)) === null || _statusCSSMap$get3 === void 0 ? void 0 : _statusCSSMap$get3.icon : children, required && /*#__PURE__*/React.createElement("img", {
105
105
  src: diamondSVG,
106
106
  className: classNames("".concat(prefix, "required"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "circleRequired"), shape === 'circle'), _defineProperty(_classNames, "".concat(prefix, "rectRequired"), shape !== 'circle'), _classNames))
107
107
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-star-design",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "A react component library developed by turingstar",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",