@bifrostui/react 1.2.9-beta.0 → 1.3.1-beta.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.
Files changed (307) hide show
  1. package/dist/ActionSheet/ActionSheet.css +6 -3
  2. package/dist/ActionSheet/ActionSheetItem.css +10 -6
  3. package/dist/Alert/index.css +14 -8
  4. package/dist/Avatar/Avatar.css +13 -9
  5. package/dist/Avatar/AvatarGroup.css +15 -8
  6. package/dist/Backdrop/Backdrop.css +2 -1
  7. package/dist/Badge/Badge.css +27 -17
  8. package/dist/Breadcrumb/Breadcrumb.css +34 -0
  9. package/dist/Breadcrumb/Breadcrumb.d.ts +5 -0
  10. package/dist/Breadcrumb/Breadcrumb.js +128 -0
  11. package/dist/Breadcrumb/Breadcrumb.types.d.ts +49 -0
  12. package/dist/Breadcrumb/Breadcrumb.types.js +15 -0
  13. package/dist/Breadcrumb/BreadcrumbItem.d.ts +4 -0
  14. package/dist/Breadcrumb/BreadcrumbItem.js +78 -0
  15. package/dist/Breadcrumb/index.d.ts +4 -0
  16. package/dist/Breadcrumb/index.js +45 -0
  17. package/dist/Button/Button.css +26 -17
  18. package/dist/Calendar/Calendar.css +33 -18
  19. package/dist/Calendar/Calendar.d.ts +1 -1
  20. package/dist/Calendar/Calendar.js +85 -18
  21. package/dist/Calendar/Calendar.types.d.ts +33 -0
  22. package/dist/Card/CardFooter.css +2 -1
  23. package/dist/Card/CardHeader.css +3 -1
  24. package/dist/Checkbox/Checkbox.css +7 -5
  25. package/dist/CitySelector/CitySelector.css +29 -15
  26. package/dist/CitySelector/CitySelectorCore.js +25 -16
  27. package/dist/CitySelector/Selector/index.css +4 -4
  28. package/dist/Collapse/Collapse.css +6 -0
  29. package/dist/Collapse/Collapse.d.ts +5 -0
  30. package/dist/Collapse/Collapse.js +165 -0
  31. package/dist/Collapse/Collapse.types.d.ts +16 -0
  32. package/dist/Collapse/Collapse.types.js +15 -0
  33. package/dist/Collapse/index.d.ts +2 -0
  34. package/dist/Collapse/index.js +41 -0
  35. package/dist/CollapsePanel/CollapsePanel.css +32 -0
  36. package/dist/CollapsePanel/CollapsePanel.d.ts +5 -0
  37. package/dist/CollapsePanel/CollapsePanel.js +159 -0
  38. package/dist/CollapsePanel/CollapsePanel.types.d.ts +64 -0
  39. package/dist/CollapsePanel/CollapsePanel.types.js +15 -0
  40. package/dist/CollapsePanel/CollapsePanelItem.d.ts +4 -0
  41. package/dist/CollapsePanel/CollapsePanelItem.js +112 -0
  42. package/dist/CollapsePanel/index.d.ts +4 -0
  43. package/dist/CollapsePanel/index.js +45 -0
  44. package/dist/Countdown/Countdown.css +2 -1
  45. package/dist/Countdown/Countdown.js +3 -0
  46. package/dist/Dialog/Dialog.d.ts +5 -0
  47. package/dist/Dialog/Dialog.js +152 -0
  48. package/dist/Dialog/Dialog.types.d.ts +109 -0
  49. package/dist/Dialog/Dialog.types.js +15 -0
  50. package/dist/Dialog/FunctionalDialog.d.ts +3 -0
  51. package/dist/Dialog/FunctionalDialog.js +204 -0
  52. package/dist/Dialog/index.css +75 -0
  53. package/dist/Dialog/index.d.ts +2 -0
  54. package/dist/Dialog/index.js +41 -0
  55. package/dist/Divider/Divider.css +6 -4
  56. package/dist/IconButton/IconButton.css +9 -7
  57. package/dist/Image/index.css +2 -1
  58. package/dist/Input/Input.css +10 -5
  59. package/dist/List/List.css +3 -0
  60. package/dist/List/ListItem.css +3 -3
  61. package/dist/List/ListItemContent.css +1 -1
  62. package/dist/Loading/Loading.css +4 -2
  63. package/dist/Modal/Modal.miniapp.d.ts +1 -1
  64. package/dist/NavBar/NavBar.css +9 -5
  65. package/dist/Picker/Picker.css +25 -29
  66. package/dist/Picker/Picker.js +31 -11
  67. package/dist/Picker/Picker.types.d.ts +4 -0
  68. package/dist/Picker/PickerPanel.css +8 -8
  69. package/dist/Picker/PickerPanel.js +14 -8
  70. package/dist/Picker/utils.d.ts +16 -0
  71. package/dist/Picker/utils.js +32 -2
  72. package/dist/Popover/Popover.css +97 -0
  73. package/dist/Popover/Popover.d.ts +5 -0
  74. package/dist/Popover/Popover.js +186 -0
  75. package/dist/Popover/Popover.types.d.ts +60 -0
  76. package/dist/Popover/Popover.types.js +15 -0
  77. package/dist/Popover/index.d.ts +2 -0
  78. package/dist/Popover/index.js +41 -0
  79. package/dist/Portal/Portal.types.d.ts +4 -0
  80. package/dist/Portal/PortalCore.js +8 -1
  81. package/dist/Progress/Progress.css +8 -6
  82. package/dist/Radio/Radio.css +2 -1
  83. package/dist/Radio/Radio.js +1 -1
  84. package/dist/Radio/RadioButtonIcon.d.ts +1 -6
  85. package/dist/Radio/RadioButtonIcon.js +0 -3
  86. package/dist/Rating/Rating.css +8 -4
  87. package/dist/Select/Select.css +21 -10
  88. package/dist/Select/Select.js +1 -1
  89. package/dist/Select/SelectOption.js +3 -0
  90. package/dist/Skeleton/Skeleton.css +3 -2
  91. package/dist/Slider/Slider.css +24 -13
  92. package/dist/Steps/Step.css +11 -11
  93. package/dist/Steps/Steps.css +14 -5
  94. package/dist/Swiper/Swiper.css +2 -1
  95. package/dist/Switch/Switch.css +31 -16
  96. package/dist/TabBar/TabBar.css +7 -3
  97. package/dist/TabBar/TabBarItem.css +0 -1
  98. package/dist/Tabs/Tab.css +2 -6
  99. package/dist/Tabs/Tabs.css +7 -4
  100. package/dist/Tag/Tag.css +7 -10
  101. package/dist/Tag/TagGroup.css +9 -1
  102. package/dist/TextArea/TextArea.css +14 -8
  103. package/dist/ThemeProvider/ThemeProvider.d.ts +4 -0
  104. package/dist/ThemeProvider/ThemeProvider.js +90 -0
  105. package/dist/ThemeProvider/ThemeProvider.types.d.ts +127 -0
  106. package/dist/ThemeProvider/ThemeProvider.types.js +27 -0
  107. package/dist/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
  108. package/dist/ThemeProvider/hooks/ThemeContext.js +35 -0
  109. package/dist/ThemeProvider/hooks/createTheme.d.ts +2 -0
  110. package/dist/ThemeProvider/hooks/createTheme.js +55 -0
  111. package/dist/ThemeProvider/hooks/index.d.ts +4 -0
  112. package/dist/ThemeProvider/hooks/index.js +43 -0
  113. package/dist/ThemeProvider/hooks/useTheme.d.ts +1 -0
  114. package/dist/ThemeProvider/hooks/useTheme.js +39 -0
  115. package/dist/ThemeProvider/index.d.ts +4 -0
  116. package/dist/ThemeProvider/index.js +45 -0
  117. package/dist/ThemeProvider/utils/constants.d.ts +38 -0
  118. package/dist/ThemeProvider/utils/constants.js +65 -0
  119. package/dist/ThemeProvider/utils/index.d.ts +2 -0
  120. package/dist/ThemeProvider/utils/index.js +23 -0
  121. package/dist/ThemeProvider/utils/mountTokens.d.ts +26 -0
  122. package/dist/ThemeProvider/utils/mountTokens.js +123 -0
  123. package/dist/Toast/FunctionalToast.d.ts +3 -0
  124. package/dist/Toast/FunctionalToast.js +177 -0
  125. package/dist/Toast/Toast.css +56 -0
  126. package/dist/Toast/Toast.d.ts +5 -0
  127. package/dist/Toast/Toast.js +121 -0
  128. package/dist/Toast/Toast.types.d.ts +101 -0
  129. package/dist/Toast/Toast.types.js +15 -0
  130. package/dist/Toast/index.d.ts +2 -0
  131. package/dist/Toast/index.js +41 -0
  132. package/dist/Tooltip/Tooltip.css +91 -0
  133. package/dist/Tooltip/Tooltip.d.ts +5 -0
  134. package/dist/Tooltip/Tooltip.js +177 -0
  135. package/dist/Tooltip/Tooltip.types.d.ts +51 -0
  136. package/dist/Tooltip/Tooltip.types.js +15 -0
  137. package/dist/Tooltip/index.d.ts +2 -0
  138. package/dist/Tooltip/index.js +41 -0
  139. package/dist/Transition/Transition.miniapp.js +7 -1
  140. package/dist/index.d.ts +9 -0
  141. package/dist/index.js +19 -1
  142. package/dist/locales/base.d.ts +40 -0
  143. package/dist/locales/base.js +15 -0
  144. package/dist/locales/en-US.d.ts +3 -0
  145. package/dist/locales/en-US.js +69 -0
  146. package/dist/locales/hooks/useLocaleText.d.ts +3 -0
  147. package/dist/locales/hooks/useLocaleText.js +43 -0
  148. package/dist/locales/index.d.ts +5 -0
  149. package/dist/locales/index.js +49 -0
  150. package/dist/locales/zh-CN.d.ts +3 -0
  151. package/dist/locales/zh-CN.js +51 -0
  152. package/dist/locales/zh-TW.d.ts +3 -0
  153. package/dist/locales/zh-TW.js +51 -0
  154. package/es/ActionSheet/ActionSheet.css +6 -3
  155. package/es/ActionSheet/ActionSheetItem.css +10 -6
  156. package/es/Alert/index.css +14 -8
  157. package/es/Avatar/Avatar.css +13 -9
  158. package/es/Avatar/AvatarGroup.css +15 -8
  159. package/es/Backdrop/Backdrop.css +2 -1
  160. package/es/Badge/Badge.css +27 -17
  161. package/es/Breadcrumb/Breadcrumb.css +34 -0
  162. package/es/Breadcrumb/Breadcrumb.d.ts +5 -0
  163. package/es/Breadcrumb/Breadcrumb.js +101 -0
  164. package/es/Breadcrumb/Breadcrumb.types.d.ts +49 -0
  165. package/es/Breadcrumb/Breadcrumb.types.js +1 -0
  166. package/es/Breadcrumb/BreadcrumbItem.d.ts +4 -0
  167. package/es/Breadcrumb/BreadcrumbItem.js +51 -0
  168. package/es/Breadcrumb/index.d.ts +4 -0
  169. package/es/Breadcrumb/index.js +9 -0
  170. package/es/Button/Button.css +26 -17
  171. package/es/Calendar/Calendar.css +33 -18
  172. package/es/Calendar/Calendar.d.ts +1 -1
  173. package/es/Calendar/Calendar.js +91 -19
  174. package/es/Calendar/Calendar.types.d.ts +33 -0
  175. package/es/Card/CardFooter.css +2 -1
  176. package/es/Card/CardHeader.css +3 -1
  177. package/es/Checkbox/Checkbox.css +7 -5
  178. package/es/CitySelector/CitySelector.css +29 -15
  179. package/es/CitySelector/CitySelectorCore.js +25 -16
  180. package/es/CitySelector/Selector/index.css +4 -4
  181. package/es/Collapse/Collapse.css +6 -0
  182. package/es/Collapse/Collapse.d.ts +5 -0
  183. package/es/Collapse/Collapse.js +144 -0
  184. package/es/Collapse/Collapse.types.d.ts +16 -0
  185. package/es/Collapse/Collapse.types.js +1 -0
  186. package/es/Collapse/index.d.ts +2 -0
  187. package/es/Collapse/index.js +6 -0
  188. package/es/CollapsePanel/CollapsePanel.css +32 -0
  189. package/es/CollapsePanel/CollapsePanel.d.ts +5 -0
  190. package/es/CollapsePanel/CollapsePanel.js +132 -0
  191. package/es/CollapsePanel/CollapsePanel.types.d.ts +64 -0
  192. package/es/CollapsePanel/CollapsePanel.types.js +1 -0
  193. package/es/CollapsePanel/CollapsePanelItem.d.ts +4 -0
  194. package/es/CollapsePanel/CollapsePanelItem.js +85 -0
  195. package/es/CollapsePanel/index.d.ts +4 -0
  196. package/es/CollapsePanel/index.js +9 -0
  197. package/es/Countdown/Countdown.css +2 -1
  198. package/es/Countdown/Countdown.js +3 -0
  199. package/es/Dialog/Dialog.d.ts +5 -0
  200. package/es/Dialog/Dialog.js +125 -0
  201. package/es/Dialog/Dialog.types.d.ts +109 -0
  202. package/es/Dialog/Dialog.types.js +1 -0
  203. package/es/Dialog/FunctionalDialog.d.ts +3 -0
  204. package/es/Dialog/FunctionalDialog.js +177 -0
  205. package/es/Dialog/index.css +75 -0
  206. package/es/Dialog/index.d.ts +2 -0
  207. package/es/Dialog/index.js +6 -0
  208. package/es/Divider/Divider.css +6 -4
  209. package/es/IconButton/IconButton.css +9 -7
  210. package/es/Image/index.css +2 -1
  211. package/es/Input/Input.css +10 -5
  212. package/es/List/List.css +3 -0
  213. package/es/List/ListItem.css +3 -3
  214. package/es/List/ListItemContent.css +1 -1
  215. package/es/Loading/Loading.css +4 -2
  216. package/es/Modal/Modal.miniapp.d.ts +1 -1
  217. package/es/NavBar/NavBar.css +9 -5
  218. package/es/Picker/Picker.css +25 -29
  219. package/es/Picker/Picker.js +32 -12
  220. package/es/Picker/Picker.types.d.ts +4 -0
  221. package/es/Picker/PickerPanel.css +8 -8
  222. package/es/Picker/PickerPanel.js +14 -8
  223. package/es/Picker/utils.d.ts +16 -0
  224. package/es/Picker/utils.js +29 -1
  225. package/es/Popover/Popover.css +97 -0
  226. package/es/Popover/Popover.d.ts +5 -0
  227. package/es/Popover/Popover.js +159 -0
  228. package/es/Popover/Popover.types.d.ts +60 -0
  229. package/es/Popover/Popover.types.js +1 -0
  230. package/es/Popover/index.d.ts +2 -0
  231. package/es/Popover/index.js +6 -0
  232. package/es/Portal/Portal.types.d.ts +4 -0
  233. package/es/Portal/PortalCore.js +8 -1
  234. package/es/Progress/Progress.css +8 -6
  235. package/es/Radio/Radio.css +2 -1
  236. package/es/Radio/Radio.js +1 -1
  237. package/es/Radio/RadioButtonIcon.d.ts +1 -6
  238. package/es/Radio/RadioButtonIcon.js +0 -3
  239. package/es/Rating/Rating.css +8 -4
  240. package/es/Select/Select.css +21 -10
  241. package/es/Select/Select.js +1 -1
  242. package/es/Select/SelectOption.js +3 -0
  243. package/es/Skeleton/Skeleton.css +3 -2
  244. package/es/Slider/Slider.css +24 -13
  245. package/es/Steps/Step.css +11 -11
  246. package/es/Steps/Steps.css +14 -5
  247. package/es/Swiper/Swiper.css +2 -1
  248. package/es/Switch/Switch.css +31 -16
  249. package/es/TabBar/TabBar.css +7 -3
  250. package/es/TabBar/TabBarItem.css +0 -1
  251. package/es/Tabs/Tab.css +2 -6
  252. package/es/Tabs/Tabs.css +7 -4
  253. package/es/Tag/Tag.css +7 -10
  254. package/es/Tag/TagGroup.css +9 -1
  255. package/es/TextArea/TextArea.css +14 -8
  256. package/es/ThemeProvider/ThemeProvider.d.ts +4 -0
  257. package/es/ThemeProvider/ThemeProvider.js +61 -0
  258. package/es/ThemeProvider/ThemeProvider.types.d.ts +127 -0
  259. package/es/ThemeProvider/ThemeProvider.types.js +1 -0
  260. package/es/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
  261. package/es/ThemeProvider/hooks/ThemeContext.js +6 -0
  262. package/es/ThemeProvider/hooks/createTheme.d.ts +2 -0
  263. package/es/ThemeProvider/hooks/createTheme.js +38 -0
  264. package/es/ThemeProvider/hooks/index.d.ts +4 -0
  265. package/es/ThemeProvider/hooks/index.js +8 -0
  266. package/es/ThemeProvider/hooks/useTheme.d.ts +1 -0
  267. package/es/ThemeProvider/hooks/useTheme.js +10 -0
  268. package/es/ThemeProvider/index.d.ts +4 -0
  269. package/es/ThemeProvider/index.js +8 -0
  270. package/es/ThemeProvider/utils/constants.d.ts +38 -0
  271. package/es/ThemeProvider/utils/constants.js +40 -0
  272. package/es/ThemeProvider/utils/index.d.ts +2 -0
  273. package/es/ThemeProvider/utils/index.js +2 -0
  274. package/es/ThemeProvider/utils/mountTokens.d.ts +26 -0
  275. package/es/ThemeProvider/utils/mountTokens.js +88 -0
  276. package/es/Toast/FunctionalToast.d.ts +3 -0
  277. package/es/Toast/FunctionalToast.js +150 -0
  278. package/es/Toast/Toast.css +56 -0
  279. package/es/Toast/Toast.d.ts +5 -0
  280. package/es/Toast/Toast.js +99 -0
  281. package/es/Toast/Toast.types.d.ts +101 -0
  282. package/es/Toast/Toast.types.js +1 -0
  283. package/es/Toast/index.d.ts +2 -0
  284. package/es/Toast/index.js +6 -0
  285. package/es/Tooltip/Tooltip.css +91 -0
  286. package/es/Tooltip/Tooltip.d.ts +5 -0
  287. package/es/Tooltip/Tooltip.js +150 -0
  288. package/es/Tooltip/Tooltip.types.d.ts +51 -0
  289. package/es/Tooltip/Tooltip.types.js +1 -0
  290. package/es/Tooltip/index.d.ts +2 -0
  291. package/es/Tooltip/index.js +6 -0
  292. package/es/Transition/Transition.miniapp.js +7 -1
  293. package/es/index.d.ts +9 -0
  294. package/es/index.js +9 -0
  295. package/es/locales/base.d.ts +40 -0
  296. package/es/locales/base.js +0 -0
  297. package/es/locales/en-US.d.ts +3 -0
  298. package/es/locales/en-US.js +50 -0
  299. package/es/locales/hooks/useLocaleText.d.ts +3 -0
  300. package/es/locales/hooks/useLocaleText.js +26 -0
  301. package/es/locales/index.d.ts +5 -0
  302. package/es/locales/index.js +11 -0
  303. package/es/locales/zh-CN.d.ts +3 -0
  304. package/es/locales/zh-CN.js +32 -0
  305. package/es/locales/zh-TW.d.ts +3 -0
  306. package/es/locales/zh-TW.js +32 -0
  307. package/package.json +5 -5
