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

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 (122) 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.js +1 -1
  28. package/dist/data-view/data-view.js.map +1 -1
  29. package/dist/date-input/date-input.js +1 -1
  30. package/dist/date-input/date-input.js.map +1 -1
  31. package/dist/empty-state/empty-state.js +1 -1
  32. package/dist/filter-bar/filter-bar.js +1 -1
  33. package/dist/foundation/anchored-overlay.js +1 -1
  34. package/dist/foundation/anchored-overlay.js.map +1 -1
  35. package/dist/foundation/haptics.d.ts +30 -0
  36. package/dist/foundation/haptics.js +53 -0
  37. package/dist/foundation/haptics.js.map +1 -0
  38. package/dist/foundation/index.d.ts +1 -0
  39. package/dist/foundation/index.js +1 -0
  40. package/dist/foundation/index.js.map +1 -1
  41. package/dist/foundation/native-pressable.d.ts +5 -1
  42. package/dist/foundation/native-pressable.js +13 -3
  43. package/dist/foundation/native-pressable.js.map +1 -1
  44. package/dist/gallery/gallery.d.ts +1 -0
  45. package/dist/gallery/gallery.js +24 -11
  46. package/dist/gallery/gallery.js.map +1 -1
  47. package/dist/haptics/index.d.ts +12 -0
  48. package/dist/haptics/index.js +36 -0
  49. package/dist/haptics/index.js.map +1 -0
  50. package/dist/icon-button/icon-button.d.ts +3 -1
  51. package/dist/icon-button/icon-button.js +7 -3
  52. package/dist/icon-button/icon-button.js.map +1 -1
  53. package/dist/image-viewer/image-viewer.js +1 -1
  54. package/dist/image-viewer/image-viewer.js.map +1 -1
  55. package/dist/inline-editor/inline-editor.js +1 -1
  56. package/dist/inline-editor/inline-editor.js.map +1 -1
  57. package/dist/input-mask/input-mask.d.ts +2 -0
  58. package/dist/input-mask/input-mask.js +7 -1
  59. package/dist/input-mask/input-mask.js.map +1 -1
  60. package/dist/input-otp/input-otp.js +1 -1
  61. package/dist/input-otp/input-otp.js.map +1 -1
  62. package/dist/input-tags/input-tags.d.ts +2 -0
  63. package/dist/input-tags/input-tags.js +8 -3
  64. package/dist/input-tags/input-tags.js.map +1 -1
  65. package/dist/listbox/listbox.js +1 -1
  66. package/dist/listbox/listbox.js.map +1 -1
  67. package/dist/menu/menu.js +1 -1
  68. package/dist/menu/menu.js.map +1 -1
  69. package/dist/modal/modal.js +1 -1
  70. package/dist/modal/modal.js.map +1 -1
  71. package/dist/nav/nav.js +1 -1
  72. package/dist/nav/nav.js.map +1 -1
  73. package/dist/notification-center/notification-center.js +1 -1
  74. package/dist/notification-center/notification-center.js.map +1 -1
  75. package/dist/number-input/number-input.js +1 -1
  76. package/dist/number-input/number-input.js.map +1 -1
  77. package/dist/panel/panel.js +1 -1
  78. package/dist/panel/panel.js.map +1 -1
  79. package/dist/password/password.js +1 -1
  80. package/dist/pick-list/pick-list.js +1 -1
  81. package/dist/pick-list/pick-list.js.map +1 -1
  82. package/dist/popover/popover.js +1 -1
  83. package/dist/popover/popover.js.map +1 -1
  84. package/dist/radio/radio.d.ts +4 -1
  85. package/dist/radio/radio.js +13 -4
  86. package/dist/radio/radio.js.map +1 -1
  87. package/dist/rating/rating.js +1 -1
  88. package/dist/rating/rating.js.map +1 -1
  89. package/dist/select/select.js +1 -1
  90. package/dist/select/select.js.map +1 -1
  91. package/dist/sidebar/sidebar.js +1 -1
  92. package/dist/sidebar/sidebar.js.map +1 -1
  93. package/dist/slider/slider.d.ts +4 -1
  94. package/dist/slider/slider.js +12 -3
  95. package/dist/slider/slider.js.map +1 -1
  96. package/dist/speed-dial/speed-dial.js +1 -1
  97. package/dist/speed-dial/speed-dial.js.map +1 -1
  98. package/dist/spinner/spinner.js +1 -1
  99. package/dist/spinner/spinner.js.map +1 -1
  100. package/dist/stepper/stepper.js +1 -1
  101. package/dist/stepper/stepper.js.map +1 -1
  102. package/dist/switch/switch.d.ts +4 -1
  103. package/dist/switch/switch.js +10 -4
  104. package/dist/switch/switch.js.map +1 -1
  105. package/dist/tabs/tabs.js +1 -1
  106. package/dist/tabs/tabs.js.map +1 -1
  107. package/dist/toast/toast.js +1 -1
  108. package/dist/toast/toast.js.map +1 -1
  109. package/dist/toggle-button-group/toggle-button-group.js +1 -1
  110. package/dist/toggle-button-group/toggle-button-group.js.map +1 -1
  111. package/dist/toolbar/toolbar.js +1 -1
  112. package/dist/toolbar/toolbar.js.map +1 -1
  113. package/dist/tree/tree.js +1 -1
  114. package/dist/tree/tree.js.map +1 -1
  115. package/dist/tree-select/tree-select.js +1 -1
  116. package/dist/tree-select/tree-select.js.map +1 -1
  117. package/dist/uploader/uploader.d.ts +1 -1
  118. package/dist/uploader/uploader.js +1 -1
  119. package/dist/uploader/uploader.js.map +1 -1
  120. package/dist/virtual-list/virtual-list.js +1 -1
  121. package/dist/virtual-list/virtual-list.js.map +1 -1
  122. package/package.json +22 -6
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../src/stepper/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAa,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;;AA0CnD,MAAM,OAAO,mBAAmB;IACrB,KAAK,GAAG,KAAK,CAAuB,EAAE;8EAAC,CAAC;IACxC,UAAU,GAAG,KAAK,CAAC,CAAC;mFAAC,CAAC;IACtB,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACvD,SAAS,GAAG,KAAK,CAAoB,EAAE;kFAAC,CAAC;IACzC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,aAAa,GAAG,KAAK,CAAC,UAAU;sFAAC,CAAC;IAClC,SAAS,GAAG,KAAK,CAAC,MAAM;kFAAC,CAAC;IAC1B,WAAW,GAAG,KAAK,CAAC,QAAQ;oFAAC,CAAC;IAC9B,QAAQ,GAAG,MAAM,EAAQ,CAAC;IAChB,SAAS,GAAG,SAAS,CAAC;IACtB,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,KAAK,CACR,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CA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CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IACS,IAAI;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAAE,OAAO;QAC/B,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;;YAChE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;uGA9CU,mBAAmB;2FAAnB,mBAAmB,mrCArCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCD,ssKAnCC,IAAI,iDAAE,IAAI,mYAAE,SAAS,+EAAE,MAAM,mIAAE,kBAAkB;;2FAsChD,mBAAmB;kBAxC/B,SAAS;+BACE,aAAa,WACd,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,CAAC,YAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCD","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n model,\n output,\n computed,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption, clamp } from '../foundation/mobile.js';\nimport { NeuButtonComponent } from '../button/button.js';\nimport { NgIcon } from '@ng-native/icons';\nimport { NEU_CHECK } from '../foundation/icons.js';\n\n@Component({\n selector: 'neu-stepper',\n imports: [View, Text, Pressable, NgIcon, NeuButtonComponent],\n template: `<view class=\"stack\"\n ><view class=\"stepper-header\">\n @for (step of steps(); track step.id; let i = $index; let last = $last) {\n <view class=\"stepper-item\">\n @if (!last) { <view class=\"stepper-connector\" [class.stepper-connector-complete]=\"completed().includes(step.id)\" /> }\n <pressable\n class=\"stepper-action\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"step.label\"\n [accessibilityState]=\"{\n selected: current() === i,\n disabled: !canGo(i),\n }\"\n [disabled]=\"!canGo(i)\"\n (press)=\"goTo(i)\"\n >\n <view class=\"stepper-circle\" [class.stepper-current]=\"current() === i\" [class.stepper-complete]=\"completed().includes(step.id)\">\n @if (completed().includes(step.id)) { <ng-icon [svg]=\"checkIcon\" [size]=\"18\" color=\"var(--neu-on-accent, #ffffff)\" /> }\n @else { <text [class]=\"current() === i ? 'selected-text' : 'muted'\">{{ i + 1 }}</text> }\n </view>\n <text class=\"stepper-label\" [class.stepper-active-label]=\"current() === i\">{{ step.label }}</text>\n </pressable\n >\n </view>\n }</view\n ><ng-content /><view class=\"row\"\n ><neu-button\n [label]=\"previousLabel()\"\n variant=\"outline\"\n [disabled]=\"disabled() || current() <= 0\"\n (pressed)=\"goTo(current() - 1)\" /><neu-button\n [label]=\"current() === steps().length - 1 ? finishLabel() : nextLabel()\"\n [disabled]=\"!canAdvance()\"\n (pressed)=\"next()\" /></view\n ></view>`,\n styleUrls: ['../foundation/mobile.css', './stepper.css'],\n})\nexport class NeuStepperComponent {\n readonly steps = input<readonly NeuOption[]>([]);\n readonly activeStep = model(0);\n readonly linear = input(false, { transform: booleanAttribute });\n readonly completed = input<readonly string[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly previousLabel = input('Previous');\n readonly nextLabel = input('Next');\n readonly finishLabel = input('Finish');\n readonly finished = output<void>();\n protected readonly checkIcon = NEU_CHECK;\n protected readonly current = computed(() =>\n Math.floor(\n clamp(this.activeStep(), 0, Math.max(0, this.steps().length - 1)),\n ),\n );\n protected canGo(index: number): boolean {\n return (\n !this.disabled() &&\n index >= 0 &&\n index < this.steps().length &&\n !this.steps()[index]?.disabled &&\n (!this.linear() ||\n index <= this.current() ||\n this.steps()\n .slice(0, index)\n .every((x) => this.completed().includes(x.id)))\n );\n }\n protected canAdvance(): boolean {\n return (\n !this.disabled() &&\n this.steps().length > 0 &&\n (!this.linear() ||\n this.completed().includes(this.steps()[this.current()]!.id)) &&\n (this.current() === this.steps().length - 1 ||\n this.canGo(this.current() + 1))\n );\n }\n goTo(index: number): void {\n if (this.canGo(index)) this.activeStep.set(index);\n }\n protected next(): void {\n if (!this.canAdvance()) return;\n if (this.current() === this.steps().length - 1) this.finished.emit();\n else this.goTo(this.current() + 1);\n }\n}\n"]}
1
+ {"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../src/stepper/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAa,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;;AA0CnD,MAAM,OAAO,mBAAmB;IACrB,KAAK,GAAG,KAAK,CAAuB,EAAE;8EAAC,CAAC;IACxC,UAAU,GAAG,KAAK,CAAC,CAAC;mFAAC,CAAC;IACtB,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACvD,SAAS,GAAG,KAAK,CAAoB,EAAE;kFAAC,CAAC;IACzC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,aAAa,GAAG,KAAK,CAAC,UAAU;sFAAC,CAAC;IAClC,SAAS,GAAG,KAAK,CAAC,MAAM;kFAAC,CAAC;IAC1B,WAAW,GAAG,KAAK,CAAC,QAAQ;oFAAC,CAAC;IAC9B,QAAQ,GAAG,MAAM,EAAQ,CAAC;IAChB,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AG,CAAC,CAAC,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAAa;QAChB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IACS,IAAI;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAAE,OAAO;QAC/B,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;;YAChE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;uGA9CU,mBAAmB;2FAAnB,mBAAmB,mrCArCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCD,ssKAnCC,IAAI,iDAAE,IAAI,mYAAE,SAAS,mGAAE,MAAM,mIAAE,kBAAkB;;2FAsChD,mBAAmB;kBAxC/B,SAAS;+BACE,aAAa,WACd,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,CAAC,YAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCD","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n model,\n output,\n computed,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption, clamp } from '../foundation/mobile.js';\nimport { NeuButtonComponent } from '../button/button.js';\nimport { NgIcon } from '@ng-native/icons';\nimport { NEU_CHECK } from '../foundation/icons.js';\n\n@Component({\n selector: 'neu-stepper',\n imports: [View, Text, Pressable, NgIcon, NeuButtonComponent],\n template: `<view class=\"stack\"\n ><view class=\"stepper-header\">\n @for (step of steps(); track step.id; let i = $index; let last = $last) {\n <view class=\"stepper-item\">\n @if (!last) { <view class=\"stepper-connector\" [class.stepper-connector-complete]=\"completed().includes(step.id)\" /> }\n <pressable\n class=\"stepper-action\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"step.label\"\n [accessibilityState]=\"{\n selected: current() === i,\n disabled: !canGo(i),\n }\"\n [disabled]=\"!canGo(i)\"\n (press)=\"goTo(i)\"\n >\n <view class=\"stepper-circle\" [class.stepper-current]=\"current() === i\" [class.stepper-complete]=\"completed().includes(step.id)\">\n @if (completed().includes(step.id)) { <ng-icon [svg]=\"checkIcon\" [size]=\"18\" color=\"var(--neu-on-accent, #ffffff)\" /> }\n @else { <text [class]=\"current() === i ? 'selected-text' : 'muted'\">{{ i + 1 }}</text> }\n </view>\n <text class=\"stepper-label\" [class.stepper-active-label]=\"current() === i\">{{ step.label }}</text>\n </pressable\n >\n </view>\n }</view\n ><ng-content /><view class=\"row\"\n ><neu-button\n [label]=\"previousLabel()\"\n variant=\"outline\"\n [disabled]=\"disabled() || current() <= 0\"\n (pressed)=\"goTo(current() - 1)\" /><neu-button\n [label]=\"current() === steps().length - 1 ? finishLabel() : nextLabel()\"\n [disabled]=\"!canAdvance()\"\n (pressed)=\"next()\" /></view\n ></view>`,\n styleUrls: ['../foundation/mobile.css', './stepper.css'],\n})\nexport class NeuStepperComponent {\n readonly steps = input<readonly NeuOption[]>([]);\n readonly activeStep = model(0);\n readonly linear = input(false, { transform: booleanAttribute });\n readonly completed = input<readonly string[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly previousLabel = input('Previous');\n readonly nextLabel = input('Next');\n readonly finishLabel = input('Finish');\n readonly finished = output<void>();\n protected readonly checkIcon = NEU_CHECK;\n protected readonly current = computed(() =>\n Math.floor(\n clamp(this.activeStep(), 0, Math.max(0, this.steps().length - 1)),\n ),\n );\n protected canGo(index: number): boolean {\n return (\n !this.disabled() &&\n index >= 0 &&\n index < this.steps().length &&\n !this.steps()[index]?.disabled &&\n (!this.linear() ||\n index <= this.current() ||\n this.steps()\n .slice(0, index)\n .every((x) => this.completed().includes(x.id)))\n );\n }\n protected canAdvance(): boolean {\n return (\n !this.disabled() &&\n this.steps().length > 0 &&\n (!this.linear() ||\n this.completed().includes(this.steps()[this.current()]!.id)) &&\n (this.current() === this.steps().length - 1 ||\n this.canGo(this.current() + 1))\n );\n }\n goTo(index: number): void {\n if (this.canGo(index)) this.activeStep.set(index);\n }\n protected next(): void {\n if (!this.canAdvance()) return;\n if (this.current() === this.steps().length - 1) this.finished.emit();\n else this.goTo(this.current() + 1);\n }\n}\n"]}
@@ -1,6 +1,9 @@
1
+ import { type NeuHapticFeedback } from '../foundation/haptics.js';
1
2
  import { type NeuSize } from '../foundation/index.js';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class NeuSwitchComponent {
5
+ readonly haptic: import("@angular/core").InputSignal<false | NeuHapticFeedback>;
6
+ private readonly haptics;
4
7
  readonly label: import("@angular/core").InputSignal<string>;
5
8
  readonly labelPosition: import("@angular/core").InputSignal<"left" | "right">;
6
9
  readonly size: import("@angular/core").InputSignal<NeuSize>;
@@ -20,5 +23,5 @@ export declare class NeuSwitchComponent {
20
23
  false: string;
21
24
  }>;
22
25
  static ɵfac: i0.ɵɵFactoryDeclaration<NeuSwitchComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<NeuSwitchComponent, "neu-switch", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "touch": "touch"; }, never, never, true, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<NeuSwitchComponent, "neu-switch", never, { "haptic": { "alias": "haptic"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "touch": "touch"; }, never, never, true, never>;
24
27
  }
