@neural-ui/native 0.1.0-beta.1 → 0.1.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +15 -5
  2. package/dist/accordion/accordion.js +1 -1
  3. package/dist/accordion/accordion.js.map +1 -1
  4. package/dist/alert/alert.js +1 -1
  5. package/dist/alert/alert.js.map +1 -1
  6. package/dist/bottom-sheet/bottom-sheet.js +1 -1
  7. package/dist/bottom-sheet/bottom-sheet.js.map +1 -1
  8. package/dist/button/button.d.ts +3 -1
  9. package/dist/button/button.js +7 -3
  10. package/dist/button/button.js.map +1 -1
  11. package/dist/button-group/button-group.js +1 -1
  12. package/dist/button-group/button-group.js.map +1 -1
  13. package/dist/calendar/calendar.js +1 -1
  14. package/dist/calendar/calendar.js.map +1 -1
  15. package/dist/carousel/carousel.js +1 -1
  16. package/dist/carousel/carousel.js.map +1 -1
  17. package/dist/cascade-select/cascade-select.js +1 -1
  18. package/dist/cascade-select/cascade-select.js.map +1 -1
  19. package/dist/checkbox/checkbox.d.ts +4 -1
  20. package/dist/checkbox/checkbox.js +10 -3
  21. package/dist/checkbox/checkbox.js.map +1 -1
  22. package/dist/chip/chip.js +1 -1
  23. package/dist/chip/chip.js.map +1 -1
  24. package/dist/confirm-dialog/confirm-dialog.js +1 -1
  25. package/dist/context-menu/context-menu.js +1 -1
  26. package/dist/context-menu/context-menu.js.map +1 -1
  27. package/dist/data-view/data-view.d.ts +5 -1
  28. package/dist/data-view/data-view.js +68 -19
  29. package/dist/data-view/data-view.js.map +1 -1
  30. package/dist/date-input/date-input.js +1 -1
  31. package/dist/date-input/date-input.js.map +1 -1
  32. package/dist/empty-state/empty-state.js +1 -1
  33. package/dist/filter-bar/filter-bar.js +1 -1
  34. package/dist/foundation/anchored-overlay.js +1 -1
  35. package/dist/foundation/anchored-overlay.js.map +1 -1
  36. package/dist/foundation/haptics.d.ts +30 -0
  37. package/dist/foundation/haptics.js +53 -0
  38. package/dist/foundation/haptics.js.map +1 -0
  39. package/dist/foundation/index.d.ts +1 -0
  40. package/dist/foundation/index.js +1 -0
  41. package/dist/foundation/index.js.map +1 -1
  42. package/dist/foundation/native-pressable.d.ts +5 -1
  43. package/dist/foundation/native-pressable.js +13 -3
  44. package/dist/foundation/native-pressable.js.map +1 -1
  45. package/dist/gallery/gallery.d.ts +1 -0
  46. package/dist/gallery/gallery.js +24 -11
  47. package/dist/gallery/gallery.js.map +1 -1
  48. package/dist/haptics/index.d.ts +12 -0
  49. package/dist/haptics/index.js +36 -0
  50. package/dist/haptics/index.js.map +1 -0
  51. package/dist/icon-button/icon-button.d.ts +3 -1
  52. package/dist/icon-button/icon-button.js +7 -3
  53. package/dist/icon-button/icon-button.js.map +1 -1
  54. package/dist/image-viewer/image-viewer.js +1 -1
  55. package/dist/image-viewer/image-viewer.js.map +1 -1
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/inline-editor/inline-editor.js +1 -1
  60. package/dist/inline-editor/inline-editor.js.map +1 -1
  61. package/dist/input-mask/input-mask.d.ts +2 -0
  62. package/dist/input-mask/input-mask.js +7 -1
  63. package/dist/input-mask/input-mask.js.map +1 -1
  64. package/dist/input-otp/input-otp.js +1 -1
  65. package/dist/input-otp/input-otp.js.map +1 -1
  66. package/dist/input-tags/input-tags.d.ts +2 -0
  67. package/dist/input-tags/input-tags.js +8 -3
  68. package/dist/input-tags/input-tags.js.map +1 -1
  69. package/dist/listbox/listbox.js +1 -1
  70. package/dist/listbox/listbox.js.map +1 -1
  71. package/dist/menu/menu.js +1 -1
  72. package/dist/menu/menu.js.map +1 -1
  73. package/dist/modal/modal.js +1 -1
  74. package/dist/modal/modal.js.map +1 -1
  75. package/dist/nav/nav.js +1 -1
  76. package/dist/nav/nav.js.map +1 -1
  77. package/dist/notification-center/notification-center.js +1 -1
  78. package/dist/notification-center/notification-center.js.map +1 -1
  79. package/dist/number-input/number-input.js +1 -1
  80. package/dist/number-input/number-input.js.map +1 -1
  81. package/dist/panel/panel.js +1 -1
  82. package/dist/panel/panel.js.map +1 -1
  83. package/dist/password/password.js +1 -1
  84. package/dist/pick-list/pick-list.js +1 -1
  85. package/dist/pick-list/pick-list.js.map +1 -1
  86. package/dist/popover/popover.js +1 -1
  87. package/dist/popover/popover.js.map +1 -1
  88. package/dist/radio/radio.d.ts +4 -1
  89. package/dist/radio/radio.js +13 -4
  90. package/dist/radio/radio.js.map +1 -1
  91. package/dist/rating/rating.js +1 -1
  92. package/dist/rating/rating.js.map +1 -1
  93. package/dist/section-list/index.d.ts +1 -0
  94. package/dist/section-list/index.js +2 -0
  95. package/dist/section-list/index.js.map +1 -0
  96. package/dist/section-list/section-list.d.ts +41 -0
  97. package/dist/section-list/section-list.js +161 -0
  98. package/dist/section-list/section-list.js.map +1 -0
  99. package/dist/select/select.js +1 -1
  100. package/dist/select/select.js.map +1 -1
  101. package/dist/sidebar/sidebar.js +1 -1
  102. package/dist/sidebar/sidebar.js.map +1 -1
  103. package/dist/slider/slider.d.ts +4 -1
  104. package/dist/slider/slider.js +12 -3
  105. package/dist/slider/slider.js.map +1 -1
  106. package/dist/speed-dial/speed-dial.js +1 -1
  107. package/dist/speed-dial/speed-dial.js.map +1 -1
  108. package/dist/spinner/spinner.js +1 -1
  109. package/dist/spinner/spinner.js.map +1 -1
  110. package/dist/stepper/stepper.js +1 -1
  111. package/dist/stepper/stepper.js.map +1 -1
  112. package/dist/switch/switch.d.ts +4 -1
  113. package/dist/switch/switch.js +10 -4
  114. package/dist/switch/switch.js.map +1 -1
  115. package/dist/tabs/tabs.js +1 -1
  116. package/dist/tabs/tabs.js.map +1 -1
  117. package/dist/toast/toast.js +1 -1
  118. package/dist/toast/toast.js.map +1 -1
  119. package/dist/toggle-button-group/toggle-button-group.js +1 -1
  120. package/dist/toggle-button-group/toggle-button-group.js.map +1 -1
  121. package/dist/toolbar/toolbar.js +1 -1
  122. package/dist/toolbar/toolbar.js.map +1 -1
  123. package/dist/tree/tree.js +1 -1
  124. package/dist/tree/tree.js.map +1 -1
  125. package/dist/tree-select/tree-select.js +1 -1
  126. package/dist/tree-select/tree-select.js.map +1 -1
  127. package/dist/uploader/uploader.d.ts +1 -1
  128. package/dist/uploader/uploader.js +1 -1
  129. package/dist/uploader/uploader.js.map +1 -1
  130. package/dist/virtual-list/virtual-list.js +1 -1
  131. package/dist/virtual-list/virtual-list.js.map +1 -1
  132. package/package.json +26 -6