@@ -0,0 +1,150 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import clsx from "clsx";
33
+ import React, { useState, useRef, useId } from "react";
34
+ import { getStylesAndLocation, triggerEventTransform } from "@bifrostui/utils";
35
+ import Portal from "../Portal";
36
+ import "./Tooltip.css";
37
+ const prefixCls = "bui-tooltip";
38
+ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
39
+ const _a = props, {
40
+ className,
41
+ style,
42
+ children,
43
+ title,
44
+ defaultOpen,
45
+ placement = "top",
46
+ trigger,
47
+ onOpenChange,
48
+ open,
49
+ PortalProps
50
+ } = _a, others = __objRest(_a, [
51
+ "className",
52
+ "style",
53
+ "children",
54
+ "title",
55
+ "defaultOpen",
56
+ "placement",
57
+ "trigger",
58
+ "onOpenChange",
59
+ "open",
60
+ "PortalProps"
61
+ ]);
62
+ const positionArr = placement.split(/([A-Z])/);
63
+ const direction = positionArr[0];
64
+ let location;
65
+ if (positionArr.length > 1) {
66
+ positionArr.splice(0, 1);
67
+ location = positionArr.join("").toLowerCase();
68
+ } else {
69
+ location = "center";
70
+ }
71
+ const childrenRef = useRef();
72
+ const [openStatus, setOpenStatus] = useState(defaultOpen);
73
+ const [arrowDirection, setArrowDirection] = useState(direction);
74
+ const [arrowLocation, setArrowLocation] = useState(location);
75
+ const [tooltyles, setTooltyles] = useState({});
76
+ const ttId = useId();
77
+ const onRootElementMouted = () => {
78
+ const result = getStylesAndLocation({
79
+ childrenRef,
80
+ arrowDirection,
81
+ arrowLocation,
82
+ selector: `[data-id="tt_${ttId}"]`
83
+ });
84
+ if (!result)
85
+ return;
86
+ const { styles, newArrowDirection, newArrowLocation } = result;
87
+ if (newArrowDirection !== arrowDirection) {
88
+ setArrowDirection(newArrowDirection);
89
+ }
90
+ if (newArrowLocation !== arrowLocation) {
91
+ setArrowLocation(newArrowLocation);
92
+ }
93
+ setTooltyles(styles);
94
+ };
95
+ const changeOpenStatus = (event, status) => {
96
+ if (open)
97
+ return;
98
+ setOpenStatus(status);
99
+ onOpenChange == null ? void 0 : onOpenChange(event, { open: status });
100
+ };
101
+ const triggerClick = (event) => {
102
+ const targetStatus = !openStatus;
103
+ changeOpenStatus(event, targetStatus);
104
+ };
105
+ const hideTooltip = (event) => {
106
+ changeOpenStatus(event, false);
107
+ };
108
+ const showTooltip = (event) => {
109
+ changeOpenStatus(event, true);
110
+ };
111
+ const triggerEventOption = triggerEventTransform({
112
+ trigger,
113
+ click: triggerClick,
114
+ show: showTooltip,
115
+ hide: hideTooltip
116
+ });
117
+ const childrenOptions = __spreadValues({
118
+ ref: childrenRef
119
+ }, triggerEventOption);
120
+ if (!children || !title)
121
+ return null;
122
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (open || openStatus) && title ? /* @__PURE__ */ React.createElement(
123
+ Portal,
124
+ __spreadProps(__spreadValues({
125
+ onRootElementMouted
126
+ }, PortalProps), {
127
+ ref
128
+ }),
129
+ /* @__PURE__ */ React.createElement(
130
+ "div",
131
+ __spreadValues({
132
+ className: clsx(prefixCls, className, `tooltip-${arrowDirection}`),
133
+ style: __spreadValues(__spreadValues({}, style), tooltyles),
134
+ "data-id": `tt_${ttId}`
135
+ }, others),
136
+ /* @__PURE__ */ React.createElement(
137
+ "div",
138
+ {
139
+ className: clsx("bui-tooltip-arrow", `location-${arrowLocation}`)
140
+ }
141
+ ),
142
+ /* @__PURE__ */ React.createElement("div", { className: "bui-tooltip-content" }, title)
143
+ )
144
+ ) : null, React.cloneElement(children, childrenOptions));
145
+ });
146
+ Tooltip.displayName = "BuiTooltip";
147
+ var Tooltip_default = Tooltip;
148
+ export {
149
+ Tooltip_default as default
150
+ };
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { OverrideProps } from '@bifrostui/types';
3
+ import { PortalCoreProps } from '../Portal/Portal.types';
4
+ type triggerType = 'click' | 'hover';
5
+ export type TooltipProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
6
+ props: P & {
7
+ children: React.ReactElement;
8
+ /**
9
+ * 气泡浮层显示内容
10
+ */
11
+ title?: string;
12
+ /**
13
+ * 默认是否显隐
14
+ * @default false
15
+ */
16
+ defaultOpen?: boolean;
17
+ /**
18
+ * 用于手动控制气泡浮层显隐
19
+ * @default false
20
+ */
21
+ open?: boolean;
22
+ /**
23
+ * 气泡框位置
24
+ * @default 'top'
25
+ */
26
+ placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
27
+ /**
28
+ * 触发行为
29
+ * - click: 点击触发
30
+ * - hover: hover触发
31
+ * - 或者是他们的数组
32
+ * @default 'click'
33
+ */
34
+ trigger?: triggerType | triggerType[];
35
+ /**
36
+ * Portal组件的属性
37
+ */
38
+ PortalProps?: PortalCoreProps;
39
+ /**
40
+ * 点击事件回调方法
41
+ * - event 触发事件
42
+ * - data.open 浮层显隐状态
43
+ * @returns
44
+ */
45
+ onOpenChange?: (event: React.SyntheticEvent, data: {
46
+ open: boolean;
47
+ }) => void;
48
+ };
49
+ defaultComponent: D;
50
+ }, D>;
51
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as Tooltip, default } from './Tooltip';
2
+ export * from './Tooltip.types';
@@ -0,0 +1,6 @@
1
+ import { default as default2, default as default3 } from "./Tooltip";
2
+ export * from "./Tooltip.types";
3
+ export {
4
+ default2 as Tooltip,
5
+ default3 as default
6
+ };
@@ -22,7 +22,13 @@ import React from "react";
22
22
  import TransitionCore from "./TransitionCore";
