@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.
- package/README.md +15 -5
- package/dist/accordion/accordion.js +1 -1
- package/dist/accordion/accordion.js.map +1 -1
- package/dist/alert/alert.js +1 -1
- package/dist/alert/alert.js.map +1 -1
- package/dist/bottom-sheet/bottom-sheet.js +1 -1
- package/dist/bottom-sheet/bottom-sheet.js.map +1 -1
- package/dist/button/button.d.ts +3 -1
- package/dist/button/button.js +7 -3
- package/dist/button/button.js.map +1 -1
- package/dist/button-group/button-group.js +1 -1
- package/dist/button-group/button-group.js.map +1 -1
- package/dist/calendar/calendar.js +1 -1
- package/dist/calendar/calendar.js.map +1 -1
- package/dist/carousel/carousel.js +1 -1
- package/dist/carousel/carousel.js.map +1 -1
- package/dist/cascade-select/cascade-select.js +1 -1
- package/dist/cascade-select/cascade-select.js.map +1 -1
- package/dist/checkbox/checkbox.d.ts +4 -1
- package/dist/checkbox/checkbox.js +10 -3
- package/dist/checkbox/checkbox.js.map +1 -1
- package/dist/chip/chip.js +1 -1
- package/dist/chip/chip.js.map +1 -1
- package/dist/confirm-dialog/confirm-dialog.js +1 -1
- package/dist/context-menu/context-menu.js +1 -1
- package/dist/context-menu/context-menu.js.map +1 -1
- package/dist/data-view/data-view.js +1 -1
- package/dist/data-view/data-view.js.map +1 -1
- package/dist/date-input/date-input.js +1 -1
- package/dist/date-input/date-input.js.map +1 -1
- package/dist/empty-state/empty-state.js +1 -1
- package/dist/filter-bar/filter-bar.js +1 -1
- package/dist/foundation/anchored-overlay.js +1 -1
- package/dist/foundation/anchored-overlay.js.map +1 -1
- package/dist/foundation/haptics.d.ts +30 -0
- package/dist/foundation/haptics.js +53 -0
- package/dist/foundation/haptics.js.map +1 -0
- package/dist/foundation/index.d.ts +1 -0
- package/dist/foundation/index.js +1 -0
- package/dist/foundation/index.js.map +1 -1
- package/dist/foundation/native-pressable.d.ts +5 -1
- package/dist/foundation/native-pressable.js +13 -3
- package/dist/foundation/native-pressable.js.map +1 -1
- package/dist/gallery/gallery.d.ts +1 -0
- package/dist/gallery/gallery.js +24 -11
- package/dist/gallery/gallery.js.map +1 -1
- package/dist/haptics/index.d.ts +12 -0
- package/dist/haptics/index.js +36 -0
- package/dist/haptics/index.js.map +1 -0
- package/dist/icon-button/icon-button.d.ts +3 -1
- package/dist/icon-button/icon-button.js +7 -3
- package/dist/icon-button/icon-button.js.map +1 -1
- package/dist/image-viewer/image-viewer.js +1 -1
- package/dist/image-viewer/image-viewer.js.map +1 -1
- package/dist/inline-editor/inline-editor.js +1 -1
- package/dist/inline-editor/inline-editor.js.map +1 -1
- package/dist/input-mask/input-mask.d.ts +2 -0
- package/dist/input-mask/input-mask.js +7 -1
- package/dist/input-mask/input-mask.js.map +1 -1
- package/dist/input-otp/input-otp.js +1 -1
- package/dist/input-otp/input-otp.js.map +1 -1
- package/dist/input-tags/input-tags.d.ts +2 -0
- package/dist/input-tags/input-tags.js +8 -3
- package/dist/input-tags/input-tags.js.map +1 -1
- package/dist/listbox/listbox.js +1 -1
- package/dist/listbox/listbox.js.map +1 -1
- package/dist/menu/menu.js +1 -1
- package/dist/menu/menu.js.map +1 -1
- package/dist/modal/modal.js +1 -1
- package/dist/modal/modal.js.map +1 -1
- package/dist/nav/nav.js +1 -1
- package/dist/nav/nav.js.map +1 -1
- package/dist/notification-center/notification-center.js +1 -1
- package/dist/notification-center/notification-center.js.map +1 -1
- package/dist/number-input/number-input.js +1 -1
- package/dist/number-input/number-input.js.map +1 -1
- package/dist/panel/panel.js +1 -1
- package/dist/panel/panel.js.map +1 -1
- package/dist/password/password.js +1 -1
- package/dist/pick-list/pick-list.js +1 -1
- package/dist/pick-list/pick-list.js.map +1 -1
- package/dist/popover/popover.js +1 -1
- package/dist/popover/popover.js.map +1 -1
- package/dist/radio/radio.d.ts +4 -1
- package/dist/radio/radio.js +13 -4
- package/dist/radio/radio.js.map +1 -1
- package/dist/rating/rating.js +1 -1
- package/dist/rating/rating.js.map +1 -1
- package/dist/select/select.js +1 -1
- package/dist/select/select.js.map +1 -1
- package/dist/sidebar/sidebar.js +1 -1
- package/dist/sidebar/sidebar.js.map +1 -1
- package/dist/slider/slider.d.ts +4 -1
- package/dist/slider/slider.js +12 -3
- package/dist/slider/slider.js.map +1 -1
- package/dist/speed-dial/speed-dial.js +1 -1
- package/dist/speed-dial/speed-dial.js.map +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/spinner/spinner.js.map +1 -1
- package/dist/stepper/stepper.js +1 -1
- package/dist/stepper/stepper.js.map +1 -1
- package/dist/switch/switch.d.ts +4 -1
- package/dist/switch/switch.js +10 -4
- package/dist/switch/switch.js.map +1 -1
- package/dist/tabs/tabs.js +1 -1
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/toast/toast.js +1 -1
- package/dist/toast/toast.js.map +1 -1
- package/dist/toggle-button-group/toggle-button-group.js +1 -1
- package/dist/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/toolbar/toolbar.js +1 -1
- package/dist/toolbar/toolbar.js.map +1 -1
- package/dist/tree/tree.js +1 -1
- package/dist/tree/tree.js.map +1 -1
- package/dist/tree-select/tree-select.js +1 -1
- package/dist/tree-select/tree-select.js.map +1 -1
- package/dist/uploader/uploader.d.ts +1 -1
- package/dist/uploader/uploader.js +1 -1
- package/dist/uploader/uploader.js.map +1 -1
- package/dist/virtual-list/virtual-list.js +1 -1
- package/dist/virtual-list/virtual-list.js.map +1 -1
- package/package.json +22 -6
|
@@ -87,7 +87,7 @@ export class NeuInlineEditorComponent extends NeuTextControl {
|
|
|
87
87
|
><text class="label">{{ value() || placeholder() }}</text></pressable
|
|
88
88
|
>
|
|
89
89
|
}
|
|
90
|
-
</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"], dependencies: [{ kind: "directive", type: NeuNativeTextSyncDirective, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"] }, { 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: TextInput, selector: "text-input", inputs: ["neuralValue", "neuralRemeasure"], outputs: ["neuralValueChange"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: NeuButtonComponent, selector: "neu-button", inputs: ["label", "accessibilityLabel", "variant", "tone", "size", "fullWidth", "disabled", "loading"], outputs: ["pressed"] }] });
|
|
90
|
+
</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"], dependencies: [{ kind: "directive", type: NeuNativeTextSyncDirective, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"] }, { 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: TextInput, selector: "text-input", inputs: ["neuralValue", "neuralRemeasure"], outputs: ["neuralValueChange"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: NeuButtonComponent, selector: "neu-button", inputs: ["haptic", "label", "accessibilityLabel", "variant", "tone", "size", "fullWidth", "disabled", "loading"], outputs: ["pressed"] }] });
|
|
91
91
|
}
|
|
92
92
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuInlineEditorComponent, decorators: [{
|
|
93
93
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|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CAAC,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAChC,CAAC;IACS,MAAM;QACd,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;uGAjCU,wBAAwB;2FAAxB,wBAAwB,qtBA5CzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyCF,gqIAhDN,0BAA0B,+FAC1B,IAAI,iDACJ,IAAI,mYACJ,SAAS,mIACT,SAAS,mGACT,kBAAkB;;2FA8CT,wBAAwB;kBAtDpC,SAAS;+BACE,mBAAmB,WACpB;wBACP,0BAA0B;wBAC1B,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,SAAS;wBACT,kBAAkB;qBACnB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyCF","sourcesContent":["import {\n Component,\n input,\n model,\n output,\n signal,\n effect,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';\nimport { NeuTextControl } from '../foundation/mobile.js';\nimport { NeuButtonComponent } from '../button/button.js';\n\nimport { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';\n\n@Component({\n selector: 'neu-inline-editor',\n imports: [\n NeuNativeTextSyncDirective,\n View,\n Text,\n TextInput,\n Pressable,\n NeuButtonComponent,\n ],\n template: `<view class=\"stack\">\n @if (editing()) {\n <text class=\"label\" [nativeID]=\"labelNativeId\">{{ label() }}</text>\n <text-input\n neuSyncText\n #textSync=\"neuSyncText\"\n (changeText)=\"textSync.synchronize()\"\n class=\"control\"\n [neuralValue]=\"draft()\"\n (neuralValueChange)=\"draft.set($event)\"\n [accessibilityLabel]=\"label()\"\n [accessibilityLabelledBy]=\"label() ? labelNativeId : undefined\"\n [accessibilityHint]=\"fieldHint()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (submitEditing)=\"save()\"\n /><view class=\"row\"\n ><neu-button\n [label]=\"saveLabel()\"\n size=\"sm\"\n [disabled]=\"\n disabled() || readonly() || (required() && !draft().trim())\n \"\n (pressed)=\"save()\" /><neu-button\n [label]=\"cancelLabel()\"\n size=\"sm\"\n variant=\"text\"\n (pressed)=\"cancel()\"\n /></view>\n } @else {\n <pressable\n class=\"control\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"label()\"\n [accessibilityValue]=\"{ text: value() || placeholder() }\"\n [disabled]=\"disabled() || readonly()\"\n (press)=\"begin()\"\n ><text class=\"label\">{{ value() || placeholder() }}</text></pressable\n >\n }\n </view>`,\n styleUrl: '../foundation/mobile.css',\n})\nexport class NeuInlineEditorComponent extends NeuTextControl {\n readonly editing = model(false);\n readonly placeholder = input('Tap to edit');\n readonly saveLabel = input('Save');\n readonly cancelLabel = input('Cancel');\n readonly saved = output<string>();\n readonly cancelled = output<void>();\n protected readonly draft = signal('');\n constructor() {\n super();\n effect(() => {\n if (this.editing()) this.draft.set(this.value());\n });\n }\n protected begin(): void {\n if (!this.disabled() && !this.readonly()) this.editing.set(true);\n }\n protected save(): void {\n if (\n this.disabled() ||\n this.readonly() ||\n !this.editing() ||\n (this.required() && !this.draft().trim())\n )\n return;\n this.accept(this.draft());\n this.editing.set(false);\n this.saved.emit(this.value());\n }\n protected cancel(): void {\n this.editing.set(false);\n this.draft.set(this.value());\n this.cancelled.emit();\n }\n}\n"]}
|
|
@@ -5,6 +5,8 @@ export declare function formatMask(value: string, mask: string): {
|
|
|
5
5
|
display: string;
|
|
6
6
|
};
|
|
7
7
|
export declare class NeuInputMaskComponent extends NeuTextControl {
|
|
8
|
+
private readonly theme;
|
|
9
|
+
protected readonly mutedColor: import("@angular/core").Signal<string>;
|
|
8
10
|
readonly mask: import("@angular/core").InputSignal<string>;
|
|
9
11
|
readonly keyboardType: import("@angular/core").InputSignal<"default" | "numeric" | "phone-pad">;
|
|
10
12
|
protected readonly maskGuide: import("@angular/core").Signal<string>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Component, input, computed, } from '@angular/core';
|
|
1
|
+
import { Component, input, computed, inject, } from '@angular/core';
|
|
2
2
|
import { View, Text } from '@ng-native/components';
|
|
3
3
|
import { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';
|
|
4
4
|
import { NeuTextControl } from '../foundation/mobile.js';
|
|
5
|
+
import { NEU_LIGHT_TOKENS, NEU_THEME } from '../foundation/index.js';
|
|
5
6
|
import { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export function formatMask(value, mask) {
|
|
@@ -33,6 +34,9 @@ export function formatMask(value, mask) {
|
|
|
33
34
|
return { raw, display };
|
|
34
35
|
}
|
|
35
36
|
export class NeuInputMaskComponent extends NeuTextControl {
|
|
37
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
38
|
+
mutedColor = computed(() => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "mutedColor" }] : /* istanbul ignore next */ []));
|
|
36
40
|
mask = input.required(/* @ts-ignore */
|
|
37
41
|
...(ngDevMode ? [{ debugName: "mask" }] : /* istanbul ignore next */ []));
|
|
38
42
|
keyboardType = input('default', /* @ts-ignore */
|
|
@@ -54,6 +58,7 @@ export class NeuInputMaskComponent extends NeuTextControl {
|
|
|
54
58
|
class="control"
|
|
55
59
|
[neuralValue]="formatted()"
|
|
56
60
|
[placeholder]="maskGuide()"
|
|
61
|
+
[placeholderTextColor]="mutedColor()"
|
|
57
62
|
[accessibilityLabel]="label()"
|
|
58
63
|
[accessibilityLabelledBy]="label() ? labelNativeId : undefined"
|
|
59
64
|
[accessibilityHint]="fieldHint()"
|
|
@@ -84,6 +89,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
|
|
|
84
89
|
class="control"
|
|
85
90
|
[neuralValue]="formatted()"
|
|
86
91
|
[placeholder]="maskGuide()"
|
|
92
|
+
[placeholderTextColor]="mutedColor()"
|
|
87
93
|
[accessibilityLabel]="label()"
|
|
88
94
|
[accessibilityLabelledBy]="label() ? labelNativeId : undefined"
|
|
89
95
|
[accessibilityHint]="fieldHint()"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-mask.js","sourceRoot":"","sources":["../../src/input-mask/input-mask.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"input-mask.js","sourceRoot":"","sources":["../../src/input-mask/input-mask.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,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,oCAAoC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA+BrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;;AA7B/E,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,IAAY;IAEZ,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,GAAG,GAAG,EAAE,EACV,OAAO,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;Q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AE,GAAG,CAAC;kFAAC,CAAC;IAC/D,SAAS,GAAG,QAAQ,CACrC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO;kFACpD,CAAC;IACQ,IAAI,CAAC,KAAa;QAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;uGAbU,qBAAqB;2FAArB,qBAAqB,8WA9BtB;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BF,gqIA5BE,0BAA0B,+FAAE,IAAI,iDAAE,IAAI,mYAAE,SAAS;;2FA+BhD,qBAAqB;kBAjCjC,SAAS;+BACE,gBAAgB,WACjB,CAAC,0BAA0B,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,YAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BF","sourcesContent":["import {\n Component,\n input,\n computed,\n inject,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';\nimport { NeuTextControl } from '../foundation/mobile.js';\nimport { NEU_LIGHT_TOKENS, NEU_THEME } from '../foundation/index.js';\n\nexport function formatMask(\n value: string,\n mask: string,\n): { raw: string; display: string } {\n const rest = Array.from(value);\n let raw = '',\n display = '';\n for (const token of mask) {\n const pattern =\n token === '#'\n ? /[0-9]/\n : token === 'A'\n ? /[a-zA-Z]/\n : token === '*'\n ? /[a-zA-Z0-9]/\n : null;\n if (!pattern) {\n if (rest[0] === token) rest.shift();\n if (rest.length) display += token;\n continue;\n }\n let char = rest.shift();\n while (char !== undefined && !pattern.test(char)) char = rest.shift();\n if (char === undefined) break;\n raw += char;\n display += char;\n }\n return { raw, display };\n}\nimport { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';\n\n@Component({\n selector: 'neu-input-mask',\n imports: [NeuNativeTextSyncDirective, View, Text, TextInput],\n template: `<view class=\"stack\"\n ><text class=\"label\" [nativeID]=\"labelNativeId\">{{ label() }}</text\n ><text-input\n neuSyncText\n #textSync=\"neuSyncText\"\n (changeText)=\"textSync.synchronize()\"\n class=\"control\"\n [neuralValue]=\"formatted()\"\n [placeholder]=\"maskGuide()\"\n [placeholderTextColor]=\"mutedColor()\"\n [accessibilityLabel]=\"label()\"\n [accessibilityLabelledBy]=\"label() ? labelNativeId : undefined\"\n [accessibilityHint]=\"fieldHint()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n [keyboardType]=\"keyboardType()\"\n (neuralValueChange)=\"edit($event)\"\n (touch)=\"touch.emit()\"\n />\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else {\n <text class=\"muted\">{{ hint() }}</text>\n }\n </view>`,\n styleUrl: '../foundation/mobile.css',\n})\nexport class NeuInputMaskComponent extends NeuTextControl {\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly mutedColor = computed(\n () => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted,\n );\n readonly mask = input.required<string>();\n readonly keyboardType = input<'default' | 'numeric' | 'phone-pad'>('default');\n protected readonly maskGuide = computed(() => this.mask().replace(/[#A*]/g, '_'));\n protected readonly formatted = computed(\n () => formatMask(this.value(), this.mask()).display,\n );\n protected edit(value: string): void {\n this.accept(formatMask(value, this.mask()).raw);\n }\n}\n"]}
|
|
@@ -104,7 +104,7 @@ export class NeuInputOtpComponent extends NeuTextControl {
|
|
|
104
104
|
} @else if (hint()) {
|
|
105
105
|
<text class="muted">{{ hint() }}</text>
|
|
106
106
|
}
|
|
107
|
-
</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", "\n .otp-positions {\n position: relative;\n gap: 6px;\n }\n .otp-row {\n flex-direction: row;\n gap: 6px;\n }\n .otp-position {\n flex-grow: 1;\n flex-basis: 0;\n min-width: 0;\n max-width: 44px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n border-width: 1px;\n border-radius: 10px;\n border-color: var(--neu-border, #a5afbf);\n background-color: var(--neu-surface, #ffffff);\n transition:\n border-color 150ms ease,\n background-color 150ms ease;\n }\n .otp-active {\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-tonal, #e9edfc);\n }\n .otp-invalid {\n border-color: var(--neu-danger, #b3261e);\n }\n .otp-disabled {\n opacity: 0.5;\n }\n .otp-digit {\n color: var(--neu-text, #172033);\n font-size: 20px;\n font-weight: 500;\n }\n .otp-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 48px;\n padding: 0;\n color: transparent;\n opacity: 0.01;\n }\n @media (prefers-reduced-motion: reduce) {\n .otp-position {\n transition: none;\n }\n }\n "], dependencies: [{ kind: "directive", type: NeuNativeTextSyncDirective, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"] }, { 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: TextInput, selector: "text-input", inputs: ["neuralValue", "neuralRemeasure"], outputs: ["neuralValueChange"] }] });
|
|
107
|
+
</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", "\n .otp-positions {\n position: relative;\n gap: 6px;\n }\n .otp-row {\n flex-direction: row;\n gap: 6px;\n }\n .otp-position {\n flex-grow: 1;\n flex-basis: 0;\n min-width: 0;\n max-width: 44px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n border-width: 1px;\n border-radius: 10px;\n border-color: var(--neu-border, #a5afbf);\n background-color: var(--neu-surface, #ffffff);\n transition:\n border-color 150ms ease,\n background-color 150ms ease;\n }\n .otp-active {\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-tonal, #e9edfc);\n }\n .otp-invalid {\n border-color: var(--neu-danger, #b3261e);\n }\n .otp-disabled {\n opacity: 0.5;\n }\n .otp-digit {\n color: var(--neu-text, #172033);\n font-size: 20px;\n font-weight: 500;\n }\n .otp-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 48px;\n padding: 0;\n color: transparent;\n opacity: 0.01;\n }\n @media (prefers-reduced-motion: reduce) {\n .otp-position {\n transition: none;\n }\n }\n "], dependencies: [{ kind: "directive", type: NeuNativeTextSyncDirective, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"] }, { 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: TextInput, selector: "text-input", inputs: ["neuralValue", "neuralRemeasure"], outputs: ["neuralValueChange"] }] });
|
|
108
108
|
}
|
|
109
109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuInputOtpComponent, decorators: [{
|
|
110
110
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp.js","sourceRoot":"","sources":["../../src/input-otp/input-otp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO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,\n computed,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n View,\n Text,\n type SelectionChangeEvent,\n} from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';\nimport { NeuTextControl, clamp } from '../foundation/mobile.js';\n\nimport { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';\n\n@Component({\n selector: 'neu-input-otp',\n imports: [NeuNativeTextSyncDirective, View, Text, Pressable, TextInput],\n template: `<view class=\"stack\"\n ><text class=\"label\">{{ label() }}</text\n ><view class=\"otp-positions\" [class.otp-disabled]=\"disabled()\">\n <text-input\n neuSyncText\n #textSync=\"neuSyncText\"\n (changeText)=\"textSync.synchronize()\"\n class=\"otp-input\"\n [neuralValue]=\"value()\"\n [maxLength]=\"digits()\"\n [accessibilityLabel]=\"label()\"\n keyboardType=\"number-pad\"\n textContentType=\"oneTimeCode\"\n autoComplete=\"one-time-code\"\n autoCapitalize=\"none\"\n [autoCorrect]=\"false\"\n [spellCheck]=\"false\"\n [caretHidden]=\"true\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n (neuralValueChange)=\"edit($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false)\"\n (selectionChange)=\"selectionChanged($event)\"\n (touch)=\"touch.emit()\"\n />\n @for (row of rows(); track $index) {\n <view class=\"otp-row\">\n @for (position of row; track position) {\n <pressable\n class=\"otp-position\"\n [class.otp-active]=\"focused() && activePosition() === position\"\n [class.otp-invalid]=\"invalid()\"\n [accessible]=\"false\"\n [focusable]=\"false\"\n [disabled]=\"disabled() || readonly()\"\n [testID]=\"'otp-position-' + position\"\n (press)=\"focusPosition(position)\"\n ><text\n class=\"otp-digit\"\n [accessible]=\"false\"\n pointerEvents=\"none\"\n >{{ value()[position] || ' ' }}</text\n ></pressable\n >\n }\n </view>\n }\n </view>\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else if (hint()) {\n <text class=\"muted\">{{ hint() }}</text>\n }\n </view>`,\n styleUrl: '../foundation/mobile.css',\n styles: `\n .otp-positions {\n position: relative;\n gap: 6px;\n }\n .otp-row {\n flex-direction: row;\n gap: 6px;\n }\n .otp-position {\n flex-grow: 1;\n flex-basis: 0;\n min-width: 0;\n max-width: 44px;\n min-height: 48px;\n align-items: center;\n justify-content: center;\n border-width: 1px;\n border-radius: 10px;\n border-color: var(--neu-border, #a5afbf);\n background-color: var(--neu-surface, #ffffff);\n transition:\n border-color 150ms ease,\n background-color 150ms ease;\n }\n .otp-active {\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-tonal, #e9edfc);\n }\n .otp-invalid {\n border-color: var(--neu-danger, #b3261e);\n }\n .otp-disabled {\n opacity: 0.5;\n }\n .otp-digit {\n color: var(--neu-text, #172033);\n font-size: 20px;\n font-weight: 500;\n }\n .otp-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 48px;\n padding: 0;\n color: transparent;\n opacity: 0.01;\n }\n @media (prefers-reduced-motion: reduce) {\n .otp-position {\n transition: none;\n }\n }\n `,\n})\nexport class NeuInputOtpComponent extends NeuTextControl {\n readonly length = input(6);\n readonly completed = output<string>();\n protected readonly digits = computed(() =>\n Math.floor(clamp(this.length(), 1, 12)),\n );\n private readonly field = viewChild(TextInput);\n protected readonly rows = computed(() => {\n const positions = Array.from(\n { length: this.digits() },\n (_, index) => index,\n );\n return positions.length > 6\n ? [positions.slice(0, 6), positions.slice(6)]\n : [positions];\n });\n protected readonly focused = signal(false);\n private readonly selectionStart = signal(0);\n protected readonly activePosition = computed(() =>\n Math.min(this.selectionStart(), this.digits() - 1),\n );\n\n protected focusPosition(position: number): void {\n if (this.disabled() || this.readonly()) return;\n const start = Math.min(position, this.value().length);\n this.selectionStart.set(start);\n this.field()?.focus();\n this.field()?.setSelection(start, Math.min(start + 1, this.value().length));\n }\n\n protected selectionChanged(event: SelectionChangeEvent): void {\n this.selectionStart.set(Math.max(0, event.nativeEvent.selection.start));\n }\n protected edit(value: string): void {\n if (this.disabled() || this.readonly()) return;\n const next = value.replace(/[^0-9]/g, '').slice(0, this.digits());\n const changed = next !== this.value();\n this.accept(next);\n this.selectionStart.set(Math.min(next.length, this.digits() - 1));\n if (changed && next.length === this.digits()) this.completed.emit(next);\n }\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class NeuInputTagsComponent {
|
|
3
|
+
private readonly theme;
|
|
4
|
+
protected readonly mutedColor: import("@angular/core").Signal<string>;
|
|
3
5
|
protected readonly plus = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M12 5v14M5 12h14\"/></svg>";
|
|
4
6
|
readonly label: import("@angular/core").InputSignal<string>;
|
|
5
7
|
readonly value: import("@angular/core").ModelSignal<readonly string[]>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { booleanAttribute, Component, input, model, output, signal, } from '@angular/core';
|
|
1
|
+
import { booleanAttribute, Component, computed, inject, input, model, output, signal, } from '@angular/core';
|
|
2
2
|
import { View, Text } from '@ng-native/components';
|
|
3
3
|
import { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';
|
|
4
4
|
import { NeuIconButtonComponent } from '../icon-button/icon-button.js';
|
|
5
5
|
import { NeuChipComponent } from '../chip/chip.js';
|
|
6
|
-
import { NEU_PLUS_ICON } from '../foundation/index.js';
|
|
6
|
+
import { NEU_LIGHT_TOKENS, NEU_PLUS_ICON, NEU_THEME } from '../foundation/index.js';
|
|
7
7
|
import { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export class NeuInputTagsComponent {
|
|
10
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
11
|
+
mutedColor = computed(() => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "mutedColor" }] : /* istanbul ignore next */ []));
|
|
10
13
|
plus = NEU_PLUS_ICON;
|
|
11
14
|
label = input.required(/* @ts-ignore */
|
|
12
15
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -61,6 +64,7 @@ export class NeuInputTagsComponent {
|
|
|
61
64
|
(neuralValueChange)="draft.set($event)"
|
|
62
65
|
[accessibilityLabel]="label()"
|
|
63
66
|
[placeholder]="placeholder()"
|
|
67
|
+
[placeholderTextColor]="mutedColor()"
|
|
64
68
|
[disabled]="disabled()"
|
|
65
69
|
[readonly]="readonly()"
|
|
66
70
|
(submitEditing)="add()" /><neu-icon-button
|
|
@@ -89,7 +93,7 @@ export class NeuInputTagsComponent {
|
|
|
89
93
|
}
|
|
90
94
|
</view>
|
|
91
95
|
}
|
|
92
|
-
</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", "\n .label { font-weight: 500; }\n .tag-editor { flex-direction: row; align-items: center; gap: 8px; }\n .tag-entry { min-height: 48px; min-width: 0; }\n .tag-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }\n "], dependencies: [{ kind: "directive", type: NeuNativeTextSyncDirective, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"] }, { 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: TextInput, selector: "text-input", inputs: ["neuralValue", "neuralRemeasure"], outputs: ["neuralValueChange"] }, { kind: "component", type: NeuChipComponent, selector: "neu-chip", inputs: ["label", "tone", "selected", "selectable", "removable", "disabled", "removeLabel"], outputs: ["selectedChange", "removed"] }, { kind: "component", type: NeuIconButtonComponent, selector: "neu-icon-button", inputs: ["label", "svg", "variant", "tone", "disabled", "loading"], outputs: ["pressed"] }] });
|
|
96
|
+
</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", "\n .label { font-weight: 500; }\n .tag-editor { flex-direction: row; align-items: center; gap: 8px; }\n .tag-entry { min-height: 48px; min-width: 0; }\n .tag-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }\n "], dependencies: [{ kind: "directive", type: NeuNativeTextSyncDirective, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"] }, { 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: TextInput, selector: "text-input", inputs: ["neuralValue", "neuralRemeasure"], outputs: ["neuralValueChange"] }, { kind: "component", type: NeuChipComponent, selector: "neu-chip", inputs: ["label", "tone", "selected", "selectable", "removable", "disabled", "removeLabel"], outputs: ["selectedChange", "removed"] }, { kind: "component", type: NeuIconButtonComponent, selector: "neu-icon-button", inputs: ["haptic", "label", "svg", "variant", "tone", "disabled", "loading"], outputs: ["pressed"] }] });
|
|
93
97
|
}
|
|
94
98
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuInputTagsComponent, decorators: [{
|
|
95
99
|
type: Component,
|
|
@@ -112,6 +116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
|
|
|
112
116
|
(neuralValueChange)="draft.set($event)"
|
|
113
117
|
[accessibilityLabel]="label()"
|
|
114
118
|
[placeholder]="placeholder()"
|
|
119
|
+
[placeholderTextColor]="mutedColor()"
|
|
115
120
|
[disabled]="disabled()"
|
|
116
121
|
[readonly]="readonly()"
|
|
117
122
|
(submitEditing)="add()" /><neu-icon-button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-tags.js","sourceRoot":"","sources":["../../src/input-tags/input-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"input-tags.js","sourceRoot":"","sources":["../../src/input-tags/input-tags.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,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;;AA8D/E,MAAM,OAAO,qBAAqB;IACf,KAAK,GAA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IAAI,CAAC,CAAC;YACvC,OAAO;QACT,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IACS,MAAM,CAAC,GAAW;QAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACrD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;uGAnCU,qBAAqB;2FAArB,qBAAqB,ioCAlDtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyCF,04IAhDN,0BAA0B,+FAC1B,IAAI,iDACJ,IAAI,mYACJ,SAAS,mIACT,gBAAgB,0LAChB,sBAAsB;;2FAoDb,qBAAqB;kBA5DjC,SAAS;+BACE,gBAAgB,WACjB;wBACP,0BAA0B;wBAC1B,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,gBAAgB;wBAChB,sBAAsB;qBACvB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyCF","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 } from '@ng-native/components';\nimport { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';\nimport { NeuIconButtonComponent } from '../icon-button/icon-button.js';\nimport { NeuChipComponent } from '../chip/chip.js';\nimport { NEU_LIGHT_TOKENS, NEU_PLUS_ICON, NEU_THEME } from '../foundation/index.js';\n\nimport { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';\n\n@Component({\n selector: 'neu-input-tags',\n imports: [\n NeuNativeTextSyncDirective,\n View,\n Text,\n TextInput,\n NeuChipComponent,\n NeuIconButtonComponent,\n ],\n template: `<view class=\"stack\"\n ><text class=\"label\">{{ label() }}</text\n >@if (!readonly()) { <view class=\"tag-editor\"\n ><text-input\n neuSyncText\n #textSync=\"neuSyncText\"\n (changeText)=\"textSync.synchronize()\"\n class=\"control grow tag-entry\"\n [neuralValue]=\"draft()\"\n (neuralValueChange)=\"draft.set($event)\"\n [accessibilityLabel]=\"label()\"\n [placeholder]=\"placeholder()\"\n [placeholderTextColor]=\"mutedColor()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (submitEditing)=\"add()\" /><neu-icon-button\n [svg]=\"plus\"\n variant=\"tonal\"\n [label]=\"addLabel()\"\n [disabled]=\"\n disabled() || readonly() || !draft().trim() || value().length >= max()\n \"\n (pressed)=\"add()\"\n /></view> }\n @if (message()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ message() }}</text>\n }\n @if (value().length) {\n <view class=\"tag-list\">\n @for (tag of value(); track tag) {\n <neu-chip\n [label]=\"tag\"\n [selectable]=\"false\"\n [removable]=\"!readonly()\"\n [disabled]=\"disabled()\"\n [removeLabel]=\"removeLabel()\"\n (removed)=\"remove(tag)\"\n />\n }\n </view>\n }\n </view>`,\n styleUrl: '../foundation/mobile.css',\n styles: `\n .label { font-weight: 500; }\n .tag-editor { flex-direction: row; align-items: center; gap: 8px; }\n .tag-entry { min-height: 48px; min-width: 0; }\n .tag-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }\n `,\n})\nexport class NeuInputTagsComponent {\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly mutedColor = computed(\n () => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted,\n );\n protected readonly plus = NEU_PLUS_ICON;\n readonly label = input.required<string>();\n readonly value = model<readonly string[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly max = input(20);\n readonly addLabel = input('Add');\n readonly placeholder = input('');\n readonly removeLabel = input('Remove');\n readonly touch = output<void>();\n protected readonly draft = signal('');\n protected readonly message = signal('');\n protected add(): void {\n if (this.disabled() || this.readonly()) return;\n const text = this.draft().trim();\n if (!text || this.value().length >= this.max()) return;\n if (this.value().includes(text)) {\n this.message.set('Duplicate: ' + text);\n return;\n }\n this.value.update((x) => [...x, text]);\n this.draft.set('');\n this.message.set('');\n this.touch.emit();\n }\n protected remove(tag: string): void {\n if (!this.disabled() && !this.readonly()) {\n this.value.update((x) => x.filter((t) => t !== tag));\n this.touch.emit();\n }\n }\n}\n"]}
|
package/dist/listbox/listbox.js
CHANGED
|
@@ -85,7 +85,7 @@ export class NeuListboxComponent {
|
|
|
85
85
|
} @empty {
|
|
86
86
|
<text class="muted">{{ emptyLabel() }}</text>
|
|
87
87
|
}
|
|
88
|
-
</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", ".plain { gap: 6px; }\n.plain .action {\n min-height: 48px;\n padding: 10px 12px;\n border-radius: 8px;\n background-color: transparent;\n}\n.plain .action.selected { background-color: var(--neu-tonal, #eff6ff); }\n.plain .option-content { min-width: 0; gap: 4px; }\n.plain .option-title { color: var(--neu-text, #172033); font-size: var(--neu-row-size, 15px); line-height: var(--neu-row-line, 21px); font-weight: 500; }\n.plain .option-description { color: var(--neu-muted, #596477); font-size: var(--neu-caption-size, 13px); line-height: var(--neu-caption-line, 18px); }\n.plain .selected-text { color: var(--neu-accent-ink, #3155d9); }\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: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
88
|
+
</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", ".plain { gap: 6px; }\n.plain .action {\n min-height: 48px;\n padding: 10px 12px;\n border-radius: 8px;\n background-color: transparent;\n}\n.plain .action.selected { background-color: var(--neu-tonal, #eff6ff); }\n.plain .option-content { min-width: 0; gap: 4px; }\n.plain .option-title { color: var(--neu-text, #172033); font-size: var(--neu-row-size, 15px); line-height: var(--neu-row-line, 21px); font-weight: 500; }\n.plain .option-description { color: var(--neu-muted, #596477); font-size: var(--neu-caption-size, 13px); line-height: var(--neu-caption-line, 18px); }\n.plain .selected-text { color: var(--neu-accent-ink, #3155d9); }\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: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
89
89
|
}
|
|
90
90
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuListboxComponent, decorators: [{
|
|
91
91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C,CAAC;IACjE,MAAM,CAAC,IAAe;QAC9B,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAChE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CACZ,IAAI,CAAC,QAAQ,EAAE;YACb,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;gBAClC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACd,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;uGA5BU,mBAAmB;2FAAnB,mBAAmB,g1CAMc,uBAAuB,gEAnDzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA0CF,uyJA3CE,IAAI,iDAAE,IAAI,mYAAE,SAAS,mGAAE,gBAAgB;;2FA8CtC,mBAAmB;kBAhD/B,SAAS;+BACE,aAAa,WACd,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,CAAC,YACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA0CF;meASoC,uBAAuB","sourcesContent":["import {\n booleanAttribute,\n Component,\n contentChild,\n TemplateRef,\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 { NgTemplateOutlet } from '@angular/common';\nimport { NeuListboxItemDirective, type NeuListboxItemContext } from './listbox-templates.js';\nimport { NeuOption, uniqueOptions } from '../foundation/mobile.js';\n\n@Component({\n selector: 'neu-listbox',\n imports: [View, Text, Pressable, NgTemplateOutlet],\n template: `<view\n class=\"stack\"\n [class.plain]=\"appearance() === 'plain'\"\n [accessibilityRole]=\"multiple() ? undefined : 'radiogroup'\"\n [accessibilityLabel]=\"label()\"\n >\n @for (item of choices(); track item.id) {\n <pressable\n class=\"row action\"\n [class.selected]=\"value().includes(item.id)\"\n [accessibilityRole]=\"multiple() ? 'checkbox' : 'radio'\"\n [accessibilityLabel]=\"item.label\"\n [accessibilityState]=\"{\n checked: value().includes(item.id),\n disabled: disabled() || readonly() || item.disabled,\n }\"\n [disabled]=\"disabled() || readonly() || !!item.disabled\"\n [class.neu-unavailable]=\"disabled() || readonly() || item.disabled\"\n (press)=\"choose(item)\"\n ><view class=\"grow stack option-content\"\n >@if (resolvedItemTemplate(); as customItem) {\n <ng-container [ngTemplateOutlet]=\"customItem\" [ngTemplateOutletContext]=\"{ $implicit: item, index: $index, selected: value().includes(item.id), disabled: disabled() || readonly() || !!item.disabled }\" />\n } @else {\n <text\n [class]=\"value().includes(item.id) ? 'option-title selected-text' : 'option-title label'\"\n >{{ item.label }}</text\n >\n @if (item.description) {\n <text\n [class]=\"value().includes(item.id) ? 'option-description selected-text' : 'option-description muted'\"\n >{{ item.description }}</text\n >\n }\n }</view\n ><text\n [class]=\"value().includes(item.id) ? 'selected-text' : 'label'\"\n >{{ value().includes(item.id) ? '✓' : '' }}</text\n ></pressable\n >\n } @empty {\n <text class=\"muted\">{{ emptyLabel() }}</text>\n }\n </view>`,\n styleUrls: ['../foundation/mobile.css', './listbox.css'],\n})\nexport class NeuListboxComponent {\n readonly label = input.required<string>();\n readonly options = input<readonly NeuOption[]>([]);\n readonly appearance = input<'cards' | 'plain'>('cards');\n /** Explicit template takes precedence over a projected neuListboxItem. */\n readonly itemTemplate = input<TemplateRef<NeuListboxItemContext>>();\n private readonly itemContent = contentChild(NeuListboxItemDirective);\n protected readonly resolvedItemTemplate = computed(() => this.itemTemplate() ?? this.itemContent()?.templateRef);\n readonly value = model<readonly string[]>([]);\n readonly multiple = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly emptyLabel = input('No options');\n readonly selected = output<string>();\n readonly touch = output<void>();\n protected readonly choices = computed(() => uniqueOptions(this.options()));\n protected choose(item: NeuOption): void {\n if (this.disabled() || this.readonly() || item.disabled) return;\n const ids = this.value();\n this.value.set(\n this.multiple()\n ? ids.includes(item.id)\n ? ids.filter((x) => x !== item.id)\n : [...ids, item.id]\n : [item.id],\n );\n this.selected.emit(item.id);\n this.touch.emit();\n }\n}\n"]}
|
package/dist/menu/menu.js
CHANGED
|
@@ -56,7 +56,7 @@ export class NeuMenuComponent {
|
|
|
56
56
|
}
|
|
57
57
|
</view>
|
|
58
58
|
</neu-anchored-overlay>
|
|
59
|
-
</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", ".menu-trigger { min-height: 48px; align-self: flex-start; max-width: 100%; flex-direction: row; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border-width: 1px; border-color: var(--neu-border); background-color: var(--neu-surface); }\n.menu-item { min-height: 48px; gap: 4px; padding: 14px 12px; }\n\n.menu-item .label { font-size: var(--neu-row-size, 15px); line-height: var(--neu-row-line, 21px); font-weight: 500; } .menu-item .muted { font-size: var(--neu-caption-size, 13px); line-height: var(--neu-caption-line, 18px); }\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: NeuAnchoredOverlayComponent, selector: "neu-anchored-overlay", inputs: ["open", "anchor", "closeLabel", "minimumWidth", "gap"], outputs: ["openChange"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
|
|
59
|
+
</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", ".menu-trigger { min-height: 48px; align-self: flex-start; max-width: 100%; flex-direction: row; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border-width: 1px; border-color: var(--neu-border); background-color: var(--neu-surface); }\n.menu-item { min-height: 48px; gap: 4px; padding: 14px 12px; }\n\n.menu-item .label { font-size: var(--neu-row-size, 15px); line-height: var(--neu-row-line, 21px); font-weight: 500; } .menu-item .muted { font-size: var(--neu-caption-size, 13px); line-height: var(--neu-caption-line, 18px); }\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: NeuAnchoredOverlayComponent, selector: "neu-anchored-overlay", inputs: ["open", "anchor", "closeLabel", "minimumWidth", "gap"], outputs: ["openChange"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
|
|
60
60
|
}
|
|
61
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuMenuComponent, decorators: [{
|
|
62
62
|
type: Component,
|
package/dist/menu/menu.js.map
CHANGED
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2BAA2B;wBAC3B,MAAM;qBACP,YACS;;;;;;;;;;;;;;;;;;;;;;;;UAwBF;8tBAYiC,SAAS,OAAE,EAAE,IAAI,EAAE,CAAA,UAAoB,CAAA,EAAE,oEACtC,WAAW,OAAE,EAAE,IAAI,EAAE,CAAA,UAAoB,CAAA,EAAE","sourcesContent":["import {\n booleanAttribute,\n Component,\n input,\n model,\n output,\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 { NeuOption } from '../foundation/mobile.js';\nimport { NeuAnchoredOverlayComponent } from '../foundation/anchored-overlay.js';\nimport { NEU_CHEVRON_DOWN } from '../foundation/icons.js';\n\n@Component({\n selector: 'neu-menu',\n imports: [\n View,\n Text,\n Pressable,\n NeuAnchoredOverlayComponent,\n NgIcon,\n ],\n template: `<view class=\"stack\" #container [collapsable]=\"false\">\n @if (showTrigger()) {\n <pressable\n class=\"menu-trigger\" #trigger=\"pressable\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"label()\"\n [disabled]=\"disabled()\"\n [accessibilityState]=\"{ expanded: open(), disabled: disabled() }\"\n (press)=\"show()\"\n ><text class=\"label\">{{ label() }}</text><ng-icon [svg]=\"chevron\" [size]=\"18\" color=\"var(--neu-accent)\" /></pressable\n >\n }\n <neu-anchored-overlay [(open)]=\"open\" [anchor]=\"anchorRef()?.nativeElement ?? containerRef()?.nativeElement\" [minimumWidth]=\"240\" [closeLabel]=\"closeLabel()\">\n <view accessibilityRole=\"menu\" [accessibilityLabel]=\"label()\">\n @for (item of items(); track item.id) {\n <pressable class=\"menu-item\" accessibilityRole=\"menuitem\" [accessibilityLabel]=\"item.label\"\n [accessibilityState]=\"{ disabled: disabled() || !!item.disabled }\" [disabled]=\"disabled() || !!item.disabled\"\n [class.neu-unavailable]=\"disabled() || item.disabled\" (press)=\"activate(item.id)\">\n <text class=\"label\">{{ item.label }}</text>\n @if (item.description) { <text class=\"muted\">{{ item.description }}</text> }\n </pressable>\n }\n </view>\n </neu-anchored-overlay>\n </view>`,\n styleUrls: ['../foundation/mobile.css', './menu.css'],\n})\nexport class NeuMenuComponent {\n readonly label = input.required<string>();\n readonly showTrigger = input(true, { transform: booleanAttribute });\n readonly closeLabel = input('Dismiss menu');\n readonly items = input<readonly NeuOption[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly open = model(false);\n readonly activated = output<string>();\n protected readonly chevron = NEU_CHEVRON_DOWN;\n protected readonly anchorRef = viewChild('trigger', { read: ElementRef<HostNode> });\n protected readonly containerRef = viewChild('container', { read: ElementRef<HostNode> });\n protected show(): void {\n if (!this.disabled()) this.open.set(true);\n }\n protected activate(id: string): void {\n if (\n this.open() && !this.disabled() &&\n this.items().some((x) => x.id === id && !x.disabled)\n ) {\n this.open.set(false);\n this.activated.emit(id);\n }\n }\n}\n"]}
|
package/dist/modal/modal.js
CHANGED
|
@@ -100,7 +100,7 @@ export class NeuModalComponent {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
</view></keyboard-avoiding-view></safe-area-view></safe-area-provider
|
|
103
|
-
></modal>`, isInline: true, styles: [".neu-unavailable > * {\n /* Fade presentation children without changing the accessible action's own alpha. */\n opacity: 0.45;\n}\n.stack {\n gap: 12px;\n}\n.row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n}\n.wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex: 1;\n}\n.surface {\n padding: 16px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-surface-radius, 16px);\n gap: 12px;\n}\n.outline {\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n}\n.title {\n color: var(--neu-text, #172033);\n font-size: var(--neu-heading-size, 18px);\n line-height: 24px;\n font-weight: 600;\n flex-shrink: 1;\n}\n.label {\n color: var(--neu-text, #172033);\n font-size: 16px;\n flex-shrink: 1;\n}\n.muted {\n color: var(--neu-muted, #596477);\n font-size: var(--neu-label-size, 14px);\n line-height: 20px;\n flex-shrink: 1;\n}\n.error {\n color: var(--neu-danger-ink, #b3261e);\n font-size: 14px;\n}\n.action {\n min-height: 48px;\n min-width: 48px;\n padding: 12px;\n justify-content: center;\n align-items: center;\n border-radius: 12px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.selected-text {\n color: var(--neu-on-accent, #ffffff);\n font-size: 16px;\n}\n.control {\n min-height: 48px;\n padding: 12px;\n font-size: 16px;\n color: var(--neu-text, #172033);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n border-radius: var(--neu-control-radius, 10px);\n background-color: var(--neu-surface, #ffffff);\n}\n.track {\n height: 8px;\n border-radius: 4px;\n overflow: hidden;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.fill {\n height: 8px;\n background-color: var(--neu-accent, #3155d9);\n}\n.dot {\n width: 20px;\n height: 20px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n border-radius: 10px;\n}\n.dot-selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.avatar {\n width: 48px;\n height: 48px;\n border-radius: 24px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-tonal, #e9edfc);\n overflow: hidden;\n}\n.avatar-image {\n width: 48px;\n height: 48px;\n}\n.backdrop {\n flex: 1;\n background-color: rgba(0, 0, 0, 0.4);\n justify-content: center;\n padding: 16px;\n}\n.bottom {\n justify-content: flex-end;\n}\n.modal-layout {\n flex: 1;\n justify-content: center;\n}\n.modal-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n}\n.scroll-content {\n padding-right: 12px;\n}\n.sheet {\n padding: 20px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-dialog-radius, 24px);\n gap: 16px;\n max-height: 90%;\n}\n.full {\n flex: 1;\n}\n.sheet-background {\n background-color: var(--neu-surface, #ffffff);\n}\n.page-sheet {\n max-height: 100%;\n border-radius: 0;\n}\n.thumb {\n width: 72px;\n height: 72px;\n border-radius: 12px;\n}\n.hero {\n height: 240px;\n width: 100%;\n}\n.divider {\n height: 1px;\n background-color: var(--neu-divider, #e7ebf0);\n}\n.skeleton {\n background-color: var(--neu-border, #a5afbf);\n border-radius: 8px;\n}\n.pill {\n padding: 4px 10px;\n border-radius: 16px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.calendar-grid {\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0;\n}\n.calendar-day {\n width: 14.2857%;\n min-width: 0;\n min-height: 48px;\n padding: 4px;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n.speed-dial {\n align-items: flex-end;\n}\n.fab {\n width: 56px;\n height: 56px;\n border-radius: 28px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #3155d9);\n}\n.fab-label {\n color: var(--neu-on-accent, #ffffff);\n font-size: 28px;\n}\n.slider-track {\n width: 100%;\n height: 24px;\n position: relative;\n}\n.slider-rail {\n position: absolute;\n top: 8px;\n}\n.slider-thumb {\n width: 24px;\n height: 24px;\n border-radius: 12px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-on-accent, #ffffff);\n position: absolute;\n top: 0;\n}\n", ".modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated"] }, { kind: "component", type: SafeAreaProvider, selector: "safe-area-provider", inputs: ["reportInsets"] }, { kind: "directive", type: SafeAreaView, selector: "safe-area-view", inputs: ["edges", "mode"] }, { kind: "component", type: KeyboardAvoidingView, selector: "keyboard-avoiding-view", inputs: ["behavior", "contentContainerStyle", "contentContainerClass", "enabled", "keyboardVerticalOffset"] }, { kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
103
|
+
></modal>`, isInline: true, styles: [".neu-unavailable > * {\n /* Fade presentation children without changing the accessible action's own alpha. */\n opacity: 0.45;\n}\n.stack {\n gap: 12px;\n}\n.row {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n}\n.wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex: 1;\n}\n.surface {\n padding: 16px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-surface-radius, 16px);\n gap: 12px;\n}\n.outline {\n border-width: 1px;\n border-color: var(--neu-surface-border, #e1e6ed);\n}\n.title {\n color: var(--neu-text, #172033);\n font-size: var(--neu-heading-size, 18px);\n line-height: 24px;\n font-weight: 600;\n flex-shrink: 1;\n}\n.label {\n color: var(--neu-text, #172033);\n font-size: 16px;\n flex-shrink: 1;\n}\n.muted {\n color: var(--neu-muted, #596477);\n font-size: var(--neu-label-size, 14px);\n line-height: 20px;\n flex-shrink: 1;\n}\n.error {\n color: var(--neu-danger-ink, #b3261e);\n font-size: 14px;\n}\n.action {\n min-height: 48px;\n min-width: 48px;\n padding: 12px;\n justify-content: center;\n align-items: center;\n border-radius: 12px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.selected-text {\n color: var(--neu-on-accent, #ffffff);\n font-size: 16px;\n}\n.control {\n min-height: 48px;\n padding: 12px;\n font-size: 16px;\n color: var(--neu-text, #172033);\n border-width: 1px;\n border-color: var(--neu-border, #a5afbf);\n border-radius: var(--neu-control-radius, 10px);\n background-color: var(--neu-surface, #ffffff);\n}\n.track {\n height: 8px;\n border-radius: 4px;\n overflow: hidden;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.fill {\n height: 8px;\n background-color: var(--neu-accent, #3155d9);\n}\n.dot {\n width: 20px;\n height: 20px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n border-radius: 10px;\n}\n.dot-selected {\n background-color: var(--neu-accent, #3155d9);\n}\n.avatar {\n width: 48px;\n height: 48px;\n border-radius: 24px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-tonal, #e9edfc);\n overflow: hidden;\n}\n.avatar-image {\n width: 48px;\n height: 48px;\n}\n.backdrop {\n flex: 1;\n background-color: rgba(0, 0, 0, 0.4);\n justify-content: center;\n padding: 16px;\n}\n.bottom {\n justify-content: flex-end;\n}\n.modal-layout {\n flex: 1;\n justify-content: center;\n}\n.modal-scroll {\n flex-grow: 0;\n flex-shrink: 1;\n}\n.scroll-content {\n padding-right: 12px;\n}\n.sheet {\n padding: 20px;\n background-color: var(--neu-surface, #ffffff);\n border-radius: var(--neu-dialog-radius, 24px);\n gap: 16px;\n max-height: 90%;\n}\n.full {\n flex: 1;\n}\n.sheet-background {\n background-color: var(--neu-surface, #ffffff);\n}\n.page-sheet {\n max-height: 100%;\n border-radius: 0;\n}\n.thumb {\n width: 72px;\n height: 72px;\n border-radius: 12px;\n}\n.hero {\n height: 240px;\n width: 100%;\n}\n.divider {\n height: 1px;\n background-color: var(--neu-divider, #e7ebf0);\n}\n.skeleton {\n background-color: var(--neu-border, #a5afbf);\n border-radius: 8px;\n}\n.pill {\n padding: 4px 10px;\n border-radius: 16px;\n background-color: var(--neu-tonal, #e9edfc);\n}\n.calendar-grid {\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0;\n}\n.calendar-day {\n width: 14.2857%;\n min-width: 0;\n min-height: 48px;\n padding: 4px;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n.speed-dial {\n align-items: flex-end;\n}\n.fab {\n width: 56px;\n height: 56px;\n border-radius: 28px;\n align-items: center;\n justify-content: center;\n background-color: var(--neu-accent, #3155d9);\n}\n.fab-label {\n color: var(--neu-on-accent, #ffffff);\n font-size: 28px;\n}\n.slider-track {\n width: 100%;\n height: 24px;\n position: relative;\n}\n.slider-rail {\n position: absolute;\n top: 8px;\n}\n.slider-thumb {\n width: 24px;\n height: 24px;\n border-radius: 12px;\n border-width: 2px;\n border-color: var(--neu-accent, #3155d9);\n background-color: var(--neu-on-accent, #ffffff);\n position: absolute;\n top: 0;\n}\n", ".modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }"], dependencies: [{ kind: "component", type: Modal, selector: "modal", inputs: ["visible", "transparent", "backdropColor", "animationType", "presentationStyle", "supportedOrientations", "allowSwipeDismissal", "statusBarTranslucent", "navigationBarTranslucent", "hardwareAccelerated", "anchor"] }, { kind: "component", type: SafeAreaProvider, selector: "safe-area-provider", inputs: ["reportInsets"] }, { kind: "directive", type: SafeAreaView, selector: "safe-area-view", inputs: ["edges", "mode"] }, { kind: "component", type: KeyboardAvoidingView, selector: "keyboard-avoiding-view", inputs: ["behavior", "contentContainerStyle", "contentContainerClass", "enabled", "keyboardVerticalOffset"] }, { kind: "directive", type: View, selector: "view" }, { kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: Pressable, selector: "pressable", inputs: ["haptic"], exportAs: ["pressable"] }, { kind: "component", type: ScrollView, selector: "scroll-view", inputs: ["contentContainerStyle", "contentContainerClass", "horizontal", "contentOffset", "maintainVisibleContentPosition", "keyboardShouldPersistTaps", "nestedScrollEnabled", "stickyHeaderIndices"], outputs: ["contentSizeChange"], exportAs: ["scrollView"] }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
104
104
|
}
|
|
105
105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuModalComponent, decorators: [{
|
|
106
106
|
type: Component,
|
package/dist/modal/modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa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BAAgB,yFAChB,YAAY,sFACZ,oBAAoB,gLACpB,IAAI,iDACJ,IAAI,mYACJ,SAAS,mGACT,UAAU,0TACV,aAAa,4DACb,gBAAgB;;2FAuDP,iBAAiB;kBAnE7B,SAAS;+BACE,WAAW,WACZ;wBACP,KAAK;wBACL,gBAAgB;wBAChB,YAAY;wBACZ,oBAAoB;wBACpB,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,UAAU;wBACV,aAAa;wBACb,gBAAgB;qBACjB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiDE;8NAwB6B,uBAAuB,wFACvB,uBAAuB","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport {\n View,\n Text,\n ScrollView,\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n KeyboardAvoidingView,\n} from '@ng-native/components';\nimport { Accessibility, Screen } from '@ng-native/device';\nimport { NeuNativePressable as Pressable } from '../foundation/native-pressable.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from '../foundation/motion.js';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NeuModalHeaderDirective, NeuModalFooterDirective } from './modal-templates.js';\n\n@Component({\n selector: 'neu-modal',\n imports: [\n Modal,\n SafeAreaProvider,\n SafeAreaView,\n KeyboardAvoidingView,\n View,\n Text,\n Pressable,\n ScrollView,\n AnimatedStyle,\n NgTemplateOutlet,\n ],\n template: `\n <modal [supportedOrientations]=\"['portrait', 'landscape']\"\n [visible]=\"motion.visible()\"\n [transparent]=\"true\"\n animationType=\"none\"\n (requestClose)=\"close('native')\"\n (show)=\"opened.emit()\"\n (dismiss)=\"dismissed.emit()\"\n ><safe-area-provider class=\"full\" [reportInsets]=\"false\"\n ><safe-area-view class=\"backdrop\" [animatedStyle]=\"backdropStyle\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\"\n ><keyboard-avoiding-view behavior=\"padding\" class=\"modal-layout\"\n ><view class=\"sheet\" [animatedStyle]=\"panelStyle\" [accessibilityViewIsModal]=\"open()\"\n ><view class=\"row\"\n ><view class=\"grow modal-heading\">\n @if (header(); as customHeader) {\n <ng-container [ngTemplateOutlet]=\"customHeader.templateRef\" />\n } @else {\n <text class=\"title\" accessibilityRole=\"header\">{{ title() }}</text>\n }\n </view>\n @if (dismissible() && showCloseButton()) {\n <pressable\n class=\"action modal-close\"\n accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\"\n (press)=\"close('action')\"\n ><text class=\"label\">×</text></pressable\n >\n }</view\n ><scroll-view\n class=\"modal-scroll\"\n keyboardShouldPersistTaps=\"handled\"\n ><view class=\"stack modal-scroll-content\">\n <view class=\"stack scroll-content\"><ng-content /></view>\n @if (footerScrolls()) {\n @if (footer(); as customFooter) {\n <view class=\"modal-footer\"><ng-container [ngTemplateOutlet]=\"customFooter.templateRef\" /></view>\n }\n }\n </view></scroll-view>\n @if (!footerScrolls()) {\n @if (footer(); as customFooter) {\n <view class=\"modal-footer\"><ng-container [ngTemplateOutlet]=\"customFooter.templateRef\" /></view>\n }\n }\n </view></keyboard-avoiding-view></safe-area-view></safe-area-provider\n ></modal>`,\n styleUrl: '../foundation/mobile.css',\n styles: '.modal-heading { min-width: 0; } .modal-close { background-color: transparent; padding: 0; } .modal-close .label { font-size: 20px; } .modal-scroll-content { gap: 16px; } .sheet { width: 100%; max-width: 420px; align-self: center; }',\n})\nexport class NeuModalComponent {\n private readonly screen = inject(Screen);\n private readonly accessibility = inject(Accessibility);\n // Keep actions fixed when there is room. Short windows and enlarged text need\n // one scrollable body so the footer cannot squeeze a focused field to zero.\n protected readonly footerScrolls = computed(() => {\n const height = this.screen.window().height;\n return height > 0 && height < 720 * Math.max(1, this.accessibility.fontScale());\n });\n readonly open = model(false);\n // Prefilled fields can relayout while the native presentation is mounting.\n // JS frames keep the transition attached across those layout commits.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly backdropStyle = { opacity: this.motion.progress };\n protected readonly panelStyle = {\n transform: [\n { translateY: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [8, 0] }) },\n { scale: this.motion.progress.interpolate({ inputRange: [0, 1], outputRange: [0.985, 1] }) },\n ],\n };\n protected readonly header = contentChild(NeuModalHeaderDirective);\n protected readonly footer = contentChild(NeuModalFooterDirective);\n readonly title = input.required<string>();\n readonly dismissible = input(true, { transform: booleanAttribute });\n readonly showCloseButton = input(true, { transform: booleanAttribute });\n readonly closeLabel = input('Close');\n readonly closed = output<'native' | 'action' | 'backdrop'>();\n /** Native presentation has finished; separate from the requested open state. */\n readonly opened = output<void>();\n /** iOS native dismissal has finished. Android does not emit this native event. */\n readonly dismissed = output<void>();\n close(reason: 'native' | 'action' | 'backdrop' = 'action'): void {\n if (this.dismissible() && this.open()) {\n this.open.set(false);\n this.closed.emit(reason);\n }\n }\n}\n"]}
|
package/dist/nav/nav.js
CHANGED
|
@@ -47,7 +47,7 @@ export class NeuNavComponent {
|
|
|
47
47
|
}}</text></pressable
|
|
48
48
|
>
|
|
49
49
|
}
|
|
50
|
-
</view>`, isInline: true, styles: [".neu-unavailable > * { opacity: 0.45; }\n.navigation-bar { flex-direction: row; align-items: stretch; border-top-width: 1px; border-color: var(--neu-divider, #e7ebf0); background-color: var(--neu-surface, #ffffff); }\n.navigation-item { position: relative; flex: 1; min-width: 0; min-height: 64px; padding: 8px 4px; gap: 4px; align-items: center; justify-content: center; }\n.navigation-icon { width: 24px; height: 24px; align-items: center; justify-content: center; }\n.navigation-label, .navigation-active-label { font-size: 12px; line-height: 16px; font-weight: 500; text-align: center; flex-shrink: 1; }\n.navigation-label { color: var(--neu-muted, #596477); }\n.navigation-active-label { color: var(--neu-accent-ink, #3155d9); }\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"] }] });
|
|
50
|
+
</view>`, isInline: true, styles: [".neu-unavailable > * { opacity: 0.45; }\n.navigation-bar { flex-direction: row; align-items: stretch; border-top-width: 1px; border-color: var(--neu-divider, #e7ebf0); background-color: var(--neu-surface, #ffffff); }\n.navigation-item { position: relative; flex: 1; min-width: 0; min-height: 64px; padding: 8px 4px; gap: 4px; align-items: center; justify-content: center; }\n.navigation-icon { width: 24px; height: 24px; align-items: center; justify-content: center; }\n.navigation-label, .navigation-active-label { font-size: 12px; line-height: 16px; font-weight: 500; text-align: center; flex-shrink: 1; }\n.navigation-label { color: var(--neu-muted, #596477); }\n.navigation-active-label { color: var(--neu-accent-ink, #3155d9); }\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"] }] });
|
|
51
51
|
}
|
|
52
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNavComponent, decorators: [{
|
|
53
53
|
type: Component,
|