@unif/react-native-ui 0.1.0 → 0.2.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.
- package/lib/commonjs/README.md +99 -0
- package/lib/commonjs/action-sheet/index.js +71 -0
- package/lib/commonjs/action-sheet/index.js.map +1 -0
- package/lib/commonjs/action-sheet/index.md +69 -0
- package/lib/commonjs/action-sheet/style/index.js +42 -0
- package/lib/commonjs/action-sheet/style/index.js.map +1 -0
- package/lib/commonjs/avatar/index.js +50 -0
- package/lib/commonjs/avatar/index.js.map +1 -0
- package/lib/commonjs/avatar/index.md +51 -0
- package/lib/commonjs/avatar/style/index.js +21 -0
- package/lib/commonjs/avatar/style/index.js.map +1 -0
- package/lib/commonjs/button/index.js +60 -0
- package/lib/commonjs/button/index.js.map +1 -0
- package/lib/commonjs/button/index.md +90 -0
- package/lib/commonjs/button/style/index.js +98 -0
- package/lib/commonjs/button/style/index.js.map +1 -0
- package/lib/commonjs/center/index.js +26 -0
- package/lib/commonjs/center/index.js.map +1 -0
- package/lib/commonjs/center/index.md +28 -0
- package/lib/commonjs/center/style/index.js +14 -0
- package/lib/commonjs/center/style/index.js.map +1 -0
- package/lib/commonjs/chip/index.js +69 -0
- package/lib/commonjs/chip/index.js.map +1 -0
- package/lib/commonjs/chip/index.md +60 -0
- package/lib/commonjs/chip/style/index.js +46 -0
- package/lib/commonjs/chip/style/index.js.map +1 -0
- package/lib/commonjs/column/index.js +35 -0
- package/lib/commonjs/column/index.js.map +1 -0
- package/lib/commonjs/column/index.md +34 -0
- package/lib/commonjs/column/style/index.js +13 -0
- package/lib/commonjs/column/style/index.js.map +1 -0
- package/lib/commonjs/divider/index.js +32 -0
- package/lib/commonjs/divider/index.js.map +1 -0
- package/lib/commonjs/divider/index.md +44 -0
- package/lib/commonjs/divider/style/index.js +22 -0
- package/lib/commonjs/divider/style/index.js.map +1 -0
- package/lib/commonjs/hooks/index.js +13 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/index.md +71 -0
- package/lib/commonjs/hooks/useMergeStyles.js +31 -0
- package/lib/commonjs/hooks/useMergeStyles.js.map +1 -0
- package/lib/commonjs/index.js +146 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/input/index.js +76 -0
- package/lib/commonjs/input/index.js.map +1 -0
- package/lib/commonjs/input/index.md +73 -0
- package/lib/commonjs/input/style/index.js +31 -0
- package/lib/commonjs/input/style/index.js.map +1 -0
- package/lib/commonjs/list-item/index.js +76 -0
- package/lib/commonjs/list-item/index.js.map +1 -0
- package/lib/commonjs/list-item/index.md +101 -0
- package/lib/commonjs/list-item/style/index.js +43 -0
- package/lib/commonjs/list-item/style/index.js.map +1 -0
- package/lib/commonjs/menu/index.js +66 -0
- package/lib/commonjs/menu/index.js.map +1 -0
- package/lib/commonjs/menu/style/index.js +32 -0
- package/lib/commonjs/menu/style/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/popover/index.js +68 -0
- package/lib/commonjs/popover/index.js.map +1 -0
- package/lib/commonjs/popover/index.md +57 -0
- package/lib/commonjs/popover/style/index.js +26 -0
- package/lib/commonjs/popover/style/index.js.map +1 -0
- package/lib/commonjs/row/index.js +36 -0
- package/lib/commonjs/row/index.js.map +1 -0
- package/lib/commonjs/row/index.md +46 -0
- package/lib/commonjs/row/style/index.js +19 -0
- package/lib/commonjs/row/style/index.js.map +1 -0
- package/lib/commonjs/space/index.js +25 -0
- package/lib/commonjs/space/index.js.map +1 -0
- package/lib/commonjs/space/index.md +31 -0
- package/lib/commonjs/space/style/index.js +15 -0
- package/lib/commonjs/space/style/index.js.map +1 -0
- package/lib/commonjs/text/index.js +40 -0
- package/lib/commonjs/text/index.js.map +1 -0
- package/lib/commonjs/text/index.md +63 -0
- package/lib/commonjs/text/style/index.js +56 -0
- package/lib/commonjs/text/style/index.js.map +1 -0
- package/lib/commonjs/theme/context.js +40 -0
- package/lib/commonjs/theme/context.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +68 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/touchable/index.js +40 -0
- package/lib/commonjs/touchable/index.js.map +1 -0
- package/lib/commonjs/touchable/index.md +42 -0
- package/lib/commonjs/touchable/style/index.js +13 -0
- package/lib/commonjs/touchable/style/index.js.map +1 -0
- package/lib/commonjs/wave-animation/index.js +72 -0
- package/lib/commonjs/wave-animation/index.js.map +1 -0
- package/lib/commonjs/wave-animation/index.md +50 -0
- package/lib/module/action-sheet/index.js +5 -2
- package/lib/module/action-sheet/index.js.map +1 -1
- package/lib/module/action-sheet/style/index.js +7 -8
- package/lib/module/action-sheet/style/index.js.map +1 -1
- package/lib/module/avatar/index.js +5 -2
- package/lib/module/avatar/index.js.map +1 -1
- package/lib/module/avatar/style/index.js +4 -5
- package/lib/module/avatar/style/index.js.map +1 -1
- package/lib/module/button/index.js +5 -2
- package/lib/module/button/index.js.map +1 -1
- package/lib/module/button/style/index.js +8 -9
- package/lib/module/button/style/index.js.map +1 -1
- package/lib/module/chip/index.js +7 -2
- package/lib/module/chip/index.js.map +1 -1
- package/lib/module/chip/style/index.js +12 -13
- package/lib/module/chip/style/index.js.map +1 -1
- package/lib/module/divider/index.js +13 -7
- package/lib/module/divider/index.js.map +1 -1
- package/lib/module/divider/style/index.js +4 -5
- package/lib/module/divider/style/index.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/index.js +5 -3
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/input/style/index.js +8 -9
- package/lib/module/input/style/index.js.map +1 -1
- package/lib/module/list-item/index.js +9 -7
- package/lib/module/list-item/index.js.map +1 -1
- package/lib/module/list-item/style/index.js +5 -6
- package/lib/module/list-item/style/index.js.map +1 -1
- package/lib/module/menu/index.js +60 -0
- package/lib/module/menu/index.js.map +1 -0
- package/lib/module/menu/style/index.js +27 -0
- package/lib/module/menu/style/index.js.map +1 -0
- package/lib/module/popover/index.js +5 -2
- package/lib/module/popover/index.js.map +1 -1
- package/lib/module/popover/style/index.js +6 -7
- package/lib/module/popover/style/index.js.map +1 -1
- package/lib/module/text/index.js +8 -3
- package/lib/module/text/index.js.map +1 -1
- package/lib/module/text/style/index.js +12 -14
- package/lib/module/text/style/index.js.map +1 -1
- package/lib/module/theme/context.js +33 -0
- package/lib/module/theme/context.js.map +1 -0
- package/lib/module/theme/tokens.js +3 -6
- package/lib/module/theme/tokens.js.map +1 -1
- package/lib/typescript/{jest.setup.d.ts.map → commonjs/jest.setup.d.ts.map} +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/action-sheet/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/action-sheet/style/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/action-sheet/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/avatar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/avatar/style/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/avatar/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/button/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/button/style/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/button/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/center/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/center/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/chip/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/chip/style/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/chip/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/column/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/column/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/divider/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/divider/style/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/divider/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useMergeStyles.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/index.d.ts +6 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/input/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/input/style/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/input/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/list-item/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/list-item/style/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/list-item/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/menu/index.d.ts +36 -0
- package/lib/typescript/commonjs/src/menu/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/menu/style/index.d.ts +32 -0
- package/lib/typescript/commonjs/src/menu/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/popover/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/popover/style/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/popover/style/index.d.ts.map +1 -0
- package/lib/typescript/{src/column → commonjs/src/row}/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/row/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/space/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/space/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/text/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/text/style/index.d.ts +5 -4
- package/lib/typescript/commonjs/src/text/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/context.d.ts +17 -0
- package/lib/typescript/commonjs/src/theme/context.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/theme/tokens.d.ts +4 -3
- package/lib/typescript/commonjs/src/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/touchable/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/touchable/style/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/wave-animation/index.d.ts.map +1 -0
- package/lib/typescript/module/jest.setup.d.ts +1 -0
- package/lib/typescript/module/jest.setup.d.ts.map +1 -0
- package/lib/typescript/module/src/action-sheet/index.d.ts +22 -0
- package/lib/typescript/module/src/action-sheet/index.d.ts.map +1 -0
- package/lib/typescript/module/src/action-sheet/style/index.d.ts +17 -0
- package/lib/typescript/module/src/action-sheet/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/avatar/index.d.ts +19 -0
- package/lib/typescript/module/src/avatar/index.d.ts.map +1 -0
- package/lib/typescript/module/src/avatar/style/index.d.ts +8 -0
- package/lib/typescript/module/src/avatar/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/button/index.d.ts +24 -0
- package/lib/typescript/module/src/button/index.d.ts.map +1 -0
- package/lib/typescript/module/src/button/style/index.d.ts +17 -0
- package/lib/typescript/module/src/button/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/center/index.d.ts +11 -0
- package/lib/typescript/module/src/center/index.d.ts.map +1 -0
- package/lib/typescript/module/src/center/style/index.d.ts +5 -0
- package/lib/typescript/module/src/center/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/chip/index.d.ts +22 -0
- package/lib/typescript/module/src/chip/index.d.ts.map +1 -0
- package/lib/typescript/module/src/chip/style/index.d.ts +11 -0
- package/lib/typescript/module/src/chip/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/column/index.d.ts +20 -0
- package/lib/typescript/module/src/column/index.d.ts.map +1 -0
- package/lib/typescript/module/src/column/style/index.d.ts +4 -0
- package/lib/typescript/module/src/column/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/divider/index.d.ts +13 -0
- package/lib/typescript/module/src/divider/index.d.ts.map +1 -0
- package/lib/typescript/module/src/divider/style/index.d.ts +10 -0
- package/lib/typescript/module/src/divider/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/index.d.ts +2 -0
- package/lib/typescript/module/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useMergeStyles.d.ts +13 -0
- package/lib/typescript/module/src/hooks/useMergeStyles.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +42 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/input/index.d.ts +29 -0
- package/lib/typescript/module/src/input/index.d.ts.map +1 -0
- package/lib/typescript/module/src/input/style/index.d.ts +9 -0
- package/lib/typescript/module/src/input/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/list-item/index.d.ts +25 -0
- package/lib/typescript/module/src/list-item/index.d.ts.map +1 -0
- package/lib/typescript/module/src/list-item/style/index.d.ts +18 -0
- package/lib/typescript/module/src/list-item/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/menu/index.d.ts +36 -0
- package/lib/typescript/module/src/menu/index.d.ts.map +1 -0
- package/lib/typescript/module/src/menu/style/index.d.ts +32 -0
- package/lib/typescript/module/src/menu/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/popover/index.d.ts +27 -0
- package/lib/typescript/module/src/popover/index.d.ts.map +1 -0
- package/lib/typescript/module/src/popover/style/index.d.ts +8 -0
- package/lib/typescript/module/src/popover/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/row/index.d.ts +22 -0
- package/lib/typescript/module/src/row/index.d.ts.map +1 -0
- package/lib/typescript/module/src/row/style/index.d.ts +8 -0
- package/lib/typescript/module/src/row/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/space/index.d.ts +15 -0
- package/lib/typescript/module/src/space/index.d.ts.map +1 -0
- package/lib/typescript/module/src/space/style/index.d.ts +7 -0
- package/lib/typescript/module/src/space/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/text/index.d.ts +18 -0
- package/lib/typescript/module/src/text/index.d.ts.map +1 -0
- package/lib/typescript/module/src/text/style/index.d.ts +36 -0
- package/lib/typescript/module/src/text/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/context.d.ts +17 -0
- package/lib/typescript/module/src/theme/context.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/tokens.d.ts +62 -0
- package/lib/typescript/module/src/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/module/src/touchable/index.d.ts +19 -0
- package/lib/typescript/module/src/touchable/index.d.ts.map +1 -0
- package/lib/typescript/module/src/touchable/style/index.d.ts +4 -0
- package/lib/typescript/module/src/touchable/style/index.d.ts.map +1 -0
- package/lib/typescript/module/src/wave-animation/index.d.ts +20 -0
- package/lib/typescript/module/src/wave-animation/index.d.ts.map +1 -0
- package/package.json +16 -5
- package/src/action-sheet/index.tsx +7 -3
- package/src/action-sheet/style/index.tsx +10 -8
- package/src/avatar/index.tsx +7 -3
- package/src/avatar/style/index.tsx +5 -5
- package/src/button/index.tsx +7 -3
- package/src/button/style/index.tsx +11 -9
- package/src/chip/index.tsx +16 -5
- package/src/chip/style/index.tsx +15 -13
- package/src/divider/index.tsx +18 -11
- package/src/divider/style/index.tsx +12 -10
- package/src/index.tsx +7 -4
- package/src/input/index.tsx +6 -4
- package/src/input/style/index.tsx +9 -9
- package/src/list-item/index.tsx +11 -6
- package/src/list-item/style/index.tsx +6 -6
- package/src/menu/index.tsx +96 -0
- package/src/menu/style/index.tsx +34 -0
- package/src/popover/index.tsx +7 -3
- package/src/popover/style/index.tsx +7 -7
- package/src/text/index.tsx +9 -3
- package/src/text/style/index.tsx +16 -12
- package/src/theme/context.tsx +38 -0
- package/src/theme/tokens.ts +5 -7
- package/lib/module/theme/config.js +0 -27
- package/lib/module/theme/config.js.map +0 -1
- package/lib/typescript/src/action-sheet/index.d.ts.map +0 -1
- package/lib/typescript/src/action-sheet/style/index.d.ts.map +0 -1
- package/lib/typescript/src/avatar/index.d.ts.map +0 -1
- package/lib/typescript/src/avatar/style/index.d.ts +0 -7
- package/lib/typescript/src/avatar/style/index.d.ts.map +0 -1
- package/lib/typescript/src/button/index.d.ts.map +0 -1
- package/lib/typescript/src/button/style/index.d.ts.map +0 -1
- package/lib/typescript/src/center/index.d.ts.map +0 -1
- package/lib/typescript/src/center/style/index.d.ts.map +0 -1
- package/lib/typescript/src/chip/index.d.ts.map +0 -1
- package/lib/typescript/src/chip/style/index.d.ts +0 -10
- package/lib/typescript/src/chip/style/index.d.ts.map +0 -1
- package/lib/typescript/src/column/style/index.d.ts.map +0 -1
- package/lib/typescript/src/divider/index.d.ts.map +0 -1
- package/lib/typescript/src/divider/style/index.d.ts +0 -9
- package/lib/typescript/src/divider/style/index.d.ts.map +0 -1
- package/lib/typescript/src/hooks/index.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useMergeStyles.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/input/index.d.ts.map +0 -1
- package/lib/typescript/src/input/style/index.d.ts.map +0 -1
- package/lib/typescript/src/list-item/index.d.ts.map +0 -1
- package/lib/typescript/src/list-item/style/index.d.ts.map +0 -1
- package/lib/typescript/src/popover/index.d.ts.map +0 -1
- package/lib/typescript/src/popover/style/index.d.ts +0 -7
- package/lib/typescript/src/popover/style/index.d.ts.map +0 -1
- package/lib/typescript/src/row/index.d.ts.map +0 -1
- package/lib/typescript/src/row/style/index.d.ts.map +0 -1
- package/lib/typescript/src/space/index.d.ts.map +0 -1
- package/lib/typescript/src/space/style/index.d.ts.map +0 -1
- package/lib/typescript/src/text/index.d.ts.map +0 -1
- package/lib/typescript/src/text/style/index.d.ts.map +0 -1
- package/lib/typescript/src/theme/config.d.ts +0 -18
- package/lib/typescript/src/theme/config.d.ts.map +0 -1
- package/lib/typescript/src/theme/tokens.d.ts.map +0 -1
- package/lib/typescript/src/touchable/index.d.ts.map +0 -1
- package/lib/typescript/src/touchable/style/index.d.ts.map +0 -1
- package/lib/typescript/src/wave-animation/index.d.ts.map +0 -1
- package/lib/typescript/tests/component/component.coverage.test.d.ts +0 -2
- package/lib/typescript/tests/component/component.coverage.test.d.ts.map +0 -1
- package/lib/typescript/tests/component/component.interaction.test.d.ts +0 -2
- package/lib/typescript/tests/component/component.interaction.test.d.ts.map +0 -1
- package/lib/typescript/tests/component/component.snapshot.test.d.ts +0 -2
- package/lib/typescript/tests/component/component.snapshot.test.d.ts.map +0 -1
- package/lib/typescript/tests/e2e/app.e2e.test.d.ts +0 -2
- package/lib/typescript/tests/e2e/app.e2e.test.d.ts.map +0 -1
- package/lib/typescript/tests/integration/ui.integration.test.d.ts +0 -2
- package/lib/typescript/tests/integration/ui.integration.test.d.ts.map +0 -1
- package/lib/typescript/tests/unit/mergeStyles.unit.test.d.ts +0 -2
- package/lib/typescript/tests/unit/mergeStyles.unit.test.d.ts.map +0 -1
- package/lib/typescript/tests/unit/public-api.unit.test.d.ts +0 -2
- package/lib/typescript/tests/unit/public-api.unit.test.d.ts.map +0 -1
- package/lib/typescript/tests/unit/theme-config.unit.test.d.ts +0 -2
- package/lib/typescript/tests/unit/theme-config.unit.test.d.ts.map +0 -1
- package/src/theme/config.ts +0 -26
- /package/lib/typescript/{jest.setup.d.ts → commonjs/jest.setup.d.ts} +0 -0
- /package/lib/typescript/{src → commonjs/src}/action-sheet/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/avatar/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/button/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/center/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/center/style/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/chip/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/column/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/column/style/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/divider/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/hooks/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/hooks/useMergeStyles.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/input/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/list-item/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/popover/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/row/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/row/style/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/space/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/space/style/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/text/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/touchable/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/touchable/style/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/wave-animation/index.d.ts +0 -0
- /package/lib/typescript/{package.json → module/package.json} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lineStyle = exports.createDefaultStyles = exports.contentWrapStyle = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const createDefaultStyles = t => ({
|
|
9
|
+
root: {
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
paddingHorizontal: 16,
|
|
13
|
+
paddingVertical: 14
|
|
14
|
+
},
|
|
15
|
+
content: {
|
|
16
|
+
fontSize: 15,
|
|
17
|
+
color: t.colorText,
|
|
18
|
+
flex: 1
|
|
19
|
+
},
|
|
20
|
+
description: {
|
|
21
|
+
fontSize: 12,
|
|
22
|
+
color: t.colorTextSecondary,
|
|
23
|
+
marginTop: 2
|
|
24
|
+
},
|
|
25
|
+
extra: {
|
|
26
|
+
color: t.colorTextSecondary,
|
|
27
|
+
fontSize: 14
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
exports.createDefaultStyles = createDefaultStyles;
|
|
31
|
+
const lineStyle = exports.lineStyle = _reactNative.StyleSheet.create({
|
|
32
|
+
s: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
alignItems: 'center'
|
|
36
|
+
}
|
|
37
|
+
}).s;
|
|
38
|
+
const contentWrapStyle = exports.contentWrapStyle = _reactNative.StyleSheet.create({
|
|
39
|
+
s: {
|
|
40
|
+
flex: 1
|
|
41
|
+
}
|
|
42
|
+
}).s;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","createDefaultStyles","t","root","flexDirection","alignItems","paddingHorizontal","paddingVertical","content","fontSize","color","colorText","flex","description","colorTextSecondary","marginTop","extra","exports","lineStyle","StyleSheet","create","s","contentWrapStyle"],"sourceRoot":"../../../../src","sources":["list-item/style/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAWO,MAAMC,mBAAmB,GAAIC,CAAS,KAA8B;EACzEC,IAAI,EAAE;IACJC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDC,OAAO,EAAE;IACPC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAER,CAAC,CAACS,SAAS;IAClBC,IAAI,EAAE;EACR,CAAC;EACDC,WAAW,EAAE;IACXJ,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAER,CAAC,CAACY,kBAAkB;IAC3BC,SAAS,EAAE;EACb,CAAC;EACDC,KAAK,EAAE;IACLN,KAAK,EAAER,CAAC,CAACY,kBAAkB;IAC3BL,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAACQ,OAAA,CAAAhB,mBAAA,GAAAA,mBAAA;AAEI,MAAMiB,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAGC,uBAAU,CAACC,MAAM,CAAC;EACzCC,CAAC,EAAE;IAAET,IAAI,EAAE,CAAC;IAAER,aAAa,EAAE,KAAK;IAAEC,UAAU,EAAE;EAAS;AAC3D,CAAC,CAAC,CAACgB,CAAC;AAEG,MAAMC,gBAAgB,GAAAL,OAAA,CAAAK,gBAAA,GAAGH,uBAAU,CAACC,MAAM,CAAC;EAChDC,CAAC,EAAE;IAAET,IAAI,EAAE;EAAE;AACf,CAAC,CAAC,CAACS,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _popover = _interopRequireDefault(require("../popover"));
|
|
10
|
+
var _context = require("../theme/context");
|
|
11
|
+
var _style = require("./style");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
/**
|
|
16
|
+
* Menu 独立组件
|
|
17
|
+
*
|
|
18
|
+
* 基于 Popover 实现的菜单列表,支持 danger、icon、disabled。
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const Menu = ({
|
|
22
|
+
visible,
|
|
23
|
+
onClose,
|
|
24
|
+
anchorLayout,
|
|
25
|
+
actions,
|
|
26
|
+
onAction,
|
|
27
|
+
placement = 'bottom',
|
|
28
|
+
width = 160,
|
|
29
|
+
style,
|
|
30
|
+
styles: semanticStyles,
|
|
31
|
+
testID
|
|
32
|
+
}) => {
|
|
33
|
+
const tokens = (0, _context.useTokens)();
|
|
34
|
+
const ds = (0, _react.useMemo)(() => (0, _style.createDefaultStyles)(tokens), [tokens]);
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_popover.default, {
|
|
36
|
+
visible: visible,
|
|
37
|
+
onClose: onClose,
|
|
38
|
+
anchorLayout: anchorLayout,
|
|
39
|
+
placement: placement,
|
|
40
|
+
width: width,
|
|
41
|
+
style: style,
|
|
42
|
+
testID: testID,
|
|
43
|
+
children: actions.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
45
|
+
style: [ds.item, semanticStyles?.item],
|
|
46
|
+
onPress: () => {
|
|
47
|
+
if (!action.disabled) {
|
|
48
|
+
onAction?.(action);
|
|
49
|
+
onClose();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
disabled: action.disabled,
|
|
53
|
+
testID: testID ? `${testID}-${action.key}` : undefined,
|
|
54
|
+
children: [action.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
55
|
+
style: [ds.itemIcon, semanticStyles?.itemIcon],
|
|
56
|
+
children: action.icon
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
58
|
+
style: [action.danger ? ds.itemLabelDanger : ds.itemLabel, semanticStyles?.itemLabel],
|
|
59
|
+
children: action.text
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
}, action.key))
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var _default = exports.default = Menu;
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_popover","_interopRequireDefault","_context","_style","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Menu","visible","onClose","anchorLayout","actions","onAction","placement","width","style","styles","semanticStyles","testID","tokens","useTokens","ds","useMemo","createDefaultStyles","jsx","children","map","action","Fragment","jsxs","Pressable","item","onPress","disabled","key","undefined","icon","View","itemIcon","Text","danger","itemLabelDanger","itemLabel","text","_default","exports"],"sourceRoot":"../../../src","sources":["menu/index.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createDefaultStyles = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const createDefaultStyles = t => ({
|
|
9
|
+
item: {
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
paddingVertical: 12,
|
|
13
|
+
paddingHorizontal: 16
|
|
14
|
+
},
|
|
15
|
+
itemLabel: {
|
|
16
|
+
fontSize: 14,
|
|
17
|
+
color: t.colorText
|
|
18
|
+
},
|
|
19
|
+
itemLabelDanger: {
|
|
20
|
+
fontSize: 14,
|
|
21
|
+
color: t.colorError
|
|
22
|
+
},
|
|
23
|
+
itemIcon: {
|
|
24
|
+
marginRight: 8
|
|
25
|
+
},
|
|
26
|
+
divider: {
|
|
27
|
+
height: _reactNative.StyleSheet.hairlineWidth,
|
|
28
|
+
backgroundColor: t.colorBorder
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
exports.createDefaultStyles = createDefaultStyles;
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","createDefaultStyles","t","item","flexDirection","alignItems","paddingVertical","paddingHorizontal","itemLabel","fontSize","color","colorText","itemLabelDanger","colorError","itemIcon","marginRight","divider","height","StyleSheet","hairlineWidth","backgroundColor","colorBorder","exports"],"sourceRoot":"../../../../src","sources":["menu/style/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAWO,MAAMC,mBAAmB,GAAIC,CAAS,KAAM;EACjDC,IAAI,EAAE;IACJC,aAAa,EAAE,KAAc;IAC7BC,UAAU,EAAE,QAAiB;IAC7BC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDC,SAAS,EAAE;IACTC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAER,CAAC,CAACS;EACX,CAAC;EACDC,eAAe,EAAE;IACfH,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAER,CAAC,CAACW;EACX,CAAC;EACDC,QAAQ,EAAE;IACRC,WAAW,EAAE;EACf,CAAC;EACDC,OAAO,EAAE;IACPC,MAAM,EAAEC,uBAAU,CAACC,aAAa;IAChCC,eAAe,EAAElB,CAAC,CAACmB;EACrB;AACF,CAAC,CAAC;AAACC,OAAA,CAAArB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _hooks = require("../hooks");
|
|
10
|
+
var _context = require("../theme/context");
|
|
11
|
+
var _style = require("./style");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
15
|
+
* Popover 基础组件
|
|
16
|
+
*
|
|
17
|
+
* 锚定定位下拉容器,仅做定位,内容由 children 传入。
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const GAP = 4;
|
|
21
|
+
const Popover = ({
|
|
22
|
+
visible,
|
|
23
|
+
onClose,
|
|
24
|
+
anchorLayout,
|
|
25
|
+
width = 180,
|
|
26
|
+
placement = 'bottom',
|
|
27
|
+
children,
|
|
28
|
+
style,
|
|
29
|
+
styles: semanticStyles,
|
|
30
|
+
testID
|
|
31
|
+
}) => {
|
|
32
|
+
const tokens = (0, _context.useTokens)();
|
|
33
|
+
const defaultStyles = (0, _react.useMemo)(() => (0, _style.createDefaultStyles)(tokens), [tokens]);
|
|
34
|
+
const s = (0, _react.useMemo)(() => (0, _hooks.mergeStyles)(defaultStyles, semanticStyles), [defaultStyles, semanticStyles]);
|
|
35
|
+
if (!visible) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const positionStyle = placement === 'bottom' ? {
|
|
39
|
+
top: anchorLayout.y + anchorLayout.height + GAP,
|
|
40
|
+
left: anchorLayout.x
|
|
41
|
+
} : {
|
|
42
|
+
bottom: anchorLayout.y - GAP,
|
|
43
|
+
left: anchorLayout.x
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
46
|
+
visible: visible,
|
|
47
|
+
transparent: true,
|
|
48
|
+
animationType: "fade",
|
|
49
|
+
onRequestClose: onClose,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback, {
|
|
51
|
+
onPress: onClose,
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
53
|
+
style: s.overlay,
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback, {
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
56
|
+
style: [s.content, positionStyle, {
|
|
57
|
+
width
|
|
58
|
+
}, style],
|
|
59
|
+
testID: testID,
|
|
60
|
+
children: children
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
var _default = exports.default = Popover;
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_hooks","_context","_style","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GAP","Popover","visible","onClose","anchorLayout","width","placement","children","style","styles","semanticStyles","testID","tokens","useTokens","defaultStyles","useMemo","createDefaultStyles","s","mergeStyles","positionStyle","top","y","height","left","x","bottom","jsx","Modal","transparent","animationType","onRequestClose","TouchableWithoutFeedback","onPress","View","overlay","content","_default","exports"],"sourceRoot":"../../../src","sources":["popover/index.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Popover
|
|
3
|
+
nav:
|
|
4
|
+
title: 组件
|
|
5
|
+
order: 1
|
|
6
|
+
group:
|
|
7
|
+
title: 基础
|
|
8
|
+
order: 2
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Popover 弹出定位容器
|
|
12
|
+
|
|
13
|
+
锚定在指定元素下方的弹出容器,用于下拉菜单等场景。
|
|
14
|
+
|
|
15
|
+
## 何时使用
|
|
16
|
+
|
|
17
|
+
- 下拉选择菜单
|
|
18
|
+
- 模型选择器
|
|
19
|
+
- 任何需要锚定定位的浮层
|
|
20
|
+
|
|
21
|
+
## 代码演示
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Popover } from '@unif/react-native-ui';
|
|
25
|
+
|
|
26
|
+
<Popover
|
|
27
|
+
visible={visible}
|
|
28
|
+
onClose={() => setVisible(false)}
|
|
29
|
+
anchorLayout={{ x: 100, y: 50, width: 120, height: 40 }}
|
|
30
|
+
width={180}
|
|
31
|
+
>
|
|
32
|
+
<View>
|
|
33
|
+
<Text>下拉内容</Text>
|
|
34
|
+
</View>
|
|
35
|
+
</Popover>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API
|
|
39
|
+
|
|
40
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
41
|
+
| ------------ | -------------- | --------------------------------------------- | ---------- |
|
|
42
|
+
| visible | 是否可见 | `boolean` | - |
|
|
43
|
+
| onClose | 关闭回调 | `() => void` | - |
|
|
44
|
+
| anchorLayout | 锚点布局 | `{ x, y, width, height }` | - |
|
|
45
|
+
| width | 内容宽度 | `number` | `180` |
|
|
46
|
+
| placement | 弹出方向 | `'bottom'` \| `'top'` | `'bottom'` |
|
|
47
|
+
| children | 弹出内容 | `ReactNode` | - |
|
|
48
|
+
| style | 内容容器样式 | `ViewStyle` | - |
|
|
49
|
+
| styles | 语义样式 | `PopoverSemanticStyles` | - |
|
|
50
|
+
| testID | 测试标识 | `string` | - |
|
|
51
|
+
|
|
52
|
+
## Semantic Styles
|
|
53
|
+
|
|
54
|
+
| Slot | 说明 |
|
|
55
|
+
| ------- | ------------ |
|
|
56
|
+
| overlay | 遮罩层 |
|
|
57
|
+
| content | 内容容器 |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createDefaultStyles = void 0;
|
|
7
|
+
const createDefaultStyles = t => ({
|
|
8
|
+
overlay: {
|
|
9
|
+
flex: 1
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
backgroundColor: t.colorBgElevated,
|
|
14
|
+
borderRadius: 12,
|
|
15
|
+
shadowColor: '#000',
|
|
16
|
+
shadowOffset: {
|
|
17
|
+
width: 0,
|
|
18
|
+
height: 4
|
|
19
|
+
},
|
|
20
|
+
shadowOpacity: 0.08,
|
|
21
|
+
shadowRadius: 8,
|
|
22
|
+
elevation: 4
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
exports.createDefaultStyles = createDefaultStyles;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDefaultStyles","t","overlay","flex","content","position","backgroundColor","colorBgElevated","borderRadius","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","exports"],"sourceRoot":"../../../../src","sources":["popover/style/index.tsx"],"mappings":";;;;;;AAQO,MAAMA,mBAAmB,GAAIC,CAAS,KAA6B;EACxEC,OAAO,EAAE;IACPC,IAAI,EAAE;EACR,CAAC;EACDC,OAAO,EAAE;IACPC,QAAQ,EAAE,UAAU;IACpBC,eAAe,EAAEL,CAAC,CAACM,eAAe;IAClCC,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAACC,OAAA,CAAAhB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _style = require("./style");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/**
|
|
13
|
+
* 水平布局容器
|
|
14
|
+
*
|
|
15
|
+
* 默认 flexDirection: 'row' + alignItems: 'center'。
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const Row = ({
|
|
19
|
+
align,
|
|
20
|
+
justify,
|
|
21
|
+
gap,
|
|
22
|
+
wrap,
|
|
23
|
+
style,
|
|
24
|
+
...rest
|
|
25
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
26
|
+
style: [_style.baseStyle, align != null && {
|
|
27
|
+
alignItems: align
|
|
28
|
+
}, justify != null && {
|
|
29
|
+
justifyContent: justify
|
|
30
|
+
}, gap != null && {
|
|
31
|
+
gap
|
|
32
|
+
}, wrap && _style.wrapStyle, style],
|
|
33
|
+
...rest
|
|
34
|
+
});
|
|
35
|
+
var _default = exports.default = Row;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_style","_jsxRuntime","e","__esModule","default","Row","align","justify","gap","wrap","style","rest","jsx","View","baseStyle","alignItems","justifyContent","wrapStyle","_default","exports"],"sourceRoot":"../../../src","sources":["row/index.tsx"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAA+C,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAT/C;AACA;AACA;AACA;AACA;;AAqBA,MAAMG,GAAuB,GAAGA,CAAC;EAC/BC,KAAK;EACLC,OAAO;EACPC,GAAG;EACHC,IAAI;EACJC,KAAK;EACL,GAAGC;AACK,CAAC,kBACT,IAAAV,WAAA,CAAAW,GAAA,EAACb,YAAA,CAAAc,IAAI;EACHH,KAAK,EAAE,CACLI,gBAAS,EACTR,KAAK,IAAI,IAAI,IAAI;IAAES,UAAU,EAAET;EAAM,CAAC,EACtCC,OAAO,IAAI,IAAI,IAAI;IAAES,cAAc,EAAET;EAAQ,CAAC,EAC9CC,GAAG,IAAI,IAAI,IAAI;IAAEA;EAAI,CAAC,EACtBC,IAAI,IAAIQ,gBAAS,EACjBP,KAAK,CACL;EAAA,GACEC;AAAI,CACT,CACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEaC,GAAG","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Row 水平布局
|
|
2
|
+
|
|
3
|
+
水平排列子元素,默认垂直居中。替代 `flexDirection: 'row' + alignItems: 'center'` 的手写样式。
|
|
4
|
+
|
|
5
|
+
## 何时使用
|
|
6
|
+
|
|
7
|
+
- 需要水平排列元素时
|
|
8
|
+
- 替代 `<View style={{flexDirection: 'row', alignItems: 'center'}}>` 的场景
|
|
9
|
+
|
|
10
|
+
## 代码演示
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
// 基础用法 — 默认 alignItems: 'center'
|
|
14
|
+
<Row>
|
|
15
|
+
<Icon name="star" />
|
|
16
|
+
<Text>标题</Text>
|
|
17
|
+
</Row>
|
|
18
|
+
|
|
19
|
+
// 两端对齐
|
|
20
|
+
<Row justify="space-between">
|
|
21
|
+
<Text>左侧</Text>
|
|
22
|
+
<Text>右侧</Text>
|
|
23
|
+
</Row>
|
|
24
|
+
|
|
25
|
+
// 间距
|
|
26
|
+
<Row gap={10}>
|
|
27
|
+
<Button block onPress={...}>修改</Button>
|
|
28
|
+
<Button block onPress={...}>确认</Button>
|
|
29
|
+
</Row>
|
|
30
|
+
|
|
31
|
+
// 换行
|
|
32
|
+
<Row wrap gap={8}>
|
|
33
|
+
{tags.map(tag => <Tag key={tag}>{tag}</Tag>)}
|
|
34
|
+
</Row>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## API
|
|
38
|
+
|
|
39
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
40
|
+
|------|------|------|--------|
|
|
41
|
+
| align | alignItems | `ViewStyle['alignItems']` | `'center'` |
|
|
42
|
+
| justify | justifyContent | `ViewStyle['justifyContent']` | - |
|
|
43
|
+
| gap | 子元素间距 | `number` | - |
|
|
44
|
+
| wrap | 是否换行 | `boolean` | `false` |
|
|
45
|
+
|
|
46
|
+
> 继承所有 RN `ViewProps`(`style`、`testID` 等)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.wrapStyle = exports.baseStyle = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const baseStyle = exports.baseStyle = _reactNative.StyleSheet.create({
|
|
9
|
+
row: {
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
alignItems: 'center'
|
|
12
|
+
}
|
|
13
|
+
}).row;
|
|
14
|
+
const wrapStyle = exports.wrapStyle = _reactNative.StyleSheet.create({
|
|
15
|
+
wrap: {
|
|
16
|
+
flexWrap: 'wrap'
|
|
17
|
+
}
|
|
18
|
+
}).wrap;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","baseStyle","exports","StyleSheet","create","row","flexDirection","alignItems","wrapStyle","wrap","flexWrap"],"sourceRoot":"../../../../src","sources":["row/style/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,uBAAU,CAACC,MAAM,CAAC;EACzCC,GAAG,EAAE;IACHC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC,CAACF,GAAG;AAEC,MAAMG,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAGL,uBAAU,CAACC,MAAM,CAAC;EACzCK,IAAI,EAAE;IACJC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC,CAACD,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _style = require("./style");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/**
|
|
13
|
+
* 间距占位组件
|
|
14
|
+
*
|
|
15
|
+
* 在两个元素之间插入固定间距。
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const Space = ({
|
|
19
|
+
size = 12,
|
|
20
|
+
direction = 'vertical'
|
|
21
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
22
|
+
style: direction === 'vertical' ? (0, _style.verticalStyle)(size) : (0, _style.horizontalStyle)(size)
|
|
23
|
+
});
|
|
24
|
+
var _default = exports.default = Space;
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_style","_jsxRuntime","e","__esModule","default","Space","size","direction","jsx","View","style","verticalStyle","horizontalStyle","_default","exports"],"sourceRoot":"../../../src","sources":["space/index.tsx"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAyD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AARzD;AACA;AACA;AACA;AACA;;AAaA,MAAMG,KAA2B,GAAGA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC,SAAS,GAAG;AAAW,CAAC,kBACxE,IAAAN,WAAA,CAAAO,GAAA,EAACT,YAAA,CAAAU,IAAI;EACHC,KAAK,EACHH,SAAS,KAAK,UAAU,GACpB,IAAAI,oBAAa,EAACL,IAAI,CAAC,GACnB,IAAAM,sBAAe,EAACN,IAAI;AACzB,CACF,CACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEaC,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Space 间距占位
|
|
2
|
+
|
|
3
|
+
在两个元素之间插入固定间距。替代 `<View style={{height: 12}} />` 或 `marginTop` 手写。
|
|
4
|
+
|
|
5
|
+
## 何时使用
|
|
6
|
+
|
|
7
|
+
- 两个块级元素之间需要固定间距
|
|
8
|
+
- 不想在元素上写 margin 时
|
|
9
|
+
|
|
10
|
+
## 代码演示
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
// 垂直间距(默认)
|
|
14
|
+
<Text variant="title">标题</Text>
|
|
15
|
+
<Space size={16} />
|
|
16
|
+
<Text variant="body">正文内容</Text>
|
|
17
|
+
|
|
18
|
+
// 水平间距
|
|
19
|
+
<Row>
|
|
20
|
+
<Icon name="star" />
|
|
21
|
+
<Space size={8} direction="horizontal" />
|
|
22
|
+
<Text>收藏</Text>
|
|
23
|
+
</Row>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
29
|
+
|------|------|------|--------|
|
|
30
|
+
| size | 间距大小(px) | `number` | `12` |
|
|
31
|
+
| direction | 方向 | `'vertical'` \| `'horizontal'` | `'vertical'` |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.verticalStyle = exports.horizontalStyle = void 0;
|
|
7
|
+
const verticalStyle = size => ({
|
|
8
|
+
height: size
|
|
9
|
+
});
|
|
10
|
+
exports.verticalStyle = verticalStyle;
|
|
11
|
+
const horizontalStyle = size => ({
|
|
12
|
+
width: size
|
|
13
|
+
});
|
|
14
|
+
exports.horizontalStyle = horizontalStyle;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["verticalStyle","size","height","exports","horizontalStyle","width"],"sourceRoot":"../../../../src","sources":["space/style/index.tsx"],"mappings":";;;;;;AAAO,MAAMA,aAAa,GAAIC,IAAY,KAAM;EAAEC,MAAM,EAAED;AAAK,CAAC,CAAC;AAACE,OAAA,CAAAH,aAAA,GAAAA,aAAA;AAE3D,MAAMI,eAAe,GAAIH,IAAY,KAAM;EAAEI,KAAK,EAAEJ;AAAK,CAAC,CAAC;AAACE,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _context = require("../theme/context");
|
|
10
|
+
var _style = require("./style");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
14
|
+
* 语义化文字组件
|
|
15
|
+
*
|
|
16
|
+
* variant 驱动样式,支持嵌套 Text。
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const Text = ({
|
|
20
|
+
variant = 'body',
|
|
21
|
+
secondary,
|
|
22
|
+
primary,
|
|
23
|
+
color,
|
|
24
|
+
weight,
|
|
25
|
+
style,
|
|
26
|
+
...rest
|
|
27
|
+
}) => {
|
|
28
|
+
const tokens = (0, _context.useTokens)();
|
|
29
|
+
const variantMap = (0, _react.useMemo)(() => (0, _style.createVariantMap)(tokens), [tokens]);
|
|
30
|
+
const secondaryStyle = (0, _react.useMemo)(() => (0, _style.createSecondaryStyle)(tokens), [tokens]);
|
|
31
|
+
const primaryStyle = (0, _react.useMemo)(() => (0, _style.createPrimaryStyle)(tokens), [tokens]);
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
33
|
+
style: [variantMap[variant], secondary && secondaryStyle, primary && primaryStyle, color != null && {
|
|
34
|
+
color
|
|
35
|
+
}, weight != null && _style.WEIGHT_MAP[weight], style],
|
|
36
|
+
...rest
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var _default = exports.default = Text;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_context","_style","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Text","variant","secondary","primary","color","weight","style","rest","tokens","useTokens","variantMap","useMemo","createVariantMap","secondaryStyle","createSecondaryStyle","primaryStyle","createPrimaryStyle","jsx","WEIGHT_MAP","_default","exports"],"sourceRoot":"../../../src","sources":["text/index.tsx"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAAiG,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAXjG;AACA;AACA;AACA;AACA;;AAiBA,MAAMkB,IAAyB,GAAGA,CAAC;EACjCC,OAAO,GAAG,MAAM;EAChBC,SAAS;EACTC,OAAO;EACPC,KAAK;EACLC,MAAM;EACNC,KAAK;EACL,GAAGC;AACM,CAAC,KAAK;EACf,MAAMC,MAAM,GAAG,IAAAC,kBAAS,EAAC,CAAC;EAC1B,MAAMC,UAAU,GAAG,IAAAC,cAAO,EAAC,MAAM,IAAAC,uBAAgB,EAACJ,MAAM,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACpE,MAAMK,cAAc,GAAG,IAAAF,cAAO,EAAC,MAAM,IAAAG,2BAAoB,EAACN,MAAM,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAC5E,MAAMO,YAAY,GAAG,IAAAJ,cAAO,EAAC,MAAM,IAAAK,yBAAkB,EAACR,MAAM,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAExE,oBACE,IAAA5B,WAAA,CAAAqC,GAAA,EAACxC,YAAA,CAAAuB,IAAM;IACLM,KAAK,EAAE,CACLI,UAAU,CAACT,OAAO,CAAC,EACnBC,SAAS,IAAIW,cAAc,EAC3BV,OAAO,IAAIY,YAAY,EACvBX,KAAK,IAAI,IAAI,IAAI;MAAEA;IAAM,CAAC,EAC1BC,MAAM,IAAI,IAAI,IAAIa,iBAAU,CAACb,MAAM,CAAC,EACpCC,KAAK,CACL;IAAA,GACEC;EAAI,CACT,CAAC;AAEN,CAAC;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAA7B,OAAA,GAEaS,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Text 语义化文字
|
|
2
|
+
|
|
3
|
+
通过 `variant` 驱动排版样式。继承 RN `Text`,支持嵌套。
|
|
4
|
+
|
|
5
|
+
## 何时使用
|
|
6
|
+
|
|
7
|
+
- 替代直接写 `fontSize` + `fontWeight` + `color` 的 `<Text>` 组合
|
|
8
|
+
- 需要统一排版规范时
|
|
9
|
+
|
|
10
|
+
## 代码演示
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
// 基础用法
|
|
14
|
+
<Text variant="title">标题文字</Text>
|
|
15
|
+
<Text variant="caption" secondary>辅助说明</Text>
|
|
16
|
+
|
|
17
|
+
// 颜色与字重
|
|
18
|
+
<Text variant="caption" primary weight="bold">¥88.00</Text>
|
|
19
|
+
|
|
20
|
+
// 嵌套 Text
|
|
21
|
+
<Text variant="body" numberOfLines={1}>
|
|
22
|
+
<Text primary weight="semibold">新 </Text>
|
|
23
|
+
{productName}
|
|
24
|
+
</Text>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
30
|
+
|------|------|------|--------|
|
|
31
|
+
| variant | 排版变体 | `'title'` \| `'heading'` \| `'body'` \| `'caption'` \| `'micro'` | `'body'` |
|
|
32
|
+
| secondary | 次要色(colorTextSecondary) | `boolean` | `false` |
|
|
33
|
+
| primary | 主题色(colorPrimary) | `boolean` | `false` |
|
|
34
|
+
| color | 自定义颜色 | `string` | - |
|
|
35
|
+
| weight | 字重 | `'medium'` \| `'semibold'` \| `'bold'` | - |
|
|
36
|
+
|
|
37
|
+
> 继承所有 RN `TextProps`(`numberOfLines`、`ellipsizeMode`、`onPress`、`style` 等)
|
|
38
|
+
|
|
39
|
+
## Variant 规格
|
|
40
|
+
|
|
41
|
+
| variant | fontSize | lineHeight | fontWeight | 场景 |
|
|
42
|
+
|---------|----------|------------|------------|------|
|
|
43
|
+
| title | 20 | 26 | 600 | 页面标题、问候语 |
|
|
44
|
+
| heading | 16 | 22 | 600 | 弹窗标题、区块标题 |
|
|
45
|
+
| body | 15 | 22 | 正常 | 默认正文 |
|
|
46
|
+
| caption | 13 | 18 | 正常 | 信息行、标签 |
|
|
47
|
+
| micro | 12 | 18 | 正常 | 地址、规格、描述 |
|
|
48
|
+
|
|
49
|
+
## Weight 映射
|
|
50
|
+
|
|
51
|
+
| weight | fontWeight | 场景 |
|
|
52
|
+
|--------|----------|------|
|
|
53
|
+
| medium | 500 | 产品名、模型名 |
|
|
54
|
+
| semibold | 600 | 标题、按钮文字、客户名 |
|
|
55
|
+
| bold | 700 | 价格金额 |
|
|
56
|
+
|
|
57
|
+
## 样式优先级
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
VARIANT_MAP → secondary/primary → color → weight → style
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
后传入的属性覆盖先传入的,`style` prop 拥有最高优先级。
|