@@ -0,0 +1,30 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export type NeuHapticImpact = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';
4
+ export type NeuHapticFeedback = 'press' | 'selection' | NeuHapticImpact | 'success' | 'warning' | 'error';
5
+ export interface NeuHapticsOptions {
6
+ /** Explicitly enabling a provider opts the application into feedback. */
7
+ enabled?: boolean;
8
+ /** Coalesce rapid feedback, including continuous sliders. Defaults to 80 ms. */
9
+ minimumIntervalMs?: number;
10
+ pressStyle?: NeuHapticImpact;
11
+ }
12
+ export interface NeuHapticsDriver {
13
+ available(): boolean;
14
+ play(feedback: Exclude<NeuHapticFeedback, 'press'>): void | Promise<void>;
15
+ }
16
+ export declare const NEU_HAPTICS_OPTIONS: InjectionToken<NeuHapticsOptions>;
17
+ /** Platform boundary, replaceable by consumers and contract tests. */
18
+ export declare const NEU_HAPTICS_DRIVER: InjectionToken<NeuHapticsDriver | null>;
19
+ /** Optional feedback: a missing motor or failed vibration must never block an action. */
20
+ export declare class NeuHaptics {
21
+ private readonly options;
22
+ private readonly driver;
23
+ readonly enabled: import("@angular/core").WritableSignal<boolean>;
24
+ private lastAt;
25
+ get available(): boolean;
26
+ /** True means a request was dispatched, not that hardware physically vibrated. */
27
+ play(feedback?: NeuHapticFeedback | false): boolean;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<NeuHaptics, never>;
29
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
30
+ }
@@ -0,0 +1,53 @@
1
+ import { Injectable, InjectionToken, inject, signal } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export const NEU_HAPTICS_OPTIONS = new InjectionToken('Neural haptics options', {
4
+ providedIn: 'root', factory: () => ({ enabled: false }),
5
+ });
6
+ /** Platform boundary, replaceable by consumers and contract tests. */
7
+ export const NEU_HAPTICS_DRIVER = new InjectionToken('Neural haptics driver', {
8
+ providedIn: 'root', factory: () => null,
9
+ });
10
+ /** Optional feedback: a missing motor or failed vibration must never block an action. */
11
+ export class NeuHaptics {
12
+ options = inject(NEU_HAPTICS_OPTIONS);
13
+ driver = inject(NEU_HAPTICS_DRIVER);
14
+ enabled = signal(this.options.enabled ?? false, /* @ts-ignore */
15
+ ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
16
+ lastAt = -Infinity;
17
+ get available() {
18
+ try {
19
+ return this.driver?.available() ?? false;
20
+ }
21
+ catch {
22
+ return false;
23
+ }
24
+ }
25
+ /** True means a request was dispatched, not that hardware physically vibrated. */
26
+ play(feedback = 'press') {
27
+ if (!feedback || !this.enabled() || !this.available || !this.driver)
28
+ return false;
29
+ const configured = this.options.minimumIntervalMs ?? 80;
30
+ const interval = Number.isFinite(configured) ? Math.max(0, Math.min(1000, configured)) : 80;
31
+ const now = Date.now();
32
+ if (now >= this.lastAt && now - this.lastAt < interval)
33
+ return false;
34
+ try {
35
+ const result = this.driver.play(feedback === 'press' ? (this.options.pressStyle ?? 'light') : feedback);
36
+ this.lastAt = now;
37
+ // A consumer-supplied asynchronous driver must not leak rejected promises.
38
+ if (result)
39
+ void Promise.resolve(result).catch(() => undefined);
40
+ return true;
41
+ }
42
+ catch {
43
+ return false;
44
+ }
45
+ }
46
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuHaptics, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
47
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuHaptics, providedIn: 'root' });
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuHaptics, decorators: [{
50
+ type: Injectable,
51
+ args: [{ providedIn: 'root' }]
52
+ }] });
53
+ //# sourceMappingURL=haptics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"haptics.js","sourceRoot":"","sources":["../../src/foundation/haptics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAe3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAoB,wBAAwB,EAAE;IACjG,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CACxD,CAAC,CAAC;AACH,sEAAsE;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAA0B,uBAAuB,EAAE;IACrG,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;CACxC,CAAC,CAAC;AAEH,yFAAyF;AAEzF,MAAM,OAAO,UAAU;IACJ,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACtC,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC5C,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,KAAK;gFAAC,CAAC;IACjD,MAAM,GAAG,CAAC,QAAQ,CAAC;IAE3B,IAAI,SAAS;QACX,IAAI,CAAC;YAAC,OAAO,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,KAAK,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO,KAAK,CAAC;QAAC,CAAC;IAC3E,CAAC;IAED,kFAAkF;IAClF,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ken, inject, signal } from '@angular/core';\n\nexport type NeuHapticImpact = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';\nexport type NeuHapticFeedback = 'press' | 'selection' | NeuHapticImpact | 'success' | 'warning' | 'error';\nexport interface NeuHapticsOptions {\n /** Explicitly enabling a provider opts the application into feedback. */\n enabled?: boolean;\n /** Coalesce rapid feedback, including continuous sliders. Defaults to 80 ms. */\n minimumIntervalMs?: number;\n pressStyle?: NeuHapticImpact;\n}\nexport interface NeuHapticsDriver {\n available(): boolean;\n play(feedback: Exclude<NeuHapticFeedback, 'press'>): void | Promise<void>;\n}\nexport const NEU_HAPTICS_OPTIONS = new InjectionToken<NeuHapticsOptions>('Neural haptics options', {\n providedIn: 'root', factory: () => ({ enabled: false }),\n});\n/** Platform boundary, replaceable by consumers and contract tests. */\nexport const NEU_HAPTICS_DRIVER = new InjectionToken<NeuHapticsDriver | null>('Neural haptics driver', {\n providedIn: 'root', factory: () => null,\n});\n\n/** Optional feedback: a missing motor or failed vibration must never block an action. */\n@Injectable({ providedIn: 'root' })\nexport class NeuHaptics {\n private readonly options = inject(NEU_HAPTICS_OPTIONS);\n private readonly driver = inject(NEU_HAPTICS_DRIVER);\n readonly enabled = signal(this.options.enabled ?? false);\n private lastAt = -Infinity;\n\n get available(): boolean {\n try { return this.driver?.available() ?? false; } catch { return false; }\n }\n\n /** True means a request was dispatched, not that hardware physically vibrated. */\n play(feedback: NeuHapticFeedback | false = 'press'): boolean {\n if (!feedback || !this.enabled() || !this.available || !this.driver) return false;\n const configured = this.options.minimumIntervalMs ?? 80;\n const interval = Number.isFinite(configured) ? Math.max(0, Math.min(1000, configured)) : 80;\n const now = Date.now();\n if (now >= this.lastAt && now - this.lastAt < interval) return false;\n try {\n const result = this.driver.play(feedback === 'press' ? (this.options.pressStyle ?? 'light') : feedback);\n this.lastAt = now;\n // A consumer-supplied asynchronous driver must not leak rejected promises.\n if (result) void Promise.resolve(result).catch(() => undefined);\n return true;\n } catch { return false; }\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { InjectionToken, type Signal } from '@angular/core';
2
+ export * from './haptics.js';
2
3
  export type NeuSize = 'sm' | 'md' | 'lg';
3
4
  export type NeuVariant = 'solid' | 'tonal' | 'outline' | 'text';
4
5
  export type NeuTone = 'neutral' | 'brand' | 'accent' | 'success' | 'info' | 'warning' | 'danger';
@@ -1,4 +1,5 @@
1
1
  import { InjectionToken } from '@angular/core';
