@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,620 @@
|
|
|
1
|
+
# Menu
|
|
2
|
+
|
|
3
|
+
A floating context menu with positioning, selection groups, and multiple presentation modes.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Menu } from '@/heroui';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Anatomy
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Menu>
|
|
15
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
16
|
+
<Menu.Portal>
|
|
17
|
+
<Menu.Overlay />
|
|
18
|
+
<Menu.Content presentation="popover">
|
|
19
|
+
<Menu.Close />
|
|
20
|
+
<Menu.Label>...</Menu.Label>
|
|
21
|
+
<Menu.Group>
|
|
22
|
+
<Menu.Item>
|
|
23
|
+
<Menu.ItemIndicator />
|
|
24
|
+
<Menu.ItemTitle>...</Menu.ItemTitle>
|
|
25
|
+
<Menu.ItemDescription>...</Menu.ItemDescription>
|
|
26
|
+
</Menu.Item>
|
|
27
|
+
</Menu.Group>
|
|
28
|
+
</Menu.Content>
|
|
29
|
+
</Menu.Portal>
|
|
30
|
+
</Menu>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **Menu**: Main container that manages open/close state, positioning, and provides context to child components.
|
|
34
|
+
- **Menu.Trigger**: Clickable element that toggles the menu visibility.
|
|
35
|
+
- **Menu.Portal**: Renders menu content in a portal layer above other content.
|
|
36
|
+
- **Menu.Overlay**: Optional background overlay to capture outside clicks and close the menu.
|
|
37
|
+
- **Menu.Content**: Container for menu content with two presentation modes: floating popover with positioning and collision detection, or bottom sheet modal.
|
|
38
|
+
- **Menu.Close**: Close button that dismisses the menu when pressed.
|
|
39
|
+
- **Menu.Label**: Non-interactive section heading text within the menu.
|
|
40
|
+
- **Menu.Group**: Groups menu items with optional selection state (none, single, multiple).
|
|
41
|
+
- **Menu.Item**: Pressable menu item with animated press feedback. Standalone or within a Group for selection.
|
|
42
|
+
- **Menu.ItemTitle**: Primary label text for a menu item.
|
|
43
|
+
- **Menu.ItemDescription**: Secondary description text for a menu item.
|
|
44
|
+
- **Menu.ItemIndicator**: Visual selection indicator (checkmark or dot) for a menu item.
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
### Basic Usage
|
|
49
|
+
|
|
50
|
+
The Menu component uses compound parts to create a floating context menu.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<Menu>
|
|
54
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
55
|
+
<Menu.Portal>
|
|
56
|
+
<Menu.Overlay />
|
|
57
|
+
<Menu.Content presentation="popover" width={220}>
|
|
58
|
+
<Menu.Item>
|
|
59
|
+
<Menu.ItemTitle>View Profile</Menu.ItemTitle>
|
|
60
|
+
</Menu.Item>
|
|
61
|
+
<Menu.Item>
|
|
62
|
+
<Menu.ItemTitle>Settings</Menu.ItemTitle>
|
|
63
|
+
</Menu.Item>
|
|
64
|
+
</Menu.Content>
|
|
65
|
+
</Menu.Portal>
|
|
66
|
+
</Menu>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With Item Descriptions
|
|
70
|
+
|
|
71
|
+
Add secondary description text to menu items alongside titles.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<Menu>
|
|
75
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
76
|
+
<Menu.Portal>
|
|
77
|
+
<Menu.Overlay />
|
|
78
|
+
<Menu.Content presentation="popover" width={260}>
|
|
79
|
+
<Menu.Item className="items-start">
|
|
80
|
+
<View className="flex-1">
|
|
81
|
+
<Menu.ItemTitle>New file</Menu.ItemTitle>
|
|
82
|
+
<Menu.ItemDescription>Create a new file</Menu.ItemDescription>
|
|
83
|
+
</View>
|
|
84
|
+
</Menu.Item>
|
|
85
|
+
<Menu.Item className="items-start">
|
|
86
|
+
<View className="flex-1">
|
|
87
|
+
<Menu.ItemTitle>Copy link</Menu.ItemTitle>
|
|
88
|
+
<Menu.ItemDescription>Copy the file link</Menu.ItemDescription>
|
|
89
|
+
</View>
|
|
90
|
+
</Menu.Item>
|
|
91
|
+
</Menu.Content>
|
|
92
|
+
</Menu.Portal>
|
|
93
|
+
</Menu>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Single Selection
|
|
97
|
+
|
|
98
|
+
Use `Menu.Group` with `selectionMode="single"` to allow one selected item at a time.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
const [theme, setTheme] = useState<Set<MenuKey>>(() => new Set(['system']));
|
|
102
|
+
|
|
103
|
+
<Menu>
|
|
104
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
105
|
+
<Menu.Portal>
|
|
106
|
+
<Menu.Overlay />
|
|
107
|
+
<Menu.Content presentation="popover" width={180}>
|
|
108
|
+
<Menu.Label>Appearance</Menu.Label>
|
|
109
|
+
<Menu.Group
|
|
110
|
+
selectionMode="single"
|
|
111
|
+
selectedKeys={theme}
|
|
112
|
+
onSelectionChange={setTheme}
|
|
113
|
+
>
|
|
114
|
+
<Menu.Item id="light">
|
|
115
|
+
<Menu.ItemIndicator />
|
|
116
|
+
<Menu.ItemTitle>Light</Menu.ItemTitle>
|
|
117
|
+
</Menu.Item>
|
|
118
|
+
<Menu.Item id="dark">
|
|
119
|
+
<Menu.ItemIndicator />
|
|
120
|
+
<Menu.ItemTitle>Dark</Menu.ItemTitle>
|
|
121
|
+
</Menu.Item>
|
|
122
|
+
<Menu.Item id="system">
|
|
123
|
+
<Menu.ItemIndicator />
|
|
124
|
+
<Menu.ItemTitle>System</Menu.ItemTitle>
|
|
125
|
+
</Menu.Item>
|
|
126
|
+
</Menu.Group>
|
|
127
|
+
</Menu.Content>
|
|
128
|
+
</Menu.Portal>
|
|
129
|
+
</Menu>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Multiple Selection
|
|
133
|
+
|
|
134
|
+
Use `selectionMode="multiple"` to allow selecting multiple items simultaneously.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
const [textStyles, setTextStyles] = useState<Set<MenuKey>>(
|
|
138
|
+
() => new Set(['bold', 'italic'])
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
<Menu>
|
|
142
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
143
|
+
<Menu.Portal>
|
|
144
|
+
<Menu.Overlay />
|
|
145
|
+
<Menu.Content presentation="popover" width={250}>
|
|
146
|
+
<Menu.Label>Text Style</Menu.Label>
|
|
147
|
+
<Menu.Group
|
|
148
|
+
selectionMode="multiple"
|
|
149
|
+
selectedKeys={textStyles}
|
|
150
|
+
onSelectionChange={setTextStyles}
|
|
151
|
+
>
|
|
152
|
+
<Menu.Item id="bold">
|
|
153
|
+
<Menu.ItemIndicator />
|
|
154
|
+
<Menu.ItemTitle>Bold</Menu.ItemTitle>
|
|
155
|
+
</Menu.Item>
|
|
156
|
+
<Menu.Item id="italic">
|
|
157
|
+
<Menu.ItemIndicator />
|
|
158
|
+
<Menu.ItemTitle>Italic</Menu.ItemTitle>
|
|
159
|
+
</Menu.Item>
|
|
160
|
+
<Menu.Item id="underline">
|
|
161
|
+
<Menu.ItemIndicator />
|
|
162
|
+
<Menu.ItemTitle>Underline</Menu.ItemTitle>
|
|
163
|
+
</Menu.Item>
|
|
164
|
+
</Menu.Group>
|
|
165
|
+
</Menu.Content>
|
|
166
|
+
</Menu.Portal>
|
|
167
|
+
</Menu>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Danger Variant
|
|
171
|
+
|
|
172
|
+
Use `variant="danger"` on a menu item for destructive actions.
|
|
173
|
+
|
|
174
|
+
```tsx
|
|
175
|
+
<Menu>
|
|
176
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
177
|
+
<Menu.Portal>
|
|
178
|
+
<Menu.Overlay />
|
|
179
|
+
<Menu.Content presentation="popover" width={220}>
|
|
180
|
+
<Menu.Item>
|
|
181
|
+
<Menu.ItemTitle>Edit</Menu.ItemTitle>
|
|
182
|
+
</Menu.Item>
|
|
183
|
+
<Menu.Item variant="danger">
|
|
184
|
+
<Menu.ItemTitle>Delete</Menu.ItemTitle>
|
|
185
|
+
</Menu.Item>
|
|
186
|
+
</Menu.Content>
|
|
187
|
+
</Menu.Portal>
|
|
188
|
+
</Menu>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Placements
|
|
192
|
+
|
|
193
|
+
Control where the menu appears relative to the trigger.
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
<Menu>
|
|
197
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
198
|
+
<Menu.Portal>
|
|
199
|
+
<Menu.Overlay />
|
|
200
|
+
<Menu.Content presentation="popover" placement="right" width={200}>
|
|
201
|
+
<Menu.Item>
|
|
202
|
+
<Menu.ItemTitle>Option A</Menu.ItemTitle>
|
|
203
|
+
</Menu.Item>
|
|
204
|
+
<Menu.Item>
|
|
205
|
+
<Menu.ItemTitle>Option B</Menu.ItemTitle>
|
|
206
|
+
</Menu.Item>
|
|
207
|
+
</Menu.Content>
|
|
208
|
+
</Menu.Portal>
|
|
209
|
+
</Menu>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Bottom Sheet Presentation
|
|
213
|
+
|
|
214
|
+
Use `presentation="bottom-sheet"` to display menu content as a bottom sheet modal.
|
|
215
|
+
|
|
216
|
+
```tsx
|
|
217
|
+
<Menu presentation="bottom-sheet">
|
|
218
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
219
|
+
<Menu.Portal>
|
|
220
|
+
<Menu.Overlay />
|
|
221
|
+
<Menu.Content presentation="bottom-sheet">
|
|
222
|
+
<Menu.Item>
|
|
223
|
+
<Menu.ItemTitle>Option A</Menu.ItemTitle>
|
|
224
|
+
</Menu.Item>
|
|
225
|
+
<Menu.Item>
|
|
226
|
+
<Menu.ItemTitle>Option B</Menu.ItemTitle>
|
|
227
|
+
</Menu.Item>
|
|
228
|
+
</Menu.Content>
|
|
229
|
+
</Menu.Portal>
|
|
230
|
+
</Menu>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Dot Indicator
|
|
234
|
+
|
|
235
|
+
Use `variant="dot"` on `Menu.ItemIndicator` to show a filled circle instead of a checkmark.
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
<Menu>
|
|
239
|
+
<Menu.Trigger>...</Menu.Trigger>
|
|
240
|
+
<Menu.Portal>
|
|
241
|
+
<Menu.Overlay />
|
|
242
|
+
<Menu.Content presentation="popover" width={180}>
|
|
243
|
+
<Menu.Group
|
|
244
|
+
selectionMode="single"
|
|
245
|
+
selectedKeys={alignment}
|
|
246
|
+
onSelectionChange={setAlignment}
|
|
247
|
+
>
|
|
248
|
+
<Menu.Item id="left">
|
|
249
|
+
<Menu.ItemIndicator variant="dot" />
|
|
250
|
+
<Menu.ItemTitle>Left</Menu.ItemTitle>
|
|
251
|
+
</Menu.Item>
|
|
252
|
+
<Menu.Item id="center">
|
|
253
|
+
<Menu.ItemIndicator variant="dot" />
|
|
254
|
+
<Menu.ItemTitle>Center</Menu.ItemTitle>
|
|
255
|
+
</Menu.Item>
|
|
256
|
+
<Menu.Item id="right">
|
|
257
|
+
<Menu.ItemIndicator variant="dot" />
|
|
258
|
+
<Menu.ItemTitle>Right</Menu.ItemTitle>
|
|
259
|
+
</Menu.Item>
|
|
260
|
+
</Menu.Group>
|
|
261
|
+
</Menu.Content>
|
|
262
|
+
</Menu.Portal>
|
|
263
|
+
</Menu>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Example
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import type { MenuKey } from '@/heroui';
|
|
270
|
+
import { Button, Menu, Separator } from '@/heroui';
|
|
271
|
+
import { useState } from 'react';
|
|
272
|
+
import { Text, View } from 'react-native';
|
|
273
|
+
|
|
274
|
+
export default function MenuExample() {
|
|
275
|
+
const [textStyles, setTextStyles] = useState<Set<MenuKey>>(
|
|
276
|
+
() => new Set(['bold', 'italic'])
|
|
277
|
+
);
|
|
278
|
+
const [alignment, setAlignment] = useState<Set<MenuKey>>(
|
|
279
|
+
() => new Set(['left'])
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
return (
|
|
283
|
+
<Menu>
|
|
284
|
+
<Menu.Trigger asChild>
|
|
285
|
+
<Button variant="secondary">Styles</Button>
|
|
286
|
+
</Menu.Trigger>
|
|
287
|
+
<Menu.Portal>
|
|
288
|
+
<Menu.Overlay />
|
|
289
|
+
<Menu.Content presentation="popover" width={250}>
|
|
290
|
+
<Menu.Label className="mb-1">Text Style</Menu.Label>
|
|
291
|
+
<Menu.Group
|
|
292
|
+
selectionMode="multiple"
|
|
293
|
+
selectedKeys={textStyles}
|
|
294
|
+
onSelectionChange={setTextStyles}
|
|
295
|
+
>
|
|
296
|
+
<Menu.Item id="bold">
|
|
297
|
+
<Menu.ItemIndicator />
|
|
298
|
+
<Menu.ItemTitle>Bold</Menu.ItemTitle>
|
|
299
|
+
<Text className="text-sm text-muted">⌘ B</Text>
|
|
300
|
+
</Menu.Item>
|
|
301
|
+
<Menu.Item id="italic">
|
|
302
|
+
<Menu.ItemIndicator />
|
|
303
|
+
<Menu.ItemTitle>Italic</Menu.ItemTitle>
|
|
304
|
+
<Text className="text-sm text-muted">⌘ I</Text>
|
|
305
|
+
</Menu.Item>
|
|
306
|
+
<Menu.Item id="underline">
|
|
307
|
+
<Menu.ItemIndicator />
|
|
308
|
+
<Menu.ItemTitle>Underline</Menu.ItemTitle>
|
|
309
|
+
<Text className="text-sm text-muted">⌘ U</Text>
|
|
310
|
+
</Menu.Item>
|
|
311
|
+
</Menu.Group>
|
|
312
|
+
<Separator className="mx-2 my-2 opacity-75" />
|
|
313
|
+
<Menu.Label className="mb-1">Text Alignment</Menu.Label>
|
|
314
|
+
<Menu.Group
|
|
315
|
+
selectionMode="single"
|
|
316
|
+
selectedKeys={alignment}
|
|
317
|
+
onSelectionChange={setAlignment}
|
|
318
|
+
>
|
|
319
|
+
<Menu.Item id="left">
|
|
320
|
+
<Menu.ItemIndicator variant="dot" />
|
|
321
|
+
<Menu.ItemTitle>Left</Menu.ItemTitle>
|
|
322
|
+
</Menu.Item>
|
|
323
|
+
<Menu.Item id="center">
|
|
324
|
+
<Menu.ItemIndicator variant="dot" />
|
|
325
|
+
<Menu.ItemTitle>Center</Menu.ItemTitle>
|
|
326
|
+
</Menu.Item>
|
|
327
|
+
<Menu.Item id="right">
|
|
328
|
+
<Menu.ItemIndicator variant="dot" />
|
|
329
|
+
<Menu.ItemTitle>Right</Menu.ItemTitle>
|
|
330
|
+
</Menu.Item>
|
|
331
|
+
</Menu.Group>
|
|
332
|
+
</Menu.Content>
|
|
333
|
+
</Menu.Portal>
|
|
334
|
+
</Menu>
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
You can find more examples in the [GitHub repository](https://github.com/heroui-inc/heroui-native/blob/rc/example/src/app/(home)/components/menu.tsx).
|
|
340
|
+
|
|
341
|
+
## API Reference
|
|
342
|
+
|
|
343
|
+
### Menu
|
|
344
|
+
|
|
345
|
+
| prop | type | default | description |
|
|
346
|
+
| ----------------- | ------------------------------------------ | ------------ | -------------------------------------------------------- |
|
|
347
|
+
| `children` | `React.ReactNode` | - | The content of the menu |
|
|
348
|
+
| `presentation` | `'popover' \| 'bottom-sheet'` | `'popover'` | Presentation mode for the menu content |
|
|
349
|
+
| `isOpen` | `boolean` | - | Controlled open state of the menu |
|
|
350
|
+
| `isDefaultOpen` | `boolean` | - | Open state when initially rendered (uncontrolled) |
|
|
351
|
+
| `isDisabled` | `boolean` | - | Whether the menu is disabled |
|
|
352
|
+
| `animation` | `MenuRootAnimation` | - | Animation configuration for menu root |
|
|
353
|
+
| `onOpenChange` | `(open: boolean) => void` | - | Callback fired when the menu open state changes |
|
|
354
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
355
|
+
|
|
356
|
+
#### MenuRootAnimation
|
|
357
|
+
|
|
358
|
+
Animation configuration for menu root component. Can be:
|
|
359
|
+
|
|
360
|
+
- `"disable-all"`: Disable all animations including children
|
|
361
|
+
- `true` or `undefined`: Use default animations
|
|
362
|
+
|
|
363
|
+
### Menu.Trigger
|
|
364
|
+
|
|
365
|
+
| prop | type | default | description |
|
|
366
|
+
| ------------------- | ----------------- | ------- | ------------------------------------------------------- |
|
|
367
|
+
| `children` | `React.ReactNode` | - | The trigger element content |
|
|
368
|
+
| `className` | `string` | - | Additional CSS class for the trigger |
|
|
369
|
+
| `isDisabled` | `boolean` | `false` | Whether the trigger is disabled |
|
|
370
|
+
| `asChild` | `boolean` | - | Render as child element using Slot pattern |
|
|
371
|
+
| `...PressableProps` | `PressableProps` | - | All standard React Native Pressable props are supported |
|
|
372
|
+
|
|
373
|
+
### Menu.Portal
|
|
374
|
+
|
|
375
|
+
| prop | type | default | description |
|
|
376
|
+
| --------------------------- | ----------------- | ------- | ------------------------------------------------------------------------------------- |
|
|
377
|
+
| `children` | `React.ReactNode` | - | The portal content |
|
|
378
|
+
| `className` | `string` | - | Additional CSS class for the portal container |
|
|
379
|
+
| `disableFullWindowOverlay` | `boolean` | `false` | Use a regular View instead of FullWindowOverlay on iOS |
|
|
380
|
+
| `hostName` | `string` | - | Optional name of the host element for the portal |
|
|
381
|
+
| `forceMount` | `boolean` | - | Force mount the portal regardless of open state |
|
|
382
|
+
|
|
383
|
+
### Menu.Overlay
|
|
384
|
+
|
|
385
|
+
| prop | type | default | description |
|
|
386
|
+
| ------------------------ | ------------------------ | ------- | ------------------------------------------------------- |
|
|
387
|
+
| `className` | `string` | - | Additional CSS class for the overlay |
|
|
388
|
+
| `closeOnPress` | `boolean` | `true` | Whether to close the menu when the overlay is pressed |
|
|
389
|
+
| `animation` | `MenuOverlayAnimation` | - | Animation configuration for overlay |
|
|
390
|
+
| `isAnimatedStyleActive` | `boolean` | `true` | Whether animated styles (react-native-reanimated) are active |
|
|
391
|
+
| `forceMount` | `boolean` | - | Force mount the overlay regardless of open state |
|
|
392
|
+
| `...PressableProps` | `PressableProps` | - | All standard React Native Pressable props are supported |
|
|
393
|
+
|
|
394
|
+
#### MenuOverlayAnimation
|
|
395
|
+
|
|
396
|
+
Animation configuration for menu overlay component. Can be:
|
|
397
|
+
|
|
398
|
+
- `false` or `"disabled"`: Disable all animations
|
|
399
|
+
- `true` or `undefined`: Use default animations
|
|
400
|
+
- `object`: Custom animation configuration
|
|
401
|
+
|
|
402
|
+
| prop | type | default | description |
|
|
403
|
+
| ------------------------ | ----------------------------- | --------------------------- | ---------------------------------------------------- |
|
|
404
|
+
| `state` | `'disabled' \| boolean` | - | Disable animations while customizing properties |
|
|
405
|
+
| `opacity.entering.value` | `EntryOrExitLayoutType` | `FadeIn.duration(200)` | Custom entering animation for overlay |
|
|
406
|
+
| `opacity.exiting.value` | `EntryOrExitLayoutType` | `FadeOut.duration(150)` | Custom exiting animation for overlay |
|
|
407
|
+
|
|
408
|
+
### Menu.Content (Popover)
|
|
409
|
+
|
|
410
|
+
Props when `presentation="popover"`.
|
|
411
|
+
|
|
412
|
+
| prop | type | default | description |
|
|
413
|
+
| ------------------- | ---------------------------------------------------- | ---------------- | ---------------------------------------------------------- |
|
|
414
|
+
| `children` | `React.ReactNode` | - | The menu content |
|
|
415
|
+
| `presentation` | `'popover'` | - | Presentation mode (must match Menu root) |
|
|
416
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'bottom'` | Where the menu appears relative to the trigger |
|
|
417
|
+
| `align` | `'start' \| 'center' \| 'end'` | `'center'` | Alignment of the menu relative to the trigger |
|
|
418
|
+
| `avoidCollisions` | `boolean` | `true` | Whether to reposition to avoid screen edges |
|
|
419
|
+
| `offset` | `number` | `9` | Distance from the trigger element in pixels |
|
|
420
|
+
| `alignOffset` | `number` | `0` | Offset along the alignment axis in pixels |
|
|
421
|
+
| `width` | `'content-fit' \| 'trigger' \| 'full' \| number` | `'content-fit'` | Content width sizing strategy |
|
|
422
|
+
| `className` | `string` | - | Additional CSS class for the content container |
|
|
423
|
+
| `animation` | `MenuContentAnimation` | - | Animation configuration for content |
|
|
424
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
425
|
+
|
|
426
|
+
#### MenuContentAnimation
|
|
427
|
+
|
|
428
|
+
Animation configuration for menu popover content component. Can be:
|
|
429
|
+
|
|
430
|
+
- `false` or `"disabled"`: Disable all animations
|
|
431
|
+
- `true` or `undefined`: Use default animations
|
|
432
|
+
- `object`: Custom animation configuration
|
|
433
|
+
|
|
434
|
+
| prop | type | default | description |
|
|
435
|
+
| ------------------ | ----------------------------- | ------------------------------------ | ----------------------------------------------- |
|
|
436
|
+
| `state` | `'disabled' \| boolean` | - | Disable animations while customizing properties |
|
|
437
|
+
| `entering.value` | `EntryOrExitLayoutType` | Scale + fade entering animation | Custom entering animation for content |
|
|
438
|
+
| `exiting.value` | `EntryOrExitLayoutType` | Scale + fade exiting animation | Custom exiting animation for content |
|
|
439
|
+
|
|
440
|
+
### Menu.Content (Bottom Sheet)
|
|
441
|
+
|
|
442
|
+
Props when `presentation="bottom-sheet"`. Extends `@gorhom/bottom-sheet` BottomSheet props.
|
|
443
|
+
|
|
444
|
+
| prop | type | default | description |
|
|
445
|
+
| ------------------------------ | ------------------------------------------ | ------- | ---------------------------------------------- |
|
|
446
|
+
| `children` | `React.ReactNode` | - | The bottom sheet content |
|
|
447
|
+
| `presentation` | `'bottom-sheet'` | - | Presentation mode (must match Menu root) |
|
|
448
|
+
| `className` | `string` | - | Additional CSS class for the bottom sheet |
|
|
449
|
+
| `backgroundClassName` | `string` | - | Additional CSS class for the background |
|
|
450
|
+
| `handleIndicatorClassName` | `string` | - | Additional CSS class for the handle indicator |
|
|
451
|
+
| `contentContainerClassName` | `string` | - | Additional CSS class for the content container |
|
|
452
|
+
| `contentContainerProps` | `Omit<BottomSheetViewProps, 'children'>` | - | Props for the content container |
|
|
453
|
+
| `animation` | `AnimationDisabled` | - | Set to `false` or `"disabled"` to disable animations |
|
|
454
|
+
| `...BottomSheetProps` | `Partial<BottomSheetProps>` | - | All `@gorhom/bottom-sheet` props are supported |
|
|
455
|
+
|
|
456
|
+
### Menu.Close
|
|
457
|
+
|
|
458
|
+
Extends `CloseButtonProps`. Automatically closes the menu when pressed.
|
|
459
|
+
|
|
460
|
+
| prop | type | default | description |
|
|
461
|
+
| ------------------- | ----------------- | ------- | ------------------------------------------------------- |
|
|
462
|
+
| `iconProps` | `CloseButtonIconProps` | - | Props for customizing the close icon |
|
|
463
|
+
| `...ButtonProps` | `ButtonRootProps` | - | All Button root props are supported |
|
|
464
|
+
|
|
465
|
+
### Menu.Group
|
|
466
|
+
|
|
467
|
+
| prop | type | default | description |
|
|
468
|
+
| ----------------------- | ------------------------------------- | -------- | ------------------------------------------------------------------- |
|
|
469
|
+
| `children` | `React.ReactNode` | - | The group content (Menu.Item elements) |
|
|
470
|
+
| `selectionMode` | `'none' \| 'single' \| 'multiple'` | `'none'` | The type of selection allowed in the group |
|
|
471
|
+
| `selectedKeys` | `Iterable<MenuKey>` | - | Currently selected keys (controlled) |
|
|
472
|
+
| `defaultSelectedKeys` | `Iterable<MenuKey>` | - | Initially selected keys (uncontrolled) |
|
|
473
|
+
| `isDisabled` | `boolean` | `false` | Whether the entire group is disabled |
|
|
474
|
+
| `disabledKeys` | `Iterable<MenuKey>` | - | Keys of items that should be disabled |
|
|
475
|
+
| `shouldCloseOnSelect` | `boolean` | - | Whether selecting an item should close the menu |
|
|
476
|
+
| `className` | `string` | - | Additional CSS class for the group container |
|
|
477
|
+
| `onSelectionChange` | `(keys: Set<MenuKey>) => void` | - | Callback fired when the selection changes |
|
|
478
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
479
|
+
|
|
480
|
+
### Menu.Label
|
|
481
|
+
|
|
482
|
+
| prop | type | default | description |
|
|
483
|
+
| -------------- | ----------------- | ------- | ------------------------------------------------------ |
|
|
484
|
+
| `children` | `React.ReactNode` | - | The label text content |
|
|
485
|
+
| `className` | `string` | - | Additional CSS class for the label |
|
|
486
|
+
| `...TextProps` | `TextProps` | - | All standard React Native Text props are supported |
|
|
487
|
+
|
|
488
|
+
### Menu.Item
|
|
489
|
+
|
|
490
|
+
| prop | type | default | description |
|
|
491
|
+
| ----------------------- | ---------------------------------------------------------------- | ----------- | ---------------------------------------------------------- |
|
|
492
|
+
| `children` | `React.ReactNode \| ((props: MenuItemRenderProps) => ReactNode)` | - | Child elements or a render function |
|
|
493
|
+
| `id` | `MenuKey` | - | Unique identifier, required when inside a Menu.Group |
|
|
494
|
+
| `variant` | `'default' \| 'danger'` | `'default'` | Visual variant of the menu item |
|
|
495
|
+
| `isDisabled` | `boolean` | `false` | Whether the item is disabled |
|
|
496
|
+
| `isSelected` | `boolean` | - | Controlled selected state for standalone items |
|
|
497
|
+
| `shouldCloseOnSelect` | `boolean` | `true` | Whether pressing this item should close the menu |
|
|
498
|
+
| `className` | `string` | - | Additional CSS class for the item |
|
|
499
|
+
| `animation` | `MenuItemAnimation` | - | Animation configuration for press feedback |
|
|
500
|
+
| `isAnimatedStyleActive` | `boolean` | `true` | Whether animated styles (react-native-reanimated) are active |
|
|
501
|
+
| `onSelectedChange` | `(selected: boolean) => void` | - | Callback when standalone item's selected state changes |
|
|
502
|
+
| `...PressableProps` | `PressableProps` | - | All standard React Native Pressable props are supported |
|
|
503
|
+
|
|
504
|
+
#### MenuItemRenderProps
|
|
505
|
+
|
|
506
|
+
Props passed to the render function when `children` is a function.
|
|
507
|
+
|
|
508
|
+
| prop | type | description |
|
|
509
|
+
| ------------ | ----------------------- | ---------------------------------------- |
|
|
510
|
+
| `isSelected` | `boolean` | Whether this item is currently selected |
|
|
511
|
+
| `isDisabled` | `boolean` | Whether the item is disabled |
|
|
512
|
+
| `isPressed` | `SharedValue<boolean>` | Whether the item is currently pressed |
|
|
513
|
+
| `variant` | `'default' \| 'danger'` | Visual variant of the item |
|
|
514
|
+
|
|
515
|
+
#### MenuItemAnimation
|
|
516
|
+
|
|
517
|
+
Animation configuration for menu item press feedback. Can be:
|
|
518
|
+
|
|
519
|
+
- `false` or `"disabled"`: Disable all item animations
|
|
520
|
+
- `true` or `undefined`: Use default animations
|
|
521
|
+
- `object`: Custom animation configuration
|
|
522
|
+
|
|
523
|
+
| prop | type | default | description |
|
|
524
|
+
| ----------------------------- | ------------------ | -------------------------- | ---------------------------------------- |
|
|
525
|
+
| `scale.value` | `number` | `0.98` | Scale value when pressed |
|
|
526
|
+
| `scale.timingConfig` | `WithTimingConfig` | `{ duration: 150 }` | Spring animation configuration for scale |
|
|
527
|
+
| `backgroundColor.value` | `string` | `useThemeColor('default')` | Background color shown while pressed |
|
|
528
|
+
| `backgroundColor.timingConfig`| `WithTimingConfig` | `{ duration: 150 }` | Animation timing for background color |
|
|
529
|
+
|
|
530
|
+
### Menu.ItemTitle
|
|
531
|
+
|
|
532
|
+
| prop | type | default | description |
|
|
533
|
+
| -------------- | ----------------- | ------- | ---------------------------------------------------- |
|
|
534
|
+
| `children` | `React.ReactNode` | - | The title text content |
|
|
535
|
+
| `className` | `string` | - | Additional CSS class for the item title |
|
|
536
|
+
| `...TextProps` | `TextProps` | - | All standard React Native Text props are supported |
|
|
537
|
+
|
|
538
|
+
### Menu.ItemDescription
|
|
539
|
+
|
|
540
|
+
| prop | type | default | description |
|
|
541
|
+
| -------------- | ----------------- | ------- | ---------------------------------------------------- |
|
|
542
|
+
| `children` | `React.ReactNode` | - | The description text content |
|
|
543
|
+
| `className` | `string` | - | Additional CSS class for the item description |
|
|
544
|
+
| `...TextProps` | `TextProps` | - | All standard React Native Text props are supported |
|
|
545
|
+
|
|
546
|
+
### Menu.ItemIndicator
|
|
547
|
+
|
|
548
|
+
| prop | type | default | description |
|
|
549
|
+
| -------------- | ---------------------------- | -------------- | ------------------------------------------------------ |
|
|
550
|
+
| `children` | `React.ReactNode` | - | Custom indicator content, defaults to checkmark or dot |
|
|
551
|
+
| `variant` | `'checkmark' \| 'dot'` | `'checkmark'` | Visual variant of the indicator |
|
|
552
|
+
| `iconProps` | `MenuItemIndicatorIconProps` | - | Icon configuration (checkmark variant) |
|
|
553
|
+
| `forceMount` | `boolean` | `true` | Force mount the indicator regardless of selected state |
|
|
554
|
+
| `className` | `string` | - | Additional CSS class for the item indicator |
|
|
555
|
+
| `...ViewProps` | `ViewProps` | - | All standard React Native View props are supported |
|
|
556
|
+
|
|
557
|
+
#### MenuItemIndicatorIconProps
|
|
558
|
+
|
|
559
|
+
| prop | type | default | description |
|
|
560
|
+
| ------- | -------- | -------- | ------------------------------------------------ |
|
|
561
|
+
| `size` | `number` | `16` | Size of the indicator icon (8 for dot variant) |
|
|
562
|
+
| `color` | `string` | `muted` | Color of the indicator icon |
|
|
563
|
+
|
|
564
|
+
## Hooks
|
|
565
|
+
|
|
566
|
+
### useMenu
|
|
567
|
+
|
|
568
|
+
Hook to access the menu root context. Must be used within a `Menu` component.
|
|
569
|
+
|
|
570
|
+
```tsx
|
|
571
|
+
import { useMenu } from '@/heroui';
|
|
572
|
+
|
|
573
|
+
const { isOpen, onOpenChange, presentation, isDisabled } = useMenu();
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
#### Returns
|
|
577
|
+
|
|
578
|
+
| property | type | description |
|
|
579
|
+
| --------------- | ------------------------------ | -------------------------------------------- |
|
|
580
|
+
| `isOpen` | `boolean` | Whether the menu is currently open |
|
|
581
|
+
| `onOpenChange` | `(open: boolean) => void` | Callback to change the open state |
|
|
582
|
+
| `presentation` | `'popover' \| 'bottom-sheet'` | Current presentation mode |
|
|
583
|
+
| `isDisabled` | `boolean \| undefined` | Whether the menu is disabled |
|
|
584
|
+
| `nativeID` | `string` | Unique identifier for the menu instance |
|
|
585
|
+
|
|
586
|
+
### useMenuItem
|
|
587
|
+
|
|
588
|
+
Hook to access the menu item context. Must be used within a `Menu.Item` component.
|
|
589
|
+
|
|
590
|
+
```tsx
|
|
591
|
+
import { useMenuItem } from '@/heroui';
|
|
592
|
+
|
|
593
|
+
const { id, isSelected, isDisabled, variant } = useMenuItem();
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
#### Returns
|
|
597
|
+
|
|
598
|
+
| property | type | description |
|
|
599
|
+
| ------------ | ----------------------- | ---------------------------------------- |
|
|
600
|
+
| `id` | `MenuKey \| undefined` | Item identifier |
|
|
601
|
+
| `isSelected` | `boolean` | Whether the item is currently selected |
|
|
602
|
+
| `isDisabled` | `boolean` | Whether the item is disabled |
|
|
603
|
+
| `variant` | `'default' \| 'danger'` | Visual variant of the item |
|
|
604
|
+
|
|
605
|
+
### useMenuAnimation
|
|
606
|
+
|
|
607
|
+
Hook to access the menu animation context. Must be used within a `Menu` component.
|
|
608
|
+
|
|
609
|
+
```tsx
|
|
610
|
+
import { useMenuAnimation } from '@/heroui';
|
|
611
|
+
|
|
612
|
+
const { progress, isDragging } = useMenuAnimation();
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
#### Returns
|
|
616
|
+
|
|
617
|
+
| property | type | description |
|
|
618
|
+
| ------------ | ---------------------- | ------------------------------------------------------ |
|
|
619
|
+
| `progress` | `SharedValue<number>` | Animation progress shared value (0=idle, 1=open, 2=close) |
|
|
620
|
+
| `isDragging` | `SharedValue<boolean>` | Whether the bottom sheet is currently being dragged |
|