@tempots/beatui 0.82.1 → 0.83.0
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/ar-CBrjAlIY.cjs +1 -0
- package/dist/ar-DjMvIww5.js +175 -0
- package/dist/{ar-NCCPhOpI.js → ar-DwDxAANU.js} +16 -1
- package/dist/ar-kZBzg02I.cjs +1 -0
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +33 -32
- package/dist/{auth-divider-Wr-S16kF.js → auth-divider-C3_CgC0l.js} +589 -569
- package/dist/auth-divider-C4WTL71M.cjs +1 -0
- package/dist/beatui.css +5678 -1438
- package/dist/beatui.tailwind.css +5662 -1422
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +18 -31
- package/dist/{colors-B2yrgHSW.cjs → colors-BI0YhONJ.cjs} +1 -1
- package/dist/{colors-DPo9GEJR.js → colors-BmLYKmoH.js} +38 -30
- package/dist/de-B03SM9eF.cjs +1 -0
- package/dist/{de-BVK2MkCk.js → de-CSGSC0xX.js} +18 -3
- package/dist/de-CrBw41po.cjs +1 -0
- package/dist/{de-f2xcEb34.js → de-wChFYqM4.js} +79 -5
- package/dist/deep-merge-CmQoIYPC.js +1689 -0
- package/dist/deep-merge-UghuPcyW.cjs +1 -0
- package/dist/{duration-input-B9UNmUCh.cjs → duration-input-BJzKgI15.cjs} +1 -1
- package/dist/{duration-input-DqcJbxKD.js → duration-input-DaB6s0rL.js} +4 -4
- package/dist/editor-toolbar-group-BslfdazC.js +32 -0
- package/dist/editor-toolbar-group-_V1rDM-1.cjs +1 -0
- package/dist/{es-BxBeTRCv.cjs → es-BRa0hV-7.cjs} +1 -1
- package/dist/es-Ca5xT3NE.cjs +1 -0
- package/dist/es-CmPF3IGl.js +175 -0
- package/dist/{es-BQS8PL9j.js → es-dR46FTMF.js} +16 -1
- package/dist/{fa-DxPseW3g.cjs → fa-BxCSKn9j.cjs} +1 -1
- package/dist/fa-D696e75R.js +175 -0
- package/dist/fa-DhZJYuC6.cjs +1 -0
- package/dist/{fa-T-tkJSJr.js → fa-FsHBFjdY.js} +16 -1
- package/dist/fr-1nSKSIlw.cjs +1 -0
- package/dist/{fr-yOW_68YY.js → fr-B0jeX1Hx.js} +83 -9
- package/dist/{fr-CSRRhyCG.js → fr-Di6BT9_V.js} +18 -3
- package/dist/fr-Dq6RAY9s.cjs +1 -0
- package/dist/he-BBX1h9uD.cjs +1 -0
- package/dist/{he-Bxdc4M08.js → he-CXujw1Lw.js} +16 -1
- package/dist/he-DhcurPt5.cjs +1 -0
- package/dist/he-SgAsIYJA.js +175 -0
- package/dist/{hi-CJeFvTBe.js → hi-Bvh4d9bO.js} +16 -1
- package/dist/hi-Cd0YQZTU.cjs +1 -0
- package/dist/hi-CxsIxbfM.cjs +1 -0
- package/dist/hi-s9oiIihq.js +175 -0
- package/dist/{index-Bt7FYl80.cjs → index-Bm43lZqE.cjs} +2 -2
- package/dist/{index-05UbKOYe.cjs → index-C2_iX1um.cjs} +1 -1
- package/dist/{index-C2Lq1m45.js → index-C32iUFIr.js} +5 -5
- package/dist/{index-lYhXnu6I.js → index-CEqc0H3v.js} +1 -1
- package/dist/index-DH37GTQj.cjs +1 -0
- package/dist/{index-DklKfzD4.js → index-Di1_W_7Q.js} +351 -361
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6220 -3084
- package/dist/input-container-CSi72GI1.cjs +1 -0
- package/dist/{input-container-DiCjOzR2.js → input-container-Nx0gMAzS.js} +86 -75
- package/dist/it-ByIEk5Cq.cjs +1 -0
- package/dist/it-D_IcaYxp.cjs +1 -0
- package/dist/{it-6e6X-4BB.js → it-Dc4IMciD.js} +80 -6
- package/dist/{it-Zmp0BhIj.js → it-EWhykhHv.js} +18 -3
- package/dist/ja-CMGqpPo7.cjs +1 -0
- package/dist/{ja-BxNuNo2H.js → ja-D2t2g5xj.js} +85 -11
- package/dist/ja-DV6Fpp18.cjs +1 -0
- package/dist/{ja-DWjoA-hQ.js → ja-YZ0P5woj.js} +16 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +191 -185
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +679 -660
- package/dist/ko-BPl5rP97.cjs +1 -0
- package/dist/ko-BRylA5JZ.js +175 -0
- package/dist/ko-DR1f0as8.cjs +1 -0
- package/dist/{ko-BOlI-33h.js → ko-U7BSUAxZ.js} +16 -1
- package/dist/lexical/index.cjs.js +31 -31
- package/dist/lexical/index.es.js +5248 -5221
- package/dist/lexical.css +5 -7
- package/dist/menu-CX72LaZ3.cjs +1 -0
- package/dist/menu-D_slbwl8.js +374 -0
- package/dist/{modal-v3u2Fpnd.js → modal-DaI1jH-X.js} +4 -4
- package/dist/{modal-I5srcntN.cjs → modal-kyZfvVZb.cjs} +1 -1
- package/dist/nl-BSfaHFt0.cjs +1 -0
- package/dist/{nl-Dr-l6zUy.cjs → nl-CQF0N7Mc.cjs} +1 -1
- package/dist/{nl-kQNcAdY1.js → nl-CqAxoB4J.js} +18 -3
- package/dist/nl-Dh7LUWAn.js +176 -0
- package/dist/{notice-CLDdy1MW.cjs → notice-Bc1L4Zpr.cjs} +1 -1
- package/dist/{notice-BuZvdvZh.js → notice-Dz4nX57_.js} +4 -4
- package/dist/{oneof-branch-detection-Dt8ss9lc.js → oneof-branch-detection-BED_n2MT.js} +522 -519
- package/dist/{oneof-branch-detection-DsM1K5xc.cjs → oneof-branch-detection-Vov_e3kI.cjs} +4 -4
- package/dist/{pl-CKyPFvss.js → pl-C-weXGCB.js} +16 -1
- package/dist/pl-D-O4sCnr.cjs +1 -0
- package/dist/{pl-Bs4nLJ__.js → pl-XEG-p1Q9.js} +77 -3
- package/dist/{pl-BK0i_yvq.cjs → pl-y_w3DWF3.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-DBmUhaNI.js → pt-BjNGOoZH.js} +18 -3
- package/dist/pt-DYsDA2sZ.js +175 -0
- package/dist/pt-DqaZWmbG.cjs +1 -0
- package/dist/pt-chEEYLlt.cjs +1 -0
- package/dist/ru-B46hVpFF.cjs +1 -0
- package/dist/{ru-Bi1_DEKM.js → ru-BTKBykp-.js} +86 -12
- package/dist/{ru-CsJ_yT-7.js → ru-CFmeZBXK.js} +16 -1
- package/dist/ru-CISMzCHR.cjs +1 -0
- package/dist/{styles-url-B2dzXrYt.cjs → styles-url-CVCcF0ra.cjs} +1 -1
- package/dist/{styles-url-Cw_mxshe.js → styles-url-DUdp56Ts.js} +1 -1
- package/dist/tailwind/index.cjs.js +1 -1
- package/dist/tailwind/index.es.js +3 -3
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +74 -4
- package/dist/tailwind/vite-plugin.cjs.js +10 -10
- package/dist/tailwind/vite-plugin.es.js +289 -410
- package/dist/text-input-8v79fzEy.cjs +1 -0
- package/dist/text-input-CPJzUC2r.js +45 -0
- package/dist/{toolbar-D994_E_s.js → toolbar-CjQG7l7X.js} +1 -1
- package/dist/{toolbar-x0_8lmKu.cjs → toolbar-D3ZsC0g_.cjs} +1 -1
- package/dist/{tr-Bn5ldVJs.js → tr-C5X2gFZS.js} +17 -2
- package/dist/tr-CaMaflJL.cjs +1 -0
- package/dist/{tr-DiYB-FwX.js → tr-Cp8ZCUic.js} +77 -3
- package/dist/{tr-CgJ8uhZu.cjs → tr-mWu2E__o.cjs} +1 -1
- package/dist/{translations-Cq8bUKJP.js → translations-BGblCUBj.js} +144 -70
- package/dist/translations-CZ0KOii3.cjs +1 -0
- package/dist/translations-gVgMyNno.cjs +1 -0
- package/dist/translations-jUYta1_1.js +87 -0
- package/dist/types/auth/index.d.ts +13 -0
- package/dist/types/auth-i18n/default.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ar.d.ts +14 -0
- package/dist/types/auth-i18n/locales/de.d.ts +14 -0
- package/dist/types/auth-i18n/locales/en.d.ts +14 -0
- package/dist/types/auth-i18n/locales/es.d.ts +14 -0
- package/dist/types/auth-i18n/locales/fa.d.ts +14 -0
- package/dist/types/auth-i18n/locales/fr.d.ts +14 -0
- package/dist/types/auth-i18n/locales/he.d.ts +14 -0
- package/dist/types/auth-i18n/locales/hi.d.ts +14 -0
- package/dist/types/auth-i18n/locales/it.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ja.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ko.d.ts +14 -0
- package/dist/types/auth-i18n/locales/nl.d.ts +14 -0
- package/dist/types/auth-i18n/locales/pl.d.ts +14 -0
- package/dist/types/auth-i18n/locales/pt.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ru.d.ts +14 -0
- package/dist/types/auth-i18n/locales/tr.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ur.d.ts +14 -0
- package/dist/types/auth-i18n/locales/vi.d.ts +14 -0
- package/dist/types/auth-i18n/locales/zh.d.ts +14 -0
- package/dist/types/auth-i18n/translations.d.ts +14 -0
- package/dist/types/beatui-i18n/default.d.ts +99 -0
- package/dist/types/beatui-i18n/index.d.ts +11 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +63 -0
- package/dist/types/beatui-i18n/translations.d.ts +87 -0
- package/dist/types/better-auth/components/authenticated.d.ts +2 -2
- package/dist/types/better-auth/components/better-auth-container.d.ts +1 -1
- package/dist/types/better-auth/components/better-auth-modal.d.ts +1 -1
- package/dist/types/better-auth/index.d.ts +13 -0
- package/dist/types/better-auth/provider.d.ts +33 -0
- package/dist/types/better-auth/types.d.ts +112 -0
- package/dist/types/components/auth/auth-container.d.ts +63 -2
- package/dist/types/components/auth/auth-divider.d.ts +30 -0
- package/dist/types/components/auth/auth-email-prop.d.ts +25 -0
- package/dist/types/components/auth/index.d.ts +9 -0
- package/dist/types/components/auth/password-strength-indicator.d.ts +58 -0
- package/dist/types/components/auth/reset-password-form.d.ts +33 -0
- package/dist/types/components/auth/schemas.d.ts +183 -5
- package/dist/types/components/auth/signin-form.d.ts +33 -0
- package/dist/types/components/auth/signup-form.d.ts +36 -0
- package/dist/types/components/auth/social-login-button.d.ts +213 -0
- package/dist/types/components/auth/social-providers.d.ts +27 -1
- package/dist/types/components/auth/types.d.ts +299 -0
- package/dist/types/components/auth/utils.d.ts +198 -0
- package/dist/types/components/beatui.d.ts +35 -0
- package/dist/types/components/button/button.d.ts +61 -0
- package/dist/types/components/button/close-button.d.ts +32 -1
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/button/toggle-button-group.d.ts +95 -0
- package/dist/types/components/button/toggle-button.d.ts +60 -0
- package/dist/types/components/data/avatar-group.d.ts +74 -0
- package/dist/types/components/data/avatar.d.ts +62 -0
- package/dist/types/components/data/badge.d.ts +49 -2
- package/dist/types/components/data/calendar-shared.d.ts +59 -0
- package/dist/types/components/data/calendar.d.ts +107 -0
- package/dist/types/components/data/history-timeline.d.ts +35 -0
- package/dist/types/components/data/icon-badge.d.ts +14 -0
- package/dist/types/components/data/icon.d.ts +55 -4
- package/dist/types/components/data/index.d.ts +9 -0
- package/dist/types/components/data/page-drop-zone.d.ts +61 -8
- package/dist/types/components/data/presence-overlay.d.ts +26 -0
- package/dist/types/components/data/progress-bar.d.ts +81 -0
- package/dist/types/components/data/range-calendar.d.ts +104 -0
- package/dist/types/components/data/skeleton.d.ts +70 -0
- package/dist/types/components/data/table.d.ts +38 -11
- package/dist/types/components/data/tag.d.ts +40 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +73 -0
- package/dist/types/components/form/control/control.d.ts +155 -0
- package/dist/types/components/form/control/date-utils.d.ts +81 -0
- package/dist/types/components/form/control/ensure-control.d.ts +28 -0
- package/dist/types/components/form/control/form-status.d.ts +63 -0
- package/dist/types/components/form/control/index.d.ts +10 -0
- package/dist/types/components/form/control/list-control.d.ts +100 -1
- package/dist/types/components/form/control/list-item-controls.d.ts +65 -0
- package/dist/types/components/form/controller/color-controller.d.ts +29 -1
- package/dist/types/components/form/controller/controller-validation.d.ts +31 -0
- package/dist/types/components/form/controller/controller.d.ts +286 -0
- package/dist/types/components/form/controller/index.d.ts +12 -0
- package/dist/types/components/form/controller/path.d.ts +69 -0
- package/dist/types/components/form/controller/union-controller.d.ts +106 -11
- package/dist/types/components/form/controller/utils.d.ts +67 -0
- package/dist/types/components/form/input/advanced-slider.d.ts +143 -0
- package/dist/types/components/form/input/appearance-selector.d.ts +39 -0
- package/dist/types/components/form/input/base64-input.d.ts +34 -0
- package/dist/types/components/form/input/base64s-input.d.ts +47 -0
- package/dist/types/components/form/input/bigint-input.d.ts +27 -0
- package/dist/types/components/form/input/checkbox-input.d.ts +46 -0
- package/dist/types/components/form/input/color-input.d.ts +42 -0
- package/dist/types/components/form/input/color-swatch-input.d.ts +53 -0
- package/dist/types/components/form/input/combobox-input.d.ts +73 -0
- package/dist/types/components/form/input/combobox-tags-input.d.ts +54 -0
- package/dist/types/components/form/input/date-input.d.ts +33 -0
- package/dist/types/components/form/input/date-time-input.d.ts +34 -0
- package/dist/types/components/form/input/dropdown-base.d.ts +52 -0
- package/dist/types/components/form/input/dropdown-input.d.ts +86 -0
- package/dist/types/components/form/input/duration-input.d.ts +18 -0
- package/dist/types/components/form/input/duration-mask.d.ts +24 -0
- package/dist/types/components/form/input/editable-text.d.ts +33 -0
- package/dist/types/components/form/input/email-input.d.ts +34 -0
- package/dist/types/components/form/input/file-input.d.ts +33 -0
- package/dist/types/components/form/input/files-input.d.ts +44 -0
- package/dist/types/components/form/input/index.d.ts +5 -0
- package/dist/types/components/form/input/input-adornment.d.ts +38 -0
- package/dist/types/components/form/input/input-container.d.ts +65 -0
- package/dist/types/components/form/input/input-options.d.ts +70 -0
- package/dist/types/components/form/input/input-wrapper.d.ts +78 -0
- package/dist/types/components/form/input/instant-input.d.ts +18 -0
- package/dist/types/components/form/input/lazy-native-select.d.ts +43 -0
- package/dist/types/components/form/input/list-input.d.ts +50 -0
- package/dist/types/components/form/input/mask-input.d.ts +158 -0
- package/dist/types/components/form/input/native-select.d.ts +50 -0
- package/dist/types/components/form/input/nullable-base64-input.d.ts +25 -0
- package/dist/types/components/form/input/nullable-bigint-input.d.ts +26 -0
- package/dist/types/components/form/input/nullable-date-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-date-time-input.d.ts +19 -0
- package/dist/types/components/form/input/nullable-duration-input.d.ts +19 -0
- package/dist/types/components/form/input/nullable-email-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-instant-input.d.ts +19 -0
- package/dist/types/components/form/input/nullable-mask-input.d.ts +24 -0
- package/dist/types/components/form/input/nullable-number-input.d.ts +29 -0
- package/dist/types/components/form/input/nullable-password-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-month-day-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-rating-input.d.ts +33 -0
- package/dist/types/components/form/input/nullable-text-area.d.ts +27 -0
- package/dist/types/components/form/input/nullable-text-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-url-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-utils.d.ts +22 -2
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-zoned-date-time-input.d.ts +20 -0
- package/dist/types/components/form/input/number-input.d.ts +49 -0
- package/dist/types/components/form/input/option.d.ts +165 -0
- package/dist/types/components/form/input/otp-input.d.ts +77 -0
- package/dist/types/components/form/input/password-input.d.ts +39 -0
- package/dist/types/components/form/input/plain-date-input.d.ts +17 -0
- package/dist/types/components/form/input/plain-date-time-input.d.ts +17 -0
- package/dist/types/components/form/input/plain-month-day-input.d.ts +18 -0
- package/dist/types/components/form/input/plain-time-input.d.ts +17 -0
- package/dist/types/components/form/input/plain-year-month-input.d.ts +17 -0
- package/dist/types/components/form/input/radio-group.d.ts +108 -0
- package/dist/types/components/form/input/rating-input.d.ts +57 -0
- package/dist/types/components/form/input/segmented-input.d.ts +70 -1
- package/dist/types/components/form/input/select-tags-input.d.ts +69 -0
- package/dist/types/components/form/input/slider-input.d.ts +82 -0
- package/dist/types/components/form/input/switch.d.ts +59 -1
- package/dist/types/components/form/input/tag-input.d.ts +19 -0
- package/dist/types/components/form/input/tag-utils.d.ts +111 -0
- package/dist/types/components/form/input/tags-input.d.ts +18 -0
- package/dist/types/components/form/input/text-area.d.ts +42 -0
- package/dist/types/components/form/input/text-input.d.ts +63 -1
- package/dist/types/components/form/input/url-input.d.ts +34 -0
- package/dist/types/components/form/input/uuid-input.d.ts +19 -0
- package/dist/types/components/form/input/zoned-date-time-input.d.ts +20 -0
- package/dist/types/components/form/schema/standard-schema-v1.d.ts +98 -23
- package/dist/types/components/form/use-form.d.ts +146 -2
- package/dist/types/components/i18n/index.d.ts +9 -0
- package/dist/types/components/i18n/locale-direction.d.ts +21 -1
- package/dist/types/components/i18n/locale-selector.d.ts +45 -0
- package/dist/types/components/i18n/make-i18nprovider.d.ts +42 -0
- package/dist/types/components/json-schema/schema-types.d.ts +133 -0
- package/dist/types/components/json-structure/controls/deprecation-utils.d.ts +2 -3
- package/dist/types/components/json-structure/structure-types.d.ts +473 -19
- package/dist/types/components/layout/accordion.d.ts +77 -0
- package/dist/types/components/layout/action-card.d.ts +90 -2
- package/dist/types/components/layout/app-shell.d.ts +76 -0
- package/dist/types/components/layout/card.d.ts +27 -0
- package/dist/types/components/layout/center.d.ts +39 -0
- package/dist/types/components/layout/collapse.d.ts +28 -0
- package/dist/types/components/layout/divider.d.ts +84 -0
- package/dist/types/components/layout/group.d.ts +15 -0
- package/dist/types/components/layout/index.d.ts +2 -0
- package/dist/types/components/layout/nine-slice-scroll-view.d.ts +105 -0
- package/dist/types/components/layout/scrollable-panel.d.ts +54 -0
- package/dist/types/components/layout/sink.d.ts +46 -0
- package/dist/types/components/layout/stack.d.ts +16 -0
- package/dist/types/components/layout/with-breakpoint.d.ts +194 -0
- package/dist/types/components/lexical/code/language-selector.d.ts +2 -2
- package/dist/types/components/lexical/floating/block-handle.d.ts +2 -2
- package/dist/types/components/lexical/floating/floating-toolbar.d.ts +2 -2
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/lexical/table/table-controls.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +4 -2
- package/dist/types/components/misc/empty-state.d.ts +86 -0
- package/dist/types/components/misc/expando.d.ts +81 -0
- package/dist/types/components/misc/index.d.ts +2 -1
- package/dist/types/components/misc/link-portal.d.ts +40 -2
- package/dist/types/components/misc/notice.d.ts +93 -0
- package/dist/types/components/misc/notification-panel.d.ts +21 -0
- package/dist/types/components/misc/notification-provider.d.ts +141 -0
- package/dist/types/components/misc/notification.d.ts +93 -0
- package/dist/types/components/misc/style-portal.d.ts +31 -1
- package/dist/types/components/monaco/monaco-editor-input.d.ts +59 -2
- package/dist/types/components/navigation/breadcrumbs.d.ts +96 -0
- package/dist/types/components/navigation/flyout.d.ts +118 -16
- package/dist/types/components/navigation/index.d.ts +3 -0
- package/dist/types/components/navigation/link/link.d.ts +100 -0
- package/dist/types/components/navigation/menu.d.ts +155 -35
- package/dist/types/components/navigation/pagination.d.ts +82 -0
- package/dist/types/components/navigation/sidebar/sidebar-group.d.ts +42 -0
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +101 -0
- package/dist/types/components/navigation/sidebar/sidebar-separator.d.ts +17 -0
- package/dist/types/components/navigation/sidebar/sidebar.d.ts +57 -0
- package/dist/types/components/navigation/tabs/tabs.d.ts +3 -2
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +125 -0
- package/dist/types/components/navigation/tree-view.d.ts +95 -0
- package/dist/types/components/overlay/announcement-bar.d.ts +41 -2
- package/dist/types/components/overlay/block-command-palette.d.ts +25 -0
- package/dist/types/components/overlay/command-palette.d.ts +17 -0
- package/dist/types/components/overlay/dialogs.d.ts +213 -0
- package/dist/types/components/overlay/drawer.d.ts +76 -12
- package/dist/types/components/overlay/index.d.ts +4 -0
- package/dist/types/components/overlay/lightbox.d.ts +53 -10
- package/dist/types/components/overlay/modal.d.ts +113 -13
- package/dist/types/components/overlay/overlay.d.ts +61 -0
- package/dist/types/components/overlay/popover.d.ts +100 -0
- package/dist/types/components/overlay/ribbon.d.ts +58 -9
- package/dist/types/components/prosemirror/etoolbar-button.d.ts +10 -0
- package/dist/types/components/prosemirror/etoolbar-group.d.ts +10 -0
- package/dist/types/components/prosemirror/link-control.d.ts +43 -2
- package/dist/types/components/prosemirror/prosemirror-toolbar.d.ts +46 -6
- package/dist/types/components/prosemirror/utils.d.ts +113 -1
- package/dist/types/components/theme/style-utils.d.ts +95 -0
- package/dist/types/components/theme/theme.d.ts +39 -0
- package/dist/types/components/theme/types.d.ts +133 -1
- package/dist/types/components/typography/index.d.ts +1 -0
- package/dist/types/components/typography/kbd.d.ts +48 -0
- package/dist/types/components/typography/label.d.ts +45 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/json-schema/index.d.ts +13 -0
- package/dist/types/json-schema-display/index.d.ts +12 -0
- package/dist/types/json-structure/index.d.ts +9 -4
- package/dist/types/markdown/index.d.ts +13 -0
- package/dist/types/monaco/index.d.ts +17 -0
- package/dist/types/monaco/lazy-loader.d.ts +79 -0
- package/dist/types/monaco/styles-url.d.ts +11 -0
- package/dist/types/monaco/styles.d.ts +11 -0
- package/dist/types/monaco/types.d.ts +47 -0
- package/dist/types/prosemirror/index.d.ts +12 -0
- package/dist/types/prosemirror/styles-url.d.ts +11 -0
- package/dist/types/prosemirror/styles.d.ts +10 -0
- package/dist/types/tailwind/google-fonts.d.ts +15 -0
- package/dist/types/tailwind/index.d.ts +13 -0
- package/dist/types/tailwind/preset.d.ts +111 -0
- package/dist/types/tailwind/vite-plugin.d.ts +39 -4
- package/dist/types/tokens/base-colors.d.ts +21 -0
- package/dist/types/tokens/breakpoints.d.ts +67 -0
- package/dist/types/tokens/colors.d.ts +213 -4
- package/dist/types/tokens/motion.d.ts +142 -3
- package/dist/types/tokens/radius.d.ts +99 -0
- package/dist/types/tokens/shadows.d.ts +85 -0
- package/dist/types/tokens/spacing.d.ts +111 -0
- package/dist/types/tokens/text-shadows.d.ts +82 -0
- package/dist/types/tokens/typography.d.ts +313 -25
- package/dist/types/tokens/z-index.d.ts +62 -0
- package/dist/types/utils/color.d.ts +297 -28
- package/dist/types/utils/download.d.ts +92 -0
- package/dist/types/utils/focus-trap.d.ts +67 -11
- package/dist/types/utils/format-file-size.d.ts +44 -0
- package/dist/ur-B6yB2JQ7.cjs +1 -0
- package/dist/ur-CvGP14xo.cjs +1 -0
- package/dist/{ur-Bg9eX81v.js → ur-Deo004ME.js} +16 -1
- package/dist/{ur-B69X-xNs.js → ur-DkIYJxsF.js} +82 -8
- package/dist/use-animated-toggle-89fKlXxy.js +195 -0
- package/dist/use-animated-toggle-DrqK7nUS.cjs +1 -0
- package/dist/{use-form-B56E_x5Y.js → use-form-BurzbPVV.js} +190 -2
- package/dist/{use-form-Cnp3XQ5X.cjs → use-form-Uree6QFy.cjs} +1 -1
- package/dist/vi-BYk1rJDv.js +53 -0
- package/dist/vi-DKw6PBja.js +175 -0
- package/dist/vi-Df4WZe9y.cjs +1 -0
- package/dist/vi-DneuUbkq.cjs +1 -0
- package/dist/{widget-customization-Ds9sicAg.js → widget-customization-0is7oTeP.js} +205 -204
- package/dist/widget-customization-B-LmxkPE.cjs +1 -0
- package/dist/zh-C5a9NGFW.cjs +1 -0
- package/dist/zh-CaKHseXJ.js +175 -0
- package/dist/zh-DFHuW_5g.cjs +1 -0
- package/dist/{zh-BIykcEu9.js → zh-DR7QaM65.js} +16 -1
- package/package.json +1 -1
- package/dist/ar-BsUm-TCn.cjs +0 -1
- package/dist/ar-D7CXDmVZ.cjs +0 -1
- package/dist/ar-nOSKXpIW.js +0 -101
- package/dist/auth-divider-BqZPH1-z.cjs +0 -1
- package/dist/de-BUFLEyKr.cjs +0 -1
- package/dist/de-WzsOu9Gn.cjs +0 -1
- package/dist/deep-merge-BYm0y62g.js +0 -1620
- package/dist/deep-merge-d7sf0xmN.cjs +0 -1
- package/dist/editor-toolbar-group--a-xgsJw.cjs +0 -1
- package/dist/editor-toolbar-group-CVpl5mxF.js +0 -31
- package/dist/es-CDqqzpCw.js +0 -101
- package/dist/es-Ds2Xf3wV.cjs +0 -1
- package/dist/fa-C7tE_hR3.js +0 -101
- package/dist/fa-Ct1UtDB7.cjs +0 -1
- package/dist/fr-Cdyopuz3.cjs +0 -1
- package/dist/fr-CzAkRFed.cjs +0 -1
- package/dist/he-D2oUloCJ.js +0 -101
- package/dist/he-DarDNPn0.cjs +0 -1
- package/dist/he-DlXALrK7.cjs +0 -1
- package/dist/hi-3dBhLwDs.cjs +0 -1
- package/dist/hi-D5ZlZoQq.js +0 -101
- package/dist/hi-tATwsXJ6.cjs +0 -1
- package/dist/index-DE2tjivA.cjs +0 -1
- package/dist/input-container-C6qEIjcA.cjs +0 -1
- package/dist/it-BmFag7j0.cjs +0 -1
- package/dist/it-DohtcWi9.cjs +0 -1
- package/dist/ja-Dj-bAKLf.cjs +0 -1
- package/dist/ja-eyTArrgS.cjs +0 -1
- package/dist/ko-BFLCDMMs.cjs +0 -1
- package/dist/ko-BomUE-yQ.cjs +0 -1
- package/dist/ko-Ch0jFsBV.js +0 -101
- package/dist/menu-CZzRsQP_.js +0 -372
- package/dist/menu-ClrU72xH.cjs +0 -1
- package/dist/nl-Bx2ACvr4.cjs +0 -1
- package/dist/nl-NuTdZO1s.js +0 -102
- package/dist/pl-QHl6sl8f.cjs +0 -1
- package/dist/pt-BETjHZrL.js +0 -101
- package/dist/pt-DZGw2Z-1.cjs +0 -1
- package/dist/pt-oBMmVYcu.cjs +0 -1
- package/dist/ru-CtxMmoa6.cjs +0 -1
- package/dist/ru-D03IuLqh.cjs +0 -1
- package/dist/text-input-B3VBat1k.js +0 -44
- package/dist/text-input-Ds8e7Z1G.cjs +0 -1
- package/dist/tr-B_-_1wua.cjs +0 -1
- package/dist/translations-B4-Zd2LM.cjs +0 -1
- package/dist/translations-D62qqNV9.cjs +0 -1
- package/dist/translations-DPr6c05Z.js +0 -67
- package/dist/ur-DvqAg9gW.cjs +0 -1
- package/dist/ur-DyUSmIbo.cjs +0 -1
- package/dist/use-animated-toggle-ChycsEoj.js +0 -175
- package/dist/use-animated-toggle-DR6CyMac.cjs +0 -1
- package/dist/vi-BdzxA60L.js +0 -101
- package/dist/vi-CBmPaHxg.cjs +0 -1
- package/dist/vi-D5R3YcU0.cjs +0 -1
- package/dist/vi-DhdsHHf_.js +0 -38
- package/dist/widget-customization-Dk7XcVly.cjs +0 -1
- package/dist/zh-CCGXcj5r.cjs +0 -1
- package/dist/zh-Cb1b8uik.cjs +0 -1
- package/dist/zh-Dn1UJiZa.js +0 -101
|
@@ -1,158 +1,457 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Component Types
|
|
3
|
+
*
|
|
4
|
+
* TypeScript interfaces and types for the BeatUI authentication suite.
|
|
5
|
+
* These types define the contracts for all auth-related UI components,
|
|
6
|
+
* including sign-in, sign-up, reset password forms, social login,
|
|
7
|
+
* and password validation.
|
|
8
|
+
*
|
|
9
|
+
* @module auth/types
|
|
10
|
+
*/
|
|
1
11
|
import { TNode, Value } from '@tempots/dom';
|
|
2
12
|
import { ControlSize } from '../theme';
|
|
3
13
|
import { ThemeColorName } from '../../tokens';
|
|
4
14
|
import { AuthProviderInfo } from './social-login-button';
|
|
15
|
+
/**
|
|
16
|
+
* Supported social authentication provider names.
|
|
17
|
+
*
|
|
18
|
+
* Represents all OAuth/social login providers that BeatUI auth components
|
|
19
|
+
* can render buttons for. Each provider name maps to display information
|
|
20
|
+
* (icon, color, label) in the social login button components.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const provider: AuthProviderName = 'google'
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
5
27
|
export type AuthProviderName = 'google' | 'github' | 'apple' | 'facebook' | 'twitter' | 'x' | 'microsoft' | 'discord' | 'linkedin' | 'instagram' | 'tiktok' | 'snapchat' | 'reddit' | 'pinterest' | 'twitch' | 'steam' | 'epic' | 'playstation' | 'xbox' | 'whatsapp' | 'wechat' | 'amazon' | 'yahoo' | 'paypal';
|
|
28
|
+
/**
|
|
29
|
+
* The current mode of the authentication container.
|
|
30
|
+
*
|
|
31
|
+
* Determines which form is displayed: sign-in, sign-up, or reset password.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const mode: AuthMode = 'signin'
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
6
38
|
export type AuthMode = 'signin' | 'signup' | 'reset-password';
|
|
39
|
+
/**
|
|
40
|
+
* The OAuth flow type for social login.
|
|
41
|
+
*
|
|
42
|
+
* - `'redirect'` - Navigates the user to the provider's login page.
|
|
43
|
+
* - `'popup'` - Opens the provider's login page in a popup window.
|
|
44
|
+
*/
|
|
7
45
|
export type SocialLoginFlow = 'redirect' | 'popup';
|
|
46
|
+
/**
|
|
47
|
+
* Password strength levels used by the password strength indicator.
|
|
48
|
+
*
|
|
49
|
+
* Computed based on how many configured password rules are satisfied.
|
|
50
|
+
*/
|
|
8
51
|
export type PasswordStrength = 'weak' | 'fair' | 'good' | 'strong';
|
|
52
|
+
/**
|
|
53
|
+
* Data submitted by the sign-in form.
|
|
54
|
+
*/
|
|
9
55
|
export interface SignInData {
|
|
56
|
+
/** The user's email address. */
|
|
10
57
|
email: string;
|
|
58
|
+
/** The user's password. */
|
|
11
59
|
password: string;
|
|
12
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Alias for {@link SignInData}, used as the form data type for the sign-in form.
|
|
63
|
+
*/
|
|
13
64
|
export type SignInFormData = SignInData;
|
|
65
|
+
/**
|
|
66
|
+
* Data submitted by the sign-up form (without confirm password).
|
|
67
|
+
*
|
|
68
|
+
* This is the cleaned data passed to the `onSignUp` callback, after
|
|
69
|
+
* the confirm password field has been validated and removed.
|
|
70
|
+
*/
|
|
14
71
|
export interface SignUpData {
|
|
72
|
+
/** The user's display name. */
|
|
15
73
|
name?: string;
|
|
74
|
+
/** The user's email address. */
|
|
16
75
|
email: string;
|
|
76
|
+
/** The user's chosen password. */
|
|
17
77
|
password: string;
|
|
78
|
+
/** Whether the user accepted the terms and conditions. */
|
|
18
79
|
acceptTerms: boolean;
|
|
19
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Internal form data for the sign-up form, including the confirm password field.
|
|
83
|
+
*
|
|
84
|
+
* Extends {@link SignUpData} with the `confirmPassword` field used for
|
|
85
|
+
* client-side validation before submission.
|
|
86
|
+
*/
|
|
20
87
|
export interface SignUpFormData extends SignUpData {
|
|
88
|
+
/** The password confirmation value, validated to match `password`. */
|
|
21
89
|
confirmPassword: string;
|
|
22
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Data submitted by the reset password form.
|
|
93
|
+
*/
|
|
23
94
|
export interface ResetPasswordData {
|
|
95
|
+
/** The email address to send the password reset link to. */
|
|
24
96
|
email: string;
|
|
25
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Configuration for a social login provider.
|
|
100
|
+
*
|
|
101
|
+
* @typeParam T - The type of the success result returned by the OAuth flow.
|
|
102
|
+
*/
|
|
26
103
|
export interface SocialProviderConfig<T> {
|
|
104
|
+
/** The name of the social provider (e.g., `'google'`, `'github'`). */
|
|
27
105
|
provider: AuthProviderName;
|
|
106
|
+
/** The OAuth client ID for this provider. */
|
|
28
107
|
clientId?: string;
|
|
108
|
+
/** The OAuth flow type: `'redirect'` or `'popup'`. */
|
|
29
109
|
flow?: SocialLoginFlow;
|
|
110
|
+
/** OAuth scopes to request from the provider. */
|
|
30
111
|
scopes?: string[];
|
|
112
|
+
/** Additional query parameters to include in the OAuth URL. */
|
|
31
113
|
customParams?: Record<string, string>;
|
|
114
|
+
/** Callback invoked on successful authentication. */
|
|
32
115
|
onSuccess?: (result: T) => Promise<void> | void;
|
|
116
|
+
/** Callback invoked when authentication fails. */
|
|
33
117
|
onError?: (error: Error) => Promise<void> | void;
|
|
34
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Password validation rules used by the sign-up form and password strength indicator.
|
|
121
|
+
*
|
|
122
|
+
* Each rule is optional. When enabled, it adds a corresponding validation
|
|
123
|
+
* check to the password schema and a requirement line to the strength indicator.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const rules: PasswordRules = {
|
|
128
|
+
* minLength: 8,
|
|
129
|
+
* requireUppercase: true,
|
|
130
|
+
* requireLowercase: true,
|
|
131
|
+
* requireNumbers: true,
|
|
132
|
+
* requireSymbols: false,
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
35
136
|
export interface PasswordRules {
|
|
137
|
+
/** Minimum number of characters required. @default 8 */
|
|
36
138
|
minLength?: number;
|
|
139
|
+
/** Whether at least one uppercase letter is required. @default true */
|
|
37
140
|
requireUppercase?: boolean;
|
|
141
|
+
/** Whether at least one lowercase letter is required. @default true */
|
|
38
142
|
requireLowercase?: boolean;
|
|
143
|
+
/** Whether at least one digit is required. @default true */
|
|
39
144
|
requireNumbers?: boolean;
|
|
145
|
+
/** Whether at least one special character is required. @default false */
|
|
40
146
|
requireSymbols?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Custom validation function for additional password checks.
|
|
149
|
+
* @param password - The password to validate.
|
|
150
|
+
* @returns An error message string if invalid, or `null` if valid.
|
|
151
|
+
*/
|
|
41
152
|
customValidation?: (password: string) => string | null;
|
|
42
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Customizable label overrides for the {@link AuthContainer} component.
|
|
156
|
+
*
|
|
157
|
+
* All labels are optional reactive `Value<string>` values. When not provided,
|
|
158
|
+
* the component falls back to the current locale's i18n translations.
|
|
159
|
+
*/
|
|
43
160
|
export interface AuthContainerLabels {
|
|
161
|
+
/** Title displayed on the sign-in form. */
|
|
44
162
|
signInTitle?: Value<string>;
|
|
163
|
+
/** Label for the email input field. */
|
|
45
164
|
emailLabel?: Value<string>;
|
|
165
|
+
/** Label for the password input field. */
|
|
46
166
|
passwordLabel?: Value<string>;
|
|
167
|
+
/** Label for the "remember me" checkbox. */
|
|
47
168
|
rememberMeLabel?: Value<string>;
|
|
169
|
+
/** Text for the sign-in submit button. */
|
|
48
170
|
signInButton?: Value<string>;
|
|
171
|
+
/** Text for the "forgot password?" link. */
|
|
49
172
|
forgotPasswordLink?: Value<string>;
|
|
173
|
+
/** Text for the "don't have an account?" link. */
|
|
50
174
|
noAccountLink?: Value<string>;
|
|
175
|
+
/** Label for the "accept terms" checkbox. */
|
|
51
176
|
acceptTermsLabel?: Value<string>;
|
|
177
|
+
/** Label for the confirm password input field. */
|
|
52
178
|
confirmPasswordLabel?: Value<string>;
|
|
179
|
+
/** Title displayed on the sign-up form. */
|
|
53
180
|
signUpTitle?: Value<string>;
|
|
181
|
+
/** Text for the sign-up submit button. */
|
|
54
182
|
signUpButton?: Value<string>;
|
|
183
|
+
/** Label for the name input field. */
|
|
55
184
|
nameLabel?: Value<string>;
|
|
185
|
+
/** Text for the "already have an account?" link. */
|
|
56
186
|
hasAccountLink?: Value<string>;
|
|
187
|
+
/** Title displayed on the reset password form. */
|
|
57
188
|
resetPasswordTitle?: Value<string>;
|
|
189
|
+
/** Text for the reset password submit button. */
|
|
58
190
|
resetPasswordButton?: Value<string>;
|
|
191
|
+
/** Description text shown on the reset password form. */
|
|
59
192
|
resetPasswordDescription?: Value<string>;
|
|
193
|
+
/** Text for the "back to sign in" link. */
|
|
60
194
|
backToSignInLink?: Value<string>;
|
|
61
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Options for the {@link AuthContainer} component.
|
|
198
|
+
*
|
|
199
|
+
* The AuthContainer is the main authentication UI that switches between
|
|
200
|
+
* sign-in, sign-up, and reset-password modes. It coordinates social login
|
|
201
|
+
* buttons, form fields, and mode navigation.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* AuthContainer({
|
|
206
|
+
* mode: 'signin',
|
|
207
|
+
* socialProviders: [{ provider: 'google' }, { provider: 'github' }],
|
|
208
|
+
* onSignIn: async (data) => { /* handle sign in *\/ return null },
|
|
209
|
+
* onSignUp: async (data) => { /* handle sign up *\/ return null },
|
|
210
|
+
* showRememberMe: true,
|
|
211
|
+
* })
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
62
214
|
export interface AuthContainerOptions {
|
|
215
|
+
/** The initial or controlled authentication mode. @default 'signin' */
|
|
63
216
|
mode?: Value<AuthMode>;
|
|
217
|
+
/** Additional CSS class names to apply to the container. */
|
|
64
218
|
className?: Value<string>;
|
|
219
|
+
/** Social login providers to display as buttons above the form. */
|
|
65
220
|
socialProviders?: AuthProviderInfo[];
|
|
221
|
+
/** Initial value for the name field on the sign-up form. */
|
|
66
222
|
initialName?: string;
|
|
223
|
+
/** Initial value for the email field on the sign-up form. */
|
|
67
224
|
initialEmail?: string;
|
|
225
|
+
/** Password validation rules applied to sign-in and sign-up forms. */
|
|
68
226
|
passwordRules?: PasswordRules;
|
|
227
|
+
/** Whether to show the "remember me" checkbox on the sign-in form. */
|
|
69
228
|
showRememberMe?: Value<boolean>;
|
|
229
|
+
/** Whether to show the "or" divider between social buttons and the form. */
|
|
70
230
|
showSocialDivider?: Value<boolean>;
|
|
231
|
+
/** Custom label overrides for all form text. */
|
|
71
232
|
labels?: AuthContainerLabels;
|
|
233
|
+
/**
|
|
234
|
+
* Callback invoked when the sign-in form is submitted.
|
|
235
|
+
* @param data - The sign-in form data.
|
|
236
|
+
* @returns An error message string to display, or `null` on success.
|
|
237
|
+
*/
|
|
72
238
|
onSignIn?: (data: SignInData) => Promise<string | null>;
|
|
239
|
+
/**
|
|
240
|
+
* Callback invoked when the sign-up form is submitted.
|
|
241
|
+
* @param data - The sign-up form data.
|
|
242
|
+
* @returns An error message string to display, or `null` on success.
|
|
243
|
+
*/
|
|
73
244
|
onSignUp?: (data: SignUpData) => Promise<string | null>;
|
|
245
|
+
/**
|
|
246
|
+
* Callback invoked when the reset password form is submitted.
|
|
247
|
+
* @param data - The reset password form data.
|
|
248
|
+
* @returns An error message string to display, or `null` on success.
|
|
249
|
+
*/
|
|
74
250
|
onResetPassword?: (data: ResetPasswordData) => Promise<string | null>;
|
|
251
|
+
/**
|
|
252
|
+
* Callback invoked when the user switches between auth modes.
|
|
253
|
+
* @param mode - The new authentication mode.
|
|
254
|
+
*/
|
|
75
255
|
onModeChange?: (mode: AuthMode) => void;
|
|
256
|
+
/**
|
|
257
|
+
* Callback invoked when a social login button is clicked.
|
|
258
|
+
* @param provider - The name of the social provider.
|
|
259
|
+
*/
|
|
76
260
|
onSocialLogin?: (provider: AuthProviderName) => Promise<void>;
|
|
261
|
+
/** Whether to show the password strength indicator on the sign-up form. */
|
|
77
262
|
showPasswordStrength?: Value<boolean>;
|
|
263
|
+
/** Whether to show the "already have an account?" link on the sign-up form. */
|
|
78
264
|
showAlreadyHaveAccountLink?: boolean;
|
|
265
|
+
/** Whether to show the name field on the sign-up form. */
|
|
79
266
|
showNameField?: boolean;
|
|
267
|
+
/** Whether to show the confirm password field on the sign-up form. */
|
|
80
268
|
showConfirmPassword?: Value<boolean>;
|
|
269
|
+
/** Whether to show the "accept terms and conditions" checkbox on the sign-up form. */
|
|
81
270
|
showAcceptTermsAndConditions?: Value<boolean>;
|
|
271
|
+
/** Custom terms and conditions content to display next to the checkbox. */
|
|
82
272
|
termsAndConditions?: TNode;
|
|
273
|
+
/** Whether to render the styled container wrapper. @default true */
|
|
83
274
|
showContainer?: Value<boolean>;
|
|
84
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Options for the {@link SocialProviders} component, which renders a list of social login buttons.
|
|
278
|
+
*/
|
|
85
279
|
export interface SocialProvidersOptions {
|
|
280
|
+
/** The list of social login providers to display. */
|
|
86
281
|
providers: AuthProviderInfo[];
|
|
282
|
+
/**
|
|
283
|
+
* Callback invoked when a social login button is clicked.
|
|
284
|
+
* @param provider - The name of the social provider that was clicked.
|
|
285
|
+
*/
|
|
87
286
|
onSocialLogin?: (provider: AuthProviderName) => Promise<void>;
|
|
88
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Customizable label overrides for the {@link SignInForm} component.
|
|
290
|
+
*/
|
|
89
291
|
export interface SignInFormLabels {
|
|
292
|
+
/** Label for the email input field. */
|
|
90
293
|
emailLabel?: Value<string>;
|
|
294
|
+
/** Label for the password input field. */
|
|
91
295
|
passwordLabel?: Value<string>;
|
|
296
|
+
/** Label for the "remember me" checkbox. */
|
|
92
297
|
rememberMeLabel?: Value<string>;
|
|
298
|
+
/** Text for the sign-in submit button. */
|
|
93
299
|
signInButton?: Value<string>;
|
|
300
|
+
/** Text for the "forgot password?" link. */
|
|
94
301
|
forgotPasswordLink?: Value<string>;
|
|
302
|
+
/** Text for the "don't have an account?" link. */
|
|
95
303
|
noAccountLink?: Value<string>;
|
|
96
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Options for the {@link SignInForm} component.
|
|
307
|
+
*/
|
|
97
308
|
export interface SignInFormOptions {
|
|
309
|
+
/**
|
|
310
|
+
* Callback invoked when the sign-in form is submitted.
|
|
311
|
+
* @param data - The sign-in form data.
|
|
312
|
+
* @returns An error message string to display, or `null` on success.
|
|
313
|
+
*/
|
|
98
314
|
onSignIn?: (data: SignInData) => Promise<string | null>;
|
|
315
|
+
/** Password validation rules for the password field. */
|
|
99
316
|
passwordRules?: PasswordRules;
|
|
317
|
+
/** Custom label overrides for form text. */
|
|
100
318
|
labels?: SignInFormLabels;
|
|
319
|
+
/** Whether to show the "remember me" checkbox. */
|
|
101
320
|
showRememberMe?: Value<boolean>;
|
|
102
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Customizable label overrides for the {@link SignUpForm} component.
|
|
324
|
+
*/
|
|
103
325
|
export interface SignUpFormLabels {
|
|
326
|
+
/** Label for the name input field. */
|
|
104
327
|
nameLabel?: Value<string>;
|
|
328
|
+
/** Label for the email input field. */
|
|
105
329
|
emailLabel?: Value<string>;
|
|
330
|
+
/** Label for the password input field. */
|
|
106
331
|
passwordLabel?: Value<string>;
|
|
332
|
+
/** Label for the confirm password input field. */
|
|
107
333
|
confirmPasswordLabel?: Value<string>;
|
|
334
|
+
/** Label for the "accept terms" checkbox. */
|
|
108
335
|
acceptTermsLabel?: Value<string>;
|
|
336
|
+
/** Text for the sign-up submit button. */
|
|
109
337
|
signUpButton?: Value<string>;
|
|
338
|
+
/** Text for the "already have an account?" link. */
|
|
110
339
|
hasAccountLink?: Value<string>;
|
|
111
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Options for the {@link SignUpForm} component.
|
|
343
|
+
*/
|
|
112
344
|
export interface SignUpFormOptions {
|
|
345
|
+
/** Initial value for the name field. */
|
|
113
346
|
initialName?: string;
|
|
347
|
+
/** Initial value for the email field. */
|
|
114
348
|
initialEmail?: string;
|
|
349
|
+
/** Password validation rules for the password and confirm password fields. */
|
|
115
350
|
passwordRules?: PasswordRules;
|
|
351
|
+
/** Custom label overrides for form text. */
|
|
116
352
|
labels?: SignUpFormLabels;
|
|
353
|
+
/**
|
|
354
|
+
* Callback invoked when the sign-up form is submitted.
|
|
355
|
+
* @param data - The sign-up form data (without confirmPassword).
|
|
356
|
+
* @returns An error message string to display, or `null` on success.
|
|
357
|
+
*/
|
|
117
358
|
onSignUp?: (data: SignUpData) => Promise<string | null>;
|
|
359
|
+
/** Whether to show the password strength indicator. */
|
|
118
360
|
showPasswordStrength?: Value<boolean>;
|
|
361
|
+
/** Whether to show the "already have an account?" link. */
|
|
119
362
|
showAlreadyHaveAccountLink?: boolean;
|
|
363
|
+
/** Whether to show the name field. @default true */
|
|
120
364
|
showNameField?: boolean;
|
|
365
|
+
/** Whether to show the confirm password field. */
|
|
121
366
|
showConfirmPassword?: Value<boolean>;
|
|
367
|
+
/** Whether to show the "accept terms and conditions" checkbox. */
|
|
122
368
|
showAcceptTermsAndConditions?: Value<boolean>;
|
|
369
|
+
/** Custom terms and conditions content to display next to the checkbox. */
|
|
123
370
|
termsAndConditions?: TNode;
|
|
124
371
|
}
|
|
372
|
+
/**
|
|
373
|
+
* Customizable label overrides for the {@link ResetPasswordForm} component.
|
|
374
|
+
*/
|
|
125
375
|
export interface ResetPasswordFormLabels {
|
|
376
|
+
/** Text for the reset password submit button. */
|
|
126
377
|
resetPasswordButton?: Value<string>;
|
|
378
|
+
/** Description text shown above the email field. */
|
|
127
379
|
resetPasswordDescription?: Value<string>;
|
|
380
|
+
/** Label for the email input field. */
|
|
128
381
|
emailLabel?: Value<string>;
|
|
382
|
+
/** Text for the "back to sign in" link. */
|
|
129
383
|
backToSignInLink?: Value<string>;
|
|
130
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* Options for the {@link ResetPasswordForm} component.
|
|
387
|
+
*/
|
|
131
388
|
export interface ResetPasswordFormOptions {
|
|
389
|
+
/**
|
|
390
|
+
* Callback invoked when the reset password form is submitted.
|
|
391
|
+
* @param data - The reset password form data containing the email.
|
|
392
|
+
* @returns An error message string to display, or `null` on success.
|
|
393
|
+
*/
|
|
132
394
|
onResetPassword?: (data: ResetPasswordData) => Promise<string | null>;
|
|
395
|
+
/** Custom label overrides for form text. */
|
|
133
396
|
labels?: ResetPasswordFormLabels;
|
|
134
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Options for the {@link SocialLoginButton} component.
|
|
400
|
+
*
|
|
401
|
+
* Renders a branded button for a specific social authentication provider.
|
|
402
|
+
*/
|
|
135
403
|
export interface SocialLoginButtonOptions {
|
|
404
|
+
/** The social provider this button represents. */
|
|
136
405
|
provider: Value<AuthProviderName>;
|
|
406
|
+
/** Click handler invoked when the button is pressed. */
|
|
137
407
|
onClick?: () => Promise<void>;
|
|
408
|
+
/** Whether the button is disabled. */
|
|
138
409
|
disabled?: Value<boolean>;
|
|
410
|
+
/** The size of the button. @default 'md' */
|
|
139
411
|
size?: Value<ControlSize>;
|
|
412
|
+
/** The OAuth flow type: `'redirect'` or `'popup'`. */
|
|
140
413
|
flow?: Value<'redirect' | 'popup' | undefined>;
|
|
414
|
+
/** The display name of the provider (e.g., `'Google'`). */
|
|
141
415
|
name: Value<string>;
|
|
416
|
+
/** The icon identifier for the provider (e.g., `'logos:google-icon'`). */
|
|
142
417
|
icon: Value<string>;
|
|
418
|
+
/** The theme color to use for the button. */
|
|
143
419
|
color: Value<ThemeColorName>;
|
|
420
|
+
/** Optional label overrides for the button text. */
|
|
144
421
|
labels?: {
|
|
422
|
+
/**
|
|
423
|
+
* Function that formats the button label given a provider name.
|
|
424
|
+
* @default (provider) => `Continue with ${provider}`
|
|
425
|
+
*/
|
|
145
426
|
continueWithProvider?: Value<(provider: string) => string>;
|
|
146
427
|
};
|
|
147
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* Options for the {@link PasswordStrengthIndicator} component.
|
|
431
|
+
*
|
|
432
|
+
* Displays a visual bar, label, and requirements checklist for password strength.
|
|
433
|
+
*/
|
|
148
434
|
export interface PasswordStrengthIndicatorOptions {
|
|
435
|
+
/** Reactive password value to evaluate strength for. */
|
|
149
436
|
password: Value<string>;
|
|
437
|
+
/** Password rules to evaluate against. Falls back to default rules if not provided. */
|
|
150
438
|
rules?: PasswordRules;
|
|
439
|
+
/** Whether to show the strength label text (e.g., "Weak", "Strong"). @default true */
|
|
151
440
|
showLabel?: boolean;
|
|
441
|
+
/** Additional CSS class names to apply to the indicator container. */
|
|
152
442
|
className?: Value<string>;
|
|
153
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Display information for a social authentication provider.
|
|
446
|
+
*
|
|
447
|
+
* Contains the human-readable name, icon identifier, and theme color
|
|
448
|
+
* used to render the provider's social login button.
|
|
449
|
+
*/
|
|
154
450
|
export interface ProviderInfo {
|
|
451
|
+
/** The human-readable display name (e.g., `'Google'`). */
|
|
155
452
|
name: string;
|
|
453
|
+
/** The icon identifier compatible with the Icon component (e.g., `'logos:google-icon'`). */
|
|
156
454
|
icon: string;
|
|
455
|
+
/** The theme color name used for the button styling. */
|
|
157
456
|
color: ThemeColorName;
|
|
158
457
|
}
|
|
@@ -1,20 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Utility Functions
|
|
3
|
+
*
|
|
4
|
+
* Helper functions and constants for authentication components, including
|
|
5
|
+
* provider display metadata, URL construction, popup handling, error formatting,
|
|
6
|
+
* and form validation utilities.
|
|
7
|
+
*
|
|
8
|
+
* @module auth/utils
|
|
9
|
+
*/
|
|
1
10
|
import { AuthProviderName, PasswordRules } from './types';
|
|
11
|
+
/**
|
|
12
|
+
* Mapping of every supported social provider name to its display metadata.
|
|
13
|
+
*
|
|
14
|
+
* Contains the human-readable name, Iconify icon identifier, and hex brand color
|
|
15
|
+
* for each {@link AuthProviderName}.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const info = providerInfo['google']
|
|
20
|
+
* // { name: 'Google', icon: 'logos:google-icon', color: '#4285f4' }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
2
23
|
export declare const providerInfo: Record<AuthProviderName, {
|
|
3
24
|
name: string;
|
|
4
25
|
icon: string;
|
|
5
26
|
color: string;
|
|
6
27
|
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the human-readable display name for a social provider.
|
|
30
|
+
*
|
|
31
|
+
* @param provider - The provider identifier.
|
|
32
|
+
* @returns The formatted provider name (e.g., `'Google'`), or the raw identifier if not found.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* formatProviderName('github') // 'GitHub'
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
7
39
|
export declare function formatProviderName(provider: AuthProviderName): string;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the Iconify icon identifier for a social provider.
|
|
42
|
+
*
|
|
43
|
+
* @param provider - The provider identifier.
|
|
44
|
+
* @returns The icon string (e.g., `'logos:google-icon'`), or `'mdi:account'` as a fallback.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* getProviderIcon('github') // 'logos:github-icon'
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
8
51
|
export declare function getProviderIcon(provider: AuthProviderName): string;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the brand hex color for a social provider.
|
|
54
|
+
*
|
|
55
|
+
* @param provider - The provider identifier.
|
|
56
|
+
* @returns The hex color string (e.g., `'#4285f4'`), or `'#666'` as a fallback.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* getProviderColor('google') // '#4285f4'
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
9
63
|
export declare function getProviderColor(provider: AuthProviderName): string;
|
|
64
|
+
/**
|
|
65
|
+
* Formats a social login button label by replacing `{provider}` in a template string.
|
|
66
|
+
*
|
|
67
|
+
* @param provider - The provider identifier.
|
|
68
|
+
* @param template - The template string containing `{provider}` placeholder. @default 'Continue with {provider}'
|
|
69
|
+
* @returns The formatted string with the provider name substituted.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* formatSocialLoginText('google') // 'Continue with Google'
|
|
74
|
+
* formatSocialLoginText('github', 'Sign in via {provider}') // 'Sign in via GitHub'
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
10
77
|
export declare function formatSocialLoginText(provider: AuthProviderName, template?: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Default password validation rules used across auth components.
|
|
80
|
+
*
|
|
81
|
+
* Requires at least 8 characters, one uppercase letter, one lowercase letter,
|
|
82
|
+
* and one number. Special characters are not required by default.
|
|
83
|
+
*/
|
|
11
84
|
export declare const defaultPasswordRules: PasswordRules;
|
|
85
|
+
/**
|
|
86
|
+
* Checks whether a string matches a basic email format.
|
|
87
|
+
*
|
|
88
|
+
* Uses a simple regex for client-side validation. This is not a comprehensive
|
|
89
|
+
* RFC 5322 check but covers common email patterns.
|
|
90
|
+
*
|
|
91
|
+
* @param email - The string to test.
|
|
92
|
+
* @returns `true` if the string looks like a valid email address.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* isValidEmail('user@example.com') // true
|
|
97
|
+
* isValidEmail('not-an-email') // false
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
12
100
|
export declare function isValidEmail(email: string): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Generates a random alphanumeric string, typically used for OAuth state parameters.
|
|
103
|
+
*
|
|
104
|
+
* Note: Uses `Math.random()`, which is not cryptographically secure. For
|
|
105
|
+
* production OAuth flows, consider using `crypto.getRandomValues()` instead.
|
|
106
|
+
*
|
|
107
|
+
* @param length - The length of the generated string. @default 32
|
|
108
|
+
* @returns A random alphanumeric string of the specified length.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const state = generateRandomString(16) // e.g., 'aB3kPm7xNq2wLz9R'
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
13
115
|
export declare function generateRandomString(length?: number): string;
|
|
116
|
+
/**
|
|
117
|
+
* Constructs an OAuth authorization URL for a social login provider.
|
|
118
|
+
*
|
|
119
|
+
* Builds a URL with query parameters for `client_id`, `redirect_uri`, `scope`,
|
|
120
|
+
* `state`, and `response_type`. Provider-specific base URLs and default scopes
|
|
121
|
+
* are built in. Custom scopes and additional query parameters can be provided.
|
|
122
|
+
*
|
|
123
|
+
* This is a basic implementation. For production use, consider using your
|
|
124
|
+
* auth library's built-in OAuth URL construction.
|
|
125
|
+
*
|
|
126
|
+
* @param provider - The social provider to generate the URL for.
|
|
127
|
+
* @param clientId - The OAuth client ID.
|
|
128
|
+
* @param redirectUri - The URI to redirect to after authentication.
|
|
129
|
+
* @param scopes - OAuth scopes to request. Defaults to provider-specific defaults if empty.
|
|
130
|
+
* @param customParams - Additional query parameters to include in the URL.
|
|
131
|
+
* @returns The fully constructed OAuth authorization URL.
|
|
132
|
+
* @throws {Error} If the provider is not supported.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const url = createSocialLoginUrl('google', 'my-client-id', 'https://myapp.com/callback')
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
14
139
|
export declare function createSocialLoginUrl(provider: AuthProviderName, clientId: string, redirectUri: string, scopes?: string[], customParams?: Record<string, string>): string;
|
|
140
|
+
/**
|
|
141
|
+
* Opens a popup window for social login and listens for the result via `postMessage`.
|
|
142
|
+
*
|
|
143
|
+
* The popup is monitored for closure (user cancellation) and for messages from
|
|
144
|
+
* the popup window. Expected message types are `SOCIAL_LOGIN_SUCCESS` and
|
|
145
|
+
* `SOCIAL_LOGIN_ERROR`, sent from the OAuth callback page.
|
|
146
|
+
*
|
|
147
|
+
* @typeParam T - The type of the success result data.
|
|
148
|
+
* @param url - The OAuth authorization URL to open in the popup.
|
|
149
|
+
* @param provider - The social provider name (used for the popup window name).
|
|
150
|
+
* @param onSuccess - Callback invoked with the result data on successful login.
|
|
151
|
+
* @param onError - Callback invoked with an error on failure or cancellation.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* openSocialLoginPopup<{ token: string }>(
|
|
156
|
+
* authUrl,
|
|
157
|
+
* 'google',
|
|
158
|
+
* (result) => console.log('Token:', result.token),
|
|
159
|
+
* (error) => console.error('Failed:', error.message)
|
|
160
|
+
* )
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
15
163
|
export declare function openSocialLoginPopup<T>(url: string, provider: AuthProviderName, onSuccess?: (result: T) => void, onError?: (error: Error) => void): void;
|
|
164
|
+
/**
|
|
165
|
+
* Formats an unknown error value into a human-readable error message string.
|
|
166
|
+
*
|
|
167
|
+
* Handles `Error` instances, plain strings, objects with a `message` property,
|
|
168
|
+
* and falls back to a generic error message.
|
|
169
|
+
*
|
|
170
|
+
* @param error - The error value to format.
|
|
171
|
+
* @returns A human-readable error message string.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* formatAuthError(new Error('Invalid credentials')) // 'Invalid credentials'
|
|
176
|
+
* formatAuthError('Something went wrong') // 'Something went wrong'
|
|
177
|
+
* formatAuthError(42) // 'An unexpected error occurred'
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
16
180
|
export declare function formatAuthError(error: unknown): string;
|
|
181
|
+
/**
|
|
182
|
+
* Checks whether the code is running in a browser environment.
|
|
183
|
+
*
|
|
184
|
+
* @returns `true` if `window` and `document` are available, `false` otherwise.
|
|
185
|
+
*/
|
|
17
186
|
export declare function isBrowser(): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Wraps an async form submission task into a form controller validation function.
|
|
189
|
+
*
|
|
190
|
+
* Creates a function that can be passed to `useForm`'s `onSubmit` option. It
|
|
191
|
+
* handles loading state (via `onStart`/`onEnd` callbacks), invokes the task,
|
|
192
|
+
* and converts the result into a `Validation` value compatible with the form
|
|
193
|
+
* controller system.
|
|
194
|
+
*
|
|
195
|
+
* @typeParam T - The form data type.
|
|
196
|
+
* @param options - Configuration for the validation wrapper.
|
|
197
|
+
* @param options.task - The async function to call with the form value. Returns an error message or `null`.
|
|
198
|
+
* @param options.message - A fallback error message used if the task throws.
|
|
199
|
+
* @param options.onStart - Called before the task begins (e.g., to set loading state).
|
|
200
|
+
* @param options.onEnd - Called after the task completes (e.g., to clear loading state).
|
|
201
|
+
* @returns An async function that accepts a value of type `T` and returns a `Validation`.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* const onSubmit = requestToControllerValidation({
|
|
206
|
+
* task: async (data) => {
|
|
207
|
+
* const error = await api.signIn(data)
|
|
208
|
+
* return error ?? null
|
|
209
|
+
* },
|
|
210
|
+
* message: 'Sign in failed',
|
|
211
|
+
* onStart: () => loading.set(true),
|
|
212
|
+
* onEnd: () => loading.set(false),
|
|
213
|
+
* })
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
18
216
|
export declare function requestToControllerValidation<T>({ task, message, onStart, onEnd, }: {
|
|
19
217
|
task: undefined | ((value: T) => Promise<string | null>);
|
|
20
218
|
message: string;
|