@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
@@ -1,11 +1,26 @@
1
1
  .bui-switch {
2
- --bg-color: #ccc;
2
+ --bg-color: var(--bui-switch-bg-color, #ccc);
3
+ --padding: var(--bui-switch-padding, 0);
4
+ --border-radius: var(--bui-switch-border-radius, 15px);
5
+ --small-width: var(--bui-switch-small-width, 24px);
6
+ --small-height: var(--bui-switch-small-height, 16px);
7
+ --small-font-size: var(--bui-switch-small-font-size, 9px);
8
+ --controller-small-width: var(--bui-switch-controller-small-width, 12px);
9
+ --controller-small-height: var(--bui-switch-controller-small-height, 12px);
10
+ --medium-width: var(--bui-switch-medium-width, 44px);
11
+ --medium-height: var(--bui-switch-medium-height, 22px);
12
+ --controller-medium-width: var(--bui-switch-controller-medium-width, 18px);
13
+ --controller-medium-height: var(--bui-switch-controller-medium-height, 18px);
14
+ --large-width: var(--bui-switch-large-width, 51px);
15
+ --large-height: var(--bui-switch-large-height, 30px);
16
+ --controller-large-width: var(--bui-switch-controller-large-width, 24px);
17
+ --controller-large-height: var(--bui-switch-controller-large-height, 24px);
3
18
  position: relative;
4
19
  display: inline-block;
5
20
  box-sizing: border-box;
6
- padding: 0;
21
+ padding: var(--padding);
7
22
  vertical-align: middle;
8
- border-radius: 15px;
23
+ border-radius: var(--border-radius);
9
24
  background-color: var(--bg-color);
10
25
  transition: all 0.3s cubic-bezier(0.35, 0, 0.25, 1);
11
26
  font-family: var(--bui-font-family);
@@ -27,16 +42,16 @@
27
42
  outline: none;
28
43
  }
29
44
  .bui-switch-small {
30
- width: 24px;
31
- height: 16px;
45
+ width: var(--small-width);
46
+ height: var(--small-height);
32
47
  }
33
48
  .bui-switch-small .bui-switch-inner {
34
49
  left: calc(100% - 10px);
35
- font-size: 9px;
50
+ font-size: var(--font-size-smal);
36
51
  }
37
52
  .bui-switch-small::after {
38
- width: 12px;
39
- height: 12px;
53
+ width: var(--controller-small-width);
54
+ height: var(--controller-small-height);
40
55
  left: 2px;
41
56
  top: 2px;
42
57
  }
@@ -47,12 +62,12 @@
47
62
  left: 2px;
48
63
  }
49
64
  .bui-switch-medium {
50
- width: 44px;
51
- height: 22px;
65
+ width: var(--medium-width);
66
+ height: var(--medium-height);
52
67
  }
53
68
  .bui-switch-medium::after {
54
- width: 18px;
55
- height: 18px;
69
+ width: var(--controller-medium-width);
70
+ height: var(--controller-medium-height);
56
71
  }
57
72
  .bui-switch-medium.bui-switch-checked::after {
58
73
  left: calc(100% - 20px);
@@ -61,15 +76,15 @@
61
76
  left: var(--bui-spacing-sm);
62
77
  }
63
78
  .bui-switch-large {
64
- width: 51px;
65
- height: 30px;
79
+ width: var(--large-width);
80
+ height: var(--large-height);
66
81
  }
67
82
  .bui-switch-large .bui-switch-inner {
68
83
  left: calc(100% - 22px);
69
84
  }
70
85
  .bui-switch-large::after {
71
- width: 24px;
72
- height: 24px;
86
+ width: var(--controller-large-width);
87
+ height: var(--controller-large-height);
73
88
  left: 3px;
74
89
  top: 3px;
75
90
  }
@@ -1,8 +1,12 @@
1
1
  .bui-tab-bar {
2
+ --width: var(--bui-tab-bar-width, 100%);
3
+ --height: var(--bui-tab-bar-height, 50px);
4
+ --padding: var(--bui-tab-bar-padding, 6px 0);
5
+ --bui-tab-bar-color: var(--bui-tab-bar-default-color, var(--bui-color-fg-default));
2
6
  display: flex;
3
- width: 100%;
4
- height: 50px;
5
- padding: 6px 0;
7
+ width: var(--width);
8
+ height: var(--height);
9
+ padding: var(--padding);
6
10
  background: var(--bui-color-white);
7
11
  font-family: var(--bui-font-family);
8
12
  }
