@neural-ui/native 0.1.0-beta.7 → 0.1.0-beta.8

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Neural Native brings the Neural visual language to [Angular Native](https://ng-native.com): 64 mobile component entries, Angular signals, typed APIs, shared themes and modular imports.
6
6
 
7
- **Public beta: `0.1.0-beta.7`.** APIs and framework compatibility may change before 1.0. Pin the version in your application lockfile and check compatibility before updating Angular Native.
7
+ **Public beta: `0.1.0-beta.8`.** APIs and framework compatibility may change before 1.0. Pin the version in your application lockfile and check compatibility before updating Angular Native.
8
8
 
9
9
  ## Documentation
10
10
 
@@ -18,18 +18,18 @@ Neural Native brings the Neural visual language to [Angular Native](https://ng-n
18
18
  Start with the compatible Angular Native template:
19
19
 
20
20
  ```sh
21
- npx create-expo-app@latest my-neural-app --template @ng-native/template@0.22.2
21
+ npx create-expo-app@latest my-neural-app --template @ng-native/template@0.23.0
22
22
  cd my-neural-app
23
23
  npm install @neural-ui/native@beta
24
24
  ```
25
25
 
26
- In an existing Angular Native 0.22.2 application, run only the last command. The beta is published under the npm `beta` tag; `@beta` is intentional. Applications on Angular Native 0.21.0 should keep Neural Native 0.1.0-beta.6. Applications on Angular Native 0.19.2 should keep Neural Native 0.1.0-beta.5. Applications on Angular Native 0.18.2 should keep Neural Native 0.1.0-beta.2 until they update the framework.
26
+ In an existing Angular Native 0.23.0 application, run only the last command. The beta is published under the npm `beta` tag; `@beta` is intentional. Applications on Angular Native 0.21.0 should keep Neural Native 0.1.0-beta.6. Applications on Angular Native 0.19.2 should keep Neural Native 0.1.0-beta.5. Applications on Angular Native 0.18.2 should keep Neural Native 0.1.0-beta.2 until they update the framework.
27
27
 
28
28
  ### Compatibility
29
29
 
30
30
  | Dependency | This beta |
31
31
  | --- | --- |
32
- | Angular Native packages | 0.22.2 |
32
+ | Angular Native packages | 0.23.0 |
33
33
  | Angular | 22.2.2 tested; peers >=22.2.0 <23 |
34
34
  | Expo / React Native | 57.0.27 / 0.86.3 tested application baseline |
35
35
  | Current framework template | Expo 58.0.16 / React Native 0.88.0: consumer tests and iOS/Android bundles verified |
@@ -180,7 +180,7 @@ Neural Native is maintained by Pedro Moreno Trujillo and shares its visual ident
180
180
 
181
181
  ## Español
182
182
 
183
- Neural Native ofrece componentes Angular nativos para iOS y Android. Esta beta.7 se instala con `npm install @neural-ui/native@beta` sobre una aplicación Angular Native 0.22.2. Para Angular Native 0.21.0, conserva beta.6. Si tu aplicación utiliza Angular Native 0.19.2, conserva beta.5; para Angular Native 0.18.2, conserva Neural Native 0.1.0-beta.2 hasta actualizar el framework. Los controles utilizan signals, un tema compartido e imports modulares; tu aplicación conserva el estado y decide cómo guardar los datos. Desde beta.5 puedes activar la respuesta háptica opcional, silenciar controles concretos y cambiar esa preferencia durante la ejecución.
183
+ Neural Native ofrece componentes Angular nativos para iOS y Android. Esta beta.7 se instala con `npm install @neural-ui/native@beta` sobre una aplicación Angular Native 0.23.0. Para Angular Native 0.21.0, conserva beta.6. Si tu aplicación utiliza Angular Native 0.19.2, conserva beta.5; para Angular Native 0.18.2, conserva Neural Native 0.1.0-beta.2 hasta actualizar el framework. Los controles utilizan signals, un tema compartido e imports modulares; tu aplicación conserva el estado y decide cómo guardar los datos. Desde beta.5 puedes activar la respuesta háptica opcional, silenciar controles concretos y cambiar esa preferencia durante la ejecución.
184
184
 
185
185
  ## License
186
186
 
@@ -97,7 +97,7 @@ export class NeuBottomSheetComponent {
97
97
  ><scroll-view class="sheet-scroll" [class.sheet-fixed-scroll]="!!panelHeight()" keyboardShouldPersistTaps="handled"
98
98
  ><view class="stack scroll-content"
99
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", inputs: ["haptic"], 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]" }] });
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", "anchor"] }, { 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", inputs: ["haptic"], 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
101
  }
102
102
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuBottomSheetComponent, decorators: [{
103
103
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet.js","sourceRoot":"","sources":["../../src/bottom-sheet/bottom-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;AAgEtD,MAAM,OAAO,uBAAuB;IACzB,IAAI,GAAG,KAAK,CAAC,KAAK;6EAAC,CAAC;IAC7B,2EAA2E;IAC3E,4EAA4E;IACzD,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,aAAa,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClD,UAAU,GAAG;QAC9B,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,Q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AAC;IACS,GAAG,CAAC,KAAiB;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE;YACtE,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;uGA1CU,uBAAuB;2FAAvB,uBAAuB,6yBA/CxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4CE,+6JAtDV,KAAK,wQACL,gBAAgB,yFAChB,YAAY,sFACZ,oBAAoB,gLACpB,IAAI,iDACJ,IAAI,mYACJ,SAAS,mGACT,UAAU,0TACV,aAAa;;2FAiDJ,uBAAuB;kBA5DnC,SAAS;+BACE,kBAAkB,WACnB;wBACP,KAAK;wBACL,gBAAgB;wBAChB,YAAY;wBACZ,oBAAoB;wBACpB,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,UAAU;wBACV,aAAa;qBACd,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4CE","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"]}
1
+ {"version":3,"file":"bottom-sheet.js","sourceRoot":"","sources":["../../src/bottom-sheet/bottom-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;AAgEtD,MAAM,OAAO,uBAAuB;IACzB,IA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AK;QACH,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACrB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IACS,KAAK,CAAC,KAAiB;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;IACxC,CAAC;IACS,GAAG,CAAC,KAAiB;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE;YACtE,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;uGA1CU,uBAAuB;2FAAvB,uBAAuB,6yBA/CxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4CE,+6JAtDV,KAAK,kRACL,gBAAgB,yFAChB,YAAY,sFACZ,oBAAoB,gLACpB,IAAI,iDACJ,IAAI,mYACJ,SAAS,mGACT,UAAU,0TACV,aAAa;;2FAiDJ,uBAAuB;kBA5DnC,SAAS;+BACE,kBAAkB,WACnB;wBACP,KAAK;wBACL,gBAAgB;wBAChB,YAAY;wBACZ,oBAAoB;wBACpB,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,UAAU;wBACV,aAAa;qBACd,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4CE","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"]}
@@ -72,7 +72,7 @@ export class NeuButtonComponent {
72
72
  }
73
73
  <text class="label" [style.color]="loadingColor()" [style.fontSize]="fontSize()" [allowFontScaling]="true">{{ label() }}</text>
74
74
  </pressable>
75
- `, 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", inputs: ["haptic"], 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"] }] });
75
+ `, 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", inputs: ["haptic"], 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", "controlSize", "animating", "color", "hidesWhenStopped"] }] });
76
76
  }
