@hanwenbo/x-taro-ui 0.0.1 → 0.0.2

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 (55) hide show
  1. package/es/adapters/miniapp/overlayHost.js +14 -8
  2. package/es/auth/components.d.ts +17 -15
  3. package/es/auth/components.js +253 -133
  4. package/es/auth/entries/locales.d.ts +2 -0
  5. package/es/auth/entries/locales.js +1 -0
  6. package/es/auth/index.d.ts +1 -0
  7. package/es/auth/index.js +2 -1
  8. package/es/auth/internal.d.ts +17 -11
  9. package/es/auth/internal.js +107 -42
  10. package/es/auth/phoneNumberInput.d.ts +4 -2
  11. package/es/auth/phoneNumberInput.js +27 -8
  12. package/es/auth/provider.d.ts +2 -2
  13. package/es/auth/styles.css +161 -99
  14. package/es/auth/theme.js +20 -4
  15. package/es/components/_shared/render.d.ts +1 -1
  16. package/es/components/button/button.js +23 -3
  17. package/es/components/button/types.d.ts +6 -0
  18. package/es/components/capsuleTabs/capsuleTabs.js +4 -0
  19. package/es/components/icon/lucide.generated.d.ts +10 -0
  20. package/es/components/icon/lucide.generated.js +10 -0
  21. package/es/components/inputItem/inputItem.js +5 -2
  22. package/es/components/list/list.d.ts +1 -1
  23. package/es/components/pagination/pagination.js +18 -5
  24. package/es/components/sectionList/sectionList.d.ts +1 -2
  25. package/es/components/segmented/segmented.js +10 -2
  26. package/es/components/touchableOpacity/touchableOpacity.js +1 -0
  27. package/es/taro-components.d.ts +6 -0
  28. package/lib/adapters/miniapp/overlayHost.js +13 -6
  29. package/lib/auth/components.d.ts +17 -15
  30. package/lib/auth/components.js +257 -125
  31. package/lib/auth/entries/locales.d.ts +2 -0
  32. package/lib/auth/entries/locales.js +33 -0
  33. package/lib/auth/index.d.ts +1 -0
  34. package/lib/auth/index.js +13 -0
  35. package/lib/auth/internal.d.ts +17 -11
  36. package/lib/auth/internal.js +76 -31
  37. package/lib/auth/phoneNumberInput.d.ts +4 -2
  38. package/lib/auth/phoneNumberInput.js +65 -45
  39. package/lib/auth/provider.d.ts +2 -2
  40. package/lib/auth/styles.css +161 -99
  41. package/lib/auth/theme.js +7 -4
  42. package/lib/components/_shared/render.d.ts +1 -1
  43. package/lib/components/button/button.js +7 -0
  44. package/lib/components/button/types.d.ts +6 -0
  45. package/lib/components/capsuleTabs/capsuleTabs.js +1 -0
  46. package/lib/components/icon/lucide.generated.d.ts +10 -0
  47. package/lib/components/icon/lucide.generated.js +24 -0
  48. package/lib/components/inputItem/inputItem.js +3 -0
  49. package/lib/components/list/list.d.ts +1 -1
  50. package/lib/components/pagination/pagination.js +19 -5
  51. package/lib/components/sectionList/sectionList.d.ts +1 -2
  52. package/lib/components/segmented/segmented.js +6 -1
  53. package/lib/components/touchableOpacity/touchableOpacity.js +1 -0
  54. package/lib/taro-components.d.ts +6 -0
  55. package/package.json +4 -4
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import type { SectionListProps } from './types';
3
- declare function SectionList<T>({ sections, renderItem, renderSectionHeader, renderSectionFooter, keyExtractor, sectionKeyExtractor, stickySectionHeadersEnabled, extraData, initialNumToRender, inverted, ItemSeparatorComponent, SectionSeparatorComponent, ListEmptyComponent, ListHeaderComponent, ListFooterComponent, testID, activeSectionKey, defaultActiveSectionKey, collapsedSectionKeys, defaultCollapsedSectionKeys, size, variant, collapsible, accordion, divider, emptyText, onSectionChange, onCollapsedSectionKeysChange, children, className, style }: SectionListProps<T>): React.JSX.Element;
2
+ declare function SectionList<T>({ sections, renderItem, renderSectionHeader, renderSectionFooter, keyExtractor, sectionKeyExtractor, stickySectionHeadersEnabled, extraData, initialNumToRender, inverted, ItemSeparatorComponent, SectionSeparatorComponent, ListEmptyComponent, ListHeaderComponent, ListFooterComponent, testID, activeSectionKey, defaultActiveSectionKey, collapsedSectionKeys, defaultCollapsedSectionKeys, size, variant, collapsible, accordion, divider, emptyText, onSectionChange, onCollapsedSectionKeysChange, children, className, style }: SectionListProps<T>): import("react/jsx-runtime").JSX.Element;
4
3
  declare namespace SectionList {
5
4
  var displayName: string;
6
5
  }
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(segmented_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_components = require("@tarojs/components");
37
37
  var import_patterns = require("../../patterns");
38
+ var import_measure = require("../../adapters/miniapp/measure");
38
39
  var import_theme = require("../../theme");
39
40
  var import_utils = require("../../utils");
40
41
  var import_inlineAlignment = require("../../utils/inlineAlignment");
@@ -217,12 +218,16 @@ var Segmented = ({
217
218
  const currentValue = value !== void 0 ? value : innerValue;
218
219
  const metrics = import_theme.segmentedSizeMetrics[size];
219
220
  const currentKey = currentValue === void 0 ? null : String(currentValue);
220
- const { containerId, itemId, indicatorStyle, indicatorReady, indicatorMotionReady } = (0, import_useTaroSelectionIndicator.useTaroSelectionIndicator)({
221
+ const { containerId, itemId, indicatorStyle, indicatorReady, indicatorMotionReady, remeasure } = (0, import_useTaroSelectionIndicator.useTaroSelectionIndicator)({
221
222
  activeKey: currentKey,
222
223
  enabled: motion && currentKey !== null,
223
224
  inset: metrics.thumbInset,
224
225
  mode: "static"
225
226
  });
227
+ (0, import_react.useEffect)(() => {
228
+ if (!motion) return;
229
+ return (0, import_measure.subscribeViewportChange)(() => void remeasure());
230
+ }, [motion, remeasure]);
226
231
  const activeTextColor = variant === "filled" ? theme.colors["primary-foreground"] : theme.colors.foreground;
227
232
  const handleSelect = (option) => {
228
233
  if (disabled || option.disabled || option.value === currentValue) return;
@@ -162,6 +162,7 @@ var TouchableOpacity = ({
162
162
  "data-pressed": pressed ? "true" : void 0,
163
163
  "data-testid": testID,
164
164
  style: {
165
+ boxSizing: "border-box",
165
166
  width: block ? "100%" : void 0,
166
167
  cursor: disabled ? "not-allowed" : "pointer",
167
168
  userSelect: "none",
@@ -21,6 +21,12 @@ declare module '@tarojs/components/types/View' {
21
21
  }
22
22
  }
23
23
 
24
+ declare module '@tarojs/components/types/Button' {
25
+ interface ButtonProps {
26
+ role?: string;
27
+ }
28
+ }
29
+
24
30
  declare module '@tarojs/components/types/Input' {
25
31
  interface InputProps {
26
32
  readonly?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanwenbo/x-taro-ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "A Taro mini-program UI library based on x-design-system",
5
5
  "author": "9476400@qq.com",
6
6
  "license": "MIT",
@@ -70,9 +70,9 @@
70
70
  "**/*.css"
71
71
  ],
72
72
  "dependencies": {
73
- "@hanwenbo/x-auth-core": "0.1.0",
74
- "@hanwenbo/x-i18n": "1.0.0",
75
- "@hanwenbo/x-mobile-locales": "1.0.0",
73
+ "@hanwenbo/x-auth-core": "0.1.3",
74
+ "@hanwenbo/x-i18n": "1.1.1",
75
+ "@hanwenbo/x-mobile-locales": "1.0.2",
76
76
  "class-variance-authority": "^0.7.1",
77
77
  "clsx": "^2.1.0",
78
78
  "tailwind-merge": "^2.2.0"