@coze-arch/cli 0.0.10 → 0.0.11
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/__templates__/expo/AGENTS.md +3 -3
- package/lib/__templates__/expo/README.md +3 -3
- package/lib/__templates__/expo/client/components/Provider.tsx +4 -1
- package/lib/__templates__/expo/client/components/Screen.tsx +4 -1
- package/lib/__templates__/expo/client/eslint.config.mjs +2 -0
- package/lib/__templates__/expo/client/global.css +1 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/accordion.animation.ts +178 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/accordion.constants.ts +62 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/accordion.md +437 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/accordion.styles.ts +95 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/accordion.tsx +340 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/accordion.types.ts +267 -0
- package/lib/__templates__/expo/client/heroui/components/accordion/index.ts +17 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.constants.ts +13 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.hooks.ts +28 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.md +263 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.styles.ts +65 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.tsx +181 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.types.ts +99 -0
- package/lib/__templates__/expo/client/heroui/components/alert/alert.utils.tsx +25 -0
- package/lib/__templates__/expo/client/heroui/components/alert/default-icon.tsx +28 -0
- package/lib/__templates__/expo/client/heroui/components/alert/index.ts +15 -0
- package/lib/__templates__/expo/client/heroui/components/alert/success-icon.tsx +28 -0
- package/lib/__templates__/expo/client/heroui/components/alert/warning-icon.tsx +28 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.animation.ts +123 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.constants.ts +19 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.context.ts +11 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.md +386 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.styles.ts +145 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.tsx +307 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/avatar.types.ts +239 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/index.ts +13 -0
- package/lib/__templates__/expo/client/heroui/components/avatar/person-icon.tsx +23 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.animation.ts +42 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.constants.ts +13 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.md +349 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.styles.ts +66 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.tsx +351 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.types.ts +150 -0
- package/lib/__templates__/expo/client/heroui/components/bottom-sheet/index.ts +16 -0
- package/lib/__templates__/expo/client/heroui/components/button/button.constants.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/button/button.md +381 -0
- package/lib/__templates__/expo/client/heroui/components/button/button.styles.ts +89 -0
- package/lib/__templates__/expo/client/heroui/components/button/button.tsx +284 -0
- package/lib/__templates__/expo/client/heroui/components/button/button.types.ts +175 -0
- package/lib/__templates__/expo/client/heroui/components/button/button.utils.ts +34 -0
- package/lib/__templates__/expo/client/heroui/components/button/index.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/card/card.constants.ts +11 -0
- package/lib/__templates__/expo/client/heroui/components/card/card.md +186 -0
- package/lib/__templates__/expo/client/heroui/components/card/card.styles.ts +35 -0
- package/lib/__templates__/expo/client/heroui/components/card/card.tsx +153 -0
- package/lib/__templates__/expo/client/heroui/components/card/card.types.ts +77 -0
- package/lib/__templates__/expo/client/heroui/components/card/index.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.animation.ts +202 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.md +311 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.styles.ts +105 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.tsx +251 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.types.ts +216 -0
- package/lib/__templates__/expo/client/heroui/components/checkbox/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/chip/chip.animation.ts +18 -0
- package/lib/__templates__/expo/client/heroui/components/chip/chip.constants.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/chip/chip.md +190 -0
- package/lib/__templates__/expo/client/heroui/components/chip/chip.styles.ts +234 -0
- package/lib/__templates__/expo/client/heroui/components/chip/chip.tsx +125 -0
- package/lib/__templates__/expo/client/heroui/components/chip/chip.types.ts +69 -0
- package/lib/__templates__/expo/client/heroui/components/chip/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/close-button/close-button.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/close-button/close-button.md +109 -0
- package/lib/__templates__/expo/client/heroui/components/close-button/close-button.styles.ts +13 -0
- package/lib/__templates__/expo/client/heroui/components/close-button/close-button.tsx +57 -0
- package/lib/__templates__/expo/client/heroui/components/close-button/close-button.types.ts +30 -0
- package/lib/__templates__/expo/client/heroui/components/close-button/index.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.animation.ts +18 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.constants.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.context.ts +14 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.md +241 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.styles.ts +15 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.tsx +245 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/control-field.types.ts +67 -0
- package/lib/__templates__/expo/client/heroui/components/control-field/index.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/description/description.animation.ts +53 -0
- package/lib/__templates__/expo/client/heroui/components/description/description.constants.ts +30 -0
- package/lib/__templates__/expo/client/heroui/components/description/description.md +129 -0
- package/lib/__templates__/expo/client/heroui/components/description/description.styles.ts +25 -0
- package/lib/__templates__/expo/client/heroui/components/description/description.tsx +81 -0
- package/lib/__templates__/expo/client/heroui/components/description/description.types.ts +77 -0
- package/lib/__templates__/expo/client/heroui/components/description/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/dialog.animation.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/dialog.constants.ts +13 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/dialog.md +288 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/dialog.styles.ts +77 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/dialog.tsx +379 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/dialog.types.ts +199 -0
- package/lib/__templates__/expo/client/heroui/components/dialog/index.ts +12 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/field-error.animation.ts +50 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/field-error.constants.ts +31 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/field-error.md +204 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/field-error.styles.ts +23 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/field-error.tsx +91 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/field-error.types.ts +79 -0
- package/lib/__templates__/expo/client/heroui/components/field-error/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/input/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/input/input.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/input/input.md +193 -0
- package/lib/__templates__/expo/client/heroui/components/input/input.styles.ts +51 -0
- package/lib/__templates__/expo/client/heroui/components/input/input.tsx +96 -0
- package/lib/__templates__/expo/client/heroui/components/input/input.types.ts +44 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/index.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/input-group.animation.ts +14 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/input-group.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/input-group.md +197 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/input-group.styles.ts +31 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/input-group.tsx +239 -0
- package/lib/__templates__/expo/client/heroui/components/input-group/input-group.types.ts +98 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/index.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.animation.ts +199 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.constants.ts +12 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.md +376 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.styles.ts +68 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.tsx +414 -0
- package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.types.ts +275 -0
- package/lib/__templates__/expo/client/heroui/components/label/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/label/label.animation.ts +18 -0
- package/lib/__templates__/expo/client/heroui/components/label/label.constants.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/label/label.md +187 -0
- package/lib/__templates__/expo/client/heroui/components/label/label.styles.ts +44 -0
- package/lib/__templates__/expo/client/heroui/components/label/label.tsx +172 -0
- package/lib/__templates__/expo/client/heroui/components/label/label.types.ts +86 -0
- package/lib/__templates__/expo/client/heroui/components/list-group/index.ts +17 -0
- package/lib/__templates__/expo/client/heroui/components/list-group/list-group.constants.ts +17 -0
- package/lib/__templates__/expo/client/heroui/components/list-group/list-group.md +387 -0
- package/lib/__templates__/expo/client/heroui/components/list-group/list-group.styles.ts +40 -0
- package/lib/__templates__/expo/client/heroui/components/list-group/list-group.tsx +206 -0
- package/lib/__templates__/expo/client/heroui/components/list-group/list-group.types.ts +132 -0
- package/lib/__templates__/expo/client/heroui/components/menu/index.ts +38 -0
- package/lib/__templates__/expo/client/heroui/components/menu/menu.animation.ts +121 -0
- package/lib/__templates__/expo/client/heroui/components/menu/menu.constants.ts +37 -0
- package/lib/__templates__/expo/client/heroui/components/menu/menu.md +620 -0
- package/lib/__templates__/expo/client/heroui/components/menu/menu.styles.ts +107 -0
- package/lib/__templates__/expo/client/heroui/components/menu/menu.tsx +664 -0
- package/lib/__templates__/expo/client/heroui/components/menu/menu.types.ts +394 -0
- package/lib/__templates__/expo/client/heroui/components/popover/arrow-svg.tsx +180 -0
- package/lib/__templates__/expo/client/heroui/components/popover/index.ts +18 -0
- package/lib/__templates__/expo/client/heroui/components/popover/popover.animation.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/popover/popover.constants.ts +34 -0
- package/lib/__templates__/expo/client/heroui/components/popover/popover.md +508 -0
- package/lib/__templates__/expo/client/heroui/components/popover/popover.styles.ts +98 -0
- package/lib/__templates__/expo/client/heroui/components/popover/popover.tsx +624 -0
- package/lib/__templates__/expo/client/heroui/components/popover/popover.types.ts +290 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.animation.ts +450 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.constants.ts +12 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.md +328 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.styles.ts +84 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.tsx +330 -0
- package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.types.ts +386 -0
- package/lib/__templates__/expo/client/heroui/components/radio/index.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/radio/radio.animation.ts +92 -0
- package/lib/__templates__/expo/client/heroui/components/radio/radio.constants.ts +11 -0
- package/lib/__templates__/expo/client/heroui/components/radio/radio.md +339 -0
- package/lib/__templates__/expo/client/heroui/components/radio/radio.styles.ts +80 -0
- package/lib/__templates__/expo/client/heroui/components/radio/radio.tsx +217 -0
- package/lib/__templates__/expo/client/heroui/components/radio/radio.types.ts +106 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/index.ts +9 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.animation.ts +20 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.constants.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.context.ts +14 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.md +273 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.styles.ts +15 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.tsx +220 -0
- package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.types.ts +64 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/index.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.animation.ts +132 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.constants.ts +21 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.md +206 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.styles.ts +52 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.tsx +262 -0
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.types.ts +121 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/index.ts +17 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-field.animation.ts +18 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-field.constants.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-field.md +231 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-field.styles.ts +35 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-field.tsx +253 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-field.types.ts +160 -0
- package/lib/__templates__/expo/client/heroui/components/search-field/search-icon.tsx +37 -0
- package/lib/__templates__/expo/client/heroui/components/select/index.ts +28 -0
- package/lib/__templates__/expo/client/heroui/components/select/select.animation.ts +92 -0
- package/lib/__templates__/expo/client/heroui/components/select/select.constants.ts +53 -0
- package/lib/__templates__/expo/client/heroui/components/select/select.md +796 -0
- package/lib/__templates__/expo/client/heroui/components/select/select.styles.ts +149 -0
- package/lib/__templates__/expo/client/heroui/components/select/select.tsx +828 -0
- package/lib/__templates__/expo/client/heroui/components/select/select.types.ts +438 -0
- package/lib/__templates__/expo/client/heroui/components/separator/index.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/separator/separator.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/separator/separator.md +106 -0
- package/lib/__templates__/expo/client/heroui/components/separator/separator.styles.ts +50 -0
- package/lib/__templates__/expo/client/heroui/components/separator/separator.tsx +62 -0
- package/lib/__templates__/expo/client/heroui/components/separator/separator.types.ts +40 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/index.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/linear-gradient.tsx +45 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.animation.ts +351 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.constants.ts +39 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.md +208 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.styles.ts +49 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.tsx +183 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.types.ts +191 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton-group/index.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.constants.ts +7 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.md +247 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.styles.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.tsx +94 -0
- package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.types.ts +28 -0
- package/lib/__templates__/expo/client/heroui/components/slider/index.ts +23 -0
- package/lib/__templates__/expo/client/heroui/components/slider/slider.animation.ts +87 -0
- package/lib/__templates__/expo/client/heroui/components/slider/slider.constants.ts +24 -0
- package/lib/__templates__/expo/client/heroui/components/slider/slider.md +348 -0
- package/lib/__templates__/expo/client/heroui/components/slider/slider.styles.ts +85 -0
- package/lib/__templates__/expo/client/heroui/components/slider/slider.tsx +413 -0
- package/lib/__templates__/expo/client/heroui/components/slider/slider.types.ts +120 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/index.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner-icon.tsx +49 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner.animation.ts +150 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner.constants.ts +36 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner.md +199 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner.styles.ts +44 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner.tsx +198 -0
- package/lib/__templates__/expo/client/heroui/components/spinner/spinner.types.ts +158 -0
- package/lib/__templates__/expo/client/heroui/components/surface/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/surface/surface.animation.ts +18 -0
- package/lib/__templates__/expo/client/heroui/components/surface/surface.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/surface/surface.md +136 -0
- package/lib/__templates__/expo/client/heroui/components/surface/surface.styles.ts +28 -0
- package/lib/__templates__/expo/client/heroui/components/surface/surface.tsx +66 -0
- package/lib/__templates__/expo/client/heroui/components/surface/surface.types.ts +46 -0
- package/lib/__templates__/expo/client/heroui/components/switch/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/switch/switch.animation.ts +243 -0
- package/lib/__templates__/expo/client/heroui/components/switch/switch.constants.ts +26 -0
- package/lib/__templates__/expo/client/heroui/components/switch/switch.md +334 -0
- package/lib/__templates__/expo/client/heroui/components/switch/switch.styles.ts +83 -0
- package/lib/__templates__/expo/client/heroui/components/switch/switch.tsx +280 -0
- package/lib/__templates__/expo/client/heroui/components/switch/switch.types.ts +208 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/index.ts +8 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.animation.ts +246 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.constants.ts +17 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.context.ts +28 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.md +565 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.styles.ts +168 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.tsx +445 -0
- package/lib/__templates__/expo/client/heroui/components/tabs/tabs.types.ts +341 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/index.ts +15 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.animation.ts +17 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.constants.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.md +404 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.styles.ts +74 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.tsx +325 -0
- package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.types.ts +125 -0
- package/lib/__templates__/expo/client/heroui/components/text-area/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/text-area/text-area.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/text-area/text-area.md +133 -0
- package/lib/__templates__/expo/client/heroui/components/text-area/text-area.styles.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/text-area/text-area.tsx +44 -0
- package/lib/__templates__/expo/client/heroui/components/text-area/text-area.types.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/text-field.animation.ts +20 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/text-field.constants.ts +6 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/text-field.md +256 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/text-field.styles.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/text-field.tsx +82 -0
- package/lib/__templates__/expo/client/heroui/components/text-field/text-field.types.ts +56 -0
- package/lib/__templates__/expo/client/heroui/components/toast/index.ts +4 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.animation.ts +381 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.constants.ts +10 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.hooks.ts +73 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.md +420 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.styles.ts +89 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.tsx +472 -0
- package/lib/__templates__/expo/client/heroui/components/toast/toast.types.ts +320 -0
- package/lib/__templates__/expo/client/heroui/docs.md +47 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/hooks/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/hooks/use-is-on-surface.ts +8 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/hooks/use-theme-color.ts +137 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/utils/cn.ts +12 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/utils/color-kit/index.ts +2395 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/utils/color-kit/types.ts +212 -0
- package/lib/__templates__/expo/client/heroui/helpers/external/utils/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/animated-check-icon.tsx +78 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/bottom-sheet-content-container.tsx +97 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/bottom-sheet-content.tsx +158 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/check-icon.tsx +28 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/chevron-down-icon.tsx +28 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/chevron-right-icon.tsx +29 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/close-icon.tsx +29 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/full-window-overlay.tsx +48 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/hero-text.tsx +71 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/components/index.ts +9 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/animation-settings-context.ts +19 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/bottom-sheet-is-dragging-context.ts +11 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/form-field-context.ts +36 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/index.ts +14 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-augmented-ref.ts +32 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-bottom-sheet-aware-handlers.ts +94 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-bottom-sheet-gesture-handlers.ts +52 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-combined-animation-disabled-state.ts +49 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts +124 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-dev-info.ts +38 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-keyboard-status.ts +22 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-bottom-sheet-content-animation.ts +67 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-dialog-content-animation.ts +296 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-overlay-animation.ts +91 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-popover-content-animation.ts +199 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-root-animation.ts +26 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-relative-position.ts +353 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-resolved-style-property.ts +118 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/types/animation.ts +131 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/types/bottom-sheet.ts +99 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/types/index.ts +5 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/types/misc.ts +10 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/types/primitives.ts +146 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/types/theme.ts +18 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/animation.ts +266 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/children-to-string.ts +117 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/combine-styles.ts +17 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/create-context.ts +60 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/ease-gradient/create-interpolation.ts +35 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/ease-gradient/index.ts +97 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/get-element-by-display-name.ts +15 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/get-element-with-default.ts +17 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/has-prop.ts +18 -0
- package/lib/__templates__/expo/client/heroui/helpers/internal/utils/index.ts +8 -0
- package/lib/__templates__/expo/client/heroui/index.tsx +51 -0
- package/lib/__templates__/expo/client/heroui/primitives/README.md +27 -0
- package/lib/__templates__/expo/client/heroui/primitives/accordion/accordion.tsx +270 -0
- package/lib/__templates__/expo/client/heroui/primitives/accordion/accordion.types.ts +117 -0
- package/lib/__templates__/expo/client/heroui/primitives/accordion/accordion.utils.ts +12 -0
- package/lib/__templates__/expo/client/heroui/primitives/accordion/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/activity-indicator/activity-indicator.tsx +50 -0
- package/lib/__templates__/expo/client/heroui/primitives/activity-indicator/activity-indicator.types.ts +24 -0
- package/lib/__templates__/expo/client/heroui/primitives/activity-indicator/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/alert/alert.tsx +124 -0
- package/lib/__templates__/expo/client/heroui/primitives/alert/alert.types.ts +87 -0
- package/lib/__templates__/expo/client/heroui/primitives/alert/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/avatar/avatar.tsx +171 -0
- package/lib/__templates__/expo/client/heroui/primitives/avatar/avatar.types.ts +62 -0
- package/lib/__templates__/expo/client/heroui/primitives/avatar/avatar.utils.ts +102 -0
- package/lib/__templates__/expo/client/heroui/primitives/avatar/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/bottom-sheet/bottom-sheet.tsx +235 -0
- package/lib/__templates__/expo/client/heroui/primitives/bottom-sheet/bottom-sheet.types.ts +127 -0
- package/lib/__templates__/expo/client/heroui/primitives/bottom-sheet/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/checkbox/checkbox.tsx +119 -0
- package/lib/__templates__/expo/client/heroui/primitives/checkbox/checkbox.types.ts +37 -0
- package/lib/__templates__/expo/client/heroui/primitives/checkbox/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/dialog/dialog.tsx +274 -0
- package/lib/__templates__/expo/client/heroui/primitives/dialog/dialog.types.ts +129 -0
- package/lib/__templates__/expo/client/heroui/primitives/dialog/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/input-otp/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/primitives/input-otp/input-otp.tsx +431 -0
- package/lib/__templates__/expo/client/heroui/primitives/input-otp/input-otp.types.ts +169 -0
- package/lib/__templates__/expo/client/heroui/primitives/input-otp/input-otp.utils.ts +31 -0
- package/lib/__templates__/expo/client/heroui/primitives/label/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/label/label.tsx +24 -0
- package/lib/__templates__/expo/client/heroui/primitives/label/label.types.ts +39 -0
- package/lib/__templates__/expo/client/heroui/primitives/menu/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/menu/menu.tsx +765 -0
- package/lib/__templates__/expo/client/heroui/primitives/menu/menu.types.ts +401 -0
- package/lib/__templates__/expo/client/heroui/primitives/popover/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/popover/popover.tsx +382 -0
- package/lib/__templates__/expo/client/heroui/primitives/popover/popover.types.ts +201 -0
- package/lib/__templates__/expo/client/heroui/primitives/portal/index.ts +1 -0
- package/lib/__templates__/expo/client/heroui/primitives/portal/portal.tsx +126 -0
- package/lib/__templates__/expo/client/heroui/primitives/radio/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/radio/radio.tsx +133 -0
- package/lib/__templates__/expo/client/heroui/primitives/radio/radio.types.ts +47 -0
- package/lib/__templates__/expo/client/heroui/primitives/radio-group/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/radio-group/radio-group.tsx +114 -0
- package/lib/__templates__/expo/client/heroui/primitives/radio-group/radio-group.types.ts +65 -0
- package/lib/__templates__/expo/client/heroui/primitives/select/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/select/select.tsx +705 -0
- package/lib/__templates__/expo/client/heroui/primitives/select/select.types.ts +409 -0
- package/lib/__templates__/expo/client/heroui/primitives/select/select.utils.ts +35 -0
- package/lib/__templates__/expo/client/heroui/primitives/slider/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/primitives/slider/slider.tsx +464 -0
- package/lib/__templates__/expo/client/heroui/primitives/slider/slider.types.ts +208 -0
- package/lib/__templates__/expo/client/heroui/primitives/slider/slider.utils.ts +93 -0
- package/lib/__templates__/expo/client/heroui/primitives/slot/index.ts +1 -0
- package/lib/__templates__/expo/client/heroui/primitives/slot/slot.tsx +122 -0
- package/lib/__templates__/expo/client/heroui/primitives/slot/types.ts +19 -0
- package/lib/__templates__/expo/client/heroui/primitives/slot/utils.ts +96 -0
- package/lib/__templates__/expo/client/heroui/primitives/switch/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/switch/switch.tsx +61 -0
- package/lib/__templates__/expo/client/heroui/primitives/switch/switch.types.ts +55 -0
- package/lib/__templates__/expo/client/heroui/primitives/tabs/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/tabs/tabs.tsx +202 -0
- package/lib/__templates__/expo/client/heroui/primitives/tabs/tabs.types.ts +77 -0
- package/lib/__templates__/expo/client/heroui/primitives/tag-group/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/tag-group/tag-group.tsx +324 -0
- package/lib/__templates__/expo/client/heroui/primitives/tag-group/tag-group.types.ts +119 -0
- package/lib/__templates__/expo/client/heroui/primitives/toast/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/primitives/toast/toast.tsx +138 -0
- package/lib/__templates__/expo/client/heroui/primitives/toast/toast.types.ts +86 -0
- package/lib/__templates__/expo/client/heroui/providers/animation-settings/index.ts +8 -0
- package/lib/__templates__/expo/client/heroui/providers/animation-settings/provider.tsx +47 -0
- package/lib/__templates__/expo/client/heroui/providers/animation-settings/types.ts +27 -0
- package/lib/__templates__/expo/client/heroui/providers/hero-ui-native/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/providers/hero-ui-native/provider.tsx +67 -0
- package/lib/__templates__/expo/client/heroui/providers/hero-ui-native/types.ts +114 -0
- package/lib/__templates__/expo/client/heroui/providers/hero-ui-native-raw/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/providers/hero-ui-native-raw/provider.tsx +50 -0
- package/lib/__templates__/expo/client/heroui/providers/hero-ui-native-raw/types.ts +39 -0
- package/lib/__templates__/expo/client/heroui/providers/text-component/index.ts +2 -0
- package/lib/__templates__/expo/client/heroui/providers/text-component/provider.tsx +9 -0
- package/lib/__templates__/expo/client/heroui/providers/text-component/types.ts +52 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/index.ts +3 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/insets-container.tsx +87 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/provider.tsx +431 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/reducer.ts +34 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/toast-config.context.ts +27 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/toast-item-renderer.tsx +45 -0
- package/lib/__templates__/expo/client/heroui/providers/toast/types.ts +373 -0
- package/lib/__templates__/expo/client/heroui/styles/index.css +3 -0
- package/lib/__templates__/expo/client/heroui/styles/theme.css +112 -0
- package/lib/__templates__/expo/client/heroui/styles/utilities.css +8 -0
- package/lib/__templates__/expo/client/heroui/styles/variables.css +146 -0
- package/lib/__templates__/expo/client/package.json +4 -1
- package/lib/__templates__/expo/package.json +1 -1
- package/lib/__templates__/expo/pnpm-lock.yaml +68 -0
- package/lib/__templates__/nextjs/AGENTS.md +6 -4
- package/lib/__templates__/nextjs/eslint.config.mjs +9 -0
- package/lib/__templates__/taro/.coze +2 -0
- package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +1 -2
- package/lib/__templates__/taro/config/index.ts +1 -1
- package/lib/__templates__/taro/package.json +1 -0
- package/lib/__templates__/taro/project.config.json +1 -1
- package/lib/cli.js +246 -252
- package/package.json +3 -2
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
Displays a floating content panel anchored to a trigger element with placement and alignment options.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Popover } from '@/heroui';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Anatomy
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Popover>
|
|
15
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
16
|
+
<Popover.Portal>
|
|
17
|
+
<Popover.Overlay />
|
|
18
|
+
<Popover.Content>
|
|
19
|
+
<Popover.Arrow />
|
|
20
|
+
<Popover.Close />
|
|
21
|
+
<Popover.Title>...</Popover.Title>
|
|
22
|
+
<Popover.Description>...</Popover.Description>
|
|
23
|
+
</Popover.Content>
|
|
24
|
+
</Popover.Portal>
|
|
25
|
+
</Popover>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- **Popover**: Main container that manages open/close state, positioning, and provides context to child components.
|
|
29
|
+
- **Popover.Trigger**: Clickable element that toggles popover visibility. Wraps any child element with press handlers.
|
|
30
|
+
- **Popover.Portal**: Renders popover content in a portal layer above other content. Ensures proper stacking and positioning.
|
|
31
|
+
- **Popover.Overlay**: Optional background overlay. Can be transparent or semi-transparent to capture outside clicks.
|
|
32
|
+
- **Popover.Content**: Container for popover content with positioning, styling, and collision detection. Supports both popover and bottom-sheet presentations.
|
|
33
|
+
- **Popover.Arrow**: Optional arrow element pointing to the trigger. Automatically positioned based on placement.
|
|
34
|
+
- **Popover.Close**: Close button for the popover. Can accept custom children or uses default close icon.
|
|
35
|
+
- **Popover.Title**: Optional title text with pre-styled typography.
|
|
36
|
+
- **Popover.Description**: Optional description text with muted styling.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Basic Usage
|
|
41
|
+
|
|
42
|
+
The Popover component uses compound parts to create floating content panels.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<Popover>
|
|
46
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
47
|
+
<Popover.Portal>
|
|
48
|
+
<Popover.Overlay />
|
|
49
|
+
<Popover.Content presentation="popover">...</Popover.Content>
|
|
50
|
+
</Popover.Portal>
|
|
51
|
+
</Popover>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### With Title and Description
|
|
55
|
+
|
|
56
|
+
Structure popover content with title and description for better information hierarchy.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<Popover>
|
|
60
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
61
|
+
<Popover.Portal>
|
|
62
|
+
<Popover.Overlay />
|
|
63
|
+
<Popover.Content presentation="popover">
|
|
64
|
+
<Popover.Close />
|
|
65
|
+
<Popover.Title>...</Popover.Title>
|
|
66
|
+
<Popover.Description>...</Popover.Description>
|
|
67
|
+
</Popover.Content>
|
|
68
|
+
</Popover.Portal>
|
|
69
|
+
</Popover>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### With Arrow
|
|
73
|
+
|
|
74
|
+
Add an arrow pointing to the trigger element for better visual connection.
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
<Popover>
|
|
78
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
79
|
+
<Popover.Portal>
|
|
80
|
+
<Popover.Overlay />
|
|
81
|
+
<Popover.Content presentation="popover" placement="top">
|
|
82
|
+
<Popover.Arrow />
|
|
83
|
+
...
|
|
84
|
+
</Popover.Content>
|
|
85
|
+
</Popover.Portal>
|
|
86
|
+
</Popover>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
> **Note:** When using `<Popover.Arrow />`, you need to apply a border to `Popover.Content`, for instance using the `border border-border` class. This ensures the arrow visually connects properly with the content border.
|
|
90
|
+
|
|
91
|
+
### Width Control
|
|
92
|
+
|
|
93
|
+
Control the width of the popover content using the `width` prop.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
{
|
|
97
|
+
/* Fixed width in pixels */
|
|
98
|
+
}
|
|
99
|
+
<Popover>
|
|
100
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
101
|
+
<Popover.Portal>
|
|
102
|
+
<Popover.Overlay />
|
|
103
|
+
<Popover.Content presentation="popover" width={320}>
|
|
104
|
+
...
|
|
105
|
+
</Popover.Content>
|
|
106
|
+
</Popover.Portal>
|
|
107
|
+
</Popover>;
|
|
108
|
+
|
|
109
|
+
{
|
|
110
|
+
/* Match trigger width */
|
|
111
|
+
}
|
|
112
|
+
<Popover>
|
|
113
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
114
|
+
<Popover.Portal>
|
|
115
|
+
<Popover.Overlay />
|
|
116
|
+
<Popover.Content presentation="popover" width="trigger">
|
|
117
|
+
...
|
|
118
|
+
</Popover.Content>
|
|
119
|
+
</Popover.Portal>
|
|
120
|
+
</Popover>;
|
|
121
|
+
|
|
122
|
+
{
|
|
123
|
+
/* Full width (100%) */
|
|
124
|
+
}
|
|
125
|
+
<Popover>
|
|
126
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
127
|
+
<Popover.Portal>
|
|
128
|
+
<Popover.Overlay />
|
|
129
|
+
<Popover.Content presentation="popover" width="full">
|
|
130
|
+
...
|
|
131
|
+
</Popover.Content>
|
|
132
|
+
</Popover.Portal>
|
|
133
|
+
</Popover>;
|
|
134
|
+
|
|
135
|
+
{
|
|
136
|
+
/* Auto-size to content (default) */
|
|
137
|
+
}
|
|
138
|
+
<Popover>
|
|
139
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
140
|
+
<Popover.Portal>
|
|
141
|
+
<Popover.Overlay />
|
|
142
|
+
<Popover.Content presentation="popover" width="content-fit">
|
|
143
|
+
...
|
|
144
|
+
</Popover.Content>
|
|
145
|
+
</Popover.Portal>
|
|
146
|
+
</Popover>;
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Bottom Sheet Presentation
|
|
150
|
+
|
|
151
|
+
Use bottom sheet presentation for mobile-optimized interaction patterns.
|
|
152
|
+
|
|
153
|
+
> **Important:** The `presentation` prop on `Popover.Content` must match the `presentation` prop on `Popover.Root`. In development mode, a mismatch will throw an error.
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
<Popover presentation="bottom-sheet">
|
|
157
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
158
|
+
<Popover.Portal>
|
|
159
|
+
<Popover.Overlay />
|
|
160
|
+
<Popover.Content presentation="bottom-sheet">
|
|
161
|
+
<Popover.Title>...</Popover.Title>
|
|
162
|
+
<Popover.Description>...</Popover.Description>
|
|
163
|
+
<Button>Close</Button>
|
|
164
|
+
</Popover.Content>
|
|
165
|
+
</Popover.Portal>
|
|
166
|
+
</Popover>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Placement Options
|
|
170
|
+
|
|
171
|
+
Control where the popover appears relative to the trigger element.
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
<Popover>
|
|
175
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
176
|
+
<Popover.Portal>
|
|
177
|
+
<Popover.Content presentation="popover" placement="left">
|
|
178
|
+
...
|
|
179
|
+
</Popover.Content>
|
|
180
|
+
</Popover.Portal>
|
|
181
|
+
</Popover>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Alignment Options
|
|
185
|
+
|
|
186
|
+
Fine-tune content alignment along the placement axis.
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
<Popover>
|
|
190
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
191
|
+
<Popover.Portal>
|
|
192
|
+
<Popover.Content presentation="popover" placement="top" align="start">
|
|
193
|
+
...
|
|
194
|
+
</Popover.Content>
|
|
195
|
+
</Popover.Portal>
|
|
196
|
+
</Popover>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Custom Animation
|
|
200
|
+
|
|
201
|
+
Configure custom animations for open and close transitions using the `animation` prop on `Popover.Root`.
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
<Popover
|
|
205
|
+
animation={{
|
|
206
|
+
entering: {
|
|
207
|
+
type: 'spring',
|
|
208
|
+
config: { damping: 15, stiffness: 300 },
|
|
209
|
+
},
|
|
210
|
+
exiting: {
|
|
211
|
+
type: 'timing',
|
|
212
|
+
config: { duration: 200 },
|
|
213
|
+
},
|
|
214
|
+
}}
|
|
215
|
+
>
|
|
216
|
+
<Popover.Trigger>...</Popover.Trigger>
|
|
217
|
+
<Popover.Portal>
|
|
218
|
+
<Popover.Overlay />
|
|
219
|
+
<Popover.Content presentation="popover">...</Popover.Content>
|
|
220
|
+
</Popover.Portal>
|
|
221
|
+
</Popover>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Programmatic control
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
// Open or close popover programmatically using ref
|
|
228
|
+
const popoverRef = useRef<PopoverTriggerRef>(null);
|
|
229
|
+
|
|
230
|
+
// Open programmatically
|
|
231
|
+
popoverRef.current?.open();
|
|
232
|
+
|
|
233
|
+
// Close programmatically
|
|
234
|
+
popoverRef.current?.close();
|
|
235
|
+
|
|
236
|
+
// Full example
|
|
237
|
+
<Popover>
|
|
238
|
+
<Popover.Trigger ref={popoverRef} asChild>
|
|
239
|
+
<Button>Trigger</Button>
|
|
240
|
+
</Popover.Trigger>
|
|
241
|
+
<Popover.Portal>
|
|
242
|
+
<Popover.Overlay />
|
|
243
|
+
<Popover.Content presentation="popover">
|
|
244
|
+
<Text>Content</Text>
|
|
245
|
+
<Button onPress={() => popoverRef.current?.close()}>Close</Button>
|
|
246
|
+
</Popover.Content>
|
|
247
|
+
</Popover.Portal>
|
|
248
|
+
</Popover>;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Example
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
255
|
+
import { Button, Popover, useThemeColor } from '@/heroui';
|
|
256
|
+
import { Text, View } from 'react-native';
|
|
257
|
+
|
|
258
|
+
export default function PopoverExample() {
|
|
259
|
+
const themeColorMuted = useThemeColor('muted');
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<Popover>
|
|
263
|
+
<Popover.Trigger asChild>
|
|
264
|
+
<Button variant="tertiary" size="sm">
|
|
265
|
+
<Button.StartContent>
|
|
266
|
+
<Ionicons
|
|
267
|
+
name="information-circle"
|
|
268
|
+
size={20}
|
|
269
|
+
color={themeColorMuted}
|
|
270
|
+
/>
|
|
271
|
+
</Button.StartContent>
|
|
272
|
+
<Button.LabelContent>Show Info</Button.LabelContent>
|
|
273
|
+
</Button>
|
|
274
|
+
</Popover.Trigger>
|
|
275
|
+
<Popover.Portal>
|
|
276
|
+
<Popover.Overlay />
|
|
277
|
+
<Popover.Content
|
|
278
|
+
presentation="popover"
|
|
279
|
+
width={320}
|
|
280
|
+
className="gap-1 rounded-xl px-6 py-4"
|
|
281
|
+
>
|
|
282
|
+
<Popover.Close className="absolute top-3 right-3 z-50" />
|
|
283
|
+
<Popover.Title>Information</Popover.Title>
|
|
284
|
+
<Popover.Description>
|
|
285
|
+
This popover includes a title and description to provide more
|
|
286
|
+
structured information to users.
|
|
287
|
+
</Popover.Description>
|
|
288
|
+
</Popover.Content>
|
|
289
|
+
</Popover.Portal>
|
|
290
|
+
</Popover>
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
You can find more examples in the [GitHub repository](<https://github.com/heroui-inc/heroui-native/blob/rc/example/src/app/(home)/components/popover.tsx>).
|
|
296
|
+
|
|
297
|
+
## API Reference
|
|
298
|
+
|
|
299
|
+
### Popover
|
|
300
|
+
|
|
301
|
+
| prop | type | default | description |
|
|
302
|
+
| --------------- | ----------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
|
|
303
|
+
| `children` | `ReactNode` | - | Children elements to be rendered inside the popover |
|
|
304
|
+
| `isOpen` | `boolean` | - | Whether the popover is open (controlled mode) |
|
|
305
|
+
| `isDefaultOpen` | `boolean` | - | The open state of the popover when initially rendered (uncontrolled mode) |
|
|
306
|
+
| `onOpenChange` | `(isOpen: boolean) => void` | - | Callback when the popover open state changes |
|
|
307
|
+
| `animation` | `AnimationRootDisableAll` | - | Animation configuration. Can be `false`, `"disabled"`, `"disable-all"`, `true`, or `undefined` |
|
|
308
|
+
| `presentation` | `'popover' \| 'bottom-sheet'` | `'popover'` | Presentation mode for the popover content |
|
|
309
|
+
| `asChild` | `boolean` | `false` | Whether to render as a child element |
|
|
310
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
311
|
+
|
|
312
|
+
#### AnimationRootDisableAll
|
|
313
|
+
|
|
314
|
+
Animation configuration for popover root component. Can be:
|
|
315
|
+
|
|
316
|
+
- `false` or `"disabled"`: Disable only root animations
|
|
317
|
+
- `"disable-all"`: Disable all animations including children
|
|
318
|
+
- `true` or `undefined`: Use default animations
|
|
319
|
+
|
|
320
|
+
### Popover.Trigger
|
|
321
|
+
|
|
322
|
+
| prop | type | default | description |
|
|
323
|
+
| ------------------- | ---------------- | ------- | ------------------------------------------------------- |
|
|
324
|
+
| `children` | `ReactNode` | - | The trigger element content |
|
|
325
|
+
| `className` | `string` | - | Additional CSS classes for the trigger |
|
|
326
|
+
| `asChild` | `boolean` | `true` | Whether to render as a child element |
|
|
327
|
+
| `...PressableProps` | `PressableProps` | - | All standard React Native Pressable props are supported |
|
|
328
|
+
|
|
329
|
+
### Popover.Portal
|
|
330
|
+
|
|
331
|
+
| prop | type | default | description |
|
|
332
|
+
| -------------------------- | ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
333
|
+
| `children` | `ReactNode` | - | The portal content (required) |
|
|
334
|
+
| `disableFullWindowOverlay` | `boolean` | `false` | When true on iOS, uses View instead of FullWindowOverlay. Enables element inspector; overlay won't appear above native modals |
|
|
335
|
+
| `hostName` | `string` | - | Optional name of the host element for the portal |
|
|
336
|
+
| `forceMount` | `boolean` | - | Whether to force mount the component in the DOM |
|
|
337
|
+
| `className` | `string` | - | Additional CSS classes for the portal container |
|
|
338
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
339
|
+
|
|
340
|
+
### Popover.Overlay
|
|
341
|
+
|
|
342
|
+
| prop | type | default | description |
|
|
343
|
+
| ----------------------- | ------------------------- | ------- | ------------------------------------------------------------ |
|
|
344
|
+
| `className` | `string` | - | Additional CSS classes for the overlay |
|
|
345
|
+
| `closeOnPress` | `boolean` | `true` | Whether to close the popover when overlay is pressed |
|
|
346
|
+
| `forceMount` | `boolean` | - | Whether to force mount the component in the DOM |
|
|
347
|
+
| `animation` | `PopoverOverlayAnimation` | - | Animation configuration |
|
|
348
|
+
| `isAnimatedStyleActive` | `boolean` | `true` | Whether animated styles (react-native-reanimated) are active |
|
|
349
|
+
| `asChild` | `boolean` | `false` | Whether to render as a child element |
|
|
350
|
+
| `...Animated.ViewProps` | `Animated.ViewProps` | - | All Reanimated Animated.View props are supported |
|
|
351
|
+
|
|
352
|
+
#### PopoverOverlayAnimation
|
|
353
|
+
|
|
354
|
+
Animation configuration for popover overlay component. Can be:
|
|
355
|
+
|
|
356
|
+
- `false` or `"disabled"`: Disable all animations
|
|
357
|
+
- `true` or `undefined`: Use default animations
|
|
358
|
+
- `object`: Custom animation configuration
|
|
359
|
+
|
|
360
|
+
| prop | type | default | description |
|
|
361
|
+
| --------------- | -------------------------- | --------------------------- | ----------------------------------------------------------------------------------------- |
|
|
362
|
+
| `state` | `'disabled' \| boolean` | - | Disable animations while customizing properties |
|
|
363
|
+
| `opacity.value` | `[number, number, number]` | `[0, 1, 0]` | Opacity values [idle, open, close] - Takes effect for bottom-sheet/dialog presentation |
|
|
364
|
+
| `entering` | `EntryOrExitLayoutType` | FadeIn with duration 200ms | Custom Keyframe animation for entering transition - Takes effect for popover presentation |
|
|
365
|
+
| `exiting` | `EntryOrExitLayoutType` | FadeOut with duration 150ms | Custom Keyframe animation for exiting transition - Takes effect for popover presentation |
|
|
366
|
+
|
|
367
|
+
### Popover.Content (Popover Presentation)
|
|
368
|
+
|
|
369
|
+
| prop | type | default | description |
|
|
370
|
+
| ------------------------- | ------------------------------------------------ | --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
371
|
+
| `children` | `ReactNode` | - | The popover content |
|
|
372
|
+
| `presentation` | `'popover'` | `'popover'` | Presentation mode - must match Popover.Root presentation prop. When not provided, defaults to 'popover' |
|
|
373
|
+
| `width` | `number \| 'trigger' \| 'content-fit' \| 'full'` | `'content-fit'` | Width sizing strategy for the content |
|
|
374
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'bottom'` | Placement of the popover relative to trigger |
|
|
375
|
+
| `align` | `'start' \| 'center' \| 'end'` | `'center'` | Alignment along the placement axis |
|
|
376
|
+
| `avoidCollisions` | `boolean` | `true` | Whether to flip placement when close to viewport edges |
|
|
377
|
+
| `offset` | `number` | `9` | Distance from trigger element in pixels |
|
|
378
|
+
| `alignOffset` | `number` | `0` | Offset along the alignment axis in pixels |
|
|
379
|
+
| `disablePositioningStyle` | `boolean` | `false` | Whether to disable automatic positioning styles |
|
|
380
|
+
| `forceMount` | `boolean` | - | Whether to force mount the component in the DOM |
|
|
381
|
+
| `insets` | `Insets` | - | Screen edge insets to respect when positioning |
|
|
382
|
+
| `className` | `string` | - | Additional CSS classes for the content container |
|
|
383
|
+
| `animation` | `PopupPopoverContentAnimation` | - | Animation configuration |
|
|
384
|
+
| `isAnimatedStyleActive` | `boolean` | `true` | Whether animated styles (react-native-reanimated) are active |
|
|
385
|
+
| `asChild` | `boolean` | `false` | Whether to render as a child element |
|
|
386
|
+
| `...Animated.ViewProps` | `Animated.ViewProps` | - | All Reanimated Animated.View props are supported |
|
|
387
|
+
|
|
388
|
+
### Popover.Content (Bottom Sheet Presentation)
|
|
389
|
+
|
|
390
|
+
| prop | type | default | description |
|
|
391
|
+
| --------------------------- | ---------------------- | ------- | ---------------------------------------------------------------------------------------------- |
|
|
392
|
+
| `children` | `ReactNode` | - | The bottom sheet content |
|
|
393
|
+
| `presentation` | `'bottom-sheet'` | - | Presentation mode - must be 'bottom-sheet' and match Popover.Root presentation prop (required) |
|
|
394
|
+
| `contentContainerClassName` | `string` | - | Additional CSS classes for the content container |
|
|
395
|
+
| `contentContainerProps` | `BottomSheetViewProps` | - | Props for the content container |
|
|
396
|
+
| `enablePanDownToClose` | `boolean` | `true` | Whether pan down gesture closes the sheet |
|
|
397
|
+
| `backgroundStyle` | `ViewStyle` | - | Style for the bottom sheet background |
|
|
398
|
+
| `handleIndicatorStyle` | `ViewStyle` | - | Style for the bottom sheet handle indicator |
|
|
399
|
+
| `...BottomSheetProps` | `BottomSheetProps` | - | All @gorhom/bottom-sheet props are supported |
|
|
400
|
+
|
|
401
|
+
#### PopupPopoverContentAnimation
|
|
402
|
+
|
|
403
|
+
Animation configuration for popover content component (popover presentation). Can be:
|
|
404
|
+
|
|
405
|
+
- `false` or `"disabled"`: Disable all animations
|
|
406
|
+
- `true` or `undefined`: Use default animations
|
|
407
|
+
- `object`: Custom animation configuration
|
|
408
|
+
|
|
409
|
+
| prop | type | default | description |
|
|
410
|
+
| ---------- | ----------------------- | --------------------------------------------------------------- | ------------------------------------------------- |
|
|
411
|
+
| `state` | `'disabled' \| boolean` | - | Disable animations while customizing properties |
|
|
412
|
+
| `entering` | `EntryOrExitLayoutType` | Keyframe with translateY/translateX, scale, and opacity (200ms) | Custom Keyframe animation for entering transition |
|
|
413
|
+
| `exiting` | `EntryOrExitLayoutType` | Keyframe mirroring entering animation (150ms) | Custom Keyframe animation for exiting transition |
|
|
414
|
+
|
|
415
|
+
### Popover.Arrow
|
|
416
|
+
|
|
417
|
+
| prop | type | default | description |
|
|
418
|
+
| --------------------- | ---------------------------------------- | ------- | --------------------------------------------------------------------- |
|
|
419
|
+
| `className` | `string` | - | Additional CSS classes for the arrow |
|
|
420
|
+
| `height` | `number` | `12` | Height of the arrow in pixels |
|
|
421
|
+
| `width` | `number` | `20` | Width of the arrow in pixels |
|
|
422
|
+
| `fill` | `string` | - | Fill color of the arrow (defaults to content background) |
|
|
423
|
+
| `stroke` | `string` | - | Stroke (border) color of the arrow (defaults to content border color) |
|
|
424
|
+
| `strokeWidth` | `number` | `1` | Stroke width of the arrow border in pixels |
|
|
425
|
+
| `strokeBaselineInset` | `number` | `1` | Baseline inset in pixels for stroke alignment |
|
|
426
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Placement of the popover (inherited from content) |
|
|
427
|
+
| `children` | `ReactNode` | - | Custom arrow content (replaces default SVG arrow) |
|
|
428
|
+
| `style` | `StyleProp<ViewStyle>` | - | Additional styles for the arrow container |
|
|
429
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
430
|
+
|
|
431
|
+
### Popover.Close
|
|
432
|
+
|
|
433
|
+
Popover.Close extends [CloseButton](../close-button/close-button.md) and automatically handles popover dismissal when pressed.
|
|
434
|
+
|
|
435
|
+
### Popover.Title
|
|
436
|
+
|
|
437
|
+
| prop | type | default | description |
|
|
438
|
+
| -------------- | ----------- | ------- | -------------------------------------------------- |
|
|
439
|
+
| `children` | `ReactNode` | - | The title text content |
|
|
440
|
+
| `className` | `string` | - | Additional CSS classes for the title |
|
|
441
|
+
| `...TextProps` | `TextProps` | - | All standard React Native Text props are supported |
|
|
442
|
+
|
|
443
|
+
### Popover.Description
|
|
444
|
+
|
|
445
|
+
| prop | type | default | description |
|
|
446
|
+
| -------------- | ----------- | ------- | -------------------------------------------------- |
|
|
447
|
+
| `children` | `ReactNode` | - | The description text content |
|
|
448
|
+
| `className` | `string` | - | Additional CSS classes for the description |
|
|
449
|
+
| `...TextProps` | `TextProps` | - | All standard React Native Text props are supported |
|
|
450
|
+
|
|
451
|
+
## Hooks
|
|
452
|
+
|
|
453
|
+
### usePopover
|
|
454
|
+
|
|
455
|
+
Hook to access popover context values within custom components or compound components.
|
|
456
|
+
|
|
457
|
+
```tsx
|
|
458
|
+
import { usePopover } from '@/heroui';
|
|
459
|
+
|
|
460
|
+
const CustomContent = () => {
|
|
461
|
+
const { isOpen, onOpenChange, triggerPosition } = usePopover();
|
|
462
|
+
// ... your implementation
|
|
463
|
+
};
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
**Returns:** `UsePopoverReturn`
|
|
467
|
+
|
|
468
|
+
| property | type | description |
|
|
469
|
+
| -------------------- | --------------------------------------------------- | ----------------------------------------------------------------- |
|
|
470
|
+
| `isOpen` | `boolean` | Whether the popover is currently open |
|
|
471
|
+
| `onOpenChange` | `(open: boolean) => void` | Callback function to change the popover open state |
|
|
472
|
+
| `isDefaultOpen` | `boolean \| undefined` | Whether the popover should be open by default (uncontrolled mode) |
|
|
473
|
+
| `isDisabled` | `boolean \| undefined` | Whether the popover is disabled |
|
|
474
|
+
| `triggerPosition` | `LayoutPosition \| null` | The position of the trigger element relative to the viewport |
|
|
475
|
+
| `setTriggerPosition` | `(triggerPosition: LayoutPosition \| null) => void` | Function to update the trigger element's position |
|
|
476
|
+
| `contentLayout` | `LayoutRectangle \| null` | The layout measurements of the popover content |
|
|
477
|
+
| `setContentLayout` | `(contentLayout: LayoutRectangle \| null) => void` | Function to update the content layout measurements |
|
|
478
|
+
| `nativeID` | `string` | Unique identifier for the popover instance |
|
|
479
|
+
|
|
480
|
+
**Note:** This hook must be used within a `Popover` component. It will throw an error if called outside of the popover context.
|
|
481
|
+
|
|
482
|
+
### usePopoverAnimation
|
|
483
|
+
|
|
484
|
+
Hook to access popover animation state values within custom components or compound components.
|
|
485
|
+
|
|
486
|
+
```tsx
|
|
487
|
+
import { usePopoverAnimation } from '@/heroui';
|
|
488
|
+
|
|
489
|
+
const CustomContent = () => {
|
|
490
|
+
const { progress, isDragging } = usePopoverAnimation();
|
|
491
|
+
// ... your implementation
|
|
492
|
+
};
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
**Returns:** `UsePopoverAnimationReturn`
|
|
496
|
+
|
|
497
|
+
| property | type | description |
|
|
498
|
+
| ------------ | ---------------------- | ------------------------------------------------------------------ |
|
|
499
|
+
| `progress` | `SharedValue<number>` | Progress value for the popover animation (0=idle, 1=open, 2=close) |
|
|
500
|
+
| `isDragging` | `SharedValue<boolean>` | Dragging state shared value |
|
|
501
|
+
|
|
502
|
+
**Note:** This hook must be used within a `Popover` component. It will throw an error if called outside of the popover animation context.
|
|
503
|
+
|
|
504
|
+
## Special Notes
|
|
505
|
+
|
|
506
|
+
### Element Inspector (iOS)
|
|
507
|
+
|
|
508
|
+
Popover uses FullWindowOverlay on iOS. To enable the React Native element inspector during development, set `disableFullWindowOverlay={true}` on `Popover.Portal`. Tradeoff: the popover will not appear above native modals when disabled.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { tv } from 'tailwind-variants';
|
|
3
|
+
import { combineStyles } from '../../helpers/internal/utils';
|
|
4
|
+
|
|
5
|
+
const portal = tv({
|
|
6
|
+
base: 'absolute inset-0',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Overlay style definition
|
|
11
|
+
*
|
|
12
|
+
* @note ANIMATED PROPERTIES (cannot be set via className):
|
|
13
|
+
* The following property is animated and cannot be overridden using Tailwind classes:
|
|
14
|
+
* - `opacity` - Animated for overlay show/hide transitions (idle: 0, open: 1, close: 0)
|
|
15
|
+
*
|
|
16
|
+
* To customize this property, use the `animation` prop on `Popover.Overlay`:
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Popover.Overlay
|
|
19
|
+
* animation={{
|
|
20
|
+
* opacity: { value: [0, 1, 0] }
|
|
21
|
+
* }}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* To completely disable animated styles and apply your own via className or style prop,
|
|
26
|
+
* set `isAnimatedStyleActive={false}` on `Popover.Overlay`.
|
|
27
|
+
*/
|
|
28
|
+
const overlay = tv({
|
|
29
|
+
base: 'absolute inset-0',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Popover content style definition
|
|
34
|
+
*
|
|
35
|
+
* @note ANIMATED PROPERTIES (cannot be set via className):
|
|
36
|
+
* The following properties are animated and cannot be overridden using Tailwind classes:
|
|
37
|
+
* - `opacity` - Animated for content show/hide transitions (idle: 0, open: 1, close: 0)
|
|
38
|
+
* - `transform` (specifically `scale`, `translateX`, `translateY`) - Animated for content show/hide transitions (scale: idle: 0.95, open: 1, close: 0.95; translateX/translateY: based on placement)
|
|
39
|
+
* - `transformOrigin` - Animated for content show/hide transitions (based on placement: 'top', 'bottom', 'left', 'right')
|
|
40
|
+
*
|
|
41
|
+
* To customize these properties, use the `animation` prop on `Popover.Content`:
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Popover.Content
|
|
44
|
+
* presentation="popover"
|
|
45
|
+
* animation={{
|
|
46
|
+
* opacity: { value: [0, 1, 0] },
|
|
47
|
+
* scale: { value: [0.95, 1, 0.95] },
|
|
48
|
+
* translateX: { value: [4, 0, 4] },
|
|
49
|
+
* translateY: { value: [4, 0, 4] },
|
|
50
|
+
* transformOrigin: { value: 'top' }
|
|
51
|
+
* }}
|
|
52
|
+
* />
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* To completely disable animated styles and apply your own via className or style prop,
|
|
56
|
+
* set `isAnimatedStyleActive={false}` on `Popover.Content`.
|
|
57
|
+
*/
|
|
58
|
+
const content = tv({
|
|
59
|
+
base: 'absolute bg-overlay p-3 px-4 rounded-3xl shadow-overlay',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @note When Popover.Content uses `presentation="bottom-sheet"`, it uses `bottomSheetClassNames`
|
|
64
|
+
* from `../bottom-sheet/bottom-sheet.styles` instead of `popoverClassNames.content`.
|
|
65
|
+
* See `popover.tsx` PopoverContentBottomSheet component for usage.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
const close = tv({
|
|
69
|
+
base: '',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const label = tv({
|
|
73
|
+
base: 'text-lg font-medium text-foreground',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const description = tv({
|
|
77
|
+
base: 'text-base/snug text-muted',
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const arrow = tv({
|
|
81
|
+
base: 'absolute z-50',
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const popoverClassNames = combineStyles({
|
|
85
|
+
portal,
|
|
86
|
+
overlay,
|
|
87
|
+
content,
|
|
88
|
+
close,
|
|
89
|
+
label,
|
|
90
|
+
description,
|
|
91
|
+
arrow,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export const popoverStyleSheet = StyleSheet.create({
|
|
95
|
+
contentContainer: {
|
|
96
|
+
borderCurve: 'continuous',
|
|
97
|
+
},
|
|
98
|
+
});
|