2
+ export * from './haptics.js';
2
3
  export const NEU_LIGHT_TOKENS = Object.freeze({
3
4
  accent: '#006ee6',
4
5
  onAccent: '#ffffff',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/foundation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAsC5D,MAAM,CAAC,MAAM,gBAAgB,GAAwB,MAAM,CAAC,MAAM,CAAC;IACjE,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,GAAG;IACb,aAAa,EAAE,SAAS;IACxB,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,SAAS;IAC3B,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,OAAO;CACvB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,eAAe,GAAwB,MAAM,CAAC,MAAM,CAAC;IAChE,GAAG,gBAAgB;IACnB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,SAAS;CAC5B,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,cAAc,CACzC,qBAAqB,CACtB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GACzB,8JAA8J,CAAC;AACjK,MAAM,CAAC,MAAM,aAAa,GACxB,uIAAuI,CAAC","sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nexport type NeuSize = 'sm' | 'md' | 'lg';\nexport type NeuVariant = 'solid' | 'tonal' | 'outline' | 'text';\nexport type NeuTone = 'neutral' | 'brand' | 'accent' | 'success' | 'info' | 'warning' | 'danger';\nexport type NeuColorScheme = 'system' | 'light' | 'dark';\nexport interface NeuTokens {\n accent: string;\n onAccent: string;\n surface: string;\n canvas: string;\n text: string;\n muted: string;\n border: string;\n tonal: string;\n danger: string;\n success: string;\n warning: string;\n warningText: string;\n onWarning: string;\n info: string;\n /** Optional semantic text inks; defaults are resolved against the theme surfaces. */\n accentText?: string;\n dangerText?: string;\n successText?: string;\n infoText?: string;\n radius: number;\n spacing: number;\n fontSize: number;\n duration: number;\n /** Decorative surfaces; independent of the functional control border. */\n surfaceBorder?: string;\n divider?: string;\n surfaceSecondary?: string;\n /** Dedicated image canvas and readable control ink, independent of app scheme. */\n mediaCanvas?: string;\n mediaText?: string;\n mediaBarStyle?: 'light' | 'dark';\n}\nexport const NEU_LIGHT_TOKENS: Readonly<NeuTokens> = Object.freeze({\n accent: '#006ee6',\n onAccent: '#ffffff',\n surface: '#ffffff',\n canvas: '#f4f5f7',\n text: '#172033',\n muted: '#596477',\n border: '#a5afbf',\n tonal: '#eff6ff',\n danger: '#dc2626',\n success: '#15803d',\n warning: '#f59e0b',\n warningText: '#92400e',\n onWarning: '#111827',\n info: '#0064d1',\n radius: 12,\n spacing: 16,\n fontSize: 16,\n duration: 120,\n surfaceBorder: '#e1e6ed',\n divider: '#e7ebf0',\n surfaceSecondary: '#eef1f5',\n mediaCanvas: '#111722',\n mediaText: '#edf1fa',\n mediaBarStyle: 'light',\n});\nexport const NEU_DARK_TOKENS: Readonly<NeuTokens> = Object.freeze({\n ...NEU_LIGHT_TOKENS,\n accent: '#b5c4ff',\n onAccent: '#172955',\n surface: '#1b2230',\n canvas: '#111722',\n text: '#edf1fa',\n muted: '#b4bed0',\n border: '#6c7a92',\n tonal: '#293756',\n danger: '#ffb4ab',\n success: '#8fdeb1',\n warning: '#efd48f',\n warningText: '#efd48f',\n onWarning: '#111722',\n info: '#7dd3fc',\n surfaceBorder: '#354052',\n divider: '#303b4c',\n surfaceSecondary: '#222d3f',\n});\nexport const NEU_THEME = new InjectionToken<Signal<Readonly<NeuTokens>>>(\n 'Neural Native theme',\n);\nexport const NEU_CHECK_ICON =\n '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m5 12 4 4 10-10\"/></svg>';\nexport const NEU_PLUS_ICON =\n '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M12 5v14M5 12h14\"/></svg>';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/foundation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAC5D,cA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Ac,CACzC,qBAAqB,CACtB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GACzB,8JAA8J,CAAC;AACjK,MAAM,CAAC,MAAM,aAAa,GACxB,uIAAuI,CAAC","sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nexport * from './haptics.js';\nexport type NeuSize = 'sm' | 'md' | 'lg';\nexport type NeuVariant = 'solid' | 'tonal' | 'outline' | 'text';\nexport type NeuTone = 'neutral' | 'brand' | 'accent' | 'success' | 'info' | 'warning' | 'danger';\nexport type NeuColorScheme = 'system' | 'light' | 'dark';\nexport interface NeuTokens {\n accent: string;\n onAccent: string;\n surface: string;\n canvas: string;\n text: string;\n muted: string;\n border: string;\n tonal: string;\n danger: string;\n success: string;\n warning: string;\n warningText: string;\n onWarning: string;\n info: string;\n /** Optional semantic text inks; defaults are resolved against the theme surfaces. */\n accentText?: string;\n dangerText?: string;\n successText?: string;\n infoText?: string;\n radius: number;\n spacing: number;\n fontSize: number;\n duration: number;\n /** Decorative surfaces; independent of the functional control border. */\n surfaceBorder?: string;\n divider?: string;\n surfaceSecondary?: string;\n /** Dedicated image canvas and readable control ink, independent of app scheme. */\n mediaCanvas?: string;\n mediaText?: string;\n mediaBarStyle?: 'light' | 'dark';\n}\nexport const NEU_LIGHT_TOKENS: Readonly<NeuTokens> = Object.freeze({\n accent: '#006ee6',\n onAccent: '#ffffff',\n surface: '#ffffff',\n canvas: '#f4f5f7',\n text: '#172033',\n muted: '#596477',\n border: '#a5afbf',\n tonal: '#eff6ff',\n danger: '#dc2626',\n success: '#15803d',\n warning: '#f59e0b',\n warningText: '#92400e',\n onWarning: '#111827',\n info: '#0064d1',\n radius: 12,\n spacing: 16,\n fontSize: 16,\n duration: 120,\n surfaceBorder: '#e1e6ed',\n divider: '#e7ebf0',\n surfaceSecondary: '#eef1f5',\n mediaCanvas: '#111722',\n mediaText: '#edf1fa',\n mediaBarStyle: 'light',\n});\nexport const NEU_DARK_TOKENS: Readonly<NeuTokens> = Object.freeze({\n ...NEU_LIGHT_TOKENS,\n accent: '#b5c4ff',\n onAccent: '#172955',\n surface: '#1b2230',\n canvas: '#111722',\n text: '#edf1fa',\n muted: '#b4bed0',\n border: '#6c7a92',\n tonal: '#293756',\n danger: '#ffb4ab',\n success: '#8fdeb1',\n warning: '#efd48f',\n warningText: '#efd48f',\n onWarning: '#111722',\n info: '#7dd3fc',\n surfaceBorder: '#354052',\n divider: '#303b4c',\n surfaceSecondary: '#222d3f',\n});\nexport const NEU_THEME = new InjectionToken<Signal<Readonly<NeuTokens>>>(\n 'Neural Native theme',\n);\nexport const NEU_CHECK_ICON =\n '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m5 12 4 4 10-10\"/></svg>';\nexport const NEU_PLUS_ICON =\n '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M12 5v14M5 12h14\"/></svg>';\n"]}
@@ -1,10 +1,14 @@
1
1
  import { Pressable } from '@ng-native/components';
2
+ import { type NeuHapticFeedback } from './haptics.js';
2
3
  import * as i0 from "@angular/core";
3
4
  /** Bridge the iOS accessibility activation event to the normal guarded action. */
4
5
  export declare class NeuNativePressable extends Pressable {
6
+ readonly haptic: import("@angular/core").InputSignal<false | NeuHapticFeedback>;
7
+ private readonly haptics;
8
+ private stopHaptics?;
5
9
  private stopAccessibilityTap?;
6
10
  ngOnInit(): void;
7
11
  ngOnDestroy(): void;
8
12
  static ɵfac: i0.ɵɵFactoryDeclaration<NeuNativePressable, never>;
9
- static ɵdir: i0.ɵɵDirectiveDeclaration<NeuNativePressable, "pressable", ["pressable"], {}, {}, never, never, true, never>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NeuNativePressable, "pressable", ["pressable"], { "haptic": { "alias": "haptic"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
10
14
  }
@@ -1,13 +1,22 @@
1
- import { Directive } from '@angular/core';
1
+ import { Directive, inject, input } from '@angular/core';
2
2
  import { Pressable } from '@ng-native/components';
3
3
  import { declareNativeProps, nativePlatform } from '@ng-native/fabric';
4
+ import { NeuHaptics } from './haptics.js';
4
5
  import * as i0 from "@angular/core";
5
6
  declareNativeProps('pressable', ['onAccessibilityTap']);
6
7
  /** Bridge the iOS accessibility activation event to the normal guarded action. */
7
8
  export class NeuNativePressable extends Pressable {
9
+ haptic = input('press', /* @ts-ignore */
10
+ ...(ngDevMode ? [{ debugName: "haptic" }] : /* istanbul ignore next */ []));
11
+ haptics = inject(NeuHaptics);
12
+ stopHaptics;
8
13
  stopAccessibilityTap;
9
14
  ngOnInit() {
10
15
  super.ngOnInit();
16
+ this.stopHaptics = this.press.subscribe(() => {
17
+ if (this.claims())
18
+ this.haptics.play(this.haptic());
19
+ });
11
20
  if (nativePlatform() !== 'ios')
12
21
  return;
13
22
  // Fabric's iOS view emits this event only when the native opt-in is present.
@@ -21,14 +30,15 @@ export class NeuNativePressable extends Pressable {
21
30
  });
22
31
  }
23
32
  ngOnDestroy() {
33
+ this.stopHaptics?.unsubscribe();
24
34
  this.stopAccessibilityTap?.();
25
35
  super.ngOnDestroy();
26
36
  }
27
37
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativePressable, deps: null, target: i0.ɵɵFactoryTarget.Directive });
28
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.2", type: NeuNativePressable, isStandalone: true, selector: "pressable", exportAs: ["pressable"], usesInheritance: true, ngImport: i0 });
38
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.2", type: NeuNativePressable, isStandalone: true, selector: "pressable", inputs: { haptic: { classPropertyName: "haptic", publicName: "haptic", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["pressable"], usesInheritance: true, ngImport: i0 });
29
39
  }
30
40
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativePressable, decorators: [{
31
41
  type: Directive,
32
42
  args: [{ selector: 'pressable', exportAs: 'pressable' }]
33
- }] });
43
+ }], propDecorators: { haptic: [{ type: i0.Input, args: [{ isSignal: true, alias: "haptic", required: false }] }] } });
34
44
  //# sourceMappingURL=native-pressable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"native-pressable.js","sourceRoot":"","sources":["../../src/foundation/native-pressable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAmB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;;AAEvE,kBAAkB,CAAC,WAAW,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAExD,kFAAkF;AAElF,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IACvC,oBAAoB,CAAc;IAEjC,QAAQ;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,cAAc,EAAE,KAAK,KAAK;YAAE,OAAO;QACvC,6EAA6E;QAC7E,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,EAAE,GAAG,CAAC,EAAE;YAC/F,MAAM,KAAK,GAAG,GAAiB,CAAC;YAChC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI;gBAAE,OAAO;YACvC,IAAI,IAAI,CAAC,MAAM,EAAE;gBAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAmB,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAEQ,WAAW;QAClB,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAC;QAC9B,KAAK,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;uGAlBU,kBAAkB;2FAAlB,kBAAkB;;2FAAlB,kBAAkB;kBAD9B,SAAS;mBAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE","sourcesContent":["import { Directive } from '@angular/core';\nimport { Pressable, type PressEvent } from '@ng-native/components';\nimport { declareNativeProps, nativePlatform } from '@ng-native/fabric';\n\ndeclareNativeProps('pressable', ['onAccessibilityTap']);\n\n/** Bridge the iOS accessibility activation event to the normal guarded action. */\n@Directive({ selector: 'pressable', exportAs: 'pressable' })\nexport class NeuNativePressable extends Pressable {\n private stopAccessibilityTap?: () => void;\n\n override ngOnInit(): void {\n super.ngOnInit();\n if (nativePlatform() !== 'ios') return;\n // Fabric's iOS view emits this event only when the native opt-in is present.\n this.engine.setProp(this.node, 'onAccessibilityTap', true);\n this.stopAccessibilityTap = this.engine.setEventListener(this.node, 'topAccessibilityTap', raw => {\n const event = raw as PressEvent;\n if (event.target !== this.node) return;\n if (this.claims()) this.press.emit(event as PressEvent);\n });\n }\n\n override ngOnDestroy(): void {\n this.stopAccessibilityTap?.();\n super.ngOnDestroy();\n }\n}\n"]}