77
77
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuButtonComponent, decorators: [{
78
78
  type: Component,
@@ -106,7 +106,7 @@ export class NeuAnchoredOverlayComponent {
106
106
  </scroll-view>
107
107
  </view>
108
108
  </view>
109
- </modal>`, isInline: true, styles: [".overlay-root {\n flex: 1;\n}\n.overlay-dismiss {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.overlay-popup {\n position: absolute;\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n border-radius: var(--neu-overlay-radius, 16px);\n background-color: var(--neu-surface, #ffffff);\n overflow: hidden;\n}\n.overlay-scroll {\n flex: 1;\n min-height: 0;\n}\n.overlay-content {\n padding: 6px;\n padding-right: 6px;\n}\n"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], 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: View, selector: "view" }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }] });
109
+ </modal>`, isInline: true, styles: [".overlay-root {\n flex: 1;\n}\n.overlay-dismiss {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.overlay-popup {\n position: absolute;\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n border-radius: var(--neu-overlay-radius, 16px);\n background-color: var(--neu-surface, #ffffff);\n overflow: hidden;\n}\n.overlay-scroll {\n flex: 1;\n min-height: 0;\n}\n.overlay-content {\n padding: 6px;\n padding-right: 6px;\n}\n"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated", "anchor"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], 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: View, selector: "view" }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }] });
110
110
  }
111
111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuAnchoredOverlayComponent, decorators: [{
112
112
  type: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;;;;;;;;WAmBD,8iBApBC,KAAK,wQAAE,SAAS,mGAAE,UAAU,0TAAE,IAAI,iDAAE,aAAa;;2FAuBhD,2BAA2B;kBAzBvC,SAAS;+BACE,sBAAsB,WACvB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,CAAC,YAClD;;;;;;;;;;;;;;;;;;;WAmBD;mnBAiB2B,IAAI,QAAE,EAAE,IAAI,EAAE,CAAA,UAAoB,CAAA,EAAE","sourcesContent":["import { Component, DestroyRef, ElementRef, computed, effect, inject, input, model, signal, viewChild } from '@angular/core';\nimport { Modal, ScrollView, View, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from './native-pressable.js';\nimport { HostEngine, type HostNode } from '@ng-native/fabric';\nimport { Keyboard, SafeArea } from '@ng-native/device';\nimport { anchoredLayout } from './anchored-layout.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from './motion.js';\n\n/** Internal anchored surface shared by native popup controls. */\n@Component({\n selector: 'neu-anchored-overlay',\n imports: [Modal, Pressable, ScrollView, View, AnimatedStyle],\n template: `<modal [supportedOrientations]=\"['portrait', 'landscape']\" [visible]=\"motion.visible()\" [transparent]=\"true\" animationType=\"none\"\n presentationStyle=\"overFullScreen\" [statusBarTranslucent]=\"false\"\n (requestClose)=\"open.set(false)\" (show)=\"measure()\">\n <view class=\"overlay-root\" [collapsable]=\"false\" (layout)=\"layout($event)\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\" [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <pressable class=\"overlay-dismiss\" accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\" (press)=\"open.set(false)\" />\n <view class=\"overlay-popup\" [style.left]=\"position().left\" [style.width]=\"position().width\"\n [animatedStyle]=\"popupStyle\"\n [style.top]=\"position().top\" [style.bottom]=\"position().bottom\"\n [style.height]=\"popupHeight()\"\n [style.maxHeight]=\"position().height\" [accessibilityViewIsModal]=\"open()\">\n <scroll-view class=\"overlay-scroll\" keyboardShouldPersistTaps=\"handled\"\n (contentSizeChange)=\"contentHeight.set($event.height)\">\n <view class=\"overlay-content\"><ng-content /></view>\n </scroll-view>\n </view>\n </view>\n </modal>`,\n styleUrl: './anchored-overlay.css',\n})\nexport class NeuAnchoredOverlayComponent {\n readonly open = model(false);\n // The popup is remeasured after its Modal mounts. JS frames keep opacity in sync\n // with those layout commits instead of reconnecting a native animation tag.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly popupStyle = { opacity: this.motion.progress };\n readonly anchor = input<HostNode>();\n readonly closeLabel = input('Dismiss options');\n readonly minimumWidth = input(160);\n readonly gap = input(8);\n private readonly engine = inject(HostEngine);\n private readonly keyboard = inject(Keyboard);\n private readonly safeArea = inject(SafeArea);\n private readonly destroy = inject(DestroyRef);\n private readonly origin = viewChild(View, { read: ElementRef<HostNode> });\n private measurement = 0;\n private readonly viewport = signal({ width: 360, height: 800 });\n private readonly frame = signal({ x: 16, y: 64, width: 328, height: 48 });\n private readonly windowOrigin = signal({ x: 0, y: 0 });\n protected readonly position = signal<{ left: number; width: number; top: number | null; bottom: number | null; height: number }>({ left: 16, width: 328, top: 120, bottom: null, height: 320 });\n protected readonly contentHeight = signal(0);\n // A native ScrollView needs a bounded viewport before it can measure its content.\n protected readonly popupHeight = computed(() => {\n const height = this.contentHeight(), available = this.position().height;\n return height > 0 ? Math.min(available, height + 2) : available;\n });\n constructor() {\n effect(() => {\n if (this.open() && this.anchor() && this.origin()) this.measure();\n else this.measurement++;\n });\n effect(() => {\n const view = this.viewport(), anchor = this.frame();\n const keyboard = this.keyboard.position();\n const keyboardTop = this.keyboard.visible()\n ? (keyboard.screenY ?? view.height - keyboard.height) - this.windowOrigin().y\n : undefined;\n this.position.set(anchoredLayout(view, anchor, this.minimumWidth(), this.gap(), keyboardTop, this.safeArea.insets()));\n });\n }\n protected layout(event: LayoutEvent): void {\n const { width, height } = event.nativeEvent.layout;\n if (width > 0 && height > 0) { this.viewport.set({ width, height }); this.measure(); }\n }\n protected measure(): void {\n const anchor = this.anchor(), origin = this.origin()?.nativeElement;\n if (!anchor || !origin || !this.open()) return;\n const measurement = ++this.measurement;\n const active = () => !this.destroy.destroyed && this.open() && this.anchor() === anchor && measurement === this.measurement;\n this.engine.measure(origin, originFrame => {\n if (!active()) return;\n this.windowOrigin.set({ x: originFrame.x, y: originFrame.y });\n if (originFrame.width > 0 && originFrame.height > 0) this.viewport.set({ width: originFrame.width, height: originFrame.height });\n this.engine.measure(anchor, frame => {\n if (active()) this.frame.set({ ...frame, x: frame.x - originFrame.x, y: frame.y - originFrame.y });\n });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"anchored-overlay.js","sourceRoot":"","sources":["../../src/foundation/anchored-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7H,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAoB,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAiB,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;;AAE1C,iEAAiE;AA0BjE,MAAM,OAAO,2BAA2B;IAC7B,IAAI,GAAG,KAAK,CAAC,KAAK;6EAAC,CAAC;IAC7B,iFAAiF;IACjF,4EAA4E;IACzD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YACjI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;gBAClC,IAAI,MAAM,EAAE;oBAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;YACrG,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;uGAzDU,2BAA2B;2FAA3B,2BAA2B,2xBAcF,IAAI,2BAAU,UAAU,6CApClD;;;;;;;;;;;;;;;;;;;WAmBD,8iBApBC,KAAK,kRAAE,SAAS,mGAAE,UAAU,0TAAE,IAAI,iDAAE,aAAa;;2FAuBhD,2BAA2B;kBAzBvC,SAAS;+BACE,sBAAsB,WACvB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,CAAC,YAClD;;;;;;;;;;;;;;;;;;;WAmBD;mnBAiB2B,IAAI,QAAE,EAAE,IAAI,EAAE,CAAA,UAAoB,CAAA,EAAE","sourcesContent":["import { Component, DestroyRef, ElementRef, computed, effect, inject, input, model, signal, viewChild } from '@angular/core';\nimport { Modal, ScrollView, View, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from './native-pressable.js';\nimport { HostEngine, type HostNode } from '@ng-native/fabric';\nimport { Keyboard, SafeArea } from '@ng-native/device';\nimport { anchoredLayout } from './anchored-layout.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from './motion.js';\n\n/** Internal anchored surface shared by native popup controls. */\n@Component({\n selector: 'neu-anchored-overlay',\n imports: [Modal, Pressable, ScrollView, View, AnimatedStyle],\n template: `<modal [supportedOrientations]=\"['portrait', 'landscape']\" [visible]=\"motion.visible()\" [transparent]=\"true\" animationType=\"none\"\n presentationStyle=\"overFullScreen\" [statusBarTranslucent]=\"false\"\n (requestClose)=\"open.set(false)\" (show)=\"measure()\">\n <view class=\"overlay-root\" [collapsable]=\"false\" (layout)=\"layout($event)\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\" [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <pressable class=\"overlay-dismiss\" accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\" (press)=\"open.set(false)\" />\n <view class=\"overlay-popup\" [style.left]=\"position().left\" [style.width]=\"position().width\"\n [animatedStyle]=\"popupStyle\"\n [style.top]=\"position().top\" [style.bottom]=\"position().bottom\"\n [style.height]=\"popupHeight()\"\n [style.maxHeight]=\"position().height\" [accessibilityViewIsModal]=\"open()\">\n <scroll-view class=\"overlay-scroll\" keyboardShouldPersistTaps=\"handled\"\n (contentSizeChange)=\"contentHeight.set($event.height)\">\n <view class=\"overlay-content\"><ng-content /></view>\n </scroll-view>\n </view>\n </view>\n </modal>`,\n styleUrl: './anchored-overlay.css',\n})\nexport class NeuAnchoredOverlayComponent {\n readonly open = model(false);\n // The popup is remeasured after its Modal mounts. JS frames keep opacity in sync\n // with those layout commits instead of reconnecting a native animation tag.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly popupStyle = { opacity: this.motion.progress };\n readonly anchor = input<HostNode>();\n readonly closeLabel = input('Dismiss options');\n readonly minimumWidth = input(160);\n readonly gap = input(8);\n private readonly engine = inject(HostEngine);\n private readonly keyboard = inject(Keyboard);\n private readonly safeArea = inject(SafeArea);\n private readonly destroy = inject(DestroyRef);\n private readonly origin = viewChild(View, { read: ElementRef<HostNode> });\n private measurement = 0;\n private readonly viewport = signal({ width: 360, height: 800 });\n private readonly frame = signal({ x: 16, y: 64, width: 328, height: 48 });\n private readonly windowOrigin = signal({ x: 0, y: 0 });\n protected readonly position = signal<{ left: number; width: number; top: number | null; bottom: number | null; height: number }>({ left: 16, width: 328, top: 120, bottom: null, height: 320 });\n protected readonly contentHeight = signal(0);\n // A native ScrollView needs a bounded viewport before it can measure its content.\n protected readonly popupHeight = computed(() => {\n const height = this.contentHeight(), available = this.position().height;\n return height > 0 ? Math.min(available, height + 2) : available;\n });\n constructor() {\n effect(() => {\n if (this.open() && this.anchor() && this.origin()) this.measure();\n else this.measurement++;\n });\n effect(() => {\n const view = this.viewport(), anchor = this.frame();\n const keyboard = this.keyboard.position();\n const keyboardTop = this.keyboard.visible()\n ? (keyboard.screenY ?? view.height - keyboard.height) - this.windowOrigin().y\n : undefined;\n this.position.set(anchoredLayout(view, anchor, this.minimumWidth(), this.gap(), keyboardTop, this.safeArea.insets()));\n });\n }\n protected layout(event: LayoutEvent): void {\n const { width, height } = event.nativeEvent.layout;\n if (width > 0 && height > 0) { this.viewport.set({ width, height }); this.measure(); }\n }\n protected measure(): void {\n const anchor = this.anchor(), origin = this.origin()?.nativeElement;\n if (!anchor || !origin || !this.open()) return;\n const measurement = ++this.measurement;\n const active = () => !this.destroy.destroyed && this.open() && this.anchor() === anchor && measurement === this.measurement;\n this.engine.measure(origin, originFrame => {\n if (!active()) return;\n this.windowOrigin.set({ x: originFrame.x, y: originFrame.y });\n if (originFrame.width > 0 && originFrame.height > 0) this.viewport.set({ width: originFrame.width, height: originFrame.height });\n this.engine.measure(anchor, frame => {\n if (active()) this.frame.set({ ...frame, x: frame.x - originFrame.x, y: frame.y - originFrame.y });\n });\n });\n }\n}\n"]}
@@ -57,7 +57,7 @@ export class NeuIconButtonComponent {
57
57
  <ng-icon [svg]="svg()" [size]="24" [color]="color()" />
58
58
  }
59
59
  </pressable>
60
- `, isInline: true, styles: ["\n .control {\n align-self: flex-start;\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n padding: 12px;\n align-items: center;\n justify-content: center;\n border-radius: var(--neu-radius, 12px);\n background-color: var(--neu-accent, #3155d9);\n }\n .tonal {\n background-color: var(--neu-tonal, #e9edfc);\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 "], dependencies: [{ kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }, { kind: "directive", type: ActivityIndicator, selector: "activity-indicator", inputs: ["size", "animating", "color", "hidesWhenStopped"] }] });
60
+ `, isInline: true, styles: ["\n .control {\n align-self: flex-start;\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n padding: 12px;\n align-items: center;\n justify-content: center;\n border-radius: var(--neu-radius, 12px);\n background-color: var(--neu-accent, #3155d9);\n }\n .tonal {\n background-color: var(--neu-tonal, #e9edfc);\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 "], dependencies: [{ kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }, { kind: "directive", type: ActivityIndicator, selector: "activity-indicator", inputs: ["size", "controlSize", "animating", "color", "hidesWhenStopped"] }] });
61
61
  }
62
62
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuIconButtonComponent, decorators: [{
63
63
  type: Component,
@@ -281,7 +281,7 @@ export class NeuImageViewerComponent {
281
281
  variant="text"
282
282
  [disabled]="!current() || failed() || zoom() >= 4"
283
283
  (pressed)="adjustZoom(1)" /></view></view></safe-area-view></safe-area-provider></neu-theme
284
- ></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", ".viewer { min-width: 0; min-height: 0; overflow: hidden; }\n.viewer-header { padding: 8px 12px; flex-shrink: 0; }\n.viewer-viewport { flex: 1; min-height: 0; min-width: 0; overflow: hidden; position: relative; }\n.viewer-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--neu-surface, #ffffff); }\n.viewer-controls { padding: 8px; gap: 8px; justify-content: center; flex-shrink: 0; flex-wrap: wrap; }\n.viewer-navigation, .viewer-zoom { gap: 2px; flex-shrink: 0; }\n.zoom-level { min-width: 44px; text-align: center; }\n\n.viewer { padding: 0; gap: 0; }\n.viewer-header .title { font-size: var(--neu-heading-size, 18px); line-height: var(--neu-heading-line, 24px); }\n.viewer-controls .label { font-size: var(--neu-caption-size, 13px); line-height: var(--neu-caption-line, 18px); }\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: "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: Image, selector: "image", inputs: ["source", "src", "srcSet", "defaultSource", "loadingIndicatorSource", "resizeMode", "resizeMethod", "resizeMultiplier", "blurRadius", "capInsets", "tintColor", "fadeDuration", "progressiveRenderingEnabled", "alt", "crossOrigin", "referrerPolicy"] }, { kind: "component", type: NeuIconButtonComponent, selector: "neu-icon-button", inputs: ["haptic", "label", "svg", "variant", "tone", "disabled", "loading"], outputs: ["pressed"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "component", type: NeuThemeComponent, selector: "neu-theme", inputs: ["scheme", "tokens"] }] });
284
+ ></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", ".viewer { min-width: 0; min-height: 0; overflow: hidden; }\n.viewer-header { padding: 8px 12px; flex-shrink: 0; }\n.viewer-viewport { flex: 1; min-height: 0; min-width: 0; overflow: hidden; position: relative; }\n.viewer-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--neu-surface, #ffffff); }\n.viewer-controls { padding: 8px; gap: 8px; justify-content: center; flex-shrink: 0; flex-wrap: wrap; }\n.viewer-navigation, .viewer-zoom { gap: 2px; flex-shrink: 0; }\n.zoom-level { min-width: 44px; text-align: center; }\n\n.viewer { padding: 0; gap: 0; }\n.viewer-header .title { font-size: var(--neu-heading-size, 18px); line-height: var(--neu-heading-line, 24px); }\n.viewer-controls .label { font-size: var(--neu-caption-size, 13px); line-height: var(--neu-caption-line, 18px); }\n"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated", "anchor"] }, { kind: "component", type: SafeAreaProvider, selector: "safe-area-provider", inputs: ["reportInsets"] }, { kind: "directive", type: SafeAreaView, selector: "safe-area-view", inputs: ["edges", "mode"] }, { 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: Image, selector: "image", inputs: ["source", "src", "srcSet", "defaultSource", "loadingIndicatorSource", "resizeMode", "resizeMethod", "resizeMultiplier", "blurRadius", "capInsets", "tintColor", "fadeDuration", "progressiveRenderingEnabled", "alt", "crossOrigin", "referrerPolicy"] }, { kind: "component", type: NeuIconButtonComponent, selector: "neu-icon-button", inputs: ["haptic", "label", "svg", "variant", "tone", "disabled", "loading"], outputs: ["pressed"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "component", type: NeuThemeComponent, selector: "neu-theme", inputs: ["scheme", "tokens"] }] });
285
285
  }
286
286
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuImageViewerComponent, decorators: [{
287
287
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../../src/image-viewer/image-viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,YAAY,GAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAgB,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;AACtE,MAAM,aAAa,GAAG,4JAA4J,CAAC;AACnL,MAAM,SAAS,GAAG,8KAA8K,CAAC;AACjM,MAAM,aAAa,GAAG,uKAAuK,CAAC;AAW9L,SAAS,aAAa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iBAAiB;qBAClB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgFE","sourcesContent":["import {\n Component,\n input,\n model,\n output,\n computed,\n signal,\n effect,\n inject,\n DestroyRef,\n} from '@angular/core';\nimport {\n View,\n Text,\n Image,\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n type TouchEvent,\n} from '@ng-native/components';\nimport { Animated, AnimatedStyle, Easing } from '@ng-native/components/animations';\nimport { Accessibility, StatusBar } from '@ng-native/device';\nimport { NeuThemeComponent } from '../theme/theme.js';\nimport { NEU_THEME, NEU_LIGHT_TOKENS } from '../foundation/index.js';\nimport { neuCrossfade, neuMotionDuration, neuPresence } from '../foundation/motion.js';\nimport { NeuImageItem, clamp } from '../foundation/mobile.js';\nimport { NeuIconButtonComponent } from '../icon-button/icon-button.js';\nimport { NEU_CLOSE, NEU_CHEVRON_RIGHT } from '../foundation/icons.js';\nconst PREVIOUS_ICON = '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m15 6-6 6 6 6\"/></svg>';\nconst ZOOM_ICON = '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><circle cx=\"10\" cy=\"10\" r=\"6\"/><path d=\"m15 15 6 6M7 10h6M10 7v6\"/></svg>';\nconst ZOOM_OUT_ICON = '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><circle cx=\"10\" cy=\"10\" r=\"6\"/><path d=\"m15 15 6 6M7 10h6\"/></svg>';\n/** Consumer-owned labels for an embedded full-screen image viewer. */\nexport interface NeuImageViewerLabels {\n readonly label?: string;\n readonly closeLabel?: string;\n readonly previousLabel?: string;\n readonly nextLabel?: string;\n readonly zoomLabel?: string;\n readonly zoomOutLabel?: string;\n readonly errorLabel?: string;\n}\nfunction touchDistance(event: TouchEvent): number {\n const touches = event.nativeEvent.touches;\n if (!touches || touches.length < 2) return 0;\n const a = touches[0]!,\n b = touches[1]!;\n if (\n a.pageX === undefined ||\n a.pageY === undefined ||\n b.pageX === undefined ||\n b.pageY === undefined\n )\n return 0;\n return Math.hypot(a.pageX - b.pageX, a.pageY - b.pageY);\n}\n@Component({\n selector: 'neu-image-viewer',\n imports: [\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n View,\n Text,\n Image,\n NeuIconButtonComponent,\n AnimatedStyle,\n NeuThemeComponent,\n ],\n template: `\n <modal [supportedOrientations]=\"['portrait', 'landscape']\"\n [visible]=\"motion.visible()\"\n presentationStyle=\"fullScreen\"\n [backdropColor]=\"mediaTokens().canvas\"\n [statusBarTranslucent]=\"true\"\n [navigationBarTranslucent]=\"true\"\n animationType=\"none\"\n (requestClose)=\"close()\"\n (show)=\"opened.emit()\"\n (dismiss)=\"dismissed.emit()\"\n ><neu-theme [tokens]=\"mediaTokens()\"><safe-area-provider class=\"full sheet-background\" [reportInsets]=\"false\"\n ><safe-area-view\n class=\"full surface page-sheet viewer\"\n [animatedStyle]=\"viewerStyle\" [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n [accessibilityViewIsModal]=\"open()\"\n ><view class=\"row viewer-header\"\n ><text class=\"title grow\" [numberOfLines]=\"2\">{{ current()?.label || label() }}</text\n ><neu-icon-button\n [label]=\"closeLabel()\"\n [svg]=\"closeIcon\"\n variant=\"text\"\n (pressed)=\"close()\" /></view\n ><view\n class=\"viewer-viewport\"\n [animatedStyle]=\"imageEntryStyle\"\n (touchStart)=\"start($event)\"\n (touchMove)=\"pinch($event)\"\n (touchEnd)=\"end($event)\"\n (touchCancel)=\"cancelTouch()\"\n >\n @if (failed()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{\n errorLabel()\n }}</text>\n } @else if (current(); as item) {\n @if (images.outgoing(); as previous) {\n <image class=\"viewer-image\" [animatedStyle]=\"outgoingImageStyle\"\n [source]=\"{ uri: previous.uri }\" resizeMode=\"contain\"\n [accessible]=\"false\" pointerEvents=\"none\"\n [accessibilityElementsHidden]=\"true\" importantForAccessibility=\"no-hide-descendants\" />\n }\n @for (photo of [item]; track photo.uri) {\n <image\n class=\"viewer-image\"\n [animatedStyle]=\"imageStyle\"\n accessibilityRole=\"image\"\n [source]=\"{ uri: photo.uri }\"\n resizeMode=\"contain\"\n [alt]=\"photo.label\"\n (load)=\"imageLoaded(photo)\"\n (error)=\"imageFailed(photo)\"\n />\n }\n }\n </view\n ><view class=\"row viewer-controls\"\n ><view class=\"row viewer-navigation\"><neu-icon-button\n [label]=\"previousLabel()\"\n [svg]=\"previousIcon\"\n variant=\"text\"\n [disabled]=\"position() <= 0\"\n (pressed)=\"move(-1)\" /><text class=\"label\">{{ items().length ? position() + 1 : 0 }} / {{ items().length }}</text><neu-icon-button\n [label]=\"nextLabel()\"\n [svg]=\"nextIcon\"\n variant=\"text\"\n [disabled]=\"position() >= items().length - 1\"\n (pressed)=\"move(1)\" /></view><view class=\"row viewer-zoom\"><neu-icon-button\n [label]=\"zoomOutLabel()\"\n [svg]=\"zoomOutIcon\"\n variant=\"text\"\n [disabled]=\"!current() || failed() || zoom() <= 1\"\n (pressed)=\"adjustZoom(-1)\" /><text class=\"label zoom-level\">{{ zoomPercent() }}%</text><neu-icon-button\n [label]=\"zoomLabel()\"\n [svg]=\"zoomIcon\"\n variant=\"text\"\n [disabled]=\"!current() || failed() || zoom() >= 4\"\n (pressed)=\"adjustZoom(1)\" /></view></view></safe-area-view></safe-area-provider></neu-theme\n ></modal>`,\n styleUrls: ['../foundation/mobile.css', './image-viewer.css'],\n})\nexport class NeuImageViewerComponent {\n protected readonly closeIcon = NEU_CLOSE;\n protected readonly previousIcon = PREVIOUS_ICON;\n protected readonly nextIcon = NEU_CHEVRON_RIGHT;\n protected readonly zoomIcon = ZOOM_ICON;\n protected readonly zoomOutIcon = ZOOM_OUT_ICON;\n readonly open = model(false);\n protected readonly motion = neuPresence(this.open);\n protected readonly viewerStyle = { opacity: this.motion.progress };\n private readonly loadedUris = signal<ReadonlySet<string>>(new Set());\n private readonly entryReady = computed(() => this.failed() || this.loadedUris().has(this.current()?.uri ?? ''));\n private readonly imageEntry = neuPresence(computed(() => this.open() && this.entryReady()));\n protected readonly imageEntryStyle = {\n opacity: this.imageEntry.progress,\n transform: [{ scale: this.imageEntry.progress.interpolate({ inputRange: [0, 1], outputRange: [0.92, 1] }) }],\n };\n private readonly accessibility = inject(Accessibility);\n private readonly theme = inject(NEU_THEME, { optional: true });\n private readonly statusBar = inject(StatusBar);\n protected readonly mediaTokens = computed(() => {\n const tokens = this.theme?.() ?? NEU_LIGHT_TOKENS;\n const canvas = tokens.mediaCanvas ?? '#111722';\n const ink = tokens.mediaText ?? '#edf1fa';\n return { ...tokens, surface: canvas, canvas, text: ink, muted: ink, accent: ink, onAccent: canvas };\n });\n private readonly destroy = inject(DestroyRef);\n private readonly zoomValue = new Animated.Value(1);\n private readonly pinching = signal(false);\n readonly items = input<readonly NeuImageItem[]>([]);\n readonly index = model(0);\n readonly label = input('Image viewer');\n readonly closeLabel = input('Close viewer');\n readonly previousLabel = input('Previous image');\n readonly nextLabel = input('Next image');\n readonly zoomLabel = input('Zoom in');\n readonly zoomOutLabel = input('Zoom out');\n readonly errorLabel = input('Image could not be loaded');\n readonly closed = output<void>();\n /** Native presentation has finished; separate from the requested open state. */\n readonly opened = output<void>();\n /** iOS native dismissal has finished. Android does not emit this native event. */\n readonly dismissed = output<void>();\n protected readonly zoom = signal(1);\n protected readonly zoomPercent = computed(() => Math.round(this.zoom() * 100));\n protected readonly failed = signal(false);\n protected readonly position = computed(() =>\n Math.floor(clamp(this.index(), 0, Math.max(0, this.items().length - 1))),\n );\n protected readonly current = computed<NeuImageItem | undefined>(\n () => this.items()[this.position()],\n );\n protected readonly images = neuCrossfade(this.current, this.open, (a, b) => a.id === b.id && a.uri === b.uri, true);\n protected readonly imageStyle = { ...this.images.incomingStyle, transform: [{ scale: this.zoomValue }] };\n protected readonly outgoingImageStyle = { ...this.images.settledStyle, transform: [{ scale: this.zoomValue }] };\n private readonly currentUri = computed(() => this.current()?.uri);\n private startX: number | undefined;\n private distance = 0;\n private baseZoom = 1;\n constructor() {\n effect(onCleanup => {\n if (!this.motion.visible()) return;\n const release = this.statusBar.push({ style: this.mediaTokens().mediaBarStyle ?? 'light' });\n onCleanup(release);\n });\n effect(() => {\n this.index();\n const opening = this.open();\n this.currentUri();\n if (opening) {\n this.zoom.set(1);\n this.zoomValue.setValue(1);\n }\n this.pinching.set(false);\n this.failed.set(false);\n this.startX = undefined;\n this.distance = 0;\n this.baseZoom = 1;\n });\n effect(onCleanup => {\n const target = this.zoom();\n const duration = Math.min(1000, neuMotionDuration(this.theme?.().duration ?? NEU_LIGHT_TOKENS.duration, true) * 4 / 3);\n if (!this.open() || this.pinching() || this.accessibility.reduceMotion() || duration === 0) {\n this.zoomValue.setValue(target);\n return;\n }\n const animation = Animated.timing(this.zoomValue, {\n toValue: target, duration, easing: Easing.out(Easing.cubic), useNativeDriver: true, isInteraction: false,\n });\n animation.start();\n onCleanup(() => animation.stop());\n });\n this.destroy.onDestroy(() => this.zoomValue.stopAnimation());\n }\n protected imageLoaded(item: NeuImageItem): void {\n this.images.loaded(item);\n this.loadedUris.update(uris => new Set([...uris, item.uri]));\n }\n protected imageFailed(item: NeuImageItem): void {\n if (this.current()?.uri !== item.uri) return;\n this.failed.set(true);\n this.images.loaded(item);\n }\n close(): void {\n if (this.open()) {\n this.open.set(false);\n this.closed.emit();\n }\n }\n protected move(delta: number): void {\n if (!this.items().length) return;\n this.index.set(clamp(this.position() + delta, 0, this.items().length - 1));\n }\n protected adjustZoom(delta: number): void {\n if (!this.current() || this.failed()) return;\n this.pinching.set(false);\n this.zoom.update(value => clamp(value + delta, 1, 4));\n this.startX = undefined;\n this.distance = 0;\n }\n protected start(event: TouchEvent): void {\n this.startX = event.nativeEvent.pageX;\n this.distance = touchDistance(event);\n this.baseZoom = this.zoom();\n if (this.distance > 0) {\n this.pinching.set(true);\n this.zoomValue.stopAnimation(value => {\n if (this.destroy.destroyed || !this.pinching()) return;\n this.baseZoom = clamp(value, 1, 4);\n this.zoom.set(this.baseZoom);\n });\n }\n }\n protected pinch(event: TouchEvent): void {\n const distance = touchDistance(event);\n if (distance > 0 && this.distance > 0) {\n const value = clamp((this.baseZoom * distance) / this.distance, 1, 4);\n this.zoomValue.setValue(value);\n this.zoom.set(value);\n }\n }\n protected end(event: TouchEvent): void {\n const x = event.nativeEvent.pageX;\n if (\n this.distance === 0 &&\n this.zoom() === 1 &&\n x !== undefined &&\n this.startX !== undefined &&\n Math.abs(x - this.startX) > 40\n )\n this.move(x < this.startX ? 1 : -1);\n this.cancelTouch();\n }\n protected cancelTouch(): void {\n this.pinching.set(false);\n this.startX = undefined;\n this.distance = 0;\n }\n}\n"]}
1
+ {"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../../src/image-viewer/image-viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,YAAY,GAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgFE,g+JA1FV,KAAK,kRACL,gBAAgB,yFAChB,YAAY,sFACZ,IAAI,iDACJ,IAAI,mYACJ,KAAK,mTACL,sBAAsB,gKACtB,aAAa,4DACb,iBAAiB;;2FAqFR,uBAAuB;kBAhGnC,SAAS;+BACE,kBAAkB,WACnB;wBACP,KAAK;wBACL,gBAAgB;wBAChB,YAAY;wBACZ,IAAI;wBACJ,IAAI;wBACJ,KAAK;wBACL,sBAAsB;wBACtB,aAAa;wBACb,iBAAiB;qBAClB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgFE","sourcesContent":["import {\n Component,\n input,\n model,\n output,\n computed,\n signal,\n effect,\n inject,\n DestroyRef,\n} from '@angular/core';\nimport {\n View,\n Text,\n Image,\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n type TouchEvent,\n} from '@ng-native/components';\nimport { Animated, AnimatedStyle, Easing } from '@ng-native/components/animations';\nimport { Accessibility, StatusBar } from '@ng-native/device';\nimport { NeuThemeComponent } from '../theme/theme.js';\nimport { NEU_THEME, NEU_LIGHT_TOKENS } from '../foundation/index.js';\nimport { neuCrossfade, neuMotionDuration, neuPresence } from '../foundation/motion.js';\nimport { NeuImageItem, clamp } from '../foundation/mobile.js';\nimport { NeuIconButtonComponent } from '../icon-button/icon-button.js';\nimport { NEU_CLOSE, NEU_CHEVRON_RIGHT } from '../foundation/icons.js';\nconst PREVIOUS_ICON = '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m15 6-6 6 6 6\"/></svg>';\nconst ZOOM_ICON = '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><circle cx=\"10\" cy=\"10\" r=\"6\"/><path d=\"m15 15 6 6M7 10h6M10 7v6\"/></svg>';\nconst ZOOM_OUT_ICON = '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><circle cx=\"10\" cy=\"10\" r=\"6\"/><path d=\"m15 15 6 6M7 10h6\"/></svg>';\n/** Consumer-owned labels for an embedded full-screen image viewer. */\nexport interface NeuImageViewerLabels {\n readonly label?: string;\n readonly closeLabel?: string;\n readonly previousLabel?: string;\n readonly nextLabel?: string;\n readonly zoomLabel?: string;\n readonly zoomOutLabel?: string;\n readonly errorLabel?: string;\n}\nfunction touchDistance(event: TouchEvent): number {\n const touches = event.nativeEvent.touches;\n if (!touches || touches.length < 2) return 0;\n const a = touches[0]!,\n b = touches[1]!;\n if (\n a.pageX === undefined ||\n a.pageY === undefined ||\n b.pageX === undefined ||\n b.pageY === undefined\n )\n return 0;\n return Math.hypot(a.pageX - b.pageX, a.pageY - b.pageY);\n}\n@Component({\n selector: 'neu-image-viewer',\n imports: [\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n View,\n Text,\n Image,\n NeuIconButtonComponent,\n AnimatedStyle,\n NeuThemeComponent,\n ],\n template: `\n <modal [supportedOrientations]=\"['portrait', 'landscape']\"\n [visible]=\"motion.visible()\"\n presentationStyle=\"fullScreen\"\n [backdropColor]=\"mediaTokens().canvas\"\n [statusBarTranslucent]=\"true\"\n [navigationBarTranslucent]=\"true\"\n animationType=\"none\"\n (requestClose)=\"close()\"\n (show)=\"opened.emit()\"\n (dismiss)=\"dismissed.emit()\"\n ><neu-theme [tokens]=\"mediaTokens()\"><safe-area-provider class=\"full sheet-background\" [reportInsets]=\"false\"\n ><safe-area-view\n class=\"full surface page-sheet viewer\"\n [animatedStyle]=\"viewerStyle\" [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n [accessibilityViewIsModal]=\"open()\"\n ><view class=\"row viewer-header\"\n ><text class=\"title grow\" [numberOfLines]=\"2\">{{ current()?.label || label() }}</text\n ><neu-icon-button\n [label]=\"closeLabel()\"\n [svg]=\"closeIcon\"\n variant=\"text\"\n (pressed)=\"close()\" /></view\n ><view\n class=\"viewer-viewport\"\n [animatedStyle]=\"imageEntryStyle\"\n (touchStart)=\"start($event)\"\n (touchMove)=\"pinch($event)\"\n (touchEnd)=\"end($event)\"\n (touchCancel)=\"cancelTouch()\"\n >\n @if (failed()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{\n errorLabel()\n }}</text>\n } @else if (current(); as item) {\n @if (images.outgoing(); as previous) {\n <image class=\"viewer-image\" [animatedStyle]=\"outgoingImageStyle\"\n [source]=\"{ uri: previous.uri }\" resizeMode=\"contain\"\n [accessible]=\"false\" pointerEvents=\"none\"\n [accessibilityElementsHidden]=\"true\" importantForAccessibility=\"no-hide-descendants\" />\n }\n @for (photo of [item]; track photo.uri) {\n <image\n class=\"viewer-image\"\n [animatedStyle]=\"imageStyle\"\n accessibilityRole=\"image\"\n [source]=\"{ uri: photo.uri }\"\n resizeMode=\"contain\"\n [alt]=\"photo.label\"\n (load)=\"imageLoaded(photo)\"\n (error)=\"imageFailed(photo)\"\n />\n }\n }\n </view\n ><view class=\"row viewer-controls\"\n ><view class=\"row viewer-navigation\"><neu-icon-button\n [label]=\"previousLabel()\"\n [svg]=\"previousIcon\"\n variant=\"text\"\n [disabled]=\"position() <= 0\"\n (pressed)=\"move(-1)\" /><text class=\"label\">{{ items().length ? position() + 1 : 0 }} / {{ items().length }}</text><neu-icon-button\n [label]=\"nextLabel()\"\n [svg]=\"nextIcon\"\n variant=\"text\"\n [disabled]=\"position() >= items().length - 1\"\n (pressed)=\"move(1)\" /></view><view class=\"row viewer-zoom\"><neu-icon-button\n [label]=\"zoomOutLabel()\"\n [svg]=\"zoomOutIcon\"\n variant=\"text\"\n [disabled]=\"!current() || failed() || zoom() <= 1\"\n (pressed)=\"adjustZoom(-1)\" /><text class=\"label zoom-level\">{{ zoomPercent() }}%</text><neu-icon-button\n [label]=\"zoomLabel()\"\n [svg]=\"zoomIcon\"\n variant=\"text\"\n [disabled]=\"!current() || failed() || zoom() >= 4\"\n (pressed)=\"adjustZoom(1)\" /></view></view></safe-area-view></safe-area-provider></neu-theme\n ></modal>`,\n styleUrls: ['../foundation/mobile.css', './image-viewer.css'],\n})\nexport class NeuImageViewerComponent {\n protected readonly closeIcon = NEU_CLOSE;\n protected readonly previousIcon = PREVIOUS_ICON;\n protected readonly nextIcon = NEU_CHEVRON_RIGHT;\n protected readonly zoomIcon = ZOOM_ICON;\n protected readonly zoomOutIcon = ZOOM_OUT_ICON;\n readonly open = model(false);\n protected readonly motion = neuPresence(this.open);\n protected readonly viewerStyle = { opacity: this.motion.progress };\n private readonly loadedUris = signal<ReadonlySet<string>>(new Set());\n private readonly entryReady = computed(() => this.failed() || this.loadedUris().has(this.current()?.uri ?? ''));\n private readonly imageEntry = neuPresence(computed(() => this.open() && this.entryReady()));\n protected readonly imageEntryStyle = {\n opacity: this.imageEntry.progress,\n transform: [{ scale: this.imageEntry.progress.interpolate({ inputRange: [0, 1], outputRange: [0.92, 1] }) }],\n };\n private readonly accessibility = inject(Accessibility);\n private readonly theme = inject(NEU_THEME, { optional: true });\n private readonly statusBar = inject(StatusBar);\n protected readonly mediaTokens = computed(() => {\n const tokens = this.theme?.() ?? NEU_LIGHT_TOKENS;\n const canvas = tokens.mediaCanvas ?? '#111722';\n const ink = tokens.mediaText ?? '#edf1fa';\n return { ...tokens, surface: canvas, canvas, text: ink, muted: ink, accent: ink, onAccent: canvas };\n });\n private readonly destroy = inject(DestroyRef);\n private readonly zoomValue = new Animated.Value(1);\n private readonly pinching = signal(false);\n readonly items = input<readonly NeuImageItem[]>([]);\n readonly index = model(0);\n readonly label = input('Image viewer');\n readonly closeLabel = input('Close viewer');\n readonly previousLabel = input('Previous image');\n readonly nextLabel = input('Next image');\n readonly zoomLabel = input('Zoom in');\n readonly zoomOutLabel = input('Zoom out');\n readonly errorLabel = input('Image could not be loaded');\n readonly closed = output<void>();\n /** Native presentation has finished; separate from the requested open state. */\n readonly opened = output<void>();\n /** iOS native dismissal has finished. Android does not emit this native event. */\n readonly dismissed = output<void>();\n protected readonly zoom = signal(1);\n protected readonly zoomPercent = computed(() => Math.round(this.zoom() * 100));\n protected readonly failed = signal(false);\n protected readonly position = computed(() =>\n Math.floor(clamp(this.index(), 0, Math.max(0, this.items().length - 1))),\n );\n protected readonly current = computed<NeuImageItem | undefined>(\n () => this.items()[this.position()],\n );\n protected readonly images = neuCrossfade(this.current, this.open, (a, b) => a.id === b.id && a.uri === b.uri, true);\n protected readonly imageStyle = { ...this.images.incomingStyle, transform: [{ scale: this.zoomValue }] };\n protected readonly outgoingImageStyle = { ...this.images.settledStyle, transform: [{ scale: this.zoomValue }] };\n private readonly currentUri = computed(() => this.current()?.uri);\n private startX: number | undefined;\n private distance = 0;\n private baseZoom = 1;\n constructor() {\n effect(onCleanup => {\n if (!this.motion.visible()) return;\n const release = this.statusBar.push({ style: this.mediaTokens().mediaBarStyle ?? 'light' });\n onCleanup(release);\n });\n effect(() => {\n this.index();\n const opening = this.open();\n this.currentUri();\n if (opening) {\n this.zoom.set(1);\n this.zoomValue.setValue(1);\n }\n this.pinching.set(false);\n this.failed.set(false);\n this.startX = undefined;\n this.distance = 0;\n this.baseZoom = 1;\n });\n effect(onCleanup => {\n const target = this.zoom();\n const duration = Math.min(1000, neuMotionDuration(this.theme?.().duration ?? NEU_LIGHT_TOKENS.duration, true) * 4 / 3);\n if (!this.open() || this.pinching() || this.accessibility.reduceMotion() || duration === 0) {\n this.zoomValue.setValue(target);\n return;\n }\n const animation = Animated.timing(this.zoomValue, {\n toValue: target, duration, easing: Easing.out(Easing.cubic), useNativeDriver: true, isInteraction: false,\n });\n animation.start();\n onCleanup(() => animation.stop());\n });\n this.destroy.onDestroy(() => this.zoomValue.stopAnimation());\n }\n protected imageLoaded(item: NeuImageItem): void {\n this.images.loaded(item);\n this.loadedUris.update(uris => new Set([...uris, item.uri]));\n }\n protected imageFailed(item: NeuImageItem): void {\n if (this.current()?.uri !== item.uri) return;\n this.failed.set(true);\n this.images.loaded(item);\n }\n close(): void {\n if (this.open()) {\n this.open.set(false);\n this.closed.emit();\n }\n }\n protected move(delta: number): void {\n if (!this.items().length) return;\n this.index.set(clamp(this.position() + delta, 0, this.items().length - 1));\n }\n protected adjustZoom(delta: number): void {\n if (!this.current() || this.failed()) return;\n this.pinching.set(false);\n this.zoom.update(value => clamp(value + delta, 1, 4));\n this.startX = undefined;\n this.distance = 0;\n }\n protected start(event: TouchEvent): void {\n this.startX = event.nativeEvent.pageX;\n this.distance = touchDistance(event);\n this.baseZoom = this.zoom();\n if (this.distance > 0) {\n this.pinching.set(true);\n this.zoomValue.stopAnimation(value => {\n if (this.destroy.destroyed || !this.pinching()) return;\n this.baseZoom = clamp(value, 1, 4);\n this.zoom.set(this.baseZoom);\n });\n }\n }\n protected pinch(event: TouchEvent): void {\n const distance = touchDistance(event);\n if (distance > 0 && this.distance > 0) {\n const value = clamp((this.baseZoom * distance) / this.distance, 1, 4);\n this.zoomValue.setValue(value);\n this.zoom.set(value);\n }\n }\n protected end(event: TouchEvent): void {\n const x = event.nativeEvent.pageX;\n if (\n this.distance === 0 &&\n this.zoom() === 1 &&\n x !== undefined &&\n this.startX !== undefined &&\n Math.abs(x - this.startX) > 40\n )\n this.move(x < this.startX ? 1 : -1);\n this.cancelTouch();\n }\n protected cancelTouch(): void {\n this.pinching.set(false);\n this.startX = undefined;\n this.distance = 0;\n }\n}\n"]}
@@ -100,7 +100,7 @@ export class NeuModalComponent {
100
100
  }
101
101
  }
102
102
  </view></keyboard-avoiding-view></safe-area-view></safe-area-provider
103
- ></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", ".modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }"], 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", inputs: ["haptic"], 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]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
103
+ ></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", ".modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated", "anchor"] }, { 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", inputs: ["haptic"], 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]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
104
104
  }
105
105
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuModalComponent, decorators: [{
106
106
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,KAAK,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiDE,44IA5DV,KAAK,wQACL,gBAAgB,yFAChB,YAAY,sFACZ,oBAAoB,gLACpB,IAAI,iDACJ,IAAI,mYACJ,SAAS,mGACT,UAAU,0TACV,aAAa,4DACb,gBAAgB;;2FAuDP,iBAAiB;kBAnE7B,SAAS;+BACE,WAAW,WACZ;wBACP,KAAK;wBACL,gBAAgB;wBAChB,YAAY;wBACZ,oBAAoB;wBACpB,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,UAAU;wBACV,aAAa;wBACb,gBAAgB;qBACjB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiDE;8NAwB6B,uBAAuB,wFACvB,uBAAuB","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n inject,\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} from '@ng-native/components';\nimport { Accessibility, Screen } from '@ng-native/device';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from '../foundation/motion.js';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NeuModalHeaderDirective, NeuModalFooterDirective } from './modal-templates.js';\n\n@Component({\n selector: 'neu-modal',\n imports: [\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n KeyboardAvoidingView,\n View,\n Text,\n Pressable,\n ScrollView,\n AnimatedStyle,\n NgTemplateOutlet,\n ],\n template: `\n <modal [supportedOrientations]=\"['portrait', 'landscape']\"\n [visible]=\"motion.visible()\"\n [transparent]=\"true\"\n animationType=\"none\"\n (requestClose)=\"close('native')\"\n (show)=\"opened.emit()\"\n (dismiss)=\"dismissed.emit()\"\n ><safe-area-provider class=\"full\" [reportInsets]=\"false\"\n ><safe-area-view class=\"backdrop\" [animatedStyle]=\"backdropStyle\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n ><keyboard-avoiding-view behavior=\"padding\" class=\"modal-layout\"\n ><view class=\"sheet\" [animatedStyle]=\"panelStyle\" [accessibilityViewIsModal]=\"open()\"\n ><view class=\"row\"\n ><view class=\"grow modal-heading\">\n @if (header(); as customHeader) {\n <ng-container [ngTemplateOutlet]=\"customHeader.templateRef\" />\n } @else {\n <text class=\"title\" accessibilityRole=\"header\">{{ title() }}</text>\n }\n </view>\n @if (dismissible() && showCloseButton()) {\n <pressable\n class=\"action modal-close\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\"\n (press)=\"close('action')\"\n ><text class=\"label\">×</text></pressable\n >\n }</view\n ><scroll-view\n class=\"modal-scroll\"\n keyboardShouldPersistTaps=\"handled\"\n ><view class=\"stack modal-scroll-content\">\n <view class=\"stack scroll-content\"><ng-content /></view>\n @if (footerScrolls()) {\n @if (footer(); as customFooter) {\n <view class=\"modal-footer\"><ng-container [ngTemplateOutlet]=\"customFooter.templateRef\" /></view>\n }\n }\n </view></scroll-view>\n @if (!footerScrolls()) {\n @if (footer(); as customFooter) {\n <view class=\"modal-footer\"><ng-container [ngTemplateOutlet]=\"customFooter.templateRef\" /></view>\n }\n }\n </view></keyboard-avoiding-view></safe-area-view></safe-area-provider\n ></modal>`,\n styleUrl: '../foundation/mobile.css',\n styles: '.modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }',\n})\nexport class NeuModalComponent {\n private readonly screen = inject(Screen);\n private readonly accessibility = inject(Accessibility);\n // Keep actions fixed when there is room. Short windows and enlarged text need\n // one scrollable body so the footer cannot squeeze a focused field to zero.\n protected readonly footerScrolls = computed(() => {\n const height = this.screen.window().height;\n return height > 0 && height < 720 * Math.max(1, this.accessibility.fontScale());\n });\n readonly open = model(false);\n // Prefilled fields can relayout while the native presentation is mounting.\n // JS frames keep the transition attached across those layout commits.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly backdropStyle = { opacity: this.motion.progress };\n protected readonly panelStyle = {\n transform: [\n { translateY: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [8, 0] }) },\n { scale: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [0.985, 1] }) },\n ],\n };\n protected readonly header = contentChild(NeuModalHeaderDirective);\n protected readonly footer = contentChild(NeuModalFooterDirective);\n readonly title = input.required<string>();\n readonly dismissible = input(true, { transform: booleanAttribute });\n readonly showCloseButton = input(true, { transform: booleanAttribute });\n readonly closeLabel = input('Close');\n readonly closed = output<'native' | 'action' | 'backdrop'>();\n /** Native presentation has finished; separate from the requested open state. */\n readonly opened = output<void>();\n /** iOS native dismissal has finished. Android does not emit this native event. */\n readonly dismissed = output<void>();\n close(reason: 'native' | 'action' | 'backdrop' = 'action'): void {\n if (this.dismissible() && this.open()) {\n this.open.set(false);\n this.closed.emit(reason);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW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ACb,gBAAgB;qBACjB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiDE;8NAwB6B,uBAAuB,wFACvB,uBAAuB","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n inject,\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} from '@ng-native/components';\nimport { Accessibility, Screen } from '@ng-native/device';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from '../foundation/motion.js';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NeuModalHeaderDirective, NeuModalFooterDirective } from './modal-templates.js';\n\n@Component({\n selector: 'neu-modal',\n imports: [\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n KeyboardAvoidingView,\n View,\n Text,\n Pressable,\n ScrollView,\n AnimatedStyle,\n NgTemplateOutlet,\n ],\n template: `\n <modal [supportedOrientations]=\"['portrait', 'landscape']\"\n [visible]=\"motion.visible()\"\n [transparent]=\"true\"\n animationType=\"none\"\n (requestClose)=\"close('native')\"\n (show)=\"opened.emit()\"\n (dismiss)=\"dismissed.emit()\"\n ><safe-area-provider class=\"full\" [reportInsets]=\"false\"\n ><safe-area-view class=\"backdrop\" [animatedStyle]=\"backdropStyle\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n ><keyboard-avoiding-view behavior=\"padding\" class=\"modal-layout\"\n ><view class=\"sheet\" [animatedStyle]=\"panelStyle\" [accessibilityViewIsModal]=\"open()\"\n ><view class=\"row\"\n ><view class=\"grow modal-heading\">\n @if (header(); as customHeader) {\n <ng-container [ngTemplateOutlet]=\"customHeader.templateRef\" />\n } @else {\n <text class=\"title\" accessibilityRole=\"header\">{{ title() }}</text>\n }\n </view>\n @if (dismissible() && showCloseButton()) {\n <pressable\n class=\"action modal-close\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\"\n (press)=\"close('action')\"\n ><text class=\"label\">×</text></pressable\n >\n }</view\n ><scroll-view\n class=\"modal-scroll\"\n keyboardShouldPersistTaps=\"handled\"\n ><view class=\"stack modal-scroll-content\">\n <view class=\"stack scroll-content\"><ng-content /></view>\n @if (footerScrolls()) {\n @if (footer(); as customFooter) {\n <view class=\"modal-footer\"><ng-container [ngTemplateOutlet]=\"customFooter.templateRef\" /></view>\n }\n }\n </view></scroll-view>\n @if (!footerScrolls()) {\n @if (footer(); as customFooter) {\n <view class=\"modal-footer\"><ng-container [ngTemplateOutlet]=\"customFooter.templateRef\" /></view>\n }\n }\n </view></keyboard-avoiding-view></safe-area-view></safe-area-provider\n ></modal>`,\n styleUrl: '../foundation/mobile.css',\n styles: '.modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }',\n})\nexport class NeuModalComponent {\n private readonly screen = inject(Screen);\n private readonly accessibility = inject(Accessibility);\n // Keep actions fixed when there is room. Short windows and enlarged text need\n // one scrollable body so the footer cannot squeeze a focused field to zero.\n protected readonly footerScrolls = computed(() => {\n const height = this.screen.window().height;\n return height > 0 && height < 720 * Math.max(1, this.accessibility.fontScale());\n });\n readonly open = model(false);\n // Prefilled fields can relayout while the native presentation is mounting.\n // JS frames keep the transition attached across those layout commits.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly backdropStyle = { opacity: this.motion.progress };\n protected readonly panelStyle = {\n transform: [\n { translateY: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [8, 0] }) },\n { scale: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [0.985, 1] }) },\n ],\n };\n protected readonly header = contentChild(NeuModalHeaderDirective);\n protected readonly footer = contentChild(NeuModalFooterDirective);\n readonly title = input.required<string>();\n readonly dismissible = input(true, { transform: booleanAttribute });\n readonly showCloseButton = input(true, { transform: booleanAttribute });\n readonly closeLabel = input('Close');\n readonly closed = output<'native' | 'action' | 'backdrop'>();\n /** Native presentation has finished; separate from the requested open state. */\n readonly opened = output<void>();\n /** iOS native dismissal has finished. Android does not emit this native event. */\n readonly dismissed = output<void>();\n close(reason: 'native' | 'action' | 'backdrop' = 'action'): void {\n if (this.dismissible() && this.open()) {\n this.open.set(false);\n this.closed.emit(reason);\n }\n }\n}\n"]}
@@ -81,7 +81,7 @@ export class NeuSidebarComponent {
81
81
  </view>
82
82
  </view>
83
83
  </safe-area-provider>
84
- </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", ".drawer-root {\n flex-direction: row;\n}\n.drawer-backdrop {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: #000000;\n}\n.drawer-panel {\n width: 86%;\n max-width: 360px;\n background-color: var(--neu-surface, #ffffff);\n}\n.drawer-panel.drawer-full {\n width: 100%;\n max-width: 100%;\n}\n.drawer-header {\n padding: 16px;\n border-bottom-width: 1px;\n border-color: var(--neu-border, #c6cede);\n}\n.drawer-close {\n width: 48px;\n height: 48px;\n align-items: center;\n justify-content: center;\n}\n.drawer-items {\n padding: 8px;\n padding-right: 16px;\n gap: 4px;\n}\n.drawer-item {\n min-height: 52px;\n padding: 14px;\n gap: 6px;\n border-left-width: 3px;\n border-color: transparent;\n border-radius: 8px;\n}\n.drawer-selected {\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-tonal, #e9edfc);\n}\n.drawer-selected-label {\n color: var(--neu-accent-ink, #3155d9);\n font-weight: 600;\n}\n.drawer-footer {\n padding: 16px;\n}\n"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated"] }, { 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", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "component", type: SafeAreaProvider, selector: "safe-area-provider", inputs: ["reportInsets"] }, { kind: "directive", type: SafeAreaView, selector: "safe-area-view", inputs: ["edges", "mode"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }] });
84
+ </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", ".drawer-root {\n flex-direction: row;\n}\n.drawer-backdrop {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: #000000;\n}\n.drawer-panel {\n width: 86%;\n max-width: 360px;\n background-color: var(--neu-surface, #ffffff);\n}\n.drawer-panel.drawer-full {\n width: 100%;\n max-width: 100%;\n}\n.drawer-header {\n padding: 16px;\n border-bottom-width: 1px;\n border-color: var(--neu-border, #c6cede);\n}\n.drawer-close {\n width: 48px;\n height: 48px;\n align-items: center;\n justify-content: center;\n}\n.drawer-items {\n padding: 8px;\n padding-right: 16px;\n gap: 4px;\n}\n.drawer-item {\n min-height: 52px;\n padding: 14px;\n gap: 6px;\n border-left-width: 3px;\n border-color: transparent;\n border-radius: 8px;\n}\n.drawer-selected {\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-tonal, #e9edfc);\n}\n.drawer-selected-label {\n color: var(--neu-accent-ink, #3155d9);\n font-weight: 600;\n}\n.drawer-footer {\n padding: 16px;\n}\n"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated", "anchor"] }, { 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", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "component", type: SafeAreaProvider, selector: "safe-area-provider", inputs: ["reportInsets"] }, { kind: "directive", type: SafeAreaView, selector: "safe-area-view", inputs: ["edges", "mode"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }] });
85
85
  }
86
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuSidebarComponent, decorators: [{
87
87
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/sidebar/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,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sFAAE,aAAa;;2FAyCtF,mBAAmB;kBA3C/B,SAAS;+BACE,aAAa,WACd,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,CAAC,YACxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqCD","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { Modal, View, Text, ScrollView, SafeAreaProvider, SafeAreaView, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { NeuOption } from '../foundation/mobile.js';\nimport { neuPresence } from '../foundation/motion.js';\n\n@Component({\n selector: 'neu-sidebar',\n imports: [Modal, View, Text, Pressable, ScrollView, SafeAreaProvider, SafeAreaView, AnimatedStyle],\n template: `<modal [supportedOrientations]=\"['portrait', 'landscape']\" [visible]=\"motion.visible()\" [transparent]=\"true\" animationType=\"none\"\n presentationStyle=\"overFullScreen\" [statusBarTranslucent]=\"true\"\n (requestClose)=\"close()\" (show)=\"opened.emit()\" (dismiss)=\"dismissed.emit()\">\n <safe-area-provider class=\"full\" [reportInsets]=\"false\">\n <view class=\"full drawer-root\" [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\" [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <pressable class=\"drawer-backdrop\" [animatedStyle]=\"backdropStyle\" [accessible]=\"false\"\n [focusable]=\"false\" (press)=\"close()\" />\n <view class=\"drawer-panel\" [class.drawer-full]=\"fullWidth()\" (layout)=\"measure($event)\"\n [animatedStyle]=\"drawerStyle()\" [accessibilityViewIsModal]=\"open()\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\" [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <safe-area-view class=\"full\">\n <view class=\"drawer-header row\">\n <text class=\"title grow\" accessibilityRole=\"header\">{{ title() }}</text>\n <pressable class=\"drawer-close\" accessibilityRole=\"button\" [accessibilityLabel]=\"closeLabel()\" (press)=\"close()\">\n <text class=\"title\">×</text>\n </pressable>\n </view>\n <scroll-view class=\"grow\" keyboardShouldPersistTaps=\"handled\">\n <view class=\"drawer-items\" [accessibilityLabel]=\"title()\">\n @for (item of items(); track item.id) {\n <pressable class=\"drawer-item\" [class.drawer-selected]=\"value() === item.id\"\n accessibilityRole=\"radio\" [accessibilityLabel]=\"item.label\"\n [accessibilityState]=\"{ checked: value() === item.id, disabled: !open() || disabled() || !!item.disabled }\"\n [disabled]=\"!open() || disabled() || !!item.disabled\" [class.neu-unavailable]=\"disabled() || item.disabled\" (press)=\"choose(item.id)\">\n <text class=\"label\" [class.drawer-selected-label]=\"value() === item.id\">{{ item.label }}</text>\n @if (item.description) { <text class=\"muted\">{{ item.description }}</text> }\n </pressable>\n }\n </view>\n </scroll-view>\n <view class=\"drawer-footer\"><ng-content /></view>\n </safe-area-view>\n </view>\n </view>\n </safe-area-provider>\n </modal>`,\n styleUrls: ['../foundation/mobile.css', './sidebar.css'],\n})\nexport class NeuSidebarComponent {\n readonly open = model(false);\n readonly title = input.required<string>();\n readonly items = input<readonly NeuOption[]>([]);\n readonly value = model('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly fullWidth = input(false, { transform: booleanAttribute });\n readonly closeLabel = input('Close navigation');\n readonly navigate = output<string>();\n readonly opened = output<void>();\n readonly dismissed = output<void>();\n protected readonly motion = neuPresence(this.open);\n private readonly panelWidth = signal(0);\n protected readonly drawerStyle = computed(() => ({\n opacity: this.panelWidth() > 0 ? 1 : 0,\n transform: [{ translateX: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [-this.panelWidth(), 0] }) }],\n }));\n protected readonly backdropStyle = { opacity: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [0, 0.36] }) };\n protected measure(event: LayoutEvent): void {\n const width = event.nativeEvent.layout.width;\n if (Number.isFinite(width) && width > 0) this.panelWidth.set(width);\n }\n protected close(): void { this.open.set(false); }\n protected choose(id: string): void {\n if (\n !this.open() || this.disabled() ||\n !this.items().some((x) => x.id === id && !x.disabled)\n )\n return;\n this.value.set(id);\n this.open.set(false);\n this.navigate.emit(id);\n }\n}\n"]}
1
+ {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/sidebar/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAC;AACxH,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;;AA6CtD,MAAM,OAAO,mBAAmB;IACrB,IAAI,GAAG,KAAK,CAAC,KAAK;6EAAC,CAAC;IACpB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU,CAAC;IACjC,KAAK,GAAG,KAAK,CAAuB,EAAE;8EAAC,CAAC;IACxC,KAAK,GAAG,KAAK,CAAC,EAAE;8EAAC,CAAC;IAClB,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IAC1D,UAAU,GAAG,KAAK,CAAC,kBAAkB;mFAAC,CAAC;IACvC,QAAQ,GAAG,MAAM,EAAU,CAAC;IAC5B,MAAM,GAAG,MAAM,EAAQ,CAAC;IACxB,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,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;YAErD,OAAO;QACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;uGAhCU,mBAAmB;2FAAnB,mBAAmB,kjCAxCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqCD,6qKAtCC,KAAK,kRAAE,IAAI,iDAAE,IAAI,mYAAE,SAAS,mGAAE,UAAU,0TAAE,gBAAgB,yFAAE,YAAY,sFAAE,aAAa;;2FAyCtF,mBAAmB;kBA3C/B,SAAS;+BACE,aAAa,WACd,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,CAAC,YACxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqCD","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { Modal, View, Text, ScrollView, SafeAreaProvider, SafeAreaView, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { NeuOption } from '../foundation/mobile.js';\nimport { neuPresence } from '../foundation/motion.js';\n\n@Component({\n selector: 'neu-sidebar',\n imports: [Modal, View, Text, Pressable, ScrollView, SafeAreaProvider, SafeAreaView, AnimatedStyle],\n template: `<modal [supportedOrientations]=\"['portrait', 'landscape']\" [visible]=\"motion.visible()\" [transparent]=\"true\" animationType=\"none\"\n presentationStyle=\"overFullScreen\" [statusBarTranslucent]=\"true\"\n (requestClose)=\"close()\" (show)=\"opened.emit()\" (dismiss)=\"dismissed.emit()\">\n <safe-area-provider class=\"full\" [reportInsets]=\"false\">\n <view class=\"full drawer-root\" [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\" [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <pressable class=\"drawer-backdrop\" [animatedStyle]=\"backdropStyle\" [accessible]=\"false\"\n [focusable]=\"false\" (press)=\"close()\" />\n <view class=\"drawer-panel\" [class.drawer-full]=\"fullWidth()\" (layout)=\"measure($event)\"\n [animatedStyle]=\"drawerStyle()\" [accessibilityViewIsModal]=\"open()\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\" [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <safe-area-view class=\"full\">\n <view class=\"drawer-header row\">\n <text class=\"title grow\" accessibilityRole=\"header\">{{ title() }}</text>\n <pressable class=\"drawer-close\" accessibilityRole=\"button\" [accessibilityLabel]=\"closeLabel()\" (press)=\"close()\">\n <text class=\"title\">×</text>\n </pressable>\n </view>\n <scroll-view class=\"grow\" keyboardShouldPersistTaps=\"handled\">\n <view class=\"drawer-items\" [accessibilityLabel]=\"title()\">\n @for (item of items(); track item.id) {\n <pressable class=\"drawer-item\" [class.drawer-selected]=\"value() === item.id\"\n accessibilityRole=\"radio\" [accessibilityLabel]=\"item.label\"\n [accessibilityState]=\"{ checked: value() === item.id, disabled: !open() || disabled() || !!item.disabled }\"\n [disabled]=\"!open() || disabled() || !!item.disabled\" [class.neu-unavailable]=\"disabled() || item.disabled\" (press)=\"choose(item.id)\">\n <text class=\"label\" [class.drawer-selected-label]=\"value() === item.id\">{{ item.label }}</text>\n @if (item.description) { <text class=\"muted\">{{ item.description }}</text> }\n </pressable>\n }\n </view>\n </scroll-view>\n <view class=\"drawer-footer\"><ng-content /></view>\n </safe-area-view>\n </view>\n </view>\n </safe-area-provider>\n </modal>`,\n styleUrls: ['../foundation/mobile.css', './sidebar.css'],\n})\nexport class NeuSidebarComponent {\n readonly open = model(false);\n readonly title = input.required<string>();\n readonly items = input<readonly NeuOption[]>([]);\n readonly value = model('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly fullWidth = input(false, { transform: booleanAttribute });\n readonly closeLabel = input('Close navigation');\n readonly navigate = output<string>();\n readonly opened = output<void>();\n readonly dismissed = output<void>();\n protected readonly motion = neuPresence(this.open);\n private readonly panelWidth = signal(0);\n protected readonly drawerStyle = computed(() => ({\n opacity: this.panelWidth() > 0 ? 1 : 0,\n transform: [{ translateX: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [-this.panelWidth(), 0] }) }],\n }));\n protected readonly backdropStyle = { opacity: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [0, 0.36] }) };\n protected measure(event: LayoutEvent): void {\n const width = event.nativeEvent.layout.width;\n if (Number.isFinite(width) && width > 0) this.panelWidth.set(width);\n }\n protected close(): void { this.open.set(false); }\n protected choose(id: string): void {\n if (\n !this.open() || this.disabled() ||\n !this.items().some((x) => x.id === id && !x.disabled)\n )\n return;\n this.value.set(id);\n this.open.set(false);\n this.navigate.emit(id);\n }\n}\n"]}
@@ -32,7 +32,7 @@ export class NeuSpinnerComponent {
32
32
  @if (showLabel()) {
33
33
  <text class="label">{{ label() }}</text>
34
34
  }
35
- </view>`, isInline: true, styles: ["\n .row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n min-height: 32px;\n }\n .label {\n font-size: 14px;\n color: var(--neu-muted, #596477);\n }\n "], dependencies: [{ kind: "directive", type: ActivityIndicator, selector: "activity-indicator", inputs: ["size", "animating", "color", "hidesWhenStopped"] }, { 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: View, selector: "view" }] });
35
+ </view>`, isInline: true, styles: ["\n .row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n min-height: 32px;\n }\n .label {\n font-size: 14px;\n color: var(--neu-muted, #596477);\n }\n "], dependencies: [{ kind: "directive", type: ActivityIndicator, selector: "activity-indicator", inputs: ["size", "controlSize", "animating", "color", "hidesWhenStopped"] }, { 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: View, selector: "view" }] });
36
36
  }
37
37
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuSpinnerComponent, decorators: [{
38
38
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/spinner/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AAkCvD,MAAM,OAAO,mBAAmB;IACrB,KAAK,GAAG,KAAK,CAAC,SAAS;8EAAC,CAAC;IACzB,IAAI,GAAG,KAAK,CAAoB,OAAO;6EAAC,CAAC;IACzC,MAAM,GAAG,KAAK,CAAC,IAAI,8EAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACtD,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IAC1D,IAAI,GAAG,KAAK,CAAU,OAAO;6EAAC,CAAC;IACvB,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,KAAK,GAAG,QAAQ,CACjC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,gBAAgB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK;8EAC5E,CAAC;uGATS,mBAAmB;2FAAnB,mBAAmB,orBA9BpB;;;;;;;;;;;;;;;;UAgBF,0RAjBE,iBAAiB,2HAAE,IAAI,mYAAE,IAAI;;2FA+B5B,mBAAmB;kBAjC/B,SAAS;+BACE,aAAa,WACd,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,YAC9B;;;;;;;;;;;;;;;;UAgBF","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { ActivityIndicator, Text, View } from '@ng-native/components';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n@Component({\n selector: 'neu-spinner',\n imports: [ActivityIndicator, Text, View],\n template: `<view\n class=\"row\"\n accessibilityRole=\"progressbar\"\n [accessibilityLabel]=\"label()\"\n [accessibilityState]=\"{ busy: active() }\"\n ><activity-indicator\n [size]=\"size()\"\n [animating]=\"active()\"\n [color]=\"color()\"\n [accessible]=\"false\"\n [accessibilityElementsHidden]=\"true\"\n importantForAccessibility=\"no-hide-descendants\"\n />\n @if (showLabel()) {\n <text class=\"label\">{{ label() }}</text>\n }\n </view>`,\n styles: `\n .row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n min-height: 32px;\n }\n .label {\n font-size: 14px;\n color: var(--neu-muted, #596477);\n }\n `,\n})\nexport class NeuSpinnerComponent {\n readonly label = input('Loading');\n readonly size = input<'small' | 'large'>('small');\n readonly active = input(true, { transform: booleanAttribute });\n readonly showLabel = input(false, { transform: booleanAttribute });\n readonly tone = input<NeuTone>('brand');\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly color = computed(\n () => neuTonePalette(this.theme?.() ?? NEU_LIGHT_TOKENS, this.tone()).color,\n );\n}\n"]}
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/spinner/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AAkCvD,MAAM,OAAO,mBAAmB;IACrB,KAAK,GAAG,KAAK,CAAC,SAAS;8EAAC,CAAC;IACzB,IAAI,GAAG,KAAK,CAAoB,OAAO;6EAAC,CAAC;IACzC,MAAM,GAAG,KAAK,CAAC,IAAI,8EAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACtD,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IAC1D,IAAI,GAAG,KAAK,CAAU,OAAO;6EAAC,CAAC;IACvB,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,KAAK,GAAG,QAAQ,CACjC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,gBAAgB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK;8EAC5E,CAAC;uGATS,mBAAmB;2FAAnB,mBAAmB,orBA9BpB;;;;;;;;;;;;;;;;UAgBF,0RAjBE,iBAAiB,0IAAE,IAAI,mYAAE,IAAI;;2FA+B5B,mBAAmB;kBAjC/B,SAAS;+BACE,aAAa,WACd,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,YAC9B;;;;;;;;;;;;;;;;UAgBF","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { ActivityIndicator, Text, View } from '@ng-native/components';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n@Component({\n selector: 'neu-spinner',\n imports: [ActivityIndicator, Text, View],\n template: `<view\n class=\"row\"\n accessibilityRole=\"progressbar\"\n [accessibilityLabel]=\"label()\"\n [accessibilityState]=\"{ busy: active() }\"\n ><activity-indicator\n [size]=\"size()\"\n [animating]=\"active()\"\n [color]=\"color()\"\n [accessible]=\"false\"\n [accessibilityElementsHidden]=\"true\"\n importantForAccessibility=\"no-hide-descendants\"\n />\n @if (showLabel()) {\n <text class=\"label\">{{ label() }}</text>\n }\n </view>`,\n styles: `\n .row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n min-height: 32px;\n }\n .label {\n font-size: 14px;\n color: var(--neu-muted, #596477);\n }\n `,\n})\nexport class NeuSpinnerComponent {\n readonly label = input('Loading');\n readonly size = input<'small' | 'large'>('small');\n readonly active = input(true, { transform: booleanAttribute });\n readonly showLabel = input(false, { transform: booleanAttribute });\n readonly tone = input<NeuTone>('brand');\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly color = computed(\n () => neuTonePalette(this.theme?.() ?? NEU_LIGHT_TOKENS, this.tone()).color,\n );\n}\n"]}
@@ -70,7 +70,7 @@ export class NeuSwitchComponent {
70
70
  />
71
71
  </view>
72
72
  </view>
73
- `, isInline: true, styles: ["\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n "], dependencies: [{ kind: "directive", type: Switch, selector: "switch", inputs: ["checked", "disabled", "invalid", "touched", "thumbColor", "trackColor", "ios_backgroundColor"], outputs: ["checkedChange", "touch"] }, { 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: View, selector: "view" }] });
73
+ `, isInline: true, styles: ["\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n "], dependencies: [{ kind: "directive", type: Switch, selector: "switch", inputs: ["checked", "controlSize", "disabled", "invalid", "touched", "thumbColor", "trackColor", "ios_backgroundColor"], outputs: ["checkedChange", "touch"] }, { 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: View, selector: "view" }] });
74
74
  }
75
75
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuSwitchComponent, decorators: [{
76
76
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/switch/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAA0B,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;;AAsFhC,MAAM,OAAO,kBAAkB;IACpB,MAAM,GAAG,KAAK,CAA4B,WAAW;+EAAC,CAAC;IAC/C,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU,CAAC;IACjC,aAAa,GAAG,KAAK,CAAmB,MAAM;sFAAC,CAAC;IAChD,IAAI,GAAG,KAAK,CAAU,IAAI;6EAA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C,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;YACrC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;mFAAC,CAAC;uGA7BQ,kBAAkB;2FAAlB,kBAAkB,y+CAjFnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT,+jCA5BS,MAAM,kMAAE,IAAI,mYAAE,IAAI;;2FAkFjB,kBAAkB;kBApF9B,SAAS;+BACE,YAAY,WACb,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,YACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport { Switch, Text, View } from '@ng-native/components';\nimport { NeuHaptics, type NeuHapticFeedback } from '../foundation/haptics.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuSize,\n} from '../foundation/index.js';\n\n@Component({\n selector: 'neu-switch',\n imports: [Switch, Text, View],\n template: `\n <view [class]=\"labelPosition() === 'right' ? 'row label-right' : 'row'\">\n <view class=\"copy\"\n ><text class=\"label\">{{ label() }}</text>\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else if (hint()) {\n <text class=\"hint\">{{ hint() }}</text>\n }\n </view>\n <view [class]=\"'toggle ' + size()\">\n <switch\n class=\"control\"\n [checked]=\"checked()\"\n (checkedChange)=\"acceptChange($event)\"\n [accessibilityLabel]=\"label()\"\n [accessibilityHint]=\"invalid() && error() ? error() : hint()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [disabled]=\"disabled() || readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n [trackColor]=\"trackColor()\"\n [hitSlop]=\"{ top: 10, bottom: 10, left: 8, right: 8 }\"\n (touch)=\"markTouched()\"\n />\n </view>\n </view>\n `,\n styles: `\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n `,\n})\nexport class NeuSwitchComponent {\n readonly haptic = input<NeuHapticFeedback | false>('selection');\n private readonly haptics = inject(NeuHaptics);\n readonly label = input.required<string>();\n readonly labelPosition = input<'left' | 'right'>('left');\n readonly size = input<NeuSize>('md');\n readonly hint = input('');\n readonly error = input('');\n readonly checked = model(false);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touched = input(false, { transform: booleanAttribute });\n readonly touch = output<void>();\n protected acceptChange(value: boolean): void {\n if (!this.disabled() && !this.readonly() && value !== this.checked()) {\n this.checked.set(value);\n this.haptics.play(this.haptic());\n }\n }\n protected markTouched(): void {\n if (!this.disabled() && !this.readonly()) this.touch.emit();\n }\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly trackColor = computed(() => {\n const t = this.theme?.() ?? NEU_LIGHT_TOKENS;\n return this.invalid()\n ? { true: t.danger, false: t.danger }\n : { true: t.accent, false: t.border };\n });\n}\n"]}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/switch/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AAC,OAAO,EAAE,EAAE,CAAC;YACrE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACS,WAAW;QACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;IACgB,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,UAAU,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,gBAAgB,CAAC;QAC7C,OAAO,IAAI,CAAC,OAAO,EAAE;YACnB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;YACrC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;mFAAC,CAAC;uGA7BQ,kBAAkB;2FAAlB,kBAAkB,y+CAjFnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT,+jCA5BS,MAAM,iNAAE,IAAI,mYAAE,IAAI;;2FAkFjB,kBAAkB;kBApF9B,SAAS;+BACE,YAAY,WACb,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,YACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport { Switch, Text, View } from '@ng-native/components';\nimport { NeuHaptics, type NeuHapticFeedback } from '../foundation/haptics.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuSize,\n} from '../foundation/index.js';\n\n@Component({\n selector: 'neu-switch',\n imports: [Switch, Text, View],\n template: `\n <view [class]=\"labelPosition() === 'right' ? 'row label-right' : 'row'\">\n <view class=\"copy\"\n ><text class=\"label\">{{ label() }}</text>\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else if (hint()) {\n <text class=\"hint\">{{ hint() }}</text>\n }\n </view>\n <view [class]=\"'toggle ' + size()\">\n <switch\n class=\"control\"\n [checked]=\"checked()\"\n (checkedChange)=\"acceptChange($event)\"\n [accessibilityLabel]=\"label()\"\n [accessibilityHint]=\"invalid() && error() ? error() : hint()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [disabled]=\"disabled() || readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n [trackColor]=\"trackColor()\"\n [hitSlop]=\"{ top: 10, bottom: 10, left: 8, right: 8 }\"\n (touch)=\"markTouched()\"\n />\n </view>\n </view>\n `,\n styles: `\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n `,\n})\nexport class NeuSwitchComponent {\n readonly haptic = input<NeuHapticFeedback | false>('selection');\n private readonly haptics = inject(NeuHaptics);\n readonly label = input.required<string>();\n readonly labelPosition = input<'left' | 'right'>('left');\n readonly size = input<NeuSize>('md');\n readonly hint = input('');\n readonly error = input('');\n readonly checked = model(false);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touched = input(false, { transform: booleanAttribute });\n readonly touch = output<void>();\n protected acceptChange(value: boolean): void {\n if (!this.disabled() && !this.readonly() && value !== this.checked()) {\n this.checked.set(value);\n this.haptics.play(this.haptic());\n }\n }\n protected markTouched(): void {\n if (!this.disabled() && !this.readonly()) this.touch.emit();\n }\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly trackColor = computed(() => {\n const t = this.theme?.() ?? NEU_LIGHT_TOKENS;\n return this.invalid()\n ? { true: t.danger, false: t.danger }\n : { true: t.accent, false: t.border };\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neural-ui/native",
3
- "version": "0.1.0-beta.7",
3
+ "version": "0.1.0-beta.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Signals-first native Angular components for iOS and Android.",
@@ -291,10 +291,10 @@
291
291
  "peerDependencies": {
292
292
  "@angular/common": ">=22.2.0 <23",
293
293
  "@angular/core": ">=22.2.0 <23",
294
- "@ng-native/components": "0.22.2",
295
- "@ng-native/device": "0.22.2",
296
- "@ng-native/fabric": "0.22.2",
297
- "@ng-native/icons": "0.22.2",
294
+ "@ng-native/components": "0.23.0",
295
+ "@ng-native/device": "0.23.0",
296
+ "@ng-native/fabric": "0.23.0",
297
+ "@ng-native/icons": "0.23.0",
298
298
  "expo-haptics": "^57.0.0 || ^58.0.0",
299
299
  "expo-modules-core": "^57.0.0 || ^58.0.0",
300
300
  "react-native-svg": "15.15.4"
@@ -314,7 +314,7 @@
314
314
  "devDependencies": {
315
315
  "@angular/compiler-cli": "22.2.2",
316
316
  "@babel/core": "7.29.7",
317
- "@ng-native/testing": "0.22.2",
317
+ "@ng-native/testing": "0.23.0",
318
318
  "@vitest/coverage-v8": "5.0.3",
319
319
  "expo-haptics": "57.0.3",
320
320
  "vitest": "5.0.3"