@@ -1,8 +1,12 @@
1
1
  import { Component, booleanAttribute, computed, inject, input, model, output, } from '@angular/core';
2
2
  import { Switch, Text, View } from '@ng-native/components';
3
+ import { NeuHaptics } from '../foundation/haptics.js';
3
4
  import { NEU_LIGHT_TOKENS, NEU_THEME, } from '../foundation/index.js';
4
5
  import * as i0 from "@angular/core";
5
6
  export class NeuSwitchComponent {
7
+ haptic = input('selection', /* @ts-ignore */
8
+ ...(ngDevMode ? [{ debugName: "haptic" }] : /* istanbul ignore next */ []));
9
+ haptics = inject(NeuHaptics);
6
10
  label = input.required(/* @ts-ignore */
7
11
  ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
8
12
  labelPosition = input('left', /* @ts-ignore */
@@ -21,8 +25,10 @@ export class NeuSwitchComponent {
21
25
  touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
22
26
  touch = output();
23
27
  acceptChange(value) {
24
- if (!this.disabled() && !this.readonly())
28
+ if (!this.disabled() && !this.readonly() && value !== this.checked()) {
25
29
  this.checked.set(value);
30
+ this.haptics.play(this.haptic());
31
+ }
26
32
  }
27
33
  markTouched() {
28
34
  if (!this.disabled() && !this.readonly())
@@ -37,7 +43,7 @@ export class NeuSwitchComponent {
37
43
  }, /* @ts-ignore */
38
44
  ...(ngDevMode ? [{ debugName: "trackColor" }] : /* istanbul ignore next */ []));
39
45
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
40
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuSwitchComponent, isStandalone: true, selector: "neu-switch", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touch: "touch" }, ngImport: i0, template: `
46
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuSwitchComponent, isStandalone: true, selector: "neu-switch", inputs: { haptic: { classPropertyName: "haptic", publicName: "haptic", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touch: "touch" }, ngImport: i0, template: `
41
47
  <view [class]="labelPosition() === 'right' ? 'row label-right' : 'row'">
42
48
  <view class="copy"
43
49
  ><text class="label">{{ label() }}</text>
@@ -64,7 +70,7 @@ export class NeuSwitchComponent {
64
70
  />
65
71
  </view>
66
72
  </view>
67
- `, isInline: true, styles: ["\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n "], dependencies: [{ kind: "directive", type: Switch, selector: "switch", inputs: ["checked", "disabled", "invalid", "touched", "thumbColor", "trackColor", "ios_backgroundColor"], outputs: ["checkedChange", "touch"] }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: View, selector: "view" }] });
73
+ `, isInline: true, styles: ["\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n "], dependencies: [{ kind: "directive", type: Switch, selector: "switch", inputs: ["checked", "controlSize", "disabled", "invalid", "touched", "thumbColor", "trackColor", "ios_backgroundColor"], outputs: ["checkedChange", "touch"] }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: View, selector: "view" }] });
68
74
  }
