panelui-native 0.115.0 → 1.0.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.
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/ai-input/index.js.map +1 -1
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/animated-badge/index.js +1 -2
- package/lib/module/components/animated-badge/index.js.map +1 -1
- package/lib/module/components/attachment/index.js.map +1 -1
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/avatar-cropper/index.js.map +1 -1
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js.map +1 -1
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/button-group/index.js.map +1 -1
- package/lib/module/components/calendar/index.js.map +1 -1
- package/lib/module/components/card/index.js.map +1 -1
- package/lib/module/components/checkbox/index.js +9 -3
- package/lib/module/components/checkbox/index.js.map +1 -1
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/collapsible/index.js.map +1 -1
- package/lib/module/components/color-picker/index.js +13 -5
- package/lib/module/components/color-picker/index.js.map +1 -1
- package/lib/module/components/combobox/index.js +1 -2
- package/lib/module/components/combobox/index.js.map +1 -1
- package/lib/module/components/context-menu/index.js +1 -2
- package/lib/module/components/context-menu/index.js.map +1 -1
- package/lib/module/components/countdown/index.js.map +1 -1
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/fab/index.js +2 -1
- package/lib/module/components/fab/index.js.map +1 -1
- package/lib/module/components/feedback/index.js +1 -2
- package/lib/module/components/feedback/index.js.map +1 -1
- package/lib/module/components/field/index.js.map +1 -1
- package/lib/module/components/file-upload/index.js.map +1 -1
- package/lib/module/components/flip-card/index.js +1 -2
- package/lib/module/components/flip-card/index.js.map +1 -1
- package/lib/module/components/frame/index.js +1 -2
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/grid-item/index.js.map +1 -1
- package/lib/module/components/heatmap-chart/index.js +1 -2
- package/lib/module/components/heatmap-chart/index.js.map +1 -1
- package/lib/module/components/image-viewer/index.js +1 -2
- package/lib/module/components/image-viewer/index.js.map +1 -1
- package/lib/module/components/input/index.js +1 -2
- package/lib/module/components/input/index.js.map +1 -1
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js.map +1 -1
- package/lib/module/components/kpi/index.js +1 -2
- package/lib/module/components/kpi/index.js.map +1 -1
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/leaderboard/index.js.map +1 -1
- package/lib/module/components/live-line-chart/index.js +1 -1
- package/lib/module/components/live-line-chart/index.js.map +1 -1
- package/lib/module/components/map/native-style.js +38 -7
- package/lib/module/components/map/native-style.js.map +1 -1
- package/lib/module/components/markdown-editor/index.js.map +1 -1
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/marquee/index.js +2 -1
- package/lib/module/components/marquee/index.js.map +1 -1
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +2 -3
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/meter/index.js.map +1 -1
- package/lib/module/components/number-input/index.js +1 -2
- package/lib/module/components/number-input/index.js.map +1 -1
- package/lib/module/components/otp-input/index.js +1 -2
- package/lib/module/components/otp-input/index.js.map +1 -1
- package/lib/module/components/page-header/index.js +1 -2
- package/lib/module/components/page-header/index.js.map +1 -1
- package/lib/module/components/pagination/index.js.map +1 -1
- package/lib/module/components/panelside/index.js +8 -7
- package/lib/module/components/panelside/index.js.map +1 -1
- package/lib/module/components/planner/index.js +1 -2
- package/lib/module/components/planner/index.js.map +1 -1
- package/lib/module/components/popover/index.js +1 -2
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/post/index.js +1 -2
- package/lib/module/components/post/index.js.map +1 -1
- package/lib/module/components/progress/index.js.map +1 -1
- package/lib/module/components/progress-button/index.js +1 -2
- package/lib/module/components/progress-button/index.js.map +1 -1
- package/lib/module/components/qr-code/index.js.map +1 -1
- package/lib/module/components/questionnaire/index.js +1 -2
- package/lib/module/components/questionnaire/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/rating/index.js +1 -2
- package/lib/module/components/rating/index.js.map +1 -1
- package/lib/module/components/scroll-header/index.js +5 -4
- package/lib/module/components/scroll-header/index.js.map +1 -1
- package/lib/module/components/search-bar/index.js +1 -2
- package/lib/module/components/search-bar/index.js.map +1 -1
- package/lib/module/components/section-progress/index.js +3 -2
- package/lib/module/components/section-progress/index.js.map +1 -1
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/separator/index.js.map +1 -1
- package/lib/module/components/shimmer/index.js +8 -1
- package/lib/module/components/shimmer/index.js.map +1 -1
- package/lib/module/components/signature/index.js.map +1 -1
- package/lib/module/components/sketch/index.js.map +1 -1
- package/lib/module/components/slide-button/index.js +1 -2
- package/lib/module/components/slide-button/index.js.map +1 -1
- package/lib/module/components/slider/index.js +1 -2
- package/lib/module/components/slider/index.js.map +1 -1
- package/lib/module/components/sortable/index.js +6 -7
- package/lib/module/components/sortable/index.js.map +1 -1
- package/lib/module/components/splitter/index.js +3 -2
- package/lib/module/components/splitter/index.js.map +1 -1
- package/lib/module/components/stack-card/index.js +3 -2
- package/lib/module/components/stack-card/index.js.map +1 -1
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/support/index.js.map +1 -1
- package/lib/module/components/surface/index.js.map +1 -1
- package/lib/module/components/swipe/index.js.map +1 -1
- package/lib/module/components/switch/index.js.map +1 -1
- package/lib/module/components/table/index.js +1 -2
- package/lib/module/components/table/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +2 -1
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/tag-input/index.js +1 -2
- package/lib/module/components/tag-input/index.js.map +1 -1
- package/lib/module/components/text-animation/index.js +2 -1
- package/lib/module/components/text-animation/index.js.map +1 -1
- package/lib/module/components/textarea/index.js +1 -2
- package/lib/module/components/textarea/index.js.map +1 -1
- package/lib/module/components/time-picker/index.js.map +1 -1
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/components/toast/index.js +1 -0
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/components/tooltip/index.js +1 -2
- package/lib/module/components/tooltip/index.js.map +1 -1
- package/lib/module/components/tour/index.js.map +1 -1
- package/lib/module/components/tree/index.js +2 -1
- package/lib/module/components/tree/index.js.map +1 -1
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/hooks/use-keyboard-avoidance.js +7 -1
- package/lib/module/hooks/use-keyboard-avoidance.js.map +1 -1
- package/lib/module/hooks/use-reveal-progress.js.map +1 -1
- package/lib/module/hooks/use-scroll-sections.js.map +1 -1
- package/lib/module/icons/index.js +22 -1
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/animated-pressable.js.map +1 -1
- package/lib/module/primitives/chart-accessibility.js +9 -1
- package/lib/module/primitives/chart-accessibility.js.map +1 -1
- package/lib/module/primitives/glass.js.map +1 -1
- package/lib/module/primitives/refs.js +4 -0
- package/lib/module/primitives/refs.js.map +1 -0
- package/lib/module/primitives/scroll-progress.js.map +1 -1
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/primitives/web-deps.js +17 -0
- package/lib/module/primitives/web-deps.js.map +1 -0
- package/lib/module/uniwind-env.d.ts +1 -0
- package/lib/typescript/src/components/accordion/index.d.ts +8 -7
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ai-input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts +9 -8
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/animated-badge/index.d.ts +5 -4
- package/lib/typescript/src/components/animated-badge/index.d.ts.map +1 -1
- package/lib/typescript/src/components/attachment/index.d.ts +10 -9
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/avatar/index.d.ts +7 -6
- package/lib/typescript/src/components/avatar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/avatar-cropper/index.d.ts.map +1 -1
- package/lib/typescript/src/components/badge/index.d.ts +5 -4
- package/lib/typescript/src/components/badge/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts +9 -8
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +4 -4
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button-group/index.d.ts +5 -4
- package/lib/typescript/src/components/button-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/card/index.d.ts +16 -15
- package/lib/typescript/src/components/card/index.d.ts.map +1 -1
- package/lib/typescript/src/components/checkbox/index.d.ts +23 -7
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/index.d.ts +4 -4
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/collapsible/index.d.ts +7 -6
- package/lib/typescript/src/components/collapsible/index.d.ts.map +1 -1
- package/lib/typescript/src/components/color-picker/index.d.ts +13 -13
- package/lib/typescript/src/components/color-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/combobox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/src/components/countdown/index.d.ts +5 -4
- package/lib/typescript/src/components/countdown/index.d.ts.map +1 -1
- package/lib/typescript/src/components/dialog/index.d.ts +11 -10
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts +12 -11
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/fab/index.d.ts +7 -6
- package/lib/typescript/src/components/fab/index.d.ts.map +1 -1
- package/lib/typescript/src/components/feedback/index.d.ts +6 -5
- package/lib/typescript/src/components/feedback/index.d.ts.map +1 -1
- package/lib/typescript/src/components/field/index.d.ts +12 -11
- package/lib/typescript/src/components/field/index.d.ts.map +1 -1
- package/lib/typescript/src/components/file-upload/index.d.ts +5 -4
- package/lib/typescript/src/components/file-upload/index.d.ts.map +1 -1
- package/lib/typescript/src/components/flip-card/index.d.ts +5 -4
- package/lib/typescript/src/components/flip-card/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts +14 -13
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/grid-item/index.d.ts +30 -29
- package/lib/typescript/src/components/grid-item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts +3 -2
- package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/image-viewer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input/index.d.ts +5 -4
- package/lib/typescript/src/components/input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts +6 -5
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts +34 -33
- package/lib/typescript/src/components/item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/kpi/index.d.ts +6 -5
- package/lib/typescript/src/components/kpi/index.d.ts.map +1 -1
- package/lib/typescript/src/components/label/index.d.ts +4 -3
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/leaderboard/index.d.ts +3 -2
- package/lib/typescript/src/components/leaderboard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/live-line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/native-style.d.ts.map +1 -1
- package/lib/typescript/src/components/markdown-editor/index.d.ts +6 -5
- package/lib/typescript/src/components/markdown-editor/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marker/index.d.ts +7 -6
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marquee/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message/index.d.ts +13 -12
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/meter/index.d.ts +5 -4
- package/lib/typescript/src/components/meter/index.d.ts.map +1 -1
- package/lib/typescript/src/components/number-input/index.d.ts +5 -4
- package/lib/typescript/src/components/number-input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/otp-input/index.d.ts +5 -4
- package/lib/typescript/src/components/otp-input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/page-header/index.d.ts +15 -14
- package/lib/typescript/src/components/page-header/index.d.ts.map +1 -1
- package/lib/typescript/src/components/pagination/index.d.ts +9 -8
- package/lib/typescript/src/components/pagination/index.d.ts.map +1 -1
- package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
- package/lib/typescript/src/components/planner/index.d.ts +3 -2
- package/lib/typescript/src/components/planner/index.d.ts.map +1 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/post/index.d.ts +15 -14
- package/lib/typescript/src/components/post/index.d.ts.map +1 -1
- package/lib/typescript/src/components/progress/index.d.ts +5 -4
- package/lib/typescript/src/components/progress/index.d.ts.map +1 -1
- package/lib/typescript/src/components/progress-button/index.d.ts +5 -4
- package/lib/typescript/src/components/progress-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/qr-code/index.d.ts +11 -10
- package/lib/typescript/src/components/qr-code/index.d.ts.map +1 -1
- package/lib/typescript/src/components/questionnaire/index.d.ts +4 -3
- package/lib/typescript/src/components/questionnaire/index.d.ts.map +1 -1
- package/lib/typescript/src/components/radio-group/index.d.ts +6 -5
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/rating/index.d.ts +4 -4
- package/lib/typescript/src/components/rating/index.d.ts.map +1 -1
- package/lib/typescript/src/components/scroll-header/index.d.ts +11 -10
- package/lib/typescript/src/components/scroll-header/index.d.ts.map +1 -1
- package/lib/typescript/src/components/search-bar/index.d.ts +5 -4
- package/lib/typescript/src/components/search-bar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/section-progress/index.d.ts.map +1 -1
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/selection-mode/index.d.ts +2 -2
- package/lib/typescript/src/components/selection-mode/index.d.ts.map +1 -1
- package/lib/typescript/src/components/separator/index.d.ts +17 -16
- package/lib/typescript/src/components/separator/index.d.ts.map +1 -1
- package/lib/typescript/src/components/shimmer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/signature/index.d.ts +2 -2
- package/lib/typescript/src/components/signature/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sketch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/slide-button/index.d.ts +5 -4
- package/lib/typescript/src/components/slide-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/index.d.ts +4 -4
- package/lib/typescript/src/components/slider/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sortable/index.d.ts.map +1 -1
- package/lib/typescript/src/components/spinner/index.d.ts +11 -11
- package/lib/typescript/src/components/spinner/index.d.ts.map +1 -1
- package/lib/typescript/src/components/splitter/index.d.ts.map +1 -1
- package/lib/typescript/src/components/stack-card/index.d.ts +11 -10
- package/lib/typescript/src/components/stack-card/index.d.ts.map +1 -1
- package/lib/typescript/src/components/steps/index.d.ts +9 -8
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/support/index.d.ts +22 -21
- package/lib/typescript/src/components/support/index.d.ts.map +1 -1
- package/lib/typescript/src/components/surface/index.d.ts +35 -34
- package/lib/typescript/src/components/surface/index.d.ts.map +1 -1
- package/lib/typescript/src/components/swipe/index.d.ts +8 -7
- package/lib/typescript/src/components/swipe/index.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/index.d.ts +5 -4
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/table/index.d.ts +14 -13
- package/lib/typescript/src/components/table/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tag-input/index.d.ts +5 -4
- package/lib/typescript/src/components/tag-input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/text-animation/index.d.ts.map +1 -1
- package/lib/typescript/src/components/textarea/index.d.ts +5 -4
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -1
- package/lib/typescript/src/components/time-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/timeline/index.d.ts +18 -17
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts +2 -2
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts +6 -5
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tour/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tree/index.d.ts +10 -9
- package/lib/typescript/src/components/tree/index.d.ts.map +1 -1
- package/lib/typescript/src/components/typography/index.d.ts +101 -100
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts +3 -2
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-reveal-progress.d.ts +2 -2
- package/lib/typescript/src/hooks/use-reveal-progress.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-scroll-sections.d.ts +3 -2
- package/lib/typescript/src/hooks/use-scroll-sections.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +40 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/animated-pressable.d.ts +3 -2
- package/lib/typescript/src/primitives/animated-pressable.d.ts.map +1 -1
- package/lib/typescript/src/primitives/chart-accessibility.d.ts +5 -6
- package/lib/typescript/src/primitives/chart-accessibility.d.ts.map +1 -1
- package/lib/typescript/src/primitives/glass.d.ts +3 -2
- package/lib/typescript/src/primitives/glass.d.ts.map +1 -1
- package/lib/typescript/src/primitives/refs.d.ts +25 -0
- package/lib/typescript/src/primitives/refs.d.ts.map +1 -0
- package/lib/typescript/src/primitives/scroll-progress.d.ts.map +1 -1
- package/lib/typescript/src/primitives/text.d.ts +41 -40
- package/lib/typescript/src/primitives/text.d.ts.map +1 -1
- package/lib/typescript/src/primitives/web-deps.d.ts +11 -0
- package/lib/typescript/src/primitives/web-deps.d.ts.map +1 -0
- package/package.json +6 -6
- package/src/components/accordion/index.tsx +7 -6
- package/src/components/ai-input/index.tsx +2 -1
- package/src/components/alert/index.tsx +6 -5
- package/src/components/animated-badge/index.tsx +2 -1
- package/src/components/attachment/index.tsx +9 -8
- package/src/components/avatar/index.tsx +4 -3
- package/src/components/avatar-cropper/index.tsx +2 -1
- package/src/components/badge/index.tsx +2 -1
- package/src/components/breadcrumb/index.tsx +8 -7
- package/src/components/button/index.tsx +2 -1
- package/src/components/button-group/index.tsx +2 -1
- package/src/components/calendar/index.tsx +2 -1
- package/src/components/card/index.tsx +7 -6
- package/src/components/checkbox/index.tsx +39 -8
- package/src/components/chip/index.tsx +2 -1
- package/src/components/collapsible/index.tsx +6 -5
- package/src/components/color-picker/index.tsx +29 -15
- package/src/components/combobox/index.tsx +3 -2
- package/src/components/context-menu/index.tsx +2 -1
- package/src/components/countdown/index.tsx +2 -1
- package/src/components/dialog/index.tsx +3 -2
- package/src/components/empty-state/index.tsx +7 -6
- package/src/components/fab/index.tsx +6 -4
- package/src/components/feedback/index.tsx +5 -4
- package/src/components/field/index.tsx +11 -10
- package/src/components/file-upload/index.tsx +4 -3
- package/src/components/flip-card/index.tsx +4 -3
- package/src/components/frame/index.tsx +13 -12
- package/src/components/grid-item/index.tsx +10 -9
- package/src/components/heatmap-chart/index.tsx +2 -1
- package/src/components/image-viewer/index.tsx +2 -1
- package/src/components/input/index.tsx +2 -1
- package/src/components/input-group/index.tsx +4 -3
- package/src/components/item/index.tsx +11 -10
- package/src/components/kpi/index.tsx +3 -2
- package/src/components/label/index.tsx +3 -2
- package/src/components/leaderboard/index.tsx +2 -1
- package/src/components/live-line-chart/index.tsx +2 -1
- package/src/components/map/native-style.ts +31 -4
- package/src/components/markdown-editor/index.tsx +11 -11
- package/src/components/marker/index.tsx +4 -3
- package/src/components/marquee/index.tsx +2 -1
- package/src/components/message/index.tsx +10 -9
- package/src/components/message-scroller/index.tsx +4 -4
- package/src/components/meter/index.tsx +2 -1
- package/src/components/number-input/index.tsx +2 -1
- package/src/components/otp-input/index.tsx +4 -3
- package/src/components/page-header/index.tsx +12 -11
- package/src/components/pagination/index.tsx +6 -5
- package/src/components/panelside/index.tsx +8 -7
- package/src/components/planner/index.tsx +7 -7
- package/src/components/popover/index.tsx +2 -1
- package/src/components/post/index.tsx +12 -11
- package/src/components/progress/index.tsx +2 -1
- package/src/components/progress-button/index.tsx +2 -1
- package/src/components/qr-code/index.tsx +8 -7
- package/src/components/questionnaire/index.tsx +4 -3
- package/src/components/radio-group/index.tsx +3 -2
- package/src/components/rating/index.tsx +2 -1
- package/src/components/scroll-header/index.tsx +13 -11
- package/src/components/search-bar/index.tsx +7 -8
- package/src/components/section-progress/index.tsx +3 -2
- package/src/components/select/index.tsx +2 -1
- package/src/components/separator/index.tsx +2 -1
- package/src/components/shimmer/index.tsx +11 -2
- package/src/components/signature/index.tsx +2 -1
- package/src/components/sketch/index.tsx +2 -1
- package/src/components/slide-button/index.tsx +2 -1
- package/src/components/slider/index.tsx +2 -1
- package/src/components/sortable/index.tsx +5 -7
- package/src/components/splitter/index.tsx +3 -2
- package/src/components/stack-card/index.tsx +9 -7
- package/src/components/steps/index.tsx +8 -7
- package/src/components/support/index.tsx +17 -16
- package/src/components/surface/index.tsx +2 -1
- package/src/components/swipe/index.tsx +5 -4
- package/src/components/switch/index.tsx +2 -1
- package/src/components/table/index.tsx +11 -10
- package/src/components/tabs/index.tsx +4 -2
- package/src/components/tag-input/index.tsx +5 -5
- package/src/components/text-animation/index.tsx +2 -1
- package/src/components/textarea/index.tsx +3 -3
- package/src/components/time-picker/index.tsx +2 -1
- package/src/components/timeline/index.tsx +17 -16
- package/src/components/toast/index.tsx +2 -2
- package/src/components/toggle-button/index.tsx +3 -2
- package/src/components/tooltip/index.tsx +2 -1
- package/src/components/tour/index.tsx +3 -2
- package/src/components/tree/index.tsx +11 -9
- package/src/components/typography/index.tsx +8 -7
- package/src/hooks/use-keyboard-avoidance.ts +10 -2
- package/src/hooks/use-reveal-progress.ts +3 -2
- package/src/hooks/use-scroll-sections.ts +3 -2
- package/src/icons/index.tsx +21 -2
- package/src/index.ts +4 -0
- package/src/primitives/animated-pressable.tsx +2 -1
- package/src/primitives/chart-accessibility.ts +9 -5
- package/src/primitives/glass.tsx +3 -2
- package/src/primitives/refs.ts +45 -0
- package/src/primitives/scroll-progress.tsx +2 -1
- package/src/primitives/text.tsx +2 -1
- package/src/primitives/web-deps.ts +14 -0
- package/lib/module/uniwind-env.d.js +0 -4
- package/lib/module/uniwind-env.d.js.map +0 -1
|
@@ -69,6 +69,7 @@ import { tv } from 'tailwind-variants';
|
|
|
69
69
|
import { Portal } from '../../primitives/portal';
|
|
70
70
|
import { Text, type TextProps } from '../../primitives/text';
|
|
71
71
|
import { cn } from '../../utils/cn';
|
|
72
|
+
import type { ViewRef } from '../../primitives/refs';
|
|
72
73
|
|
|
73
74
|
/** Gap between the trigger and the label. */
|
|
74
75
|
const DEFAULT_OFFSET = 6;
|
|
@@ -294,7 +295,7 @@ export interface TooltipTriggerProps {
|
|
|
294
295
|
*/
|
|
295
296
|
function TooltipTrigger({ className, children }: TooltipTriggerProps) {
|
|
296
297
|
const { open, show, hide, setTrigger, openOn, label } = useTooltip('Tooltip.Trigger');
|
|
297
|
-
const ref = useRef<
|
|
298
|
+
const ref = useRef<ViewRef>(null);
|
|
298
299
|
|
|
299
300
|
const measureThenShow = () => {
|
|
300
301
|
// Measured on every open rather than on layout: the trigger may have
|
|
@@ -79,6 +79,7 @@ import {
|
|
|
79
79
|
nextTourCardMeasurement,
|
|
80
80
|
type TourCardMeasurement,
|
|
81
81
|
} from './tour-card-measurement';
|
|
82
|
+
import type { ViewRef } from '../../primitives/refs';
|
|
82
83
|
|
|
83
84
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
84
85
|
|
|
@@ -137,7 +138,7 @@ interface TourStepEntry {
|
|
|
137
138
|
padding?: number;
|
|
138
139
|
radius?: number;
|
|
139
140
|
placement?: TourPlacement;
|
|
140
|
-
target: RefObject<
|
|
141
|
+
target: RefObject<ViewRef | null>;
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
interface TourContextValue {
|
|
@@ -905,7 +906,7 @@ function TourStep({
|
|
|
905
906
|
...props
|
|
906
907
|
}: TourStepProps) {
|
|
907
908
|
const { register, unregister } = useTour('Tour.Step');
|
|
908
|
-
const target = useRef<
|
|
909
|
+
const target = useRef<ViewRef>(null);
|
|
909
910
|
|
|
910
911
|
const entry = useMemo<TourStepEntry>(
|
|
911
912
|
() => ({
|
|
@@ -72,6 +72,8 @@ import { useCSSVariable } from 'uniwind';
|
|
|
72
72
|
import { ChevronRightIcon, IconColorProvider } from '../../icons';
|
|
73
73
|
import { useDirection } from '../../hooks/use-direction';
|
|
74
74
|
import { Text, type TextProps } from '../../primitives/text';
|
|
75
|
+
import type { TextRef, ViewRef } from '../../primitives/refs';
|
|
76
|
+
import { webDeps } from '../../primitives/web-deps';
|
|
75
77
|
|
|
76
78
|
export type TreeSize = 'sm' | 'default';
|
|
77
79
|
|
|
@@ -193,7 +195,7 @@ export interface TreeProps extends ViewProps {
|
|
|
193
195
|
children?: ReactNode;
|
|
194
196
|
}
|
|
195
197
|
|
|
196
|
-
const TreeRoot = forwardRef<
|
|
198
|
+
const TreeRoot = forwardRef<ViewRef, TreeProps>(
|
|
197
199
|
(
|
|
198
200
|
{
|
|
199
201
|
className,
|
|
@@ -319,7 +321,7 @@ export interface TreeItemProps extends ViewProps {
|
|
|
319
321
|
* is a leaf that renders a chevron-sized gap in place of the chevron so its
|
|
320
322
|
* label still lines up with its siblings'.
|
|
321
323
|
*/
|
|
322
|
-
const TreeItem = forwardRef<
|
|
324
|
+
const TreeItem = forwardRef<ViewRef, TreeItemProps>(
|
|
323
325
|
({ className, value, isDisabled = false, hasChildren, children, ...props }, ref) => {
|
|
324
326
|
const { expanded, selected } = useTree('Tree.Item');
|
|
325
327
|
const parent = useContext(TreeItemContext);
|
|
@@ -374,7 +376,7 @@ export interface TreeTriggerProps extends Omit<PressableProps, 'children'> {
|
|
|
374
376
|
* with its expanded and selected state attached — is the description that
|
|
375
377
|
* actually survives to the user.
|
|
376
378
|
*/
|
|
377
|
-
const TreeTrigger = forwardRef<
|
|
379
|
+
const TreeTrigger = forwardRef<ViewRef, TreeTriggerProps>(
|
|
378
380
|
({ className, onPress, disabled = false, children, ...props }, ref) => {
|
|
379
381
|
const { toggleExpanded, select, selectionMode, expandOnPress, size } =
|
|
380
382
|
useTree('Tree.Trigger');
|
|
@@ -432,7 +434,7 @@ export interface TreeIndicatorProps extends ViewProps {
|
|
|
432
434
|
* On a leaf it becomes an empty box of the same size rather than disappearing,
|
|
433
435
|
* so a leaf's label starts where its siblings' labels do.
|
|
434
436
|
*/
|
|
435
|
-
const TreeIndicator = forwardRef<
|
|
437
|
+
const TreeIndicator = forwardRef<ViewRef, TreeIndicatorProps>(
|
|
436
438
|
({ className, children, ...props }, ref) => {
|
|
437
439
|
const { toggleExpanded, size } = useTree('Tree.Indicator');
|
|
438
440
|
const { value, isExpanded, isDisabled, isBranch } = useTreeItem('Tree.Indicator');
|
|
@@ -448,7 +450,7 @@ const TreeIndicator = forwardRef<View, TreeIndicatorProps>(
|
|
|
448
450
|
const openRotation = direction === 'rtl' ? -90 : 90;
|
|
449
451
|
const rotation = useDerivedValue(
|
|
450
452
|
() => withTiming(isExpanded ? openRotation : 0, { duration: TRANSITION_DURATION }),
|
|
451
|
-
[isExpanded, openRotation]
|
|
453
|
+
webDeps([isExpanded, openRotation])
|
|
452
454
|
);
|
|
453
455
|
const rotationStyle = useAnimatedStyle(() => ({
|
|
454
456
|
transform: [{ rotate: `${rotation.value}deg` }],
|
|
@@ -484,7 +486,7 @@ export interface TreeIconProps extends ViewProps {
|
|
|
484
486
|
}
|
|
485
487
|
|
|
486
488
|
/** The leading glyph, between the chevron and the label. */
|
|
487
|
-
const TreeIcon = forwardRef<
|
|
489
|
+
const TreeIcon = forwardRef<ViewRef, TreeIconProps>(({ className, ...props }, ref) => {
|
|
488
490
|
const { size } = useTree('Tree.Icon');
|
|
489
491
|
const { icon } = treeVariants({ size });
|
|
490
492
|
return <View ref={ref} className={icon({ className })} {...props} />;
|
|
@@ -492,7 +494,7 @@ const TreeIcon = forwardRef<View, TreeIconProps>(({ className, ...props }, ref)
|
|
|
492
494
|
TreeIcon.displayName = 'Tree.Icon';
|
|
493
495
|
|
|
494
496
|
/** The row's text. Takes the selected colour with the rest of the row. */
|
|
495
|
-
const TreeLabel = forwardRef<
|
|
497
|
+
const TreeLabel = forwardRef<TextRef, TextProps>(({ className, ...props }, ref) => {
|
|
496
498
|
const { size } = useTree('Tree.Label');
|
|
497
499
|
const { isSelected } = useTreeItem('Tree.Label');
|
|
498
500
|
const { label } = treeVariants({ size, isSelected });
|
|
@@ -506,7 +508,7 @@ export interface TreeActionsProps extends ViewProps {
|
|
|
506
508
|
}
|
|
507
509
|
|
|
508
510
|
/** The trailing slot: a count, a badge, a menu button for the node. */
|
|
509
|
-
const TreeActions = forwardRef<
|
|
511
|
+
const TreeActions = forwardRef<ViewRef, TreeActionsProps>(({ className, ...props }, ref) => {
|
|
510
512
|
const { actions } = treeVariants();
|
|
511
513
|
return <View ref={ref} className={actions({ className })} {...props} />;
|
|
512
514
|
});
|
|
@@ -529,7 +531,7 @@ export interface TreeGroupProps extends ViewProps {
|
|
|
529
531
|
* start-edge border: an indent that always fell on the left would run the wrong
|
|
530
532
|
* way in a right-to-left subtree and put every level further from its parent.
|
|
531
533
|
*/
|
|
532
|
-
const TreeGroup = forwardRef<
|
|
534
|
+
const TreeGroup = forwardRef<ViewRef, TreeGroupProps>(
|
|
533
535
|
({ className, children, ...props }, ref) => {
|
|
534
536
|
const { showLines, indent } = useTree('Tree.Group');
|
|
535
537
|
const { isExpanded } = useTreeItem('Tree.Group');
|
|
@@ -27,6 +27,7 @@ import { View, type Text as RNText, type ViewProps } from 'react-native';
|
|
|
27
27
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
28
28
|
import { Text, type TextProps, textChildren } from '../../primitives/text';
|
|
29
29
|
import { cn } from '../../utils/cn';
|
|
30
|
+
import type { TextRef, ViewRef } from '../../primitives/refs';
|
|
30
31
|
|
|
31
32
|
const typographyVariants = tv({
|
|
32
33
|
base: 'text-foreground',
|
|
@@ -144,7 +145,7 @@ const HEADING_LEVEL: Record<HeadingType, number> = {
|
|
|
144
145
|
h6: 6,
|
|
145
146
|
};
|
|
146
147
|
|
|
147
|
-
const TypographyRoot = forwardRef<
|
|
148
|
+
const TypographyRoot = forwardRef<TextRef, TypographyProps>(
|
|
148
149
|
(
|
|
149
150
|
{ className, type, muted, weight, align, transform, underline, italic, strike, ...props },
|
|
150
151
|
ref
|
|
@@ -173,7 +174,7 @@ export interface TypographyHeadingProps extends Omit<TypographyProps, 'type'> {
|
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
/** Heading text, wired up with the matching accessibility heading level. */
|
|
176
|
-
const TypographyHeading = forwardRef<
|
|
177
|
+
const TypographyHeading = forwardRef<TextRef, TypographyHeadingProps>(
|
|
177
178
|
(
|
|
178
179
|
{ className, type = 'h2', muted, weight, align, transform, underline, italic, strike, ...props },
|
|
179
180
|
ref
|
|
@@ -203,7 +204,7 @@ export interface TypographyParagraphProps extends Omit<TypographyProps, 'type'>
|
|
|
203
204
|
type?: ParagraphType;
|
|
204
205
|
}
|
|
205
206
|
|
|
206
|
-
const TypographyParagraph = forwardRef<
|
|
207
|
+
const TypographyParagraph = forwardRef<TextRef, TypographyParagraphProps>(
|
|
207
208
|
(
|
|
208
209
|
{ className, type = 'body', muted, weight, align, transform, underline, italic, strike, ...props },
|
|
209
210
|
ref
|
|
@@ -233,7 +234,7 @@ export interface TypographyCodeProps extends Omit<TypographyProps, 'type'> {
|
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
/** Inline code on a muted surface. */
|
|
236
|
-
const TypographyCode = forwardRef<
|
|
237
|
+
const TypographyCode = forwardRef<ViewRef, TypographyCodeProps & Pick<ViewProps, 'testID'>>(
|
|
237
238
|
({ className, containerClassName, muted, testID, ...props }, ref) => (
|
|
238
239
|
<View
|
|
239
240
|
ref={ref}
|
|
@@ -257,7 +258,7 @@ export interface TypographyBlockquoteProps extends Omit<TypographyProps, 'type'>
|
|
|
257
258
|
* The rule uses `border-s`, so it moves to the right-hand side under a
|
|
258
259
|
* right-to-left `Direction` without the quote having to know.
|
|
259
260
|
*/
|
|
260
|
-
const TypographyBlockquote = forwardRef<
|
|
261
|
+
const TypographyBlockquote = forwardRef<ViewRef, TypographyBlockquoteProps>(
|
|
261
262
|
({ className, containerClassName, muted, weight, align, transform, underline, italic = true, strike, children, ...props }, ref) => (
|
|
262
263
|
<View ref={ref} className={cn('border-s-2 border-border ps-4', containerClassName)}>
|
|
263
264
|
<Text
|
|
@@ -296,7 +297,7 @@ export interface TypographyListProps extends ViewProps {
|
|
|
296
297
|
* only the list knows whether it is a bullet or a number — and only the list
|
|
297
298
|
* knows which number.
|
|
298
299
|
*/
|
|
299
|
-
const TypographyList = forwardRef<
|
|
300
|
+
const TypographyList = forwardRef<ViewRef, TypographyListProps>(
|
|
300
301
|
({ className, ordered = false, children, ...props }, ref) => (
|
|
301
302
|
<View ref={ref} {...props} accessibilityRole="list" className={cn('gap-2', className)}>
|
|
302
303
|
{Children.map(children, (child, index) => (
|
|
@@ -321,7 +322,7 @@ export interface TypographyListItemProps extends Omit<TypographyProps, 'type'> {
|
|
|
321
322
|
}
|
|
322
323
|
|
|
323
324
|
/** One line of a list. The marker beside it belongs to the list. */
|
|
324
|
-
const TypographyListItem = forwardRef<
|
|
325
|
+
const TypographyListItem = forwardRef<TextRef, TypographyListItemProps>(
|
|
325
326
|
(
|
|
326
327
|
{ className, type = 'body', muted, weight, align, transform, underline, italic, strike, ...props },
|
|
327
328
|
ref
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
type AnimatedRef,
|
|
66
66
|
type SharedValue,
|
|
67
67
|
} from 'react-native-reanimated';
|
|
68
|
+
import type { ViewRef } from '../primitives/refs';
|
|
68
69
|
|
|
69
70
|
/** How long a lifted element takes to settle back after it stops being active. */
|
|
70
71
|
const SETTLE_DURATION = 200;
|
|
@@ -108,7 +109,7 @@ export interface UseKeyboardAvoidanceOptions {
|
|
|
108
109
|
|
|
109
110
|
export interface UseKeyboardAvoidanceResult {
|
|
110
111
|
/** Attach to the element that should stay visible. */
|
|
111
|
-
ref: AnimatedRef<
|
|
112
|
+
ref: AnimatedRef<ViewRef>;
|
|
112
113
|
/** Attach to the same element, so a re-layout at rest cannot leave it offset. */
|
|
113
114
|
onLayout: (event: LayoutChangeEvent) => void;
|
|
114
115
|
/** Apply to the same element. */
|
|
@@ -193,7 +194,7 @@ export function useKeyboardAvoidance({
|
|
|
193
194
|
offset = 16,
|
|
194
195
|
bottomInset = 0,
|
|
195
196
|
}: UseKeyboardAvoidanceOptions = {}): UseKeyboardAvoidanceResult {
|
|
196
|
-
const ref = useAnimatedRef<
|
|
197
|
+
const ref = useAnimatedRef<ViewRef>();
|
|
197
198
|
const rawHeight = useKeyboardHeight();
|
|
198
199
|
const { height: screenHeight } = useWindowDimensions();
|
|
199
200
|
|
|
@@ -259,8 +260,14 @@ export function useKeyboardAvoidance({
|
|
|
259
260
|
* frame, so that is subtracted back out to recover the honest resting edge.
|
|
260
261
|
* Without it the callback would chase its own output down the screen.
|
|
261
262
|
*/
|
|
263
|
+
const following = useSharedValue(false);
|
|
262
264
|
const track = useFrameCallback(() => {
|
|
263
265
|
'worklet';
|
|
266
|
+
// Stopping the callback goes through the JS thread and takes a frame or
|
|
267
|
+
// more. Until it lands, a write here would replace the settle animation
|
|
268
|
+
// and leave the element frozen part-way up, so the loop checks the
|
|
269
|
+
// UI-thread flag first.
|
|
270
|
+
if (!following.value) return;
|
|
264
271
|
const keyboardHeight = Math.abs(rawHeight.value);
|
|
265
272
|
if (keyboardHeight === 0) return;
|
|
266
273
|
if (!laidOut.value) return;
|
|
@@ -290,6 +297,7 @@ export function useKeyboardAvoidance({
|
|
|
290
297
|
() => isActive.value && Math.abs(rawHeight.value) > 0,
|
|
291
298
|
(shouldTrack, wasTracking) => {
|
|
292
299
|
if (shouldTrack === wasTracking) return;
|
|
300
|
+
following.value = shouldTrack;
|
|
293
301
|
runOnJS(setTracking)(shouldTrack);
|
|
294
302
|
|
|
295
303
|
// A keyboard opening is the other place the guard is put back, for the
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
type SharedValue,
|
|
37
37
|
} from 'react-native-reanimated';
|
|
38
38
|
import { useScrollProgress } from '../primitives/scroll-progress';
|
|
39
|
+
import type { ViewRef } from '../primitives/refs';
|
|
39
40
|
|
|
40
41
|
export interface UseRevealProgressOptions {
|
|
41
42
|
/**
|
|
@@ -59,7 +60,7 @@ export interface UseRevealProgressOptions {
|
|
|
59
60
|
|
|
60
61
|
export interface UseRevealProgressResult {
|
|
61
62
|
/** Attach to the element whose travel drives the effect. */
|
|
62
|
-
ref: AnimatedRef<
|
|
63
|
+
ref: AnimatedRef<ViewRef>;
|
|
63
64
|
/**
|
|
64
65
|
* Attach to the same element. It is what says the element can be measured —
|
|
65
66
|
* without it the effect still works, at the cost of a warning per frame for
|
|
@@ -76,7 +77,7 @@ export function useRevealProgress({
|
|
|
76
77
|
progress: external,
|
|
77
78
|
enabled = true,
|
|
78
79
|
}: UseRevealProgressOptions = {}): UseRevealProgressResult {
|
|
79
|
-
const ref = useAnimatedRef<
|
|
80
|
+
const ref = useAnimatedRef<ViewRef>();
|
|
80
81
|
const scroll = useScrollProgress();
|
|
81
82
|
const { height: windowHeight } = useWindowDimensions();
|
|
82
83
|
|
|
@@ -37,6 +37,7 @@ import type {
|
|
|
37
37
|
ScrollView,
|
|
38
38
|
} from 'react-native';
|
|
39
39
|
import { useSharedValue, type SharedValue } from 'react-native-reanimated';
|
|
40
|
+
import type { ScrollViewRef } from '../primitives/refs';
|
|
40
41
|
|
|
41
42
|
export interface UseScrollSectionsOptions {
|
|
42
43
|
/** Section ids, in the order they appear down the page. */
|
|
@@ -71,7 +72,7 @@ export interface ScrollSectionsPosition {
|
|
|
71
72
|
|
|
72
73
|
export interface UseScrollSectionsResult {
|
|
73
74
|
/** Attach to the ScrollView, so `scrollTo` has something to drive. */
|
|
74
|
-
ref: React.RefObject<
|
|
75
|
+
ref: React.RefObject<ScrollViewRef | null>;
|
|
75
76
|
/** The section being read. */
|
|
76
77
|
active: string | undefined;
|
|
77
78
|
/**
|
|
@@ -106,7 +107,7 @@ export function useScrollSections({
|
|
|
106
107
|
endThreshold = 24,
|
|
107
108
|
scrollPadding = 0,
|
|
108
109
|
}: UseScrollSectionsOptions): UseScrollSectionsResult {
|
|
109
|
-
const ref = useRef<
|
|
110
|
+
const ref = useRef<ScrollViewRef | null>(null);
|
|
110
111
|
const offsets = useRef<Record<string, number>>({});
|
|
111
112
|
const settle = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
112
113
|
const [active, setActive] = useState<string | undefined>(ids[0]);
|
package/src/icons/index.tsx
CHANGED
|
@@ -206,7 +206,11 @@ const decorative = (
|
|
|
206
206
|
/** The default line weight. See the note on weight above. */
|
|
207
207
|
const STROKE = 2;
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
/**
|
|
210
|
+
* The defaults a glyph is drawn with when the caller passes nothing.
|
|
211
|
+
* The second argument to `icon()`.
|
|
212
|
+
*/
|
|
213
|
+
export interface IconDefaults {
|
|
210
214
|
/** Both dimensions at the size this glyph is normally drawn. */
|
|
211
215
|
size: number;
|
|
212
216
|
/** The colour used when neither a prop nor a provider supplies one. */
|
|
@@ -222,12 +226,24 @@ interface IconDefaults {
|
|
|
222
226
|
/**
|
|
223
227
|
* Builds one icon from a glyph and the defaults it is normally drawn with.
|
|
224
228
|
*
|
|
229
|
+
* Exported so an app can add a glyph the set does not carry, and have it
|
|
230
|
+
* behave exactly like the built-in icons: the same colour order (prop, then
|
|
231
|
+
* `IconColorProvider`, then the default), the same line weight, the same
|
|
232
|
+
* right-to-left mirror and the same `filled` toggle.
|
|
233
|
+
*
|
|
234
|
+
* ```tsx
|
|
235
|
+
* import HgViewOffIcon from '@hugeicons/core-free-icons/ViewOffIcon';
|
|
236
|
+
* import { icon } from 'panelui-native/icons';
|
|
237
|
+
*
|
|
238
|
+
* export const EyeOffIcon = icon(HgViewOffIcon, { size: 16, color: '#737373' });
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
225
241
|
* A factory rather than seventy near-identical components: what varies between
|
|
226
242
|
* them is data, and what does not — the colour order, the weight default, the
|
|
227
243
|
* mirror, the fill toggle, the prop passthrough — is worth having in exactly
|
|
228
244
|
* one place, where a fix reaches the whole set at once.
|
|
229
245
|
*/
|
|
230
|
-
function icon(glyph: IconSvgElement, defaults: IconDefaults) {
|
|
246
|
+
export function icon(glyph: IconSvgElement, defaults: IconDefaults) {
|
|
231
247
|
function Icon({
|
|
232
248
|
size = defaults.size,
|
|
233
249
|
color,
|
|
@@ -274,6 +290,9 @@ function icon(glyph: IconSvgElement, defaults: IconDefaults) {
|
|
|
274
290
|
return Icon;
|
|
275
291
|
}
|
|
276
292
|
|
|
293
|
+
/** Another name for `icon()`, for code that prefers the `create` prefix. */
|
|
294
|
+
export const createIcon = icon;
|
|
295
|
+
|
|
277
296
|
/* -------------------------------------------------------------------------- */
|
|
278
297
|
/* Chrome */
|
|
279
298
|
/* -------------------------------------------------------------------------- */
|
package/src/index.ts
CHANGED
|
@@ -33,6 +33,10 @@ export {
|
|
|
33
33
|
type GlassRadius,
|
|
34
34
|
} from './primitives/glass';
|
|
35
35
|
export { Text, type TextProps } from './primitives/text';
|
|
36
|
+
// What a forwarded ref points at. Name these instead of `View`, `Text` or
|
|
37
|
+
// `TextInput` as a ref's type: they compile on every React Native version the
|
|
38
|
+
// library supports, where the component names stopped being types in 0.88.
|
|
39
|
+
export type { ViewRef, TextRef, TextInputRef, ScrollViewRef } from './primitives/refs';
|
|
36
40
|
export { Collapse, type CollapseProps } from './primitives/collapse';
|
|
37
41
|
export {
|
|
38
42
|
KeyboardAvoider,
|
|
@@ -13,6 +13,7 @@ import Animated, {
|
|
|
13
13
|
withTiming,
|
|
14
14
|
} from 'react-native-reanimated';
|
|
15
15
|
import { useResolveClassNames } from 'uniwind';
|
|
16
|
+
import type { ViewRef } from './refs';
|
|
16
17
|
|
|
17
18
|
const AnimatedPressableBase = Animated.createAnimatedComponent(Pressable);
|
|
18
19
|
|
|
@@ -44,7 +45,7 @@ export interface AnimatedPressableProps extends PressableProps {
|
|
|
44
45
|
* from 1. Keep `pressOpacity` either 1 or not for the life of a component:
|
|
45
46
|
* the style's keys follow it.
|
|
46
47
|
*/
|
|
47
|
-
export const AnimatedPressable = forwardRef<
|
|
48
|
+
export const AnimatedPressable = forwardRef<ViewRef, AnimatedPressableProps>(
|
|
48
49
|
(
|
|
49
50
|
{
|
|
50
51
|
pressScale = 0.97,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The largest text scale a chart's axis labels follow: iOS's biggest size before
|
|
@@ -8,11 +9,14 @@ import { createElement } from 'react';
|
|
|
8
9
|
*/
|
|
9
10
|
export const CHART_AXIS_MAX_FONT_SCALE = 1.353;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/*
|
|
13
|
+
* `accessibilityLabel` and `accessibilityHint` come from ViewProps, which every
|
|
14
|
+
* chart also extends, rather than being declared again here: React Native 0.88
|
|
15
|
+
* declares them read-only, and two declarations that differ by that fail to merge.
|
|
16
|
+
* A chart's label defaults to its family and number of data entries, and the
|
|
17
|
+
* hint is spoken after that summary.
|
|
18
|
+
*/
|
|
19
|
+
export interface ChartAccessibilityProps<Datum> extends Pick<ViewProps, 'accessibilityLabel' | 'accessibilityHint'> {
|
|
16
20
|
/** Overrides the spoken label for one data entry. */
|
|
17
21
|
accessibilityLabelForDatum?: (datum: Datum, index: number) => string;
|
|
18
22
|
/** Makes each data entry actionable without making the SVG geometry focusable. */
|
package/src/primitives/glass.tsx
CHANGED
|
@@ -52,6 +52,7 @@ import { Platform, StyleSheet, View, type StyleProp, type ViewProps, type ViewSt
|
|
|
52
52
|
import { useThemeMode } from '../theme/use-theme';
|
|
53
53
|
import { cn } from '../utils/cn';
|
|
54
54
|
import { useReduceTransparency } from './scrim';
|
|
55
|
+
import type { ViewRef } from './refs';
|
|
55
56
|
|
|
56
57
|
/** How the material treats what is behind it. */
|
|
57
58
|
export type GlassVariant = 'regular' | 'clear';
|
|
@@ -87,7 +88,7 @@ interface GlassViewProps extends ViewProps {
|
|
|
87
88
|
|
|
88
89
|
interface GlassContainerViewProps extends ViewProps {
|
|
89
90
|
spacing?: number;
|
|
90
|
-
ref?: React.Ref<
|
|
91
|
+
ref?: React.Ref<ViewRef>;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
interface GlassModule {
|
|
@@ -265,7 +266,7 @@ export interface GlassContainerProps extends ViewProps {
|
|
|
265
266
|
* like one thing dividing rather than several things arriving. A plain view
|
|
266
267
|
* wherever the material is not drawn, so it can be written unconditionally.
|
|
267
268
|
*/
|
|
268
|
-
export const GlassContainer = forwardRef<
|
|
269
|
+
export const GlassContainer = forwardRef<ViewRef, GlassContainerProps>(
|
|
269
270
|
({ spacing, className, style, children, ...props }, ref) => {
|
|
270
271
|
const material = useGlassMaterial();
|
|
271
272
|
if (material && GlassContainerView) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ComponentRef } from 'react';
|
|
2
|
+
import type { FlatListProps, ScrollView, Text, TextInput, TextInputProps, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* The types a forwarded ref points at.
|
|
6
|
+
*
|
|
7
|
+
* React Native's `View`, `Text` and `TextInput` were declared as classes up to
|
|
8
|
+
* 0.86 and as function components from 0.88, so naming one as a ref's type —
|
|
9
|
+
* `forwardRef<View, …>` — compiles on one and fails on the other.
|
|
10
|
+
* `ComponentRef<typeof X>` reads the instance type off whichever declaration is
|
|
11
|
+
* installed, so these compile on both and keep the instance methods (`focus`,
|
|
12
|
+
* `blur`, `measure`, …) on the ref.
|
|
13
|
+
*
|
|
14
|
+
* They are interfaces rather than type aliases so the published declarations
|
|
15
|
+
* can name them: on 0.88 the type they resolve to lives in a private path of
|
|
16
|
+
* React Native that a declaration file cannot import.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** What a ref on a `View`-rooted component points at. */
|
|
20
|
+
export interface ViewRef extends ComponentRef<typeof View> {}
|
|
21
|
+
|
|
22
|
+
/** What a ref on a `Text`-rooted component points at. */
|
|
23
|
+
export interface TextRef extends ComponentRef<typeof Text> {}
|
|
24
|
+
|
|
25
|
+
/** What a ref on a `TextInput`-rooted component points at: `focus()`, `clear()`, `isFocused()`. */
|
|
26
|
+
export interface TextInputRef extends ComponentRef<typeof TextInput> {}
|
|
27
|
+
|
|
28
|
+
/** What a ref on a `ScrollView` points at: `scrollTo`, `scrollToEnd`, `flashScrollIndicators`. */
|
|
29
|
+
export interface ScrollViewRef extends ComponentRef<typeof ScrollView> {}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Event and list types React Native 0.88 renamed or removed. Each is read off
|
|
33
|
+
* a prop both versions share, so the library compiles against either.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/** The event `TextInput`'s `onKeyPress` receives. */
|
|
37
|
+
export type KeyPressEvent = Parameters<NonNullable<TextInputProps['onKeyPress']>>[0];
|
|
38
|
+
/** The event `TextInput`'s `onSubmitEditing` receives. */
|
|
39
|
+
export type SubmitEditingEvent = Parameters<NonNullable<TextInputProps['onSubmitEditing']>>[0];
|
|
40
|
+
/** The event `TextInput`'s `onSelectionChange` receives. */
|
|
41
|
+
export type SelectionChangeEvent = Parameters<NonNullable<TextInputProps['onSelectionChange']>>[0];
|
|
42
|
+
/** The event `TextInput`'s `onContentSizeChange` receives. */
|
|
43
|
+
export type ContentSizeChangeEvent = Parameters<NonNullable<TextInputProps['onContentSizeChange']>>[0];
|
|
44
|
+
/** One entry of what a list reports as visible. */
|
|
45
|
+
export type ViewTokenOf<T> = Parameters<NonNullable<FlatListProps<T>['onViewableItemsChanged']>>[0]['viewableItems'][number];
|
|
@@ -42,6 +42,7 @@ import Animated, {
|
|
|
42
42
|
type AnimatedScrollViewProps,
|
|
43
43
|
type SharedValue,
|
|
44
44
|
} from 'react-native-reanimated';
|
|
45
|
+
import type { ViewRef } from './refs';
|
|
45
46
|
|
|
46
47
|
export interface ScrollProgressValue {
|
|
47
48
|
/** Distance scrolled, in pixels. */
|
|
@@ -90,7 +91,7 @@ export function ScrollProgress({ className, children, ...props }: ScrollProgress
|
|
|
90
91
|
const viewport = useSharedValue(0);
|
|
91
92
|
const content = useSharedValue(0);
|
|
92
93
|
const top = useSharedValue(0);
|
|
93
|
-
const hostRef = useRef<
|
|
94
|
+
const hostRef = useRef<ViewRef>(null);
|
|
94
95
|
|
|
95
96
|
const child = Children.only(children) as ReactElement<ScrollableProps>;
|
|
96
97
|
|
package/src/primitives/text.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { Children, forwardRef, type ReactElement, type ReactNode } from 'react';
|
|
|
2
2
|
import { Text as RNText, type Text as RNTextType, type TextProps as RNTextProps } from 'react-native';
|
|
3
3
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
4
4
|
import { useDirection } from '../hooks/use-direction';
|
|
5
|
+
import type { TextRef } from './refs';
|
|
5
6
|
|
|
6
7
|
const textVariants = tv({
|
|
7
8
|
base: 'text-foreground',
|
|
@@ -35,7 +36,7 @@ export interface TextProps extends RNTextProps, VariantProps<typeof textVariants
|
|
|
35
36
|
className?: string;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
export const Text = forwardRef<
|
|
39
|
+
export const Text = forwardRef<TextRef, TextProps>(
|
|
39
40
|
({ className, size, weight, muted, style, ...props }, ref) => {
|
|
40
41
|
/*
|
|
41
42
|
* `direction` is a Yoga *layout* property, and React Native resolves a
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A dependency list for a Reanimated hook, on the web only.
|
|
5
|
+
*
|
|
6
|
+
* On iOS and Android the Babel plugin works out what a worklet closes over,
|
|
7
|
+
* and Reanimated ignores a dependency list there; from 4.7 it also warns about
|
|
8
|
+
* one in development. On the web there is no plugin, and the list is how the
|
|
9
|
+
* hook knows to rebuild. Passing the list through this keeps the web right and
|
|
10
|
+
* the native console quiet.
|
|
11
|
+
*/
|
|
12
|
+
export function webDeps(deps: unknown[]): unknown[] | undefined {
|
|
13
|
+
return Platform.OS === 'web' ? deps : undefined;
|
|
14
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["uniwind-env.d.ts"],"mappings":";;AAAA,OAAO,eAAe","ignoreList":[]}
|