@@ -1,5 +1,4 @@
1
1
  .bui-tab-bar-item {
2
- --bui-tab-bar-color: var(--bui-tab-bar-default-color, var(--bui-color-fg-default));
3
2
  display: flex;
4
3
  align-items: center;
5
4
  justify-content: center;
package/es/Tabs/Tab.css CHANGED
@@ -4,20 +4,16 @@
4
4
  justify-content: center;
5
5
  white-space: nowrap;
6
6
  width: min-content;
7
- height: 100%;
7
+ height: var(--tab-height);
8
8
  box-sizing: border-box;
9
9
  position: relative;
10
10
  cursor: pointer;
11
11
  font-size: var(--font-size);
12
12
  line-height: var(--bui-line-height);
13
13
  color: var(--color);
14
- padding: var(--bui-spacing-lg) var(--bui-spacing-lg) 10px;
14
+ padding: var(--tab-padding);
15
15
  font-family: var(--bui-font-family);
16
16
  }
17
- .bui-tab-center {
18
- flex: 1 0 auto;
19
- margin: 0 auto;
20
- }
21
17
  .bui-tab-active {
22
18
  font-size: var(--font-size);
23
19
  line-height: var(--bui-line-height);
package/es/Tabs/Tabs.css CHANGED
@@ -1,11 +1,14 @@
1
1
  .bui-tabs {
2
- --height: 39px;
2
+ --height: var(--bui-tabs-height, 39px);
3
3
  --font-size: var(--bui-text-size-1);
4
4
  --color: var(--bui-color-fg-subtle);
5
5
  --active-color: var(--bui-color-fg-default);
6
6
  --line-color: var(--bui-color-primary);
7
- --line-height: 3PX;
8
- --line-width: 18px;
7
+ --line-height: var(--bui-tabs-line-height, 3PX);
8
+ --line-width: var(--bui-tabs-line-width, 18px);
9
+ --mask-height: var(--bui-tabs-mask-height, 100%);
10
+ --tab-height: var(--bui-tab-height, 100%);
11
+ --tab-padding: var(--bui-tab-padding, var(--bui-spacing-lg) var(--bui-spacing-lg) 10px);
9
12
  position: relative;
10
13
  font-family: var(--bui-font-family);
11
14
  }
@@ -40,7 +43,7 @@
40
43
  bottom: 0;
41
44
  z-index: 1;
42
45
  width: 12px;
43
- height: 100%;
46
+ height: var(--bui-tabs-mask-height);
44
47
  pointer-events: none;
45
48
  }
