@krak-stack/registry 0.10.20 → 0.11.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/CHANGELOG.md +89 -3
- package/README.md +11 -8
- package/dist/components/agent/index.d.ts +454 -0
- package/dist/components/agent/react.d.ts +55 -0
- package/dist/components/agent/react.js +2440 -0
- package/dist/components/agent/schema.d.ts +55 -0
- package/dist/components/animated-list/classes.d.ts +9 -0
- package/dist/components/animated-list/html.d.ts +11 -0
- package/dist/components/animated-list/html.js +533 -0
- package/dist/components/animated-list/index.d.ts +205 -0
- package/dist/components/animated-list/react.d.ts +11 -0
- package/dist/components/{ui/animated-list.js → animated-list/react.js} +199 -54
- package/dist/components/animated-list/schema.d.ts +44 -0
- package/dist/components/animated-number/html.d.ts +19 -0
- package/dist/components/animated-number/html.js +101 -0
- package/dist/components/animated-number/index.d.ts +80 -0
- package/dist/components/{ui/animated-number.d.ts → animated-number/react.d.ts} +2 -7
- package/dist/components/animated-number/react.js +124 -0
- package/dist/components/animated-number/schema.d.ts +9 -0
- package/dist/components/app-brand/classes.d.ts +11 -0
- package/dist/components/app-brand/html.d.ts +26 -0
- package/dist/components/app-brand/html.js +78 -0
- package/dist/components/app-brand/react.d.ts +12 -0
- package/dist/components/app-brand/react.js +86 -0
- package/dist/components/app-brand/schema.d.ts +36 -0
- package/dist/components/app-switcher/classes.d.ts +15 -0
- package/dist/components/app-switcher/html.d.ts +72 -0
- package/dist/components/app-switcher/html.js +327 -0
- package/dist/components/app-switcher/index.d.ts +47 -0
- package/dist/components/app-switcher/react.d.ts +12 -0
- package/dist/components/{ui/app-switcher.js → app-switcher/react.js} +84 -15
- package/dist/components/app-switcher/schema.d.ts +39 -0
- package/dist/components/async-action-button/classes.d.ts +11 -0
- package/dist/components/async-action-button/html.d.ts +46 -0
- package/dist/components/async-action-button/html.js +266 -0
- package/dist/components/async-action-button/index.d.ts +73 -0
- package/dist/components/async-action-button/react.d.ts +10 -0
- package/dist/components/async-action-button/react.js +224 -0
- package/dist/components/async-action-button/schema.d.ts +28 -0
- package/dist/{services/events/client/audit-log-table.d.ts → components/audit-log-table/react.d.ts} +2 -2
- package/dist/{services/events/client/audit-log-table.js → components/audit-log-table/react.js} +1964 -847
- package/dist/components/auto-height/html.d.ts +8 -0
- package/dist/components/auto-height/html.js +81 -0
- package/dist/components/auto-height/index.d.ts +2 -0
- package/dist/components/{ui/auto-height.d.ts → auto-height/react.d.ts} +2 -4
- package/dist/components/auto-height/react.js +75 -0
- package/dist/components/auto-height/schema.d.ts +7 -0
- package/dist/components/bulk-list-input/classes.d.ts +7 -0
- package/dist/components/bulk-list-input/html.d.ts +41 -0
- package/dist/components/bulk-list-input/html.js +265 -0
- package/dist/components/bulk-list-input/index.d.ts +76 -0
- package/dist/components/bulk-list-input/react.d.ts +12 -0
- package/dist/components/{ui/bulk-list-input.js → bulk-list-input/react.js} +71 -4
- package/dist/components/bulk-list-input/schema.d.ts +33 -0
- package/dist/components/choice-cards/classes.d.ts +19 -0
- package/dist/components/choice-cards/html.d.ts +76 -0
- package/dist/components/choice-cards/html.js +237 -0
- package/dist/components/choice-cards/index.d.ts +1 -0
- package/dist/components/choice-cards/react.d.ts +21 -0
- package/dist/components/{ui/choice-cards.js → choice-cards/react.js} +29 -10
- package/dist/components/choice-cards/schema.d.ts +100 -0
- package/dist/components/code-block/classes.d.ts +13 -0
- package/dist/components/code-block/html.d.ts +21 -0
- package/dist/components/code-block/html.js +381 -0
- package/dist/components/code-block/index.d.ts +4 -0
- package/dist/components/code-block/react.d.ts +4 -0
- package/dist/components/{ui/code-block.js → code-block/react.js} +168 -50
- package/dist/components/code-block/schema.d.ts +29 -0
- package/dist/components/color-input/classes.d.ts +9 -0
- package/dist/components/color-input/html.d.ts +48 -0
- package/dist/components/color-input/html.js +187 -0
- package/dist/components/color-input/index.d.ts +88 -0
- package/dist/components/color-input/react.d.ts +7 -0
- package/dist/components/{ui/color-picker.js → color-input/react.js} +165 -233
- package/dist/components/color-input/schema.d.ts +40 -0
- package/dist/components/copy-button/html.d.ts +48 -0
- package/dist/components/copy-button/html.js +266 -0
- package/dist/components/copy-button/index.d.ts +73 -0
- package/dist/components/copy-button/react.d.ts +12 -0
- package/dist/components/copy-button/react.js +234 -0
- package/dist/components/copy-button/schema.d.ts +37 -0
- package/dist/components/copy-value/html.d.ts +37 -0
- package/dist/components/copy-value/html.js +426 -0
- package/dist/components/copy-value/index.d.ts +57 -0
- package/dist/components/copy-value/react.d.ts +9 -0
- package/dist/components/{ui/copy-value.js → copy-value/react.js} +243 -65
- package/dist/components/copy-value/schema.d.ts +45 -0
- package/dist/components/cron-input/classes.d.ts +25 -0
- package/dist/components/cron-input/html.d.ts +36 -0
- package/dist/components/cron-input/html.js +204 -0
- package/dist/components/cron-input/index.d.ts +59 -0
- package/dist/components/cron-input/react.d.ts +7 -0
- package/dist/components/{ui/cron-expression-editor.js → cron-input/react.js} +126 -54
- package/dist/components/cron-input/schema.d.ts +24 -0
- package/dist/components/danger-confirmation/classes.d.ts +7 -0
- package/dist/components/danger-confirmation/html.d.ts +39 -0
- package/dist/components/danger-confirmation/html.js +227 -0
- package/dist/components/danger-confirmation/index.d.ts +113 -0
- package/dist/components/{ui/danger-confirmation.d.ts → danger-confirmation/react.d.ts} +3 -12
- package/dist/components/{ui/danger-confirmation.js → danger-confirmation/react.js} +203 -205
- package/dist/components/danger-confirmation/schema.d.ts +34 -0
- package/dist/components/data-table/classes.d.ts +63 -0
- package/dist/components/data-table/html.d.ts +1938 -0
- package/dist/components/data-table/html.js +2682 -0
- package/dist/components/data-table/index.d.ts +2686 -0
- package/dist/components/data-table/react.d.ts +578 -0
- package/dist/components/{ui/data-table.js → data-table/react.js} +1958 -835
- package/dist/components/data-table/schema.d.ts +3012 -0
- package/dist/components/date-input/classes.d.ts +17 -0
- package/dist/components/date-input/html.d.ts +60 -0
- package/dist/components/date-input/html.js +418 -0
- package/dist/components/date-input/index.d.ts +91 -0
- package/dist/components/date-input/react.d.ts +10 -0
- package/dist/components/{ui/date-picker.js → date-input/react.js} +233 -79
- package/dist/components/date-input/schema.d.ts +41 -0
- package/dist/components/editable-text/classes.d.ts +17 -0
- package/dist/components/editable-text/html.d.ts +51 -0
- package/dist/components/editable-text/html.js +370 -0
- package/dist/components/editable-text/index.d.ts +143 -0
- package/dist/components/editable-text/react.d.ts +6 -0
- package/dist/components/editable-text/react.js +345 -0
- package/dist/components/editable-text/schema.d.ts +31 -0
- package/dist/components/editing-locale-switcher/classes.d.ts +7 -0
- package/dist/components/editing-locale-switcher/html.d.ts +27 -0
- package/dist/components/editing-locale-switcher/html.js +250 -0
- package/dist/components/editing-locale-switcher/index.d.ts +52 -0
- package/dist/components/editing-locale-switcher/react.d.ts +7 -0
- package/dist/components/{ui/editing-locale-switcher.js → editing-locale-switcher/react.js} +63 -10
- package/dist/components/editing-locale-switcher/schema.d.ts +16 -0
- package/dist/components/{ui/effect-form.d.ts → effect-form/react.d.ts} +2 -2
- package/dist/components/{ui/effect-form.js → effect-form/react.js} +302 -76
- package/dist/components/effectcn/alert-dialog.d.ts +13 -0
- package/dist/components/effectcn/button.d.ts +31 -0
- package/dist/components/effectcn/calendar.d.ts +12 -0
- package/dist/components/effectcn/checkbox.d.ts +10 -0
- package/dist/components/effectcn/combobox.d.ts +25 -0
- package/dist/components/effectcn/dialog.d.ts +19 -0
- package/dist/components/effectcn/field.d.ts +11 -0
- package/dist/components/effectcn/file-drop.d.ts +8 -0
- package/dist/components/effectcn/input.d.ts +26 -0
- package/dist/components/effectcn/menu.d.ts +85 -0
- package/dist/components/effectcn/menubar.d.ts +8 -0
- package/dist/components/effectcn/popover.d.ts +18 -0
- package/dist/components/effectcn/scroll-area.d.ts +12 -0
- package/dist/components/effectcn/select.d.ts +68 -0
- package/dist/components/effectcn/toast.d.ts +29 -0
- package/dist/components/email-composer/index.d.ts +229 -0
- package/dist/components/email-composer/labels.d.ts +12 -0
- package/dist/components/email-composer/react.d.ts +5 -0
- package/dist/components/{ui/email-composer.js → email-composer/react.js} +461 -127
- package/dist/components/email-composer/schema.d.ts +42 -0
- package/dist/components/email-editor/classes.d.ts +21 -0
- package/dist/components/email-editor/html.d.ts +360 -0
- package/dist/components/email-editor/html.js +1706 -0
- package/dist/components/email-editor/index.d.ts +693 -0
- package/dist/components/{ui/email-editor.d.ts → email-editor/labels.d.ts} +1 -21
- package/dist/components/email-editor/legacy-editor.html.d.ts +160 -0
- package/dist/components/email-editor/react.d.ts +11 -0
- package/dist/components/{ui/email-editor.js → email-editor/react.js} +600 -230
- package/dist/components/email-editor/schema.d.ts +162 -0
- package/dist/components/error-component/classes.d.ts +7 -0
- package/dist/components/error-component/html.d.ts +120 -0
- package/dist/components/error-component/html.js +346 -0
- package/dist/components/error-component/index.d.ts +69 -0
- package/dist/components/error-component/react.d.ts +8 -0
- package/dist/components/{ui/error-component.js → error-component/react.js} +281 -78
- package/dist/components/error-component/schema.d.ts +56 -0
- package/dist/components/file-input/classes.d.ts +7 -0
- package/dist/components/file-input/html.d.ts +95 -0
- package/dist/components/file-input/html.js +368 -0
- package/dist/components/file-input/index.d.ts +99 -0
- package/dist/components/file-input/react.d.ts +11 -0
- package/dist/components/{ui/file-picker.js → file-input/react.js} +122 -19
- package/dist/components/file-input/schema.d.ts +37 -0
- package/dist/components/{ui/form.d.ts → form/react.d.ts} +7 -7
- package/dist/components/{ui/form.js → form/react.js} +300 -74
- package/dist/components/icon-input/html.d.ts +55 -0
- package/dist/components/icon-input/html.js +538 -0
- package/dist/components/icon-input/index.d.ts +143 -0
- package/dist/components/icon-input/react.d.ts +6 -0
- package/dist/components/{ui/icon-input.js → icon-input/react.js} +305 -89
- package/dist/components/icon-input/schema.d.ts +23 -0
- package/dist/components/image-crop-editor/classes.d.ts +19 -0
- package/dist/components/image-crop-editor/html.d.ts +66 -0
- package/dist/components/image-crop-editor/html.js +561 -0
- package/dist/components/image-crop-editor/index.d.ts +183 -0
- package/dist/components/image-crop-editor/react.d.ts +8 -0
- package/dist/components/image-crop-editor/react.js +648 -0
- package/dist/components/image-crop-editor/schema.d.ts +54 -0
- package/dist/components/krakstack-provider/html.d.ts +17 -0
- package/dist/components/krakstack-provider/html.js +37 -0
- package/dist/components/krakstack-provider/index.d.ts +7 -0
- package/dist/components/krakstack-provider/react.d.ts +8 -0
- package/dist/components/{ui/krakstack-provider.js → krakstack-provider/react.js} +14 -5
- package/dist/components/krakstack-provider/schema.d.ts +6 -0
- package/dist/components/loading/classes.d.ts +5 -0
- package/dist/components/loading/html.d.ts +18 -0
- package/dist/components/loading/html.js +166 -0
- package/dist/components/loading/index.d.ts +6 -0
- package/dist/components/loading/react.d.ts +4 -0
- package/dist/components/loading/react.js +51 -0
- package/dist/components/loading/schema.d.ts +23 -0
- package/dist/components/locale-switcher/html.d.ts +22 -0
- package/dist/components/locale-switcher/html.js +264 -0
- package/dist/components/locale-switcher/index.d.ts +50 -0
- package/dist/components/locale-switcher/react.d.ts +7 -0
- package/dist/components/{ui/locale-switcher.js → locale-switcher/react.js} +55 -22
- package/dist/components/locale-switcher/schema.d.ts +12 -0
- package/dist/components/map-menu/classes.d.ts +13 -0
- package/dist/components/map-menu/google-maps.d.ts +80 -0
- package/dist/components/map-menu/google-viewport.d.ts +7 -0
- package/dist/components/map-menu/html.d.ts +274 -0
- package/dist/components/map-menu/html.js +934 -0
- package/dist/components/map-menu/index.d.ts +246 -0
- package/dist/components/map-menu/map.d.ts +47 -0
- package/dist/components/map-menu/react.d.ts +40 -0
- package/dist/components/{ui/map-menu.js → map-menu/react.js} +321 -83
- package/dist/components/map-menu/schema.d.ts +132 -0
- package/dist/components/markdown/classes.d.ts +1 -0
- package/dist/components/markdown/html.d.ts +23 -0
- package/dist/components/markdown/html.js +510 -0
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/react.d.ts +3 -0
- package/dist/components/markdown/react.js +392 -0
- package/dist/components/markdown/schema.d.ts +20 -0
- package/dist/components/notification-menu/classes.d.ts +11 -0
- package/dist/components/notification-menu/html.d.ts +67 -0
- package/dist/components/notification-menu/html.js +425 -0
- package/dist/components/notification-menu/index.d.ts +132 -0
- package/dist/components/notification-menu/react.d.ts +57 -0
- package/dist/components/notification-menu/react.js +829 -0
- package/dist/components/notification-menu/schema.d.ts +59 -0
- package/dist/components/pagination/classes.d.ts +19 -0
- package/dist/components/pagination/html.d.ts +49 -0
- package/dist/components/pagination/html.js +387 -0
- package/dist/components/pagination/index.d.ts +109 -0
- package/dist/components/pagination/react.d.ts +9 -0
- package/dist/components/{ui/pagination.js → pagination/react.js} +123 -23
- package/dist/components/pagination/schema.d.ts +36 -0
- package/dist/components/phone-number-input/classes.d.ts +17 -0
- package/dist/components/phone-number-input/html.d.ts +52 -0
- package/dist/components/phone-number-input/html.js +655 -0
- package/dist/components/phone-number-input/index.d.ts +59 -0
- package/dist/components/phone-number-input/react.d.ts +11 -0
- package/dist/components/{ui/phone-number-input.js → phone-number-input/react.js} +368 -138
- package/dist/components/phone-number-input/schema.d.ts +31 -0
- package/dist/components/presence-transition/html.d.ts +13 -0
- package/dist/components/presence-transition/html.js +128 -0
- package/dist/components/presence-transition/index.d.ts +57 -0
- package/dist/components/{ui/presence-transition.d.ts → presence-transition/react.d.ts} +3 -5
- package/dist/components/presence-transition/react.js +139 -0
- package/dist/components/presence-transition/schema.d.ts +7 -0
- package/dist/components/registry-previews/component-example.d.ts +31 -0
- package/dist/components/registry-previews/component-example.js +525 -0
- package/dist/components/registry-previews/html-preview.d.ts +17 -0
- package/dist/components/registry-previews/html-preview.js +83 -0
- package/dist/components/rich-text-editor/classes.d.ts +15 -0
- package/dist/components/rich-text-editor/engine.d.ts +9 -0
- package/dist/components/rich-text-editor/html.d.ts +246 -0
- package/dist/components/rich-text-editor/html.js +830 -0
- package/dist/components/rich-text-editor/index.d.ts +453 -0
- package/dist/components/rich-text-editor/labels.d.ts +42 -0
- package/dist/components/rich-text-editor/react.d.ts +19 -0
- package/dist/components/{ui/rich-text-editor.js → rich-text-editor/react.js} +365 -96
- package/dist/components/rich-text-editor/schema.d.ts +116 -0
- package/dist/components/search-menu/classes.d.ts +9 -0
- package/dist/components/search-menu/html.d.ts +127 -0
- package/dist/components/search-menu/html.js +432 -0
- package/dist/components/search-menu/index.d.ts +85 -0
- package/dist/components/search-menu/react.d.ts +18 -0
- package/dist/components/{ui/search-menu.js → search-menu/react.js} +128 -23
- package/dist/components/search-menu/schema.d.ts +78 -0
- package/dist/components/select-with-custom-input/classes.d.ts +17 -0
- package/dist/components/select-with-custom-input/html.d.ts +60 -0
- package/dist/components/select-with-custom-input/html.js +238 -0
- package/dist/components/select-with-custom-input/index.d.ts +114 -0
- package/dist/components/select-with-custom-input/react.d.ts +7 -0
- package/dist/components/{ui/select-with-custom-input.js → select-with-custom-input/react.js} +127 -22
- package/dist/components/select-with-custom-input/schema.d.ts +54 -0
- package/dist/components/sidebar-layout/classes.d.ts +21 -0
- package/dist/components/sidebar-layout/html.d.ts +97 -0
- package/dist/components/sidebar-layout/html.js +361 -0
- package/dist/components/sidebar-layout/index.d.ts +57 -0
- package/dist/components/sidebar-layout/react.d.ts +30 -0
- package/dist/components/{ui/sidebar-layout.js → sidebar-layout/react.js} +199 -39
- package/dist/components/sidebar-layout/schema.d.ts +54 -0
- package/dist/components/stats-card/classes.d.ts +11 -0
- package/dist/components/stats-card/html.d.ts +15 -0
- package/dist/components/stats-card/html.js +55 -0
- package/dist/components/stats-card/react.d.ts +7 -0
- package/dist/components/{ui/stats-card.js → stats-card/react.js} +19 -15
- package/dist/components/stats-card/schema.d.ts +14 -0
- package/dist/components/stepper/classes.d.ts +39 -0
- package/dist/components/stepper/html.d.ts +107 -0
- package/dist/components/stepper/html.js +397 -0
- package/dist/components/stepper/index.d.ts +83 -0
- package/dist/components/stepper/react.d.ts +17 -0
- package/dist/components/{ui/stepper.js → stepper/react.js} +120 -21
- package/dist/components/stepper/schema.d.ts +52 -0
- package/dist/components/support/classes.d.ts +55 -0
- package/dist/components/support/form.d.ts +19 -0
- package/dist/components/support/html.d.ts +266 -0
- package/dist/components/support/html.js +604 -0
- package/dist/components/support/index.d.ts +226 -0
- package/dist/components/support/multipart.d.ts +21 -0
- package/dist/components/support/react.d.ts +54 -0
- package/dist/components/support/react.js +1098 -0
- package/dist/components/support/schema.d.ts +69 -0
- package/dist/components/support.d.ts +1 -66
- package/dist/components/theme-switcher/html.d.ts +28 -0
- package/dist/components/theme-switcher/html.js +288 -0
- package/dist/components/theme-switcher/index.d.ts +59 -0
- package/dist/components/{ui/theme-switcher.d.ts → theme-switcher/react.d.ts} +4 -12
- package/dist/components/{ui/theme-switcher.js → theme-switcher/react.js} +69 -35
- package/dist/components/theme-switcher/schema.d.ts +33 -0
- package/dist/components/time-input/classes.d.ts +23 -0
- package/dist/components/time-input/html.d.ts +75 -0
- package/dist/components/time-input/html.js +571 -0
- package/dist/components/time-input/index.d.ts +164 -0
- package/dist/components/time-input/react.d.ts +7 -0
- package/dist/components/{ui/time-picker.js → time-input/react.js} +286 -114
- package/dist/components/time-input/schema.d.ts +96 -0
- package/dist/components/timezone-input/classes.d.ts +13 -0
- package/dist/components/timezone-input/html.d.ts +58 -0
- package/dist/components/timezone-input/html.js +804 -0
- package/dist/components/timezone-input/index.d.ts +170 -0
- package/dist/components/timezone-input/react.d.ts +9 -0
- package/dist/components/{ui/timezone-select.js → timezone-input/react.js} +337 -104
- package/dist/components/timezone-input/schema.d.ts +43 -0
- package/dist/components/toast/classes.d.ts +7 -0
- package/dist/components/toast/html.d.ts +34 -0
- package/dist/components/toast/html.js +280 -0
- package/dist/components/toast/index.d.ts +10 -0
- package/dist/components/toast/react.d.ts +9 -0
- package/dist/components/{ui/toast.js → toast/react.js} +35 -15
- package/dist/components/toast/schema.d.ts +24 -0
- package/dist/{services/events/client/tracking-notice.d.ts → components/tracking-notice/react.d.ts} +7 -1
- package/dist/{services/events/client/tracking-notice.js → components/tracking-notice/react.js} +13 -7
- package/dist/components/ui/animated-list.d.ts +1 -21
- package/dist/components/ui/app-brand.d.ts +1 -33
- package/dist/components/ui/async-action-button.d.ts +1 -17
- package/dist/components/ui/code-block.d.ts +1 -14
- package/dist/components/ui/copy-button.d.ts +1 -21
- package/dist/components/ui/data-table.d.ts +1 -584
- package/dist/components/ui/krakstack-provider.d.ts +1 -9
- package/dist/components/ui/loading.d.ts +1 -13
- package/dist/components/ui/pagination.d.ts +1 -47
- package/dist/components/ui/rich-text-editor.d.ts +1 -72
- package/dist/components/ui/search-menu.d.ts +1 -36
- package/dist/components/ui/sidebar-layout.d.ts +1 -40
- package/dist/components/ui/virtualized-combobox.d.ts +1 -59
- package/dist/components/unsaved-changes-guard/html.d.ts +34 -0
- package/dist/components/unsaved-changes-guard/html.js +172 -0
- package/dist/components/unsaved-changes-guard/index.d.ts +56 -0
- package/dist/components/unsaved-changes-guard/react.d.ts +4 -0
- package/dist/components/{ui/unsaved-changes-guard.js → unsaved-changes-guard/react.js} +74 -11
- package/dist/components/unsaved-changes-guard/schema.d.ts +37 -0
- package/dist/components/upload-attachment/classes.d.ts +11 -0
- package/dist/components/upload-attachment/html.d.ts +84 -0
- package/dist/components/upload-attachment/html.js +312 -0
- package/dist/components/upload-attachment/index.d.ts +72 -0
- package/dist/components/upload-attachment/react.d.ts +9 -0
- package/dist/components/{ui/upload-attachment.js → upload-attachment/react.js} +114 -17
- package/dist/components/upload-attachment/schema.d.ts +53 -0
- package/dist/components/virtualized-combobox/classes.d.ts +7 -0
- package/dist/components/virtualized-combobox/html.d.ts +97 -0
- package/dist/components/virtualized-combobox/html.js +310 -0
- package/dist/components/virtualized-combobox/index.d.ts +182 -0
- package/dist/components/virtualized-combobox/react.d.ts +31 -0
- package/dist/components/{ui/virtualized-combobox.js → virtualized-combobox/react.js} +160 -40
- package/dist/components/virtualized-combobox/schema.d.ts +92 -0
- package/dist/components/webhook-delivery-table/html.d.ts +216 -0
- package/dist/components/webhook-delivery-table/html.js +3008 -0
- package/dist/components/webhook-delivery-table/index.d.ts +405 -0
- package/dist/components/webhook-delivery-table/react.d.ts +13 -0
- package/dist/{services/webhooks/client/delivery-table.js → components/webhook-delivery-table/react.js} +2278 -917
- package/dist/components/webhook-delivery-table/schema.d.ts +134 -0
- package/dist/lib/docs.d.ts +17 -1
- package/dist/lib/docs.integrations.server.js +341 -75
- package/dist/lib/docs.js +715 -299
- package/dist/lib/docs.server.js +325 -59
- package/dist/lib/documentation-toolkit.d.ts +4 -4
- package/dist/lib/documentation-toolkit.js +337 -71
- package/dist/lib/effect-ui-adapter/model-runtime.d.ts +17 -0
- package/dist/lib/effect-ui-adapter/use-model.d.ts +9 -0
- package/dist/lib/effect-ui-adapter/use-model.js +158 -0
- package/dist/lib/effectcn-form.d.ts +3 -0
- package/dist/lib/effectcn-form.js +54 -0
- package/dist/lib/email-composer/index.d.ts +12 -0
- package/dist/lib/email-composer/schema.d.ts +14 -0
- package/dist/lib/httpapi-toolkit.d.ts +1 -1
- package/dist/lib/lucide-effect.d.ts +39 -0
- package/dist/lib/markdown/content.d.ts +1 -12
- package/dist/lib/rich-text/model.d.ts +5 -0
- package/dist/lib/webfetch-toolkit.d.ts +1 -1
- package/dist/services/agent/client/index.js +530 -168
- package/dist/services/agent/client/widget.d.ts +1 -55
- package/dist/services/notification/client/index.js +138 -27
- package/dist/services/notification/client/notification-menu.d.ts +1 -85
- package/dist/services/notification/public.js +138 -27
- package/dist/services/opentelemetry/browser.js +15 -9
- package/dist/services/webhooks/index.d.ts +4 -3
- package/package.json +185 -142
- package/dist/components/support-dialog.js +0 -881
- package/dist/components/support.js +0 -881
- package/dist/components/ui/animated-number.js +0 -75
- package/dist/components/ui/app-brand.js +0 -126
- package/dist/components/ui/app-switcher.d.ts +0 -26
- package/dist/components/ui/async-action-button.js +0 -149
- package/dist/components/ui/auto-height.js +0 -86
- package/dist/components/ui/bulk-list-input.d.ts +0 -25
- package/dist/components/ui/choice-cards.d.ts +0 -33
- package/dist/components/ui/color-picker.d.ts +0 -31
- package/dist/components/ui/copy-button.js +0 -138
- package/dist/components/ui/copy-value.d.ts +0 -24
- package/dist/components/ui/cron-expression-editor.d.ts +0 -16
- package/dist/components/ui/cron-expression-editor.schema.d.ts +0 -7
- package/dist/components/ui/date-picker.d.ts +0 -33
- package/dist/components/ui/date-picker.schema.d.ts +0 -9
- package/dist/components/ui/editable-text.d.ts +0 -19
- package/dist/components/ui/editable-text.js +0 -341
- package/dist/components/ui/editing-locale-switcher.d.ts +0 -11
- package/dist/components/ui/error-component.d.ts +0 -34
- package/dist/components/ui/file-picker.d.ts +0 -37
- package/dist/components/ui/icon-input.d.ts +0 -58
- package/dist/components/ui/image-crop-editor.d.ts +0 -41
- package/dist/components/ui/image-crop-editor.js +0 -417
- package/dist/components/ui/loading.js +0 -39
- package/dist/components/ui/locale-switcher.d.ts +0 -11
- package/dist/components/ui/map-menu-map.d.ts +0 -115
- package/dist/components/ui/map-menu.d.ts +0 -87
- package/dist/components/ui/phone-number-input.d.ts +0 -22
- package/dist/components/ui/phone-number-input.schema.d.ts +0 -7
- package/dist/components/ui/presence-transition.js +0 -94
- package/dist/components/ui/select-with-custom-input.d.ts +0 -36
- package/dist/components/ui/stats-card.d.ts +0 -12
- package/dist/components/ui/stepper.d.ts +0 -37
- package/dist/components/ui/time-picker.d.ts +0 -50
- package/dist/components/ui/time-picker.schema.d.ts +0 -28
- package/dist/components/ui/timezone-select.d.ts +0 -57
- package/dist/components/ui/timezone-select.schema.d.ts +0 -9
- package/dist/components/ui/toast.d.ts +0 -18
- package/dist/components/ui/unsaved-changes-guard.d.ts +0 -16
- package/dist/components/ui/upload-attachment.d.ts +0 -39
- package/dist/services/notification/persistence/drizzle.d.ts +0 -868
- package/dist/services/notification/persistence/drizzle.js +0 -214
- package/dist/services/notification/persistence/index.d.ts +0 -2
- package/dist/services/notification/persistence/index.js +0 -227
- package/dist/services/notification/persistence/schema.d.ts +0 -143
- package/dist/services/notification/persistence/schema.js +0 -118
- package/dist/services/webhooks/client/delivery-table.d.ts +0 -62
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
// ../../src/components/phone-number-input/html.ts
|
|
2
|
+
import { Redacted, Schema as Schema4 } from "effect";
|
|
3
|
+
import { Component as Component2, UiSchema as UiSchema2 } from "effect/ui";
|
|
4
|
+
import { Html as Html2, HtmlCommand } from "effect/ui/html";
|
|
5
|
+
import { getCountryCallingCode as getCountryCallingCode3 } from "libphonenumber-js/max";
|
|
6
|
+
|
|
7
|
+
// ../../src/components/effectcn/input.ts
|
|
8
|
+
import {
|
|
9
|
+
Input as KitInput
|
|
10
|
+
} from "effect/ui/kit";
|
|
11
|
+
|
|
12
|
+
// ../../src/lib/utils.ts
|
|
13
|
+
import { cn } from "cn";
|
|
14
|
+
|
|
15
|
+
// ../../src/components/effectcn/input.ts
|
|
16
|
+
var base = "block h-8.5 w-full min-w-0 rounded-md border border-input bg-background px-3 text-[13px] text-foreground shadow-sm outline-none " + "transition-[border-color,box-shadow] duration-150 placeholder:text-muted-foreground " + "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20 " + "aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/20 " + "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 " + "[&[readonly]]:bg-muted [&[readonly]]:text-muted-foreground [&[readonly]]:shadow-none " + "[&[type=file]]:cursor-pointer [&[type=file]]:pl-0 [&[type=file]]:leading-8 [&[type=file]]:text-muted-foreground " + "file:mr-3 file:h-8 file:cursor-pointer file:border-0 file:border-r file:border-solid file:border-input file:bg-muted file:px-3 " + "file:text-[13px] file:font-medium file:text-foreground";
|
|
17
|
+
var sizes = {
|
|
18
|
+
default: "",
|
|
19
|
+
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
20
|
+
lg: "h-10 px-3.5 text-sm"
|
|
21
|
+
};
|
|
22
|
+
var inputVariants = (options = {}) => cn(base, sizes[options.size ?? "default"], options.class);
|
|
23
|
+
var Input = (h, options) => KitInput(h, options).class(inputVariants(options));
|
|
24
|
+
|
|
25
|
+
// ../../src/components/phone-number-input/html.ts
|
|
26
|
+
import { krakstackLocaleRead as krakstackLocaleRead2 } from "@krak-stack/registry/krakstack-provider/html";
|
|
27
|
+
|
|
28
|
+
// ../../src/components/virtualized-combobox/html.ts
|
|
29
|
+
import { Html } from "effect/ui/html";
|
|
30
|
+
import { Combobox, VirtualList } from "effect/ui/kit";
|
|
31
|
+
|
|
32
|
+
// ../../src/components/effectcn/combobox.ts
|
|
33
|
+
var icon = (h, path) => h.el("svg").attrs({
|
|
34
|
+
viewBox: "0 0 24 24",
|
|
35
|
+
fill: "none",
|
|
36
|
+
stroke: "currentColor",
|
|
37
|
+
"stroke-width": "2",
|
|
38
|
+
"stroke-linecap": "round",
|
|
39
|
+
"stroke-linejoin": "round",
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
}).children(h.el("path").attr("d", path));
|
|
42
|
+
var ComboboxButton = (h, combobox, options = {}) => combobox.trigger(h.button.class(cn("border-input bg-background text-foreground hover:bg-accent data-[popup-open]:bg-accent inline-flex h-8.5 w-56 items-center justify-between gap-2 rounded-md border pr-2 pl-3 text-start text-[13px] whitespace-nowrap shadow-sm transition-colors duration-150 select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:size-3.5", options.class))).children(options.value === undefined ? combobox.value(h.span.class("min-w-0 truncate data-[placeholder]:text-muted-foreground")) : h.span.class(cn("data-[placeholder]:text-muted-foreground min-w-0 truncate", options.valueClass)).children(options.value), combobox.icon(h.span.class("grid shrink-0 place-items-center text-muted-foreground")).children(icon(h, "M7 15l5 5 5-5M7 9l5-5 5 5")));
|
|
43
|
+
var ComboboxClear = (h, combobox, options = {}) => combobox.clear({
|
|
44
|
+
element: h.button.class(cn("text-muted-foreground hover:bg-accent hover:text-foreground grid size-6 shrink-0 place-items-center rounded-sm transition-colors duration-150 data-[disabled]:pointer-events-none [&_svg]:size-3.5", options.class))
|
|
45
|
+
})?.children(icon(h, "M18 6L6 18M6 6l12 12"));
|
|
46
|
+
var ComboboxPositioner = (h, combobox, options = {}) => combobox.positioner(h.div.class(cn("outline-none", options.class)));
|
|
47
|
+
var ComboboxPopup = (h, combobox, options = {}) => combobox.popup(h.div.class(cn("bg-popover text-foreground shadow-float box-border flex max-h-[min(var(--available-height),20rem)] w-[var(--anchor-width)] max-w-[var(--available-width)] min-w-48 origin-[var(--transform-origin)] flex-col overflow-hidden rounded-lg border text-[13px] transition-[opacity,scale] duration-150 outline-none data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0", options.class)));
|
|
48
|
+
var ComboboxSearchInput = (h, combobox, options = {}) => h.div.class(cn("text-muted-foreground flex shrink-0 items-center border-b pl-3 [&_svg]:size-3.5", options.class)).children(icon(h, "M21 21l-4.3-4.3M11 18a7 7 0 100-14 7 7 0 000 14z"), combobox.input(h.input.attrs({
|
|
49
|
+
placeholder: options.placeholder,
|
|
50
|
+
"aria-label": options.placeholder
|
|
51
|
+
}).class("h-9 min-w-0 flex-1 bg-transparent px-2 text-[13px] text-foreground outline-none placeholder:text-muted-foreground")));
|
|
52
|
+
var ComboboxEmpty = (h, combobox, options = {}) => combobox.empty(h.div.class(cn("text-muted-foreground px-3 py-5 text-center empty:hidden", options.class)));
|
|
53
|
+
var ComboboxItem = (h, combobox, options) => combobox.item({
|
|
54
|
+
element: h.div.class(cn("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:text-muted-foreground flex min-h-7.5 cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1 leading-snug select-none data-[disabled]:opacity-60 data-[selected]:font-medium", options.class)),
|
|
55
|
+
value: options.value
|
|
56
|
+
});
|
|
57
|
+
var ComboboxItemIndicator = (h, combobox, options) => combobox.itemIndicator({
|
|
58
|
+
element: h.span.class(cn("border-brand mr-1.5 mb-0.5 ml-2.5 h-[9px] w-[5px] shrink-0 rotate-45 border-r-[1.5px] border-b-[1.5px]", options.class)),
|
|
59
|
+
value: options.value
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// ../../src/components/virtualized-combobox/html.ts
|
|
63
|
+
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
64
|
+
|
|
65
|
+
// ../../src/components/virtualized-combobox/classes.ts
|
|
66
|
+
var virtualizedComboboxClasses = {
|
|
67
|
+
itemLabel: "min-w-0 truncate"
|
|
68
|
+
};
|
|
69
|
+
var resolveVirtualizedComboboxClasses = (overrides) => ({
|
|
70
|
+
...virtualizedComboboxClasses,
|
|
71
|
+
...overrides
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// ../../src/components/virtualized-combobox/index.ts
|
|
75
|
+
import { Schema as Schema2 } from "effect";
|
|
76
|
+
import { Component, UiSchema } from "effect/ui";
|
|
77
|
+
|
|
78
|
+
// ../../src/components/virtualized-combobox/schema.ts
|
|
79
|
+
import { Schema, Struct } from "effect";
|
|
80
|
+
var VirtualizedComboboxOptionSchema = Schema.Struct({
|
|
81
|
+
value: Schema.String.pipe(Schema.mutableKey),
|
|
82
|
+
label: Schema.String.pipe(Schema.mutableKey)
|
|
83
|
+
}).annotate({ identifier: "VirtualizedComboboxOption" });
|
|
84
|
+
var VirtualizedComboboxLabelsSchema = Schema.Struct({
|
|
85
|
+
clear: Schema.optionalKey(Schema.String),
|
|
86
|
+
search: Schema.optionalKey(Schema.String),
|
|
87
|
+
selectMore: Schema.optionalKey(Schema.String)
|
|
88
|
+
}).annotate({ identifier: "VirtualizedComboboxLabels" });
|
|
89
|
+
var VirtualizedComboboxClassesOverridesSchema = Schema.Record(Schema.Literals(Struct.keys(virtualizedComboboxClasses)), Schema.optionalKey(Schema.String)).annotate({ identifier: "VirtualizedComboboxClassesOverrides" });
|
|
90
|
+
var VirtualizedComboboxSharedPropsSchema = Schema.Struct({
|
|
91
|
+
classes: Schema.optional(VirtualizedComboboxClassesOverridesSchema),
|
|
92
|
+
ariaLabel: Schema.String,
|
|
93
|
+
ariaInvalid: Schema.optionalKey(Schema.Boolean),
|
|
94
|
+
contentClassName: Schema.optionalKey(Schema.String),
|
|
95
|
+
disabled: Schema.optionalKey(Schema.Boolean),
|
|
96
|
+
items: Schema.Array(VirtualizedComboboxOptionSchema),
|
|
97
|
+
locale: Schema.optionalKey(Schema.String),
|
|
98
|
+
open: Schema.optionalKey(Schema.Boolean),
|
|
99
|
+
searchValue: Schema.optionalKey(Schema.String),
|
|
100
|
+
triggerId: Schema.optionalKey(Schema.String)
|
|
101
|
+
}).annotate({ identifier: "VirtualizedComboboxSharedProps" });
|
|
102
|
+
var htmlFields = {
|
|
103
|
+
...VirtualizedComboboxSharedPropsSchema.fields,
|
|
104
|
+
emptyLabel: Schema.String,
|
|
105
|
+
placeholder: Schema.String,
|
|
106
|
+
triggerLabel: Schema.optionalKey(Schema.String),
|
|
107
|
+
filter: Schema.optionalKey(Schema.Literals(["contains", "none"])),
|
|
108
|
+
messages: Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
109
|
+
...VirtualizedComboboxLabelsSchema.fields,
|
|
110
|
+
selected: Schema.optionalKey(Schema.String)
|
|
111
|
+
})))
|
|
112
|
+
};
|
|
113
|
+
var VirtualizedComboboxPropsSchema = Schema.Union([
|
|
114
|
+
Schema.Struct({
|
|
115
|
+
...htmlFields,
|
|
116
|
+
multiple: Schema.optionalKey(Schema.Literal(false)),
|
|
117
|
+
value: Schema.NullOr(VirtualizedComboboxOptionSchema)
|
|
118
|
+
}),
|
|
119
|
+
Schema.Struct({
|
|
120
|
+
...htmlFields,
|
|
121
|
+
multiple: Schema.Literal(true),
|
|
122
|
+
value: Schema.Array(VirtualizedComboboxOptionSchema)
|
|
123
|
+
})
|
|
124
|
+
]).annotate({ identifier: "VirtualizedComboboxProps" });
|
|
125
|
+
|
|
126
|
+
// ../../src/components/virtualized-combobox/index.ts
|
|
127
|
+
var isText = Schema2.is(Schema2.String);
|
|
128
|
+
var defaultMessages = {
|
|
129
|
+
en: {
|
|
130
|
+
clear: "Clear selection",
|
|
131
|
+
search: "Search...",
|
|
132
|
+
selected: (count) => `${count} selected`,
|
|
133
|
+
selectMore: "Select more"
|
|
134
|
+
},
|
|
135
|
+
fr: {
|
|
136
|
+
clear: "Effacer la sélection",
|
|
137
|
+
search: "Rechercher...",
|
|
138
|
+
selected: (count) => `${count} sélectionnés`,
|
|
139
|
+
selectMore: "Sélectionner davantage"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
var virtualizedComboboxMessages = (locale, translations) => {
|
|
143
|
+
const language = locale.split("-")[0];
|
|
144
|
+
const labels = {
|
|
145
|
+
...defaultMessages[language === "fr" ? "fr" : "en"],
|
|
146
|
+
...translations?.[language ?? locale],
|
|
147
|
+
...translations?.[locale]
|
|
148
|
+
};
|
|
149
|
+
const selected = labels.selected;
|
|
150
|
+
return {
|
|
151
|
+
...labels,
|
|
152
|
+
selected: isText(selected) ? (count) => selected.replaceAll("{count}", String(count)) : selected
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
var selectedLabel = (value, placeholder) => {
|
|
156
|
+
if (!value)
|
|
157
|
+
return placeholder;
|
|
158
|
+
if ("label" in value)
|
|
159
|
+
return value.label;
|
|
160
|
+
return value.length ? value.map(({ label }) => label).join(", ") : placeholder;
|
|
161
|
+
};
|
|
162
|
+
var selectionEntries = (items, selected, groupSelections, labels) => {
|
|
163
|
+
const entries = items.map((item, index) => ({
|
|
164
|
+
kind: "item",
|
|
165
|
+
item,
|
|
166
|
+
index
|
|
167
|
+
}));
|
|
168
|
+
if (!groupSelections || entries.length === 0)
|
|
169
|
+
return entries;
|
|
170
|
+
const chosen = entries.filter(({ item }) => selected.has(item.value));
|
|
171
|
+
return [
|
|
172
|
+
...chosen.length ? [
|
|
173
|
+
{
|
|
174
|
+
kind: "group",
|
|
175
|
+
key: "selected",
|
|
176
|
+
label: labels.selected(selected.size)
|
|
177
|
+
},
|
|
178
|
+
...chosen
|
|
179
|
+
] : [],
|
|
180
|
+
{ kind: "group", key: "available", label: labels.selectMore },
|
|
181
|
+
...entries.filter(({ item }) => !selected.has(item.value))
|
|
182
|
+
];
|
|
183
|
+
};
|
|
184
|
+
var events = {
|
|
185
|
+
OpenChanged: { open: Schema2.Boolean },
|
|
186
|
+
SearchChanged: { searchValue: Schema2.String },
|
|
187
|
+
ValueChanged: {
|
|
188
|
+
value: Schema2.NullOr(Schema2.Union([Schema2.String, Schema2.Array(Schema2.String)]))
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
var selectionId = (value) => isText(value) ? value : null;
|
|
192
|
+
var selectionIds = (value) => isText(value) ? [value] : value ?? [];
|
|
193
|
+
var VirtualizedComboboxEvents = UiSchema.TaggedEnum(events).annotate({
|
|
194
|
+
identifier: "VirtualizedComboboxEvents"
|
|
195
|
+
});
|
|
196
|
+
var VirtualizedComboboxMessage = UiSchema.TaggedEnum({
|
|
197
|
+
...events,
|
|
198
|
+
Highlighted: { value: Schema2.String }
|
|
199
|
+
}).annotate({ identifier: "VirtualizedComboboxMessage" });
|
|
200
|
+
var virtualizedComboboxOptions = {
|
|
201
|
+
name: "VirtualizedCombobox",
|
|
202
|
+
props: VirtualizedComboboxPropsSchema,
|
|
203
|
+
model: Schema2.Struct({
|
|
204
|
+
open: Schema2.Boolean,
|
|
205
|
+
searchValue: Schema2.String,
|
|
206
|
+
highlight: Schema2.NullOr(Schema2.Struct({ value: Schema2.String, id: Schema2.Int }))
|
|
207
|
+
}).annotate({ identifier: "VirtualizedComboboxModel" }),
|
|
208
|
+
message: VirtualizedComboboxMessage,
|
|
209
|
+
events: VirtualizedComboboxEvents,
|
|
210
|
+
restore: false
|
|
211
|
+
};
|
|
212
|
+
var update = Component.define(virtualizedComboboxOptions).update({
|
|
213
|
+
OpenChanged: ($, { open }) => $.set({
|
|
214
|
+
...$.model,
|
|
215
|
+
open: $.props.open === undefined ? open : $.model.open,
|
|
216
|
+
highlight: open ? $.model.highlight : null
|
|
217
|
+
}).emit(VirtualizedComboboxEvents.OpenChanged({ open })),
|
|
218
|
+
SearchChanged: ($, { searchValue }) => $.evolve({
|
|
219
|
+
searchValue: $.props.searchValue === undefined ? searchValue : $.model.searchValue,
|
|
220
|
+
highlight: null
|
|
221
|
+
}).emit(VirtualizedComboboxEvents.SearchChanged({ searchValue })),
|
|
222
|
+
ValueChanged: ($, { value }) => $.set($.model).emit(VirtualizedComboboxEvents.ValueChanged({ value })),
|
|
223
|
+
Highlighted: ($, { value }) => $.evolve({
|
|
224
|
+
highlight: { value, id: ($.model.highlight?.id ?? 0) + 1 }
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
var virtualizedComboboxBehaviours = {
|
|
228
|
+
init: () => ({ open: false, searchValue: "", highlight: null }),
|
|
229
|
+
update
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// ../../src/components/virtualized-combobox/html.ts
|
|
233
|
+
var rowHeight = 36;
|
|
234
|
+
var visibleRows = 8;
|
|
235
|
+
var itemKey = (value) => `item:${value}`;
|
|
236
|
+
var VirtualizedCombobox = Html.component({
|
|
237
|
+
...virtualizedComboboxOptions,
|
|
238
|
+
reads: { localeConfig: krakstackLocaleRead }
|
|
239
|
+
}).make({
|
|
240
|
+
...virtualizedComboboxBehaviours,
|
|
241
|
+
view: (h, model) => {
|
|
242
|
+
const virtualizedComboboxClasses = resolveVirtualizedComboboxClasses(h.props.classes);
|
|
243
|
+
const props = h.props;
|
|
244
|
+
const locale = props.locale ?? h.reads.localeConfig?.locale ?? "en";
|
|
245
|
+
const labels = virtualizedComboboxMessages(locale, props.messages);
|
|
246
|
+
const value = props.multiple ? props.value.map((item) => item.value) : props.value?.value ?? null;
|
|
247
|
+
const selected = new Set(selectionIds(value));
|
|
248
|
+
return Combobox(h, {
|
|
249
|
+
props: {
|
|
250
|
+
open: props.open ?? model.open,
|
|
251
|
+
inputValue: props.searchValue ?? model.searchValue,
|
|
252
|
+
items: props.items,
|
|
253
|
+
value,
|
|
254
|
+
locale,
|
|
255
|
+
multiple: props.multiple,
|
|
256
|
+
filter: props.filter,
|
|
257
|
+
disabled: props.disabled,
|
|
258
|
+
id: props.triggerId,
|
|
259
|
+
sideOffset: 6,
|
|
260
|
+
inputInPopup: true,
|
|
261
|
+
virtualized: true
|
|
262
|
+
},
|
|
263
|
+
onEmit: {
|
|
264
|
+
RequestedOpen: () => VirtualizedComboboxMessage.OpenChanged({ open: true }),
|
|
265
|
+
RequestedClose: () => VirtualizedComboboxMessage.OpenChanged({ open: false }),
|
|
266
|
+
RequestedInputValue: ({ inputValue }) => VirtualizedComboboxMessage.SearchChanged({ searchValue: inputValue }),
|
|
267
|
+
Picked: ({ value }) => VirtualizedComboboxMessage.ValueChanged({
|
|
268
|
+
value: props.multiple ? selectionIds(value) : selectionId(value)
|
|
269
|
+
}),
|
|
270
|
+
Highlighted: ({ reason, value }) => reason === "keyboard" && value !== null ? VirtualizedComboboxMessage.Highlighted({ value }) : undefined,
|
|
271
|
+
Settled: () => {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
view: (combo) => {
|
|
276
|
+
const entries = selectionEntries(combo.items, selected, props.multiple === true, labels);
|
|
277
|
+
const keys = entries.map((entry) => entry.kind === "group" ? `group:${entry.key}` : itemKey(entry.item.value));
|
|
278
|
+
const highlight = model.highlight && keys.includes(itemKey(model.highlight.value)) ? model.highlight : undefined;
|
|
279
|
+
return h.div.class("relative min-w-0").children(ComboboxButton(h, combo, {
|
|
280
|
+
class: "w-full min-w-0 aria-invalid:border-destructive",
|
|
281
|
+
value: props.triggerLabel ?? selectedLabel(props.value, props.placeholder),
|
|
282
|
+
valueClass: selected.size > 0 ? "pr-7" : undefined
|
|
283
|
+
}).attrs({
|
|
284
|
+
"aria-label": props.ariaLabel,
|
|
285
|
+
"aria-invalid": props.ariaInvalid ? "true" : undefined
|
|
286
|
+
}), selected.size > 0 && ComboboxClear(h, combo, {
|
|
287
|
+
class: "absolute right-7 top-1/2 -translate-y-1/2"
|
|
288
|
+
})?.attrs({ "aria-label": labels.clear, tabindex: "0" }), ComboboxPositioner(h, combo, {
|
|
289
|
+
class: "overflow-visible border-0 bg-transparent p-0 text-inherit"
|
|
290
|
+
}).children(ComboboxPopup(h, combo, { class: props.contentClassName }).attr("aria-label", props.ariaLabel).children(ComboboxSearchInput(h, combo, {
|
|
291
|
+
placeholder: labels.search
|
|
292
|
+
}), ComboboxEmpty(h, combo).children(props.emptyLabel), VirtualList(h, {
|
|
293
|
+
props: {
|
|
294
|
+
count: entries.length,
|
|
295
|
+
itemSize: rowHeight,
|
|
296
|
+
measure: false,
|
|
297
|
+
keys,
|
|
298
|
+
initialCount: visibleRows,
|
|
299
|
+
overscan: 8,
|
|
300
|
+
scrollTo: highlight && {
|
|
301
|
+
target: { _tag: "Key", key: itemKey(highlight.value) },
|
|
302
|
+
id: `${highlight.id}:${highlight.value}`,
|
|
303
|
+
align: "nearest"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
view: (list) => list.viewport(h.div.class("min-h-0 overflow-auto overscroll-contain")).attr("style", `max-height:${rowHeight * visibleRows}px`).attr("tabindex", "-1").children(list.list(combo.list(h.div)).children(...list.items.map((index) => {
|
|
307
|
+
const entry = entries[index];
|
|
308
|
+
const element = h.div.key(keys[index]);
|
|
309
|
+
if (entry.kind === "group") {
|
|
310
|
+
return list.item({
|
|
311
|
+
element: element.attr("role", "presentation"),
|
|
312
|
+
index
|
|
313
|
+
}).class("text-muted-foreground px-2 pt-3 text-xs").children(entry.label);
|
|
314
|
+
}
|
|
315
|
+
const { value, label } = entry.item;
|
|
316
|
+
return list.item({
|
|
317
|
+
element: element.attr("role", "presentation"),
|
|
318
|
+
index
|
|
319
|
+
}).children(ComboboxItem(h, combo, {
|
|
320
|
+
class: "mx-1 h-full",
|
|
321
|
+
value
|
|
322
|
+
}).attrs({
|
|
323
|
+
"aria-posinset": String(entry.index + 1),
|
|
324
|
+
"aria-setsize": String(combo.items.length)
|
|
325
|
+
}).children(h.span.class(virtualizedComboboxClasses.itemLabel).children(label), ComboboxItemIndicator(h, combo, { value })));
|
|
326
|
+
})))
|
|
327
|
+
}))));
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
// ../../src/components/phone-number-input/classes.ts
|
|
334
|
+
var phoneNumberInputClasses = {
|
|
335
|
+
root: "grid gap-2",
|
|
336
|
+
label: "text-sm font-medium",
|
|
337
|
+
countryPopup: "w-72! max-w-[calc(100vw-2rem)]!",
|
|
338
|
+
numberInput: "min-w-0 flex-1",
|
|
339
|
+
extension: "grid max-w-32 gap-1.5",
|
|
340
|
+
hint: "text-muted-foreground text-xs"
|
|
341
|
+
};
|
|
342
|
+
var resolvePhoneNumberInputClasses = (overrides) => ({
|
|
343
|
+
...phoneNumberInputClasses,
|
|
344
|
+
...overrides
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// ../../src/components/phone-number-input/index.ts
|
|
348
|
+
import {
|
|
349
|
+
AsYouType,
|
|
350
|
+
getCountries as getCountries2,
|
|
351
|
+
getCountryCallingCode as getCountryCallingCode2,
|
|
352
|
+
parsePhoneNumberFromString as parsePhoneNumberFromString2
|
|
353
|
+
} from "libphonenumber-js/max";
|
|
354
|
+
|
|
355
|
+
// ../../src/components/phone-number-input/schema.ts
|
|
356
|
+
import { Schema as Schema3, Struct as Struct2 } from "effect";
|
|
357
|
+
import {
|
|
358
|
+
getCountryCallingCode,
|
|
359
|
+
getCountries,
|
|
360
|
+
parsePhoneNumberFromString
|
|
361
|
+
} from "libphonenumber-js/max";
|
|
362
|
+
var E164DigitsSchema = Schema3.String.check(Schema3.isPattern(/^\d*$/), Schema3.isMaxLength(15)).annotate({ identifier: "E164Digits" });
|
|
363
|
+
var getPhoneNumberDigits = (value, country) => {
|
|
364
|
+
if (!value)
|
|
365
|
+
return "";
|
|
366
|
+
const parsed = parsePhoneNumberFromString(value, {
|
|
367
|
+
defaultCountry: country,
|
|
368
|
+
extract: false
|
|
369
|
+
});
|
|
370
|
+
if (parsed)
|
|
371
|
+
return parsed.number.slice(1);
|
|
372
|
+
const digits = value.replace(/(?:ext\.?|x|#|;ext=)\s*\d+\s*$/i, "").replace(/\D/g, "");
|
|
373
|
+
return value.trimStart().startsWith("+") ? digits : `${getCountryCallingCode(country)}${digits}`;
|
|
374
|
+
};
|
|
375
|
+
var fitsE164DigitLimit = (value, country) => Schema3.is(E164DigitsSchema)(getPhoneNumberDigits(value, country));
|
|
376
|
+
var PhoneCountrySchema = Schema3.Literals(getCountries()).annotate({
|
|
377
|
+
identifier: "PhoneCountry"
|
|
378
|
+
});
|
|
379
|
+
var PhoneNumberInputClassesOverridesSchema = Schema3.Record(Schema3.Literals(Struct2.keys(phoneNumberInputClasses)), Schema3.optionalKey(Schema3.String)).annotate({ identifier: "PhoneNumberInputClassesOverrides" });
|
|
380
|
+
var PhoneNumberInputPropsSchema = Schema3.Struct({
|
|
381
|
+
classes: Schema3.optional(PhoneNumberInputClassesOverridesSchema),
|
|
382
|
+
value: Schema3.String,
|
|
383
|
+
country: PhoneCountrySchema,
|
|
384
|
+
countries: Schema3.optional(Schema3.Array(PhoneCountrySchema)),
|
|
385
|
+
label: Schema3.optional(Schema3.String),
|
|
386
|
+
name: Schema3.optional(Schema3.String),
|
|
387
|
+
id: Schema3.optional(Schema3.String),
|
|
388
|
+
locale: Schema3.optional(Schema3.String),
|
|
389
|
+
disabled: Schema3.optional(Schema3.Boolean),
|
|
390
|
+
readOnly: Schema3.optional(Schema3.Boolean),
|
|
391
|
+
required: Schema3.optional(Schema3.Boolean),
|
|
392
|
+
withExtension: Schema3.optional(Schema3.Boolean),
|
|
393
|
+
placeholder: Schema3.optional(Schema3.String),
|
|
394
|
+
autoComplete: Schema3.optional(Schema3.String),
|
|
395
|
+
className: Schema3.optional(Schema3.String),
|
|
396
|
+
containerClassName: Schema3.optional(Schema3.String),
|
|
397
|
+
contentClassName: Schema3.optional(Schema3.String)
|
|
398
|
+
}).annotate({ identifier: "PhoneNumberInputProps" });
|
|
399
|
+
|
|
400
|
+
// ../../src/components/phone-number-input/index.ts
|
|
401
|
+
var normalizePhoneNumber = (value, country) => {
|
|
402
|
+
const phone = parsePhoneNumberFromString2(value, {
|
|
403
|
+
defaultCountry: country,
|
|
404
|
+
extract: false
|
|
405
|
+
});
|
|
406
|
+
return phone?.isValid() && fitsE164DigitLimit(value, country) ? {
|
|
407
|
+
e164: phone.number,
|
|
408
|
+
extension: phone.ext ?? null,
|
|
409
|
+
country: phone.country ?? null
|
|
410
|
+
} : null;
|
|
411
|
+
};
|
|
412
|
+
var defaultMessages2 = {
|
|
413
|
+
en: {
|
|
414
|
+
label: "Phone number",
|
|
415
|
+
country: "Phone country",
|
|
416
|
+
empty: "No matching countries.",
|
|
417
|
+
extension: "Extension",
|
|
418
|
+
status: "Enter a complete number. Validation does not verify ownership."
|
|
419
|
+
},
|
|
420
|
+
fr: {
|
|
421
|
+
label: "Numéro de téléphone",
|
|
422
|
+
country: "Pays du numéro",
|
|
423
|
+
empty: "Aucun pays correspondant.",
|
|
424
|
+
extension: "Poste",
|
|
425
|
+
status: "Saisissez un numéro complet. La validation ne vérifie pas son propriétaire."
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
var phoneNumberMessages = (locale) => locale.startsWith("fr") ? defaultMessages2.fr : defaultMessages2.en;
|
|
429
|
+
var getPhoneNumberView = ({
|
|
430
|
+
value,
|
|
431
|
+
country,
|
|
432
|
+
countries = getCountries2()
|
|
433
|
+
}, language) => {
|
|
434
|
+
const names = new Intl.DisplayNames([language], { type: "region" });
|
|
435
|
+
const options = [...new Set([country, ...countries])].sort((a, b) => (names.of(a) ?? a).localeCompare(names.of(b) ?? b, language));
|
|
436
|
+
const valid = normalizePhoneNumber(value, country);
|
|
437
|
+
const parsed = parsePhoneNumberFromString2(value, {
|
|
438
|
+
defaultCountry: country,
|
|
439
|
+
extract: false
|
|
440
|
+
});
|
|
441
|
+
const callingCode = value.trim().startsWith("+") ? parsed?.countryCallingCode ?? getCountryCallingCode2(country) : getCountryCallingCode2(country);
|
|
442
|
+
const nationalDraft = value.trim().startsWith(`+${callingCode}`) ? value.trim().slice(callingCode.length + 1).trimStart() : value;
|
|
443
|
+
const extension = parsed?.ext ?? "";
|
|
444
|
+
const nationalDigits = (extension ? nationalDraft.replace(/(?:ext\.?|x|#|;ext=)\s*\d+\s*$/i, "") : nationalDraft).replace(/\D/g, "");
|
|
445
|
+
const formatCountry = parsed?.country ?? country;
|
|
446
|
+
const nationalValue = parsed?.isValid() ? parsed.formatNational({ formatExtension: (number) => number }) : new AsYouType(formatCountry).input(nationalDigits);
|
|
447
|
+
const items = options.map((code) => ({
|
|
448
|
+
value: code,
|
|
449
|
+
label: `${names.of(code)} (${code}) +${getCountryCallingCode2(code)}`
|
|
450
|
+
}));
|
|
451
|
+
return {
|
|
452
|
+
options,
|
|
453
|
+
items,
|
|
454
|
+
valid,
|
|
455
|
+
callingCode,
|
|
456
|
+
extension,
|
|
457
|
+
nationalDigits,
|
|
458
|
+
nationalValue
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
var changeNational = (draft, callingCode, extension, country) => {
|
|
462
|
+
const digits = draft.replace(/\D/g, "");
|
|
463
|
+
const value = digits ? `+${callingCode} ${digits}${extension ? ` ext. ${extension}` : ""}` : "";
|
|
464
|
+
return fitsE164DigitLimit(value, country) ? { value, details: normalizePhoneNumber(value, country) } : undefined;
|
|
465
|
+
};
|
|
466
|
+
var changePhoneDraft = (draft, callingCode, extension, country, options) => {
|
|
467
|
+
const international = draft.trimStart().startsWith("+");
|
|
468
|
+
const pasted = parsePhoneNumberFromString2(draft, {
|
|
469
|
+
defaultCountry: country,
|
|
470
|
+
extract: false
|
|
471
|
+
});
|
|
472
|
+
if (!international && !pasted?.ext) {
|
|
473
|
+
const next = changeNational(draft, callingCode, extension, country);
|
|
474
|
+
return next && { ...next, country, keepCaret: true };
|
|
475
|
+
}
|
|
476
|
+
const digits = draft.replace(/\D/g, "");
|
|
477
|
+
const value = pasted?.isValid() ? `${pasted.number}${pasted.ext ? ` ext. ${pasted.ext}` : ""}` : digits ? `${international ? "+" : `+${callingCode} `}${digits}` : "";
|
|
478
|
+
if (!fitsE164DigitLimit(value, country))
|
|
479
|
+
return;
|
|
480
|
+
const details = normalizePhoneNumber(value, country);
|
|
481
|
+
const nextCountry = international && details?.country && options.includes(details.country) ? details.country : country;
|
|
482
|
+
return { value, details, country: nextCountry, keepCaret: false };
|
|
483
|
+
};
|
|
484
|
+
var formatPhoneOnBlur = (value, country) => parsePhoneNumberFromString2(value, {
|
|
485
|
+
defaultCountry: country,
|
|
486
|
+
extract: false
|
|
487
|
+
})?.formatInternational();
|
|
488
|
+
var phoneDeletion = (value, start, end, key) => {
|
|
489
|
+
if (key !== "Backspace" && key !== "Delete" || start !== end)
|
|
490
|
+
return;
|
|
491
|
+
const direction = key === "Backspace" ? -1 : 1;
|
|
492
|
+
let index = direction === -1 ? start - 1 : start;
|
|
493
|
+
if (index < 0 || index >= value.length || /\d/.test(value[index]))
|
|
494
|
+
return;
|
|
495
|
+
while (index >= 0 && index < value.length && /\D/.test(value[index]))
|
|
496
|
+
index += direction;
|
|
497
|
+
if (index < 0 || index >= value.length)
|
|
498
|
+
return;
|
|
499
|
+
return {
|
|
500
|
+
draft: value.slice(0, index) + value.slice(index + 1),
|
|
501
|
+
digits: value.slice(0, direction === -1 ? index : start).replace(/\D/g, "").length
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
var phoneCaretOffset = (value, digits) => {
|
|
505
|
+
let position = 0;
|
|
506
|
+
while (position < value.length && digits > 0) {
|
|
507
|
+
if (/\d/.test(value[position]))
|
|
508
|
+
digits--;
|
|
509
|
+
position++;
|
|
510
|
+
}
|
|
511
|
+
return position;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
// ../../src/components/phone-number-input/html.ts
|
|
515
|
+
var Input2 = Html2.ref("PhoneNationalInput", "input");
|
|
516
|
+
var Value = Schema4.Redacted(Schema4.String);
|
|
517
|
+
var Details = Schema4.Redacted(Schema4.NullOr(Schema4.Struct({
|
|
518
|
+
e164: Schema4.String,
|
|
519
|
+
extension: Schema4.NullOr(Schema4.String),
|
|
520
|
+
country: Schema4.NullOr(PhoneCountrySchema)
|
|
521
|
+
})));
|
|
522
|
+
var Message = UiSchema2.TaggedEnum({
|
|
523
|
+
Changed: {
|
|
524
|
+
value: Value,
|
|
525
|
+
details: Details,
|
|
526
|
+
country: PhoneCountrySchema,
|
|
527
|
+
caret: Schema4.optional(Schema4.Int)
|
|
528
|
+
},
|
|
529
|
+
Ignored: {}
|
|
530
|
+
});
|
|
531
|
+
var Events = UiSchema2.TaggedEnum({
|
|
532
|
+
ValueChanged: { value: Value, details: Details, country: PhoneCountrySchema }
|
|
533
|
+
});
|
|
534
|
+
var options = {
|
|
535
|
+
name: "PhoneNumberInput",
|
|
536
|
+
props: PhoneNumberInputPropsSchema,
|
|
537
|
+
model: Schema4.Null,
|
|
538
|
+
message: Message,
|
|
539
|
+
events: Events,
|
|
540
|
+
restore: false
|
|
541
|
+
};
|
|
542
|
+
var PhoneNumberInput = Html2.component({
|
|
543
|
+
...options,
|
|
544
|
+
reads: { localeConfig: krakstackLocaleRead2 }
|
|
545
|
+
}).make({
|
|
546
|
+
init: () => null,
|
|
547
|
+
update: Component2.define(options).update({
|
|
548
|
+
Changed: ($, { value, details, country, caret }) => {
|
|
549
|
+
if ($.props.disabled || $.props.readOnly)
|
|
550
|
+
return null;
|
|
551
|
+
const next = $.set(null).emit(Events.ValueChanged({ value, details, country }));
|
|
552
|
+
if (caret === undefined)
|
|
553
|
+
return next;
|
|
554
|
+
const { nationalValue } = getPhoneNumberView({ value: Redacted.value(value), country, countries: [country] }, "en");
|
|
555
|
+
const position = phoneCaretOffset(nationalValue, caret);
|
|
556
|
+
return next.run(HtmlCommand.select(Input2, () => Message.Ignored(), { start: position }));
|
|
557
|
+
},
|
|
558
|
+
Ignored: () => null
|
|
559
|
+
}),
|
|
560
|
+
view: (h) => {
|
|
561
|
+
const phoneNumberInputClasses = resolvePhoneNumberInputClasses(h.props.classes);
|
|
562
|
+
const p = h.props;
|
|
563
|
+
const locale = p.locale ?? h.reads.localeConfig?.locale ?? "en";
|
|
564
|
+
const copy = phoneNumberMessages(locale);
|
|
565
|
+
const {
|
|
566
|
+
options,
|
|
567
|
+
items,
|
|
568
|
+
valid,
|
|
569
|
+
callingCode,
|
|
570
|
+
extension,
|
|
571
|
+
nationalDigits,
|
|
572
|
+
nationalValue
|
|
573
|
+
} = getPhoneNumberView(p, locale);
|
|
574
|
+
const id = p.id ?? h.id("number");
|
|
575
|
+
const statusId = h.id("status");
|
|
576
|
+
const request = (next, country = p.country, caret) => next && Message.Changed({
|
|
577
|
+
value: Redacted.make(next.value),
|
|
578
|
+
details: Redacted.make(next.details),
|
|
579
|
+
country,
|
|
580
|
+
caret
|
|
581
|
+
});
|
|
582
|
+
return h.div.attr("data-slot", "phone-number-input").class(cn(phoneNumberInputClasses.root, p.containerClassName)).children(h.label.attr("for", id).class(phoneNumberInputClasses.label).children(p.label ?? copy.label), p.name && h.input.attrs({ type: "hidden", name: p.name }).disabled(p.disabled ?? false).value(p.value), h.div.class("flex min-w-0 items-start gap-2 [&>div:first-child_button]:pr-3 [&>div:first-child_button+button]:hidden").children(VirtualizedCombobox(h, {
|
|
583
|
+
props: {
|
|
584
|
+
ariaLabel: copy.country,
|
|
585
|
+
locale,
|
|
586
|
+
items,
|
|
587
|
+
value: items.find(({ value }) => value === p.country) ?? null,
|
|
588
|
+
triggerLabel: `${p.country} +${callingCode}`,
|
|
589
|
+
disabled: Boolean(p.disabled || p.readOnly),
|
|
590
|
+
placeholder: p.country,
|
|
591
|
+
emptyLabel: copy.empty,
|
|
592
|
+
contentClassName: cn(phoneNumberInputClasses.countryPopup, p.contentClassName)
|
|
593
|
+
},
|
|
594
|
+
onEmit: (event) => {
|
|
595
|
+
if (event._tag !== "ValueChanged")
|
|
596
|
+
return;
|
|
597
|
+
const { value } = event;
|
|
598
|
+
const selected = options.find((option) => option === value);
|
|
599
|
+
return selected && selected !== p.country ? request(changeNational(nationalDigits, getCountryCallingCode3(selected), extension, selected), selected) : undefined;
|
|
600
|
+
}
|
|
601
|
+
}), Input(h, {
|
|
602
|
+
props: { value: nationalValue, disabled: p.disabled },
|
|
603
|
+
class: cn(phoneNumberInputClasses.numberInput, p.className)
|
|
604
|
+
}).ref(Input2).attrs({
|
|
605
|
+
id,
|
|
606
|
+
type: "tel",
|
|
607
|
+
inputmode: "numeric",
|
|
608
|
+
autocomplete: p.autoComplete ?? "tel-national",
|
|
609
|
+
readonly: p.readOnly ? "" : undefined,
|
|
610
|
+
required: p.required ? "" : undefined,
|
|
611
|
+
placeholder: p.placeholder,
|
|
612
|
+
"aria-invalid": p.value && !valid ? "true" : undefined,
|
|
613
|
+
"aria-describedby": statusId,
|
|
614
|
+
"data-component": "phone-number-national"
|
|
615
|
+
}).on("input", ({ value, selectionStart, composing }) => {
|
|
616
|
+
if (composing)
|
|
617
|
+
return;
|
|
618
|
+
const next = changePhoneDraft(value, callingCode, extension, p.country, options);
|
|
619
|
+
return next ? request(next, next.country, next.keepCaret ? value.slice(0, selectionStart ?? value.length).replace(/\D/g, "").length : undefined) : Message.Ignored();
|
|
620
|
+
}).on("keydown", ({
|
|
621
|
+
key,
|
|
622
|
+
selectionStart,
|
|
623
|
+
selectionEnd,
|
|
624
|
+
ctrl,
|
|
625
|
+
meta,
|
|
626
|
+
alt,
|
|
627
|
+
composing
|
|
628
|
+
}) => {
|
|
629
|
+
if (ctrl || meta || alt || composing || p.disabled || p.readOnly)
|
|
630
|
+
return;
|
|
631
|
+
if (key.length === 1 && /\D/.test(key))
|
|
632
|
+
return Message.Ignored();
|
|
633
|
+
const next = phoneDeletion(nationalValue, selectionStart ?? 0, selectionEnd, key);
|
|
634
|
+
return next ? request(changeNational(next.draft, callingCode, extension, p.country), p.country, next.digits) : undefined;
|
|
635
|
+
}, { preventDefault: true }).on("blur", () => {
|
|
636
|
+
const value = valid && formatPhoneOnBlur(p.value, p.country);
|
|
637
|
+
return value && value !== p.value ? request({
|
|
638
|
+
value,
|
|
639
|
+
details: normalizePhoneNumber(value, p.country)
|
|
640
|
+
}) : undefined;
|
|
641
|
+
})), (p.withExtension || extension) && h.div.class(phoneNumberInputClasses.extension).attr("data-slot", "phone-number-extension").children(h.label.attr("for", h.id("extension")).class(phoneNumberInputClasses.hint).children(copy.extension), Input(h, {
|
|
642
|
+
props: { value: extension, disabled: p.disabled },
|
|
643
|
+
onUpdate: ({ value }) => request(changeNational(nationalDigits, callingCode, value.replace(/\D/g, ""), p.country))
|
|
644
|
+
}).attrs({
|
|
645
|
+
id: h.id("extension"),
|
|
646
|
+
type: "text",
|
|
647
|
+
inputmode: "numeric",
|
|
648
|
+
readonly: p.readOnly ? "" : undefined
|
|
649
|
+
})), h.p.attrs({ id: statusId, "data-slot": "phone-number-status" }).class(phoneNumberInputClasses.hint).children(valid ? `${valid.e164}${valid.extension ? ` ext. ${valid.extension}` : ""}` : copy.status));
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
export {
|
|
653
|
+
PhoneNumberInput,
|
|
654
|
+
normalizePhoneNumber
|
|
655
|
+
};
|