23
23
  const Transition = /* @__PURE__ */ React.forwardRef(
24
24
  (props, ref) => {
25
- return /* @__PURE__ */ React.createElement(TransitionCore, __spreadProps(__spreadValues({}, props), { nextTick: Taro.nextTick, ref }));
25
+ return /* @__PURE__ */ React.createElement(
26
+ TransitionCore,
27
+ __spreadProps(__spreadValues({}, props), {
28
+ nextTick: (cb) => setTimeout(() => Taro.nextTick(cb), 16),
29
+ ref
30
+ })
31
+ );
26
32
  }
27
33
  );
28
34
  Transition.displayName = "BuiTransition";
package/es/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './Button';
7
7
  export * from './Calendar';
8
8
  export * from './Card';
9
9
  export * from './Checkbox';
10
+ export * from './Collapse';
10
11
  export * from './Divider';
11
12
  export * from './Drawer';
12
13
  export * from './Fade';
@@ -15,6 +16,7 @@ export * from './Image';
15
16
  export * from './Input';
16
17
  export * from './List';
17
18
  export * from './Modal';
19
+ export * from './Popover';
18
20
  export * from './Portal';
19
21
  export * from './Progress';
20
22
  export * from './Radio';
@@ -32,9 +34,16 @@ export * from './Tabs';
32
34
  export * from './Tag';
