@fractal-io-technology/spec 0.0.0-stage → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +165 -2
- package/conformance/1.0/action-cases.json +227 -0
- package/conformance/1.0/bind-cases.json +768 -0
- package/conformance/1.0/cases.json +25139 -0
- package/conformance/1.0/layout/01-onboarding-start.json +95 -0
- package/conformance/1.0/layout/02-home-discover.json +177 -0
- package/conformance/1.0/layout/03-filters.json +186 -0
- package/conformance/1.0/layout/README.md +145 -0
- package/conformance/1.0/layout/REPORT.md +222 -0
- package/conformance/1.0/layout/alert.json +22 -0
- package/conformance/1.0/layout/iphone-14-15-pro-107.json +272 -0
- package/conformance/1.0/layout/live_status_on_its_way_4.ios.json +100 -0
- package/conformance/1.0/layout/lucy-booking-mobile.json +261 -0
- package/conformance/1.0/layout/lucy-booking-tablet.json +817 -0
- package/conformance/1.0/layout/lucy-booking.json +185 -0
- package/conformance/1.0/layout/lucy-header.json +84 -0
- package/conformance/1.0/layout/lucy-welcome-pin-mobile.json +31 -0
- package/conformance/1.0/layout/lucy-welcome-pin.json +31 -0
- package/conformance/1.0/layout/measured/android/01-onboarding-start.json +95 -0
- package/conformance/1.0/layout/measured/android/02-home-discover.json +177 -0
- package/conformance/1.0/layout/measured/android/03-filters.json +186 -0
- package/conformance/1.0/layout/measured/android/alert.json +22 -0
- package/conformance/1.0/layout/measured/android/iphone-14-15-pro-107.json +272 -0
- package/conformance/1.0/layout/measured/android/live_status_on_its_way_4.ios.json +100 -0
- package/conformance/1.0/layout/measured/android/lucy-booking-mobile.json +261 -0
- package/conformance/1.0/layout/measured/android/lucy-booking-tablet.json +817 -0
- package/conformance/1.0/layout/measured/android/lucy-booking.json +185 -0
- package/conformance/1.0/layout/measured/android/lucy-header.json +84 -0
- package/conformance/1.0/layout/measured/android/lucy-welcome-pin-mobile.json +31 -0
- package/conformance/1.0/layout/measured/android/lucy-welcome-pin.json +31 -0
- package/conformance/1.0/layout/measured/android/navigation-bar.json +46 -0
- package/conformance/1.0/layout/measured/android/probe-alert-banner-flutter.json +37 -0
- package/conformance/1.0/layout/measured/android/probe-alert-banner-regression-flutter.json +51 -0
- package/conformance/1.0/layout/measured/android/probe-alert-banner-stack-flutter.json +29 -0
- package/conformance/1.0/layout/measured/android/probe-card.json +35 -0
- package/conformance/1.0/layout/measured/android/probe-check-box-flutter.json +20 -0
- package/conformance/1.0/layout/measured/android/probe-container-height.json +21 -0
- package/conformance/1.0/layout/measured/android/probe-divider.json +55 -0
- package/conformance/1.0/layout/measured/android/probe-dropdown-menu-flutter.json +24 -0
- package/conformance/1.0/layout/measured/android/probe-dropdown-menu-max-lines.json +11 -0
- package/conformance/1.0/layout/measured/android/probe-expanded.json +31 -0
- package/conformance/1.0/layout/measured/android/probe-failed-decode.json +11 -0
- package/conformance/1.0/layout/measured/android/probe-flex.json +43 -0
- package/conformance/1.0/layout/measured/android/probe-grid-flutter.json +78 -0
- package/conformance/1.0/layout/measured/android/probe-grid.json +29 -0
- package/conformance/1.0/layout/measured/android/probe-icon-button-flutter.json +25 -0
- package/conformance/1.0/layout/measured/android/probe-icon-flutter.json +19 -0
- package/conformance/1.0/layout/measured/android/probe-icon-sizing.json +36 -0
- package/conformance/1.0/layout/measured/android/probe-image-flutter.json +24 -0
- package/conformance/1.0/layout/measured/android/probe-list-flutter.json +79 -0
- package/conformance/1.0/layout/measured/android/probe-list-regression-flutter.json +94 -0
- package/conformance/1.0/layout/measured/android/probe-list-row-flutter.json +86 -0
- package/conformance/1.0/layout/measured/android/probe-list-styles.json +45 -0
- package/conformance/1.0/layout/measured/android/probe-pin-input-parity.json +18 -0
- package/conformance/1.0/layout/measured/android/probe-progress-track-flutter.json +41 -0
- package/conformance/1.0/layout/measured/android/probe-progress-track-regression-flutter.json +57 -0
- package/conformance/1.0/layout/measured/android/probe-row-column.json +84 -0
- package/conformance/1.0/layout/measured/android/probe-scroll.json +54 -0
- package/conformance/1.0/layout/measured/android/probe-search-flutter.json +22 -0
- package/conformance/1.0/layout/measured/android/probe-size-constraints.json +20 -0
- package/conformance/1.0/layout/measured/android/probe-spacer.json +43 -0
- package/conformance/1.0/layout/measured/android/probe-stat-progress-track.json +14 -0
- package/conformance/1.0/layout/measured/android/probe-text-button-flutter.json +27 -0
- package/conformance/1.0/layout/measured/android/probe-text-field-flutter.json +28 -0
- package/conformance/1.0/layout/measured/android/probe-text.json +30 -0
- package/conformance/1.0/layout/measured/android/wallet-home.json +127 -0
- package/conformance/1.0/layout/measured/web/01-onboarding-start.json +95 -0
- package/conformance/1.0/layout/measured/web/02-home-discover.json +177 -0
- package/conformance/1.0/layout/measured/web/03-filters.json +186 -0
- package/conformance/1.0/layout/measured/web/alert.json +22 -0
- package/conformance/1.0/layout/measured/web/iphone-14-15-pro-107.json +272 -0
- package/conformance/1.0/layout/measured/web/live_status_on_its_way_4.ios.json +100 -0
- package/conformance/1.0/layout/measured/web/lucy-booking-mobile.json +261 -0
- package/conformance/1.0/layout/measured/web/lucy-booking-tablet.json +817 -0
- package/conformance/1.0/layout/measured/web/lucy-booking.json +185 -0
- package/conformance/1.0/layout/measured/web/lucy-header.json +84 -0
- package/conformance/1.0/layout/measured/web/lucy-welcome-pin-mobile.json +31 -0
- package/conformance/1.0/layout/measured/web/lucy-welcome-pin.json +31 -0
- package/conformance/1.0/layout/measured/web/navigation-bar.json +46 -0
- package/conformance/1.0/layout/measured/web/probe-alert-banner-flutter.json +37 -0
- package/conformance/1.0/layout/measured/web/probe-alert-banner-regression-flutter.json +51 -0
- package/conformance/1.0/layout/measured/web/probe-alert-banner-stack-flutter.json +29 -0
- package/conformance/1.0/layout/measured/web/probe-card.json +35 -0
- package/conformance/1.0/layout/measured/web/probe-check-box-flutter.json +20 -0
- package/conformance/1.0/layout/measured/web/probe-container-height.json +21 -0
- package/conformance/1.0/layout/measured/web/probe-divider.json +55 -0
- package/conformance/1.0/layout/measured/web/probe-dropdown-menu-flutter.json +24 -0
- package/conformance/1.0/layout/measured/web/probe-dropdown-menu-max-lines.json +11 -0
- package/conformance/1.0/layout/measured/web/probe-expanded.json +31 -0
- package/conformance/1.0/layout/measured/web/probe-failed-decode.json +15 -0
- package/conformance/1.0/layout/measured/web/probe-flex.json +43 -0
- package/conformance/1.0/layout/measured/web/probe-grid-flutter.json +78 -0
- package/conformance/1.0/layout/measured/web/probe-grid.json +29 -0
- package/conformance/1.0/layout/measured/web/probe-icon-button-flutter.json +25 -0
- package/conformance/1.0/layout/measured/web/probe-icon-flutter.json +19 -0
- package/conformance/1.0/layout/measured/web/probe-icon-sizing.json +36 -0
- package/conformance/1.0/layout/measured/web/probe-image-flutter.json +24 -0
- package/conformance/1.0/layout/measured/web/probe-list-flutter.json +79 -0
- package/conformance/1.0/layout/measured/web/probe-list-regression-flutter.json +94 -0
- package/conformance/1.0/layout/measured/web/probe-list-row-flutter.json +86 -0
- package/conformance/1.0/layout/measured/web/probe-list-styles.json +45 -0
- package/conformance/1.0/layout/measured/web/probe-pin-input-parity.json +18 -0
- package/conformance/1.0/layout/measured/web/probe-progress-track-flutter.json +41 -0
- package/conformance/1.0/layout/measured/web/probe-progress-track-regression-flutter.json +57 -0
- package/conformance/1.0/layout/measured/web/probe-row-column.json +84 -0
- package/conformance/1.0/layout/measured/web/probe-scroll.json +54 -0
- package/conformance/1.0/layout/measured/web/probe-search-flutter.json +22 -0
- package/conformance/1.0/layout/measured/web/probe-size-constraints.json +20 -0
- package/conformance/1.0/layout/measured/web/probe-spacer.json +43 -0
- package/conformance/1.0/layout/measured/web/probe-stat-progress-track.json +14 -0
- package/conformance/1.0/layout/measured/web/probe-text-button-flutter.json +27 -0
- package/conformance/1.0/layout/measured/web/probe-text-field-flutter.json +28 -0
- package/conformance/1.0/layout/measured/web/probe-text.json +30 -0
- package/conformance/1.0/layout/measured/web/wallet-home.json +127 -0
- package/conformance/1.0/layout/navigation-bar.json +46 -0
- package/conformance/1.0/layout/probe-alert-banner-flutter.json +37 -0
- package/conformance/1.0/layout/probe-alert-banner-regression-flutter.json +51 -0
- package/conformance/1.0/layout/probe-alert-banner-stack-flutter.json +29 -0
- package/conformance/1.0/layout/probe-card.json +35 -0
- package/conformance/1.0/layout/probe-check-box-flutter.json +20 -0
- package/conformance/1.0/layout/probe-container-height.json +21 -0
- package/conformance/1.0/layout/probe-divider.json +55 -0
- package/conformance/1.0/layout/probe-dropdown-menu-flutter.json +24 -0
- package/conformance/1.0/layout/probe-dropdown-menu-max-lines.json +11 -0
- package/conformance/1.0/layout/probe-expanded.json +31 -0
- package/conformance/1.0/layout/probe-failed-decode.json +13 -0
- package/conformance/1.0/layout/probe-flex.json +43 -0
- package/conformance/1.0/layout/probe-grid-flutter.json +78 -0
- package/conformance/1.0/layout/probe-grid.json +29 -0
- package/conformance/1.0/layout/probe-icon-button-flutter.json +25 -0
- package/conformance/1.0/layout/probe-icon-flutter.json +19 -0
- package/conformance/1.0/layout/probe-icon-sizing.json +36 -0
- package/conformance/1.0/layout/probe-image-flutter.json +24 -0
- package/conformance/1.0/layout/probe-list-flutter.json +79 -0
- package/conformance/1.0/layout/probe-list-regression-flutter.json +94 -0
- package/conformance/1.0/layout/probe-list-row-flutter.json +86 -0
- package/conformance/1.0/layout/probe-list-styles.json +45 -0
- package/conformance/1.0/layout/probe-pin-input-parity.json +18 -0
- package/conformance/1.0/layout/probe-progress-track-flutter.json +41 -0
- package/conformance/1.0/layout/probe-progress-track-regression-flutter.json +57 -0
- package/conformance/1.0/layout/probe-row-column.json +84 -0
- package/conformance/1.0/layout/probe-scroll.json +54 -0
- package/conformance/1.0/layout/probe-search-flutter.json +22 -0
- package/conformance/1.0/layout/probe-size-constraints.json +20 -0
- package/conformance/1.0/layout/probe-spacer.json +43 -0
- package/conformance/1.0/layout/probe-stat-progress-track.json +14 -0
- package/conformance/1.0/layout/probe-text-button-flutter.json +27 -0
- package/conformance/1.0/layout/probe-text-field-flutter.json +28 -0
- package/conformance/1.0/layout/probe-text.json +30 -0
- package/conformance/1.0/layout/probes/probe-alert-banner-flutter.json +296 -0
- package/conformance/1.0/layout/probes/probe-alert-banner-regression-flutter.json +1 -0
- package/conformance/1.0/layout/probes/probe-alert-banner-stack-flutter.json +219 -0
- package/conformance/1.0/layout/probes/probe-card.json +252 -0
- package/conformance/1.0/layout/probes/probe-check-box-flutter.json +86 -0
- package/conformance/1.0/layout/probes/probe-container-height.json +147 -0
- package/conformance/1.0/layout/probes/probe-divider.json +469 -0
- package/conformance/1.0/layout/probes/probe-dropdown-menu-flutter.json +293 -0
- package/conformance/1.0/layout/probes/probe-dropdown-menu-max-lines.json +54 -0
- package/conformance/1.0/layout/probes/probe-expanded.json +208 -0
- package/conformance/1.0/layout/probes/probe-failed-decode.json +96 -0
- package/conformance/1.0/layout/probes/probe-flex.json +353 -0
- package/conformance/1.0/layout/probes/probe-grid-flutter.json +584 -0
- package/conformance/1.0/layout/probes/probe-grid.json +209 -0
- package/conformance/1.0/layout/probes/probe-icon-button-flutter.json +143 -0
- package/conformance/1.0/layout/probes/probe-icon-flutter.json +89 -0
- package/conformance/1.0/layout/probes/probe-icon-sizing.json +219 -0
- package/conformance/1.0/layout/probes/probe-image-flutter.json +130 -0
- package/conformance/1.0/layout/probes/probe-list-flutter.json +732 -0
- package/conformance/1.0/layout/probes/probe-list-regression-flutter.json +815 -0
- package/conformance/1.0/layout/probes/probe-list-row-flutter.json +734 -0
- package/conformance/1.0/layout/probes/probe-list-styles.json +332 -0
- package/conformance/1.0/layout/probes/probe-pin-input-parity.json +87 -0
- package/conformance/1.0/layout/probes/probe-progress-track-flutter.json +298 -0
- package/conformance/1.0/layout/probes/probe-progress-track-regression-flutter.json +525 -0
- package/conformance/1.0/layout/probes/probe-row-column.json +784 -0
- package/conformance/1.0/layout/probes/probe-scroll.json +378 -0
- package/conformance/1.0/layout/probes/probe-search-flutter.json +138 -0
- package/conformance/1.0/layout/probes/probe-size-constraints.json +157 -0
- package/conformance/1.0/layout/probes/probe-spacer.json +291 -0
- package/conformance/1.0/layout/probes/probe-stat-progress-track.json +87 -0
- package/conformance/1.0/layout/probes/probe-text-button-flutter.json +163 -0
- package/conformance/1.0/layout/probes/probe-text-field-flutter.json +170 -0
- package/conformance/1.0/layout/probes/probe-text.json +202 -0
- package/conformance/1.0/layout/report/01-onboarding-start.md +49 -0
- package/conformance/1.0/layout/report/02-home-discover.md +98 -0
- package/conformance/1.0/layout/report/03-filters.md +85 -0
- package/conformance/1.0/layout/report/alert.md +27 -0
- package/conformance/1.0/layout/report/iphone-14-15-pro-107.md +47 -0
- package/conformance/1.0/layout/report/live_status_on_its_way_4.ios.md +60 -0
- package/conformance/1.0/layout/report/lucy-booking-mobile.md +81 -0
- package/conformance/1.0/layout/report/lucy-booking-tablet.md +279 -0
- package/conformance/1.0/layout/report/lucy-booking.md +117 -0
- package/conformance/1.0/layout/report/lucy-header.md +64 -0
- package/conformance/1.0/layout/report/lucy-welcome-pin-mobile.md +15 -0
- package/conformance/1.0/layout/report/lucy-welcome-pin.md +11 -0
- package/conformance/1.0/layout/report/navigation-bar.md +23 -0
- package/conformance/1.0/layout/report/probe-alert-banner-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-alert-banner-regression-flutter.md +27 -0
- package/conformance/1.0/layout/report/probe-alert-banner-stack-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-card.md +11 -0
- package/conformance/1.0/layout/report/probe-check-box-flutter.md +17 -0
- package/conformance/1.0/layout/report/probe-divider.md +11 -0
- package/conformance/1.0/layout/report/probe-dropdown-menu-flutter.md +15 -0
- package/conformance/1.0/layout/report/probe-dropdown-menu-max-lines.md +15 -0
- package/conformance/1.0/layout/report/probe-flex.md +23 -0
- package/conformance/1.0/layout/report/probe-grid-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-icon-button-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-icon-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-image-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-list-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-list-regression-flutter.md +27 -0
- package/conformance/1.0/layout/report/probe-list-row-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-pin-input-parity.md +11 -0
- package/conformance/1.0/layout/report/probe-progress-track-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-progress-track-regression-flutter.md +20 -0
- package/conformance/1.0/layout/report/probe-row-column.md +20 -0
- package/conformance/1.0/layout/report/probe-scroll.md +11 -0
- package/conformance/1.0/layout/report/probe-search-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-spacer.md +11 -0
- package/conformance/1.0/layout/report/probe-text-button-flutter.md +22 -0
- package/conformance/1.0/layout/report/probe-text-field-flutter.md +11 -0
- package/conformance/1.0/layout/report/probe-text.md +31 -0
- package/conformance/1.0/layout/report/wallet-home.md +35 -0
- package/conformance/1.0/layout/tolerance.json +12 -0
- package/conformance/1.0/layout/wallet-home.json +127 -0
- package/conformance/1.0/response-cases.json +228 -0
- package/conformance/1.0/screen-cases.json +198 -0
- package/conformance/1.0/screens/01-onboarding-start.json +994 -0
- package/conformance/1.0/screens/02-home-discover.json +2165 -0
- package/conformance/1.0/screens/03-filters.json +2290 -0
- package/conformance/1.0/screens/alert.json +231 -0
- package/conformance/1.0/screens/iphone-14-15-pro-107.json +3149 -0
- package/conformance/1.0/screens/live_status_on_its_way_4.ios.json +1313 -0
- package/conformance/1.0/screens/lucy-booking-mobile.json +3063 -0
- package/conformance/1.0/screens/lucy-booking-tablet.json +10371 -0
- package/conformance/1.0/screens/lucy-booking.json +2130 -0
- package/conformance/1.0/screens/lucy-header.json +1201 -0
- package/conformance/1.0/screens/lucy-welcome-pin-mobile.json +417 -0
- package/conformance/1.0/screens/lucy-welcome-pin.json +409 -0
- package/conformance/1.0/screens/navigation-bar.json +542 -0
- package/conformance/1.0/screens/wallet-home.json +1585 -0
- package/dist/action.d.ts +10616 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/action.js +92 -0
- package/dist/action.js.map +1 -0
- package/dist/bind.d.ts +32 -0
- package/dist/bind.d.ts.map +1 -0
- package/dist/bind.js +102 -0
- package/dist/bind.js.map +1 -0
- package/dist/block-ref.d.ts +17 -0
- package/dist/block-ref.d.ts.map +1 -0
- package/dist/block-ref.js +17 -0
- package/dist/block-ref.js.map +1 -0
- package/dist/block-types.d.ts +26 -0
- package/dist/block-types.d.ts.map +1 -0
- package/dist/block-types.js +39 -0
- package/dist/block-types.js.map +1 -0
- package/dist/block.d.ts +20908 -0
- package/dist/block.d.ts.map +1 -0
- package/dist/block.js +81 -0
- package/dist/block.js.map +1 -0
- package/dist/blocks/display.d.ts +1915 -0
- package/dist/blocks/display.d.ts.map +1 -0
- package/dist/blocks/display.js +433 -0
- package/dist/blocks/display.js.map +1 -0
- package/dist/blocks/input.d.ts +7148 -0
- package/dist/blocks/input.d.ts.map +1 -0
- package/dist/blocks/input.js +855 -0
- package/dist/blocks/input.js.map +1 -0
- package/dist/blocks/layout.d.ts +2482 -0
- package/dist/blocks/layout.d.ts.map +1 -0
- package/dist/blocks/layout.js +266 -0
- package/dist/blocks/layout.js.map +1 -0
- package/dist/blocks/list.d.ts +980 -0
- package/dist/blocks/list.d.ts.map +1 -0
- package/dist/blocks/list.js +286 -0
- package/dist/blocks/list.js.map +1 -0
- package/dist/common.d.ts +958 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +108 -0
- package/dist/common.js.map +1 -0
- package/dist/deprecated.d.ts +11 -0
- package/dist/deprecated.d.ts.map +1 -0
- package/dist/deprecated.js +26 -0
- package/dist/deprecated.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +103 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +113 -0
- package/dist/layout.js.map +1 -0
- package/dist/properties.d.ts +787 -0
- package/dist/properties.d.ts.map +1 -0
- package/dist/properties.js +447 -0
- package/dist/properties.js.map +1 -0
- package/dist/screen.d.ts +10494 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +32 -0
- package/dist/screen.js.map +1 -0
- package/package.json +57 -4
- package/schema/1.0/action.json +109 -0
- package/schema/1.0/block.json +5886 -0
- package/schema/1.0/response.json +91 -0
- package/schema/1.0/screen.json +22 -0
- package/src/README.md +135 -0
- package/src/action.ts +119 -0
- package/src/bind.ts +114 -0
- package/src/block-ref.ts +18 -0
- package/src/block-types.ts +55 -0
- package/src/block.ts +116 -0
- package/src/blocks/display.ts +543 -0
- package/src/blocks/input.ts +1031 -0
- package/src/blocks/layout.ts +322 -0
- package/src/blocks/list.ts +355 -0
- package/src/common.ts +133 -0
- package/src/deprecated.ts +40 -0
- package/src/index.ts +31 -0
- package/src/layout.ts +194 -0
- package/src/properties.ts +516 -0
- package/src/screen.ts +39 -0
|
@@ -0,0 +1,855 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { commonDataShape } from "../common.js";
|
|
3
|
+
import { borderSchema, boxConstraintsSchema, buttonSizeSchema, clipBehaviorSchema, colorSchema, cornerRadiiSchema, intSchema, tapTargetSizeSchema, textAlignmentSchema, textFieldBorderSchema, paddingEntrySchema, textStyleSchema, visualDensitySchema, } from "../properties.js";
|
|
4
|
+
import { iconButtonDataSchema, iconDataSchema, iconGlyphShape } from "./display.js";
|
|
5
|
+
/**
|
|
6
|
+
* Interactive blocks: buttons, text entry, selection and search
|
|
7
|
+
* (paths relative to `fractal_core_blocks-ios/Sources/Blocks`).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Swift: FIOCoreKeyboardType (Sources/Utils/FIOCoreKeyboardType.swift).
|
|
11
|
+
* iOS falls back to `default` for unknown strings; the schema does not.
|
|
12
|
+
*/
|
|
13
|
+
export const keyboardTypeSchema = z.enum([
|
|
14
|
+
"default",
|
|
15
|
+
"ascii_capable",
|
|
16
|
+
"numbers_and_punctuation",
|
|
17
|
+
"url",
|
|
18
|
+
"number_pad",
|
|
19
|
+
"phone_pad",
|
|
20
|
+
"name_phone_pad",
|
|
21
|
+
"email_address",
|
|
22
|
+
"decimal_pad",
|
|
23
|
+
"twitter",
|
|
24
|
+
"web_search",
|
|
25
|
+
]);
|
|
26
|
+
/**
|
|
27
|
+
* Swift: FIOCoreSubmitLabel (Sources/Utils/FIOCoreSubmitLabel.swift).
|
|
28
|
+
* iOS falls back to `done` for unknown strings; the schema does not.
|
|
29
|
+
*/
|
|
30
|
+
export const submitLabelSchema = z.enum([
|
|
31
|
+
"done",
|
|
32
|
+
"go",
|
|
33
|
+
"send",
|
|
34
|
+
"join",
|
|
35
|
+
"route",
|
|
36
|
+
"search",
|
|
37
|
+
"return",
|
|
38
|
+
"next",
|
|
39
|
+
"continue",
|
|
40
|
+
]);
|
|
41
|
+
/**
|
|
42
|
+
* Swift: FIOCoreTextCapitalization (Sources/Utils/FIOCoreTextCapitalization.swift).
|
|
43
|
+
* iOS falls back to `sentences` for unknown strings; the schema does not.
|
|
44
|
+
*/
|
|
45
|
+
export const textCapitalizationSchema = z.enum(["sentences", "words", "characters", "never"]);
|
|
46
|
+
/**
|
|
47
|
+
* Swift: FIOCoreFloatingLabelBehavior (Sources/Utils/FIOCoreFloatingLabelBehavior.swift).
|
|
48
|
+
* iOS falls back to `auto` for unknown strings; the schema does not.
|
|
49
|
+
*/
|
|
50
|
+
export const floatingLabelBehaviorSchema = z.enum(["auto", "always", "never"]);
|
|
51
|
+
/**
|
|
52
|
+
* Flutter `TextButton` / `TextButton.icon` and the Material 3 `FilledButton`, `FilledButton.tonal`,
|
|
53
|
+
* `ElevatedButton` and `OutlinedButton` (contract 2.0), from `material/text_button.dart`
|
|
54
|
+
* (`_TextButtonDefaultsM3`), `filled_button.dart`, `elevated_button.dart`, `outlined_button.dart`,
|
|
55
|
+
* `button_style_button.dart` and the light M3 `ColorScheme` (`theme_data.dart`), flutter/flutter
|
|
56
|
+
* main 66b3ad9. S23: "minimumSize - Size(64, 40)"; "shape - StadiumBorder()"; "If the onPressed
|
|
57
|
+
* and onLongPress callbacks are null, then this button will be disabled, it will not react to touch."
|
|
58
|
+
* Keys (defaults in each key's description): `text`, `id`, `events` (`on_tap`), `is_enabled`,
|
|
59
|
+
* `style`, `variant`, `background_color`, `foreground_color`, `overlay_color`, `elevation`,
|
|
60
|
+
* `shadow_color`, `border`, `shape`, `corner_radius`, `corner_radii`, `padding`, `minimum_size`,
|
|
61
|
+
* `maximum_size`, `size` (= `fixedSize`), `alignment_geometry` (= `alignment`), `tap_target_size`,
|
|
62
|
+
* `visual_density`, `icon`, `icon_alignment`, `clip_behavior`; `gradient` is kept as an extension.
|
|
63
|
+
* Layout (`ButtonStyleButton`): constraints = [`minimum_size`, `maximum_size`] adjusted by the
|
|
64
|
+
* visual density, `size` tight on each finite axis, then the parent's; the content is the label
|
|
65
|
+
* (an S19 text, soft wrap) plus `padding`, hugged (`Align` with width / height factor 1) and placed
|
|
66
|
+
* by `alignment_geometry` when the box is larger; `padded` makes the layout frame at least 48 × 48
|
|
67
|
+
* (plus the density adjustment), the visual centered, taps in the margin count; never greedy, never
|
|
68
|
+
* a flex child.
|
|
69
|
+
* Paint (`Material`, `borderOnForeground: false`): elevation shadow → fill → border → pressed
|
|
70
|
+
* overlay → label and icon. Disabled (`is_enabled` false): label and icon `#1D1B20` at 38%;
|
|
71
|
+
* `filled`, `filled_tonal` and `elevated` fill `#1D1B20` at 12% with elevation 0; `outlined` border
|
|
72
|
+
* `#1D1B20` at 12%; this replaces the 1.x 0.55 dim. A button without an `on_tap` event stays enabled
|
|
73
|
+
* unless `is_enabled` is false (a server-driven host, S23).
|
|
74
|
+
* Deprecated, accepted and ignored: `fixed_size`, `margin`, `background_image`,
|
|
75
|
+
* `background_overlays`. They stay valid so saved 1.x text buttons decode.
|
|
76
|
+
* Swift: TextButton/FIOCoreTextButtonDataBlock.swift.
|
|
77
|
+
*/
|
|
78
|
+
const ignoredOnTextButton = (key) => `Deprecated on \`text_button\` since 2.0 and ignored (S23); \`${key}\` stays valid so saved 1.x text buttons decode.`;
|
|
79
|
+
/** The `icon` of a `text_button` (Flutter `TextButton.icon`): the glyph keys of `icon` (S20). */
|
|
80
|
+
const textButtonIconSchema = z
|
|
81
|
+
.strictObject({
|
|
82
|
+
...iconGlyphShape,
|
|
83
|
+
icon_size: iconGlyphShape.icon_size.describe("Side of the icon's square, >= 0. Absent = 18 (`ButtonStyle.iconSize` of every M3 button variant)."),
|
|
84
|
+
color: iconGlyphShape.color.describe("The glyph color. Absent = the button's `iconColor`, which is the variant's foreground in every state (disabled: `#1D1B20` at 38%)."),
|
|
85
|
+
})
|
|
86
|
+
.describe("Flutter `TextButton.icon` `icon`: drawn next to the label with an 8 gap (`Row(spacing: lerpDouble(8, 4, scale))`, 8 at text scale 1), on the `icon_alignment` side. Absent = no icon.");
|
|
87
|
+
export const textButtonDataSchema = z.strictObject({
|
|
88
|
+
...commonDataShape,
|
|
89
|
+
fixed_size: commonDataShape.fixed_size.describe(ignoredOnTextButton("fixed_size")).meta({ deprecated: true }),
|
|
90
|
+
margin: commonDataShape.margin.describe(ignoredOnTextButton("margin")).meta({ deprecated: true }),
|
|
91
|
+
background_image: commonDataShape.background_image.describe(ignoredOnTextButton("background_image")).meta({ deprecated: true }),
|
|
92
|
+
background_overlays: commonDataShape.background_overlays.describe(ignoredOnTextButton("background_overlays")).meta({ deprecated: true }),
|
|
93
|
+
text: z.string().optional().describe("The label (Flutter `child: Text(...)`). Absent = an empty label."),
|
|
94
|
+
style: textStyleSchema
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("The label style (S19 shared schema). Absent keys = M3 `labelLarge`: 14, `medium` (w500), letter spacing 0.1, `height` 1.43, `leading_distribution` `even` (`_M3Typography.englishLike`). `style.foreground_color` wins over `foreground_color`."),
|
|
97
|
+
is_enabled: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("false = Flutter null `onPressed`: disabled, no taps, M3 disabled colors. Default true."),
|
|
101
|
+
variant: z
|
|
102
|
+
.enum(["text", "filled", "filled_tonal", "elevated", "outlined"])
|
|
103
|
+
.optional()
|
|
104
|
+
.describe("Which M3 button: `text` (the default, `TextButton`), `filled` (`FilledButton`), `filled_tonal` (`FilledButton.tonal`), `elevated` (`ElevatedButton`), `outlined` (`OutlinedButton`). It picks the default colors, elevation, border and padding."),
|
|
105
|
+
background_color: commonDataShape.background_color.describe("Flutter `backgroundColor`. Absent: `text` / `outlined` transparent, `filled` `#6750A4` (primary), `filled_tonal` `#E8DEF8` (secondaryContainer), `elevated` `#F7F2FA` (surfaceContainerLow). Disabled: `filled` / `filled_tonal` / `elevated` `#1D1B20` at 12%."),
|
|
106
|
+
foreground_color: commonDataShape.foreground_color.describe("Flutter `foregroundColor`: the label and icon color. Absent: `text` / `elevated` / `outlined` `#6750A4` (primary), `filled` `#FFFFFF` (onPrimary), `filled_tonal` `#4A4458` (onSecondaryContainer). Disabled: `#1D1B20` at 38%. `style.foreground_color` wins."),
|
|
107
|
+
overlay_color: colorSchema
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("Flutter `overlayColor` while pressed, painted over the fill under the label. Absent = the foreground at 10% (every M3 variant)."),
|
|
110
|
+
elevation: z
|
|
111
|
+
.number()
|
|
112
|
+
.min(0)
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("Flutter `elevation` (>= 0). Absent: `elevated` 1 (0 when disabled), every other variant 0."),
|
|
115
|
+
shadow_color: colorSchema
|
|
116
|
+
.optional()
|
|
117
|
+
.describe("Flutter `shadowColor`. Absent: `filled` / `filled_tonal` / `elevated` `#000000` (shadow); `text` / `outlined` transparent, so an `elevation` set on them draws no shadow."),
|
|
118
|
+
border: borderSchema
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("Flutter `side`, drawn inside the edge of the shape. Absent: `outlined` `#79747E` (outline), width 1 (disabled `#1D1B20` at 12%); every other variant none."),
|
|
121
|
+
shape: commonDataShape.shape.describe("Flutter `shape`. Absent = `capsule` (`StadiumBorder`); `rect` rounds by `corner_radius` (default 0) and `corner_radii`; `circle` = a centered circle, diameter = the shorter side."),
|
|
122
|
+
corner_radius: commonDataShape.corner_radius.describe("The corner radius of a `rect` shape. Default 0."),
|
|
123
|
+
corner_radii: cornerRadiiSchema
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("Per-corner radii of a `rect` shape, each overriding `corner_radius`; `start` / `end` follow the layout direction."),
|
|
126
|
+
padding: commonDataShape.padding.describe("Flutter `padding`, between the edge and the label. Absent: `text` start / end 12, top / bottom 8 (with an `icon`: end 16); every other variant start / end 24, top / bottom 0 (with an `icon`: start 16). The visual density adds its step to the top / bottom only."),
|
|
127
|
+
minimum_size: buttonSizeSchema
|
|
128
|
+
.optional()
|
|
129
|
+
.describe("Flutter `minimumSize` (each axis >= 0). Absent = 64 × 40; an axis left out keeps its default. The visual density adds its step to it."),
|
|
130
|
+
maximum_size: buttonSizeSchema
|
|
131
|
+
.optional()
|
|
132
|
+
.describe("Flutter `maximumSize` (each axis >= 0). Absent = unbounded (`Size.infinite`); an axis left out is unbounded. A label wider than it wraps."),
|
|
133
|
+
size: commonDataShape.size.describe("Flutter `fixedSize`: an exact size on each axis set, clamped into [`minimum_size`, `maximum_size`] and then by the parent. Absent = the content's size."),
|
|
134
|
+
alignment_geometry: commonDataShape.alignment_geometry.describe("Flutter `alignment`: where the label sits when the button is larger than its content. Default `center`; `start` / `end` follow the layout direction."),
|
|
135
|
+
tap_target_size: tapTargetSizeSchema
|
|
136
|
+
.optional()
|
|
137
|
+
.describe("Flutter `tapTargetSize`. Default `padded` (layout frame at least 48 × 48 plus the density adjustment, visual centered); `shrink_wrap` = the visual size."),
|
|
138
|
+
visual_density: visualDensitySchema
|
|
139
|
+
.optional()
|
|
140
|
+
.describe("Flutter `visualDensity`. Default `standard` (mobile). `comfortable` / `compact` add -4 / -8 to the minimum size, the top / bottom padding (never below 0) and the padded tap target; the start / end padding never shrinks."),
|
|
141
|
+
icon: textButtonIconSchema.optional(),
|
|
142
|
+
icon_alignment: z
|
|
143
|
+
.enum(["start", "end"])
|
|
144
|
+
.optional()
|
|
145
|
+
.describe("Flutter `iconAlignment`: the icon before (`start`, the default) or after (`end`) the label, following the layout direction. The default padding does not change with it."),
|
|
146
|
+
clip_behavior: clipBehaviorSchema
|
|
147
|
+
.optional()
|
|
148
|
+
.describe("Flutter `clipBehavior`. Default `none` (the label may paint outside the shape); any other value clips the content to the shape."),
|
|
149
|
+
gradient: commonDataShape.gradient.describe("Extension (no Flutter `ButtonStyle` key): replaces the fill (`background_color`) inside the shape, as `container` (S8)."),
|
|
150
|
+
});
|
|
151
|
+
/**
|
|
152
|
+
* Flutter `TextField` / `InputDecoration` with the Material 3 `_InputDecoratorDefaultsM3`
|
|
153
|
+
* (contract 2.0), from `material/text_field.dart`, `input_decorator.dart`, `input_border.dart`,
|
|
154
|
+
* `typography.dart` and the light M3 `ColorScheme` (`theme_data.dart`), flutter/flutter main 66b3ad9.
|
|
155
|
+
* S24: "By default, a text field has a decoration that draws a divider below the text field.";
|
|
156
|
+
* "If false the text field is "disabled": it ignores taps and its decoration is rendered in grey.";
|
|
157
|
+
* prefix / suffix icons "constrained with a minimum size of 48px by 48px".
|
|
158
|
+
* Keys (defaults in each key's description): `text`, `id`, `events` (`on_change`, `on_complete`),
|
|
159
|
+
* `style`, `decoration` (`variant`, labels, hint, helper, error, counter, prefix / suffix, the
|
|
160
|
+
* per-state borders, fill, `content_padding`, `is_dense`, `constraints`) and `config` (input
|
|
161
|
+
* behavior, lines, cursor).
|
|
162
|
+
* Layout (`_RenderDecoration`): the field fills a bounded width (`Size(constraints.maxWidth, …)`);
|
|
163
|
+
* with no width limit it is 0 wide (Flutter throws; S24 D1). Height = `content_padding` top +
|
|
164
|
+
* the floating-label space (underline with a label: 4 + 0.75 × 16 = 16; outline: 0) + the lines
|
|
165
|
+
* (24 each, bodyLarge) + `content_padding` bottom, at least 48 (`kMinInteractiveDimension`) unless
|
|
166
|
+
* `is_dense` or `expands`, at least the prefix / suffix icon slots (48 × 48); `expands` fills the
|
|
167
|
+
* parent's max height. Helper / error / counter add one bodySmall line (12, height 1.33) + 4
|
|
168
|
+
* (`subtextGap`) below. Defaults: underline no label 8 + 24 + 8 = 40 → 48; underline with a label
|
|
169
|
+
* 16 + 8 + 24 + 8 = 56; outline 20 + 24 + 12 = 56. Never greedy along a flex main axis, never a
|
|
170
|
+
* flex child.
|
|
171
|
+
* Paint (M3 state colors): text `#1D1B20`; hint, label, helper and icons `#49454F`
|
|
172
|
+
* (onSurfaceVariant); label focused `#6750A4`; underline `#49454F` 1, focused `#6750A4` 2; outline
|
|
173
|
+
* `#79747E` 1, focused `#6750A4` 2; error `#B3261E` (focused 2); fill (`filled`) `#E6E0E9`.
|
|
174
|
+
* Disabled (`is_enabled` false): text, label, hint, helper, icons and underline `#1D1B20` at 38%,
|
|
175
|
+
* outline at 12%, fill at 4%.
|
|
176
|
+
* Events (additive, S24 D3): `on_change` on each user edit (Flutter `onChanged`), `on_complete`
|
|
177
|
+
* on submit (Flutter `onSubmitted`); a server-set `text` posts nothing. Host callbacks are kept.
|
|
178
|
+
* Deprecated, accepted and ignored: the common keys other than `id` / `events` (`padding`, `size`,
|
|
179
|
+
* `margin`, `fixed_size`, colors, `shape`, `corner_radius`, `alignment_geometry`, `gradient`,
|
|
180
|
+
* backgrounds), `decoration.focus_color` (Flutter: "ignored by [TextField]"),
|
|
181
|
+
* `decoration.constraints.width` / `.height` (1.x `size` shape). They stay valid so saved 1.x
|
|
182
|
+
* text fields decode.
|
|
183
|
+
* Swift: TextField/FIOCoreTextFieldDataBlock.swift.
|
|
184
|
+
*/
|
|
185
|
+
const ignoredOnTextField = (key) => `Deprecated on \`text_field\` since 2.0 and ignored (S24); \`${key}\` stays valid so saved 1.x text fields decode.`;
|
|
186
|
+
/** Swift: TextField/FIOCoreTextFieldConfig.swift. */
|
|
187
|
+
export const textFieldConfigSchema = z
|
|
188
|
+
.strictObject({
|
|
189
|
+
is_enabled: z
|
|
190
|
+
.boolean()
|
|
191
|
+
.optional()
|
|
192
|
+
.describe("Flutter `enabled`. Default true. false = disabled: ignores taps and focus, M3 disabled colors (text, label, hint, icons and underline `#1D1B20` at 38%, outline 12%, fill 4%)."),
|
|
193
|
+
is_password: z
|
|
194
|
+
.boolean()
|
|
195
|
+
.optional()
|
|
196
|
+
.describe("Flutter `obscureText`: every character drawn as `obscuring_character`. Default false. Flutter asserts an obscured field is single-line, so `max_lines` must be absent or 1."),
|
|
197
|
+
obscuring_character: z
|
|
198
|
+
.string()
|
|
199
|
+
.optional()
|
|
200
|
+
.describe("Flutter `obscuringCharacter`, a single character. Default `•` (U+2022)."),
|
|
201
|
+
keyboard_type: keyboardTypeSchema
|
|
202
|
+
.optional()
|
|
203
|
+
.describe("Flutter `keyboardType`. Absent = `default` (Flutter `TextInputType.text`; Flutter uses `multiline` when `max_lines` is not 1)."),
|
|
204
|
+
submit_label: submitLabelSchema
|
|
205
|
+
.optional()
|
|
206
|
+
.describe("Flutter `textInputAction`: the keyboard's action key, which posts `on_complete`. Absent = `done` (Flutter: a newline action for a multiline keyboard)."),
|
|
207
|
+
auto_capitalization: textCapitalizationSchema
|
|
208
|
+
.optional()
|
|
209
|
+
.describe("Flutter `textCapitalization`. Default `never` (`TextCapitalization.none`); 1.x defaulted to `sentences` (S7 break)."),
|
|
210
|
+
disable_autocorrection: z
|
|
211
|
+
.boolean()
|
|
212
|
+
.optional()
|
|
213
|
+
.describe("true = Flutter `autocorrect: false`. Default false (autocorrect on: `_inferAutocorrect` with no autofill hints)."),
|
|
214
|
+
text_alignment: textAlignmentSchema
|
|
215
|
+
.optional()
|
|
216
|
+
.describe("Flutter `textAlign` (S19 shared enum). Default `start`; `start` / `end` follow the layout direction."),
|
|
217
|
+
max_lines: intSchema
|
|
218
|
+
.min(1)
|
|
219
|
+
.optional()
|
|
220
|
+
.describe("Flutter `maxLines` (>= 1). Default 1: one line that scrolls horizontally. n > 1: the field is n lines tall (24 each) and scrolls vertically past n; with `min_lines` it grows between the two. Must be absent when `expands` is true."),
|
|
221
|
+
min_lines: intSchema
|
|
222
|
+
.min(1)
|
|
223
|
+
.optional()
|
|
224
|
+
.describe("Flutter `minLines` (>= 1). Absent = no minimum. The field starts `min_lines` tall and grows up to `max_lines`; Flutter asserts it is not above `max_lines` (JSON Schema cannot compare two keys, so the schema does not check it). Must be absent when `expands` is true."),
|
|
225
|
+
expands: z
|
|
226
|
+
.boolean()
|
|
227
|
+
.optional()
|
|
228
|
+
.describe("Flutter `expands`. Default false. true = the field's height is the parent's max height (it needs a bounded height) and the text wraps without a line limit; `max_lines` and `min_lines` must be absent."),
|
|
229
|
+
read_only: z
|
|
230
|
+
.boolean()
|
|
231
|
+
.optional()
|
|
232
|
+
.describe("Flutter `readOnly`. Default false. true = the text can be selected but not edited, no keyboard; the enabled colors stay."),
|
|
233
|
+
auto_focus: z
|
|
234
|
+
.boolean()
|
|
235
|
+
.optional()
|
|
236
|
+
.describe("Flutter `autofocus`. Default false. true = focused (keyboard shown) when the field first appears."),
|
|
237
|
+
enable_suggestions: z
|
|
238
|
+
.boolean()
|
|
239
|
+
.optional()
|
|
240
|
+
.describe("Flutter `enableSuggestions`: keyboard suggestions. Default true."),
|
|
241
|
+
cursor_color: colorSchema
|
|
242
|
+
.optional()
|
|
243
|
+
.describe("Flutter `cursorColor`. Absent = `#6750A4` (colorScheme.primary); with an `error_text`, `#B3261E` (colorScheme.error)."),
|
|
244
|
+
cursor_width: z
|
|
245
|
+
.number()
|
|
246
|
+
.min(0)
|
|
247
|
+
.optional()
|
|
248
|
+
.describe("Flutter `cursorWidth` (>= 0). Default 2."),
|
|
249
|
+
cursor_height: z
|
|
250
|
+
.number()
|
|
251
|
+
.min(0)
|
|
252
|
+
.optional()
|
|
253
|
+
.describe("Flutter `cursorHeight` (>= 0). Absent = the line height (`RenderEditable.preferredLineHeight`)."),
|
|
254
|
+
})
|
|
255
|
+
.refine((config) => !(config.expands === true && (config.max_lines !== undefined || config.min_lines !== undefined)) &&
|
|
256
|
+
!(config.is_password === true && config.max_lines !== undefined && config.max_lines !== 1), {
|
|
257
|
+
message: "`max_lines` and `min_lines` must be absent when `expands` is true, and an `is_password` field is single-line (Flutter asserts)",
|
|
258
|
+
})
|
|
259
|
+
.meta({
|
|
260
|
+
not: {
|
|
261
|
+
anyOf: [
|
|
262
|
+
{ required: ["expands", "max_lines"], properties: { expands: { const: true } } },
|
|
263
|
+
{ required: ["expands", "min_lines"], properties: { expands: { const: true } } },
|
|
264
|
+
{ required: ["is_password", "max_lines"], properties: { is_password: { const: true }, max_lines: { not: { const: 1 } } } },
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
/** Text field `constraints`: Flutter `BoxConstraints`, plus the 1.x `size` keys, ignored. */
|
|
269
|
+
const textFieldConstraintsSchema = boxConstraintsSchema
|
|
270
|
+
.extend({
|
|
271
|
+
width: z.number().optional().describe(ignoredOnTextField("constraints.width")).meta({ deprecated: true }),
|
|
272
|
+
height: z.number().optional().describe(ignoredOnTextField("constraints.height")).meta({ deprecated: true }),
|
|
273
|
+
})
|
|
274
|
+
.describe("Flutter `InputDecoration.constraints` (each value >= 0), applied around the decorated field (helper line included). Absent = the parent's width and the default height (at least 48 unless `is_dense` / `expands`).");
|
|
275
|
+
const textFieldBorderOf = (state, absent) => textFieldBorderSchema
|
|
276
|
+
.optional()
|
|
277
|
+
.describe(`Flutter \`${state}\`: \`type\` \`underline\` (bottom line), \`outline\` (rounded box, \`corner_radius\` default 4, gap 4 around a floating label) or \`none\`; \`width\` default 1. Absent = the \`variant\` border, ${absent}.`);
|
|
278
|
+
/** Swift: TextField/FIOCoreTextFieldDecoration.swift. */
|
|
279
|
+
export const textFieldDecorationSchema = z.strictObject({
|
|
280
|
+
variant: z
|
|
281
|
+
.enum(["underline", "outline"])
|
|
282
|
+
.optional()
|
|
283
|
+
.describe("Flutter `border`: the border of every state without its own `*_border`. Default `underline` (`UnderlineInputBorder`, top corners rounded 4 when filled); `outline` = `OutlineInputBorder` (radius 4, gap padding 4). It picks the default `content_padding`."),
|
|
284
|
+
label_text: z.string().optional().describe("Flutter `labelText`: inside the field when empty and unfocused, floating above at 75% scale otherwise. Absent = no label."),
|
|
285
|
+
label_style: textStyleSchema
|
|
286
|
+
.optional()
|
|
287
|
+
.describe("Flutter `labelStyle`. Absent = bodyLarge (16, height 1.5) in `#49454F`; focused `#6750A4`; with an error `#B3261E`; disabled `#1D1B20` at 38%."),
|
|
288
|
+
floating_label_style: textStyleSchema
|
|
289
|
+
.optional()
|
|
290
|
+
.describe("Flutter `floatingLabelStyle`, drawn at 75% scale (`_kFinalLabelScale`). Absent = the same as `label_style`'s defaults."),
|
|
291
|
+
floating_label_behavior: floatingLabelBehaviorSchema
|
|
292
|
+
.optional()
|
|
293
|
+
.describe("Flutter `floatingLabelBehavior`. Default `auto` (floats when focused or not empty); `always`; `never` (the label disappears once there is text)."),
|
|
294
|
+
hint_text: z.string().optional().describe("Flutter `hintText`, shown while the field is empty (with a label: only once the label floats). Absent = no hint."),
|
|
295
|
+
hint_style: textStyleSchema
|
|
296
|
+
.optional()
|
|
297
|
+
.describe("Flutter `hintStyle`. Absent = bodyLarge (16, height 1.5) in `#49454F`; disabled `#1D1B20` at 38%."),
|
|
298
|
+
helper_text: z.string().optional().describe("Flutter `helperText`, below the field, 4 under it (`subtextGap`). Hidden while `error_text` is set."),
|
|
299
|
+
helper_style: textStyleSchema
|
|
300
|
+
.optional()
|
|
301
|
+
.describe("Flutter `helperStyle`. Absent = bodySmall (12, height 1.33, letter spacing 0.4) in `#49454F`; disabled `#1D1B20` at 38%."),
|
|
302
|
+
helper_max_lines: intSchema.optional().describe("Flutter `helperMaxLines`. Absent = one line, ellipsized."),
|
|
303
|
+
error_text: z.string().optional().describe("Flutter `errorText`: replaces the helper and turns the border, label, cursor and suffix icon to the error color."),
|
|
304
|
+
error_style: textStyleSchema.optional().describe("Flutter `errorStyle`. Absent = bodySmall (12, height 1.33) in `#B3261E`."),
|
|
305
|
+
error_max_lines: intSchema.optional().describe("Flutter `errorMaxLines`. Absent = one line, ellipsized."),
|
|
306
|
+
max_length: intSchema
|
|
307
|
+
.optional()
|
|
308
|
+
.describe("Flutter `maxLength`: input is clamped to this many characters and the counter `count/max_length` shows at the end below the field. Absent = no limit, no counter."),
|
|
309
|
+
counter_text: z
|
|
310
|
+
.string()
|
|
311
|
+
.optional()
|
|
312
|
+
.describe("Flutter `counterText`: replaces the `max_length` counter, at the end below the field, 16 from the helper (`_kSubtextCounterPadding`). An empty string hides the counter. Absent = the `max_length` counter."),
|
|
313
|
+
counter_style: textStyleSchema.optional().describe("Flutter `counterStyle`. Absent = the `helper_style` defaults."),
|
|
314
|
+
prefix_text: z.string().optional().describe("Flutter `prefixText`, before the input, shown when focused or not empty."),
|
|
315
|
+
prefix_style: textStyleSchema.optional().describe("Flutter `prefixStyle`. Absent = the field's `style` in `#49454F`."),
|
|
316
|
+
prefix_icon_name: z
|
|
317
|
+
.string()
|
|
318
|
+
.optional()
|
|
319
|
+
.describe("Flutter `prefixIcon`, a system icon name: size 24 (dense 18) in `#49454F` (disabled `#1D1B20` at 38%), centered in a slot at least 48 × 48 (`kMinInteractiveDimension`) at the start, outside the content padding."),
|
|
320
|
+
suffix_text: z.string().optional().describe("Flutter `suffixText`, after the input, shown when focused or not empty."),
|
|
321
|
+
suffix_style: textStyleSchema.optional().describe("Flutter `suffixStyle`. Absent = the field's `style` in `#49454F`."),
|
|
322
|
+
suffix_icon_name: z
|
|
323
|
+
.string()
|
|
324
|
+
.optional()
|
|
325
|
+
.describe("Flutter `suffixIcon`, a system icon name: size 24 (dense 18) in `#49454F` (error `#B3261E`; disabled `#1D1B20` at 38%), in a slot at least 48 × 48 at the end."),
|
|
326
|
+
enabled_border: textFieldBorderOf("enabledBorder", "underline `#49454F`, outline `#79747E`"),
|
|
327
|
+
focused_border: textFieldBorderOf("focusedBorder", "`#6750A4` width 2"),
|
|
328
|
+
error_border: textFieldBorderOf("errorBorder", "`#B3261E` width 1"),
|
|
329
|
+
focused_error_border: textFieldBorderOf("focusedErrorBorder", "`#B3261E` width 2"),
|
|
330
|
+
disabled_border: textFieldBorderOf("disabledBorder", "underline `#1D1B20` at 38%, outline `#1D1B20` at 12%"),
|
|
331
|
+
filled: z
|
|
332
|
+
.boolean()
|
|
333
|
+
.optional()
|
|
334
|
+
.describe("Flutter `filled`. Default false. true paints `fill_color` inside the border (underline: top corners rounded 4; outline: radius 4) and adds 12 to the default start / end padding of an underline field."),
|
|
335
|
+
fill_color: colorSchema.optional().describe("Flutter `fillColor`, painted when `filled`. Absent = `#E6E0E9` (surfaceContainerHighest); disabled `#1D1B20` at 4%."),
|
|
336
|
+
focus_color: colorSchema.optional().describe(ignoredOnTextField("decoration.focus_color") + " Flutter: `focusColor` is ignored by `TextField`.").meta({ deprecated: true }),
|
|
337
|
+
content_padding: z
|
|
338
|
+
.array(paddingEntrySchema)
|
|
339
|
+
.optional()
|
|
340
|
+
.describe("Flutter `contentPadding`, resolved like every padding list (`edgeAnchorSchema`). Absent, as start / top / end / bottom: `outline` 12 / 20 / 12 / 12 (dense 12 / 16 / 12 / 8); filled underline 12 / 8 / 12 / 8 (dense 12 / 4 / 12 / 4); underline 0 / 8 / 0 / 8 (dense 0 / 4 / 0 / 4). An outline or filled field also insets the text 4 more at the start and end (`_kInputExtraPadding`, `gapPadding`)."),
|
|
341
|
+
is_dense: z
|
|
342
|
+
.boolean()
|
|
343
|
+
.optional()
|
|
344
|
+
.describe("Flutter `isDense`. Default false. true = the dense `content_padding`, icons 18, and no 48 minimum height."),
|
|
345
|
+
constraints: textFieldConstraintsSchema.optional(),
|
|
346
|
+
});
|
|
347
|
+
/** Swift: TextField/FIOCoreTextFieldDataBlock.swift. */
|
|
348
|
+
export const textFieldDataSchema = z.strictObject({
|
|
349
|
+
...commonDataShape,
|
|
350
|
+
background_color: commonDataShape.background_color.describe(ignoredOnTextField("background_color")).meta({ deprecated: true }),
|
|
351
|
+
foreground_color: commonDataShape.foreground_color.describe(ignoredOnTextField("foreground_color")).meta({ deprecated: true }),
|
|
352
|
+
padding: commonDataShape.padding.describe(ignoredOnTextField("padding")).meta({ deprecated: true }),
|
|
353
|
+
size: commonDataShape.size.describe(ignoredOnTextField("size") + " Use `decoration.constraints`.").meta({ deprecated: true }),
|
|
354
|
+
alignment_geometry: commonDataShape.alignment_geometry.describe(ignoredOnTextField("alignment_geometry")).meta({ deprecated: true }),
|
|
355
|
+
margin: commonDataShape.margin.describe(ignoredOnTextField("margin")).meta({ deprecated: true }),
|
|
356
|
+
shape: commonDataShape.shape.describe(ignoredOnTextField("shape")).meta({ deprecated: true }),
|
|
357
|
+
corner_radius: commonDataShape.corner_radius.describe(ignoredOnTextField("corner_radius")).meta({ deprecated: true }),
|
|
358
|
+
gradient: commonDataShape.gradient.describe(ignoredOnTextField("gradient")).meta({ deprecated: true }),
|
|
359
|
+
fixed_size: commonDataShape.fixed_size.describe(ignoredOnTextField("fixed_size")).meta({ deprecated: true }),
|
|
360
|
+
background_image: commonDataShape.background_image.describe(ignoredOnTextField("background_image")).meta({ deprecated: true }),
|
|
361
|
+
background_overlays: commonDataShape.background_overlays.describe(ignoredOnTextField("background_overlays")).meta({ deprecated: true }),
|
|
362
|
+
events: commonDataShape.events.describe("`on_change` is posted on each user edit (Flutter `onChanged`) and `on_complete` on submit (Flutter `onSubmitted`); a server-set `text` posts nothing (S24 D3). Other event types are not posted."),
|
|
363
|
+
text: z.string().optional().describe("The text (Flutter `controller.text`). Absent = empty. A new value from the server replaces it without posting `on_change`."),
|
|
364
|
+
style: textStyleSchema
|
|
365
|
+
.optional()
|
|
366
|
+
.describe("Flutter `style` (S19 shared schema). Absent keys = M3 bodyLarge: 16, w400, letter spacing 0.5, `height` 1.5 (24 per line), `leading_distribution` `even`, `#1D1B20` (disabled at 38%)."),
|
|
367
|
+
decoration: textFieldDecorationSchema
|
|
368
|
+
.optional()
|
|
369
|
+
.describe("Flutter `decoration` (`InputDecoration`). Absent = the default underline decoration (\"draws a divider below the text field\")."),
|
|
370
|
+
config: textFieldConfigSchema.optional(),
|
|
371
|
+
});
|
|
372
|
+
/**
|
|
373
|
+
* Flutter `DropdownMenu` / `DropdownMenuEntry` with the Material 3 `_DropdownMenuDefaultsM3`,
|
|
374
|
+
* `_MenuDefaultsM3` and `_MenuButtonDefaultsM3` (contract 2.0), from `material/dropdown_menu.dart`,
|
|
375
|
+
* `menu_anchor.dart`, `input_decorator.dart`, `icon_button.dart`, `typography.dart` and the light
|
|
376
|
+
* M3 `ColorScheme`, flutter/flutter main 66b3ad9. S26: "If this is null, the width of the
|
|
377
|
+
* [DropdownMenu] will be the same as the width of the widest menu item plus the width of the
|
|
378
|
+
* leading/trailing icon."; "By default, shows a outlined text field."
|
|
379
|
+
* Keys (defaults in each key's description): `id`, `events` (`on_change`), `entries` (`items`
|
|
380
|
+
* deprecated), `initial_selection`, `label`, `hint_text`, `helper_text`, `error_text`, `width`,
|
|
381
|
+
* `expanded_insets`, `menu_height`, `leading_icon`, `trailing_icon`, `selected_trailing_icon`,
|
|
382
|
+
* `show_trailing_icon`, `is_enabled`, `enable_filter`, `enable_search`, `request_focus_on_tap`,
|
|
383
|
+
* `text_style`, `text_align`, `max_lines`, `decoration` (a subset of `text_field.decoration`),
|
|
384
|
+
* `menu_style`.
|
|
385
|
+
* Anchor: a `text_field` (S24) with the `outline` variant, read-only unless it can take focus
|
|
386
|
+
* (`request_focus_on_tap`), the `label` / `hint_text` / `helper_text` / `error_text`, the
|
|
387
|
+
* `leading_icon` as its prefix icon and the trailing icon as its suffix: an `IconButton` (24 glyph,
|
|
388
|
+
* 48 × 48 tap target) inside 4 padding, a 56 × 56 slot. Height 56 (outline 20 + 24 + 12, and the
|
|
389
|
+
* trailing slot), plus the helper / error line.
|
|
390
|
+
* Width (`_RenderDropdownMenuBody`): `width` when set; else the widest of the entries and the
|
|
391
|
+
* `label` (+ 8), plus the trailing slot (56, or 0 when `show_trailing_icon` is false) plus the
|
|
392
|
+
* leading icon + 16 (16 alone without one), at least 112 (`_kMinimumWidth`), clamped to the
|
|
393
|
+
* parent's max width; `expanded_insets` fills the parent width instead. Hugs (`Align` with width /
|
|
394
|
+
* height factor 1), never greedy, never a flex child.
|
|
395
|
+
* Entry (`MenuItemButton`): start 12 (with a field `leading_icon` and no entry icon: the field's
|
|
396
|
+
* leading slot, so the label lines up with the field text), end 12, 4 more before the label;
|
|
397
|
+
* `leading_icon` / `trailing_icon` 24 in `#49454F`, 12 from the label; label labelLarge (14, w500,
|
|
398
|
+
* letter spacing 0.1, height 1.43) in `#1D1B20`; at least 64 × 48; disabled `#1D1B20` at 38%.
|
|
399
|
+
* Menu (`MenuAnchor`): opens under the anchor, start-aligned (`_MenuBarDefaultsM3` alignment
|
|
400
|
+
* `bottomStart` for a top-level anchor), at least as wide as the anchor (or `width`), vertical
|
|
401
|
+
* padding 8, see `menu_style` for the panel. Selecting an enabled entry shows its label in the
|
|
402
|
+
* field, closes the menu and posts `on_change` with `event_data.value` = the entry's `value`.
|
|
403
|
+
* Deprecated, accepted and ignored: the common keys other than `id` / `events`. They stay valid so
|
|
404
|
+
* saved 1.x dropdown menus decode.
|
|
405
|
+
* Swift: DropdownMenu/FIOCoreDropdownMenuDataBlock.swift.
|
|
406
|
+
*/
|
|
407
|
+
const ignoredOnDropdownMenu = (key) => `Deprecated on \`dropdown_menu\` since 2.0 and ignored (S26); \`${key}\` stays valid so saved 1.x dropdown menus decode.`;
|
|
408
|
+
/** An icon of a `dropdown_menu` or of one of its entries: the glyph keys of `icon` (S20). */
|
|
409
|
+
const dropdownMenuIconSchema = (description) => z
|
|
410
|
+
.strictObject({
|
|
411
|
+
...iconGlyphShape,
|
|
412
|
+
icon_size: iconGlyphShape.icon_size.describe("Side of the icon's square, >= 0. Absent = 24."),
|
|
413
|
+
color: iconGlyphShape.color.describe(`The glyph color. Absent = \`#49454F\` (onSurfaceVariant); disabled \`#1D1B20\` at 38%.`),
|
|
414
|
+
})
|
|
415
|
+
.describe(description);
|
|
416
|
+
/** Flutter `DropdownMenuEntry`: one item of the menu. */
|
|
417
|
+
export const dropdownMenuEntrySchema = z.strictObject({
|
|
418
|
+
value: z.string().describe("Flutter `value`: posted as `event_data.value` of `on_change` when the entry is selected, and matched by `initial_selection`."),
|
|
419
|
+
label: z
|
|
420
|
+
.string()
|
|
421
|
+
.describe("Flutter `label`: the entry's text, and the field's text once selected. Filtering and search match it case-insensitively."),
|
|
422
|
+
leading_icon: dropdownMenuIconSchema("Flutter `leadingIcon`: before the label, 12 from it. Absent = none.").optional(),
|
|
423
|
+
trailing_icon: dropdownMenuIconSchema("Flutter `trailingIcon`: after the label, 12 from it. Absent = none.").optional(),
|
|
424
|
+
is_enabled: z
|
|
425
|
+
.boolean()
|
|
426
|
+
.optional()
|
|
427
|
+
.describe("Flutter `enabled`. Default true. false = drawn `#1D1B20` at 38% and cannot be selected."),
|
|
428
|
+
});
|
|
429
|
+
/**
|
|
430
|
+
* `dropdown_menu.decoration`: the styling keys of `text_field.decoration` (S24). The texts and icons
|
|
431
|
+
* are the block's own keys (`label`, `hint_text`, `helper_text`, `error_text`, `leading_icon`,
|
|
432
|
+
* `trailing_icon`), and the width is `width` / `expanded_insets`.
|
|
433
|
+
*/
|
|
434
|
+
export const dropdownMenuDecorationSchema = textFieldDecorationSchema
|
|
435
|
+
.pick({
|
|
436
|
+
label_style: true,
|
|
437
|
+
floating_label_style: true,
|
|
438
|
+
floating_label_behavior: true,
|
|
439
|
+
hint_style: true,
|
|
440
|
+
helper_style: true,
|
|
441
|
+
helper_max_lines: true,
|
|
442
|
+
error_style: true,
|
|
443
|
+
error_max_lines: true,
|
|
444
|
+
enabled_border: true,
|
|
445
|
+
focused_border: true,
|
|
446
|
+
error_border: true,
|
|
447
|
+
focused_error_border: true,
|
|
448
|
+
disabled_border: true,
|
|
449
|
+
filled: true,
|
|
450
|
+
fill_color: true,
|
|
451
|
+
content_padding: true,
|
|
452
|
+
is_dense: true,
|
|
453
|
+
})
|
|
454
|
+
.extend({
|
|
455
|
+
variant: z
|
|
456
|
+
.enum(["underline", "outline"])
|
|
457
|
+
.optional()
|
|
458
|
+
.describe("Flutter `InputDecorationTheme.border`: the border of every state without its own `*_border`. Default `outline` (`_DropdownMenuDefaultsM3`: `OutlineInputBorder`, radius 4); `underline` = `UnderlineInputBorder`. It picks the default `content_padding` as on `text_field`."),
|
|
459
|
+
})
|
|
460
|
+
.describe("Flutter `inputDecorationTheme` of the anchor field, as `text_field.decoration` (S24). Absent = the outlined field: outline `#79747E` 1, focused `#6750A4` 2, error `#B3261E`, content padding 12 / 20 / 12 / 12.");
|
|
461
|
+
/** Flutter `MenuStyle` of the dropdown's menu panel. */
|
|
462
|
+
export const dropdownMenuStyleSchema = z
|
|
463
|
+
.strictObject({
|
|
464
|
+
background_color: colorSchema.optional().describe("Flutter `backgroundColor`. Absent = `#F3EDF7` (colorScheme.surfaceContainer); no surface tint."),
|
|
465
|
+
elevation: z.number().min(0).optional().describe("Flutter `elevation` (>= 0). Default 3, shadow `#000000` (colorScheme.shadow)."),
|
|
466
|
+
corner_radius: z.number().min(0).optional().describe("Flutter `shape` as a `RoundedRectangleBorder` radius (>= 0). Default 4."),
|
|
467
|
+
min_width: z
|
|
468
|
+
.number()
|
|
469
|
+
.min(0)
|
|
470
|
+
.optional()
|
|
471
|
+
.describe("Flutter `minimumSize.width` (>= 0). Flutter replaces it with `width` (or, without one, the anchor's width) capped by `max_width` once the anchor is laid out, so the menu is always at least as wide as the anchor (default 112)."),
|
|
472
|
+
max_width: z
|
|
473
|
+
.number()
|
|
474
|
+
.min(0)
|
|
475
|
+
.optional()
|
|
476
|
+
.describe("Flutter `maximumSize.width` (>= 0). Absent = unbounded. Flutter drops it when `menu_height` is set (`maximumSize` becomes `Size(infinity, menu_height)`)."),
|
|
477
|
+
})
|
|
478
|
+
.describe("Flutter `menuStyle`: the panel the entries open in. Absent = the M3 menu: `#F3EDF7`, elevation 3, radius 4, vertical padding 8.");
|
|
479
|
+
export const dropdownMenuDataSchema = z.strictObject({
|
|
480
|
+
...commonDataShape,
|
|
481
|
+
background_color: commonDataShape.background_color.describe(ignoredOnDropdownMenu("background_color")).meta({ deprecated: true }),
|
|
482
|
+
foreground_color: commonDataShape.foreground_color.describe(ignoredOnDropdownMenu("foreground_color")).meta({ deprecated: true }),
|
|
483
|
+
padding: commonDataShape.padding.describe(ignoredOnDropdownMenu("padding")).meta({ deprecated: true }),
|
|
484
|
+
size: commonDataShape.size.describe(ignoredOnDropdownMenu("size") + " Use `width`.").meta({ deprecated: true }),
|
|
485
|
+
alignment_geometry: commonDataShape.alignment_geometry.describe(ignoredOnDropdownMenu("alignment_geometry")).meta({ deprecated: true }),
|
|
486
|
+
margin: commonDataShape.margin.describe(ignoredOnDropdownMenu("margin")).meta({ deprecated: true }),
|
|
487
|
+
shape: commonDataShape.shape.describe(ignoredOnDropdownMenu("shape")).meta({ deprecated: true }),
|
|
488
|
+
corner_radius: commonDataShape.corner_radius.describe(ignoredOnDropdownMenu("corner_radius")).meta({ deprecated: true }),
|
|
489
|
+
gradient: commonDataShape.gradient.describe(ignoredOnDropdownMenu("gradient")).meta({ deprecated: true }),
|
|
490
|
+
fixed_size: commonDataShape.fixed_size.describe(ignoredOnDropdownMenu("fixed_size")).meta({ deprecated: true }),
|
|
491
|
+
background_image: commonDataShape.background_image.describe(ignoredOnDropdownMenu("background_image")).meta({ deprecated: true }),
|
|
492
|
+
background_overlays: commonDataShape.background_overlays.describe(ignoredOnDropdownMenu("background_overlays")).meta({ deprecated: true }),
|
|
493
|
+
events: commonDataShape.events.describe("`on_change` is posted when the user selects an entry (Flutter `onSelected`), with `event_data.value` = the entry's `value`; `initial_selection` posts nothing (S26 D3). Other event types are not posted."),
|
|
494
|
+
entries: z
|
|
495
|
+
.array(dropdownMenuEntrySchema)
|
|
496
|
+
.optional()
|
|
497
|
+
.describe("Flutter `dropdownMenuEntries`, in menu order. Absent or empty = an empty menu (only its padding). Wins over `items` when both are set."),
|
|
498
|
+
items: z
|
|
499
|
+
.array(z.string())
|
|
500
|
+
.optional()
|
|
501
|
+
.describe("Deprecated since 2.0 (S26): honored as `entries` with `value` = `label` = each string, only when `entries` is absent. Stays valid so saved 1.x dropdown menus decode.").meta({ deprecated: true }),
|
|
502
|
+
initial_selection: z
|
|
503
|
+
.string()
|
|
504
|
+
.optional()
|
|
505
|
+
.describe("Flutter `initialSelection`: the `value` of the entry whose label the field shows at first; posts nothing. Absent or no match = an empty field."),
|
|
506
|
+
label: z.string().optional().describe("Flutter `label` (`InputDecoration.label`): inside the field when empty, floating on the outline otherwise. It counts in the default width. Absent = none."),
|
|
507
|
+
hint_text: z.string().optional().describe("Flutter `hintText`, shown while the field is empty. Absent = none."),
|
|
508
|
+
helper_text: z.string().optional().describe("Flutter `helperText`, below the field (bodySmall 12, `#49454F`). Hidden while `error_text` is set."),
|
|
509
|
+
error_text: z.string().optional().describe("Flutter `errorText`: replaces the helper and turns the border and label `#B3261E`."),
|
|
510
|
+
width: z
|
|
511
|
+
.number()
|
|
512
|
+
.min(0)
|
|
513
|
+
.optional()
|
|
514
|
+
.describe("Flutter `width` (>= 0): the anchor's width, and the menu's minimum width (capped by `menu_style.max_width`); entry labels are limited to `width` − their padding. Absent = the widest of the entries and the `label` (+ 8), plus the trailing slot (56) and the leading icon + 16 (16 alone without one), at least 112, clamped to the parent's max width. Ignored for the anchor when `expanded_insets` is set."),
|
|
515
|
+
expanded_insets: z
|
|
516
|
+
.array(paddingEntrySchema)
|
|
517
|
+
.optional()
|
|
518
|
+
.describe("Flutter `expandedInsets`, resolved like every padding list (`edgeAnchorSchema`): the anchor fills the parent's width minus these insets; top / bottom are ignored (clamped to 0). An empty list fills the parent exactly. Absent = the intrinsic `width`."),
|
|
519
|
+
menu_height: z
|
|
520
|
+
.number()
|
|
521
|
+
.min(0)
|
|
522
|
+
.optional()
|
|
523
|
+
.describe("Flutter `menuHeight` (>= 0): the menu's maximum height, scrolling past it. Absent = as many entries as fit on the screen."),
|
|
524
|
+
leading_icon: dropdownMenuIconSchema("Flutter `leadingIcon`: the field's prefix icon, in a slot at least 48 × 48 at the start; entries without their own leading icon indent their label to line up with the field text. Absent = none.").optional(),
|
|
525
|
+
trailing_icon: dropdownMenuIconSchema("Flutter `trailingIcon`: the closed-menu icon of the trailing `IconButton`. Absent = `arrow_drop_down` (`Icons.arrow_drop_down`).").optional(),
|
|
526
|
+
selected_trailing_icon: dropdownMenuIconSchema("Flutter `selectedTrailingIcon`: the trailing icon while the menu is open. Absent = `arrow_drop_up` (`Icons.arrow_drop_up`).").optional(),
|
|
527
|
+
show_trailing_icon: z.boolean().optional().describe("Flutter `showTrailingIcon`. Default true. false = no trailing button and no 56 slot."),
|
|
528
|
+
is_enabled: z
|
|
529
|
+
.boolean()
|
|
530
|
+
.optional()
|
|
531
|
+
.describe("Flutter `enabled`. Default true. false = taps ignored, the menu never opens; text, label and icons `#1D1B20` at 38%, outline at 12%."),
|
|
532
|
+
enable_filter: z
|
|
533
|
+
.boolean()
|
|
534
|
+
.optional()
|
|
535
|
+
.describe("Flutter `enableFilter`. Default false. true = while the user types, the menu lists only entries whose label contains the text (case-insensitive). Needs a field that takes focus (`request_focus_on_tap`)."),
|
|
536
|
+
enable_search: z
|
|
537
|
+
.boolean()
|
|
538
|
+
.optional()
|
|
539
|
+
.describe("Flutter `enableSearch`. Default true: the first entry whose label contains the field text (case-insensitive) is highlighted (`#1D1B20` at 12%) and scrolled into view."),
|
|
540
|
+
request_focus_on_tap: z
|
|
541
|
+
.boolean()
|
|
542
|
+
.optional()
|
|
543
|
+
.describe("Flutter `requestFocusOnTap`. Absent = false on all three (the field is a read-only button, no keyboard): Flutter's mobile default, also used by the web preview, which stands in for the mobile app (Flutter itself defaults to true on desktop / web). true = the field takes focus and shows the keyboard, so the text can be edited."),
|
|
544
|
+
text_style: textStyleSchema
|
|
545
|
+
.optional()
|
|
546
|
+
.describe("Flutter `textStyle` of the field (S19 shared schema). Absent = bodyLarge: 16, w400, letter spacing 0.5, height 1.5 (24), `#1D1B20` (disabled at 38%). Entries keep labelLarge."),
|
|
547
|
+
text_align: textAlignmentSchema.optional().describe("Flutter `textAlign` of the field (S19 shared enum). Default `start`; `start` / `end` follow the layout direction."),
|
|
548
|
+
max_lines: intSchema.min(1).optional().describe("Flutter `maxLines` of the field (>= 1). Default 1."),
|
|
549
|
+
decoration: dropdownMenuDecorationSchema.optional(),
|
|
550
|
+
menu_style: dropdownMenuStyleSchema.optional(),
|
|
551
|
+
});
|
|
552
|
+
/** Swift: PinInput/FIOCorePinInputCell.swift. */
|
|
553
|
+
export const pinInputCellSchema = z.strictObject({
|
|
554
|
+
width: z.number().optional(),
|
|
555
|
+
height: z.number().optional(),
|
|
556
|
+
spacing: z.number().optional(),
|
|
557
|
+
corner_radius: z.number().optional(),
|
|
558
|
+
background_color: colorSchema.optional(),
|
|
559
|
+
focused_background_color: colorSchema.optional(),
|
|
560
|
+
border: borderSchema.optional(),
|
|
561
|
+
focused_border: borderSchema.optional(),
|
|
562
|
+
});
|
|
563
|
+
/** Swift: PinInput/FIOCorePinInputConfig.swift. */
|
|
564
|
+
export const pinInputConfigSchema = z.strictObject({
|
|
565
|
+
is_enabled: z.boolean().optional(),
|
|
566
|
+
is_secure: z.boolean().optional(),
|
|
567
|
+
obscuring_character: z.string().optional(),
|
|
568
|
+
keyboard_type: keyboardTypeSchema.optional(),
|
|
569
|
+
auto_focus: z.boolean().optional(),
|
|
570
|
+
auto_submit: z.boolean().optional(),
|
|
571
|
+
});
|
|
572
|
+
/**
|
|
573
|
+
* Swift: PinInput/FIOCorePinInputDataBlock.swift. `length` defaults to 4 and
|
|
574
|
+
* iOS never goes below one cell (`max(1, length)`), so the schema requires >= 1.
|
|
575
|
+
*/
|
|
576
|
+
export const pinInputDataSchema = z.strictObject({
|
|
577
|
+
...commonDataShape,
|
|
578
|
+
length: intSchema.min(1).optional(),
|
|
579
|
+
value: z.string().optional(),
|
|
580
|
+
style: textStyleSchema.optional(),
|
|
581
|
+
cell: pinInputCellSchema.optional(),
|
|
582
|
+
config: pinInputConfigSchema.optional(),
|
|
583
|
+
});
|
|
584
|
+
/**
|
|
585
|
+
* Flutter `Checkbox` with the Material 3 `_CheckboxDefaultsM3` (contract 2.0), from
|
|
586
|
+
* `material/checkbox.dart`, `widgets/toggleable.dart`, `material/constants.dart` and the light M3
|
|
587
|
+
* `ColorScheme` (`theme_data.dart`), flutter/flutter main 66b3ad9. S28: "The checkbox itself does
|
|
588
|
+
* not maintain any state."; "[Checkbox] displays a dash when its value is null."; "If this callback
|
|
589
|
+
* is null, the checkbox will be displayed as disabled and will not respond to input gestures.";
|
|
590
|
+
* `static const double width = 18.0`.
|
|
591
|
+
* Keys (defaults in each key's description): `id`, `events` (`on_change`), `is_checked`,
|
|
592
|
+
* `tristate`, `is_enabled`, `active_color` (`foreground_color` deprecated alias), `check_color`,
|
|
593
|
+
* `side`, `corner_radius`, `is_error`, `semantic_label`, `tap_target_size`, `visual_density`,
|
|
594
|
+
* `title`, `style`, `control_affinity`.
|
|
595
|
+
* Layout: the frame is 48 × 48 (`padded`) or 40 × 40 (`shrink_wrap`), plus 4 per `visual_density`
|
|
596
|
+
* step on both axes (`compact` 40 / 32, `comfortable` 44 / 36), constrained by the parent (a tight
|
|
597
|
+
* parent forces it); the 18 × 18 box is centered in it. With a `title` (an extension; Flutter's
|
|
598
|
+
* `Checkbox` has no label) the text sits right next to the frame, with no extra gap, on the side
|
|
599
|
+
* `control_affinity` does not take, and the whole row toggles. Hugs; never greedy, never a flex child.
|
|
600
|
+
* Paint, bottom to top: the pressed overlay (a circle of radius 20 around the box center) → the
|
|
601
|
+
* fill (rounded by `corner_radius`) → the `side`, inside the box edge → the check or the dash, a
|
|
602
|
+
* stroked path of width 2 in `check_color` (on the 18 box: check (2.7, 8.1) → (7.2, 12.6) →
|
|
603
|
+
* (15.3, 4.5); dash (3.6, 9) → (14.4, 9)). The same path on all three, no SF Symbol or Material icon.
|
|
604
|
+
* State: the block keeps the value locally. A tap goes false → true → false, or with `tristate`
|
|
605
|
+
* false → true → null → false, and posts `on_change` with `event_data.value` `"true"`, `"false"` or
|
|
606
|
+
* `"null"`. A rebind replaces the local value only when `is_checked` changes. Semantics: a checkbox,
|
|
607
|
+
* checked / unchecked, mixed when `tristate` and the value is null, named by `semantic_label`.
|
|
608
|
+
* Deprecated, accepted and ignored: the common keys other than `id`, `events`, `corner_radius`
|
|
609
|
+
* (honored) and `foreground_color` (an alias). They stay valid so saved 1.x check boxes decode.
|
|
610
|
+
* Swift: CheckBox/FIOCoreCheckBoxDataBlock.swift.
|
|
611
|
+
*/
|
|
612
|
+
const ignoredOnCheckBox = (key) => `Deprecated on \`check_box\` since 2.0 and ignored (S28); \`${key}\` stays valid so saved 1.x check boxes decode.`;
|
|
613
|
+
/** Flutter `side` of a `Checkbox`: the `BorderSide` drawn inside the box edge. */
|
|
614
|
+
export const checkBoxSideSchema = z
|
|
615
|
+
.strictObject({
|
|
616
|
+
color: colorSchema.optional().describe("Flutter `BorderSide.color`. Absent = `#49454F` (colorScheme.onSurfaceVariant)."),
|
|
617
|
+
width: z.number().min(0).optional().describe("Flutter `BorderSide.width` (>= 0). Absent = 2."),
|
|
618
|
+
})
|
|
619
|
+
.describe("Flutter `side`, drawn inside the box edge, only while the value is false (Flutter applies a plain `BorderSide` to the unselected state only, also when disabled or in error); checked and mixed boxes draw no side (width 0). Absent = width 2 in `#49454F`; error `#B3261E`; disabled `#1D1B20` at 38%. A left-out field keeps its default.");
|
|
620
|
+
export const checkBoxDataSchema = z
|
|
621
|
+
.strictObject({
|
|
622
|
+
...commonDataShape,
|
|
623
|
+
background_color: commonDataShape.background_color.describe(ignoredOnCheckBox("background_color")).meta({ deprecated: true }),
|
|
624
|
+
foreground_color: commonDataShape.foreground_color.describe("Deprecated since 2.0 (S28): an alias of `active_color`, honored only when `active_color` is absent. Stays valid so saved 1.x check boxes decode.").meta({ deprecated: true }),
|
|
625
|
+
padding: commonDataShape.padding.describe(ignoredOnCheckBox("padding")).meta({ deprecated: true }),
|
|
626
|
+
size: commonDataShape.size.describe(ignoredOnCheckBox("size")).meta({ deprecated: true }),
|
|
627
|
+
alignment_geometry: commonDataShape.alignment_geometry.describe(ignoredOnCheckBox("alignment_geometry")).meta({ deprecated: true }),
|
|
628
|
+
margin: commonDataShape.margin.describe(ignoredOnCheckBox("margin")).meta({ deprecated: true }),
|
|
629
|
+
shape: commonDataShape.shape.describe(ignoredOnCheckBox("shape")).meta({ deprecated: true }),
|
|
630
|
+
corner_radius: commonDataShape.corner_radius.describe("Flutter `shape` as a `RoundedRectangleBorder` radius of the 18 box. Default 2. A negative value counts as 0."),
|
|
631
|
+
gradient: commonDataShape.gradient.describe(ignoredOnCheckBox("gradient")).meta({ deprecated: true }),
|
|
632
|
+
fixed_size: commonDataShape.fixed_size.describe(ignoredOnCheckBox("fixed_size")).meta({ deprecated: true }),
|
|
633
|
+
background_image: commonDataShape.background_image.describe(ignoredOnCheckBox("background_image")).meta({ deprecated: true }),
|
|
634
|
+
background_overlays: commonDataShape.background_overlays.describe(ignoredOnCheckBox("background_overlays")).meta({ deprecated: true }),
|
|
635
|
+
events: commonDataShape.events.describe("`on_change` is posted on each user toggle (Flutter `onChanged`), with `event_data.value` = the new value: `\"true\"`, `\"false\"` or `\"null\"`. A rebind posts nothing. Other event types are not posted."),
|
|
636
|
+
is_checked: z
|
|
637
|
+
.boolean()
|
|
638
|
+
.nullable()
|
|
639
|
+
.optional()
|
|
640
|
+
.describe("Flutter `value`: the initial value. Absent = false. `null` = the mixed state (a dash), valid only with `tristate: true` (Flutter asserts `tristate || value != null`)."),
|
|
641
|
+
tristate: z
|
|
642
|
+
.boolean()
|
|
643
|
+
.optional()
|
|
644
|
+
.describe("Flutter `tristate`. Default false. true = the value may be null and a tap cycles false → true → null → false."),
|
|
645
|
+
is_enabled: z
|
|
646
|
+
.boolean()
|
|
647
|
+
.optional()
|
|
648
|
+
.describe("Default true. false = Flutter's null `onChanged`: taps ignored; checked or mixed fill `#1D1B20` at 38% with the check `#FEF7FF` (colorScheme.surface), unchecked side `#1D1B20` at 38%; `active_color` is ignored; the title `#1D1B20` at 38%."),
|
|
649
|
+
active_color: colorSchema
|
|
650
|
+
.optional()
|
|
651
|
+
.describe("Flutter `activeColor`: the fill while checked or mixed. Absent = `#6750A4` (colorScheme.primary); with `is_error`, `#B3261E`. It wins over `is_error`, not over `is_enabled: false`. Unchecked boxes are transparent."),
|
|
652
|
+
check_color: colorSchema
|
|
653
|
+
.optional()
|
|
654
|
+
.describe("Flutter `checkColor`: the check and the dash, in every state. Absent = `#FFFFFF` (colorScheme.onPrimary; onError with `is_error`); disabled `#FEF7FF` (colorScheme.surface)."),
|
|
655
|
+
side: checkBoxSideSchema.optional(),
|
|
656
|
+
is_error: z
|
|
657
|
+
.boolean()
|
|
658
|
+
.optional()
|
|
659
|
+
.describe("Flutter `isError`. Default false. true = checked fill `#B3261E` (colorScheme.error) with the check `#FFFFFF` (onError), unchecked side `#B3261E` 2, pressed overlay `#B3261E` at 10%. `is_enabled: false` wins."),
|
|
660
|
+
semantic_label: z
|
|
661
|
+
.string()
|
|
662
|
+
.optional()
|
|
663
|
+
.describe("Flutter `semanticLabel`: announced by screen readers, not drawn. Absent = the `title`, if any."),
|
|
664
|
+
tap_target_size: tapTargetSizeSchema
|
|
665
|
+
.optional()
|
|
666
|
+
.describe("Flutter `materialTapTargetSize`. Absent = `padded` on all three (Flutter's mobile default): a 48 × 48 frame. `shrink_wrap` = 40 × 40. The 18 box stays centered; the whole frame is tappable."),
|
|
667
|
+
visual_density: visualDensitySchema
|
|
668
|
+
.optional()
|
|
669
|
+
.describe("Flutter `visualDensity` (S21 schema). Default `standard` (M3 ignores the theme's density). Each step adds 4 to both sides of the frame: `comfortable` 44 / 36, `compact` 40 / 32 (`padded` / `shrink_wrap`). The 18 box does not change."),
|
|
670
|
+
title: z
|
|
671
|
+
.string()
|
|
672
|
+
.optional()
|
|
673
|
+
.describe("An extension (Flutter's `Checkbox` has no label): text next to the frame, with no extra gap; the whole row toggles. Absent or empty = the box only."),
|
|
674
|
+
style: textStyleSchema
|
|
675
|
+
.optional()
|
|
676
|
+
.describe("The title's text style (S19 shared schema). Absent = the S19 text defaults (14). Disabled: the color becomes `#1D1B20` at 38%."),
|
|
677
|
+
control_affinity: z
|
|
678
|
+
.enum(["leading", "trailing"])
|
|
679
|
+
.optional()
|
|
680
|
+
.describe("Flutter `CheckboxListTile.controlAffinity`, limited to `leading` / `trailing`: the side of the box relative to the `title`, following the layout direction. Default `leading` (an extension that keeps saved 1.x check boxes; Flutter's default `platform` puts the box trailing). No effect without a `title`."),
|
|
681
|
+
})
|
|
682
|
+
.refine((data) => data.is_checked !== null || data.tristate === true, {
|
|
683
|
+
message: "`is_checked` may be null only when `tristate` is true (Flutter asserts `tristate || value != null`)",
|
|
684
|
+
path: ["is_checked"],
|
|
685
|
+
})
|
|
686
|
+
.meta({ not: { required: ["is_checked"], properties: { is_checked: { type: "null" }, tristate: { not: { const: true } } } } });
|
|
687
|
+
/**
|
|
688
|
+
* Flutter `SearchBar` with the Material 3 `_SearchBarDefaultsM3` (contract 2.0), from
|
|
689
|
+
* `material/search_anchor.dart`, `text_field.dart`, `input_decorator.dart`, `icon_button.dart`,
|
|
690
|
+
* `material.dart`, `rendering/proxy_box.dart` (`RenderConstrainedBox`), `rendering/flex.dart` and
|
|
691
|
+
* the light M3 `ColorScheme` (`theme_data.dart`), flutter/flutter main 4f5b758. S27: constraints
|
|
692
|
+
* `BoxConstraints(minWidth: 360.0, maxWidth: 800.0, minHeight: 56.0)`; padding
|
|
693
|
+
* `EdgeInsets.symmetric(horizontal: 8.0)`; shape `StadiumBorder()`; elevation 6.0.
|
|
694
|
+
* Keys (defaults in each key's description): `id`, `events` (`on_tap`, `on_change`, `on_complete`),
|
|
695
|
+
* `text`, `hint_text` (`placeholder` deprecated alias), `is_editable` (= `!readOnly`), `is_enabled`,
|
|
696
|
+
* `auto_focus`, `leading` (`icon` deprecated alias), `trailing`, `background_color`, `elevation`,
|
|
697
|
+
* `shadow_color`, `surface_tint_color`, `overlay_color`, `border` (= `side`), `shape`,
|
|
698
|
+
* `corner_radius`, `corner_radii`, `padding`, `constraints`, `style` (= `textStyle`), `hint_style`
|
|
699
|
+
* (`placeholder_style` deprecated alias), `keyboard_type`, `text_capitalization`, `submit_label`
|
|
700
|
+
* (= `textInputAction`); `size` and `gradient` are kept as extensions.
|
|
701
|
+
* Layout: `ConstrainedBox(constraints)` → `Material` → `Padding(padding)` → `Row(leading,
|
|
702
|
+
* Expanded(Padding(padding, TextField)), ...trailing)`. The box constraints are `constraints`
|
|
703
|
+
* enforced into the parent's (`BoxConstraints.enforce`), `size` tight inside them on each axis
|
|
704
|
+
* set; the `Row` fills the max width, so the bar fills a bounded width up to 800 and is 800 wide
|
|
705
|
+
* under an unbounded one (a direct `row` child: it overflows a 390 row; wrap it in `expanded`). The
|
|
706
|
+
* height is at least 56: the tallest of `leading`, the text line (24 for bodyLarge, a dense field
|
|
707
|
+
* with no content padding) plus the inner padding, and each `trailing` item, plus the outer padding;
|
|
708
|
+
* the children are centered vertically. `padding` is applied twice (Flutter): around the row and
|
|
709
|
+
* again around the text, so the default text sits 8 from `leading` / `trailing` and 16 from an
|
|
710
|
+
* edge without them. Never a flex child (S17).
|
|
711
|
+
* Paint (`Material`, `InkWell`): elevation shadow (`shadow_color`) → fill (`background_color`, or
|
|
712
|
+
* `gradient`) → surface tint at the M3 elevation opacity → pressed overlay (clipped to the shape)
|
|
713
|
+
* → leading, text or hint, trailing → `border`, in front. Disabled (`is_enabled` false): the whole
|
|
714
|
+
* bar at opacity 0.38, taps ignored, no events.
|
|
715
|
+
* Events: `on_tap` on each tap of the bar, editable or not (Flutter `onTap`, `onTapAlwaysCalled`);
|
|
716
|
+
* an editable bar also takes focus. `on_change` on each user edit with `event_data.value` = the new
|
|
717
|
+
* text (Flutter `onChanged`); `on_complete` on the keyboard action key with the current text
|
|
718
|
+
* (Flutter `onSubmitted`). A server-set `text` posts nothing.
|
|
719
|
+
* Deprecated, accepted and ignored: `horizontal_padding`, `spacing` and the common keys
|
|
720
|
+
* `foreground_color`, `alignment_geometry`, `margin`, `fixed_size`, `background_image`,
|
|
721
|
+
* `background_overlays`. They stay valid so saved 1.x search bars decode. No built-in clear button
|
|
722
|
+
* (Flutter has none; put an `icon_button` in `trailing`).
|
|
723
|
+
* Swift: Search/FIOCoreSearchDataBlock.swift.
|
|
724
|
+
*/
|
|
725
|
+
const ignoredOnSearch = (key) => `Deprecated on \`search\` since 2.0 and ignored (S27); \`${key}\` stays valid so saved 1.x search bars decode.`;
|
|
726
|
+
/**
|
|
727
|
+
* A `leading` or `trailing` widget of a `search` (Flutter: "Typically the [leading] widget is an
|
|
728
|
+
* [Icon] or an [IconButton]"): an `icon` or `icon_button` block, `{ type, data }`. With no `color`
|
|
729
|
+
* it takes the slot color (Flutter `IconTheme.merge`): leading `#1D1B20` (onSurface), trailing
|
|
730
|
+
* `#49454F` (onSurfaceVariant); an `icon_button` without `color` uses it as its foreground in
|
|
731
|
+
* every enabled state, and its pressed overlay is that color at 10% (`IconButton.themeStyleOf`).
|
|
732
|
+
*/
|
|
733
|
+
export const searchSlotBlockSchema = z
|
|
734
|
+
.discriminatedUnion("type", [
|
|
735
|
+
z.strictObject({ type: z.literal("icon"), data: iconDataSchema }),
|
|
736
|
+
z.strictObject({ type: z.literal("icon_button"), data: iconButtonDataSchema }),
|
|
737
|
+
])
|
|
738
|
+
.describe("An `icon` or `icon_button` block (`{ type, data }`). Absent `color` = the slot color: leading `#1D1B20`, trailing `#49454F`.");
|
|
739
|
+
export const searchDataSchema = z.strictObject({
|
|
740
|
+
...commonDataShape,
|
|
741
|
+
foreground_color: commonDataShape.foreground_color.describe(ignoredOnSearch("foreground_color") + " Use `style.foreground_color`.").meta({ deprecated: true }),
|
|
742
|
+
alignment_geometry: commonDataShape.alignment_geometry.describe(ignoredOnSearch("alignment_geometry")).meta({ deprecated: true }),
|
|
743
|
+
margin: commonDataShape.margin.describe(ignoredOnSearch("margin")).meta({ deprecated: true }),
|
|
744
|
+
fixed_size: commonDataShape.fixed_size.describe(ignoredOnSearch("fixed_size")).meta({ deprecated: true }),
|
|
745
|
+
background_image: commonDataShape.background_image.describe(ignoredOnSearch("background_image")).meta({ deprecated: true }),
|
|
746
|
+
background_overlays: commonDataShape.background_overlays.describe(ignoredOnSearch("background_overlays")).meta({ deprecated: true }),
|
|
747
|
+
events: commonDataShape.events.describe("`on_tap` on each tap of the bar, editable or read-only (Flutter `onTap`, called for every tap); `on_change` on each user edit, `event_data.value` = the new text (Flutter `onChanged`); `on_complete` on the keyboard action key, `event_data.value` = the current text (Flutter `onSubmitted`). A server-set `text` and a disabled bar post nothing. Other event types are not posted."),
|
|
748
|
+
text: z.string().optional().describe("The text (Flutter `controller.text`). Absent = empty. A new value from the server replaces it without posting `on_change`."),
|
|
749
|
+
hint_text: z
|
|
750
|
+
.string()
|
|
751
|
+
.optional()
|
|
752
|
+
.describe("Flutter `hintText`: \"Displayed at the same location on the screen where text may be entered when the input is empty.\" Absent = `placeholder`, else no hint."),
|
|
753
|
+
placeholder: z
|
|
754
|
+
.string()
|
|
755
|
+
.optional()
|
|
756
|
+
.describe("Deprecated since 2.0 (S27): an alias of `hint_text`, honored only when `hint_text` is absent. Stays valid so saved 1.x search bars decode.").meta({ deprecated: true }),
|
|
757
|
+
is_editable: z
|
|
758
|
+
.boolean()
|
|
759
|
+
.optional()
|
|
760
|
+
.describe("false = Flutter `readOnly: true`: no keyboard and no cursor, the text cannot be edited (no `on_change` / `on_complete`), each tap posts `on_tap`. Default true (`readOnly` false). The enabled colors stay."),
|
|
761
|
+
is_enabled: z
|
|
762
|
+
.boolean()
|
|
763
|
+
.optional()
|
|
764
|
+
.describe("Flutter `enabled`. Default true. false: \"the widget will ignore taps and appear dimmed\": the whole bar at opacity 0.38 (`_kDisableSearchBarOpacity`), no events."),
|
|
765
|
+
auto_focus: z
|
|
766
|
+
.boolean()
|
|
767
|
+
.optional()
|
|
768
|
+
.describe("Flutter `autoFocus`. Default false. true = focused (keyboard shown when editable) when the bar first appears."),
|
|
769
|
+
leading: searchSlotBlockSchema
|
|
770
|
+
.optional()
|
|
771
|
+
.describe("Flutter `leading`: \"A widget to display before the text input field.\" An `icon` or `icon_button` block at the start, `padding` from the edge and from the text. Absent = `icon`, else nothing (no default search icon). Absent `color` = `#1D1B20` (onSurface)."),
|
|
772
|
+
icon: iconDataSchema
|
|
773
|
+
.optional()
|
|
774
|
+
.describe("Deprecated since 2.0 (S27): an `icon` data payload (no `{ type, data }` wrapper), honored as `leading` `{ type: \"icon\", data: icon }` only when `leading` is absent. Stays valid so saved 1.x search bars decode.").meta({ deprecated: true }),
|
|
775
|
+
trailing: z
|
|
776
|
+
.array(searchSlotBlockSchema)
|
|
777
|
+
.optional()
|
|
778
|
+
.describe("Flutter `trailing`: \"A list of Widgets to display in a row after the text field.\" `icon` / `icon_button` blocks in order, at the end, with no gap between them (Flutter: \"There should not be more than two trailing actions.\"). Absent `color` = `#49454F` (onSurfaceVariant). Absent or empty = none."),
|
|
779
|
+
background_color: commonDataShape.background_color.describe("Flutter `backgroundColor`. Absent = `#ECE6F0` (colorScheme.surfaceContainerHigh)."),
|
|
780
|
+
gradient: commonDataShape.gradient.describe("Extension (no Flutter `SearchBar` key): replaces the fill (`background_color`) inside the shape, as `container` (S8)."),
|
|
781
|
+
elevation: z
|
|
782
|
+
.number()
|
|
783
|
+
.min(0)
|
|
784
|
+
.optional()
|
|
785
|
+
.describe("Flutter `elevation` (>= 0) of the bar's `Material`: the shadow, and the surface tint opacity. Default 6."),
|
|
786
|
+
shadow_color: colorSchema.optional().describe("Flutter `shadowColor`. Absent = `#000000` (colorScheme.shadow)."),
|
|
787
|
+
surface_tint_color: colorSchema
|
|
788
|
+
.optional()
|
|
789
|
+
.describe("Flutter `surfaceTintColor`. Absent = transparent (no tint). Set = an overlay of this color over the fill at the M3 elevation opacity: 0 → 0, 1 → 5%, 3 → 8%, 6 → 11%, 8 → 12%, 12 → 14%, interpolated between and clamped past the ends."),
|
|
790
|
+
overlay_color: colorSchema
|
|
791
|
+
.optional()
|
|
792
|
+
.describe("Flutter `overlayColor` as one color for every state: the pressed overlay over the whole bar, clipped to the shape (and the hover overlay on web). Absent = `#1D1B20` at 10% pressed, at 8% hovered (web); no focus overlay."),
|
|
793
|
+
border: borderSchema
|
|
794
|
+
.optional()
|
|
795
|
+
.describe("Flutter `side`: \"The color and weight of the search bar's outline.\", drawn inside the edge of the shape, in front of the content; `width` default 1. Absent = none."),
|
|
796
|
+
shape: commonDataShape.shape.describe("Flutter `shape`. Absent = `capsule` (`StadiumBorder`); `rect` rounds by `corner_radius` (default 0) and `corner_radii`; `circle` = a centered circle, diameter = the shorter side."),
|
|
797
|
+
corner_radius: commonDataShape.corner_radius.describe("The corner radius of a `rect` shape. Default 0. A negative value counts as 0."),
|
|
798
|
+
corner_radii: cornerRadiiSchema
|
|
799
|
+
.optional()
|
|
800
|
+
.describe("Per-corner radii of a `rect` shape, each overriding `corner_radius`; `start` / `end` follow the layout direction."),
|
|
801
|
+
padding: commonDataShape.padding.describe("Flutter `padding`, resolved like every padding list (`edgeAnchorSchema`). Absent = horizontal 8 (`EdgeInsets.symmetric(horizontal: 8.0)`). Applied twice, as Flutter does: between the edge and the row (`leading`, text, `trailing`) and again around the text, so the default text sits 8 from `leading` / `trailing` and 16 from an edge without them. Negative constants count as 0."),
|
|
802
|
+
horizontal_padding: z.number().optional().describe(ignoredOnSearch("horizontal_padding") + " Use `padding`.").meta({ deprecated: true }),
|
|
803
|
+
spacing: z.number().optional().describe(ignoredOnSearch("spacing") + " Use `padding`.").meta({ deprecated: true }),
|
|
804
|
+
constraints: boxConstraintsSchema
|
|
805
|
+
.optional()
|
|
806
|
+
.describe("Flutter `constraints` (each value >= 0), enforced into the parent's. Absent = min width 360, max width 800, min height 56. Given, it replaces the default: a min it leaves out is 0 and a max it leaves out is unbounded."),
|
|
807
|
+
size: commonDataShape.size.describe("Extension (Flutter has no `SearchBar` size): an exact size on each axis set, clamped into `constraints` (so with the defaults a width below 360 becomes 360 and a height below 56 becomes 56), then by the parent. Absent = the layout above."),
|
|
808
|
+
style: textStyleSchema
|
|
809
|
+
.optional()
|
|
810
|
+
.describe("Flutter `textStyle` of the text (S19 shared schema). Absent keys = M3 bodyLarge: 16, w400, letter spacing 0.5, `height` 1.5 (24), `#1D1B20` (onSurface). Also the hint's style when `hint_style` is absent."),
|
|
811
|
+
hint_style: textStyleSchema
|
|
812
|
+
.optional()
|
|
813
|
+
.describe("Flutter `hintStyle`, applied over the text style. Absent = `placeholder_style`, else `style`, else bodyLarge in `#49454F` (onSurfaceVariant); a hint style without a color keeps `#49454F`."),
|
|
814
|
+
placeholder_style: textStyleSchema
|
|
815
|
+
.optional()
|
|
816
|
+
.describe("Deprecated since 2.0 (S27): an alias of `hint_style`, honored only when `hint_style` is absent. Stays valid so saved 1.x search bars decode.").meta({ deprecated: true }),
|
|
817
|
+
keyboard_type: keyboardTypeSchema
|
|
818
|
+
.optional()
|
|
819
|
+
.describe("Flutter `keyboardType`. Absent = `default` (Flutter `TextInputType.text`, a single-line field)."),
|
|
820
|
+
text_capitalization: textCapitalizationSchema
|
|
821
|
+
.optional()
|
|
822
|
+
.describe("Flutter `textCapitalization`. Default `never` (`TextCapitalization.none`)."),
|
|
823
|
+
submit_label: submitLabelSchema
|
|
824
|
+
.optional()
|
|
825
|
+
.describe("Flutter `textInputAction`: the keyboard's action key, which posts `on_complete`. Absent = `done` (Flutter's single-line default); 1.x always showed `search` (S7 break)."),
|
|
826
|
+
});
|
|
827
|
+
/** Swift: BellToggle/FIOCoreBellToggleDataBlock.swift. Height, type, icon and padding presets. */
|
|
828
|
+
export const bellToggleSizeSchema = z.enum(["sm", "md", "lg"]);
|
|
829
|
+
/**
|
|
830
|
+
* Swift: BellToggle/FIOCoreBellToggleDataBlock.swift. A pill toggle with a bell
|
|
831
|
+
* icon and an off / on label. Common `foreground_color` and `background_color`
|
|
832
|
+
* are the ink and fill at rest; `on_*` colors apply while on. `control_size`
|
|
833
|
+
* is a preset (36 / 44 / 52 tall), separate from the common `size` in points.
|
|
834
|
+
* `is_on` and `count` are initial values; a tap emits `on_change` with
|
|
835
|
+
* `value` `"true"` or `"false"`. Motion (ring, waves, reveal) is fixed per
|
|
836
|
+
* platform and not part of the contract.
|
|
837
|
+
*/
|
|
838
|
+
export const bellToggleDataSchema = z.strictObject({
|
|
839
|
+
...commonDataShape,
|
|
840
|
+
off_label: z.string().optional(),
|
|
841
|
+
on_label: z.string().optional(),
|
|
842
|
+
label: z.string().optional(),
|
|
843
|
+
system_name: z.string().optional(),
|
|
844
|
+
on_foreground_color: colorSchema.optional(),
|
|
845
|
+
on_background_color: colorSchema.optional(),
|
|
846
|
+
control_size: bellToggleSizeSchema.optional(),
|
|
847
|
+
is_on: z.boolean().optional(),
|
|
848
|
+
is_enabled: z.boolean().optional(),
|
|
849
|
+
count: intSchema.min(0).optional(),
|
|
850
|
+
show_badge: z.boolean().optional(),
|
|
851
|
+
badge_color: colorSchema.optional(),
|
|
852
|
+
badge_text_color: colorSchema.optional(),
|
|
853
|
+
waves: z.boolean().optional(),
|
|
854
|
+
});
|
|
855
|
+
//# sourceMappingURL=input.js.map
|