46
49
  .bui-tabs-mask-left {
package/es/Tag/Tag.css CHANGED
@@ -1,15 +1,12 @@
1
1
  .bui-tag {
2
- --color: var(--bui-tag-color, var(--bui-color-gray));
3
- --border-color: var(--bui-tag-border-color, var(--bui-color-border-gray));
4
- --bg-color: var(--bui-tag-bg-color, var(--bui-color-gray));
5
2
  position: relative;
6
3
  display: inline-flex;
7
4
  align-items: center;
8
5
  justify-content: center;
9
6
  white-space: nowrap;
10
- height: 15px;
11
- line-height: 15px;
12
- padding: 0 var(--bui-spacing-xs);
7
+ height: var(--tag-height);
8
+ line-height: var(--tag-line-height);
9
+ padding: var(--tag-padding);
13
10
  font-size: var(--bui-text-size-5);
14
11
  font-weight: var(--bui-font-weight-normal);
15
12
  border-radius: var(--bui-shape-radius-label);
@@ -19,8 +16,8 @@
19
16
  font-family: var(--bui-font-family);
20
17
  }
21
18
  .bui-tag-outlined {
22
- color: var(--color);
23
- border: 1px solid var(--border-color);
19
+ color: var(--tag-color);
20
+ border: 1px solid var(--tag-border-color);
24
21
  }
25
22
  .bui-tag-outlined.bui-tag-primary {
26
23
  color: var(--bui-color-primary);
@@ -47,7 +44,7 @@
47
44
  border: 1px solid var(--bui-color-border-primary);
48
45
  }
49
46
  .bui-tag-contained {
50
- background-color: var(--bg-color);
47
+ background-color: var(--tag-bg-color);
51
48
  }
52
49
  .bui-tag-contained.bui-tag-primary {
53
50
  background-color: var(--bui-color-primary);
@@ -92,6 +89,6 @@
92
89
  color: var(--bui-color-danger);
93
90
  }
94
91
  .bui-tag-light.bui-tag-vip {
95
- background-color: rgba(255, 134, 110, 0.3);
92
+ background-color: var(--tag-bg-color-vip);
96
93
  color: var(--bui-color-vip);
97
94
  }
@@ -1,4 +1,12 @@
1
1
  .bui-tag-group {
2
+ --height: var(--bui-tag-group-divider-height, 13%);
3
+ --tag-color: var(--bui-tag-color, var(--bui-color-gray));
4
+ --tag-border-color: var(--bui-tag-border-color, var(--bui-color-border-gray));
5
+ --tag-bg-color: var(--bui-tag-bg-color, var(--bui-color-gray));
6
+ --tag-height: var(--bui-tag-height, 15px);
7
+ --tag-line-height: var(--bui-tag-line-height, 15px);
8
+ --tag-padding: var(--bui-tag-padding, 0 var(--bui-spacing-xs));
9
+ --tag-bg-color-vip: var(--bui-tag-color-vip, rgba(255, 134, 110, 0.3));
2
10
  display: inline-flex;
3
11
  font-family: var(--bui-font-family);
4
12
  }
@@ -24,7 +32,7 @@
24
32
  position: absolute;
25
33
  right: -1px;
26
34
  width: 1px;
27
- height: 13%;
35
+ height: var(--height);
28
36
  color: #fff;
29
37
  background-color: #fff;
30
38
  border-right-style: solid;
@@ -1,13 +1,19 @@
1
1
  .bui-textarea {
2
+ --width: var(--bui-textarea-width, 100%);
2
3
  --bg-color: var(--bui-color-bg-default);
3
- --text-color: var(--bui-color-fg-subtle);
4
+ --text-color: var(--bui-textarea-text-color, var(--bui-color-fg-subtle));
4
5
  --count-bg-color: var(--bg-color, var(--bui-color-bg-default));
5
- --count-text-color: var(--bui-color-fg-subtle);
6
+ --count-text-color: var(--bui-textarea-count-color, var(--bui-color-fg-subtle));
7
+ --text-font-size: var(--bui-textarea-text-font-size, var(--bui-text-size-2));
8
+ --count-font-size: var(--bui-textarea-count-font-size, var(--bui-title-size-3));
9
+ --content-padding: var(--bui-textarea-padding, 8px);
10
+ --count-padding: var(--bui-textarea-count-padding, 0 4px);
11
+ --placeholder-line-height: var(--bui-textarea-placeholder-line-height, 1.3);
6
12
  background: var(--bui-color-bg-default);
7
13
  font-family: var(--bui-font-family);
8
14
  }
9
15
  .bui-textarea textarea {
10
- font-size: var(--bui-text-size-2);
16
+ font-size: var(--text-font-size);
11
17
  color: var(--text-color);
12
18
  line-height: var(--bui-line-height);
13
19
  }
@@ -21,10 +27,10 @@
21
27
  display: none;
22
28
  }
23
29
  .bui-textarea-content {
24
- width: 100%;
30
+ width: var(--width);
25
31
  resize: none;
26
32
  background: var(--bg-color);
27
- padding: 8px;
33
+ padding: var(--content-padding);
28
34
  border: none;
29
35
  outline: none;
30
36
  word-break: break-all;
@@ -32,12 +38,12 @@
32
38
  }
33
39
  .bui-textarea-content::placeholder {
34
40
  color: var(--bui-color-fg-disabled);
35
- line-height: 1.3;
41
+ line-height: var(--placeholder-line-height);
36
42
  }