69
75
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuSwitchComponent, decorators: [{
70
76
  type: Component,
@@ -96,5 +102,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
96
102
  </view>
97
103
  </view>
98
104
  `, styles: ["\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n "] }]
99
- }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] } });
105
+ }], propDecorators: { haptic: [{ type: i0.Input, args: [{ isSignal: true, alias: "haptic", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] } });
100
106
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/switch/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;;AAsFhC,MAAM,OAAO,kBAAkB;IACpB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU,CAAC;IACjC,aAAa,GAAG,KAAK,CAAmB,MAAM;sFAAC,CAAC;IAChD,IAAI,GAAG,KAAK,CAAU,IAAI;6EAAC,CAAC;IAC5B,IAAI,GAAG,KAAK,CAAC,EAAE;6EAAC,CAAC;I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CAAC;uGAxBQ,kBAAkB;2FAAlB,kBAAkB,82CAjFnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT,+jCA5BS,MAAM,kMAAE,IAAI,mYAAE,IAAI;;2FAkFjB,kBAAkB;kBApF9B,SAAS;+BACE,YAAY,WACb,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,YACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport { Switch, Text, View } from '@ng-native/components';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuSize,\n} from '../foundation/index.js';\n\n@Component({\n selector: 'neu-switch',\n imports: [Switch, Text, View],\n template: `\n <view [class]=\"labelPosition() === 'right' ? 'row label-right' : 'row'\">\n <view class=\"copy\"\n ><text class=\"label\">{{ label() }}</text>\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else if (hint()) {\n <text class=\"hint\">{{ hint() }}</text>\n }\n </view>\n <view [class]=\"'toggle ' + size()\">\n <switch\n class=\"control\"\n [checked]=\"checked()\"\n (checkedChange)=\"acceptChange($event)\"\n [accessibilityLabel]=\"label()\"\n [accessibilityHint]=\"invalid() && error() ? error() : hint()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [disabled]=\"disabled() || readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n [trackColor]=\"trackColor()\"\n [hitSlop]=\"{ top: 10, bottom: 10, left: 8, right: 8 }\"\n (touch)=\"markTouched()\"\n />\n </view>\n </view>\n `,\n styles: `\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n `,\n})\nexport class NeuSwitchComponent {\n readonly label = input.required<string>();\n readonly labelPosition = input<'left' | 'right'>('left');\n readonly size = input<NeuSize>('md');\n readonly hint = input('');\n readonly error = input('');\n readonly checked = model(false);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touched = input(false, { transform: booleanAttribute });\n readonly touch = output<void>();\n protected acceptChange(value: boolean): void {\n if (!this.disabled() && !this.readonly()) this.checked.set(value);\n }\n protected markTouched(): void {\n if (!this.disabled() && !this.readonly()) this.touch.emit();\n }\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly trackColor = computed(() => {\n const t = this.theme?.() ?? NEU_LIGHT_TOKENS;\n return this.invalid()\n ? { true: t.danger, false: t.danger }\n : { true: t.accent, false: t.border };\n });\n}\n"]}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/switch/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAA0B,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;;AAsFhC,MAAM,O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B,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,UAAU,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,gBAAgB,CAAC;QAC7C,OAAO,IAAI,CAAC,OAAO,EAAE;YACnB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;YACrC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;mFAAC,CAAC;uGA7BQ,kBAAkB;2FAAlB,kBAAkB,y+CAjFnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT,+jCA5BS,MAAM,iNAAE,IAAI,mYAAE,IAAI;;2FAkFjB,kBAAkB;kBApF9B,SAAS;+BACE,YAAY,WACb,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,YACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT","sourcesContent":["import {\n Component,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport { Switch, Text, View } from '@ng-native/components';\nimport { NeuHaptics, type NeuHapticFeedback } from '../foundation/haptics.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuSize,\n} from '../foundation/index.js';\n\n@Component({\n selector: 'neu-switch',\n imports: [Switch, Text, View],\n template: `\n <view [class]=\"labelPosition() === 'right' ? 'row label-right' : 'row'\">\n <view class=\"copy\"\n ><text class=\"label\">{{ label() }}</text>\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else if (hint()) {\n <text class=\"hint\">{{ hint() }}</text>\n }\n </view>\n <view [class]=\"'toggle ' + size()\">\n <switch\n class=\"control\"\n [checked]=\"checked()\"\n (checkedChange)=\"acceptChange($event)\"\n [accessibilityLabel]=\"label()\"\n [accessibilityHint]=\"invalid() && error() ? error() : hint()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [disabled]=\"disabled() || readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n [trackColor]=\"trackColor()\"\n [hitSlop]=\"{ top: 10, bottom: 10, left: 8, right: 8 }\"\n (touch)=\"markTouched()\"\n />\n </view>\n </view>\n `,\n styles: `\n .row {\n min-height: 48px;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n }\n .copy {\n flex: 1;\n min-width: 0;\n gap: 4px;\n }\n .label-right {\n flex-direction: row-reverse;\n }\n .toggle {\n min-height: 48px;\n width: 64px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n .toggle.sm {\n width: 64px;\n }\n .toggle.lg {\n width: 72px;\n }\n .control {\n transform: scale(1);\n }\n .sm .control {\n transform: scale(0.85);\n }\n .lg .control {\n transform: scale(1.15);\n }\n .error {\n font-size: 13px;\n color: var(--neu-danger-ink, #b3261e);\n }\n .label {\n font-size: var(--neu-row-size, 15px);\n line-height: 21px;\n color: var(--neu-text, #172033);\n }\n .hint {\n font-size: 13px;\n color: var(--neu-muted, #596477);\n }\n `,\n})\nexport class NeuSwitchComponent {\n readonly haptic = input<NeuHapticFeedback | false>('selection');\n private readonly haptics = inject(NeuHaptics);\n readonly label = input.required<string>();\n readonly labelPosition = input<'left' | 'right'>('left');\n readonly size = input<NeuSize>('md');\n readonly hint = input('');\n readonly error = input('');\n readonly checked = model(false);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touched = input(false, { transform: booleanAttribute });\n readonly touch = output<void>();\n protected acceptChange(value: boolean): void {\n if (!this.disabled() && !this.readonly() && value !== this.checked()) {\n this.checked.set(value);\n this.haptics.play(this.haptic());\n }\n }\n protected markTouched(): void {\n if (!this.disabled() && !this.readonly()) this.touch.emit();\n }\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly trackColor = computed(() => {\n const t = this.theme?.() ?? NEU_LIGHT_TOKENS;\n return this.invalid()\n ? { true: t.danger, false: t.danger }\n : { true: t.accent, false: t.border };\n });\n}\n"]}
package/dist/tabs/tabs.js CHANGED
@@ -75,7 +75,7 @@ export class NeuTabsComponent {
75
75
  >
76
76
  }</view></scroll-view
77
77
  ><ng-content
78
- /></view>`, 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", ".tabs-header { flex-direction: row; min-width: 100%; border-bottom-width: 1px; border-color: var(--neu-divider, #e7ebf0); }\n.tab-action { flex-grow: 1; min-width: 80px; min-height: 48px; padding: 0 16px; justify-content: center; align-items: center; }\n.tab-label-wrap { position: relative; min-height: 48px; padding: 12px 4px; justify-content: center; align-items: center; }\n.tab-label, .tab-active-label { font-size: var(--neu-label-size, 14px); line-height: var(--neu-label-line, 20px); font-weight: 500; flex-shrink: 1; }\n.tab-label { color: var(--neu-muted, #596477); }\n.tab-active-label { color: var(--neu-accent-ink, #3155d9); }\n.tab-indicator { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; border-radius: 1px; background-color: var(--neu-accent, #006ee6); }\n"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }] });
78
+ /></view>`, 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", ".tabs-header { flex-direction: row; min-width: 100%; border-bottom-width: 1px; border-color: var(--neu-divider, #e7ebf0); }\n.tab-action { flex-grow: 1; min-width: 80px; min-height: 48px; padding: 0 16px; justify-content: center; align-items: center; }\n.tab-label-wrap { position: relative; min-height: 48px; padding: 12px 4px; justify-content: center; align-items: center; }\n.tab-label, .tab-active-label { font-size: var(--neu-label-size, 14px); line-height: var(--neu-label-line, 20px); font-weight: 500; flex-shrink: 1; }\n.tab-label { color: var(--neu-muted, #596477); }\n.tab-active-label { color: var(--neu-accent-ink, #3155d9); }\n.tab-indicator { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; border-radius: 1px; background-color: var(--neu-accent, #006ee6); }\n"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }] });
79
79
  }
80
80
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTabsComponent, decorators: [{
81
81
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/tabs/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,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,CAAC,GAAG,EAAE;YACV,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,EACtB,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;gBAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC;IACS,MAAM,CAAC,GAAc;QAC7B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;uGAfU,gBAAgB;2FAAhB,gBAAgB,4kBAJhB;YACT,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,EAAE;SACvE,0BA9BS;;;;;;;;;;;;;;;;;;;;;;;;;;YA0BA,07JA3BA,IAAI,iDAAE,IAAI,mYAAE,SAAS,+EAAE,UAAU;;2FAiChC,gBAAgB;kBAnC5B,SAAS;+BACE,UAAU,WACX,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,YAClC;;;;;;;;;;;;;;;;;;;;;;;;;;YA0BA,aAEC;wBACT,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE;qBACvE","sourcesContent":["import {\n Component,\n input,\n model,\n computed,\n effect,\n inject,\n InjectionToken,\n forwardRef,\n type Signal,\n} from '@angular/core';\nimport { View, Text, ScrollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption } from '../foundation/mobile.js';\n\nexport const NEU_TABS = new InjectionToken<{\n value: Signal<string>;\n tabs?: Signal<readonly NeuOption[]>;\n}>(\n 'Neural tabs',\n);\n@Component({\n selector: 'neu-tab-panel',\n imports: [View],\n template: `@if (active()) {\n <view role=\"tabpanel\" [accessibilityLabel]=\"panelLabel()\"><ng-content /></view>\n }`,\n})\nexport class NeuTabPanelComponent {\n readonly id = input.required<string>();\n private readonly tabs = inject(NEU_TABS);\n protected readonly active = computed(() => this.tabs.value() === this.id());\n protected readonly panelLabel = computed(() =>\n this.tabs.tabs?.().find(tab => tab.id === this.id())?.label ?? this.id());\n}\n\n@Component({\n selector: 'neu-tabs',\n imports: [View, Text, Pressable, ScrollView],\n template: `<view class=\"stack\"\n ><scroll-view [horizontal]=\"true\" [showsHorizontalScrollIndicator]=\"false\" keyboardShouldPersistTaps=\"handled\">\n <view\n class=\"tabs-header\"\n accessibilityRole=\"tablist\"\n [accessibilityLabel]=\"label()\"\n >\n @for (tab of tabs(); track tab.id) {\n <pressable\n class=\"tab-action\"\n [class.tab-active]=\"value() === tab.id\"\n accessibilityRole=\"tab\"\n [accessibilityLabel]=\"tab.label\"\n [accessibilityState]=\"{\n selected: value() === tab.id,\n disabled: disabled() || tab.disabled,\n }\"\n [disabled]=\"disabled() || !!tab.disabled\"\n [class.neu-unavailable]=\"disabled() || tab.disabled\"\n (press)=\"choose(tab)\"\n ><view class=\"tab-label-wrap\"><text [class]=\"value() === tab.id ? 'tab-active-label' : 'tab-label'\">{{\n tab.label\n }}</text><view class=\"tab-indicator\" [style.opacity]=\"value() === tab.id ? 1 : 0\" /></view></pressable\n >\n }</view></scroll-view\n ><ng-content\n /></view>`,\n styleUrls: ['../foundation/mobile.css', './tabs.css'],\n providers: [\n { provide: NEU_TABS, useExisting: forwardRef(() => NeuTabsComponent) },\n ],\n})\nexport class NeuTabsComponent {\n readonly label = input('Tabs');\n readonly tabs = input<readonly NeuOption[]>([]);\n readonly value = model('');\n readonly disabled = input(false);\n constructor() {\n effect(() => {\n const tabs = this.tabs(),\n value = this.value();\n if (!tabs.some((x) => x.id === value && !x.disabled))\n this.value.set(tabs.find((x) => !x.disabled)?.id ?? '');\n });\n }\n protected choose(tab: NeuOption): void {\n if (!this.disabled() && !tab.disabled) this.value.set(tab.id);\n }\n}\n"]}
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/tabs/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,cAAc,EACd,UAAU,GAEX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;;AAGpF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAIxC,aAAa,CACd,CAAC;AAQF,MAAM,OAAO,oBAAoB;IACtB,EAAE,GAAG,KAAK,CAAC,QAAQ;2EAAU,CAAC;IACtB,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtB,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;+EAAC,CAAC;IACzD,UAAU,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,KAAK,IAAI,IAAI,CAAC,EAAE,EAAE;mFAAC,CAAC;uGALjE,oBAAoB;2FAApB,oBAAoB,mMAJrB;;IAER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AAI,iDAAE,IAAI,mYAAE,SAAS,mGAAE,UAAU;;2FAiChC,gBAAgB;kBAnC5B,SAAS;+BACE,UAAU,WACX,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,YAClC;;;;;;;;;;;;;;;;;;;;;;;;;;YA0BA,aAEC;wBACT,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE;qBACvE","sourcesContent":["import {\n Component,\n input,\n model,\n computed,\n effect,\n inject,\n InjectionToken,\n forwardRef,\n type Signal,\n} from '@angular/core';\nimport { View, Text, ScrollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption } from '../foundation/mobile.js';\n\nexport const NEU_TABS = new InjectionToken<{\n value: Signal<string>;\n tabs?: Signal<readonly NeuOption[]>;\n}>(\n 'Neural tabs',\n);\n@Component({\n selector: 'neu-tab-panel',\n imports: [View],\n template: `@if (active()) {\n <view role=\"tabpanel\" [accessibilityLabel]=\"panelLabel()\"><ng-content /></view>\n }`,\n})\nexport class NeuTabPanelComponent {\n readonly id = input.required<string>();\n private readonly tabs = inject(NEU_TABS);\n protected readonly active = computed(() => this.tabs.value() === this.id());\n protected readonly panelLabel = computed(() =>\n this.tabs.tabs?.().find(tab => tab.id === this.id())?.label ?? this.id());\n}\n\n@Component({\n selector: 'neu-tabs',\n imports: [View, Text, Pressable, ScrollView],\n template: `<view class=\"stack\"\n ><scroll-view [horizontal]=\"true\" [showsHorizontalScrollIndicator]=\"false\" keyboardShouldPersistTaps=\"handled\">\n <view\n class=\"tabs-header\"\n accessibilityRole=\"tablist\"\n [accessibilityLabel]=\"label()\"\n >\n @for (tab of tabs(); track tab.id) {\n <pressable\n class=\"tab-action\"\n [class.tab-active]=\"value() === tab.id\"\n accessibilityRole=\"tab\"\n [accessibilityLabel]=\"tab.label\"\n [accessibilityState]=\"{\n selected: value() === tab.id,\n disabled: disabled() || tab.disabled,\n }\"\n [disabled]=\"disabled() || !!tab.disabled\"\n [class.neu-unavailable]=\"disabled() || tab.disabled\"\n (press)=\"choose(tab)\"\n ><view class=\"tab-label-wrap\"><text [class]=\"value() === tab.id ? 'tab-active-label' : 'tab-label'\">{{\n tab.label\n }}</text><view class=\"tab-indicator\" [style.opacity]=\"value() === tab.id ? 1 : 0\" /></view></pressable\n >\n }</view></scroll-view\n ><ng-content\n /></view>`,\n styleUrls: ['../foundation/mobile.css', './tabs.css'],\n providers: [\n { provide: NEU_TABS, useExisting: forwardRef(() => NeuTabsComponent) },\n ],\n})\nexport class NeuTabsComponent {\n readonly label = input('Tabs');\n readonly tabs = input<readonly NeuOption[]>([]);\n readonly value = model('');\n readonly disabled = input(false);\n constructor() {\n effect(() => {\n const tabs = this.tabs(),\n value = this.value();\n if (!tabs.some((x) => x.id === value && !x.disabled))\n this.value.set(tabs.find((x) => !x.disabled)?.id ?? '');\n });\n }\n protected choose(tab: NeuOption): void {\n if (!this.disabled() && !tab.disabled) this.value.set(tab.id);\n }\n}\n"]}
@@ -98,7 +98,7 @@ export class NeuToastComponent {
98
98
  [size]="18"
99
99
  [color]="palette().onColor" /></pressable></view
100
100
  ></view>
101
- }`, 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", "\n .toast {\n padding: 4px 8px 4px 16px;\n min-height: 56px;\n border-radius: var(--neu-radius);\n background-color: var(--neu-text);\n gap: 4px;\n flex-direction: row;\n align-items: center;\n }\n .toast-message {\n flex: 1;\n min-width: 0;\n color: var(--neu-surface);\n font-size: 16px;\n padding-top: 8px;\n padding-bottom: 4px;\n }\n .toast-actions {\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n }\n .toast-action {\n min-height: 48px;\n padding: 12px;\n align-items: center;\n justify-content: center;\n }\n .toast-action-text {\n color: var(--neu-surface);\n font-size: 14px;\n font-weight: 600;\n }\n .toast-close {\n min-width: 48px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
101
+ }`, 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", "\n .toast {\n padding: 4px 8px 4px 16px;\n min-height: 56px;\n border-radius: var(--neu-radius);\n background-color: var(--neu-text);\n gap: 4px;\n flex-direction: row;\n align-items: center;\n }\n .toast-message {\n flex: 1;\n min-width: 0;\n color: var(--neu-surface);\n font-size: 16px;\n padding-top: 8px;\n padding-bottom: 4px;\n }\n .toast-actions {\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n }\n .toast-action {\n min-height: 48px;\n padding: 12px;\n align-items: center;\n justify-content: center;\n }\n .toast-action-text {\n color: var(--neu-surface);\n font-size: 14px;\n font-weight: 600;\n }\n .toast-close {\n min-width: 48px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
102
102
  }
103
103
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuToastComponent, decorators: [{
104
104
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AA0FvD,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAG,KAAK,CAAC,KAAK;6EAAC,CAAC;IACpB,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAU,CAAC;IACnC,QAAQ,GAAG,KAAK,CAAC,CAAC;iFAAC,CAAC;IACpB,UAAU,GAAG,KAAK,CAAC,SAAS;mFAAC,CAAC;IAC9B,WAAW,GAAG,KAAK,CAAC,EAAE;oFAAC,CAAC;IACxB,IAAI,GAAG,KAAK,CAAU,SAAS;6EAAC,CAAC;IACjC,MAAM,GAAG,MAAM,EAAQ,CAAC;IACxB,SAAS,GAAG,MAAM,EAAQ,CAAC;IACn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C;IACS,YAAY;QACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,OAAO;QACzB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;uGA9CU,iBAAiB;2FAAjB,iBAAiB,4/BAjFlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqCR,+jKAtCQ,IAAI,iDAAE,IAAI,mYAAE,SAAS,+EAAE,aAAa,4DAAE,MAAM;;2FAkF3C,iBAAiB;kBAxF7B,SAAS;+BACE,WAAW,QACf;wBACJ,KAAK,EACH,2EAA2E;qBAC9E,WACQ,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,YAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqCR","sourcesContent":["import {\n Component,\n input,\n model,\n output,\n effect,\n computed,\n inject,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { NgIcon } from '@ng-native/icons';\nimport { neuPresence } from '../foundation/motion.js';\nimport { NEU_CLOSE } from '../foundation/icons.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n\n@Component({\n selector: 'neu-toast',\n host: {\n style:\n 'position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1000;',\n },\n imports: [View, Text, Pressable, AnimatedStyle, NgIcon],\n template: `@if (motion.visible()) {\n <view\n class=\"toast\"\n accessibilityRole=\"alert\"\n [animatedStyle]=\"animationStyle\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [style.backgroundColor]=\"palette().color\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n >\n <text class=\"toast-message\" [style.color]=\"palette().onColor\">{{\n message()\n }}</text\n ><view class=\"toast-actions\">\n @if (actionLabel()) {\n <pressable\n class=\"toast-action\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"actionLabel()\"\n (press)=\"invokeAction()\"\n ><text\n class=\"toast-action-text\"\n [style.color]=\"palette().onColor\"\n >{{ actionLabel() }}</text\n ></pressable\n >\n }\n <pressable\n class=\"toast-close\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\"\n (press)=\"dismiss()\"\n ><ng-icon\n [svg]=\"closeIcon\"\n [size]=\"18\"\n [color]=\"palette().onColor\" /></pressable></view\n ></view>\n }`,\n styleUrl: '../foundation/mobile.css',\n styles: `\n .toast {\n padding: 4px 8px 4px 16px;\n min-height: 56px;\n border-radius: var(--neu-radius);\n background-color: var(--neu-text);\n gap: 4px;\n flex-direction: row;\n align-items: center;\n }\n .toast-message {\n flex: 1;\n min-width: 0;\n color: var(--neu-surface);\n font-size: 16px;\n padding-top: 8px;\n padding-bottom: 4px;\n }\n .toast-actions {\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n }\n .toast-action {\n min-height: 48px;\n padding: 12px;\n align-items: center;\n justify-content: center;\n }\n .toast-action-text {\n color: var(--neu-surface);\n font-size: 14px;\n font-weight: 600;\n }\n .toast-close {\n min-width: 48px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n }\n `,\n})\nexport class NeuToastComponent {\n readonly open = model(false);\n readonly message = input.required<string>();\n readonly duration = input(0);\n readonly closeLabel = input('Dismiss');\n readonly actionLabel = input('');\n readonly tone = input<NeuTone>('neutral');\n readonly action = output<void>();\n readonly dismissed = output<void>();\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly palette = computed(() =>\n neuTonePalette(this.theme?.() ?? NEU_LIGHT_TOKENS, this.tone()),\n );\n protected readonly closeIcon = NEU_CLOSE;\n protected readonly motion = neuPresence(this.open);\n protected readonly animationStyle = {\n opacity: this.motion.progress,\n transform: [\n {\n translateY: this.motion.progress.interpolate({\n inputRange: [0, 1],\n outputRange: [8, 0],\n }),\n },\n ],\n };\n constructor() {\n effect((onCleanup) => {\n const open = this.open(),\n duration = this.duration();\n if (open && duration > 0) {\n const timer = setTimeout(() => this.dismiss(), duration);\n onCleanup(() => clearTimeout(timer));\n }\n });\n }\n protected dismiss(): void {\n if (this.open()) {\n this.open.set(false);\n this.dismissed.emit();\n }\n }\n protected invokeAction(): void {\n if (!this.open()) return;\n this.action.emit();\n this.dismiss();\n }\n}\n"]}
1
+ {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AA0FvD,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAG,KAAK,CAAC,KAAK;6EAAC,CAAC;IACpB,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAU,CAAC;IACnC,QAAQ,GAAG,KAAK,CAAC,CAAC;iFAAC,CAAC;IACpB,UAAU,GAAG,KAAK,CAAC,SAAS;mFAAC,CAAC;IAC9B,WAAW,GAAG,KAAK,CAAC,EAAE;oF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AE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACrB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IACS,YAAY;QACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,OAAO;QACzB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;uGA9CU,iBAAiB;2FAAjB,iBAAiB,4/BAjFlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqCR,+jKAtCQ,IAAI,iDAAE,IAAI,mYAAE,SAAS,mGAAE,aAAa,4DAAE,MAAM;;2FAkF3C,iBAAiB;kBAxF7B,SAAS;+BACE,WAAW,QACf;wBACJ,KAAK,EACH,2EAA2E;qBAC9E,WACQ,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,YAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqCR","sourcesContent":["import {\n Component,\n input,\n model,\n output,\n effect,\n computed,\n inject,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { NgIcon } from '@ng-native/icons';\nimport { neuPresence } from '../foundation/motion.js';\nimport { NEU_CLOSE } from '../foundation/icons.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n\n@Component({\n selector: 'neu-toast',\n host: {\n style:\n 'position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1000;',\n },\n imports: [View, Text, Pressable, AnimatedStyle, NgIcon],\n template: `@if (motion.visible()) {\n <view\n class=\"toast\"\n accessibilityRole=\"alert\"\n [animatedStyle]=\"animationStyle\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [style.backgroundColor]=\"palette().color\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n >\n <text class=\"toast-message\" [style.color]=\"palette().onColor\">{{\n message()\n }}</text\n ><view class=\"toast-actions\">\n @if (actionLabel()) {\n <pressable\n class=\"toast-action\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"actionLabel()\"\n (press)=\"invokeAction()\"\n ><text\n class=\"toast-action-text\"\n [style.color]=\"palette().onColor\"\n >{{ actionLabel() }}</text\n ></pressable\n >\n }\n <pressable\n class=\"toast-close\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\"\n (press)=\"dismiss()\"\n ><ng-icon\n [svg]=\"closeIcon\"\n [size]=\"18\"\n [color]=\"palette().onColor\" /></pressable></view\n ></view>\n }`,\n styleUrl: '../foundation/mobile.css',\n styles: `\n .toast {\n padding: 4px 8px 4px 16px;\n min-height: 56px;\n border-radius: var(--neu-radius);\n background-color: var(--neu-text);\n gap: 4px;\n flex-direction: row;\n align-items: center;\n }\n .toast-message {\n flex: 1;\n min-width: 0;\n color: var(--neu-surface);\n font-size: 16px;\n padding-top: 8px;\n padding-bottom: 4px;\n }\n .toast-actions {\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n }\n .toast-action {\n min-height: 48px;\n padding: 12px;\n align-items: center;\n justify-content: center;\n }\n .toast-action-text {\n color: var(--neu-surface);\n font-size: 14px;\n font-weight: 600;\n }\n .toast-close {\n min-width: 48px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n }\n `,\n})\nexport class NeuToastComponent {\n readonly open = model(false);\n readonly message = input.required<string>();\n readonly duration = input(0);\n readonly closeLabel = input('Dismiss');\n readonly actionLabel = input('');\n readonly tone = input<NeuTone>('neutral');\n readonly action = output<void>();\n readonly dismissed = output<void>();\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly palette = computed(() =>\n neuTonePalette(this.theme?.() ?? NEU_LIGHT_TOKENS, this.tone()),\n );\n protected readonly closeIcon = NEU_CLOSE;\n protected readonly motion = neuPresence(this.open);\n protected readonly animationStyle = {\n opacity: this.motion.progress,\n transform: [\n {\n translateY: this.motion.progress.interpolate({\n inputRange: [0, 1],\n outputRange: [8, 0],\n }),\n },\n ],\n };\n constructor() {\n effect((onCleanup) => {\n const open = this.open(),\n duration = this.duration();\n if (open && duration > 0) {\n const timer = setTimeout(() => this.dismiss(), duration);\n onCleanup(() => clearTimeout(timer));\n }\n });\n }\n protected dismiss(): void {\n if (this.open()) {\n this.open.set(false);\n this.dismissed.emit();\n }\n }\n protected invokeAction(): void {\n if (!this.open()) return;\n this.action.emit();\n this.dismiss();\n }\n}\n"]}
@@ -86,7 +86,7 @@ export class NeuToggleButtonGroupComponent {
86
86
  }
87
87
  </view></scroll-view
88
88
  >
89
- }`, isInline: true, styles: ["\n .neu-unavailable > * { opacity: 0.45; }\n .neu-held > * { opacity: 0.8; }\n .segment-check { position: absolute; top: 1px; right: 3px; font-size: 10px; line-height: 12px; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .toggle-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n gap: 4px;\n padding: 4px;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n background-color: var(--neu-surface-secondary, #eef1f5);\n }\n .segment {\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: auto;\n min-height: 48px;\n min-width: 48px;\n padding: 10px 4px;\n border-radius: 8px;\n }\n .label {\n color: var(--neu-text, #172033);\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }] });
89
+ }`, isInline: true, styles: ["\n .neu-unavailable > * { opacity: 0.45; }\n .neu-held > * { opacity: 0.8; }\n .segment-check { position: absolute; top: 1px; right: 3px; font-size: 10px; line-height: 12px; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .toggle-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n gap: 4px;\n padding: 4px;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n background-color: var(--neu-surface-secondary, #eef1f5);\n }\n .segment {\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: auto;\n min-height: 48px;\n min-width: 48px;\n padding: 10px 4px;\n border-radius: 8px;\n }\n .label {\n color: var(--neu-text, #172033);\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }] });
90
90
  }
91
91
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuToggleButtonGroupComponent, decorators: [{
92
92
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-button-group.js","sourceRoot":"","sources":["../../src/toggle-button-group/toggle-button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AAwGvD,MAAM,OAAO,6BAA6B;IAC/B,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU,CAAC;IACjC,OAAO,GAAG,KAAK,CAAuB,EAAE;gFAAC,CAAC;IAC1C,KAAK,GAAG,KAAK,CAAoB,EAAE;8EAAC,CAAC;IACrC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI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;;;;;;;;;;IAkDR,0vCAnDQ,IAAI,iDAAE,IAAI,mYAAE,SAAS,+EAAE,UAAU;;2FAoGhC,6BAA6B;kBAtGzC,SAAS;+BACE,yBAAyB,WAC1B,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,YAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkDR","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { View, Text, ScrollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption } from '../foundation/mobile.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n\n@Component({\n selector: 'neu-toggle-button-group',\n imports: [View, Text, Pressable, ScrollView],\n template: `@if (options().length) {\n <scroll-view\n class=\"group-scroll\"\n [horizontal]=\"true\"\n keyboardShouldPersistTaps=\"handled\"\n [showsHorizontalScrollIndicator]=\"false\"\n [contentContainerStyle]=\"scrollContent\"\n >\n <view\n class=\"toggle-group\"\n [accessibilityLabel]=\"label()\"\n [style.minWidth]=\"options().length * 48 + 10\"\n >\n @for (item of options(); track item.id) {\n <pressable\n class=\"segment\"\n accessibilityRole=\"checkbox\"\n [accessibilityLabel]=\"item.label\"\n [accessibilityState]=\"{\n checked: value().includes(item.id),\n disabled: disabled() || item.disabled,\n }\"\n [disabled]=\"disabled() || !!item.disabled\"\n [class.neu-unavailable]=\"disabled() || item.disabled\"\n [class.neu-held]=\"!disabled() && !item.disabled && held() === item.id\"\n [style.backgroundColor]=\"\n value().includes(item.id)\n ? (multiple() ? palette().tonal : tokens().surface)\n : 'transparent'\n \"\n (pressIn)=\"held.set(item.id)\"\n (pressOut)=\"held.set(null)\"\n (press)=\"toggle(item)\"\n >\n @if (multiple()) { <text class=\"segment-check\" pointerEvents=\"none\" [accessible]=\"false\" [style.color]=\"palette().ink\" [style.opacity]=\"value().includes(item.id) ? 1 : 0\">✓</text> }\n <text\n class=\"label\"\n pointerEvents=\"none\"\n [accessible]=\"false\"\n [style.color]=\"\n value().includes(item.id) ? palette().ink : tokens().muted\n \"\n [numberOfLines]=\"2\"\n ellipsizeMode=\"tail\"\n >{{ item.label }}</text\n ></pressable\n >\n }\n </view></scroll-view\n >\n }`,\n styles: `\n .neu-unavailable > * { opacity: 0.45; }\n .neu-held > * { opacity: 0.8; }\n .segment-check { position: absolute; top: 1px; right: 3px; font-size: 10px; line-height: 12px; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .toggle-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n gap: 4px;\n padding: 4px;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n background-color: var(--neu-surface-secondary, #eef1f5);\n }\n .segment {\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: auto;\n min-height: 48px;\n min-width: 48px;\n padding: 10px 4px;\n border-radius: 8px;\n }\n .label {\n color: var(--neu-text, #172033);\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n `,\n})\nexport class NeuToggleButtonGroupComponent {\n readonly label = input.required<string>();\n readonly options = input<readonly NeuOption[]>([]);\n readonly value = model<readonly string[]>([]);\n readonly multiple = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly tone = input<NeuTone>('brand');\n readonly touch = output<void>();\n protected readonly scrollContent = { flexGrow: 1 };\n protected readonly held = signal<string | null>(null);\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly tokens = computed(\n () => this.theme?.() ?? NEU_LIGHT_TOKENS,\n );\n protected readonly palette = computed(() =>\n neuTonePalette(this.tokens(), this.tone()),\n );\n protected toggle(item: NeuOption): void {\n if (this.disabled() || item.disabled) return;\n const ids = this.value();\n this.value.set(\n ids.includes(item.id)\n ? ids.filter((x) => x !== item.id)\n : this.multiple()\n ? [...ids, item.id]\n : [item.id],\n );\n this.touch.emit();\n }\n}\n"]}
1
+ {"version":3,"file":"toggle-button-group.js","sourceRoot":"","sources":["../../src/toggle-button-group/toggle-button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EACL,gBAAgB,EAChB,SAAS,GAEV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AAwGvD,MAAM,OAAO,6BAA6B;IAC/B,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU,CAAC;IACjC,OAAO,GAAG,KAAK,CAAuB,EAAE;gFAAC,CAAC;IAC1C,KAAK,GAAG,KAAK,CAAoB,EAAE;8EAAC,CAAC;IACrC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,IAAI,GAAG,KAAK,CAAU,OAAO;6EAAC,CAAC;IAC/B,KAAK,GAAG,MAAM,EAAQ,CAAC;IACb,aAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAChC,IAAI,GAAG,MAAM,CAAgB,IAAI;6EAAC,CAAC;IACrC,KA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;;;;;;;;;;;;;;IAkDR","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { View, Text, ScrollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuOption } from '../foundation/mobile.js';\nimport {\n NEU_LIGHT_TOKENS,\n NEU_THEME,\n type NeuTone,\n} from '../foundation/index.js';\nimport { neuTonePalette } from '../foundation/tone.js';\n\n@Component({\n selector: 'neu-toggle-button-group',\n imports: [View, Text, Pressable, ScrollView],\n template: `@if (options().length) {\n <scroll-view\n class=\"group-scroll\"\n [horizontal]=\"true\"\n keyboardShouldPersistTaps=\"handled\"\n [showsHorizontalScrollIndicator]=\"false\"\n [contentContainerStyle]=\"scrollContent\"\n >\n <view\n class=\"toggle-group\"\n [accessibilityLabel]=\"label()\"\n [style.minWidth]=\"options().length * 48 + 10\"\n >\n @for (item of options(); track item.id) {\n <pressable\n class=\"segment\"\n accessibilityRole=\"checkbox\"\n [accessibilityLabel]=\"item.label\"\n [accessibilityState]=\"{\n checked: value().includes(item.id),\n disabled: disabled() || item.disabled,\n }\"\n [disabled]=\"disabled() || !!item.disabled\"\n [class.neu-unavailable]=\"disabled() || item.disabled\"\n [class.neu-held]=\"!disabled() && !item.disabled && held() === item.id\"\n [style.backgroundColor]=\"\n value().includes(item.id)\n ? (multiple() ? palette().tonal : tokens().surface)\n : 'transparent'\n \"\n (pressIn)=\"held.set(item.id)\"\n (pressOut)=\"held.set(null)\"\n (press)=\"toggle(item)\"\n >\n @if (multiple()) { <text class=\"segment-check\" pointerEvents=\"none\" [accessible]=\"false\" [style.color]=\"palette().ink\" [style.opacity]=\"value().includes(item.id) ? 1 : 0\">✓</text> }\n <text\n class=\"label\"\n pointerEvents=\"none\"\n [accessible]=\"false\"\n [style.color]=\"\n value().includes(item.id) ? palette().ink : tokens().muted\n \"\n [numberOfLines]=\"2\"\n ellipsizeMode=\"tail\"\n >{{ item.label }}</text\n ></pressable\n >\n }\n </view></scroll-view\n >\n }`,\n styles: `\n .neu-unavailable > * { opacity: 0.45; }\n .neu-held > * { opacity: 0.8; }\n .segment-check { position: absolute; top: 1px; right: 3px; font-size: 10px; line-height: 12px; }\n :host {\n align-self: stretch;\n min-width: 0;\n max-width: 100%;\n }\n .group-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n max-width: 100%;\n }\n .toggle-group {\n flex-direction: row;\n flex-grow: 1;\n align-items: stretch;\n gap: 4px;\n padding: 4px;\n border-radius: var(--neu-radius, 12px);\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n background-color: var(--neu-surface-secondary, #eef1f5);\n }\n .segment {\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: auto;\n min-height: 48px;\n min-width: 48px;\n padding: 10px 4px;\n border-radius: 8px;\n }\n .label {\n color: var(--neu-text, #172033);\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n text-align: center;\n flex-shrink: 1;\n }\n `,\n})\nexport class NeuToggleButtonGroupComponent {\n readonly label = input.required<string>();\n readonly options = input<readonly NeuOption[]>([]);\n readonly value = model<readonly string[]>([]);\n readonly multiple = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly tone = input<NeuTone>('brand');\n readonly touch = output<void>();\n protected readonly scrollContent = { flexGrow: 1 };\n protected readonly held = signal<string | null>(null);\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly tokens = computed(\n () => this.theme?.() ?? NEU_LIGHT_TOKENS,\n );\n protected readonly palette = computed(() =>\n neuTonePalette(this.tokens(), this.tone()),\n );\n protected toggle(item: NeuOption): void {\n if (this.disabled() || item.disabled) return;\n const ids = this.value();\n this.value.set(\n ids.includes(item.id)\n ? ids.filter((x) => x !== item.id)\n : this.multiple()\n ? [...ids, item.id]\n : [item.id],\n );\n this.touch.emit();\n }\n}\n"]}
@@ -48,7 +48,7 @@ export class NeuToolbarComponent {
48
48
  </view>
49
49
  </scroll-view>
50
50
  }
51
- </view>`, isInline: true, styles: ["\n .neu-unavailable > * { opacity: 0.45; }\n :host { align-self: stretch; min-width: 0; max-width: 100%; }\n .toolbar {\n flex-direction: row;\n align-items: center;\n min-height: 56px;\n padding: 4px 8px;\n gap: 8px;\n background-color: var(--neu-surface, #ffffff);\n border-bottom-width: 1px;\n border-color: var(--neu-divider, #e4e7ec);\n }\n .toolbar-content { flex-direction: row; align-items: center; gap: 8px; flex-grow: 1; flex-shrink: 1; min-width: 0; }\n .toolbar-scroll { flex-grow: 0; flex-shrink: 1; max-width: 100%; }\n .toolbar-actions { flex-direction: row; align-items: center; }\n .toolbar-action {\n min-width: 48px;\n min-height: 48px;\n padding: 8px 12px;\n align-items: center;\n justify-content: center;\n border-radius: var(--neu-radius, 12px);\n }\n .toolbar-icon { width: 48px; padding: 0; }\n .toolbar-label { color: var(--neu-text, #172033); font-size: 14px; font-weight: 500; }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
51
+ </view>`, isInline: true, styles: ["\n .neu-unavailable > * { opacity: 0.45; }\n :host { align-self: stretch; min-width: 0; max-width: 100%; }\n .toolbar {\n flex-direction: row;\n align-items: center;\n min-height: 56px;\n padding: 4px 8px;\n gap: 8px;\n background-color: var(--neu-surface, #ffffff);\n border-bottom-width: 1px;\n border-color: var(--neu-divider, #e4e7ec);\n }\n .toolbar-content { flex-direction: row; align-items: center; gap: 8px; flex-grow: 1; flex-shrink: 1; min-width: 0; }\n .toolbar-scroll { flex-grow: 0; flex-shrink: 1; max-width: 100%; }\n .toolbar-actions { flex-direction: row; align-items: center; }\n .toolbar-action {\n min-width: 48px;\n min-height: 48px;\n padding: 8px 12px;\n align-items: center;\n justify-content: center;\n border-radius: var(--neu-radius, 12px);\n }\n .toolbar-icon { width: 48px; padding: 0; }\n .toolbar-label { color: var(--neu-text, #172033); font-size: 14px; font-weight: 500; }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
52
52
  }
53
53
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuToolbarComponent, decorators: [{
54
54
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","sourceRoot":"","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M;;2FAyDxC,mBAAmB;kBA3D/B,SAAS;+BACE,aAAa,WACd,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,YAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BF","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { View, Text, ScrollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NgIcon } from '@ng-native/icons';\nimport { NeuOption } from '../foundation/mobile.js';\nimport { NEU_LIGHT_TOKENS, NEU_THEME } from '../foundation/index.js';\n\n/** An action on the current screen. Supply svg for an icon and label for its accessible name. */\nexport interface NeuToolbarAction extends NeuOption {\n readonly svg?: string;\n}\n\n@Component({\n selector: 'neu-toolbar',\n imports: [View, Text, Pressable, ScrollView, NgIcon],\n template: `<view class=\"toolbar\" accessibilityRole=\"toolbar\" [accessibilityLabel]=\"label()\">\n <view class=\"toolbar-content\"><ng-content /></view>\n @if (actions().length) {\n <scroll-view class=\"toolbar-scroll\" [horizontal]=\"true\"\n keyboardShouldPersistTaps=\"handled\" [showsHorizontalScrollIndicator]=\"false\">\n <view class=\"toolbar-actions\">\n @for (action of actions(); track action.id) {\n <pressable class=\"toolbar-action\" [class.toolbar-icon]=\"!!action.svg\"\n accessibilityRole=\"button\" [accessibilityLabel]=\"action.label\"\n [accessibilityState]=\"{ disabled: disabled() || !!action.disabled }\"\n [disabled]=\"disabled() || !!action.disabled\"\n [class.neu-unavailable]=\"disabled() || action.disabled\"\n [style.backgroundColor]=\"held() === action.id && !disabled() && !action.disabled ? tokens().tonal : 'transparent'\"\n (pressIn)=\"held.set(action.id)\" (pressOut)=\"held.set(null)\"\n (press)=\"activate(action)\">\n @if (action.svg) {\n <view pointerEvents=\"none\" [accessible]=\"false\">\n <ng-icon [svg]=\"action.svg\" [size]=\"22\" [color]=\"tokens().text\" />\n </view>\n } @else {\n <text class=\"toolbar-label\" pointerEvents=\"none\" [accessible]=\"false\">{{ action.label }}</text>\n }\n </pressable>\n }\n </view>\n </scroll-view>\n }\n </view>`,\n styles: `\n .neu-unavailable > * { opacity: 0.45; }\n :host { align-self: stretch; min-width: 0; max-width: 100%; }\n .toolbar {\n flex-direction: row;\n align-items: center;\n min-height: 56px;\n padding: 4px 8px;\n gap: 8px;\n background-color: var(--neu-surface, #ffffff);\n border-bottom-width: 1px;\n border-color: var(--neu-divider, #e4e7ec);\n }\n .toolbar-content { flex-direction: row; align-items: center; gap: 8px; flex-grow: 1; flex-shrink: 1; min-width: 0; }\n .toolbar-scroll { flex-grow: 0; flex-shrink: 1; max-width: 100%; }\n .toolbar-actions { flex-direction: row; align-items: center; }\n .toolbar-action {\n min-width: 48px;\n min-height: 48px;\n padding: 8px 12px;\n align-items: center;\n justify-content: center;\n border-radius: var(--neu-radius, 12px);\n }\n .toolbar-icon { width: 48px; padding: 0; }\n .toolbar-label { color: var(--neu-text, #172033); font-size: 14px; font-weight: 500; }\n `,\n})\nexport class NeuToolbarComponent {\n readonly label = input('Toolbar');\n readonly actions = input<readonly NeuToolbarAction[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly activated = output<string>();\n protected readonly held = signal<string | null>(null);\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly tokens = computed(() => this.theme?.() ?? NEU_LIGHT_TOKENS);\n protected activate(action: NeuToolbarAction): void {\n if (!this.disabled() && !action.disabled) this.activated.emit(action.id);\n }\n}\n"]}
1
+ {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["../../src/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBA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ollView } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NgIcon } from '@ng-native/icons';\nimport { NeuOption } from '../foundation/mobile.js';\nimport { NEU_LIGHT_TOKENS, NEU_THEME } from '../foundation/index.js';\n\n/** An action on the current screen. Supply svg for an icon and label for its accessible name. */\nexport interface NeuToolbarAction extends NeuOption {\n readonly svg?: string;\n}\n\n@Component({\n selector: 'neu-toolbar',\n imports: [View, Text, Pressable, ScrollView, NgIcon],\n template: `<view class=\"toolbar\" accessibilityRole=\"toolbar\" [accessibilityLabel]=\"label()\">\n <view class=\"toolbar-content\"><ng-content /></view>\n @if (actions().length) {\n <scroll-view class=\"toolbar-scroll\" [horizontal]=\"true\"\n keyboardShouldPersistTaps=\"handled\" [showsHorizontalScrollIndicator]=\"false\">\n <view class=\"toolbar-actions\">\n @for (action of actions(); track action.id) {\n <pressable class=\"toolbar-action\" [class.toolbar-icon]=\"!!action.svg\"\n accessibilityRole=\"button\" [accessibilityLabel]=\"action.label\"\n [accessibilityState]=\"{ disabled: disabled() || !!action.disabled }\"\n [disabled]=\"disabled() || !!action.disabled\"\n [class.neu-unavailable]=\"disabled() || action.disabled\"\n [style.backgroundColor]=\"held() === action.id && !disabled() && !action.disabled ? tokens().tonal : 'transparent'\"\n (pressIn)=\"held.set(action.id)\" (pressOut)=\"held.set(null)\"\n (press)=\"activate(action)\">\n @if (action.svg) {\n <view pointerEvents=\"none\" [accessible]=\"false\">\n <ng-icon [svg]=\"action.svg\" [size]=\"22\" [color]=\"tokens().text\" />\n </view>\n } @else {\n <text class=\"toolbar-label\" pointerEvents=\"none\" [accessible]=\"false\">{{ action.label }}</text>\n }\n </pressable>\n }\n </view>\n </scroll-view>\n }\n </view>`,\n styles: `\n .neu-unavailable > * { opacity: 0.45; }\n :host { align-self: stretch; min-width: 0; max-width: 100%; }\n .toolbar {\n flex-direction: row;\n align-items: center;\n min-height: 56px;\n padding: 4px 8px;\n gap: 8px;\n background-color: var(--neu-surface, #ffffff);\n border-bottom-width: 1px;\n border-color: var(--neu-divider, #e4e7ec);\n }\n .toolbar-content { flex-direction: row; align-items: center; gap: 8px; flex-grow: 1; flex-shrink: 1; min-width: 0; }\n .toolbar-scroll { flex-grow: 0; flex-shrink: 1; max-width: 100%; }\n .toolbar-actions { flex-direction: row; align-items: center; }\n .toolbar-action {\n min-width: 48px;\n min-height: 48px;\n padding: 8px 12px;\n align-items: center;\n justify-content: center;\n border-radius: var(--neu-radius, 12px);\n }\n .toolbar-icon { width: 48px; padding: 0; }\n .toolbar-label { color: var(--neu-text, #172033); font-size: 14px; font-weight: 500; }\n `,\n})\nexport class NeuToolbarComponent {\n readonly label = input('Toolbar');\n readonly actions = input<readonly NeuToolbarAction[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly activated = output<string>();\n protected readonly held = signal<string | null>(null);\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly tokens = computed(() => this.theme?.() ?? NEU_LIGHT_TOKENS);\n protected activate(action: NeuToolbarAction): void {\n if (!this.disabled() && !action.disabled) this.activated.emit(action.id);\n }\n}\n"]}
package/dist/tree/tree.js CHANGED
@@ -106,7 +106,7 @@ export class NeuTreeComponent {
106
106
  } @empty {
107
107
  <text class="muted">{{ emptyLabel() }}</text>
108
108
  }
109
- </view>`, 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", ".tree-row {\n min-height: 52px;\n gap: 0;\n}\n.tree-disclosure {\n width: 32px;\n min-height: 48px;\n justify-content: center;\n align-items: center;\n}\n.tree-spacer {\n width: 32px;\n}\n.tree-node {\n min-height: 48px;\n padding: 8px;\n border-radius: 8px;\n gap: 8px;\n}\n.tree-copy {\n gap: 4px;\n}\n.tree-selected {\n background-color: var(--neu-tonal, #e9edfc);\n}\n.tree-selected-label {\n font-size: 16px;\n font-weight: 600;\n color: var(--neu-accent-ink, #3155d9);\n}\n.tree-branch-label {\n font-size: 16px;\n font-weight: 600;\n color: var(--neu-text, #172033);\n}\n"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
109
+ </view>`, 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", ".tree-row {\n min-height: 52px;\n gap: 0;\n}\n.tree-disclosure {\n width: 32px;\n min-height: 48px;\n justify-content: center;\n align-items: center;\n}\n.tree-spacer {\n width: 32px;\n}\n.tree-node {\n min-height: 48px;\n padding: 8px;\n border-radius: 8px;\n gap: 8px;\n}\n.tree-copy {\n gap: 4px;\n}\n.tree-selected {\n background-color: var(--neu-tonal, #e9edfc);\n}\n.tree-selected-label {\n font-size: 16px;\n font-weight: 600;\n color: var(--neu-accent-ink, #3155d9);\n}\n.tree-branch-label {\n font-size: 16px;\n font-weight: 600;\n color: var(--neu-text, #172033);\n}\n"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
110
110
  }
111
111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTreeComponent, decorators: [{
112
112
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/tree/tree.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;;AA4DlE,MAAM,OAAO,gBAAgB;IAClB,KAAK,GAAG,KAAK,CAAC,MAAM;8EAAC,CAAC;IACtB,KAAK,GAAG,KAAK,CAAyB,EAAE;8EAAC,CAAC;IAC1C,QAAQ,GAAG,KAAK,CAAoB,EAAE;iFAAC,CAAC;IACxC,KAAK,GAAG,KAAK,CAAC,EAAE;8EAAC,CAAC;IAClB,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACzD,WAAW,GAAG,KAAK,CAAC,QAAQ;oFAAC,CAAC;IAC9B,UAAU,GAAG,KAAK,CAAC,UAAU;mFAAC,CAAC;IAC/B,QAAQ,GAAG,MAAM,EAAU,CAAC;IAC5B,KAAK,GAAG,MAAM,EAAQ,CAAC;IACb,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,EAAE,MAAM,CAAC;YAEhD,OAAO;QACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;uGA/CU,gBAAgB;2FAAhB,gBAAgB,kzCAvDjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoDF,yvJArDE,IAAI,iDAAE,IAAI,mYAAE,SAAS,+EAAE,MAAM;;2FAwD5B,gBAAgB;kBA1D5B,SAAS;+BACE,UAAU,WACX,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,YAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoDF","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n model,\n output,\n computed,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NgIcon } from '@ng-native/icons';\nimport { NEU_CHEVRON_DOWN, NEU_CHEVRON_RIGHT, NEU_FOLDER, NEU_FILE, NEU_CHECK } from '../foundation/icons.js';\nimport { NeuTreeNode } from '../foundation/mobile.js';\nimport { visibleTree, findTreeNode } from '../foundation/tree.js';\n\n@Component({\n selector: 'neu-tree',\n imports: [View, Text, Pressable, NgIcon],\n template: `<view [accessibilityLabel]=\"label()\">\n @for (row of rows(); track row.node.id) {\n <view class=\"row tree-row\" [style.paddingLeft]=\"row.depth * 16\"\n [style.opacity]=\"disabled() || row.disabled ? 0.45 : 1\">\n @if (row.branch) {\n <pressable\n class=\"tree-disclosure\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"row.node.label + ' ' + expandLabel()\"\n [accessibilityState]=\"{\n expanded: expandedIds().has(row.node.id),\n disabled: disabled() || row.disabled,\n }\"\n [disabled]=\"disabled() || row.disabled\"\n (press)=\"toggle(row.node.id)\"\n ><ng-icon [svg]=\"expandedIds().has(row.node.id) ? downIcon : rightIcon\" [size]=\"18\" color=\"var(--neu-muted, #596477)\" /></pressable\n >\n } @else {\n <view class=\"tree-spacer\" />\n }\n <pressable\n class=\"tree-node row grow\"\n [class.tree-selected]=\"value() === row.node.id\"\n accessibilityRole=\"radio\"\n [accessibilityLabel]=\"row.node.label\"\n [accessibilityState]=\"{\n checked: value() === row.node.id,\n disabled:\n disabled() ||\n readonly() ||\n row.disabled ||\n (leafOnly() && row.branch),\n }\"\n [disabled]=\"\n disabled() ||\n readonly() ||\n row.disabled ||\n (leafOnly() && row.branch)\n \"\n (press)=\"choose(row.node.id)\"\n ><ng-icon [svg]=\"row.branch ? folderIcon : fileIcon\" [size]=\"20\" color=\"var(--neu-muted, #596477)\" />\n <view class=\"grow tree-copy\">\n <text [class]=\"value() === row.node.id ? 'tree-selected-label' : row.branch ? 'tree-branch-label' : 'label'\">{{ row.node.label }}</text>\n @if (row.node.description) { <text class=\"muted\">{{ row.node.description }}</text> }\n </view>\n @if (value() === row.node.id) { <ng-icon [svg]=\"checkIcon\" [size]=\"18\" color=\"var(--neu-accent, #3155d9)\" /> }\n </pressable\n ></view\n >\n } @empty {\n <text class=\"muted\">{{ emptyLabel() }}</text>\n }\n </view>`,\n styleUrls: ['../foundation/mobile.css', './tree.css'],\n})\nexport class NeuTreeComponent {\n readonly label = input('Tree');\n readonly nodes = input<readonly NeuTreeNode[]>([]);\n readonly expanded = model<readonly string[]>([]);\n readonly value = model('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly leafOnly = input(false, { transform: booleanAttribute });\n readonly expandLabel = input('Expand');\n readonly emptyLabel = input('No items');\n readonly selected = output<string>();\n readonly touch = output<void>();\n protected readonly downIcon = NEU_CHEVRON_DOWN;\n protected readonly rightIcon = NEU_CHEVRON_RIGHT;\n protected readonly folderIcon = NEU_FOLDER;\n protected readonly fileIcon = NEU_FILE;\n protected readonly checkIcon = NEU_CHECK;\n protected readonly expandedIds = computed(() => new Set(this.expanded()));\n protected readonly rows = computed(() =>\n visibleTree(this.nodes(), this.expanded()),\n );\n protected toggle(id: string): void {\n const found = findTreeNode(this.nodes(), id);\n if (\n this.disabled() ||\n !found ||\n found.disabled ||\n !found.node.children?.length\n )\n return;\n this.expanded.update((ids) =>\n ids.includes(id) ? ids.filter((x) => x !== id) : [...ids, id],\n );\n }\n protected choose(id: string): void {\n const found = findTreeNode(this.nodes(), id);\n if (\n this.disabled() ||\n this.readonly() ||\n !found ||\n found.disabled ||\n (this.leafOnly() && found.node.children?.length)\n )\n return;\n this.value.set(id);\n this.selected.emit(id);\n this.touch.emit();\n }\n}\n"]}
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/tree/tree.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;;AA4DlE,MAAM,OAAO,gBAAgB;IAClB,KAAK,GAAG,KAAK,CAAC,MAAM;8EAAC,CAAC;IACtB,KAAK,GAAG,KAAK,CAAyB,EAAE;8EAAC,CAAC;IAC1C,QAAQ,GAAG,KAAK,CAAoB,EAAE;iFAAC,CAAC;IACxC,KAAK,GAAG,KAAK,CAAC,EAAE;8EAA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,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAC9D,CAAC;IACJ,CAAC;IACS,MAAM,CAAC,EAAU;QACzB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC7C,IACE,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,QAAQ,EAAE;YACf,CAAC,KAAK;YACN,KAAK,CAAC,QAAQ;YACd,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;YAEhD,OAAO;QACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;uGA/CU,gBAAgB;2FAAhB,gBAAgB,kzCAvDjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoDF,yvJArDE,IAAI,iDAAE,IAAI,mYAAE,SAAS,mGAAE,MAAM;;2FAwD5B,gBAAgB;kBA1D5B,SAAS;+BACE,UAAU,WACX,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,YAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoDF","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n model,\n output,\n computed,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NgIcon } from '@ng-native/icons';\nimport { NEU_CHEVRON_DOWN, NEU_CHEVRON_RIGHT, NEU_FOLDER, NEU_FILE, NEU_CHECK } from '../foundation/icons.js';\nimport { NeuTreeNode } from '../foundation/mobile.js';\nimport { visibleTree, findTreeNode } from '../foundation/tree.js';\n\n@Component({\n selector: 'neu-tree',\n imports: [View, Text, Pressable, NgIcon],\n template: `<view [accessibilityLabel]=\"label()\">\n @for (row of rows(); track row.node.id) {\n <view class=\"row tree-row\" [style.paddingLeft]=\"row.depth * 16\"\n [style.opacity]=\"disabled() || row.disabled ? 0.45 : 1\">\n @if (row.branch) {\n <pressable\n class=\"tree-disclosure\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"row.node.label + ' ' + expandLabel()\"\n [accessibilityState]=\"{\n expanded: expandedIds().has(row.node.id),\n disabled: disabled() || row.disabled,\n }\"\n [disabled]=\"disabled() || row.disabled\"\n (press)=\"toggle(row.node.id)\"\n ><ng-icon [svg]=\"expandedIds().has(row.node.id) ? downIcon : rightIcon\" [size]=\"18\" color=\"var(--neu-muted, #596477)\" /></pressable\n >\n } @else {\n <view class=\"tree-spacer\" />\n }\n <pressable\n class=\"tree-node row grow\"\n [class.tree-selected]=\"value() === row.node.id\"\n accessibilityRole=\"radio\"\n [accessibilityLabel]=\"row.node.label\"\n [accessibilityState]=\"{\n checked: value() === row.node.id,\n disabled:\n disabled() ||\n readonly() ||\n row.disabled ||\n (leafOnly() && row.branch),\n }\"\n [disabled]=\"\n disabled() ||\n readonly() ||\n row.disabled ||\n (leafOnly() && row.branch)\n \"\n (press)=\"choose(row.node.id)\"\n ><ng-icon [svg]=\"row.branch ? folderIcon : fileIcon\" [size]=\"20\" color=\"var(--neu-muted, #596477)\" />\n <view class=\"grow tree-copy\">\n <text [class]=\"value() === row.node.id ? 'tree-selected-label' : row.branch ? 'tree-branch-label' : 'label'\">{{ row.node.label }}</text>\n @if (row.node.description) { <text class=\"muted\">{{ row.node.description }}</text> }\n </view>\n @if (value() === row.node.id) { <ng-icon [svg]=\"checkIcon\" [size]=\"18\" color=\"var(--neu-accent, #3155d9)\" /> }\n </pressable\n ></view\n >\n } @empty {\n <text class=\"muted\">{{ emptyLabel() }}</text>\n }\n </view>`,\n styleUrls: ['../foundation/mobile.css', './tree.css'],\n})\nexport class NeuTreeComponent {\n readonly label = input('Tree');\n readonly nodes = input<readonly NeuTreeNode[]>([]);\n readonly expanded = model<readonly string[]>([]);\n readonly value = model('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly leafOnly = input(false, { transform: booleanAttribute });\n readonly expandLabel = input('Expand');\n readonly emptyLabel = input('No items');\n readonly selected = output<string>();\n readonly touch = output<void>();\n protected readonly downIcon = NEU_CHEVRON_DOWN;\n protected readonly rightIcon = NEU_CHEVRON_RIGHT;\n protected readonly folderIcon = NEU_FOLDER;\n protected readonly fileIcon = NEU_FILE;\n protected readonly checkIcon = NEU_CHECK;\n protected readonly expandedIds = computed(() => new Set(this.expanded()));\n protected readonly rows = computed(() =>\n visibleTree(this.nodes(), this.expanded()),\n );\n protected toggle(id: string): void {\n const found = findTreeNode(this.nodes(), id);\n if (\n this.disabled() ||\n !found ||\n found.disabled ||\n !found.node.children?.length\n )\n return;\n this.expanded.update((ids) =>\n ids.includes(id) ? ids.filter((x) => x !== id) : [...ids, id],\n );\n }\n protected choose(id: string): void {\n const found = findTreeNode(this.nodes(), id);\n if (\n this.disabled() ||\n this.readonly() ||\n !found ||\n found.disabled ||\n (this.leafOnly() && found.node.children?.length)\n )\n return;\n this.value.set(id);\n this.selected.emit(id);\n this.touch.emit();\n }\n}\n"]}
@@ -70,7 +70,7 @@ export class NeuTreeSelectComponent extends NeuTextControl {
70
70
  [readonly]="readonly()"
71
71
  (expandedChange)="expanded.set($event)"
72
72
  (selected)="choose($event)"
73
- /></neu-anchored-overlay>`, 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"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }, { kind: "component", type: NeuAnchoredOverlayComponent, selector: "neu-anchored-overlay", inputs: ["open", "anchor", "closeLabel", "minimumWidth", "gap"], outputs: ["openChange"] }, { kind: "component", type: NeuTreeComponent, selector: "neu-tree", inputs: ["label", "nodes", "expanded", "value", "disabled", "readonly", "leafOnly", "expandLabel", "emptyLabel"], outputs: ["expandedChange", "valueChange", "selected", "touch"] }] });
73
+ /></neu-anchored-overlay>`, 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"], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }, { kind: "component", type: NeuAnchoredOverlayComponent, selector: "neu-anchored-overlay", inputs: ["open", "anchor", "closeLabel", "minimumWidth", "gap"], outputs: ["openChange"] }, { kind: "component", type: NeuTreeComponent, selector: "neu-tree", inputs: ["label", "nodes", "expanded", "value", "disabled", "readonly", "leafOnly", "expandLabel", "emptyLabel"], outputs: ["expandedChange", "valueChange", "selected", "touch"] }] });
74
74
  }
75
75
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTreeSelectComponent, decorators: [{
76
76
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"tree-select.js","sourceRoot":"","sources":["../../src/tree-select/tree-select.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;;AAyCrD,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IAC/C,KAAK,GAAG,KAAK,CAAyB,EAAE;8EAAC,CAAC;IAC1C,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,GAAG,CAAC;IACxD,WAAW,GAAG,KAAK,CAAC,aAAa;oFAAC,CAAC;IACnC,UAAU,GAAG,KAAK,CAAC,iBAAiB;mFAAC,CAAC;IACtC,WAAW,GAAG,KAAK,CAAC,QAAQ;oFAAC,CAAC;IAC9B,UAAU,GAAG,KAAK,CAAC,UAAU;mFAAC,CAAC;IACrB,SAAS,GAAG,SAAS,CAAC,gBAAgB,iFAAI,IAAI,EAAE,CAAA,UAAoB,CAAA,GAAG,CAAC;IACxE,OAAO,GAAG,gBAAgB,CAAC;IAC3B,IAAI,GAAG,MAAM,CAAC,KAAK;6EAAC,CAAC;IACrB,QAAQ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AAoB,CAAA,EAAE","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n computed,\n signal,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NgIcon } from '@ng-native/icons';\nimport type { HostNode } from '@ng-native/fabric';\nimport { NeuTreeNode, NeuTextControl } from '../foundation/mobile.js';\nimport { NeuAnchoredOverlayComponent } from '../foundation/anchored-overlay.js';\nimport { NEU_CHEVRON_DOWN } from '../foundation/icons.js';\nimport { NeuTreeComponent } from '../tree/tree.js';\nimport { findTreeNode } from '../foundation/tree.js';\n\n@Component({\n selector: 'neu-tree-select',\n imports: [\n View,\n Text,\n Pressable,\n NgIcon,\n NeuAnchoredOverlayComponent,\n NeuTreeComponent,\n ],\n template: `<view class=\"stack\"\n ><text class=\"label\">{{ label() }}</text\n ><pressable class=\"control row\" #triggerElement=\"pressable\" accessibilityRole=\"button\"\n [accessibilityLabel]=\"label() || placeholder()\"\n [accessibilityValue]=\"{ text: selectedLabel() || placeholder() }\"\n [accessibilityState]=\"{ expanded: open(), disabled: disabled() || readonly() }\"\n [disabled]=\"disabled() || readonly()\"\n (press)=\"show()\">\n <text class=\"label grow\">{{ selectedLabel() || placeholder() }}</text>\n <ng-icon [svg]=\"chevron\" [size]=\"20\" color=\"var(--neu-muted, #596477)\" />\n </pressable>\n @if (invalid() && error()) { <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text> }\n </view\n ><neu-anchored-overlay [gap]=\"4\" [(open)]=\"open\" [anchor]=\"anchorRef()?.nativeElement\" [closeLabel]=\"closeLabel()\"\n ><neu-tree\n [label]=\"label()\"\n [nodes]=\"nodes()\"\n [value]=\"value()\"\n [expanded]=\"expanded()\"\n [leafOnly]=\"leafOnly()\"\n [expandLabel]=\"expandLabel()\"\n [emptyLabel]=\"emptyLabel()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (expandedChange)=\"expanded.set($event)\"\n (selected)=\"choose($event)\"\n /></neu-anchored-overlay>`,\n styleUrl: '../foundation/mobile.css',\n})\nexport class NeuTreeSelectComponent extends NeuTextControl {\n readonly nodes = input<readonly NeuTreeNode[]>([]);\n readonly leafOnly = input(true, { transform: booleanAttribute });\n readonly placeholder = input('Choose item');\n readonly closeLabel = input('Dismiss options');\n readonly expandLabel = input('Expand');\n readonly emptyLabel = input('No items');\n protected readonly anchorRef = viewChild('triggerElement', { read: ElementRef<HostNode> });\n protected readonly chevron = NEU_CHEVRON_DOWN;\n protected readonly open = signal(false);\n protected readonly expanded = signal<readonly string[]>([]);\n protected readonly selectedLabel = computed(\n () => findTreeNode(this.nodes(), this.value())?.node.label ?? '',\n );\n protected show(): void {\n if (!this.disabled() && !this.readonly()) this.open.set(true);\n }\n protected choose(id: string): void {\n const found = findTreeNode(this.nodes(), id);\n if (\n this.disabled() ||\n this.readonly() ||\n !found ||\n found.disabled ||\n (this.leafOnly() && found.node.children?.length)\n )\n return;\n this.accept(id);\n this.open.set(false);\n }\n}\n"]}
1
+ {"version":3,"file":"tree-select.js","sourceRoot":"","sources":["../../src/tree-select/tree-select.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC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EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;YAEhD,OAAO;QACT,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;uGA7BU,sBAAsB;2FAAtB,sBAAsB,08BAOkC,UAAU,oEApCnE;;;;;;;;;;;;;;;;;;;;;;;;;;8BA0BkB,gqIAjC1B,IAAI,iDACJ,IAAI,mYACJ,SAAS,mGACT,MAAM,mIACN,2BAA2B,2JAC3B,gBAAgB;;2FA+BP,sBAAsB;kBAvClC,SAAS;+BACE,iBAAiB,WAClB;wBACP,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,MAAM;wBACN,2BAA2B;wBAC3B,gBAAgB;qBACjB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;8BA0BkB;qpBAUa,gBAAgB,OAAE,EAAE,IAAI,EAAE,CAAA,UAAoB,CAAA,EAAE","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n computed,\n signal,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NgIcon } from '@ng-native/icons';\nimport type { HostNode } from '@ng-native/fabric';\nimport { NeuTreeNode, NeuTextControl } from '../foundation/mobile.js';\nimport { NeuAnchoredOverlayComponent } from '../foundation/anchored-overlay.js';\nimport { NEU_CHEVRON_DOWN } from '../foundation/icons.js';\nimport { NeuTreeComponent } from '../tree/tree.js';\nimport { findTreeNode } from '../foundation/tree.js';\n\n@Component({\n selector: 'neu-tree-select',\n imports: [\n View,\n Text,\n Pressable,\n NgIcon,\n NeuAnchoredOverlayComponent,\n NeuTreeComponent,\n ],\n template: `<view class=\"stack\"\n ><text class=\"label\">{{ label() }}</text\n ><pressable class=\"control row\" #triggerElement=\"pressable\" accessibilityRole=\"button\"\n [accessibilityLabel]=\"label() || placeholder()\"\n [accessibilityValue]=\"{ text: selectedLabel() || placeholder() }\"\n [accessibilityState]=\"{ expanded: open(), disabled: disabled() || readonly() }\"\n [disabled]=\"disabled() || readonly()\"\n (press)=\"show()\">\n <text class=\"label grow\">{{ selectedLabel() || placeholder() }}</text>\n <ng-icon [svg]=\"chevron\" [size]=\"20\" color=\"var(--neu-muted, #596477)\" />\n </pressable>\n @if (invalid() && error()) { <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text> }\n </view\n ><neu-anchored-overlay [gap]=\"4\" [(open)]=\"open\" [anchor]=\"anchorRef()?.nativeElement\" [closeLabel]=\"closeLabel()\"\n ><neu-tree\n [label]=\"label()\"\n [nodes]=\"nodes()\"\n [value]=\"value()\"\n [expanded]=\"expanded()\"\n [leafOnly]=\"leafOnly()\"\n [expandLabel]=\"expandLabel()\"\n [emptyLabel]=\"emptyLabel()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (expandedChange)=\"expanded.set($event)\"\n (selected)=\"choose($event)\"\n /></neu-anchored-overlay>`,\n styleUrl: '../foundation/mobile.css',\n})\nexport class NeuTreeSelectComponent extends NeuTextControl {\n readonly nodes = input<readonly NeuTreeNode[]>([]);\n readonly leafOnly = input(true, { transform: booleanAttribute });\n readonly placeholder = input('Choose item');\n readonly closeLabel = input('Dismiss options');\n readonly expandLabel = input('Expand');\n readonly emptyLabel = input('No items');\n protected readonly anchorRef = viewChild('triggerElement', { read: ElementRef<HostNode> });\n protected readonly chevron = NEU_CHEVRON_DOWN;\n protected readonly open = signal(false);\n protected readonly expanded = signal<readonly string[]>([]);\n protected readonly selectedLabel = computed(\n () => findTreeNode(this.nodes(), this.value())?.node.label ?? '',\n );\n protected show(): void {\n if (!this.disabled() && !this.readonly()) this.open.set(true);\n }\n protected choose(id: string): void {\n const found = findTreeNode(this.nodes(), id);\n if (\n this.disabled() ||\n this.readonly() ||\n !found ||\n found.disabled ||\n (this.leafOnly() && found.node.children?.length)\n )\n return;\n this.accept(id);\n this.open.set(false);\n }\n}\n"]}
@@ -11,7 +11,7 @@ export declare class NeuUploaderComponent {
11
11
  readonly chooseLabel: import("@angular/core").InputSignal<string>;
12
12
  readonly uploadLabel: import("@angular/core").InputSignal<string>;
13
13
  readonly removeLabel: import("@angular/core").InputSignal<string>;
14
- readonly stateLabels: import("@angular/core").InputSignal<Readonly<Record<"selected" | "uploading" | "complete" | "error", string>>>;
14
+ readonly stateLabels: import("@angular/core").InputSignal<Readonly<Record<"error" | "selected" | "uploading" | "complete", string>>>;
15
15
  readonly upload: import("@angular/core").InputSignal<NeuUpload | undefined>;
16
16
  readonly selected: import("@angular/core").OutputEmitterRef<readonly NeuFile[]>;
17
17
  readonly completed: import("@angular/core").OutputEmitterRef<NeuFile>;