33
35
  export * from './TextArea';
34
36
  export * from './Transition';
37
+ export * from './Tooltip';
35
38
  export * from './NavBar';
36
39
  export * from './Loading';
37
40
  export * from './TabBar';
38
41
  export * from './Countdown';
39
42
  export * from './CitySelector';
40
43
  export * from './Picker';
44
+ export * from './CollapsePanel';
45
+ export * from './Breadcrumb';
46
+ export * from './Toast';
47
+ export * from './Dialog';
48
+ export * from './ThemeProvider';
49
+ export * from './locales';
package/es/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./Button";
7
7
  export * from "./Calendar";
8
8
  export * from "./Card";
9
9
  export * from "./Checkbox";
10
+ export * from "./Collapse";
10
11
  export * from "./Divider";
11
12
  export * from "./Drawer";
12
13
  export * from "./Fade";
@@ -15,6 +16,7 @@ export * from "./Image";
15
16
  export * from "./Input";
16
17
  export * from "./List";
17
18
  export * from "./Modal";
19
+ export * from "./Popover";
18
20
  export * from "./Portal";
19
21
  export * from "./Progress";
20
22
  export * from "./Radio";
@@ -32,9 +34,16 @@ export * from "./Tabs";
32
34
  export * from "./Tag";
33
35
  export * from "./TextArea";