37
43
  .bui-textarea-count {
38
44
  background: var(--count-bg-color);
39
45
  color: var(--count-text-color);
40
46
  text-align: right;
41
- padding: 0 4px;
42
- font-size: var(--bui-title-size-3);
47
+ padding: var(--count-padding);
48
+ font-size: var(--count-font-size);
43
49
  }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ThemeProviderProps } from './ThemeProvider.types';
3
+ declare const ThemeProvider: React.ForwardRefExoticComponent<Omit<ThemeProviderProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export default ThemeProvider;
@@ -0,0 +1,61 @@
1
+ import React, { useMemo, useId, useEffect } from "react";
2
+ import { ThemeContext } from "./hooks";
3
+ import { BUI_VAR_PREFIX } from "./utils/constants";
4
+ import { mountTokens } from "./utils/mountTokens";
5
+ const ThemeProvider = /* @__PURE__ */ React.forwardRef(
6
+ (props, ref) => {
7
+ var _a;
8
+ const {
9
+ isRoot,
10
+ locale,
11
+ responsive,
12
+ defaultLightToken,
13
+ defaultDarkToken,
14
+ dmLightToken,
15
+ dmDarkToken,
16
+ token,
17
+ children
18
+ } = props;
19
+ let containerId = (useId() || "").replace(/:/g, "");
20
+ containerId = `${BUI_VAR_PREFIX}${containerId}`;
21
+ const theme = useMemo(() => {
22
+ return { locale };
23
+ }, [locale]);
24
+ let childrenNode = children;
25
+ if (React.isValidElement(children)) {
26
+ childrenNode = React.cloneElement(children, {
27
+ className: `${containerId} ${((_a = children == null ? void 0 : children.props) == null ? void 0 : _a.className) || ""}`.trim()
28
+ });
29
+ }
30
+ useEffect(() => {
31
+ if (responsive || defaultLightToken || defaultDarkToken || dmLightToken || dmDarkToken || token) {
32
+ mountTokens({
33
+ isRoot,
34
+ containerId,
35
+ container: children,
36
+ responsive,
37
+ defaultLightToken,
38
+ defaultDarkToken,
39
+ dmLightToken,
40
+ dmDarkToken,
41
+ token
42
+ });
43
+ }
44
+ }, [
45
+ isRoot,
46
+ containerId,
47
+ responsive,
48
+ defaultLightToken,
49
+ defaultDarkToken,
50
+ dmLightToken,
51
+ dmDarkToken,
52
+ token
53
+ ]);
54
+ return /* @__PURE__ */ React.createElement(ThemeContext.Provider, { value: theme }, childrenNode);
55
+ }
56
+ );
57
+ ThemeProvider.displayName = "BuiThemeProvider";
58
+ var ThemeProvider_default = ThemeProvider;
59
+ export {
60
+ ThemeProvider_default as default
61
+ };
@@ -0,0 +1,127 @@
1
+ import { ReactNode } from 'react';
2
+ import { OverrideProps } from '@bifrostui/types';
3
+ import { BaseLang } from '../locales/base';
4
+ export type ThemeProviderProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
5
+ props: P & ThemeProps;
6
+ defaultComponent: D;
7
+ }, D>;
8
+ export interface Breakpoints {
9
+ /**
10
+ * 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
11
+ * @default '575.98px'
12
+ */
13
+ xs?: string;
14
+ /**
15
+ * 小屏幕
16
+ * @default '576px'
17
+ */
18
+ sm?: string;
19
+ /**
20
+ * 中等屏幕
21
+ * @default '768px'
22
+ */
23
+ md?: string;
24
+ /**
25
+ * 大屏幕
26
+ * @default '992px'
27
+ */
28
+ lg?: string;
29
+ /**
30
+ * 超大屏幕
31
+ * @default '1200px'
32
+ */
33
+ xl?: string;
34
+ }
35
+ /**
36
+ * 响应式屏幕断点配置
37
+ */
38
+ interface ResponsiveTokenOptions {
39
+ /**
40
+ * 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
41
+ */
42
+ xs?: Record<string, string>;
43
+ /**
44
+ * 小屏幕 (≥ 576px)
45
+ */
46
+ sm?: Record<string, string>;
47
+ /**
48
+ * 中等屏幕 (≥ 768px)
49
+ */
50
+ md?: Record<string, string>;
51
+ /**
52
+ * 大屏幕 (≥ 992px)
53
+ */
54
+ lg?: Record<string, string>;
55
+ /**
56
+ * 超大屏幕 (≥ 1200px)
57
+ */
58
+ xl?: Record<string, string>;
59
+ }
60
+ interface ThemeProps {
61
+ /**
62
+ * 当前ThemeProvider是否为最顶层
63
+ * 若当前应用会出现嵌套的ThemeProvider,则需要将最外层的ThemeProvider isRoot属性设置为true
64
+ * TODO 不通过属性判断
65
+ * @default false
66
+ */
67
+ isRoot?: boolean;
68
+ /**
69
+ * 挂载的容器
70
+ * @default root
71
+ */
72
+ container?: ReactNode;
73
+ /**
74
+ * 挂载容器的id
75
+ */
76
+ containerId?: string;
77
+ /**
78
+ * 语言
79
+ */
80
+ locale?: BaseLang;
81
+ /**
82
+ * 响应式屏幕断点配置
83
+ */
84
+ responsive?: ResponsiveTokenOptions;
85
+ /**
86
+ * 默认高亮主题Token
87
+ */
88
+ defaultLightToken?: Record<string, string>;
89
+ /**
90
+ * 默认暗黑主题Token
91
+ */
92
+ defaultDarkToken?: Record<string, string>;
93
+ /**
94
+ * 大麦高亮主题Token
95
+ */
96
+ dmLightToken?: Record<string, string>;
97
+ /**
98
+ * 大麦暗黑主题Token
99
+ */
100
+ dmDarkToken?: Record<string, string>;
101
+ /**
102
+ * 组件全局Token
103
+ */
104
+ token?: Record<string, string>;
105
+ }
106
+ /**
107
+ * 复写内置主题Tokens
108
+ */
109
+ type BuiltInThemesTokenOptions = Pick<ThemeProps, 'defaultLightToken' | 'defaultDarkToken' | 'dmLightToken' | 'dmDarkToken'>;
110
+ /**
111
+ * 挂载组件自定义Tokens参数
112
+ */
113
+ export type MountComponentsTokenOptions = Pick<ThemeProps, 'isRoot' | 'container' | 'containerId' | 'token'>;
114
+ /**
115
+ * 挂载响应式Tokens参数
116
+ */
117
+ type componentsTokenOptions = Pick<ThemeProps, 'token'>;
118
+ export type MountResponsiveTokenOptions = Pick<ThemeProps, 'responsive'> & {
119
+ breakpoints?: Breakpoints;
120
+ };
121
+ /**
122
+ * 更新Tokens
123
+ */
124
+ export type UpdateTokensOptions = Pick<ThemeProps, 'isRoot' | 'containerId' | 'container'> & {
125
+ rootString: string;
126
+ };
127
+ export { BaseLang, ResponsiveTokenOptions, ThemeProps, BuiltInThemesTokenOptions, componentsTokenOptions, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ThemeProps } from '../ThemeProvider.types';
3
+ declare const ThemeContext: React.Context<ThemeProps>;
4
+ export default ThemeContext;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ const ThemeContext = React.createContext(null);
3
+ var ThemeContext_default = ThemeContext;
4
+ export {
5
+ ThemeContext_default as default
6
+ };
@@ -0,0 +1,2 @@
1
+ import { ThemeProps } from '../ThemeProvider.types';
2
+ export default function createTheme(options: ThemeProps): ThemeProps;
@@ -0,0 +1,38 @@
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
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
29
+ function createTheme(options) {
30
+ const _a = options || {}, { locale } = _a, others = __objRest(_a, ["locale"]);
31
+ const buiTheme = __spreadValues({
32
+ locale
33
+ }, others);
34
+ return buiTheme;
35
+ }
36
+ export {
37
+ createTheme as default
38
+ };
@@ -0,0 +1,4 @@
1
+ import createTheme from './createTheme';
2
+ import ThemeContext from './ThemeContext';
3
+ import useTheme from './useTheme';
4
+ export { createTheme, ThemeContext, useTheme };
@@ -0,0 +1,8 @@
1
+ import createTheme from "./createTheme";
2
+ import ThemeContext from "./ThemeContext";
3
+ import useTheme from "./useTheme";
4
+ export {
5
+ ThemeContext,
6
+ createTheme,
7
+ useTheme
8
+ };
@@ -0,0 +1 @@
1
+ export default function useTheme(defaultTheme?: import("../ThemeProvider.types").ThemeProps): import("../ThemeProvider.types").ThemeProps;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import createTheme from "./createTheme";
3
+ import ThemeContext from "./ThemeContext";
4
+ function useTheme(defaultTheme = createTheme(null)) {
5
+ const contextTheme = React.useContext(ThemeContext);
6
+ return !contextTheme || Object.keys(contextTheme).length === 0 ? defaultTheme : contextTheme;
7
+ }
8
+ export {
9
+ useTheme as default
10
+ };
@@ -0,0 +1,4 @@
1
+ export { default, default as ThemeProvider } from './ThemeProvider';
2
+ export * from './hooks';
3
+ export * from './utils';
4
+ export * from './ThemeProvider.types';
@@ -0,0 +1,8 @@
1
+ import { default as default2, default as default3 } from "./ThemeProvider";
2
+ export * from "./hooks";
3
+ export * from "./utils";
4
+ export * from "./ThemeProvider.types";
5
+ export {
6
+ default3 as ThemeProvider,
7
+ default2 as default
8
+ };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 响应式屏幕断点
3
+ */
4
+ export declare const breakpoints: {
5
+ /**
6
+ * 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
7
+ */
8
+ xs: string;
9
+ /**
10
+ * 小屏幕 (≥ 576px)
11
+ */
12
+ sm: string;
13
+ /**
14
+ * 中等屏幕 (≥ 768px)
15
+ */
16
+ md: string;
17
+ /**
18
+ * 大屏幕 (≥ 992px)
19
+ */
20
+ lg: string;
21
+ /**
22
+ * 超大屏幕 (≥ 1200px)
23
+ */
24
+ xl: string;
25
+ };
26
+ /**
27
+ * 根节点选择器,用于挂载全局Tokens
28
+ */
29
+ export declare const rootSelector: {
30
+ defaultLight: string[];
31
+ defaultDark: string[];
32
+ dmLight: string[];
33
+ dmDark: string[];
34
+ };
35
+ /**
36
+ * BUI css变量前缀
37
+ */
38
+ export declare const BUI_VAR_PREFIX = "bui-var-";
@@ -0,0 +1,40 @@
1
+ const breakpoints = {
2
+ /**
3
+ * 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
4
+ */
5
+ xs: "575.98px",
6
+ /**
7
+ * 小屏幕 (≥ 576px)
8
+ */
9
+ sm: "576px",
10
+ /**
11
+ * 中等屏幕 (≥ 768px)
12
+ */
13
+ md: "768px",
14
+ /**
15
+ * 大屏幕 (≥ 992px)
16
+ */
17
+ lg: "992px",
18
+ /**
19
+ * 超大屏幕 (≥ 1200px)
20
+ */
21
+ xl: "1200px"
22
+ };
23
+ const rootSelector = {
24
+ defaultLight: [
25
+ ":root",
26
+ "page",
27
+ "xhs-page",
28
+ ".bui-default-light",
29
+ '[data-color-mode="light"][data-theme="default"]'
30
+ ],
31
+ defaultDark: [".bui-dark", '[data-color-mode="dark"][data-theme="default"]'],
32
+ dmLight: [".bui-dm-light", '[data-color-mode="light"][data-theme="dm"]'],
33
+ dmDark: [".bui-dm-dark", '[data-color-mode="dark"][data-theme="dm"]']
34
+ };
35
+ const BUI_VAR_PREFIX = "bui-var-";
36
+ export {
37
+ BUI_VAR_PREFIX,
38
+ breakpoints,
39
+ rootSelector
40
+ };
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './mountTokens';
@@ -0,0 +1,2 @@
1
+ export * from "./constants";
2
+ export * from "./mountTokens";