1
+ {"version":3,"file":"native-pressable.js","sourceRoot":"","sources":["../../src/foundation/native-pressable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAA8B,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,SAAS,EAAmB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;;AAElE,kBAAkB,CAAC,WAAW,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAExD,kFAAkF;AAElF,MAAM,OAAO,kBAAmB,SAAQ,SAA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Content":["import { Directive, inject, input, type OutputRefSubscription } from '@angular/core';\nimport { Pressable, type PressEvent } from '@ng-native/components';\nimport { declareNativeProps, nativePlatform } from '@ng-native/fabric';\nimport { NeuHaptics, type NeuHapticFeedback } from './haptics.js';\n\ndeclareNativeProps('pressable', ['onAccessibilityTap']);\n\n/** Bridge the iOS accessibility activation event to the normal guarded action. */\n@Directive({ selector: 'pressable', exportAs: 'pressable' })\nexport class NeuNativePressable extends Pressable {\n readonly haptic = input<NeuHapticFeedback | false>('press');\n private readonly haptics = inject(NeuHaptics);\n private stopHaptics?: OutputRefSubscription;\n private stopAccessibilityTap?: () => void;\n\n override ngOnInit(): void {\n super.ngOnInit();\n this.stopHaptics = this.press.subscribe(() => {\n if (this.claims()) this.haptics.play(this.haptic());\n });\n if (nativePlatform() !== 'ios') return;\n // Fabric's iOS view emits this event only when the native opt-in is present.\n this.engine.setProp(this.node, 'onAccessibilityTap', true);\n this.stopAccessibilityTap = this.engine.setEventListener(this.node, 'topAccessibilityTap', raw => {\n const event = raw as PressEvent;\n if (event.target !== this.node) return;\n if (this.claims()) this.press.emit(event as PressEvent);\n });\n }\n\n override ngOnDestroy(): void {\n this.stopHaptics?.unsubscribe();\n this.stopAccessibilityTap?.();\n super.ngOnDestroy();\n }\n}\n"]}
@@ -24,6 +24,7 @@ type GalleryScene = {
24
24
  radius: number;
25
25
  ratio: number;
26
26
  captions: boolean;
27
+ columnWidth: number;
27
28
  };
28
29
  export declare class NeuGalleryComponent {
29
30
  protected readonly itemContent: import("@angular/core").Signal<NeuGalleryItemDirective | undefined>;
@@ -65,9 +65,12 @@ export class NeuGalleryComponent {
65
65
  scene = computed(() => ({
66
66
  groups: this.groups(), layout: this.layout(), gap: this.resolvedGap(),
67
67
  radius: this.resolvedRadius(), ratio: this.bounded(this.aspectRatio(), 1, 0.25, 4), captions: this.showCaptions(),
68
+ // Native image measurement can otherwise make a percentage-width image's
69
+ // intrinsic width dominate its flex row and squeeze the adjacent tile.
70
+ columnWidth: Math.max(0, (this.measuredWidth() - this.resolvedGap() * (this.resolvedColumns() - 1)) / this.resolvedColumns()),
68
71
  }), /* @ts-ignore */
69
72
  ...(ngDevMode ? [{ debugName: "scene" }] : /* istanbul ignore next */ []));
70
- motion = neuCrossfade(this.scene, signal(true), (a, b) => a.groups === b.groups && a.layout === b.layout && a.gap === b.gap && a.radius === b.radius && a.ratio === b.ratio && a.captions === b.captions);
73
+ motion = neuCrossfade(this.scene, signal(true), (a, b) => a.groups === b.groups && a.layout === b.layout && a.gap === b.gap && a.radius === b.radius && a.ratio === b.ratio && a.captions === b.captions && a.columnWidth === b.columnWidth);
71
74
  layers = computed(() => {
72
75
  const previous = this.motion.outgoing();
73
76
  return [
@@ -96,17 +99,22 @@ export class NeuGalleryComponent {
96
99
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuGalleryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
97
100
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuGalleryComponent, isStandalone: true, selector: "neu-gallery", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, viewerLabels: { classPropertyName: "viewerLabels", publicName: "viewerLabels", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, emptyLabel: { classPropertyName: "emptyLabel", publicName: "emptyLabel", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, aspectRatio: { classPropertyName: "aspectRatio", publicName: "aspectRatio", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, showCaptions: { classPropertyName: "showCaptions", publicName: "showCaptions", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange", open: "openChange" }, queries: [{ propertyName: "itemContent", first: true, predicate: NeuGalleryItemDirective, descendants: true, isSignal: true }, { propertyName: "captionContent", first: true, predicate: NeuGalleryCaptionDirective, descendants: true, isSignal: true }], ngImport: i0, template: `<view class="gallery-stage" [accessibilityLabel]="label()" (layout)="measure($event)">
98
101
  @for (layer of layers(); track layer.outgoing) {
99
- <view class="gallery" [class.gallery-outgoing]="layer.outgoing" [class.gallery-mosaic]="layer.scene.layout === 'mosaic'"
102
+ <view class="gallery" [class.gallery-outgoing]="layer.outgoing"
103
+ [style.flexDirection]="layer.scene.layout === 'mosaic' ? 'row' : 'column'"
100
104
  [style.gap]="layer.scene.gap" [animatedStyle]="layer.outgoing ? motion.settledStyle : motion.incomingStyle"
101
105
  [pointerEvents]="layer.outgoing ? 'none' : 'auto'" [accessibilityElementsHidden]="layer.outgoing"
102
106
  [importantForAccessibility]="layer.outgoing ? 'no-hide-descendants' : 'auto'">
103
107
  @for (group of layer.scene.groups; track $index) {
104
- <view class="gallery-group" [class.gallery-column]="layer.scene.layout === 'mosaic'" [style.gap]="layer.scene.gap">
108
+ <view class="gallery-group" [style.gap]="layer.scene.gap"
109
+ [style.flexDirection]="layer.scene.layout === 'mosaic' ? 'column' : 'row'"
110
+ [style.width]="layer.scene.layout === 'mosaic' ? layer.scene.columnWidth : '100%'"
111
+ [style.flexGrow]="0" [style.flexShrink]="0" [style.flexBasis]="'auto'">
105
112
  @for (tile of group; track tile ? tile.item.id : $index) {
106
113
  @if (tile) {
107
114
  <pressable
108
115
  class="gallery-item"
109
- [class.mosaic-item]="layer.scene.layout === 'mosaic'"
116
+ [style.width]="layer.scene.layout === 'mosaic' ? '100%' : layer.scene.columnWidth"
117
+ [style.flexGrow]="0" [style.flexShrink]="0" [style.flexBasis]="'auto'"
110
118
  accessibilityRole="button"
111
119
  [accessibilityLabel]="tile.item.label"
112
120
  (press)="show(tile.index)"
@@ -126,7 +134,7 @@ export class NeuGalleryComponent {
126
134
  } @else { <text class="muted" [numberOfLines]="2">{{ tile.item.label }}</text> }
127
135
  }</pressable
128
136
  >
129
- } @else { <view class="gallery-placeholder" /> }
137
+ } @else { <view class="gallery-placeholder" [style.width]="layer.scene.columnWidth" /> }
130
138
  }
131
139
  </view>
132
140
  } @empty {
@@ -140,23 +148,28 @@ export class NeuGalleryComponent {
140
148
  [nextLabel]="viewerLabels().nextLabel ?? 'Next image'"
141
149
  [zoomLabel]="viewerLabels().zoomLabel ?? 'Zoom in'"
142
150
  [zoomOutLabel]="viewerLabels().zoomOutLabel ?? 'Zoom out'"
143
- [errorLabel]="viewerLabels().errorLabel ?? 'Image could not be loaded'" />`, 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", ".gallery-stage { position: relative; width: 100%; min-width: 0; overflow: hidden; }\n.gallery-outgoing { position: absolute; top: 0; left: 0; }\n.gallery { width: 100%; min-width: 0; flex-direction: column; }\n.gallery-mosaic { flex-direction: row; align-items: flex-start; }\n.gallery-group { width: 100%; min-width: 0; flex-direction: row; align-items: flex-start; }\n.gallery-column { width: auto; flex: 1; flex-direction: column; }\n.gallery-item, .gallery-placeholder { min-width: 0; flex: 1; }\n.gallery-item { gap: 8px; }\n.mosaic-item { width: 100%; flex-grow: 0; flex-shrink: 0; flex-basis: auto; }\n.gallery-image { width: 100%; }\n"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Image, selector: "image", inputs: ["source", "src", "srcSet", "defaultSource", "loadingIndicatorSource", "resizeMode", "resizeMethod", "resizeMultiplier", "blurRadius", "capInsets", "tintColor", "fadeDuration", "progressiveRenderingEnabled", "alt", "crossOrigin", "referrerPolicy"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: NeuImageViewerComponent, selector: "neu-image-viewer", inputs: ["open", "items", "index", "label", "closeLabel", "previousLabel", "nextLabel", "zoomLabel", "zoomOutLabel", "errorLabel"], outputs: ["openChange", "indexChange", "closed", "opened", "dismissed"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
151
+ [errorLabel]="viewerLabels().errorLabel ?? 'Image could not be loaded'" />`, 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", ".gallery-stage { position: relative; width: 100%; min-width: 0; overflow: hidden; }\n.gallery-outgoing { position: absolute; top: 0; left: 0; }\n.gallery { width: 100%; min-width: 0; align-items: flex-start; }\n.gallery-group { width: 100%; min-width: 0; flex-direction: row; align-items: flex-start; }\n.gallery-item, .gallery-placeholder { min-width: 0; }\n.gallery-item { gap: 8px; }\n.gallery-image { width: 100%; }\n"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Image, selector: "image", inputs: ["source", "src", "srcSet", "defaultSource", "loadingIndicatorSource", "resizeMode", "resizeMethod", "resizeMultiplier", "blurRadius", "capInsets", "tintColor", "fadeDuration", "progressiveRenderingEnabled", "alt", "crossOrigin", "referrerPolicy"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: NeuImageViewerComponent, selector: "neu-image-viewer", inputs: ["open", "items", "index", "label", "closeLabel", "previousLabel", "nextLabel", "zoomLabel", "zoomOutLabel", "errorLabel"], outputs: ["openChange", "indexChange", "closed", "opened", "dismissed"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
144
152
  }
145
153
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuGalleryComponent, decorators: [{
146
154
  type: Component,
147
155
  args: [{ selector: 'neu-gallery', imports: [View, Text, Image, Pressable, NeuImageViewerComponent, AnimatedStyle, NgTemplateOutlet], template: `<view class="gallery-stage" [accessibilityLabel]="label()" (layout)="measure($event)">
148
156
  @for (layer of layers(); track layer.outgoing) {
149
- <view class="gallery" [class.gallery-outgoing]="layer.outgoing" [class.gallery-mosaic]="layer.scene.layout === 'mosaic'"
157
+ <view class="gallery" [class.gallery-outgoing]="layer.outgoing"
158
+ [style.flexDirection]="layer.scene.layout === 'mosaic' ? 'row' : 'column'"
150
159
  [style.gap]="layer.scene.gap" [animatedStyle]="layer.outgoing ? motion.settledStyle : motion.incomingStyle"
151
160
  [pointerEvents]="layer.outgoing ? 'none' : 'auto'" [accessibilityElementsHidden]="layer.outgoing"
152
161
  [importantForAccessibility]="layer.outgoing ? 'no-hide-descendants' : 'auto'">
153
162
  @for (group of layer.scene.groups; track $index) {
154
- <view class="gallery-group" [class.gallery-column]="layer.scene.layout === 'mosaic'" [style.gap]="layer.scene.gap">
163
+ <view class="gallery-group" [style.gap]="layer.scene.gap"
164
+ [style.flexDirection]="layer.scene.layout === 'mosaic' ? 'column' : 'row'"
165
+ [style.width]="layer.scene.layout === 'mosaic' ? layer.scene.columnWidth : '100%'"
166
+ [style.flexGrow]="0" [style.flexShrink]="0" [style.flexBasis]="'auto'">
155
167
  @for (tile of group; track tile ? tile.item.id : $index) {
156
168
  @if (tile) {
157
169
  <pressable
158
170
  class="gallery-item"
159
- [class.mosaic-item]="layer.scene.layout === 'mosaic'"
171
+ [style.width]="layer.scene.layout === 'mosaic' ? '100%' : layer.scene.columnWidth"
172
+ [style.flexGrow]="0" [style.flexShrink]="0" [style.flexBasis]="'auto'"
160
173
  accessibilityRole="button"
161
174
  [accessibilityLabel]="tile.item.label"
162
175
  (press)="show(tile.index)"
@@ -176,7 +189,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
176
189
  } @else { <text class="muted" [numberOfLines]="2">{{ tile.item.label }}</text> }
177
190
  }</pressable
178
191
  >
179
- } @else { <view class="gallery-placeholder" /> }
192
+ } @else { <view class="gallery-placeholder" [style.width]="layer.scene.columnWidth" /> }
180
193
  }
181
194
  </view>
182
195
  } @empty {
@@ -190,6 +203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
190
203
  [nextLabel]="viewerLabels().nextLabel ?? 'Next image'"
191
204
  [zoomLabel]="viewerLabels().zoomLabel ?? 'Zoom in'"
192
205
  [zoomOutLabel]="viewerLabels().zoomOutLabel ?? 'Zoom out'"
193
- [errorLabel]="viewerLabels().errorLabel ?? 'Image could not be loaded'" />`, 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", ".gallery-stage { position: relative; width: 100%; min-width: 0; overflow: hidden; }\n.gallery-outgoing { position: absolute; top: 0; left: 0; }\n.gallery { width: 100%; min-width: 0; flex-direction: column; }\n.gallery-mosaic { flex-direction: row; align-items: flex-start; }\n.gallery-group { width: 100%; min-width: 0; flex-direction: row; align-items: flex-start; }\n.gallery-column { width: auto; flex: 1; flex-direction: column; }\n.gallery-item, .gallery-placeholder { min-width: 0; flex: 1; }\n.gallery-item { gap: 8px; }\n.mosaic-item { width: 100%; flex-grow: 0; flex-shrink: 0; flex-basis: auto; }\n.gallery-image { width: 100%; }\n"] }]
206
+ [errorLabel]="viewerLabels().errorLabel ?? 'Image could not be loaded'" />`, 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", ".gallery-stage { position: relative; width: 100%; min-width: 0; overflow: hidden; }\n.gallery-outgoing { position: absolute; top: 0; left: 0; }\n.gallery { width: 100%; min-width: 0; align-items: flex-start; }\n.gallery-group { width: 100%; min-width: 0; flex-direction: row; align-items: flex-start; }\n.gallery-item, .gallery-placeholder { min-width: 0; }\n.gallery-item { gap: 8px; }\n.gallery-image { width: 100%; }\n"] }]
194
207
  }], propDecorators: { itemContent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuGalleryItemDirective), { isSignal: true }] }], captionContent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuGalleryCaptionDirective), { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], viewerLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewerLabels", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], emptyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyLabel", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], aspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "aspectRatio", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], showCaptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCaptions", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }, { type: i0.Output, args: ["indexChange"] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] } });
195
208
  //# sourceMappingURL=gallery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../src/gallery/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAoB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;;AAuE7F,MAAM,OAAO,mBAAmB;IACX,WAAW,GAAG,YAAY,CAAC,uBAAuB;oFAAC,CAAC;IACpD,cAAc,GAAG,YAAY,CAAC,0BAA0B;uFAAC,CAAC;IACpE,KAAK,GAAG,KAAK,CAAC,SAAS;8EAAC,CAAC;IACzB,YAAY,GAAG,KAAK,CAAyB,EAAE;qFAAC,CAAC;IACjD,KAAK,GAAG,KAAK,CAA0B,EAAE;8EAAC,CAAC;IAC3C,UAAU,GAAG,KAAK,CAAC,WAAW;mFAAC,CAAC;IAChC,MAAM,GAAG,KAAK,CAAmB,MAAM;+EAAC,CAAC;IACzC,OAAO,GAAG,KAAK,CAAC,CAAC;gFAAC,CAAC;IACnB,GAAG,GAAG,KAAK,CAAC,EAAE;4EAAC,CAAC;IAChB,WAAW,GAAG,KAAK,CAAC,CAAC;oFAAC,CAAC;IACvB,YAAY,GAAG,KAAK,CAAC,EAAE;q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFA8CqE;gGAIjC,uBAAuB,gGACpB,0BAA0B","sourcesContent":["import {\n Component,\n contentChild,\n booleanAttribute,\n computed,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { View, Text, Image, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuCrossfade } from '../foundation/motion.js';\nimport { NeuImageItem } from '../foundation/mobile.js';\nimport { NeuImageViewerComponent } from '../image-viewer/image-viewer.js';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NeuGalleryItemDirective, NeuGalleryCaptionDirective } from './gallery-templates.js';\n\nexport type NeuGalleryLayout = 'grid' | 'mosaic';\n/** Consumer-owned copy for the full-screen viewer opened by Gallery. */\nexport interface NeuGalleryViewerLabels {\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}\ntype GalleryTile = { item: NeuImageItem; index: number };\ntype GalleryScene = {\n groups: (GalleryTile | null)[][]; layout: NeuGalleryLayout;\n gap: number; radius: number; ratio: number; captions: boolean;\n};\n\n@Component({\n selector: 'neu-gallery',\n imports: [View, Text, Image, Pressable, NeuImageViewerComponent, AnimatedStyle, NgTemplateOutlet],\n template: `<view class=\"gallery-stage\" [accessibilityLabel]=\"label()\" (layout)=\"measure($event)\">\n @for (layer of layers(); track layer.outgoing) {\n <view class=\"gallery\" [class.gallery-outgoing]=\"layer.outgoing\" [class.gallery-mosaic]=\"layer.scene.layout === 'mosaic'\"\n [style.gap]=\"layer.scene.gap\" [animatedStyle]=\"layer.outgoing ? motion.settledStyle : motion.incomingStyle\"\n [pointerEvents]=\"layer.outgoing ? 'none' : 'auto'\" [accessibilityElementsHidden]=\"layer.outgoing\"\n [importantForAccessibility]=\"layer.outgoing ? 'no-hide-descendants' : 'auto'\">\n @for (group of layer.scene.groups; track $index) {\n <view class=\"gallery-group\" [class.gallery-column]=\"layer.scene.layout === 'mosaic'\" [style.gap]=\"layer.scene.gap\">\n @for (tile of group; track tile ? tile.item.id : $index) {\n @if (tile) {\n <pressable\n class=\"gallery-item\"\n [class.mosaic-item]=\"layer.scene.layout === 'mosaic'\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"tile.item.label\"\n (press)=\"show(tile.index)\"\n >@if (itemContent(); as customItem) {\n <ng-container [ngTemplateOutlet]=\"customItem.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: tile.item, index: tile.index, aspectRatio: tileRatio(tile.index, layer.scene), borderRadius: layer.scene.radius }\" />\n } @else { <image\n class=\"gallery-image\"\n [style.aspectRatio]=\"tileRatio(tile.index, layer.scene)\"\n [style.borderRadius]=\"layer.scene.radius\"\n [source]=\"{ uri: tile.item.uri }\"\n resizeMode=\"cover\"\n [alt]=\"tile.item.label\"\n /> }\n @if (layer.scene.captions) {\n @if (captionContent(); as customCaption) {\n <ng-container [ngTemplateOutlet]=\"customCaption.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: tile.item, index: tile.index, aspectRatio: tileRatio(tile.index, layer.scene), borderRadius: layer.scene.radius }\" />\n } @else { <text class=\"muted\" [numberOfLines]=\"2\">{{ tile.item.label }}</text> }\n }</pressable\n >\n } @else { <view class=\"gallery-placeholder\" /> }\n }\n </view>\n } @empty {\n <text class=\"muted\">{{ emptyLabel() }}</text>\n }</view>\n }</view\n ><neu-image-viewer [items]=\"items()\" [(index)]=\"index\" [(open)]=\"open\"\n [label]=\"viewerLabels().label ?? label()\"\n [closeLabel]=\"viewerLabels().closeLabel ?? 'Close viewer'\"\n [previousLabel]=\"viewerLabels().previousLabel ?? 'Previous image'\"\n [nextLabel]=\"viewerLabels().nextLabel ?? 'Next image'\"\n [zoomLabel]=\"viewerLabels().zoomLabel ?? 'Zoom in'\"\n [zoomOutLabel]=\"viewerLabels().zoomOutLabel ?? 'Zoom out'\"\n [errorLabel]=\"viewerLabels().errorLabel ?? 'Image could not be loaded'\" />`,\n styleUrls: ['../foundation/mobile.css', './gallery.css'],\n})\nexport class NeuGalleryComponent {\n protected readonly itemContent = contentChild(NeuGalleryItemDirective);\n protected readonly captionContent = contentChild(NeuGalleryCaptionDirective);\n readonly label = input('Gallery');\n readonly viewerLabels = input<NeuGalleryViewerLabels>({});\n readonly items = input<readonly NeuImageItem[]>([]);\n readonly emptyLabel = input('No images');\n readonly layout = input<NeuGalleryLayout>('grid');\n readonly columns = input(2);\n readonly gap = input(10);\n readonly aspectRatio = input(1);\n readonly borderRadius = input(12);\n readonly showCaptions = input(true, { transform: booleanAttribute });\n readonly index = model(0);\n readonly open = model(false);\n private readonly measuredWidth = signal(0);\n protected readonly resolvedGap = computed(() => this.bounded(this.gap(), 10, 0, 48));\n protected readonly resolvedRadius = computed(() => this.bounded(this.borderRadius(), 12, 0, 1000));\n private readonly resolvedColumns = computed(() => {\n const requested = Math.floor(this.bounded(this.columns(), 2, 1, 4));\n const width = this.measuredWidth(), gap = this.resolvedGap();\n return width > 0 ? Math.max(1, Math.min(requested, Math.floor((width + gap) / (48 + gap)))) : requested;\n });\n protected readonly groups = computed(() => {\n const tiles = this.items().map((item, index) => ({ item, index }));\n const columns = this.resolvedColumns();\n if (!tiles.length) return [];\n if (this.layout() === 'mosaic') {\n return Array.from({ length: Math.min(columns, tiles.length) }, (_, column) => tiles.filter((_, index) => index % columns === column));\n }\n const rows: (GalleryTile | null)[][] = [];\n for (let start = 0; start < tiles.length; start += columns) {\n rows.push(Array.from({ length: columns }, (_, offset) => tiles[start + offset] ?? null));\n }\n return rows;\n });\n protected readonly scene = computed<GalleryScene>(() => ({\n groups: this.groups(), layout: this.layout(), gap: this.resolvedGap(),\n radius: this.resolvedRadius(), ratio: this.bounded(this.aspectRatio(), 1, 0.25, 4), captions: this.showCaptions(),\n }));\n protected readonly motion = neuCrossfade(this.scene, signal(true), (a, b) =>\n a.groups === b.groups && a.layout === b.layout && a.gap === b.gap && a.radius === b.radius && a.ratio === b.ratio && a.captions === b.captions);\n protected readonly layers = computed(() => {\n const previous = this.motion.outgoing();\n return [\n ...(previous ? [{ scene: previous, outgoing: true }] : []),\n { scene: this.scene(), outgoing: false },\n ];\n });\n protected tileRatio(index: number, scene: GalleryScene): number {\n return scene.layout === 'mosaic' ? scene.ratio / (index % 3 === 0 ? 1.5 : index % 3 === 1 ? 1 : 0.8) : scene.ratio;\n }\n protected measure(event: LayoutEvent): void {\n const width = event.nativeEvent.layout.width;\n if (Number.isFinite(width) && width >= 0) this.measuredWidth.set(width);\n }\n private bounded(value: number, fallback: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, Number.isFinite(value) ? value : fallback));\n }\n protected show(index: number): void {\n if (index >= 0 && index < this.items().length) {\n this.index.set(index);\n this.open.set(true);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../src/gallery/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAoB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;;AA4E7F,MAAM,OAAO,mBAAmB;IACX,WAAW,GAAG,YAAY,CAAC,uBAAuB;oFAAC,CAAC;I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AQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjF,CAAC;IACS,IAAI,CAAC,KAAa;QAC1B,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;uGAnEU,mBAAmB;2FAAnB,mBAAmB,mrDACgB,uBAAuB,iGACpB,0BAA0B,gEAxDjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAmDqE,ykJApDrE,IAAI,iDAAE,IAAI,mYAAE,KAAK,mTAAE,SAAS,mGAAE,uBAAuB,0QAAE,aAAa,4DAAE,gBAAgB;;2FAuDrF,mBAAmB;kBAzD/B,SAAS;+BACE,aAAa,WACd,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,aAAa,EAAE,gBAAgB,CAAC,YACvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAmDqE;gGAIjC,uBAAuB,gGACpB,0BAA0B","sourcesContent":["import {\n Component,\n contentChild,\n booleanAttribute,\n computed,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { View, Text, Image, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuCrossfade } from '../foundation/motion.js';\nimport { NeuImageItem } from '../foundation/mobile.js';\nimport { NeuImageViewerComponent } from '../image-viewer/image-viewer.js';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NeuGalleryItemDirective, NeuGalleryCaptionDirective } from './gallery-templates.js';\n\nexport type NeuGalleryLayout = 'grid' | 'mosaic';\n/** Consumer-owned copy for the full-screen viewer opened by Gallery. */\nexport interface NeuGalleryViewerLabels {\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}\ntype GalleryTile = { item: NeuImageItem; index: number };\ntype GalleryScene = {\n groups: (GalleryTile | null)[][]; layout: NeuGalleryLayout;\n gap: number; radius: number; ratio: number; captions: boolean; columnWidth: number;\n};\n\n@Component({\n selector: 'neu-gallery',\n imports: [View, Text, Image, Pressable, NeuImageViewerComponent, AnimatedStyle, NgTemplateOutlet],\n template: `<view class=\"gallery-stage\" [accessibilityLabel]=\"label()\" (layout)=\"measure($event)\">\n @for (layer of layers(); track layer.outgoing) {\n <view class=\"gallery\" [class.gallery-outgoing]=\"layer.outgoing\"\n [style.flexDirection]=\"layer.scene.layout === 'mosaic' ? 'row' : 'column'\"\n [style.gap]=\"layer.scene.gap\" [animatedStyle]=\"layer.outgoing ? motion.settledStyle : motion.incomingStyle\"\n [pointerEvents]=\"layer.outgoing ? 'none' : 'auto'\" [accessibilityElementsHidden]=\"layer.outgoing\"\n [importantForAccessibility]=\"layer.outgoing ? 'no-hide-descendants' : 'auto'\">\n @for (group of layer.scene.groups; track $index) {\n <view class=\"gallery-group\" [style.gap]=\"layer.scene.gap\"\n [style.flexDirection]=\"layer.scene.layout === 'mosaic' ? 'column' : 'row'\"\n [style.width]=\"layer.scene.layout === 'mosaic' ? layer.scene.columnWidth : '100%'\"\n [style.flexGrow]=\"0\" [style.flexShrink]=\"0\" [style.flexBasis]=\"'auto'\">\n @for (tile of group; track tile ? tile.item.id : $index) {\n @if (tile) {\n <pressable\n class=\"gallery-item\"\n [style.width]=\"layer.scene.layout === 'mosaic' ? '100%' : layer.scene.columnWidth\"\n [style.flexGrow]=\"0\" [style.flexShrink]=\"0\" [style.flexBasis]=\"'auto'\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"tile.item.label\"\n (press)=\"show(tile.index)\"\n >@if (itemContent(); as customItem) {\n <ng-container [ngTemplateOutlet]=\"customItem.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: tile.item, index: tile.index, aspectRatio: tileRatio(tile.index, layer.scene), borderRadius: layer.scene.radius }\" />\n } @else { <image\n class=\"gallery-image\"\n [style.aspectRatio]=\"tileRatio(tile.index, layer.scene)\"\n [style.borderRadius]=\"layer.scene.radius\"\n [source]=\"{ uri: tile.item.uri }\"\n resizeMode=\"cover\"\n [alt]=\"tile.item.label\"\n /> }\n @if (layer.scene.captions) {\n @if (captionContent(); as customCaption) {\n <ng-container [ngTemplateOutlet]=\"customCaption.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: tile.item, index: tile.index, aspectRatio: tileRatio(tile.index, layer.scene), borderRadius: layer.scene.radius }\" />\n } @else { <text class=\"muted\" [numberOfLines]=\"2\">{{ tile.item.label }}</text> }\n }</pressable\n >\n } @else { <view class=\"gallery-placeholder\" [style.width]=\"layer.scene.columnWidth\" /> }\n }\n </view>\n } @empty {\n <text class=\"muted\">{{ emptyLabel() }}</text>\n }</view>\n }</view\n ><neu-image-viewer [items]=\"items()\" [(index)]=\"index\" [(open)]=\"open\"\n [label]=\"viewerLabels().label ?? label()\"\n [closeLabel]=\"viewerLabels().closeLabel ?? 'Close viewer'\"\n [previousLabel]=\"viewerLabels().previousLabel ?? 'Previous image'\"\n [nextLabel]=\"viewerLabels().nextLabel ?? 'Next image'\"\n [zoomLabel]=\"viewerLabels().zoomLabel ?? 'Zoom in'\"\n [zoomOutLabel]=\"viewerLabels().zoomOutLabel ?? 'Zoom out'\"\n [errorLabel]=\"viewerLabels().errorLabel ?? 'Image could not be loaded'\" />`,\n styleUrls: ['../foundation/mobile.css', './gallery.css'],\n})\nexport class NeuGalleryComponent {\n protected readonly itemContent = contentChild(NeuGalleryItemDirective);\n protected readonly captionContent = contentChild(NeuGalleryCaptionDirective);\n readonly label = input('Gallery');\n readonly viewerLabels = input<NeuGalleryViewerLabels>({});\n readonly items = input<readonly NeuImageItem[]>([]);\n readonly emptyLabel = input('No images');\n readonly layout = input<NeuGalleryLayout>('grid');\n readonly columns = input(2);\n readonly gap = input(10);\n readonly aspectRatio = input(1);\n readonly borderRadius = input(12);\n readonly showCaptions = input(true, { transform: booleanAttribute });\n readonly index = model(0);\n readonly open = model(false);\n private readonly measuredWidth = signal(0);\n protected readonly resolvedGap = computed(() => this.bounded(this.gap(), 10, 0, 48));\n protected readonly resolvedRadius = computed(() => this.bounded(this.borderRadius(), 12, 0, 1000));\n private readonly resolvedColumns = computed(() => {\n const requested = Math.floor(this.bounded(this.columns(), 2, 1, 4));\n const width = this.measuredWidth(), gap = this.resolvedGap();\n return width > 0 ? Math.max(1, Math.min(requested, Math.floor((width + gap) / (48 + gap)))) : requested;\n });\n protected readonly groups = computed(() => {\n const tiles = this.items().map((item, index) => ({ item, index }));\n const columns = this.resolvedColumns();\n if (!tiles.length) return [];\n if (this.layout() === 'mosaic') {\n return Array.from({ length: Math.min(columns, tiles.length) }, (_, column) => tiles.filter((_, index) => index % columns === column));\n }\n const rows: (GalleryTile | null)[][] = [];\n for (let start = 0; start < tiles.length; start += columns) {\n rows.push(Array.from({ length: columns }, (_, offset) => tiles[start + offset] ?? null));\n }\n return rows;\n });\n protected readonly scene = computed<GalleryScene>(() => ({\n groups: this.groups(), layout: this.layout(), gap: this.resolvedGap(),\n radius: this.resolvedRadius(), ratio: this.bounded(this.aspectRatio(), 1, 0.25, 4), captions: this.showCaptions(),\n // Native image measurement can otherwise make a percentage-width image's\n // intrinsic width dominate its flex row and squeeze the adjacent tile.\n columnWidth: Math.max(0, (this.measuredWidth() - this.resolvedGap() * (this.resolvedColumns() - 1)) / this.resolvedColumns()),\n }));\n protected readonly motion = neuCrossfade(this.scene, signal(true), (a, b) =>\n a.groups === b.groups && a.layout === b.layout && a.gap === b.gap && a.radius === b.radius && a.ratio === b.ratio && a.captions === b.captions && a.columnWidth === b.columnWidth);\n protected readonly layers = computed(() => {\n const previous = this.motion.outgoing();\n return [\n ...(previous ? [{ scene: previous, outgoing: true }] : []),\n { scene: this.scene(), outgoing: false },\n ];\n });\n protected tileRatio(index: number, scene: GalleryScene): number {\n return scene.layout === 'mosaic' ? scene.ratio / (index % 3 === 0 ? 1.5 : index % 3 === 1 ? 1 : 0.8) : scene.ratio;\n }\n protected measure(event: LayoutEvent): void {\n const width = event.nativeEvent.layout.width;\n if (Number.isFinite(width) && width >= 0) this.measuredWidth.set(width);\n }\n private bounded(value: number, fallback: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, Number.isFinite(value) ? value : fallback));\n }\n protected show(index: number): void {\n if (index >= 0 && index < this.items().length) {\n this.index.set(index);\n this.open.set(true);\n }\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { InjectionToken, type EnvironmentProviders } from '@angular/core';
2
+ import { type NeuHapticsOptions, type NeuHapticImpact } from '../foundation/haptics.js';
3
+ export * from '../foundation/haptics.js';
4
+ export interface NeuNativeHaptics {
5
+ impactAsync(style: NeuHapticImpact): Promise<void>;
6
+ notificationAsync(type: 'success' | 'warning' | 'error'): Promise<void>;
7
+ selectionAsync(): Promise<void>;
8
+ }
9
+ /** The same optional native boundary used by Angular Native's Haptics service. */
10
+ export declare const NEU_NATIVE_HAPTICS: InjectionToken<NeuNativeHaptics | null>;
11
+ /** Import this optional entry point only after installing expo-haptics and rebuilding the app. */
12
+ export declare function provideNeuHaptics(options?: NeuHapticsOptions): EnvironmentProviders;
@@ -0,0 +1,36 @@
1
+ import { InjectionToken, inject, makeEnvironmentProviders } from '@angular/core';
2
+ import { requireOptionalNativeModule } from 'expo-modules-core';
3
+ import { NEU_HAPTICS_DRIVER, NEU_HAPTICS_OPTIONS, } from '../foundation/haptics.js';
4
+ export * from '../foundation/haptics.js';
5
+ /** The same optional native boundary used by Angular Native's Haptics service. */
6
+ export const NEU_NATIVE_HAPTICS = new InjectionToken('Neural native haptics module', {
7
+ providedIn: 'root',
8
+ factory: () => {
9
+ try {
10
+ return requireOptionalNativeModule('ExpoHaptics');
11
+ }
12
+ catch {
13
+ return null;
14
+ }
15
+ },
16
+ });
17
+ /** Import this optional entry point only after installing expo-haptics and rebuilding the app. */
18
+ export function provideNeuHaptics(options = {}) {
19
+ return makeEnvironmentProviders([
20
+ { provide: NEU_HAPTICS_OPTIONS, useValue: { ...options, enabled: options.enabled ?? true } },
21
+ { provide: NEU_HAPTICS_DRIVER, useFactory: () => {
22
+ const native = inject(NEU_NATIVE_HAPTICS);
23
+ return {
24
+ available: () => native !== null,
25
+ play: feedback => {
26
+ if (feedback === 'selection')
27
+ return native?.selectionAsync();
28
+ if (feedback === 'success' || feedback === 'warning' || feedback === 'error')
29
+ return native?.notificationAsync(feedback);
30
+ return native?.impactAsync(feedback);
31
+ },
32
+ };
33
+ } },
34
+ ]);
35
+ }
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/haptics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,wBAAwB,EAA6B,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAAE,mBAAmB,GAExC,MAAM,0BAA0B,CAAC;AAElC,cAAc,0BAA0B,CAAC;AAOzC,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAA0B,8BAA8B,EAAE;IAC5G,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,CAAC;YAAC,OAAO,2BAA2B,CAAmB,aAAa,CAAC,CAAC;QAAC,CAAC;QAC5E,MAAM,CAAC;YAAC,OAAO,IAAI,CAAC;QAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC;AAEH,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,UAA6B,EAAE;IAC/D,OAAO,wBAAwB,CAAC;QAC9B,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE,EAAE;QAC5F,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,GAAqB,EAAE;gBAChE,MAAM,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;gBAC1C,OAAO;oBACL,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,KAAK,IAAI;oBAChC,IAAI,EAAE,QAAQ,CAAC,EAAE;wBACf,IAAI,QAAQ,KAAK,WAAW;4BAAE,OAAO,MAAM,EAAE,cAAc,EAAE,CAAC;wBAC9D,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,OAAO;4BAAE,OAAO,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;wBACzH,OAAO,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;oBACvC,CAAC;iBACF,CAAC;YACJ,CAAC,EAAE;KACJ,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { InjectionToken, inject, makeEnvironmentProviders, type EnvironmentProviders } from '@angular/core';\nimport { requireOptionalNativeModule } from 'expo-modules-core';\nimport {\n NEU_HAPTICS_DRIVER, NEU_HAPTICS_OPTIONS,\n type NeuHapticsDriver, type NeuHapticsOptions, type NeuHapticImpact,\n} from '../foundation/haptics.js';\n\nexport * from '../foundation/haptics.js';\n\nexport interface NeuNativeHaptics {\n impactAsync(style: NeuHapticImpact): Promise<void>;\n notificationAsync(type: 'success' | 'warning' | 'error'): Promise<void>;\n selectionAsync(): Promise<void>;\n}\n/** The same optional native boundary used by Angular Native's Haptics service. */\nexport const NEU_NATIVE_HAPTICS = new InjectionToken<NeuNativeHaptics | null>('Neural native haptics module', {\n providedIn: 'root',\n factory: () => {\n try { return requireOptionalNativeModule<NeuNativeHaptics>('ExpoHaptics'); }\n catch { return null; }\n },\n});\n\n/** Import this optional entry point only after installing expo-haptics and rebuilding the app. */\nexport function provideNeuHaptics(options: NeuHapticsOptions = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: NEU_HAPTICS_OPTIONS, useValue: { ...options, enabled: options.enabled ?? true } },\n { provide: NEU_HAPTICS_DRIVER, useFactory: (): NeuHapticsDriver => {\n const native = inject(NEU_NATIVE_HAPTICS);\n return {\n available: () => native !== null,\n play: feedback => {\n if (feedback === 'selection') return native?.selectionAsync();\n if (feedback === 'success' || feedback === 'warning' || feedback === 'error') return native?.notificationAsync(feedback);\n return native?.impactAsync(feedback);\n },\n };\n } },\n ]);\n}\n"]}
@@ -1,7 +1,9 @@
1
1
  import { type PressEvent } from '@ng-native/components';
2
2
  import { type NeuVariant, type NeuTone } from '../foundation/index.js';
3
+ import type { NeuHapticFeedback } from '../foundation/haptics.js';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class NeuIconButtonComponent {
6
+ readonly haptic: import("@angular/core").InputSignal<false | NeuHapticFeedback>;
5
7
  readonly label: import("@angular/core").InputSignal<string>;
6
8
  readonly svg: import("@angular/core").InputSignal<string>;
7
9
  readonly variant: import("@angular/core").InputSignal<NeuVariant>;
@@ -21,5 +23,5 @@ export declare class NeuIconButtonComponent {
21
23
  protected readonly color: import("@angular/core").Signal<string>;
22
24
  protected activate(event: PressEvent): void;
23
25
  static ɵfac: i0.ɵɵFactoryDeclaration<NeuIconButtonComponent, never>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<NeuIconButtonComponent, "neu-icon-button", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "svg": { "alias": "svg"; "required": true; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, { "pressed": "pressed"; }, never, never, true, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<NeuIconButtonComponent, "neu-icon-button", never, { "haptic": { "alias": "haptic"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "svg": { "alias": "svg"; "required": true; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, { "pressed": "pressed"; }, never, never, true, never>;
25
27
  }
@@ -6,6 +6,8 @@ import { NEU_LIGHT_TOKENS, NEU_THEME, } from '../foundation/index.js';
6
6
  import { neuTonePalette } from '../foundation/tone.js';
7
7
  import * as i0 from "@angular/core";
8
8
  export class NeuIconButtonComponent {
9
+ haptic = input('press', /* @ts-ignore */
10
+ ...(ngDevMode ? [{ debugName: "haptic" }] : /* istanbul ignore next */ []));
9
11
  label = input.required(/* @ts-ignore */
10
12
  ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
11
13
  svg = input.required(/* @ts-ignore */
@@ -33,7 +35,7 @@ export class NeuIconButtonComponent {
33
35
  this.pressed.emit(event);
34
36
  }
35
37
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
36
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuIconButtonComponent, isStandalone: true, selector: "neu-icon-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, svg: { classPropertyName: "svg", publicName: "svg", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { properties: { "style.opacity": "unavailable() ? 0.45 : held() ? 0.8 : 1" } }, ngImport: i0, template: `
38
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuIconButtonComponent, isStandalone: true, selector: "neu-icon-button", inputs: { haptic: { classPropertyName: "haptic", publicName: "haptic", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, svg: { classPropertyName: "svg", publicName: "svg", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { properties: { "style.opacity": "unavailable() ? 0.45 : held() ? 0.8 : 1" } }, ngImport: i0, template: `
37
39
  <pressable
38
40
  [class]="'control ' + variant()"
39
41
  accessibilityRole="button"
@@ -42,6 +44,7 @@ export class NeuIconButtonComponent {
42
44
  [aria-disabled]="unavailable()"
43
45
  [aria-busy]="loading()"
44
46
  [disabled]="unavailable()"
47
+ [haptic]="haptic()"
45
48
  [style.backgroundColor]="variant() === 'solid' ? palette().color : variant() === 'tonal' ? palette().tonal : 'transparent'"
46
49
  [style.borderColor]="variant() === 'outline' ? palette().color : 'transparent'"
47
50
  (pressIn)="held.set(true)"
@@ -54,7 +57,7 @@ export class NeuIconButtonComponent {
54
57
  <ng-icon [svg]="svg()" [size]="24" [color]="color()" />
55
58
  }
56
59
  </pressable>
57
- `, 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", 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"] }] });
58
61
  }
59
62
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuIconButtonComponent, decorators: [{
60
63
  type: Component,
@@ -67,6 +70,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
67
70
  [aria-disabled]="unavailable()"
68
71
  [aria-busy]="loading()"
69
72
  [disabled]="unavailable()"
73
+ [haptic]="haptic()"
70
74
  [style.backgroundColor]="variant() === 'solid' ? palette().color : variant() === 'tonal' ? palette().tonal : 'transparent'"
71
75
  [style.borderColor]="variant() === 'outline' ? palette().color : 'transparent'"
72
76
  (pressIn)="held.set(true)"
@@ -80,5 +84,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
80
84
  }
81
85
  </pressable>
82
86
  `, 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 "] }]
83
- }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], svg: [{ type: i0.Input, args: [{ isSignal: true, alias: "svg", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
87
+ }], propDecorators: { haptic: [{ type: i0.Input, args: [{ isSignal: true, alias: "haptic", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], svg: [{ type: i0.Input, args: [{ isSignal: true, alias: "svg", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
84
88
  //# sourceMappingURL=icon-button.js.map