x-star-design 0.0.23 → 0.0.24

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,3 +1,5 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import { useCookieState } from 'ahooks';
1
3
  import React, { useContext, useRef } from 'react';
2
4
  import en_US from "./en_US";
3
5
  import zh_CN from "./zh_CN";
@@ -12,7 +14,10 @@ export var LocaleProvider = function LocaleProvider(_ref) {
12
14
  };
13
15
  export var useLocale = function useLocale(slice) {
14
16
  var _zh_CN$en_US$locale;
15
- var locale = useContext(LocaleContext);
17
+ var _useCookieState = useCookieState('lang'),
18
+ _useCookieState2 = _slicedToArray(_useCookieState, 1),
19
+ cookieLang = _useCookieState2[0];
20
+ var locale = useContext(LocaleContext) || (cookieLang === 'zh' ? 'zh_CN' : 'en_US');
16
21
  var message = ((_zh_CN$en_US$locale = {
17
22
  zh_CN: zh_CN,
18
23
  en_US: en_US
@@ -3,6 +3,7 @@ type TitleWithIconProps = {
3
3
  title: string;
4
4
  className?: string;
5
5
  description?: string;
6
+ id?: string;
6
7
  };
7
- declare const TitleWithIcon: ({ className, title, description, }: TitleWithIconProps) => React.JSX.Element;
8
+ declare const TitleWithIcon: ({ className, title, description, id, }: TitleWithIconProps) => React.JSX.Element;
8
9
  export default TitleWithIcon;
@@ -5,9 +5,11 @@ import { prefix } from "../utils/global";
5
5
  var TitleWithIcon = function TitleWithIcon(_ref) {
6
6
  var className = _ref.className,
7
7
  title = _ref.title,
8
- description = _ref.description;
8
+ description = _ref.description,
9
+ id = _ref.id;
9
10
  return /*#__PURE__*/React.createElement("div", {
10
- className: classNames(className, "".concat(prefix, "titleSection"))
11
+ className: classNames(className, "".concat(prefix, "titleSection")),
12
+ id: id
11
13
  }, /*#__PURE__*/React.createElement("img", {
12
14
  src: rightSvg,
13
15
  alt: ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-star-design",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "A react component library developed by turingstar",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",