34
36
  export * from "./Transition";
37
+ export * from "./Tooltip";
35
38
  export * from "./NavBar";
36
39
  export * from "./Loading";
37
40
  export * from "./TabBar";
38
41
  export * from "./Countdown";
39
42
  export * from "./CitySelector";
40
43
  export * from "./Picker";
44
+ export * from "./CollapsePanel";
45
+ export * from "./Breadcrumb";
46
+ export * from "./Toast";
47
+ export * from "./Dialog";
48
+ export * from "./ThemeProvider";
49
+ export * from "./locales";
@@ -0,0 +1,40 @@
1
+ export interface BaseLang {
2
+ dialog?: {
3
+ cancel?: string;
4
+ confirm?: string;
5
+ placeholder?: string;
6
+ };
7
+ picker?: {
8
+ cancel?: string;
9
+ confirm?: string;
10
+ };
11
+ calendar?: {
12
+ Monday?: string;
13
+ Tuesday?: string;
14
+ Wednesday?: string;
15
+ Thursday?: string;
16
+ Friday?: string;
17
+ Saturday?: string;
18
+ Sunday?: string;
19
+ };
20
+ input?: {
21
+ placeholder?: string;
22
+ };
23
+ textarea?: {
24
+ placeholder?: string;
25
+ };
26
+ selector?: {
27
+ select?: string;
28
+ };
29
+ citySelector?: {
30
+ selectedCityGroupName?: string;
31
+ currentCityGroupName?: string;
32
+ hotCitiesGroupName?: string;
33
+ located?: string;
34
+ current?: string;
35
+ hot?: string;
36
+ gpsType?: Record<string, string>;
37
+ currentType?: Record<string, string>;
38
+ hotCityType?: Record<string, string>;
39
+ };
40
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ import { BaseLang } from './base';
2
+ declare const enUS: BaseLang;
3
+ export default enUS;
@@ -0,0 +1,50 @@
1
+ const enUS = {
2
+ dialog: {
3
+ cancel: "Cancel",
4
+ confirm: "Confirm",
5
+ placeholder: "Placeholder"
6
+ },
7
+ picker: {
8
+ cancel: "Cancel",
9
+ confirm: "Confirm"
10
+ },
11
+ calendar: {
12
+ Monday: "Mon",
13
+ Tuesday: "Tue",
14
+ Wednesday: "Wed",
15
+ Thursday: "Thu",
16
+ Friday: "Fri",
17
+ Saturday: "Sat",
18
+ Sunday: "Sun"
19
+ },
20
+ input: {
21
+ placeholder: "Placeholder"
22
+ },
23
+ textarea: {
24
+ placeholder: "Placeholder"
25
+ },
26
+ selector: {
27
+ select: "Please select"
28
+ },
29
+ citySelector: {
30
+ selectedCityGroupName: "Selected City",
31
+ currentCityGroupName: "Current City",
32
+ hotCitiesGroupName: "Hot Cities",
33
+ gpsType: {
34
+ title: "Current",
35
+ code: "GPS"
36
+ },
37
+ currentType: {
38
+ title: "Selected",
39
+ code: "CRRT"
40
+ },
41
+ hotCityType: {
42
+ title: "Hot",
43
+ code: "HOT"
44
+ }
45
+ }
46
+ };
47
+ var en_US_default = enUS;
48
+ export {
49
+ en_US_default as default
50
+ };
@@ -0,0 +1,3 @@
1
+ import { ThemeProps } from '../../ThemeProvider';
2
+ declare function useLocaleText(componentName: string, theme?: Partial<ThemeProps>): any;
3
+ export default useLocaleText;
@@ -0,0 +1,26 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import { CN } from "../index";
18
+ import { useTheme } from "../../ThemeProvider";
19
+ function useLocaleText(componentName, theme) {
20
+ const { locale } = useTheme(theme);
21
+ return __spreadValues(__spreadValues({}, CN[componentName]), (locale == null ? void 0 : locale[componentName]) || {});
22
+ }
23
+ var useLocaleText_default = useLocaleText;
24
+ export {
25
+ useLocaleText_default as default
26
+ };
@@ -0,0 +1,5 @@
1
+ export { default as EN } from './en-US';
2
+ export { default as CN } from './zh-CN';
3
+ export { default as TW } from './zh-TW';
4
+ export { default as useLocaleText } from './hooks/useLocaleText';
5
+ export * from './base';
@@ -0,0 +1,11 @@
1
+ import { default as default2 } from "./en-US";
2
+ import { default as default3 } from "./zh-CN";
3
+ import { default as default4 } from "./zh-TW";
4
+ import { default as default5 } from "./hooks/useLocaleText";
5
+ export * from "./base";
6
+ export {
7
+ default3 as CN,
8
+ default2 as EN,
9
+ default4 as TW,
10
+ default5 as useLocaleText
11
+ };
@@ -0,0 +1,3 @@
1
+ import { BaseLang } from './base';
2
+ declare const zhCN: BaseLang;
3
+ export default zhCN;
@@ -0,0 +1,32 @@
1
+ const zhCN = {
2
+ dialog: {
3
+ cancel: "\u53D6\u6D88",
4
+ confirm: "\u786E\u5B9A",
5
+ placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9"
6
+ },
7
+ picker: {
8
+ cancel: "\u53D6\u6D88",
9
+ confirm: "\u786E\u8BA4"
10
+ },
11
+ calendar: {
12
+ Monday: "\u4E00",
13
+ Tuesday: "\u4E8C",
14
+ Wednesday: "\u4E09",
15
+ Thursday: "\u56DB",
16
+ Friday: "\u4E94",
17
+ Saturday: "\u516D",
18
+ Sunday: "\u65E5"
19
+ },
20
+ citySelector: {
21
+ selectedCityGroupName: "\u5F53\u524D\u57CE\u5E02",
22
+ currentCityGroupName: "\u5B9A\u4F4D\u57CE\u5E02",
23
+ hotCitiesGroupName: "\u70ED\u95E8\u57CE\u5E02",
24
+ located: "\u5B9A\u4F4D",
25
+ current: "\u5F53\u524D",
26
+ hot: "\u70ED\u95E8"
27
+ }
28
+ };
29
+ var zh_CN_default = zhCN;
30
+ export {
31
+ zh_CN_default as default
32
+ };
@@ -0,0 +1,3 @@
1
+ import { BaseLang } from './base';
2
+ declare const zhTW: BaseLang;
3
+ export default zhTW;
@@ -0,0 +1,32 @@
1
+ const zhTW = {
2
+ dialog: {
3
+ cancel: "\u53D6\u6D88",
4
+ confirm: "\u78BA\u8A8D",
5
+ placeholder: "\u8ACB\u8F38\u5165\u5167\u5BB9"
6
+ },
7
+ picker: {
8
+ cancel: "\u53D6\u6D88",
9
+ confirm: "\u78BA\u8A8D"
10
+ },
11
+ calendar: {
12
+ Monday: "\u4E00",
13
+ Tuesday: "\u4E8C",
14
+ Wednesday: "\u4E09",
15
+ Thursday: "\u56DB",
16
+ Friday: "\u4E94",
17
+ Saturday: "\u516D",
18
+ Sunday: "\u65E5"
19
+ },
20
+ citySelector: {
21
+ selectedCityGroupName: "\u76EE\u524D\u57CE\u5E02",
22
+ currentCityGroupName: "\u5B9A\u4F4D\u57CE\u5E02",
23
+ hotCitiesGroupName: "\u71B1\u9580\u57CE\u5E02",
24
+ located: "\u5B9A\u4F4D",
25
+ current: "\u76EE\u524D",
26
+ hot: "\u71B1\u9580"
27
+ }
28
+ };
29
+ var zh_TW_default = zhTW;
30
+ export {
31
+ zh_TW_default as default
32
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifrostui/react",
3
- "version": "1.2.9-beta.0",
3
+ "version": "1.3.1-beta.0",
4
4
  "description": "React components for building mobile application",
5
5
  "homepage": "http://bui.taopiaopiao.com",
6
6
  "license": "MIT",
@@ -33,10 +33,10 @@
33
33
  "clsx": "^1.2.1",
34
34
  "dayjs": "^1.11.7",
35
35
  "swiper": "^8.1.5",
36
- "@bifrostui/icons": "1.2.9-beta.0",
37
- "@bifrostui/types": "1.2.9-beta.0",
38
- "@bifrostui/utils": "1.2.9-beta.0",
39
- "@bifrostui/styles": "1.2.9-beta.0"
36
+ "@bifrostui/icons": "1.3.1-beta.0",
37
+ "@bifrostui/styles": "1.3.1-beta.0",
38
+ "@bifrostui/types": "1.3.1-beta.0",
39
+ "@bifrostui/utils": "1.3.1-beta.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@tarojs/components": "^3.0.0",