@neural-ui/native 0.0.0-stage → 0.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +183 -2
- package/dist/accordion/accordion.d.ts +11 -0
- package/dist/accordion/accordion.js +75 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/accordion/index.d.ts +1 -0
- package/dist/accordion/index.js +2 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert/alert.d.ts +27 -0
- package/dist/alert/alert.js +69 -0
- package/dist/alert/alert.js.map +1 -0
- package/dist/alert/index.d.ts +1 -0
- package/dist/alert/index.js +2 -0
- package/dist/alert/index.js.map +1 -0
- package/dist/autocomplete/autocomplete.d.ts +15 -0
- package/dist/autocomplete/autocomplete.js +117 -0
- package/dist/autocomplete/autocomplete.js.map +1 -0
- package/dist/autocomplete/index.d.ts +1 -0
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.js.map +1 -0
- package/dist/avatar/avatar.d.ts +22 -0
- package/dist/avatar/avatar.js +89 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +1 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/avatar-group/avatar-group.d.ts +29 -0
- package/dist/avatar-group/avatar-group.js +83 -0
- package/dist/avatar-group/avatar-group.js.map +1 -0
- package/dist/avatar-group/index.d.ts +1 -0
- package/dist/avatar-group/index.js +2 -0
- package/dist/avatar-group/index.js.map +1 -0
- package/dist/badge/badge.d.ts +15 -0
- package/dist/badge/badge.js +27 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/bottom-sheet/bottom-sheet.d.ts +34 -0
- package/dist/bottom-sheet/bottom-sheet.js +160 -0
- package/dist/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/bottom-sheet/index.d.ts +1 -0
- package/dist/bottom-sheet/index.js +2 -0
- package/dist/bottom-sheet/index.js.map +1 -0
- package/dist/button/button.d.ts +30 -0
- package/dist/button/button.js +110 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button-group/button-group.d.ts +25 -0
- package/dist/button-group/button-group.js +121 -0
- package/dist/button-group/button-group.js.map +1 -0
- package/dist/button-group/index.d.ts +1 -0
- package/dist/button-group/index.js +2 -0
- package/dist/button-group/index.js.map +1 -0
- package/dist/calendar/calendar.d.ts +76 -0
- package/dist/calendar/calendar.js +612 -0
- package/dist/calendar/calendar.js.map +1 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/card/card-slots.d.ts +11 -0
- package/dist/card/card-slots.js +21 -0
- package/dist/card/card-slots.js.map +1 -0
- package/dist/card/card.d.ts +10 -0
- package/dist/card/card.js +47 -0
- package/dist/card/card.js.map +1 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +3 -0
- package/dist/card/index.js.map +1 -0
- package/dist/carousel/carousel.d.ts +54 -0
- package/dist/carousel/carousel.js +238 -0
- package/dist/carousel/carousel.js.map +1 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +2 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/cascade-select/cascade-select.d.ts +25 -0
- package/dist/cascade-select/cascade-select.js +151 -0
- package/dist/cascade-select/cascade-select.js.map +1 -0
- package/dist/cascade-select/index.d.ts +1 -0
- package/dist/cascade-select/index.js +2 -0
- package/dist/cascade-select/index.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +20 -0
- package/dist/checkbox/checkbox.js +100 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/chip/chip.d.ts +24 -0
- package/dist/chip/chip.js +86 -0
- package/dist/chip/chip.js.map +1 -0
- package/dist/chip/index.d.ts +1 -0
- package/dist/chip/index.js +2 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/confirm-dialog/confirm-dialog.d.ts +21 -0
- package/dist/confirm-dialog/confirm-dialog.js +93 -0
- package/dist/confirm-dialog/confirm-dialog.js.map +1 -0
- package/dist/confirm-dialog/index.d.ts +1 -0
- package/dist/confirm-dialog/index.js +2 -0
- package/dist/confirm-dialog/index.js.map +1 -0
- package/dist/context-menu/context-menu.d.ts +21 -0
- package/dist/context-menu/context-menu.js +105 -0
- package/dist/context-menu/context-menu.js.map +1 -0
- package/dist/context-menu/index.d.ts +1 -0
- package/dist/context-menu/index.js +2 -0
- package/dist/context-menu/index.js.map +1 -0
- package/dist/data-view/data-view-row.d.ts +31 -0
- package/dist/data-view/data-view-row.js +108 -0
- package/dist/data-view/data-view-row.js.map +1 -0
- package/dist/data-view/data-view-templates.d.ts +15 -0
- package/dist/data-view/data-view-templates.js +14 -0
- package/dist/data-view/data-view-templates.js.map +1 -0
- package/dist/data-view/data-view.d.ts +33 -0
- package/dist/data-view/data-view.js +178 -0
- package/dist/data-view/data-view.js.map +1 -0
- package/dist/data-view/index.d.ts +2 -0
- package/dist/data-view/index.js +3 -0
- package/dist/data-view/index.js.map +1 -0
- package/dist/date-input/date-input.d.ts +21 -0
- package/dist/date-input/date-input.js +150 -0
- package/dist/date-input/date-input.js.map +1 -0
- package/dist/date-input/index.d.ts +1 -0
- package/dist/date-input/index.js +2 -0
- package/dist/date-input/index.js.map +1 -0
- package/dist/divider/divider.d.ts +6 -0
- package/dist/divider/divider.js +14 -0
- package/dist/divider/divider.js.map +1 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +2 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/empty-state/empty-state.d.ts +9 -0
- package/dist/empty-state/empty-state.js +34 -0
- package/dist/empty-state/empty-state.js.map +1 -0
- package/dist/empty-state/index.d.ts +1 -0
- package/dist/empty-state/index.js +2 -0
- package/dist/empty-state/index.js.map +1 -0
- package/dist/filter-bar/filter-bar.d.ts +21 -0
- package/dist/filter-bar/filter-bar.js +121 -0
- package/dist/filter-bar/filter-bar.js.map +1 -0
- package/dist/filter-bar/index.d.ts +1 -0
- package/dist/filter-bar/index.js +2 -0
- package/dist/filter-bar/index.js.map +1 -0
- package/dist/form-field/form-field.d.ts +12 -0
- package/dist/form-field/form-field.js +39 -0
- package/dist/form-field/form-field.js.map +1 -0
- package/dist/form-field/index.d.ts +1 -0
- package/dist/form-field/index.js +2 -0
- package/dist/form-field/index.js.map +1 -0
- package/dist/foundation/accordion-indicator.d.ts +16 -0
- package/dist/foundation/accordion-indicator.js +36 -0
- package/dist/foundation/accordion-indicator.js.map +1 -0
- package/dist/foundation/anchored-layout.d.ts +23 -0
- package/dist/foundation/anchored-layout.js +23 -0
- package/dist/foundation/anchored-layout.js.map +1 -0
- package/dist/foundation/anchored-overlay.d.ts +41 -0
- package/dist/foundation/anchored-overlay.js +134 -0
- package/dist/foundation/anchored-overlay.js.map +1 -0
- package/dist/foundation/calendar.d.ts +8 -0
- package/dist/foundation/calendar.js +34 -0
- package/dist/foundation/calendar.js.map +1 -0
- package/dist/foundation/collapse.d.ts +22 -0
- package/dist/foundation/collapse.js +70 -0
- package/dist/foundation/collapse.js.map +1 -0
- package/dist/foundation/control-label.d.ts +2 -0
- package/dist/foundation/control-label.js +6 -0
- package/dist/foundation/control-label.js.map +1 -0
- package/dist/foundation/file-picker.d.ts +22 -0
- package/dist/foundation/file-picker.js +23 -0
- package/dist/foundation/file-picker.js.map +1 -0
- package/dist/foundation/icons.d.ts +14 -0
- package/dist/foundation/icons.js +16 -0
- package/dist/foundation/icons.js.map +1 -0
- package/dist/foundation/index.d.ts +43 -0
- package/dist/foundation/index.js +51 -0
- package/dist/foundation/index.js.map +1 -0
- package/dist/foundation/mobile.d.ts +37 -0
- package/dist/foundation/mobile.js +59 -0
- package/dist/foundation/mobile.js.map +1 -0
- package/dist/foundation/motion.d.ts +22 -0
- package/dist/foundation/motion.js +119 -0
- package/dist/foundation/motion.js.map +1 -0
- package/dist/foundation/native-pressable.d.ts +10 -0
- package/dist/foundation/native-pressable.js +34 -0
- package/dist/foundation/native-pressable.js.map +1 -0
- package/dist/foundation/native-text-input.d.ts +20 -0
- package/dist/foundation/native-text-input.js +96 -0
- package/dist/foundation/native-text-input.js.map +1 -0
- package/dist/foundation/native-text-snapshot.d.ts +3 -0
- package/dist/foundation/native-text-snapshot.js +19 -0
- package/dist/foundation/native-text-snapshot.js.map +1 -0
- package/dist/foundation/native-text-sync.d.ts +8 -0
- package/dist/foundation/native-text-sync.js +41 -0
- package/dist/foundation/native-text-sync.js.map +1 -0
- package/dist/foundation/text-control.d.ts +20 -0
- package/dist/foundation/text-control.js +41 -0
- package/dist/foundation/text-control.js.map +1 -0
- package/dist/foundation/tone.d.ts +10 -0
- package/dist/foundation/tone.js +52 -0
- package/dist/foundation/tone.js.map +1 -0
- package/dist/foundation/tree.d.ts +12 -0
- package/dist/foundation/tree.js +39 -0
- package/dist/foundation/tree.js.map +1 -0
- package/dist/gallery/gallery-templates.d.ts +24 -0
- package/dist/gallery/gallery-templates.js +25 -0
- package/dist/gallery/gallery-templates.js.map +1 -0
- package/dist/gallery/gallery.d.ts +73 -0
- package/dist/gallery/gallery.js +195 -0
- package/dist/gallery/gallery.js.map +1 -0
- package/dist/gallery/index.d.ts +2 -0
- package/dist/gallery/index.js +3 -0
- package/dist/gallery/index.js.map +1 -0
- package/dist/icon-button/icon-button.d.ts +25 -0
- package/dist/icon-button/icon-button.js +84 -0
- package/dist/icon-button/icon-button.js.map +1 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/icon-button/index.js +2 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/image-viewer/image-viewer.d.ts +134 -0
- package/dist/image-viewer/image-viewer.js +380 -0
- package/dist/image-viewer/image-viewer.js.map +1 -0
- package/dist/image-viewer/index.d.ts +1 -0
- package/dist/image-viewer/index.js +2 -0
- package/dist/image-viewer/index.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/inline-editor/index.d.ts +1 -0
- package/dist/inline-editor/index.js +2 -0
- package/dist/inline-editor/index.js.map +1 -0
- package/dist/inline-editor/inline-editor.d.ts +17 -0
- package/dist/inline-editor/inline-editor.js +144 -0
- package/dist/inline-editor/inline-editor.js.map +1 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +2 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/input.d.ts +9 -0
- package/dist/input/input.js +87 -0
- package/dist/input/input.js.map +1 -0
- package/dist/input-mask/index.d.ts +1 -0
- package/dist/input-mask/index.js +2 -0
- package/dist/input-mask/index.js.map +1 -0
- package/dist/input-mask/input-mask.d.ts +15 -0
- package/dist/input-mask/input-mask.js +106 -0
- package/dist/input-mask/input-mask.js.map +1 -0
- package/dist/input-otp/index.d.ts +1 -0
- package/dist/input-otp/index.js +2 -0
- package/dist/input-otp/index.js.map +1 -0
- package/dist/input-otp/input-otp.d.ts +18 -0
- package/dist/input-otp/input-otp.js +169 -0
- package/dist/input-otp/input-otp.js.map +1 -0
- package/dist/input-tags/index.d.ts +1 -0
- package/dist/input-tags/index.js +2 -0
- package/dist/input-tags/index.js.map +1 -0
- package/dist/input-tags/input-tags.d.ts +19 -0
- package/dist/input-tags/input-tags.js +145 -0
- package/dist/input-tags/input-tags.js.map +1 -0
- package/dist/listbox/index.d.ts +2 -0
- package/dist/listbox/index.js +3 -0
- package/dist/listbox/index.js.map +1 -0
- package/dist/listbox/listbox-templates.d.ts +17 -0
- package/dist/listbox/listbox-templates.js +14 -0
- package/dist/listbox/listbox-templates.js.map +1 -0
- package/dist/listbox/listbox.d.ts +24 -0
- package/dist/listbox/listbox.js +136 -0
- package/dist/listbox/listbox.js.map +1 -0
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/menu/menu.d.ts +19 -0
- package/dist/menu/menu.js +95 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/meter-group/index.d.ts +1 -0
- package/dist/meter-group/index.js +2 -0
- package/dist/meter-group/index.js.map +1 -0
- package/dist/meter-group/meter-group.d.ts +23 -0
- package/dist/meter-group/meter-group.js +68 -0
- package/dist/meter-group/meter-group.js.map +1 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +3 -0
- package/dist/modal/index.js.map +1 -0
- package/dist/modal/modal-templates.d.ts +14 -0
- package/dist/modal/modal-templates.js +23 -0
- package/dist/modal/modal-templates.js.map +1 -0
- package/dist/modal/modal.d.ts +38 -0
- package/dist/modal/modal.js +169 -0
- package/dist/modal/modal.js.map +1 -0
- package/dist/nav/index.d.ts +1 -0
- package/dist/nav/index.js +2 -0
- package/dist/nav/index.js.map +1 -0
- package/dist/nav/nav.d.ts +15 -0
- package/dist/nav/nav.js +84 -0
- package/dist/nav/nav.js.map +1 -0
- package/dist/notification-center/index.d.ts +1 -0
- package/dist/notification-center/index.js +2 -0
- package/dist/notification-center/index.js.map +1 -0
- package/dist/notification-center/notification-center.d.ts +18 -0
- package/dist/notification-center/notification-center.js +104 -0
- package/dist/notification-center/notification-center.js.map +1 -0
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +2 -0
- package/dist/number-input/index.js.map +1 -0
- package/dist/number-input/number-input.d.ts +23 -0
- package/dist/number-input/number-input.js +143 -0
- package/dist/number-input/number-input.js.map +1 -0
- package/dist/panel/index.d.ts +2 -0
- package/dist/panel/index.js +3 -0
- package/dist/panel/index.js.map +1 -0
- package/dist/panel/panel-slots.d.ts +11 -0
- package/dist/panel/panel-slots.js +21 -0
- package/dist/panel/panel-slots.js.map +1 -0
- package/dist/panel/panel.d.ts +11 -0
- package/dist/panel/panel.js +60 -0
- package/dist/panel/panel.js.map +1 -0
- package/dist/password/index.d.ts +1 -0
- package/dist/password/index.js +2 -0
- package/dist/password/index.js.map +1 -0
- package/dist/password/password.d.ts +12 -0
- package/dist/password/password.js +111 -0
- package/dist/password/password.js.map +1 -0
- package/dist/pick-list/index.d.ts +1 -0
- package/dist/pick-list/index.js +2 -0
- package/dist/pick-list/index.js.map +1 -0
- package/dist/pick-list/pick-list.d.ts +32 -0
- package/dist/pick-list/pick-list.js +215 -0
- package/dist/pick-list/pick-list.js.map +1 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/popover.d.ts +15 -0
- package/dist/popover/popover.js +55 -0
- package/dist/popover/popover.js.map +1 -0
- package/dist/progress-bar/index.d.ts +1 -0
- package/dist/progress-bar/index.js +2 -0
- package/dist/progress-bar/index.js.map +1 -0
- package/dist/progress-bar/progress-bar.d.ts +13 -0
- package/dist/progress-bar/progress-bar.js +50 -0
- package/dist/progress-bar/progress-bar.js.map +1 -0
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.js.map +1 -0
- package/dist/radio/radio.d.ts +16 -0
- package/dist/radio/radio.js +100 -0
- package/dist/radio/radio.js.map +1 -0
- package/dist/rating/index.d.ts +1 -0
- package/dist/rating/index.js +2 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/rating/rating.d.ts +17 -0
- package/dist/rating/rating.js +121 -0
- package/dist/rating/rating.js.map +1 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +3 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/select-templates.d.ts +24 -0
- package/dist/select/select-templates.js +23 -0
- package/dist/select/select-templates.js.map +1 -0
- package/dist/select/select.d.ts +33 -0
- package/dist/select/select.js +193 -0
- package/dist/select/select.js.map +1 -0
- package/dist/sidebar/index.d.ts +1 -0
- package/dist/sidebar/index.js +2 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/sidebar/sidebar.d.ts +34 -0
- package/dist/sidebar/sidebar.js +127 -0
- package/dist/sidebar/sidebar.js.map +1 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/skeleton.d.ts +32 -0
- package/dist/skeleton/skeleton.js +121 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.d.ts +34 -0
- package/dist/slider/slider.js +177 -0
- package/dist/slider/slider.js.map +1 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +2 -0
- package/dist/speed-dial/index.js.map +1 -0
- package/dist/speed-dial/speed-dial.d.ts +31 -0
- package/dist/speed-dial/speed-dial.js +138 -0
- package/dist/speed-dial/speed-dial.js.map +1 -0
- package/dist/spinner/index.d.ts +1 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/spinner.d.ts +13 -0
- package/dist/spinner/spinner.js +57 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/stats-card/index.d.ts +1 -0
- package/dist/stats-card/index.js +2 -0
- package/dist/stats-card/index.js.map +1 -0
- package/dist/stats-card/stats-card.d.ts +19 -0
- package/dist/stats-card/stats-card.js +70 -0
- package/dist/stats-card/stats-card.js.map +1 -0
- package/dist/stepper/index.d.ts +1 -0
- package/dist/stepper/index.js +2 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/stepper/stepper.d.ts +21 -0
- package/dist/stepper/stepper.js +134 -0
- package/dist/stepper/stepper.js.map +1 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/switch.d.ts +24 -0
- package/dist/switch/switch.js +100 -0
- package/dist/switch/switch.js.map +1 -0
- package/dist/tabs/index.d.ts +1 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/tabs.d.ts +25 -0
- package/dist/tabs/tabs.js +112 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +2 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/textarea/textarea.d.ts +8 -0
- package/dist/textarea/textarea.js +87 -0
- package/dist/textarea/textarea.js.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme.d.ts +16 -0
- package/dist/theme/theme.js +146 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/timeline.d.ts +16 -0
- package/dist/timeline/timeline.js +66 -0
- package/dist/timeline/timeline.js.map +1 -0
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/toast.d.ts +35 -0
- package/dist/toast/toast.js +146 -0
- package/dist/toast/toast.js.map +1 -0
- package/dist/toggle-button-group/index.d.ts +1 -0
- package/dist/toggle-button-group/index.js +2 -0
- package/dist/toggle-button-group/index.js.map +1 -0
- package/dist/toggle-button-group/toggle-button-group.d.ts +27 -0
- package/dist/toggle-button-group/toggle-button-group.js +145 -0
- package/dist/toggle-button-group/toggle-button-group.js.map +1 -0
- package/dist/toolbar/index.d.ts +1 -0
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.js.map +1 -0
- package/dist/toolbar/toolbar.d.ts +18 -0
- package/dist/toolbar/toolbar.js +84 -0
- package/dist/toolbar/toolbar.js.map +1 -0
- package/dist/tree/index.d.ts +1 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/tree.d.ts +26 -0
- package/dist/tree/tree.js +167 -0
- package/dist/tree/tree.js.map +1 -0
- package/dist/tree-select/index.d.ts +1 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/tree-select/index.js.map +1 -0
- package/dist/tree-select/tree-select.d.ts +20 -0
- package/dist/tree-select/tree-select.js +112 -0
- package/dist/tree-select/tree-select.js.map +1 -0
- package/dist/uploader/index.d.ts +2 -0
- package/dist/uploader/index.js +3 -0
- package/dist/uploader/index.js.map +1 -0
- package/dist/uploader/uploader.d.ts +37 -0
- package/dist/uploader/uploader.js +280 -0
- package/dist/uploader/uploader.js.map +1 -0
- package/dist/virtual-list/index.d.ts +2 -0
- package/dist/virtual-list/index.js +3 -0
- package/dist/virtual-list/index.js.map +1 -0
- package/dist/virtual-list/virtual-list-templates.d.ts +16 -0
- package/dist/virtual-list/virtual-list-templates.js +14 -0
- package/dist/virtual-list/virtual-list-templates.js.map +1 -0
- package/dist/virtual-list/virtual-list.d.ts +20 -0
- package/dist/virtual-list/virtual-list.js +110 -0
- package/dist/virtual-list/virtual-list.js.map +1 -0
- package/package.json +328 -4
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { booleanAttribute, Component, computed, input, model, output, } from '@angular/core';
|
|
2
|
+
import { View, Text, ScrollView, Modal, SafeAreaProvider, SafeAreaView, KeyboardAvoidingView, } from '@ng-native/components';
|
|
3
|
+
import { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';
|
|
4
|
+
import { AnimatedStyle } from '@ng-native/components/animations';
|
|
5
|
+
import { neuPresence } from '../foundation/motion.js';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class NeuBottomSheetComponent {
|
|
8
|
+
open = model(false, /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
10
|
+
// A hidden Modal has no native view tag until presentation. JS frames also
|
|
11
|
+
// update the newly mounted backdrop instead of leaving its opacity at zero.
|
|
12
|
+
motion = neuPresence(this.open, false);
|
|
13
|
+
backdropStyle = { opacity: this.motion.progress };
|
|
14
|
+
panelStyle = {
|
|
15
|
+
transform: [{ translateY: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [24, 0] }) }],
|
|
16
|
+
};
|
|
17
|
+
title = input.required(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
19
|
+
dismissible = input(true, { ...(ngDevMode ? { debugName: "dismissible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
20
|
+
closeLabel = input('Close', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []));
|
|
22
|
+
height = input('auto', /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
24
|
+
panelHeight = computed(() => {
|
|
25
|
+
switch (this.height()) {
|
|
26
|
+
case 'sm': return '35%';
|
|
27
|
+
case 'md': return '50%';
|
|
28
|
+
case 'lg': return '75%';
|
|
29
|
+
case 'full': return '100%';
|
|
30
|
+
default: return undefined;
|
|
31
|
+
}
|
|
32
|
+
}, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "panelHeight" }] : /* istanbul ignore next */ []));
|
|
34
|
+
closed = output();
|
|
35
|
+
/** Native presentation has finished. */
|
|
36
|
+
opened = output();
|
|
37
|
+
/** iOS native dismissal has finished. Android does not emit this native event. */
|
|
38
|
+
dismissed = output();
|
|
39
|
+
startY;
|
|
40
|
+
close() {
|
|
41
|
+
if (this.open() && this.dismissible()) {
|
|
42
|
+
this.open.set(false);
|
|
43
|
+
this.closed.emit();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
start(event) {
|
|
47
|
+
this.startY = event.nativeEvent.pageY;
|
|
48
|
+
}
|
|
49
|
+
end(event) {
|
|
50
|
+
const y = event.nativeEvent.pageY;
|
|
51
|
+
if (y !== undefined && this.startY !== undefined && y - this.startY > 80)
|
|
52
|
+
this.close();
|
|
53
|
+
this.startY = undefined;
|
|
54
|
+
}
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuBottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
56
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuBottomSheetComponent, isStandalone: true, selector: "neu-bottom-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed", opened: "opened", dismissed: "dismissed" }, ngImport: i0, template: `
|
|
57
|
+
<modal [supportedOrientations]="['portrait', 'landscape']"
|
|
58
|
+
[visible]="motion.visible()"
|
|
59
|
+
[transparent]="true"
|
|
60
|
+
presentationStyle="overFullScreen"
|
|
61
|
+
animationType="none"
|
|
62
|
+
(requestClose)="close()"
|
|
63
|
+
(show)="opened.emit()"
|
|
64
|
+
(dismiss)="dismissed.emit()"
|
|
65
|
+
><safe-area-provider class="full" [reportInsets]="false"
|
|
66
|
+
><keyboard-avoiding-view class="full sheet-backdrop" behavior="padding"
|
|
67
|
+
[animatedStyle]="backdropStyle" [pointerEvents]="open() ? 'auto' : 'none'"
|
|
68
|
+
[accessibilityElementsHidden]="!open()"
|
|
69
|
+
[importantForAccessibility]="open() ? 'auto' : 'no-hide-descendants'">
|
|
70
|
+
<pressable class="sheet-dismiss" [accessible]="false" [focusable]="false"
|
|
71
|
+
[disabled]="!dismissible()" (press)="close()" />
|
|
72
|
+
<safe-area-view class="sheet-panel" [edges]="['bottom']"
|
|
73
|
+
[animatedStyle]="panelStyle"
|
|
74
|
+
[style.height]="panelHeight()"
|
|
75
|
+
[style.maxHeight]="panelHeight() ? '100%' : '85%'"
|
|
76
|
+
><view
|
|
77
|
+
class="sheet-content"
|
|
78
|
+
[class.sheet-fixed-content]="!!panelHeight()"
|
|
79
|
+
[accessibilityViewIsModal]="open()"
|
|
80
|
+
><view class="sheet-handle" />
|
|
81
|
+
<view
|
|
82
|
+
class="row"
|
|
83
|
+
(touchStart)="start($event)"
|
|
84
|
+
(touchEnd)="end($event)"
|
|
85
|
+
><text class="title grow" accessibilityRole="header">{{
|
|
86
|
+
title()
|
|
87
|
+
}}</text>
|
|
88
|
+
@if (dismissible()) {
|
|
89
|
+
<pressable
|
|
90
|
+
class="action"
|
|
91
|
+
accessibilityRole="button"
|
|
92
|
+
[accessibilityLabel]="closeLabel()"
|
|
93
|
+
(press)="close()"
|
|
94
|
+
><text class="label">×</text></pressable
|
|
95
|
+
>
|
|
96
|
+
}</view
|
|
97
|
+
><scroll-view class="sheet-scroll" [class.sheet-fixed-scroll]="!!panelHeight()" keyboardShouldPersistTaps="handled"
|
|
98
|
+
><view class="stack scroll-content"
|
|
99
|
+
><ng-content /></view></scroll-view></view></safe-area-view></keyboard-avoiding-view></safe-area-provider
|
|
100
|
+
></modal>`, isInline: true, styles: [".neu-unavailable > * {\n /* Fade presentation children without changing the accessible action's own alpha. */\n opacity: 0.45;\n}\n.stack {\n gap: 12px;\n}\n.row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n}\n.wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex: 1;\n}\n.surface {\n padding: 16px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-surface-radius, 16px);\n gap: 12px;\n}\n.outline {\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n}\n.title {\n color: var(--neu-text, #172033);\n font-size: var(--neu-heading-size, 18px);\n line-height: 24px;\n font-weight: 600;\n flex-shrink: 1;\n}\n.label {\n color: var(--neu-text, #172033);\n font-size: 16px;\n flex-shrink: 1;\n}\n.muted {\n color: var(--neu-muted, #596477);\n font-size: var(--neu-label-size, 14px);\n line-height: 20px;\n flex-shrink: 1;\n}\n.error {\n color: var(--neu-danger-ink, #b3261e);\n font-size: 14px;\n}\n.action {\n min-height: 48px;\n min-width: 48px;\n padding: 12px;\n justify-content: center;\n align-items: center;\n border-radius: 12px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.selected-text {\n color: var(--neu-on-accent, #ffffff);\n font-size: 16px;\n}\n.control {\n min-height: 48px;\n padding: 12px;\n font-size: 16px;\n color: var(--neu-text, #172033);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n border-radius: var(--neu-control-radius, 10px);\n background-color: var(--neu-surface, #ffffff);\n}\n.track {\n height: 8px;\n border-radius: 4px;\n overflow: hidden;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.fill {\n height: 8px;\n background-color: var(--neu-accent, #3155d9);\n}\n.dot {\n width: 20px;\n height: 20px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n border-radius: 10px;\n}\n.dot-selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.avatar {\n width: 48px;\n height: 48px;\n border-radius: 24px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-tonal, #e9edfc);\n overflow: hidden;\n}\n.avatar-image {\n width: 48px;\n height: 48px;\n}\n.backdrop {\n flex: 1;\n background-color: rgba(0, 0, 0, 0.4);\n justify-content: center;\n padding: 16px;\n}\n.bottom {\n justify-content: flex-end;\n}\n.modal-layout {\n flex: 1;\n justify-content: center;\n}\n.modal-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n}\n.scroll-content {\n padding-right: 12px;\n}\n.sheet {\n padding: 20px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-dialog-radius, 24px);\n gap: 16px;\n max-height: 90%;\n}\n.full {\n flex: 1;\n}\n.sheet-background {\n background-color: var(--neu-surface, #ffffff);\n}\n.page-sheet {\n max-height: 100%;\n border-radius: 0;\n}\n.thumb {\n width: 72px;\n height: 72px;\n border-radius: 12px;\n}\n.hero {\n height: 240px;\n width: 100%;\n}\n.divider {\n height: 1px;\n background-color: var(--neu-divider, #e7ebf0);\n}\n.skeleton {\n background-color: var(--neu-border, #a5afbf);\n border-radius: 8px;\n}\n.pill {\n padding: 4px 10px;\n border-radius: 16px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.calendar-grid {\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0;\n}\n.calendar-day {\n width: 14.2857%;\n min-width: 0;\n min-height: 48px;\n padding: 4px;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n.speed-dial {\n align-items: flex-end;\n}\n.fab {\n width: 56px;\n height: 56px;\n border-radius: 28px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #3155d9);\n}\n.fab-label {\n color: var(--neu-on-accent, #ffffff);\n font-size: 28px;\n}\n.slider-track {\n width: 100%;\n height: 24px;\n position: relative;\n}\n.slider-rail {\n position: absolute;\n top: 8px;\n}\n.slider-thumb {\n width: 24px;\n height: 24px;\n border-radius: 12px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-on-accent, #ffffff);\n position: absolute;\n top: 0;\n}\n", ".sheet-backdrop {\n justify-content: flex-end;\n background-color: rgba(0, 0, 0, 0.36);\n}\n.sheet-dismiss {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.sheet-panel {\n max-height: 85%;\n border-top-left-radius: 24px;\n border-top-right-radius: 24px;\n background-color: var(--neu-surface, #ffffff);\n overflow: hidden;\n}\n.sheet-content {\n padding: 20px;\n padding-top: 8px;\n gap: 16px;\n flex-shrink: 1;\n}\n.sheet-handle {\n width: 36px;\n height: 4px;\n border-radius: 2px;\n background-color: var(--neu-border, #c6cede);\n align-self: center;\n}\n.sheet-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n}\n.sheet-fixed-content {\n flex: 1;\n min-height: 0;\n}\n.sheet-fixed-scroll {\n flex-grow: 1;\n min-height: 0;\n}\n"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated"] }, { kind: "component", type: SafeAreaProvider, selector: "safe-area-provider", inputs: ["reportInsets"] }, { kind: "directive", type: SafeAreaView, selector: "safe-area-view", inputs: ["edges", "mode"] }, { kind: "component", type: KeyboardAvoidingView, selector: "keyboard-avoiding-view", inputs: ["behavior", "contentContainerStyle", "contentContainerClass", "enabled", "keyboardVerticalOffset"] }, { kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }] });
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuBottomSheetComponent, decorators: [{
|
|
103
|
+
type: Component,
|
|
104
|
+
args: [{ selector: 'neu-bottom-sheet', imports: [
|
|
105
|
+
Modal,
|
|
106
|
+
SafeAreaProvider,
|
|
107
|
+
SafeAreaView,
|
|
108
|
+
KeyboardAvoidingView,
|
|
109
|
+
View,
|
|
110
|
+
Text,
|
|
111
|
+
Pressable,
|
|
112
|
+
ScrollView,
|
|
113
|
+
AnimatedStyle,
|
|
114
|
+
], template: `
|
|
115
|
+
<modal [supportedOrientations]="['portrait', 'landscape']"
|
|
116
|
+
[visible]="motion.visible()"
|
|
117
|
+
[transparent]="true"
|
|
118
|
+
presentationStyle="overFullScreen"
|
|
119
|
+
animationType="none"
|
|
120
|
+
(requestClose)="close()"
|
|
121
|
+
(show)="opened.emit()"
|
|
122
|
+
(dismiss)="dismissed.emit()"
|
|
123
|
+
><safe-area-provider class="full" [reportInsets]="false"
|
|
124
|
+
><keyboard-avoiding-view class="full sheet-backdrop" behavior="padding"
|
|
125
|
+
[animatedStyle]="backdropStyle" [pointerEvents]="open() ? 'auto' : 'none'"
|
|
126
|
+
[accessibilityElementsHidden]="!open()"
|
|
127
|
+
[importantForAccessibility]="open() ? 'auto' : 'no-hide-descendants'">
|
|
128
|
+
<pressable class="sheet-dismiss" [accessible]="false" [focusable]="false"
|
|
129
|
+
[disabled]="!dismissible()" (press)="close()" />
|
|
130
|
+
<safe-area-view class="sheet-panel" [edges]="['bottom']"
|
|
131
|
+
[animatedStyle]="panelStyle"
|
|
132
|
+
[style.height]="panelHeight()"
|
|
133
|
+
[style.maxHeight]="panelHeight() ? '100%' : '85%'"
|
|
134
|
+
><view
|
|
135
|
+
class="sheet-content"
|
|
136
|
+
[class.sheet-fixed-content]="!!panelHeight()"
|
|
137
|
+
[accessibilityViewIsModal]="open()"
|
|
138
|
+
><view class="sheet-handle" />
|
|
139
|
+
<view
|
|
140
|
+
class="row"
|
|
141
|
+
(touchStart)="start($event)"
|
|
142
|
+
(touchEnd)="end($event)"
|
|
143
|
+
><text class="title grow" accessibilityRole="header">{{
|
|
144
|
+
title()
|
|
145
|
+
}}</text>
|
|
146
|
+
@if (dismissible()) {
|
|
147
|
+
<pressable
|
|
148
|
+
class="action"
|
|
149
|
+
accessibilityRole="button"
|
|
150
|
+
[accessibilityLabel]="closeLabel()"
|
|
151
|
+
(press)="close()"
|
|
152
|
+
><text class="label">×</text></pressable
|
|
153
|
+
>
|
|
154
|
+
}</view
|
|
155
|
+
><scroll-view class="sheet-scroll" [class.sheet-fixed-scroll]="!!panelHeight()" keyboardShouldPersistTaps="handled"
|
|
156
|
+
><view class="stack scroll-content"
|
|
157
|
+
><ng-content /></view></scroll-view></view></safe-area-view></keyboard-avoiding-view></safe-area-provider
|
|
158
|
+
></modal>`, styles: [".neu-unavailable > * {\n /* Fade presentation children without changing the accessible action's own alpha. */\n opacity: 0.45;\n}\n.stack {\n gap: 12px;\n}\n.row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n}\n.wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex: 1;\n}\n.surface {\n padding: 16px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-surface-radius, 16px);\n gap: 12px;\n}\n.outline {\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n}\n.title {\n color: var(--neu-text, #172033);\n font-size: var(--neu-heading-size, 18px);\n line-height: 24px;\n font-weight: 600;\n flex-shrink: 1;\n}\n.label {\n color: var(--neu-text, #172033);\n font-size: 16px;\n flex-shrink: 1;\n}\n.muted {\n color: var(--neu-muted, #596477);\n font-size: var(--neu-label-size, 14px);\n line-height: 20px;\n flex-shrink: 1;\n}\n.error {\n color: var(--neu-danger-ink, #b3261e);\n font-size: 14px;\n}\n.action {\n min-height: 48px;\n min-width: 48px;\n padding: 12px;\n justify-content: center;\n align-items: center;\n border-radius: 12px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.selected-text {\n color: var(--neu-on-accent, #ffffff);\n font-size: 16px;\n}\n.control {\n min-height: 48px;\n padding: 12px;\n font-size: 16px;\n color: var(--neu-text, #172033);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n border-radius: var(--neu-control-radius, 10px);\n background-color: var(--neu-surface, #ffffff);\n}\n.track {\n height: 8px;\n border-radius: 4px;\n overflow: hidden;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.fill {\n height: 8px;\n background-color: var(--neu-accent, #3155d9);\n}\n.dot {\n width: 20px;\n height: 20px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n border-radius: 10px;\n}\n.dot-selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.avatar {\n width: 48px;\n height: 48px;\n border-radius: 24px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-tonal, #e9edfc);\n overflow: hidden;\n}\n.avatar-image {\n width: 48px;\n height: 48px;\n}\n.backdrop {\n flex: 1;\n background-color: rgba(0, 0, 0, 0.4);\n justify-content: center;\n padding: 16px;\n}\n.bottom {\n justify-content: flex-end;\n}\n.modal-layout {\n flex: 1;\n justify-content: center;\n}\n.modal-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n}\n.scroll-content {\n padding-right: 12px;\n}\n.sheet {\n padding: 20px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-dialog-radius, 24px);\n gap: 16px;\n max-height: 90%;\n}\n.full {\n flex: 1;\n}\n.sheet-background {\n background-color: var(--neu-surface, #ffffff);\n}\n.page-sheet {\n max-height: 100%;\n border-radius: 0;\n}\n.thumb {\n width: 72px;\n height: 72px;\n border-radius: 12px;\n}\n.hero {\n height: 240px;\n width: 100%;\n}\n.divider {\n height: 1px;\n background-color: var(--neu-divider, #e7ebf0);\n}\n.skeleton {\n background-color: var(--neu-border, #a5afbf);\n border-radius: 8px;\n}\n.pill {\n padding: 4px 10px;\n border-radius: 16px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.calendar-grid {\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0;\n}\n.calendar-day {\n width: 14.2857%;\n min-width: 0;\n min-height: 48px;\n padding: 4px;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n.speed-dial {\n align-items: flex-end;\n}\n.fab {\n width: 56px;\n height: 56px;\n border-radius: 28px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #3155d9);\n}\n.fab-label {\n color: var(--neu-on-accent, #ffffff);\n font-size: 28px;\n}\n.slider-track {\n width: 100%;\n height: 24px;\n position: relative;\n}\n.slider-rail {\n position: absolute;\n top: 8px;\n}\n.slider-thumb {\n width: 24px;\n height: 24px;\n border-radius: 12px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-on-accent, #ffffff);\n position: absolute;\n top: 0;\n}\n", ".sheet-backdrop {\n justify-content: flex-end;\n background-color: rgba(0, 0, 0, 0.36);\n}\n.sheet-dismiss {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.sheet-panel {\n max-height: 85%;\n border-top-left-radius: 24px;\n border-top-right-radius: 24px;\n background-color: var(--neu-surface, #ffffff);\n overflow: hidden;\n}\n.sheet-content {\n padding: 20px;\n padding-top: 8px;\n gap: 16px;\n flex-shrink: 1;\n}\n.sheet-handle {\n width: 36px;\n height: 4px;\n border-radius: 2px;\n background-color: var(--neu-border, #c6cede);\n align-self: center;\n}\n.sheet-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n}\n.sheet-fixed-content {\n flex: 1;\n min-height: 0;\n}\n.sheet-fixed-scroll {\n flex-grow: 1;\n min-height: 0;\n}\n"] }]
|
|
159
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], opened: [{ type: i0.Output, args: ["opened"] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }] } });
|
|
160
|
+
//# sourceMappingURL=bottom-sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-sheet.js","sourceRoot":"","sources":["../../src/bottom-sheet/bottom-sheet.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n input,\n model,\n output,\n} from '@angular/core';\nimport {\n View,\n Text,\n ScrollView,\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n KeyboardAvoidingView,\n type TouchEvent,\n} from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from '../foundation/motion.js';\n\nexport type NeuBottomSheetHeight = 'auto' | 'sm' | 'md' | 'lg' | 'full';\n\n@Component({\n selector: 'neu-bottom-sheet',\n imports: [\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n KeyboardAvoidingView,\n View,\n Text,\n Pressable,\n ScrollView,\n AnimatedStyle,\n ],\n template: `\n <modal [supportedOrientations]=\"['portrait', 'landscape']\"\n [visible]=\"motion.visible()\"\n [transparent]=\"true\"\n presentationStyle=\"overFullScreen\"\n animationType=\"none\"\n (requestClose)=\"close()\"\n (show)=\"opened.emit()\"\n (dismiss)=\"dismissed.emit()\"\n ><safe-area-provider class=\"full\" [reportInsets]=\"false\"\n ><keyboard-avoiding-view class=\"full sheet-backdrop\" behavior=\"padding\"\n [animatedStyle]=\"backdropStyle\" [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <pressable class=\"sheet-dismiss\" [accessible]=\"false\" [focusable]=\"false\"\n [disabled]=\"!dismissible()\" (press)=\"close()\" />\n <safe-area-view class=\"sheet-panel\" [edges]=\"['bottom']\"\n [animatedStyle]=\"panelStyle\"\n [style.height]=\"panelHeight()\"\n [style.maxHeight]=\"panelHeight() ? '100%' : '85%'\"\n ><view\n class=\"sheet-content\"\n [class.sheet-fixed-content]=\"!!panelHeight()\"\n [accessibilityViewIsModal]=\"open()\"\n ><view class=\"sheet-handle\" />\n <view\n class=\"row\"\n (touchStart)=\"start($event)\"\n (touchEnd)=\"end($event)\"\n ><text class=\"title grow\" accessibilityRole=\"header\">{{\n title()\n }}</text>\n @if (dismissible()) {\n <pressable\n class=\"action\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\"\n (press)=\"close()\"\n ><text class=\"label\">×</text></pressable\n >\n }</view\n ><scroll-view class=\"sheet-scroll\" [class.sheet-fixed-scroll]=\"!!panelHeight()\" keyboardShouldPersistTaps=\"handled\"\n ><view class=\"stack scroll-content\"\n ><ng-content /></view></scroll-view></view></safe-area-view></keyboard-avoiding-view></safe-area-provider\n ></modal>`,\n styleUrls: ['../foundation/mobile.css', './bottom-sheet.css'],\n})\nexport class NeuBottomSheetComponent {\n readonly open = model(false);\n // A hidden Modal has no native view tag until presentation. JS frames also\n // update the newly mounted backdrop instead of leaving its opacity at zero.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly backdropStyle = { opacity: this.motion.progress };\n protected readonly panelStyle = {\n transform: [{ translateY: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [24, 0] }) }],\n };\n readonly title = input.required<string>();\n readonly dismissible = input(true, { transform: booleanAttribute });\n readonly closeLabel = input('Close');\n readonly height = input<NeuBottomSheetHeight>('auto');\n protected readonly panelHeight = computed(() => {\n switch (this.height()) {\n case 'sm': return '35%';\n case 'md': return '50%';\n case 'lg': return '75%';\n case 'full': return '100%';\n default: return undefined;\n }\n });\n readonly closed = output<void>();\n /** Native presentation has finished. */\n readonly opened = output<void>();\n /** iOS native dismissal has finished. Android does not emit this native event. */\n readonly dismissed = output<void>();\n private startY: number | undefined;\n close(): void {\n if (this.open() && this.dismissible()) {\n this.open.set(false);\n this.closed.emit();\n }\n }\n protected start(event: TouchEvent): void {\n this.startY = event.nativeEvent.pageY;\n }\n protected end(event: TouchEvent): void {\n const y = event.nativeEvent.pageY;\n if (y !== undefined && this.startY !== undefined && y - this.startY > 80)\n this.close();\n this.startY = undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bottom-sheet.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bottom-sheet/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './bottom-sheet.js';\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PressEvent } from '@ng-native/components';
|
|
2
|
+
import { type NeuSize, type NeuVariant, type NeuTone } from '../foundation/index.js';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NeuButtonComponent {
|
|
5
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
6
|
+
readonly accessibilityLabel: import("@angular/core").InputSignal<string>;
|
|
7
|
+
readonly variant: import("@angular/core").InputSignal<NeuVariant>;
|
|
8
|
+
readonly tone: import("@angular/core").InputSignal<NeuTone>;
|
|
9
|
+
readonly size: import("@angular/core").InputSignal<NeuSize>;
|
|
10
|
+
readonly fullWidth: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
11
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
12
|
+
readonly loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
13
|
+
readonly pressed: import("@angular/core").OutputEmitterRef<import("@ng-native/components").TouchEvent>;
|
|
14
|
+
private readonly theme;
|
|
15
|
+
protected readonly palette: import("@angular/core").Signal<{
|
|
16
|
+
color: string;
|
|
17
|
+
onColor: string;
|
|
18
|
+
ink: string;
|
|
19
|
+
tonal: string;
|
|
20
|
+
}>;
|
|
21
|
+
protected readonly fontSize: import("@angular/core").Signal<number>;
|
|
22
|
+
protected readonly background: import("@angular/core").Signal<string>;
|
|
23
|
+
protected readonly loadingColor: import("@angular/core").Signal<string>;
|
|
24
|
+
protected readonly held: import("@angular/core").WritableSignal<boolean>;
|
|
25
|
+
protected readonly unavailable: import("@angular/core").Signal<boolean>;
|
|
26
|
+
protected readonly classes: import("@angular/core").Signal<string>;
|
|
27
|
+
protected activate(event: PressEvent): void;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NeuButtonComponent, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NeuButtonComponent, "neu-button", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "accessibilityLabel": { "alias": "accessibilityLabel"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fullWidth": { "alias": "fullWidth"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, { "pressed": "pressed"; }, never, never, true, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Component, booleanAttribute, computed, inject, input, output, signal, } from '@angular/core';
|
|
2
|
+
import { ActivityIndicator, Text, } from '@ng-native/components';
|
|
3
|
+
import { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';
|
|
4
|
+
import { NEU_LIGHT_TOKENS, NEU_THEME, } from '../foundation/index.js';
|
|
5
|
+
import { neuTonePalette } from '../foundation/tone.js';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class NeuButtonComponent {
|
|
8
|
+
label = input.required(/* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
10
|
+
accessibilityLabel = input('', /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "accessibilityLabel" }] : /* istanbul ignore next */ []));
|
|
12
|
+
variant = input('solid', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
14
|
+
tone = input('brand', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
16
|
+
size = input('md', /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
18
|
+
fullWidth = input(false, { ...(ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
19
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
20
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
21
|
+
pressed = output();
|
|
22
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
23
|
+
palette = computed(() => neuTonePalette(this.theme?.() ?? NEU_LIGHT_TOKENS, this.tone()), /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "palette" }] : /* istanbul ignore next */ []));
|
|
25
|
+
fontSize = computed(() => (this.theme?.() ?? NEU_LIGHT_TOKENS).fontSize * (this.size() === 'sm' ? 0.875 : this.size() === 'lg' ? 1.125 : 1), /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "fontSize" }] : /* istanbul ignore next */ []));
|
|
27
|
+
background = computed(() => this.variant() === 'solid' ? this.palette().color : this.variant() === 'tonal' ? this.palette().tonal : 'transparent', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "background" }] : /* istanbul ignore next */ []));
|
|
29
|
+
loadingColor = computed(() => {
|
|
30
|
+
return this.variant() === 'solid' ? this.palette().onColor : this.palette().ink;
|
|
31
|
+
}, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "loadingColor" }] : /* istanbul ignore next */ []));
|
|
33
|
+
held = signal(false, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "held" }] : /* istanbul ignore next */ []));
|
|
35
|
+
unavailable = computed(() => this.disabled() || this.loading(), /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "unavailable" }] : /* istanbul ignore next */ []));
|
|
37
|
+
classes = computed(() => 'control ' + this.variant() + ' ' + this.size(), /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
39
|
+
activate(event) {
|
|
40
|
+
if (!this.unavailable())
|
|
41
|
+
this.pressed.emit(event);
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuButtonComponent, isStandalone: true, selector: "neu-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, accessibilityLabel: { classPropertyName: "accessibilityLabel", publicName: "accessibilityLabel", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { properties: { "style.width": "fullWidth() ? '100%' : null", "style.alignSelf": "fullWidth() ? 'stretch' : 'flex-start'", "style.opacity": "unavailable() ? 0.45 : held() ? 0.8 : 1" } }, ngImport: i0, template: `
|
|
45
|
+
<pressable
|
|
46
|
+
[class]="classes()"
|
|
47
|
+
accessibilityRole="button"
|
|
48
|
+
[accessibilityLabel]="accessibilityLabel() || label()"
|
|
49
|
+
[accessibilityState]="{ disabled: unavailable(), busy: loading() }"
|
|
50
|
+
[aria-disabled]="unavailable()"
|
|
51
|
+
[aria-busy]="loading()"
|
|
52
|
+
[disabled]="unavailable()"
|
|
53
|
+
[style.width]="fullWidth() ? '100%' : null"
|
|
54
|
+
[style.alignSelf]="fullWidth() ? 'stretch' : 'flex-start'"
|
|
55
|
+
[style.backgroundColor]="background()"
|
|
56
|
+
[style.borderColor]="variant() === 'outline' ? palette().color : 'transparent'"
|
|
57
|
+
(pressIn)="held.set(true)"
|
|
58
|
+
(pressOut)="held.set(false)"
|
|
59
|
+
(press)="activate($event)"
|
|
60
|
+
>
|
|
61
|
+
@if (loading()) {
|
|
62
|
+
<activity-indicator
|
|
63
|
+
size="small"
|
|
64
|
+
[color]="loadingColor()"
|
|
65
|
+
[accessible]="false"
|
|
66
|
+
[accessibilityElementsHidden]="true"
|
|
67
|
+
importantForAccessibility="no-hide-descendants"
|
|
68
|
+
/>
|
|
69
|
+
}
|
|
70
|
+
<text class="label" [style.color]="loadingColor()" [style.fontSize]="fontSize()" [allowFontScaling]="true">{{ label() }}</text>
|
|
71
|
+
</pressable>
|
|
72
|
+
`, isInline: true, styles: ["\n :host { transition: opacity var(--neu-duration, 120ms); }\n .control {\n max-width: 100%;\n min-width: 48px;\n min-height: 56px;\n padding: 12px 20px;\n border-radius: var(--neu-radius, 12px);\n flex-direction: row;\n gap: 8px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #006ee6);\n }\n .label {\n flex-shrink: 1;\n color: var(--neu-on-accent, #ffffff);\n font-size: var(--neu-font-size, 16px);\n font-weight: 600;\n }\n .tonal {\n background-color: var(--neu-tonal, #eff6ff);\n }\n .control.tonal > .label,\n .control.outline > .label,\n .control.text > .label {\n color: var(--neu-accent, #006ee6);\n }\n .outline {\n background-color: transparent;\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n }\n .text {\n background-color: transparent;\n }\n .sm {\n min-height: 48px;\n padding: 10px 14px;\n }\n .lg {\n min-height: 64px;\n padding: 16px 24px;\n }\n @media (prefers-reduced-motion: reduce) {\n :host { transition: none; }\n }\n "], dependencies: [{ kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: ActivityIndicator, selector: "activity-indicator", inputs: ["size", "animating", "color", "hidesWhenStopped"] }] });
|
|
73
|
+
}
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuButtonComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{ selector: 'neu-button', imports: [Pressable, Text, ActivityIndicator], host: {
|
|
77
|
+
'[style.width]': "fullWidth() ? '100%' : null",
|
|
78
|
+
'[style.alignSelf]': "fullWidth() ? 'stretch' : 'flex-start'",
|
|
79
|
+
'[style.opacity]': 'unavailable() ? 0.45 : held() ? 0.8 : 1',
|
|
80
|
+
}, template: `
|
|
81
|
+
<pressable
|
|
82
|
+
[class]="classes()"
|
|
83
|
+
accessibilityRole="button"
|
|
84
|
+
[accessibilityLabel]="accessibilityLabel() || label()"
|
|
85
|
+
[accessibilityState]="{ disabled: unavailable(), busy: loading() }"
|
|
86
|
+
[aria-disabled]="unavailable()"
|
|
87
|
+
[aria-busy]="loading()"
|
|
88
|
+
[disabled]="unavailable()"
|
|
89
|
+
[style.width]="fullWidth() ? '100%' : null"
|
|
90
|
+
[style.alignSelf]="fullWidth() ? 'stretch' : 'flex-start'"
|
|
91
|
+
[style.backgroundColor]="background()"
|
|
92
|
+
[style.borderColor]="variant() === 'outline' ? palette().color : 'transparent'"
|
|
93
|
+
(pressIn)="held.set(true)"
|
|
94
|
+
(pressOut)="held.set(false)"
|
|
95
|
+
(press)="activate($event)"
|
|
96
|
+
>
|
|
97
|
+
@if (loading()) {
|
|
98
|
+
<activity-indicator
|
|
99
|
+
size="small"
|
|
100
|
+
[color]="loadingColor()"
|
|
101
|
+
[accessible]="false"
|
|
102
|
+
[accessibilityElementsHidden]="true"
|
|
103
|
+
importantForAccessibility="no-hide-descendants"
|
|
104
|
+
/>
|
|
105
|
+
}
|
|
106
|
+
<text class="label" [style.color]="loadingColor()" [style.fontSize]="fontSize()" [allowFontScaling]="true">{{ label() }}</text>
|
|
107
|
+
</pressable>
|
|
108
|
+
`, styles: ["\n :host { transition: opacity var(--neu-duration, 120ms); }\n .control {\n max-width: 100%;\n min-width: 48px;\n min-height: 56px;\n padding: 12px 20px;\n border-radius: var(--neu-radius, 12px);\n flex-direction: row;\n gap: 8px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #006ee6);\n }\n .label {\n flex-shrink: 1;\n color: var(--neu-on-accent, #ffffff);\n font-size: var(--neu-font-size, 16px);\n font-weight: 600;\n }\n .tonal {\n background-color: var(--neu-tonal, #eff6ff);\n }\n .control.tonal > .label,\n .control.outline > .label,\n .control.text > .label {\n color: var(--neu-accent, #006ee6);\n }\n .outline {\n background-color: transparent;\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n }\n .text {\n background-color: transparent;\n }\n .sm {\n min-height: 48px;\n padding: 10px 14px;\n }\n .lg {\n min-height: 64px;\n padding: 16px 24px;\n }\n @media (prefers-reduced-motion: reduce) {\n :host { transition: none; }\n }\n "] }]
|
|
109
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], accessibilityLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLabel", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
110
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport {\n ActivityIndicator,\n Text,\n type PressEvent,\n} from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuSize,\n type NeuVariant,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n\n@Component({\n selector: 'neu-button',\n imports: [Pressable, Text, ActivityIndicator],\n host: {\n '[style.width]': \"fullWidth() ? '100%' : null\",\n '[style.alignSelf]': \"fullWidth() ? 'stretch' : 'flex-start'\",\n '[style.opacity]': 'unavailable() ? 0.45 : held() ? 0.8 : 1',\n },\n template: `\n <pressable\n [class]=\"classes()\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"accessibilityLabel() || label()\"\n [accessibilityState]=\"{ disabled: unavailable(), busy: loading() }\"\n [aria-disabled]=\"unavailable()\"\n [aria-busy]=\"loading()\"\n [disabled]=\"unavailable()\"\n [style.width]=\"fullWidth() ? '100%' : null\"\n [style.alignSelf]=\"fullWidth() ? 'stretch' : 'flex-start'\"\n [style.backgroundColor]=\"background()\"\n [style.borderColor]=\"variant() === 'outline' ? palette().color : 'transparent'\"\n (pressIn)=\"held.set(true)\"\n (pressOut)=\"held.set(false)\"\n (press)=\"activate($event)\"\n >\n @if (loading()) {\n <activity-indicator\n size=\"small\"\n [color]=\"loadingColor()\"\n [accessible]=\"false\"\n [accessibilityElementsHidden]=\"true\"\n importantForAccessibility=\"no-hide-descendants\"\n />\n }\n <text class=\"label\" [style.color]=\"loadingColor()\" [style.fontSize]=\"fontSize()\" [allowFontScaling]=\"true\">{{ label() }}</text>\n </pressable>\n `,\n styles: `\n :host { transition: opacity var(--neu-duration, 120ms); }\n .control {\n max-width: 100%;\n min-width: 48px;\n min-height: 56px;\n padding: 12px 20px;\n border-radius: var(--neu-radius, 12px);\n flex-direction: row;\n gap: 8px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #006ee6);\n }\n .label {\n flex-shrink: 1;\n color: var(--neu-on-accent, #ffffff);\n font-size: var(--neu-font-size, 16px);\n font-weight: 600;\n }\n .tonal {\n background-color: var(--neu-tonal, #eff6ff);\n }\n .control.tonal > .label,\n .control.outline > .label,\n .control.text > .label {\n color: var(--neu-accent, #006ee6);\n }\n .outline {\n background-color: transparent;\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n }\n .text {\n background-color: transparent;\n }\n .sm {\n min-height: 48px;\n padding: 10px 14px;\n }\n .lg {\n min-height: 64px;\n padding: 16px 24px;\n }\n @media (prefers-reduced-motion: reduce) {\n :host { transition: none; }\n }\n `,\n})\nexport class NeuButtonComponent {\n readonly label = input.required<string>();\n readonly accessibilityLabel = input('');\n readonly variant = input<NeuVariant>('solid');\n readonly tone = input<NeuTone>('brand');\n readonly size = input<NeuSize>('md');\n readonly fullWidth = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly loading = input(false, { transform: booleanAttribute });\n readonly pressed = output<PressEvent>();\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly palette = computed(() => neuTonePalette(this.theme?.() ?? NEU_LIGHT_TOKENS, this.tone()));\n protected readonly fontSize = computed(() => (this.theme?.() ?? NEU_LIGHT_TOKENS).fontSize * (this.size() === 'sm' ? 0.875 : this.size() === 'lg' ? 1.125 : 1));\n protected readonly background = computed(() => this.variant() === 'solid' ? this.palette().color : this.variant() === 'tonal' ? this.palette().tonal : 'transparent');\n protected readonly loadingColor = computed(() => {\n return this.variant() === 'solid' ? this.palette().onColor : this.palette().ink;\n });\n protected readonly held = signal(false);\n protected readonly unavailable = computed(\n () => this.disabled() || this.loading(),\n );\n protected readonly classes = computed(\n () => 'control ' + this.variant() + ' ' + this.size(),\n );\n protected activate(event: PressEvent): void {\n if (!this.unavailable()) this.pressed.emit(event);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NeuButtonComponent } from './button.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { NeuButtonComponent } from './button.js';\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NeuOption } from '../foundation/mobile.js';
|
|
2
|
+
import { type NeuTone } from '../foundation/index.js';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NeuButtonGroupComponent {
|
|
5
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
6
|
+
readonly items: import("@angular/core").InputSignal<readonly NeuOption[]>;
|
|
7
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
8
|
+
readonly tone: import("@angular/core").InputSignal<NeuTone>;
|
|
9
|
+
readonly activated: import("@angular/core").OutputEmitterRef<string>;
|
|
10
|
+
protected readonly scrollContent: {
|
|
11
|
+
flexGrow: number;
|
|
12
|
+
};
|
|
13
|
+
protected readonly held: import("@angular/core").WritableSignal<string | null>;
|
|
14
|
+
private readonly theme;
|
|
15
|
+
protected readonly tokens: import("@angular/core").Signal<Readonly<import("../foundation/index.js").NeuTokens>>;
|
|
16
|
+
protected readonly palette: import("@angular/core").Signal<{
|
|
17
|
+
color: string;
|
|
18
|
+
onColor: string;
|
|
19
|
+
ink: string;
|
|
20
|
+
tonal: string;
|
|
21
|
+
}>;
|
|
22
|
+
protected activate(item: NeuOption): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NeuButtonGroupComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NeuButtonGroupComponent, "neu-button-group", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; }, { "activated": "activated"; }, never, never, true, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { booleanAttribute, Component, computed, inject, input, output, signal, } from '@angular/core';
|
|
2
|
+
import { View, Text, ScrollView } from '@ng-native/components';
|
|
3
|
+
import { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';
|
|
4
|
+
import { NEU_LIGHT_TOKENS, NEU_THEME, } from '../foundation/index.js';
|
|
5
|
+
import { neuTonePalette } from '../foundation/tone.js';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class NeuButtonGroupComponent {
|
|
8
|
+
label = input('Actions', /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
10
|
+
items = input([], /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
12
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13
|
+
tone = input('brand', /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
15
|
+
activated = output();
|
|
16
|
+
scrollContent = { flexGrow: 1 };
|
|
17
|
+
held = signal(null, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "held" }] : /* istanbul ignore next */ []));
|
|
19
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
20
|
+
tokens = computed(() => this.theme?.() ?? NEU_LIGHT_TOKENS, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "tokens" }] : /* istanbul ignore next */ []));
|
|
22
|
+
palette = computed(() => neuTonePalette(this.tokens(), this.tone()), /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "palette" }] : /* istanbul ignore next */ []));
|
|
24
|
+
activate(item) {
|
|
25
|
+
if (!this.disabled() && !item.disabled)
|
|
26
|
+
this.activated.emit(item.id);
|
|
27
|
+
}
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuButtonGroupComponent, isStandalone: true, selector: "neu-button-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "activated" }, ngImport: i0, template: `@if (items().length) {
|
|
30
|
+
<scroll-view
|
|
31
|
+
class="group-scroll"
|
|
32
|
+
[horizontal]="true"
|
|
33
|
+
keyboardShouldPersistTaps="handled"
|
|
34
|
+
[showsHorizontalScrollIndicator]="false"
|
|
35
|
+
[contentContainerStyle]="scrollContent"
|
|
36
|
+
>
|
|
37
|
+
<view
|
|
38
|
+
class="button-group"
|
|
39
|
+
[accessibilityLabel]="label()"
|
|
40
|
+
[style.minWidth]="items().length * 48 + 2"
|
|
41
|
+
>
|
|
42
|
+
@for (item of items(); track item.id; let last = $last) {
|
|
43
|
+
<pressable
|
|
44
|
+
class="group-action"
|
|
45
|
+
accessibilityRole="button"
|
|
46
|
+
[accessibilityLabel]="item.label"
|
|
47
|
+
[disabled]="disabled() || !!item.disabled"
|
|
48
|
+
[accessibilityState]="{ disabled: disabled() || item.disabled }"
|
|
49
|
+
[class.neu-unavailable]="disabled() || item.disabled"
|
|
50
|
+
[style.borderRightWidth]="last ? 0 : 1"
|
|
51
|
+
[style.backgroundColor]="
|
|
52
|
+
!disabled() && !item.disabled && held() === item.id
|
|
53
|
+
? palette().tonal
|
|
54
|
+
: tokens().surface
|
|
55
|
+
"
|
|
56
|
+
(pressIn)="held.set(item.id)"
|
|
57
|
+
(pressOut)="held.set(null)"
|
|
58
|
+
(press)="activate(item)"
|
|
59
|
+
><text
|
|
60
|
+
class="label"
|
|
61
|
+
pointerEvents="none"
|
|
62
|
+
[accessible]="false"
|
|
63
|
+
[style.color]="palette().ink"
|
|
64
|
+
[numberOfLines]="2"
|
|
65
|
+
ellipsizeMode="tail"
|
|
66
|
+
>{{ item.label }}</text
|
|
67
|
+
></pressable
|
|
68
|
+
>
|
|
69
|
+
}
|
|
70
|
+
</view></scroll-view
|
|
71
|
+
>
|
|
72
|
+
}`, isInline: true, styles: ["\n .neu-unavailable > * { opacity: 0.45; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .button-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n overflow: hidden;\n }\n .group-action {\n min-height: 48px;\n min-width: 48px;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0;\n padding: 12px 8px;\n justify-content: center;\n align-items: center;\n border-color: var(--neu-border, #a5afbf);\n background-color: var(--neu-surface, #ffffff);\n }\n .label {\n color: var(--neu-accent-ink, #3155d9);\n font-size: 14px;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }] });
|
|
73
|
+
}
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuButtonGroupComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{ selector: 'neu-button-group', imports: [View, Text, Pressable, ScrollView], template: `@if (items().length) {
|
|
77
|
+
<scroll-view
|
|
78
|
+
class="group-scroll"
|
|
79
|
+
[horizontal]="true"
|
|
80
|
+
keyboardShouldPersistTaps="handled"
|
|
81
|
+
[showsHorizontalScrollIndicator]="false"
|
|
82
|
+
[contentContainerStyle]="scrollContent"
|
|
83
|
+
>
|
|
84
|
+
<view
|
|
85
|
+
class="button-group"
|
|
86
|
+
[accessibilityLabel]="label()"
|
|
87
|
+
[style.minWidth]="items().length * 48 + 2"
|
|
88
|
+
>
|
|
89
|
+
@for (item of items(); track item.id; let last = $last) {
|
|
90
|
+
<pressable
|
|
91
|
+
class="group-action"
|
|
92
|
+
accessibilityRole="button"
|
|
93
|
+
[accessibilityLabel]="item.label"
|
|
94
|
+
[disabled]="disabled() || !!item.disabled"
|
|
95
|
+
[accessibilityState]="{ disabled: disabled() || item.disabled }"
|
|
96
|
+
[class.neu-unavailable]="disabled() || item.disabled"
|
|
97
|
+
[style.borderRightWidth]="last ? 0 : 1"
|
|
98
|
+
[style.backgroundColor]="
|
|
99
|
+
!disabled() && !item.disabled && held() === item.id
|
|
100
|
+
? palette().tonal
|
|
101
|
+
: tokens().surface
|
|
102
|
+
"
|
|
103
|
+
(pressIn)="held.set(item.id)"
|
|
104
|
+
(pressOut)="held.set(null)"
|
|
105
|
+
(press)="activate(item)"
|
|
106
|
+
><text
|
|
107
|
+
class="label"
|
|
108
|
+
pointerEvents="none"
|
|
109
|
+
[accessible]="false"
|
|
110
|
+
[style.color]="palette().ink"
|
|
111
|
+
[numberOfLines]="2"
|
|
112
|
+
ellipsizeMode="tail"
|
|
113
|
+
>{{ item.label }}</text
|
|
114
|
+
></pressable
|
|
115
|
+
>
|
|
116
|
+
}
|
|
117
|
+
</view></scroll-view
|
|
118
|
+
>
|
|
119
|
+
}`, styles: ["\n .neu-unavailable > * { opacity: 0.45; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .button-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n overflow: hidden;\n }\n .group-action {\n min-height: 48px;\n min-width: 48px;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0;\n padding: 12px 8px;\n justify-content: center;\n align-items: center;\n border-color: var(--neu-border, #a5afbf);\n background-color: var(--neu-surface, #ffffff);\n }\n .label {\n color: var(--neu-accent-ink, #3155d9);\n font-size: 14px;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n "] }]
|
|
120
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], activated: [{ type: i0.Output, args: ["activated"] }] } });
|
|
121
|
+
//# sourceMappingURL=button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../src/button-group/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AA2FvD,MAAM,OAAO,uBAAuB;IACzB,KAAK,GAAG,KAAK,CAAC,SAAS;8EAAC,CAAC;IACzB,KAAK,GAAG,KAAK,CAAuB,EAAE;8EAAC,CAAC;IACxC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,IAAI,GAAG,KAAK,CAAU,OAAO;6EAAC,CAAC;IAC/B,SAAS,GAAG,MAAM,EAAU,CAAC;IACnB,aAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAChC,IAAI,GAAG,MAAM,CAAgB,IAAI;6EAAC,CAAC;IACrC,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAM,GAAG,QAAQ,CAClC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,gBAAgB;+EACzC,CAAC;IACiB,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CACzC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;gFAC3C,CAAC;IACQ,QAAQ,CAAC,IAAe;QAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;uGAjBU,uBAAuB;2FAAvB,uBAAuB,mmBAtFxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2CR,wiCA5CQ,IAAI,iDAAE,IAAI,mYAAE,SAAS,+EAAE,UAAU;;2FAuFhC,uBAAuB;kBAzFnC,SAAS;+BACE,kBAAkB,WACnB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,YAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2CR","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { View, Text, ScrollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption } from '../foundation/mobile.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n\n@Component({\n selector: 'neu-button-group',\n imports: [View, Text, Pressable, ScrollView],\n template: `@if (items().length) {\n <scroll-view\n class=\"group-scroll\"\n [horizontal]=\"true\"\n keyboardShouldPersistTaps=\"handled\"\n [showsHorizontalScrollIndicator]=\"false\"\n [contentContainerStyle]=\"scrollContent\"\n >\n <view\n class=\"button-group\"\n [accessibilityLabel]=\"label()\"\n [style.minWidth]=\"items().length * 48 + 2\"\n >\n @for (item of items(); track item.id; let last = $last) {\n <pressable\n class=\"group-action\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"item.label\"\n [disabled]=\"disabled() || !!item.disabled\"\n [accessibilityState]=\"{ disabled: disabled() || item.disabled }\"\n [class.neu-unavailable]=\"disabled() || item.disabled\"\n [style.borderRightWidth]=\"last ? 0 : 1\"\n [style.backgroundColor]=\"\n !disabled() && !item.disabled && held() === item.id\n ? palette().tonal\n : tokens().surface\n \"\n (pressIn)=\"held.set(item.id)\"\n (pressOut)=\"held.set(null)\"\n (press)=\"activate(item)\"\n ><text\n class=\"label\"\n pointerEvents=\"none\"\n [accessible]=\"false\"\n [style.color]=\"palette().ink\"\n [numberOfLines]=\"2\"\n ellipsizeMode=\"tail\"\n >{{ item.label }}</text\n ></pressable\n >\n }\n </view></scroll-view\n >\n }`,\n styles: `\n .neu-unavailable > * { opacity: 0.45; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .button-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n overflow: hidden;\n }\n .group-action {\n min-height: 48px;\n min-width: 48px;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0;\n padding: 12px 8px;\n justify-content: center;\n align-items: center;\n border-color: var(--neu-border, #a5afbf);\n background-color: var(--neu-surface, #ffffff);\n }\n .label {\n color: var(--neu-accent-ink, #3155d9);\n font-size: 14px;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n `,\n})\nexport class NeuButtonGroupComponent {\n readonly label = input('Actions');\n readonly items = input<readonly NeuOption[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly tone = input<NeuTone>('brand');\n readonly activated = output<string>();\n protected readonly scrollContent = { flexGrow: 1 };\n protected readonly held = signal<string | null>(null);\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly tokens = computed(\n () => this.theme?.() ?? NEU_LIGHT_TOKENS,\n );\n protected readonly palette = computed(() =>\n neuTonePalette(this.tokens(), this.tone()),\n );\n protected activate(item: NeuOption): void {\n if (!this.disabled() && !item.disabled) this.activated.emit(item.id);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button-group.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/button-group/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './button-group.js';\n"]}
|