How to create normal (direction) widget?
Actually it is not a separate widget as I thought but argument for float vector property (subtype='DIRECTION'). In general it can be done in next way:


    vector: bpy.props.FloatVectorProperty(default=(0.0, 0.0, 1.0), subtype='DIRECTION')

    def draw_buttons(self, context, layout):
        layout.prop(self, 'vector')



Test script.

import bpy
from bpy.props import FloatVectorProperty

context = bpy.context

bpy.types.Scene.normal = FloatVectorProperty(subtype='DIRECTION')

def draw(self, context):
    scene = context.scene
    self.layout.prop(scene, "normal")

bpy.types.SCENE_PT_scene.prepend(draw)

context.window_manager.popover(draw)