termcast 1.3.9
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/dist/action-utils.d.ts +25 -0
- package/dist/action-utils.d.ts.map +1 -0
- package/dist/action-utils.js +209 -0
- package/dist/action-utils.js.map +1 -0
- package/dist/ai.d.ts +104 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +135 -0
- package/dist/ai.js.map +1 -0
- package/dist/apis/ai.d.ts +104 -0
- package/dist/apis/ai.d.ts.map +1 -0
- package/dist/apis/ai.js +135 -0
- package/dist/apis/ai.js.map +1 -0
- package/dist/apis/cache.d.ts +84 -0
- package/dist/apis/cache.d.ts.map +1 -0
- package/dist/apis/cache.js +307 -0
- package/dist/apis/cache.js.map +1 -0
- package/dist/apis/cache.test.d.ts +2 -0
- package/dist/apis/cache.test.d.ts.map +1 -0
- package/dist/apis/cache.test.js +246 -0
- package/dist/apis/cache.test.js.map +1 -0
- package/dist/apis/clipboard.d.ts +36 -0
- package/dist/apis/clipboard.d.ts.map +1 -0
- package/dist/apis/clipboard.js +154 -0
- package/dist/apis/clipboard.js.map +1 -0
- package/dist/apis/environment.d.ts +63 -0
- package/dist/apis/environment.d.ts.map +1 -0
- package/dist/apis/environment.js +189 -0
- package/dist/apis/environment.js.map +1 -0
- package/dist/apis/hud.d.ts +7 -0
- package/dist/apis/hud.d.ts.map +1 -0
- package/dist/apis/hud.js +45 -0
- package/dist/apis/hud.js.map +1 -0
- package/dist/apis/localstorage.d.ts +13 -0
- package/dist/apis/localstorage.d.ts.map +1 -0
- package/dist/apis/localstorage.js +190 -0
- package/dist/apis/localstorage.js.map +1 -0
- package/dist/apis/localstorage.test.d.ts +2 -0
- package/dist/apis/localstorage.test.d.ts.map +1 -0
- package/dist/apis/localstorage.test.js +131 -0
- package/dist/apis/localstorage.test.js.map +1 -0
- package/dist/apis/oauth.d.ts +142 -0
- package/dist/apis/oauth.d.ts.map +1 -0
- package/dist/apis/oauth.js +551 -0
- package/dist/apis/oauth.js.map +1 -0
- package/dist/apis/preferences.d.ts +23 -0
- package/dist/apis/preferences.d.ts.map +1 -0
- package/dist/apis/preferences.js +105 -0
- package/dist/apis/preferences.js.map +1 -0
- package/dist/apis/toast.d.ts +81 -0
- package/dist/apis/toast.d.ts.map +1 -0
- package/dist/apis/toast.js +275 -0
- package/dist/apis/toast.js.map +1 -0
- package/dist/apis/toast.test.d.ts +2 -0
- package/dist/apis/toast.test.d.ts.map +1 -0
- package/dist/apis/toast.test.js +67 -0
- package/dist/apis/toast.test.js.map +1 -0
- package/dist/apis/window.d.ts +12 -0
- package/dist/apis/window.d.ts.map +1 -0
- package/dist/apis/window.js +47 -0
- package/dist/apis/window.js.map +1 -0
- package/dist/build.d.ts +15 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +213 -0
- package/dist/build.js.map +1 -0
- package/dist/build.test.d.ts +2 -0
- package/dist/build.test.d.ts.map +1 -0
- package/dist/build.test.js +73 -0
- package/dist/build.test.js.map +1 -0
- package/dist/cache.d.ts +32 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +205 -0
- package/dist/cache.js.map +1 -0
- package/dist/cache.test.d.ts +2 -0
- package/dist/cache.test.d.ts.map +1 -0
- package/dist/cache.test.js +246 -0
- package/dist/cache.test.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +278 -0
- package/dist/cli.js.map +1 -0
- package/dist/clipboard.d.ts +36 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +154 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/colors.d.ts +15 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +13 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/actions.d.ts +120 -0
- package/dist/components/actions.d.ts.map +1 -0
- package/dist/components/actions.js +371 -0
- package/dist/components/actions.js.map +1 -0
- package/dist/components/alert.d.ts +25 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +99 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/detail.d.ts +65 -0
- package/dist/components/detail.d.ts.map +1 -0
- package/dist/components/detail.js +147 -0
- package/dist/components/detail.js.map +1 -0
- package/dist/components/dropdown.d.ts +40 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/dropdown.js +202 -0
- package/dist/components/dropdown.js.map +1 -0
- package/dist/components/extension-preferences.d.ts +8 -0
- package/dist/components/extension-preferences.d.ts.map +1 -0
- package/dist/components/extension-preferences.js +139 -0
- package/dist/components/extension-preferences.js.map +1 -0
- package/dist/components/form/assign-components.d.ts +2 -0
- package/dist/components/form/assign-components.d.ts.map +1 -0
- package/dist/components/form/assign-components.js +22 -0
- package/dist/components/form/assign-components.js.map +1 -0
- package/dist/components/form/checkbox.d.ts +7 -0
- package/dist/components/form/checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox.js +46 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.d.ts +18 -0
- package/dist/components/form/date-picker.d.ts.map +1 -0
- package/dist/components/form/date-picker.js +69 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/description.d.ts +7 -0
- package/dist/components/form/description.d.ts.map +1 -0
- package/dist/components/form/description.js +8 -0
- package/dist/components/form/description.js.map +1 -0
- package/dist/components/form/dropdown.d.ts +25 -0
- package/dist/components/form/dropdown.d.ts.map +1 -0
- package/dist/components/form/dropdown.js +286 -0
- package/dist/components/form/dropdown.js.map +1 -0
- package/dist/components/form/file-autocomplete.d.ts +12 -0
- package/dist/components/form/file-autocomplete.d.ts.map +1 -0
- package/dist/components/form/file-autocomplete.js +84 -0
- package/dist/components/form/file-autocomplete.js.map +1 -0
- package/dist/components/form/file-picker.d.ts +31 -0
- package/dist/components/form/file-picker.d.ts.map +1 -0
- package/dist/components/form/file-picker.js +113 -0
- package/dist/components/form/file-picker.js.map +1 -0
- package/dist/components/form/form-end.d.ts +2 -0
- package/dist/components/form/form-end.d.ts.map +1 -0
- package/dist/components/form/form-end.js +6 -0
- package/dist/components/form/form-end.js.map +1 -0
- package/dist/components/form/form-type-only.d.ts +174 -0
- package/dist/components/form/form-type-only.d.ts.map +1 -0
- package/dist/components/form/form-type-only.js +2 -0
- package/dist/components/form/form-type-only.js.map +1 -0
- package/dist/components/form/index.d.ts +46 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +106 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/form/password-field.d.ts +7 -0
- package/dist/components/form/password-field.d.ts.map +1 -0
- package/dist/components/form/password-field.js +34 -0
- package/dist/components/form/password-field.js.map +1 -0
- package/dist/components/form/separator.d.ts +2 -0
- package/dist/components/form/separator.d.ts.map +1 -0
- package/dist/components/form/separator.js +8 -0
- package/dist/components/form/separator.js.map +1 -0
- package/dist/components/form/tagpicker.d.ts +134 -0
- package/dist/components/form/tagpicker.d.ts.map +1 -0
- package/dist/components/form/tagpicker.js +79 -0
- package/dist/components/form/tagpicker.js.map +1 -0
- package/dist/components/form/text-area.d.ts +8 -0
- package/dist/components/form/text-area.d.ts.map +1 -0
- package/dist/components/form/text-area.js +26 -0
- package/dist/components/form/text-area.js.map +1 -0
- package/dist/components/form/text-field.d.ts +7 -0
- package/dist/components/form/text-field.d.ts.map +1 -0
- package/dist/components/form/text-field.js +28 -0
- package/dist/components/form/text-field.js.map +1 -0
- package/dist/components/form/types.d.ts +43 -0
- package/dist/components/form/types.d.ts.map +1 -0
- package/dist/components/form/types.js +2 -0
- package/dist/components/form/types.js.map +1 -0
- package/dist/components/form/use-form-handling.d.ts +4 -0
- package/dist/components/form/use-form-handling.d.ts.map +1 -0
- package/dist/components/form/use-form-handling.js +37 -0
- package/dist/components/form/use-form-handling.js.map +1 -0
- package/dist/components/form/use-form-navigation.d.ts +8 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -0
- package/dist/components/form/use-form-navigation.js +58 -0
- package/dist/components/form/use-form-navigation.js.map +1 -0
- package/dist/components/form/with-left-border.d.ts +17 -0
- package/dist/components/form/with-left-border.d.ts.map +1 -0
- package/dist/components/form/with-left-border.js +10 -0
- package/dist/components/form/with-left-border.js.map +1 -0
- package/dist/components/icon.d.ts +9 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +485 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/image.d.ts +19 -0
- package/dist/components/image.d.ts.map +1 -0
- package/dist/components/image.js +32 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/list.d.ts +234 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +667 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/loading-bar.d.ts +8 -0
- package/dist/components/loading-bar.d.ts.map +1 -0
- package/dist/components/loading-bar.js +107 -0
- package/dist/components/loading-bar.js.map +1 -0
- package/dist/components/menubar-extra.d.ts +68 -0
- package/dist/components/menubar-extra.d.ts.map +1 -0
- package/dist/components/menubar-extra.js +39 -0
- package/dist/components/menubar-extra.js.map +1 -0
- package/dist/descendants.d.ts +25 -0
- package/dist/descendants.d.ts.map +1 -0
- package/dist/descendants.js +81 -0
- package/dist/descendants.js.map +1 -0
- package/dist/dev-ui.d.ts +7 -0
- package/dist/dev-ui.d.ts.map +1 -0
- package/dist/dev-ui.js +118 -0
- package/dist/dev-ui.js.map +1 -0
- package/dist/e2e-node.d.ts +63 -0
- package/dist/e2e-node.d.ts.map +1 -0
- package/dist/e2e-node.js +255 -0
- package/dist/e2e-node.js.map +1 -0
- package/dist/e2e.d.ts +39 -0
- package/dist/e2e.d.ts.map +1 -0
- package/dist/e2e.js +127 -0
- package/dist/e2e.js.map +1 -0
- package/dist/environment.d.ts +63 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +189 -0
- package/dist/environment.js.map +1 -0
- package/dist/examples/action-show-in-finder.d.ts +2 -0
- package/dist/examples/action-show-in-finder.d.ts.map +1 -0
- package/dist/examples/action-show-in-finder.js +13 -0
- package/dist/examples/action-show-in-finder.js.map +1 -0
- package/dist/examples/datepicker.d.ts +2 -0
- package/dist/examples/datepicker.d.ts.map +1 -0
- package/dist/examples/datepicker.js +344 -0
- package/dist/examples/datepicker.js.map +1 -0
- package/dist/examples/environment-test.d.ts +2 -0
- package/dist/examples/environment-test.d.ts.map +1 -0
- package/dist/examples/environment-test.js +28 -0
- package/dist/examples/environment-test.js.map +1 -0
- package/dist/examples/error-boundary.d.ts +6 -0
- package/dist/examples/error-boundary.d.ts.map +1 -0
- package/dist/examples/error-boundary.js +67 -0
- package/dist/examples/error-boundary.js.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +2 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js +46 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +1 -0
- package/dist/examples/form-basic.d.ts +2 -0
- package/dist/examples/form-basic.d.ts.map +1 -0
- package/dist/examples/form-basic.js +21 -0
- package/dist/examples/form-basic.js.map +1 -0
- package/dist/examples/form-basic.vitest.d.ts +2 -0
- package/dist/examples/form-basic.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic.vitest.js +995 -0
- package/dist/examples/form-basic.vitest.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.js +13 -0
- package/dist/examples/form-dropdown-with-sections.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js +75 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +1 -0
- package/dist/examples/form-dropdown.d.ts +2 -0
- package/dist/examples/form-dropdown.d.ts.map +1 -0
- package/dist/examples/form-dropdown.js +13 -0
- package/dist/examples/form-dropdown.js.map +1 -0
- package/dist/examples/form-dropdown.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown.vitest.js +722 -0
- package/dist/examples/form-dropdown.vitest.js.map +1 -0
- package/dist/examples/form-multiselect-dropdown.d.ts +2 -0
- package/dist/examples/form-multiselect-dropdown.d.ts.map +1 -0
- package/dist/examples/form-multiselect-dropdown.js +13 -0
- package/dist/examples/form-multiselect-dropdown.js.map +1 -0
- package/dist/examples/form-tagpicker.d.ts +2 -0
- package/dist/examples/form-tagpicker.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.js +13 -0
- package/dist/examples/form-tagpicker.js.map +1 -0
- package/dist/examples/form-tagpicker.vitest.d.ts +2 -0
- package/dist/examples/form-tagpicker.vitest.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.vitest.js +491 -0
- package/dist/examples/form-tagpicker.vitest.js.map +1 -0
- package/dist/examples/internal/descendants-filtering.d.ts +2 -0
- package/dist/examples/internal/descendants-filtering.d.ts.map +1 -0
- package/dist/examples/internal/descendants-filtering.js +144 -0
- package/dist/examples/internal/descendants-filtering.js.map +1 -0
- package/dist/examples/internal/descendants.d.ts +2 -0
- package/dist/examples/internal/descendants.d.ts.map +1 -0
- package/dist/examples/internal/descendants.js +134 -0
- package/dist/examples/internal/descendants.js.map +1 -0
- package/dist/examples/internal/nested-boxes.d.ts +2 -0
- package/dist/examples/internal/nested-boxes.d.ts.map +1 -0
- package/dist/examples/internal/nested-boxes.js +7 -0
- package/dist/examples/internal/nested-boxes.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.d.ts +2 -0
- package/dist/examples/internal/scrollbox-demo.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +104 -0
- package/dist/examples/internal/scrollbox-demo.js.map +1 -0
- package/dist/examples/internal/simple-dialog.d.ts +2 -0
- package/dist/examples/internal/simple-dialog.d.ts.map +1 -0
- package/dist/examples/internal/simple-dialog.js +43 -0
- package/dist/examples/internal/simple-dialog.js.map +1 -0
- package/dist/examples/internal/text-stacking.d.ts +2 -0
- package/dist/examples/internal/text-stacking.d.ts.map +1 -0
- package/dist/examples/internal/text-stacking.js +53 -0
- package/dist/examples/internal/text-stacking.js.map +1 -0
- package/dist/examples/internal/unicode-square-repro.d.ts +2 -0
- package/dist/examples/internal/unicode-square-repro.d.ts.map +1 -0
- package/dist/examples/internal/unicode-square-repro.js +7 -0
- package/dist/examples/internal/unicode-square-repro.js.map +1 -0
- package/dist/examples/list-dropdown-default.d.ts +2 -0
- package/dist/examples/list-dropdown-default.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.js +14 -0
- package/dist/examples/list-dropdown-default.js.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts +2 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.js +164 -0
- package/dist/examples/list-dropdown-default.vitest.js.map +1 -0
- package/dist/examples/list-fetch-data.d.ts +2 -0
- package/dist/examples/list-fetch-data.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.js +87 -0
- package/dist/examples/list-fetch-data.js.map +1 -0
- package/dist/examples/list-fetch-data.vitest.d.ts +2 -0
- package/dist/examples/list-fetch-data.vitest.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.vitest.js +103 -0
- package/dist/examples/list-fetch-data.vitest.js.map +1 -0
- package/dist/examples/list-filter-navigation.d.ts +2 -0
- package/dist/examples/list-filter-navigation.d.ts.map +1 -0
- package/dist/examples/list-filter-navigation.js +8 -0
- package/dist/examples/list-filter-navigation.js.map +1 -0
- package/dist/examples/list-with-detail.d.ts +2 -0
- package/dist/examples/list-with-detail.d.ts.map +1 -0
- package/dist/examples/list-with-detail.js +94 -0
- package/dist/examples/list-with-detail.js.map +1 -0
- package/dist/examples/list-with-detail.vitest.d.ts +2 -0
- package/dist/examples/list-with-detail.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-detail.vitest.js +438 -0
- package/dist/examples/list-with-detail.vitest.js.map +1 -0
- package/dist/examples/list-with-dropdown.d.ts +2 -0
- package/dist/examples/list-with-dropdown.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.js +43 -0
- package/dist/examples/list-with-dropdown.js.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts +2 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.js +297 -0
- package/dist/examples/list-with-dropdown.vitest.js.map +1 -0
- package/dist/examples/list-with-sections.d.ts +2 -0
- package/dist/examples/list-with-sections.d.ts.map +1 -0
- package/dist/examples/list-with-sections.js +67 -0
- package/dist/examples/list-with-sections.js.map +1 -0
- package/dist/examples/list-with-sections.vitest.d.ts +2 -0
- package/dist/examples/list-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-sections.vitest.js +441 -0
- package/dist/examples/list-with-sections.vitest.js.map +1 -0
- package/dist/examples/miscellaneous.d.ts +2 -0
- package/dist/examples/miscellaneous.d.ts.map +1 -0
- package/dist/examples/miscellaneous.js +313 -0
- package/dist/examples/miscellaneous.js.map +1 -0
- package/dist/examples/nested-navigation.d.ts +2 -0
- package/dist/examples/nested-navigation.d.ts.map +1 -0
- package/dist/examples/nested-navigation.js +35 -0
- package/dist/examples/nested-navigation.js.map +1 -0
- package/dist/examples/preferences-test.d.ts +2 -0
- package/dist/examples/preferences-test.d.ts.map +1 -0
- package/dist/examples/preferences-test.js +43 -0
- package/dist/examples/preferences-test.js.map +1 -0
- package/dist/examples/simple-dropdown.d.ts +2 -0
- package/dist/examples/simple-dropdown.d.ts.map +1 -0
- package/dist/examples/simple-dropdown.js +15 -0
- package/dist/examples/simple-dropdown.js.map +1 -0
- package/dist/examples/simple-file-picker.d.ts +2 -0
- package/dist/examples/simple-file-picker.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.js +21 -0
- package/dist/examples/simple-file-picker.js.map +1 -0
- package/dist/examples/simple-file-picker.vitest.d.ts +2 -0
- package/dist/examples/simple-file-picker.vitest.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.vitest.js +277 -0
- package/dist/examples/simple-file-picker.vitest.js.map +1 -0
- package/dist/examples/simple-grid.d.ts +2 -0
- package/dist/examples/simple-grid.d.ts.map +1 -0
- package/dist/examples/simple-grid.js +51 -0
- package/dist/examples/simple-grid.js.map +1 -0
- package/dist/examples/simple-grid.vitest.d.ts +2 -0
- package/dist/examples/simple-grid.vitest.d.ts.map +1 -0
- package/dist/examples/simple-grid.vitest.js +498 -0
- package/dist/examples/simple-grid.vitest.js.map +1 -0
- package/dist/examples/simple-hud.d.ts +2 -0
- package/dist/examples/simple-hud.d.ts.map +1 -0
- package/dist/examples/simple-hud.js +18 -0
- package/dist/examples/simple-hud.js.map +1 -0
- package/dist/examples/simple-list-search.d.ts +2 -0
- package/dist/examples/simple-list-search.d.ts.map +1 -0
- package/dist/examples/simple-list-search.js +26 -0
- package/dist/examples/simple-list-search.js.map +1 -0
- package/dist/examples/simple-list.d.ts +2 -0
- package/dist/examples/simple-list.d.ts.map +1 -0
- package/dist/examples/simple-list.js +50 -0
- package/dist/examples/simple-list.js.map +1 -0
- package/dist/examples/simple-navigation.d.ts +2 -0
- package/dist/examples/simple-navigation.d.ts.map +1 -0
- package/dist/examples/simple-navigation.js +36 -0
- package/dist/examples/simple-navigation.js.map +1 -0
- package/dist/examples/simple-navigation.vitest.d.ts +2 -0
- package/dist/examples/simple-navigation.vitest.d.ts.map +1 -0
- package/dist/examples/simple-navigation.vitest.js +522 -0
- package/dist/examples/simple-navigation.vitest.js.map +1 -0
- package/dist/examples/store.d.ts +2 -0
- package/dist/examples/store.d.ts.map +1 -0
- package/dist/examples/store.js +5 -0
- package/dist/examples/store.js.map +1 -0
- package/dist/examples/store.vitest.d.ts +2 -0
- package/dist/examples/store.vitest.d.ts.map +1 -0
- package/dist/examples/store.vitest.js +52 -0
- package/dist/examples/store.vitest.js.map +1 -0
- package/dist/examples/tanstack-demo.d.ts +2 -0
- package/dist/examples/tanstack-demo.d.ts.map +1 -0
- package/dist/examples/tanstack-demo.js +51 -0
- package/dist/examples/tanstack-demo.js.map +1 -0
- package/dist/examples/use-promise-demo.d.ts +2 -0
- package/dist/examples/use-promise-demo.d.ts.map +1 -0
- package/dist/examples/use-promise-demo.js +45 -0
- package/dist/examples/use-promise-demo.js.map +1 -0
- package/dist/extensions/dev.d.ts +7 -0
- package/dist/extensions/dev.d.ts.map +1 -0
- package/dist/extensions/dev.js +124 -0
- package/dist/extensions/dev.js.map +1 -0
- package/dist/extensions/home.d.ts +8 -0
- package/dist/extensions/home.d.ts.map +1 -0
- package/dist/extensions/home.js +184 -0
- package/dist/extensions/home.js.map +1 -0
- package/dist/extensions/store.d.ts +6 -0
- package/dist/extensions/store.d.ts.map +1 -0
- package/dist/extensions/store.js +203 -0
- package/dist/extensions/store.js.map +1 -0
- package/dist/globals.d.ts +9 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +21 -0
- package/dist/globals.js.map +1 -0
- package/dist/home-command.d.ts +8 -0
- package/dist/home-command.d.ts.map +1 -0
- package/dist/home-command.js +181 -0
- package/dist/home-command.js.map +1 -0
- package/dist/hooks/hooks.test.d.ts +2 -0
- package/dist/hooks/hooks.test.d.ts.map +1 -0
- package/dist/hooks/hooks.test.js +37 -0
- package/dist/hooks/hooks.test.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-action-panel.d.ts +16 -0
- package/dist/hooks/use-action-panel.d.ts.map +1 -0
- package/dist/hooks/use-action-panel.js +19 -0
- package/dist/hooks/use-action-panel.js.map +1 -0
- package/dist/hooks/use-id.d.ts +9 -0
- package/dist/hooks/use-id.d.ts.map +1 -0
- package/dist/hooks/use-id.js +17 -0
- package/dist/hooks/use-id.js.map +1 -0
- package/dist/hooks/use-unstable-ai.d.ts +9 -0
- package/dist/hooks/use-unstable-ai.d.ts.map +1 -0
- package/dist/hooks/use-unstable-ai.js +13 -0
- package/dist/hooks/use-unstable-ai.js.map +1 -0
- package/dist/hooks.d.ts +10 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +20 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hover-repro.d.ts +2 -0
- package/dist/hover-repro.d.ts.map +1 -0
- package/dist/hover-repro.js +20 -0
- package/dist/hover-repro.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/date-picker-widget.d.ts +9 -0
- package/dist/internal/date-picker-widget.d.ts.map +1 -0
- package/dist/internal/date-picker-widget.js +380 -0
- package/dist/internal/date-picker-widget.js.map +1 -0
- package/dist/internal/dialog.d.ts +21 -0
- package/dist/internal/dialog.d.ts.map +1 -0
- package/dist/internal/dialog.js +122 -0
- package/dist/internal/dialog.js.map +1 -0
- package/dist/internal/error-handler.d.ts +2 -0
- package/dist/internal/error-handler.d.ts.map +1 -0
- package/dist/internal/error-handler.js +29 -0
- package/dist/internal/error-handler.js.map +1 -0
- package/dist/internal/focus-context.d.ts +10 -0
- package/dist/internal/focus-context.d.ts.map +1 -0
- package/dist/internal/focus-context.js +12 -0
- package/dist/internal/focus-context.js.map +1 -0
- package/dist/internal/navigation.d.ts +18 -0
- package/dist/internal/navigation.d.ts.map +1 -0
- package/dist/internal/navigation.js +83 -0
- package/dist/internal/navigation.js.map +1 -0
- package/dist/internal/providers.d.ts +8 -0
- package/dist/internal/providers.d.ts.map +1 -0
- package/dist/internal/providers.js +262 -0
- package/dist/internal/providers.js.map +1 -0
- package/dist/localstorage.d.ts +13 -0
- package/dist/localstorage.d.ts.map +1 -0
- package/dist/localstorage.js +190 -0
- package/dist/localstorage.js.map +1 -0
- package/dist/localstorage.test.d.ts +2 -0
- package/dist/localstorage.test.d.ts.map +1 -0
- package/dist/localstorage.test.js +131 -0
- package/dist/localstorage.test.js.map +1 -0
- package/dist/logger.d.ts +7 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +70 -0
- package/dist/logger.js.map +1 -0
- package/dist/oauth.d.ts +142 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +551 -0
- package/dist/oauth.js.map +1 -0
- package/dist/package-json.d.ts +84 -0
- package/dist/package-json.d.ts.map +1 -0
- package/dist/package-json.js +77 -0
- package/dist/package-json.js.map +1 -0
- package/dist/preferences.d.ts +23 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +105 -0
- package/dist/preferences.js.map +1 -0
- package/dist/preload.d.ts +2 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +28 -0
- package/dist/preload.js.map +1 -0
- package/dist/state.d.ts +26 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +18 -0
- package/dist/state.js.map +1 -0
- package/dist/store-api/download.d.ts +8 -0
- package/dist/store-api/download.d.ts.map +1 -0
- package/dist/store-api/download.js +37 -0
- package/dist/store-api/download.js.map +1 -0
- package/dist/store-api/download.test.d.ts +2 -0
- package/dist/store-api/download.test.d.ts.map +1 -0
- package/dist/store-api/download.test.js +36 -0
- package/dist/store-api/download.test.js.map +1 -0
- package/dist/store-api/extension.d.ts +87 -0
- package/dist/store-api/extension.d.ts.map +1 -0
- package/dist/store-api/extension.js +23 -0
- package/dist/store-api/extension.js.map +1 -0
- package/dist/store-api/extension.test.d.ts +2 -0
- package/dist/store-api/extension.test.d.ts.map +1 -0
- package/dist/store-api/extension.test.js +22 -0
- package/dist/store-api/extension.test.js.map +1 -0
- package/dist/store-api/search.d.ts +101 -0
- package/dist/store-api/search.d.ts.map +1 -0
- package/dist/store-api/search.js +29 -0
- package/dist/store-api/search.js.map +1 -0
- package/dist/store-api/search.test.d.ts +2 -0
- package/dist/store-api/search.test.d.ts.map +1 -0
- package/dist/store-api/search.test.js +45 -0
- package/dist/store-api/search.test.js.map +1 -0
- package/dist/store.d.ts +21 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +84 -0
- package/dist/store.js.map +1 -0
- package/dist/theme.d.ts +20 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +26 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast.d.ts +44 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +221 -0
- package/dist/toast.js.map +1 -0
- package/dist/utils/file-system.d.ts +11 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +66 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils.d.ts +234 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +473 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +152 -0
- package/dist/utils.test.js.map +1 -0
- package/dist/window.d.ts +12 -0
- package/dist/window.d.ts.map +1 -0
- package/dist/window.js +48 -0
- package/dist/window.js.map +1 -0
- package/package.json +56 -0
- package/src/action-utils.tsx +207 -0
- package/src/apis/ai.tsx +177 -0
- package/src/apis/cache.test.ts +311 -0
- package/src/apis/cache.tsx +394 -0
- package/src/apis/clipboard.tsx +200 -0
- package/src/apis/environment.tsx +239 -0
- package/src/apis/hud.tsx +86 -0
- package/src/apis/localstorage.test.ts +164 -0
- package/src/apis/localstorage.tsx +215 -0
- package/src/apis/oauth.tsx +744 -0
- package/src/apis/preferences.tsx +140 -0
- package/src/apis/toast.tsx +388 -0
- package/src/apis/window.tsx +61 -0
- package/src/build.test.tsx +78 -0
- package/src/build.tsx +273 -0
- package/src/cli.tsx +328 -0
- package/src/colors.tsx +15 -0
- package/src/components/actions.tsx +718 -0
- package/src/components/alert.tsx +205 -0
- package/src/components/detail.tsx +359 -0
- package/src/components/dropdown.tsx +438 -0
- package/src/components/extension-preferences.tsx +269 -0
- package/src/components/form/assign-components.tsx +22 -0
- package/src/components/form/checkbox.tsx +96 -0
- package/src/components/form/date-picker.tsx +125 -0
- package/src/components/form/description.tsx +30 -0
- package/src/components/form/dropdown.tsx +512 -0
- package/src/components/form/file-autocomplete.tsx +141 -0
- package/src/components/form/file-picker.tsx +233 -0
- package/src/components/form/form-end.tsx +6 -0
- package/src/components/form/index.tsx +242 -0
- package/src/components/form/password-field.tsx +87 -0
- package/src/components/form/separator.tsx +15 -0
- package/src/components/form/tagpicker.tsx +245 -0
- package/src/components/form/text-area.tsx +82 -0
- package/src/components/form/text-field.tsx +82 -0
- package/src/components/form/types.tsx +49 -0
- package/src/components/form/use-form-navigation.tsx +65 -0
- package/src/components/form/with-left-border.tsx +53 -0
- package/src/components/icon.tsx +496 -0
- package/src/components/image.tsx +54 -0
- package/src/components/list.tsx +1564 -0
- package/src/components/loading-bar.tsx +141 -0
- package/src/components/menubar-extra.tsx +181 -0
- package/src/descendants.tsx +134 -0
- package/src/e2e-node.tsx +303 -0
- package/src/e2e.tsx +147 -0
- package/src/examples/action-show-in-finder.tsx +80 -0
- package/src/examples/environment-test.tsx +50 -0
- package/src/examples/error-boundary.tsx +217 -0
- package/src/examples/form-basic.tsx +122 -0
- package/src/examples/form-basic.vitest.tsx +1035 -0
- package/src/examples/form-dropdown.tsx +102 -0
- package/src/examples/form-dropdown.vitest.tsx +758 -0
- package/src/examples/form-tagpicker.tsx +66 -0
- package/src/examples/form-tagpicker.vitest.tsx +523 -0
- package/src/examples/internal/descendants-filtering.tsx +223 -0
- package/src/examples/internal/descendants.tsx +208 -0
- package/src/examples/internal/scrollbox-demo.tsx +149 -0
- package/src/examples/internal/simple-dialog.tsx +124 -0
- package/src/examples/internal/text-stacking.tsx +90 -0
- package/src/examples/list-dropdown-default.tsx +69 -0
- package/src/examples/list-dropdown-default.vitest.tsx +187 -0
- package/src/examples/list-fetch-data.tsx +123 -0
- package/src/examples/list-fetch-data.vitest.tsx +110 -0
- package/src/examples/list-with-detail.tsx +161 -0
- package/src/examples/list-with-detail.vitest.tsx +468 -0
- package/src/examples/list-with-dropdown.tsx +97 -0
- package/src/examples/list-with-dropdown.vitest.tsx +324 -0
- package/src/examples/list-with-sections.tsx +196 -0
- package/src/examples/list-with-sections.vitest.tsx +479 -0
- package/src/examples/miscellaneous.tsx +780 -0
- package/src/examples/nested-navigation.tsx +118 -0
- package/src/examples/preferences-test.tsx +82 -0
- package/src/examples/simple-dropdown.tsx +95 -0
- package/src/examples/simple-file-picker.tsx +75 -0
- package/src/examples/simple-file-picker.vitest.tsx +306 -0
- package/src/examples/simple-grid.tsx +149 -0
- package/src/examples/simple-grid.vitest.tsx +535 -0
- package/src/examples/simple-hud.tsx +60 -0
- package/src/examples/simple-list-search.tsx +93 -0
- package/src/examples/simple-list.tsx +149 -0
- package/src/examples/simple-navigation.tsx +89 -0
- package/src/examples/simple-navigation.vitest.tsx +571 -0
- package/src/examples/store.tsx +4 -0
- package/src/examples/store.vitest.tsx +59 -0
- package/src/examples/tanstack-demo.tsx +104 -0
- package/src/examples/use-promise-demo.tsx +96 -0
- package/src/extensions/dev.tsx +215 -0
- package/src/extensions/home.tsx +332 -0
- package/src/extensions/store.tsx +375 -0
- package/src/globals.ts +34 -0
- package/src/hooks/index.tsx +8 -0
- package/src/hooks/use-action-panel.tsx +28 -0
- package/src/hooks/use-id.tsx +19 -0
- package/src/hooks/use-unstable-ai.tsx +15 -0
- package/src/hooks.tsx +22 -0
- package/src/index.tsx +240 -0
- package/src/internal/date-picker-widget.tsx +500 -0
- package/src/internal/dialog.tsx +202 -0
- package/src/internal/error-handler.tsx +32 -0
- package/src/internal/focus-context.tsx +23 -0
- package/src/internal/navigation.tsx +149 -0
- package/src/internal/providers.tsx +430 -0
- package/src/logger.tsx +84 -0
- package/src/package-json.tsx +197 -0
- package/src/preload.tsx +32 -0
- package/src/state.tsx +49 -0
- package/src/store-api/download.test.tsx +38 -0
- package/src/store-api/download.tsx +52 -0
- package/src/store-api/extension.test.tsx +24 -0
- package/src/store-api/extension.tsx +123 -0
- package/src/store-api/search.test.tsx +50 -0
- package/src/store-api/search.tsx +146 -0
- package/src/theme.tsx +31 -0
- package/src/utils/file-system.ts +87 -0
- package/src/utils.test.tsx +204 -0
- package/src/utils.tsx +657 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FormItemProps, FormItemRef } from './types';
|
|
2
|
+
export interface FilePickerProps extends FormItemProps<string[]> {
|
|
3
|
+
/**
|
|
4
|
+
* Indicates whether the user can select multiple items or only one.
|
|
5
|
+
* @defaultValue `true`
|
|
6
|
+
*/
|
|
7
|
+
allowMultipleSelection?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Indicates whether it's possible to choose a directory.
|
|
10
|
+
* Note: On Windows, this property is ignored if `canChooseFiles` is set to `true`.
|
|
11
|
+
* @defaultValue `false`
|
|
12
|
+
*/
|
|
13
|
+
canChooseDirectories?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Indicates whether it's possible to choose a file.
|
|
16
|
+
* @defaultValue `true`
|
|
17
|
+
*/
|
|
18
|
+
canChooseFiles?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Indicates whether the file picker displays files that are normally hidden from the user.
|
|
21
|
+
* @defaultValue `false`
|
|
22
|
+
*/
|
|
23
|
+
showHiddenFiles?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Placeholder text for the input field
|
|
26
|
+
*/
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
}
|
|
29
|
+
export type FilePickerRef = FormItemRef;
|
|
30
|
+
export declare const FilePicker: (props: FilePickerProps) => any;
|
|
31
|
+
//# sourceMappingURL=file-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-picker.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAOpD,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,MAAM,EAAE,CAAC;IAC9D;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,CAAA;AAwIvC,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,KAAG,GA0DnD,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Theme } from '@termcast/cli/src/theme';
|
|
4
|
+
import { WithLeftBorder } from './with-left-border';
|
|
5
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
6
|
+
import { useFocusContext } from './index';
|
|
7
|
+
import { useKeyboard } from '@opentui/react';
|
|
8
|
+
import { useIsInFocus } from '@termcast/cli/src/internal/focus-context';
|
|
9
|
+
import { FileAutocomplete } from './file-autocomplete';
|
|
10
|
+
const FilePickerField = ({ field, fieldState, formState, props, isFocused, setFocusedField, }) => {
|
|
11
|
+
const isInFocus = useIsInFocus();
|
|
12
|
+
const [inputValue, setInputValue] = React.useState('');
|
|
13
|
+
const [showAutocomplete, setShowAutocomplete] = React.useState(false);
|
|
14
|
+
const inputRef = React.useRef(null);
|
|
15
|
+
const anchorRef = React.useRef(null);
|
|
16
|
+
// Show autocomplete when typing
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
if (inputValue && isFocused) {
|
|
19
|
+
setShowAutocomplete(true);
|
|
20
|
+
}
|
|
21
|
+
else if (!inputValue) {
|
|
22
|
+
setShowAutocomplete(false);
|
|
23
|
+
}
|
|
24
|
+
}, [inputValue, isFocused]);
|
|
25
|
+
// Handle Enter key
|
|
26
|
+
useKeyboard((evt) => {
|
|
27
|
+
if (!isFocused || !isInFocus)
|
|
28
|
+
return;
|
|
29
|
+
if (evt.name === 'return') {
|
|
30
|
+
// If input is empty, show files in current directory
|
|
31
|
+
if (!inputValue && !showAutocomplete) {
|
|
32
|
+
setShowAutocomplete(true);
|
|
33
|
+
}
|
|
34
|
+
// If autocomplete is not visible and input has value, add the path
|
|
35
|
+
else if (inputValue.trim() && !showAutocomplete) {
|
|
36
|
+
const currentFiles = field.value || [];
|
|
37
|
+
const newFiles = props.allowMultipleSelection !== false
|
|
38
|
+
? [...currentFiles, inputValue.trim()]
|
|
39
|
+
: [inputValue.trim()];
|
|
40
|
+
field.onChange(newFiles);
|
|
41
|
+
if (props.onChange) {
|
|
42
|
+
props.onChange(newFiles);
|
|
43
|
+
}
|
|
44
|
+
setInputValue('');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const handleSelectFile = (path) => {
|
|
49
|
+
const currentFiles = field.value || [];
|
|
50
|
+
const newFiles = props.allowMultipleSelection !== false ? [...currentFiles, path] : [path];
|
|
51
|
+
field.onChange(newFiles);
|
|
52
|
+
if (props.onChange) {
|
|
53
|
+
props.onChange(newFiles);
|
|
54
|
+
}
|
|
55
|
+
setInputValue('');
|
|
56
|
+
setShowAutocomplete(false);
|
|
57
|
+
};
|
|
58
|
+
const selectedFiles = field.value || [];
|
|
59
|
+
return (_jsxs("box", { flexDirection: 'column', children: [_jsx(WithLeftBorder, { withDiamond: true, isFocused: isFocused, children: _jsx("text", { fg: Theme.text, onMouseDown: () => {
|
|
60
|
+
setFocusedField(props.id);
|
|
61
|
+
}, children: props.title || 'File Path' }) }), _jsx(WithLeftBorder, { isFocused: isFocused, children: _jsxs("box", { flexDirection: 'column', ref: anchorRef, children: [_jsx("input", { ref: inputRef, value: inputValue, placeholder: props.placeholder || 'Enter file path...', focused: isFocused, onMouseDown: () => setFocusedField(props.id), onInput: (value) => setInputValue(value) }), selectedFiles.length > 0 && (_jsxs("box", { flexDirection: 'column', marginTop: 1, children: [_jsx("text", { fg: Theme.textMuted, children: "Selected files:" }), selectedFiles.map((file, index) => (_jsxs("text", { fg: Theme.text, children: ["\u2022 ", file] }, index)))] }))] }) }), (fieldState.error || props.error) && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.error, children: fieldState.error?.message || props.error }) })), props.info && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.textMuted, children: props.info }) })), _jsx(FileAutocomplete, { value: inputValue, onChange: (newValue) => {
|
|
62
|
+
setInputValue(newValue);
|
|
63
|
+
// Move cursor to end when value changes
|
|
64
|
+
if (inputRef.current) {
|
|
65
|
+
inputRef.current.cursorPosition = newValue.length;
|
|
66
|
+
}
|
|
67
|
+
}, onSelect: handleSelectFile, visible: showAutocomplete, onVisibilityChange: setShowAutocomplete, inputRef: inputRef, anchorRef: anchorRef })] }));
|
|
68
|
+
};
|
|
69
|
+
export const FilePicker = (props) => {
|
|
70
|
+
const { control, getValues } = useFormContext();
|
|
71
|
+
const { focusedField, setFocusedField } = useFocusContext();
|
|
72
|
+
const isFocused = focusedField === props.id;
|
|
73
|
+
const isInFocus = useIsInFocus();
|
|
74
|
+
const handleNavigateUp = () => {
|
|
75
|
+
// Find previous field and focus it
|
|
76
|
+
const fieldNames = Object.keys(getValues());
|
|
77
|
+
const currentIndex = fieldNames.indexOf(props.id);
|
|
78
|
+
if (currentIndex > 0) {
|
|
79
|
+
setFocusedField(fieldNames[currentIndex - 1]);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
setFocusedField(fieldNames[fieldNames.length - 1]);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const handleNavigateDown = () => {
|
|
86
|
+
// Find next field and focus it
|
|
87
|
+
const fieldNames = Object.keys(getValues());
|
|
88
|
+
const currentIndex = fieldNames.indexOf(props.id);
|
|
89
|
+
if (currentIndex < fieldNames.length - 1) {
|
|
90
|
+
setFocusedField(fieldNames[currentIndex + 1]);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
setFocusedField(fieldNames[0]);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
// Handle keyboard navigation
|
|
97
|
+
useKeyboard((evt) => {
|
|
98
|
+
if (!isFocused || !isInFocus)
|
|
99
|
+
return;
|
|
100
|
+
if (evt.name === 'tab') {
|
|
101
|
+
if (evt.shift) {
|
|
102
|
+
handleNavigateUp();
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
handleNavigateDown();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return (_jsx(Controller, { name: props.id, control: control, defaultValue: props.defaultValue || props.value || [], render: (renderProps) => {
|
|
110
|
+
return (_jsx(FilePickerField, { ...renderProps, props: props, isFocused: isFocused, setFocusedField: setFocusedField }));
|
|
111
|
+
} }));
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=file-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-picker.js","sourceRoot":"","sources":["../../../src/components/form/file-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAgCtD,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,EACL,UAAU,EACV,SAAS,EACT,KAAK,EACL,SAAS,EACT,eAAe,GAQhB,EAAO,EAAE;IACR,MAAM,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,EAAE,CAAC;YACzC,eAAe,CAAC,UAAU,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAA;QAC/C,CAAC;aAAM,CAAC;YACN,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAChC,CAAC;IACH,CAAC,CAAA;IAED,6BAA6B;IAC7B,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE;QAClB,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS;YAAE,OAAM;QAEpC,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBACd,gBAAgB,EAAE,CAAA;YACpB,CAAC;iBAAM,CAAC;gBACN,kBAAkB,EAAE,CAAA;YACtB,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CACL,KAAC,UAAU,IACT,IAAI,EAAE,KAAK,CAAC,EAAE,EACd,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EACrD,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;YACtB,OAAO,CACL,KAAC,eAAe,OACV,WAAW,EACf,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,GAChC,CACmB,CAAA;QACzB,CAAC,GACD,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-end.d.ts","sourceRoot":"","sources":["../../../src/components/form/form-end.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,QAAO,GAE1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-end.js","sourceRoot":"","sources":["../../../src/components/form/form-end.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAQ,EAAE;IAC/B,OAAO,eAAM,EAAE,EAAE,KAAK,CAAC,IAAI,uBAAU,CAAA;AACvC,CAAC,CAAA"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormEvent, FormEventType, FormItemRef, FormValue_2, FormValues_2, FormProps_2, FormItemProps_2 } from './types';
|
|
3
|
+
import type { TextFieldProps, TextFieldRef } from './text-field';
|
|
4
|
+
import type { PasswordFieldProps, PasswordFieldRef } from './password-field';
|
|
5
|
+
import type { TextAreaProps, TextAreaRef } from './text-area';
|
|
6
|
+
import type { CheckboxProps, CheckboxRef } from './checkbox';
|
|
7
|
+
import type { DropdownProps, DropdownRef, DropdownItemProps, DropdownSectionProps } from './dropdown';
|
|
8
|
+
import type { DatePickerProps, DatePickerRef, DatePickerType as DatePickerEnum } from './date-picker';
|
|
9
|
+
import type { TagPickerType } from './tagpicker';
|
|
10
|
+
import type { DescriptionProps } from './description';
|
|
11
|
+
import type { FilePickerProps, FilePickerRef } from './file-picker';
|
|
12
|
+
interface LinkAccessoryProps {
|
|
13
|
+
text: string;
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace Form {
|
|
17
|
+
type ItemProps<T extends FormValue_2> = FormItemProps_2<T>;
|
|
18
|
+
type Value = FormValue_2;
|
|
19
|
+
type Values = FormValues_2;
|
|
20
|
+
type Props = FormProps_2 & {
|
|
21
|
+
searchBarAccessory?: React.ReactElement<LinkAccessoryProps> | undefined | null;
|
|
22
|
+
};
|
|
23
|
+
type ItemReference = FormItemRef;
|
|
24
|
+
/**
|
|
25
|
+
* An interface describing event in callbacks {@link Form.Item.Props.onFocus} and {@link Form.Item.Props.onBlur}
|
|
26
|
+
*/
|
|
27
|
+
type Event<T extends FormValue_2> = FormEvent<T>;
|
|
28
|
+
namespace Event {
|
|
29
|
+
/**
|
|
30
|
+
* Types of Form event {@link Form.Event}
|
|
31
|
+
* * `focus` - the type will be returned for the event of {@link Form.Item.Props.onFocus} callback
|
|
32
|
+
* * `blur` - the type will be returned for the event of {@link Form.Item.Props.onBlur} callback
|
|
33
|
+
*/
|
|
34
|
+
type Type = FormEventType;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A Ref Type for the {@link Form.TextField}.
|
|
38
|
+
* Use refs to control your Form by calling `Form.TextField.focus()` or `Form.TextField.reset()` functions.
|
|
39
|
+
*/
|
|
40
|
+
type TextField = TextFieldRef;
|
|
41
|
+
namespace TextField {
|
|
42
|
+
/**
|
|
43
|
+
* Props of the {@link Form.TextField} React component.
|
|
44
|
+
*/
|
|
45
|
+
type Props = TextFieldProps;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A Ref Type for the {@link Form.PasswordField}.
|
|
49
|
+
* Use refs to control your Form by calling `Form.PasswordField.focus()` or `Form.PasswordField.reset()` functions.
|
|
50
|
+
*/
|
|
51
|
+
type PasswordField = PasswordFieldRef;
|
|
52
|
+
namespace PasswordField {
|
|
53
|
+
/**
|
|
54
|
+
* Props of the {@link Form.PasswordField} React component.
|
|
55
|
+
*/
|
|
56
|
+
type Props = PasswordFieldProps;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A Ref Type for the {@link Form.TextArea}.
|
|
60
|
+
* Use refs to control your Form by calling `Form.TextArea.focus()` or `Form.TextArea.reset()` functions.
|
|
61
|
+
*/
|
|
62
|
+
type TextArea = TextAreaRef;
|
|
63
|
+
namespace TextArea {
|
|
64
|
+
/**
|
|
65
|
+
* Props of the {@link Form.TextArea} React component.
|
|
66
|
+
*/
|
|
67
|
+
type Props = TextAreaProps;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A Ref Type for the {@link Form.Checkbox}.
|
|
71
|
+
* Use refs to control your Form by calling `Form.Checkbox.focus()` or `Form.Checkbox.reset()` functions.
|
|
72
|
+
*/
|
|
73
|
+
type Checkbox = CheckboxRef;
|
|
74
|
+
namespace Checkbox {
|
|
75
|
+
/**
|
|
76
|
+
* Props of the {@link Form.Checkbox} React component.
|
|
77
|
+
*/
|
|
78
|
+
type Props = CheckboxProps;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A Ref Type for the {@link Form.Dropdown}.
|
|
82
|
+
* Use refs to control your Form by calling `Form.Dropdown.focus()` or `Form.Dropdown.reset()` functions.
|
|
83
|
+
*/
|
|
84
|
+
type Dropdown = DropdownRef;
|
|
85
|
+
namespace Dropdown {
|
|
86
|
+
/**
|
|
87
|
+
* Props of the {@link Form.Dropdown} React component.
|
|
88
|
+
*/
|
|
89
|
+
type Props = DropdownProps;
|
|
90
|
+
namespace Item {
|
|
91
|
+
/**
|
|
92
|
+
* Props of the {@link Form.Dropdown.Item} React component.
|
|
93
|
+
*/
|
|
94
|
+
type Props = DropdownItemProps;
|
|
95
|
+
}
|
|
96
|
+
namespace Section {
|
|
97
|
+
/**
|
|
98
|
+
* Props of the {@link Form.Dropdown.Section} React component.
|
|
99
|
+
*/
|
|
100
|
+
type Props = DropdownSectionProps;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A Ref Type for the {@link Form.DatePicker}.
|
|
105
|
+
* Use refs to control your Form by calling `Form.DatePicker.focus()` or `Form.DatePicker.reset()` functions.
|
|
106
|
+
*/
|
|
107
|
+
type DatePicker = DatePickerRef;
|
|
108
|
+
namespace DatePicker {
|
|
109
|
+
/**
|
|
110
|
+
* Props of the {@link Form.DatePicker} React component.
|
|
111
|
+
*/
|
|
112
|
+
type Props = DatePickerProps;
|
|
113
|
+
/**
|
|
114
|
+
* The types of date components the user can pick with {@link Form.DatePicker}.
|
|
115
|
+
*/
|
|
116
|
+
type Type = DatePickerEnum;
|
|
117
|
+
}
|
|
118
|
+
namespace TagPicker {
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A Ref Type for the {@link Form.FilePicker}.
|
|
122
|
+
* Use refs to control your Form by calling `Form.FilePicker.focus()` or `Form.FilePicker.reset()` functions.
|
|
123
|
+
*/
|
|
124
|
+
type FilePicker = FilePickerRef;
|
|
125
|
+
namespace FilePicker {
|
|
126
|
+
/**
|
|
127
|
+
* Props of the {@link Form.FilePicker} React component.
|
|
128
|
+
*/
|
|
129
|
+
type Props = FilePickerProps;
|
|
130
|
+
}
|
|
131
|
+
namespace Separator {
|
|
132
|
+
/**
|
|
133
|
+
* Props of the {@link Form.Separator} React component.
|
|
134
|
+
*/
|
|
135
|
+
interface Props {
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
namespace Description {
|
|
139
|
+
/**
|
|
140
|
+
* Props of the {@link Form.Description} React component.
|
|
141
|
+
*/
|
|
142
|
+
type Props = DescriptionProps;
|
|
143
|
+
}
|
|
144
|
+
namespace LinkAccessory {
|
|
145
|
+
/**
|
|
146
|
+
* Props of the {@link Form.LinkAccessory} React component.
|
|
147
|
+
*/
|
|
148
|
+
type Props = LinkAccessoryProps;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
interface FormType {
|
|
152
|
+
(props: Form.Props): any;
|
|
153
|
+
TextField: React.ForwardRefExoticComponent<Form.TextField.Props & React.RefAttributes<Form.TextField>>;
|
|
154
|
+
PasswordField: React.ForwardRefExoticComponent<Form.PasswordField.Props & React.RefAttributes<Form.PasswordField>>;
|
|
155
|
+
TextArea: React.ForwardRefExoticComponent<Form.TextArea.Props & React.RefAttributes<Form.TextArea>>;
|
|
156
|
+
Checkbox: React.ForwardRefExoticComponent<Form.Checkbox.Props & React.RefAttributes<Form.Checkbox>>;
|
|
157
|
+
Dropdown: {
|
|
158
|
+
(props: Form.Dropdown.Props): any;
|
|
159
|
+
Item: (props: Form.Dropdown.Item.Props) => any;
|
|
160
|
+
Section: (props: Form.Dropdown.Section.Props) => any;
|
|
161
|
+
};
|
|
162
|
+
DatePicker: {
|
|
163
|
+
(props: Form.DatePicker.Props): any;
|
|
164
|
+
Type: typeof DatePickerEnum;
|
|
165
|
+
};
|
|
166
|
+
TagPicker: TagPickerType;
|
|
167
|
+
FilePicker: React.ForwardRefExoticComponent<Form.FilePicker.Props & React.RefAttributes<Form.FilePicker>>;
|
|
168
|
+
Separator: (props: Form.Separator.Props) => any;
|
|
169
|
+
Description: (props: Form.Description.Props) => any;
|
|
170
|
+
LinkAccessory: (props: Form.LinkAccessory.Props) => any;
|
|
171
|
+
}
|
|
172
|
+
export declare const Form: FormType;
|
|
173
|
+
export {};
|
|
174
|
+
//# sourceMappingURL=form-type-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-type-only.d.ts","sourceRoot":"","sources":["../../../src/components/form/form-type-only.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAGH,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EAClB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EACR,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACR,eAAe,EACf,aAAa,EACb,cAAc,IAAI,cAAc,EACnC,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEnE,UAAU,kBAAkB;IAC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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormValues, FormProps } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export { useFormContext } from 'react-hook-form';
|
|
5
|
+
interface FocusContextValue {
|
|
6
|
+
focusedField: string | null;
|
|
7
|
+
setFocusedField: (id: string | null) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useFocusContext: () => FocusContextValue;
|
|
10
|
+
interface FormSubmitContextValue {
|
|
11
|
+
getFormValues: () => FormValues;
|
|
12
|
+
}
|
|
13
|
+
export declare const useFormSubmit: () => FormSubmitContextValue | null;
|
|
14
|
+
import type { TextFieldProps, TextFieldRef } from './text-field';
|
|
15
|
+
import type { PasswordFieldProps, PasswordFieldRef } from './password-field';
|
|
16
|
+
import type { TextAreaProps, TextAreaRef } from './text-area';
|
|
17
|
+
import type { CheckboxProps, CheckboxRef } from './checkbox';
|
|
18
|
+
import type { DropdownProps, DropdownItemProps, DropdownSectionProps } from './dropdown';
|
|
19
|
+
import type { DatePickerProps, DatePickerType as DatePickerEnum } from './date-picker';
|
|
20
|
+
import type { TagPickerType } from './tagpicker';
|
|
21
|
+
import type { DescriptionProps } from './description';
|
|
22
|
+
import type { FilePickerProps } from './file-picker';
|
|
23
|
+
interface DropdownType {
|
|
24
|
+
(props: DropdownProps): any;
|
|
25
|
+
Item: (props: DropdownItemProps) => any;
|
|
26
|
+
Section: (props: DropdownSectionProps) => any;
|
|
27
|
+
}
|
|
28
|
+
interface DatePickerComponentType {
|
|
29
|
+
(props: DatePickerProps): any;
|
|
30
|
+
Type: typeof DatePickerEnum;
|
|
31
|
+
}
|
|
32
|
+
interface FormType {
|
|
33
|
+
(props: FormProps): any;
|
|
34
|
+
TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextFieldRef>>;
|
|
35
|
+
PasswordField: React.ForwardRefExoticComponent<PasswordFieldProps & React.RefAttributes<PasswordFieldRef>>;
|
|
36
|
+
TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaRef>>;
|
|
37
|
+
Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<CheckboxRef>>;
|
|
38
|
+
Dropdown: DropdownType;
|
|
39
|
+
DatePicker: DatePickerComponentType;
|
|
40
|
+
TagPicker: TagPickerType;
|
|
41
|
+
FilePicker: (props: FilePickerProps) => any;
|
|
42
|
+
Separator: () => any;
|
|
43
|
+
Description: (props: DescriptionProps) => any;
|
|
44
|
+
}
|
|
45
|
+
export declare const Form: FormType;
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAU7E,OAAO,EACL,UAAU,EACV,SAAS,EASV,MAAM,SAAS,CAAA;AAEhB,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGhD,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAC7C;AAID,eAAO,MAAM,eAAe,yBAM3B,CAAA;AAGD,UAAU,sBAAsB;IAC9B,aAAa,EAAE,MAAM,UAAU,CAAA;CAChC;AAID,eAAO,MAAM,aAAa,qCAGzB,CAAA;AAiDD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,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K,EAAE,eAAe,KAAK,GAAG,CAAA;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAA;IACpB,WAAW,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,GAAG,CAAA;CAC9C;AAED,eAAO,MAAM,IAAI,EAAE,QAgEL,CAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useState, createContext, useContext, useEffect } from 'react';
|
|
3
|
+
import { useKeyboard } from '@opentui/react';
|
|
4
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
5
|
+
import { logger } from '@termcast/cli/src/logger';
|
|
6
|
+
import { useIsInFocus } from '@termcast/cli/src/internal/focus-context';
|
|
7
|
+
import { useDialog } from '@termcast/cli/src/internal/dialog';
|
|
8
|
+
import { Theme } from '@termcast/cli/src/theme';
|
|
9
|
+
import { TextAttributes } from '@opentui/core';
|
|
10
|
+
import { useStore } from '@termcast/cli/src/state';
|
|
11
|
+
export * from './types';
|
|
12
|
+
export { useFormContext } from 'react-hook-form';
|
|
13
|
+
const FocusContext = createContext(null);
|
|
14
|
+
export const useFocusContext = () => {
|
|
15
|
+
const context = useContext(FocusContext);
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error('Form components must be used within a Form');
|
|
18
|
+
}
|
|
19
|
+
return context;
|
|
20
|
+
};
|
|
21
|
+
const FormSubmitContext = createContext(null);
|
|
22
|
+
export const useFormSubmit = () => {
|
|
23
|
+
const context = useContext(FormSubmitContext);
|
|
24
|
+
return context; // Can be null if not in a form
|
|
25
|
+
};
|
|
26
|
+
// Footer component to show keyboard shortcuts
|
|
27
|
+
function FormFooter() {
|
|
28
|
+
const toast = useStore((state) => state.toast);
|
|
29
|
+
if (toast) {
|
|
30
|
+
return (_jsx("box", { border: false, style: {
|
|
31
|
+
paddingLeft: 1,
|
|
32
|
+
paddingRight: 1,
|
|
33
|
+
paddingTop: 1,
|
|
34
|
+
marginTop: 1,
|
|
35
|
+
}, children: toast }));
|
|
36
|
+
}
|
|
37
|
+
return (_jsxs("box", { border: false, style: {
|
|
38
|
+
paddingLeft: 1,
|
|
39
|
+
paddingRight: 1,
|
|
40
|
+
paddingTop: 1,
|
|
41
|
+
marginTop: 1,
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
}, children: [_jsx("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: "\u21B5" }), _jsx("text", { fg: Theme.textMuted, children: " submit" }), _jsxs("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: [' ', "\u2191\u2193"] }), _jsx("text", { fg: Theme.textMuted, children: " navigate" }), _jsxs("text", { fg: Theme.text, attributes: TextAttributes.BOLD, children: [' ', "^k"] }), _jsx("text", { fg: Theme.textMuted, children: " actions" })] }));
|
|
44
|
+
}
|
|
45
|
+
export const Form = ((props) => {
|
|
46
|
+
const methods = useForm({
|
|
47
|
+
// defaultValues: {},
|
|
48
|
+
// mode: 'onChange',
|
|
49
|
+
});
|
|
50
|
+
const [focusedField, setFocusedField] = useState(null);
|
|
51
|
+
// Auto-focus first field on mount
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const fieldNames = Object.keys(methods.getValues());
|
|
54
|
+
if (fieldNames.length > 0) {
|
|
55
|
+
logger.log(`focusing `, fieldNames[0]);
|
|
56
|
+
setFocusedField(fieldNames[0]);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
logger.log(`no fields to focus in form`);
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
// Get focus state and dialog
|
|
63
|
+
const inFocus = useIsInFocus();
|
|
64
|
+
const dialog = useDialog();
|
|
65
|
+
// Handle action key navigation only
|
|
66
|
+
useKeyboard((evt) => {
|
|
67
|
+
// Only handle keyboard events when form is in focus
|
|
68
|
+
if (!inFocus)
|
|
69
|
+
return;
|
|
70
|
+
if (evt.name === 'k' && evt.ctrl && props.actions) {
|
|
71
|
+
// Ctrl+K shows actions
|
|
72
|
+
dialog.push(_jsx(FormSubmitContext.Provider, { value: submitContextValue, children: props.actions }), 'bottom-right');
|
|
73
|
+
}
|
|
74
|
+
else if (evt.name === 'return' && evt.meta && props.actions) {
|
|
75
|
+
// Cmd+Return also shows actions (consistent with List)
|
|
76
|
+
dialog.push(_jsx(FormSubmitContext.Provider, { value: submitContextValue, children: props.actions }), 'bottom-right');
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const submitContextValue = {
|
|
80
|
+
getFormValues: () => methods.getValues(),
|
|
81
|
+
};
|
|
82
|
+
return (_jsx(FormProvider, { ...methods, children: _jsx(FormSubmitContext.Provider, { value: submitContextValue, children: _jsx(FocusContext.Provider, { value: { focusedField, setFocusedField }, children: _jsxs("box", { flexDirection: 'column', children: [props.children, _jsx(FormEnd, {}), _jsx(FormFooter, {})] }) }) }) }));
|
|
83
|
+
});
|
|
84
|
+
// Import and assign components after Form is defined
|
|
85
|
+
import { TextField } from './text-field';
|
|
86
|
+
import { PasswordField } from './password-field';
|
|
87
|
+
import { TextArea } from './text-area';
|
|
88
|
+
import { Checkbox } from './checkbox';
|
|
89
|
+
import { Dropdown } from './dropdown';
|
|
90
|
+
import { DatePicker } from './date-picker';
|
|
91
|
+
import { TagPicker } from './tagpicker';
|
|
92
|
+
import { Separator } from './separator';
|
|
93
|
+
import { Description } from './description';
|
|
94
|
+
import { FormEnd } from './form-end';
|
|
95
|
+
import { FilePicker } from './file-picker';
|
|
96
|
+
Form.TextField = TextField;
|
|
97
|
+
Form.PasswordField = PasswordField;
|
|
98
|
+
Form.TextArea = TextArea;
|
|
99
|
+
Form.Checkbox = Checkbox;
|
|
100
|
+
Form.Dropdown = Dropdown;
|
|
101
|
+
Form.DatePicker = DatePicker;
|
|
102
|
+
Form.TagPicker = TagPicker;
|
|
103
|
+
Form.FilePicker = FilePicker;
|
|
104
|
+
Form.Separator = Separator;
|
|
105
|
+
Form.Description = Description;
|
|
106
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0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,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FormItemProps, FormItemRef } from './types';
|
|
2
|
+
export interface PasswordFieldProps extends FormItemProps<string> {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
}
|
|
5
|
+
export type PasswordFieldRef = FormItemRef;
|
|
6
|
+
export declare const PasswordField: (props: PasswordFieldProps) => any;
|
|
7
|
+
//# sourceMappingURL=password-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/password-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAMpD,MAAM,WAAW,kBAAmB,SAAQ,aAAa,CAAC,MAAM,CAAC;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAA;AAE1C,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,KAAG,GAsEzD,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
+
import { useFocusContext } from './index';
|
|
4
|
+
import { Theme } from '@termcast/cli/src/theme';
|
|
5
|
+
import { WithLeftBorder } from './with-left-border';
|
|
6
|
+
import { useFormNavigation } from './use-form-navigation';
|
|
7
|
+
export const PasswordField = (props) => {
|
|
8
|
+
const { control } = useFormContext();
|
|
9
|
+
const { focusedField, setFocusedField } = useFocusContext();
|
|
10
|
+
const isFocused = focusedField === props.id;
|
|
11
|
+
// Use form navigation hook
|
|
12
|
+
useFormNavigation(props.id);
|
|
13
|
+
return (_jsx(Controller, { name: props.id, control: control, defaultValue: props.defaultValue || props.value || '', render: ({ field, fieldState, formState }) => {
|
|
14
|
+
// Always show masked value when not focused
|
|
15
|
+
const displayValue = isFocused
|
|
16
|
+
? field.value
|
|
17
|
+
: '*'.repeat(field.value.length);
|
|
18
|
+
return (_jsxs("box", { flexDirection: 'column', children: [_jsx(WithLeftBorder, { withDiamond: true, isFocused: isFocused, children: _jsx("text", { fg: Theme.text, onMouseDown: () => {
|
|
19
|
+
setFocusedField(props.id);
|
|
20
|
+
}, children: props.title }) }), _jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("input", { value: displayValue, onInput: (value) => {
|
|
21
|
+
// Ignore masked input (all asterisks) when not focused
|
|
22
|
+
if (isFocused &&
|
|
23
|
+
!(/^\*+$/.test(value) && !field.value.startsWith('*'))) {
|
|
24
|
+
field.onChange(value);
|
|
25
|
+
if (props.onChange) {
|
|
26
|
+
props.onChange(value);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, placeholder: props.placeholder, focused: isFocused, onMouseDown: () => {
|
|
30
|
+
setFocusedField(props.id);
|
|
31
|
+
} }) }), (fieldState.error || props.error) && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.error, children: fieldState.error?.message || props.error }) })), props.info && (_jsx(WithLeftBorder, { isFocused: isFocused, children: _jsx("text", { fg: Theme.textMuted, children: props.info }) }))] }));
|
|
32
|
+
} }));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=password-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-field.js","sourceRoot":"","sources":["../../../src/components/form/password-field.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAGzC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,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CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACtD,CAAC;oCACD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;oCACrB,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;wCACnB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;oCACvB,CAAC;gCACH,CAAC;4BACH,CAAC,EACD,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,GAAG,EAAE;gCAChB,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;4BAC3B,CAAC,GACD,GACa,EAChB,CAAC,UAAU,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CACpC,KAAC,cAAc,IAAC,SAAS,EAAE,SAAS,YAClC,eAAM,EAAE,EAAE,KAAK,CAAC,KAAK,YAClB,UAAU,CAAC,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,KAAK,GACpC,GACQ,CAClB,EACA,KAAK,CAAC,IAAI,IAAI,CACb,KAAC,cAAc,IAAC,SAAS,EAAE,SAAS,YAClC,eAAM,EAAE,EAAE,KAAK,CAAC,SAAS,YAAG,KAAK,CAAC,IAAI,GAAQ,GAC/B,CAClB,IACG,CACe,CAAA;QACzB,CAAC,GACD,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/components/form/separator.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,QAAO,GAU5B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { Theme } from '@termcast/cli/src/theme';
|
|
3
|
+
import { WithLeftBorder } from './with-left-border';
|
|
4
|
+
export const Separator = () => {
|
|
5
|
+
return null;
|
|
6
|
+
return (_jsxs(_Fragment, { children: [_jsx(WithLeftBorder, { withDiamond: true, isFocused: false, children: _jsx("text", { fg: Theme.border, children: ''.repeat(40) }) }), "|"] }));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","sourceRoot":"","sources":["../../../src/components/form/separator.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAQ,EAAE;IACjC,OAAO,IAAI,CAAA;IACX,OAAO,CACL,8BACE,KAAC,cAAc,IAAC,WAAW,QAAC,SAAS,EAAE,KAAK,YAC1C,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,YAAG,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,GAC/B,SAEhB,CACJ,CAAA;AACH,CAAC,CAAA"}
|