@nanisoft/prism-ui 0.13.0 → 0.16.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/THIRD-PARTY-NOTICES.md +22 -7
- package/dist/.tsbuildinfo +1 -1
- package/dist/blocks/about-01/about.d.ts +296 -0
- package/dist/blocks/about-01/about.d.ts.map +1 -0
- package/dist/blocks/about-01/about.js +103 -0
- package/dist/blocks/about-01/index.d.ts +3 -0
- package/dist/blocks/about-01/index.d.ts.map +1 -0
- package/dist/blocks/about-01/index.js +1 -0
- package/dist/blocks/accept-invite-01/accept-invite.d.ts +324 -0
- package/dist/blocks/accept-invite-01/accept-invite.d.ts.map +1 -0
- package/dist/blocks/accept-invite-01/accept-invite.js +230 -0
- package/dist/blocks/accept-invite-01/index.d.ts +3 -0
- package/dist/blocks/accept-invite-01/index.d.ts.map +1 -0
- package/dist/blocks/accept-invite-01/index.js +1 -0
- package/dist/blocks/account-01/account-01.d.ts +393 -0
- package/dist/blocks/account-01/account-01.d.ts.map +1 -0
- package/dist/blocks/account-01/account-01.js +215 -0
- package/dist/blocks/account-01/index.d.ts +3 -0
- package/dist/blocks/account-01/index.d.ts.map +1 -0
- package/dist/blocks/account-01/index.js +1 -0
- package/dist/blocks/activity-feed-01/activity-feed-01.d.ts +271 -0
- package/dist/blocks/activity-feed-01/activity-feed-01.d.ts.map +1 -0
- package/dist/blocks/activity-feed-01/activity-feed-01.js +185 -0
- package/dist/blocks/activity-feed-01/index.d.ts +3 -0
- package/dist/blocks/activity-feed-01/index.d.ts.map +1 -0
- package/dist/blocks/activity-feed-01/index.js +1 -0
- package/dist/blocks/address-book-01/address-book-01.d.ts +312 -0
- package/dist/blocks/address-book-01/address-book-01.d.ts.map +1 -0
- package/dist/blocks/address-book-01/address-book-01.js +233 -0
- package/dist/blocks/address-book-01/index.d.ts +3 -0
- package/dist/blocks/address-book-01/index.d.ts.map +1 -0
- package/dist/blocks/address-book-01/index.js +1 -0
- package/dist/blocks/audit-log-01/audit-log-01.d.ts +333 -0
- package/dist/blocks/audit-log-01/audit-log-01.d.ts.map +1 -0
- package/dist/blocks/audit-log-01/audit-log-01.js +211 -0
- package/dist/blocks/audit-log-01/index.d.ts +3 -0
- package/dist/blocks/audit-log-01/index.d.ts.map +1 -0
- package/dist/blocks/audit-log-01/index.js +1 -0
- package/dist/blocks/auth-form-01/auth-form.d.ts +40 -1
- package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -1
- package/dist/blocks/auth-form-01/auth-form.js +26 -3
- package/dist/blocks/awards-01/awards.d.ts +156 -0
- package/dist/blocks/awards-01/awards.d.ts.map +1 -0
- package/dist/blocks/awards-01/awards.js +102 -0
- package/dist/blocks/awards-01/index.d.ts +3 -0
- package/dist/blocks/awards-01/index.d.ts.map +1 -0
- package/dist/blocks/awards-01/index.js +1 -0
- package/dist/blocks/backdrop-01/backdrop.d.ts +268 -0
- package/dist/blocks/backdrop-01/backdrop.d.ts.map +1 -0
- package/dist/blocks/backdrop-01/backdrop.js +170 -0
- package/dist/blocks/backdrop-01/index.d.ts +3 -0
- package/dist/blocks/backdrop-01/index.d.ts.map +1 -0
- package/dist/blocks/backdrop-01/index.js +1 -0
- package/dist/blocks/bento-01/bento-01.d.ts +136 -0
- package/dist/blocks/bento-01/bento-01.d.ts.map +1 -0
- package/dist/blocks/bento-01/bento-01.js +97 -0
- package/dist/blocks/bento-01/index.d.ts +3 -0
- package/dist/blocks/bento-01/index.d.ts.map +1 -0
- package/dist/blocks/bento-01/index.js +1 -0
- package/dist/blocks/billing-source-01/billing-source-01.d.ts +379 -0
- package/dist/blocks/billing-source-01/billing-source-01.d.ts.map +1 -0
- package/dist/blocks/billing-source-01/billing-source-01.js +222 -0
- package/dist/blocks/billing-source-01/index.d.ts +3 -0
- package/dist/blocks/billing-source-01/index.d.ts.map +1 -0
- package/dist/blocks/billing-source-01/index.js +1 -0
- package/dist/blocks/bundle-01/bundle.d.ts +387 -0
- package/dist/blocks/bundle-01/bundle.d.ts.map +1 -0
- package/dist/blocks/bundle-01/bundle.js +153 -0
- package/dist/blocks/bundle-01/index.d.ts +3 -0
- package/dist/blocks/bundle-01/index.d.ts.map +1 -0
- package/dist/blocks/bundle-01/index.js +1 -0
- package/dist/blocks/calendar-01/calendar.d.ts +251 -0
- package/dist/blocks/calendar-01/calendar.d.ts.map +1 -0
- package/dist/blocks/calendar-01/calendar.js +191 -0
- package/dist/blocks/calendar-01/index.d.ts +3 -0
- package/dist/blocks/calendar-01/index.d.ts.map +1 -0
- package/dist/blocks/calendar-01/index.js +1 -0
- package/dist/blocks/capacity-01/capacity.d.ts +363 -0
- package/dist/blocks/capacity-01/capacity.d.ts.map +1 -0
- package/dist/blocks/capacity-01/capacity.js +208 -0
- package/dist/blocks/capacity-01/index.d.ts +3 -0
- package/dist/blocks/capacity-01/index.d.ts.map +1 -0
- package/dist/blocks/capacity-01/index.js +1 -0
- package/dist/blocks/careers-01/careers.d.ts +186 -0
- package/dist/blocks/careers-01/careers.d.ts.map +1 -0
- package/dist/blocks/careers-01/careers.js +83 -0
- package/dist/blocks/careers-01/index.d.ts +3 -0
- package/dist/blocks/careers-01/index.d.ts.map +1 -0
- package/dist/blocks/careers-01/index.js +1 -0
- package/dist/blocks/case-studies-01/case-studies.d.ts +192 -0
- package/dist/blocks/case-studies-01/case-studies.d.ts.map +1 -0
- package/dist/blocks/case-studies-01/case-studies.js +97 -0
- package/dist/blocks/case-studies-01/index.d.ts +3 -0
- package/dist/blocks/case-studies-01/index.d.ts.map +1 -0
- package/dist/blocks/case-studies-01/index.js +1 -0
- package/dist/blocks/case-study-01/case-study.d.ts +214 -0
- package/dist/blocks/case-study-01/case-study.d.ts.map +1 -0
- package/dist/blocks/case-study-01/case-study.js +79 -0
- package/dist/blocks/case-study-01/index.d.ts +3 -0
- package/dist/blocks/case-study-01/index.d.ts.map +1 -0
- package/dist/blocks/case-study-01/index.js +1 -0
- package/dist/blocks/changelog-01/changelog.d.ts +200 -0
- package/dist/blocks/changelog-01/changelog.d.ts.map +1 -0
- package/dist/blocks/changelog-01/changelog.js +155 -0
- package/dist/blocks/changelog-01/index.d.ts +3 -0
- package/dist/blocks/changelog-01/index.d.ts.map +1 -0
- package/dist/blocks/changelog-01/index.js +1 -0
- package/dist/blocks/chart-card-01/chart-card-01.d.ts +149 -0
- package/dist/blocks/chart-card-01/chart-card-01.d.ts.map +1 -0
- package/dist/blocks/chart-card-01/chart-card-01.js +81 -0
- package/dist/blocks/chart-card-01/index.d.ts +3 -0
- package/dist/blocks/chart-card-01/index.d.ts.map +1 -0
- package/dist/blocks/chart-card-01/index.js +1 -0
- package/dist/blocks/chart-group-01/chart-group-01.d.ts +138 -0
- package/dist/blocks/chart-group-01/chart-group-01.d.ts.map +1 -0
- package/dist/blocks/chart-group-01/chart-group-01.js +74 -0
- package/dist/blocks/chart-group-01/index.d.ts +3 -0
- package/dist/blocks/chart-group-01/index.d.ts.map +1 -0
- package/dist/blocks/chart-group-01/index.js +1 -0
- package/dist/blocks/code-sample-01/code-sample.d.ts +193 -0
- package/dist/blocks/code-sample-01/code-sample.d.ts.map +1 -0
- package/dist/blocks/code-sample-01/code-sample.js +104 -0
- package/dist/blocks/code-sample-01/index.d.ts +3 -0
- package/dist/blocks/code-sample-01/index.d.ts.map +1 -0
- package/dist/blocks/code-sample-01/index.js +1 -0
- package/dist/blocks/community-01/community.d.ts +183 -0
- package/dist/blocks/community-01/community.d.ts.map +1 -0
- package/dist/blocks/community-01/community.js +102 -0
- package/dist/blocks/community-01/index.d.ts +3 -0
- package/dist/blocks/community-01/index.d.ts.map +1 -0
- package/dist/blocks/community-01/index.js +1 -0
- package/dist/blocks/compare-01/compare.d.ts +184 -0
- package/dist/blocks/compare-01/compare.d.ts.map +1 -0
- package/dist/blocks/compare-01/compare.js +106 -0
- package/dist/blocks/compare-01/index.d.ts +3 -0
- package/dist/blocks/compare-01/index.d.ts.map +1 -0
- package/dist/blocks/compare-01/index.js +1 -0
- package/dist/blocks/compliance-01/compliance.d.ts +249 -0
- package/dist/blocks/compliance-01/compliance.d.ts.map +1 -0
- package/dist/blocks/compliance-01/compliance.js +130 -0
- package/dist/blocks/compliance-01/index.d.ts +3 -0
- package/dist/blocks/compliance-01/index.d.ts.map +1 -0
- package/dist/blocks/compliance-01/index.js +1 -0
- package/dist/blocks/consent-01/consent.d.ts +211 -0
- package/dist/blocks/consent-01/consent.d.ts.map +1 -0
- package/dist/blocks/consent-01/consent.js +101 -0
- package/dist/blocks/consent-01/index.d.ts +3 -0
- package/dist/blocks/consent-01/index.d.ts.map +1 -0
- package/dist/blocks/consent-01/index.js +1 -0
- package/dist/blocks/contact-01/contact.d.ts +319 -0
- package/dist/blocks/contact-01/contact.d.ts.map +1 -0
- package/dist/blocks/contact-01/contact.js +211 -0
- package/dist/blocks/contact-01/index.d.ts +3 -0
- package/dist/blocks/contact-01/index.d.ts.map +1 -0
- package/dist/blocks/contact-01/index.js +1 -0
- package/dist/blocks/content-grid-01/content-grid.d.ts +262 -0
- package/dist/blocks/content-grid-01/content-grid.d.ts.map +1 -0
- package/dist/blocks/content-grid-01/content-grid.js +155 -0
- package/dist/blocks/content-grid-01/index.d.ts +3 -0
- package/dist/blocks/content-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/content-grid-01/index.js +1 -0
- package/dist/blocks/cta-01/cta.d.ts +7 -1
- package/dist/blocks/cta-01/cta.d.ts.map +1 -1
- package/dist/blocks/cta-01/cta.js +11 -2
- package/dist/blocks/dashboard-01/dashboard-01.d.ts +247 -0
- package/dist/blocks/dashboard-01/dashboard-01.d.ts.map +1 -0
- package/dist/blocks/dashboard-01/dashboard-01.js +141 -0
- package/dist/blocks/dashboard-01/index.d.ts +3 -0
- package/dist/blocks/dashboard-01/index.d.ts.map +1 -0
- package/dist/blocks/dashboard-01/index.js +1 -0
- package/dist/blocks/data-table-01/data-table.d.ts +22 -1
- package/dist/blocks/data-table-01/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table-01/data-table.js +9 -5
- package/dist/blocks/delivery-01/delivery.d.ts +343 -0
- package/dist/blocks/delivery-01/delivery.d.ts.map +1 -0
- package/dist/blocks/delivery-01/delivery.js +212 -0
- package/dist/blocks/delivery-01/index.d.ts +3 -0
- package/dist/blocks/delivery-01/index.d.ts.map +1 -0
- package/dist/blocks/delivery-01/index.js +1 -0
- package/dist/blocks/directory-01/directory-01.d.ts +316 -0
- package/dist/blocks/directory-01/directory-01.d.ts.map +1 -0
- package/dist/blocks/directory-01/directory-01.js +252 -0
- package/dist/blocks/directory-01/index.d.ts +3 -0
- package/dist/blocks/directory-01/index.d.ts.map +1 -0
- package/dist/blocks/directory-01/index.js +1 -0
- package/dist/blocks/download-01/download.d.ts +261 -0
- package/dist/blocks/download-01/download.d.ts.map +1 -0
- package/dist/blocks/download-01/download.js +115 -0
- package/dist/blocks/download-01/index.d.ts +3 -0
- package/dist/blocks/download-01/index.d.ts.map +1 -0
- package/dist/blocks/download-01/index.js +1 -0
- package/dist/blocks/faq-01/faq.d.ts +128 -0
- package/dist/blocks/faq-01/faq.d.ts.map +1 -0
- package/dist/blocks/faq-01/faq.js +53 -0
- package/dist/blocks/faq-01/index.d.ts +3 -0
- package/dist/blocks/faq-01/index.d.ts.map +1 -0
- package/dist/blocks/faq-01/index.js +1 -0
- package/dist/blocks/feature-rows-01/feature-rows-01.d.ts +158 -0
- package/dist/blocks/feature-rows-01/feature-rows-01.d.ts.map +1 -0
- package/dist/blocks/feature-rows-01/feature-rows-01.js +81 -0
- package/dist/blocks/feature-rows-01/index.d.ts +3 -0
- package/dist/blocks/feature-rows-01/index.d.ts.map +1 -0
- package/dist/blocks/feature-rows-01/index.js +1 -0
- package/dist/blocks/feedback-01/feedback.d.ts +235 -0
- package/dist/blocks/feedback-01/feedback.d.ts.map +1 -0
- package/dist/blocks/feedback-01/feedback.js +113 -0
- package/dist/blocks/feedback-01/index.d.ts +3 -0
- package/dist/blocks/feedback-01/index.d.ts.map +1 -0
- package/dist/blocks/feedback-01/index.js +1 -0
- package/dist/blocks/field-map-01/field-map.d.ts +247 -0
- package/dist/blocks/field-map-01/field-map.d.ts.map +1 -0
- package/dist/blocks/field-map-01/field-map.js +183 -0
- package/dist/blocks/field-map-01/index.d.ts +3 -0
- package/dist/blocks/field-map-01/index.d.ts.map +1 -0
- package/dist/blocks/field-map-01/index.js +1 -0
- package/dist/blocks/forgot-password-01/forgot-password.d.ts +288 -0
- package/dist/blocks/forgot-password-01/forgot-password.d.ts.map +1 -0
- package/dist/blocks/forgot-password-01/forgot-password.js +190 -0
- package/dist/blocks/forgot-password-01/index.d.ts +3 -0
- package/dist/blocks/forgot-password-01/index.d.ts.map +1 -0
- package/dist/blocks/forgot-password-01/index.js +1 -0
- package/dist/blocks/gallery-01/gallery.d.ts +208 -0
- package/dist/blocks/gallery-01/gallery.d.ts.map +1 -0
- package/dist/blocks/gallery-01/gallery.js +174 -0
- package/dist/blocks/gallery-01/index.d.ts +3 -0
- package/dist/blocks/gallery-01/index.d.ts.map +1 -0
- package/dist/blocks/gallery-01/index.js +1 -0
- package/dist/blocks/gantt-01/gantt.d.ts +290 -0
- package/dist/blocks/gantt-01/gantt.d.ts.map +1 -0
- package/dist/blocks/gantt-01/gantt.js +224 -0
- package/dist/blocks/gantt-01/index.d.ts +3 -0
- package/dist/blocks/gantt-01/index.d.ts.map +1 -0
- package/dist/blocks/gantt-01/index.js +1 -0
- package/dist/blocks/handoff-01/handoff-01.d.ts +326 -0
- package/dist/blocks/handoff-01/handoff-01.d.ts.map +1 -0
- package/dist/blocks/handoff-01/handoff-01.js +180 -0
- package/dist/blocks/handoff-01/index.d.ts +3 -0
- package/dist/blocks/handoff-01/index.d.ts.map +1 -0
- package/dist/blocks/handoff-01/index.js +1 -0
- package/dist/blocks/help-01/help.d.ts +254 -0
- package/dist/blocks/help-01/help.d.ts.map +1 -0
- package/dist/blocks/help-01/help.js +188 -0
- package/dist/blocks/help-01/index.d.ts +3 -0
- package/dist/blocks/help-01/index.d.ts.map +1 -0
- package/dist/blocks/help-01/index.js +1 -0
- package/dist/blocks/hero-01/hero.d.ts +105 -34
- package/dist/blocks/hero-01/hero.d.ts.map +1 -1
- package/dist/blocks/hero-01/hero.js +23 -15
- package/dist/blocks/hero-01/index.d.ts +1 -1
- package/dist/blocks/hero-01/index.d.ts.map +1 -1
- package/dist/blocks/hero-02/hero-02.d.ts +244 -0
- package/dist/blocks/hero-02/hero-02.d.ts.map +1 -0
- package/dist/blocks/hero-02/hero-02.js +87 -0
- package/dist/blocks/hero-02/index.d.ts +3 -0
- package/dist/blocks/hero-02/index.d.ts.map +1 -0
- package/dist/blocks/hero-02/index.js +1 -0
- package/dist/blocks/hero-03/hero-03.d.ts +247 -0
- package/dist/blocks/hero-03/hero-03.d.ts.map +1 -0
- package/dist/blocks/hero-03/hero-03.js +93 -0
- package/dist/blocks/hero-03/index.d.ts +3 -0
- package/dist/blocks/hero-03/index.d.ts.map +1 -0
- package/dist/blocks/hero-03/index.js +1 -0
- package/dist/blocks/history-01/history-01.d.ts +414 -0
- package/dist/blocks/history-01/history-01.d.ts.map +1 -0
- package/dist/blocks/history-01/history-01.js +285 -0
- package/dist/blocks/history-01/index.d.ts +3 -0
- package/dist/blocks/history-01/index.d.ts.map +1 -0
- package/dist/blocks/history-01/index.js +1 -0
- package/dist/blocks/inbox-01/inbox.d.ts +349 -0
- package/dist/blocks/inbox-01/inbox.d.ts.map +1 -0
- package/dist/blocks/inbox-01/inbox.js +244 -0
- package/dist/blocks/inbox-01/index.d.ts +3 -0
- package/dist/blocks/inbox-01/index.d.ts.map +1 -0
- package/dist/blocks/inbox-01/index.js +1 -0
- package/dist/blocks/index.d.ts +203 -0
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +118 -0
- package/dist/blocks/industries-01/index.d.ts +3 -0
- package/dist/blocks/industries-01/index.d.ts.map +1 -0
- package/dist/blocks/industries-01/index.js +1 -0
- package/dist/blocks/industries-01/industries.d.ts +164 -0
- package/dist/blocks/industries-01/industries.d.ts.map +1 -0
- package/dist/blocks/industries-01/industries.js +96 -0
- package/dist/blocks/intake-01/index.d.ts +3 -0
- package/dist/blocks/intake-01/index.d.ts.map +1 -0
- package/dist/blocks/intake-01/index.js +1 -0
- package/dist/blocks/intake-01/intake-01.d.ts +305 -0
- package/dist/blocks/intake-01/intake-01.d.ts.map +1 -0
- package/dist/blocks/intake-01/intake-01.js +178 -0
- package/dist/blocks/integration-01/index.d.ts +3 -0
- package/dist/blocks/integration-01/index.d.ts.map +1 -0
- package/dist/blocks/integration-01/index.js +1 -0
- package/dist/blocks/integration-01/integration.d.ts +226 -0
- package/dist/blocks/integration-01/integration.d.ts.map +1 -0
- package/dist/blocks/integration-01/integration.js +170 -0
- package/dist/blocks/invite-user-01/index.d.ts +3 -0
- package/dist/blocks/invite-user-01/index.d.ts.map +1 -0
- package/dist/blocks/invite-user-01/index.js +1 -0
- package/dist/blocks/invite-user-01/invite-user.d.ts +317 -0
- package/dist/blocks/invite-user-01/invite-user.d.ts.map +1 -0
- package/dist/blocks/invite-user-01/invite-user.js +228 -0
- package/dist/blocks/issue-detail-01/index.d.ts +3 -0
- package/dist/blocks/issue-detail-01/index.d.ts.map +1 -0
- package/dist/blocks/issue-detail-01/index.js +1 -0
- package/dist/blocks/issue-detail-01/issue-detail.d.ts +355 -0
- package/dist/blocks/issue-detail-01/issue-detail.d.ts.map +1 -0
- package/dist/blocks/issue-detail-01/issue-detail.js +187 -0
- package/dist/blocks/issue-list-01/index.d.ts +3 -0
- package/dist/blocks/issue-list-01/index.d.ts.map +1 -0
- package/dist/blocks/issue-list-01/index.js +1 -0
- package/dist/blocks/issue-list-01/issue-list.d.ts +298 -0
- package/dist/blocks/issue-list-01/issue-list.d.ts.map +1 -0
- package/dist/blocks/issue-list-01/issue-list.js +284 -0
- package/dist/blocks/kanban-01/index.d.ts +3 -0
- package/dist/blocks/kanban-01/index.d.ts.map +1 -0
- package/dist/blocks/kanban-01/index.js +1 -0
- package/dist/blocks/kanban-01/kanban.d.ts +278 -0
- package/dist/blocks/kanban-01/kanban.d.ts.map +1 -0
- package/dist/blocks/kanban-01/kanban.js +144 -0
- package/dist/blocks/leaderboard-01/index.d.ts +3 -0
- package/dist/blocks/leaderboard-01/index.d.ts.map +1 -0
- package/dist/blocks/leaderboard-01/index.js +1 -0
- package/dist/blocks/leaderboard-01/leaderboard.d.ts +250 -0
- package/dist/blocks/leaderboard-01/leaderboard.d.ts.map +1 -0
- package/dist/blocks/leaderboard-01/leaderboard.js +121 -0
- package/dist/blocks/login-01/index.d.ts +3 -0
- package/dist/blocks/login-01/index.d.ts.map +1 -0
- package/dist/blocks/login-01/index.js +1 -0
- package/dist/blocks/login-01/login-01.d.ts +356 -0
- package/dist/blocks/login-01/login-01.d.ts.map +1 -0
- package/dist/blocks/login-01/login-01.js +249 -0
- package/dist/blocks/logo-cloud-01/index.d.ts +3 -0
- package/dist/blocks/logo-cloud-01/index.d.ts.map +1 -0
- package/dist/blocks/logo-cloud-01/index.js +1 -0
- package/dist/blocks/logo-cloud-01/logo-cloud.d.ts +181 -0
- package/dist/blocks/logo-cloud-01/logo-cloud.d.ts.map +1 -0
- package/dist/blocks/logo-cloud-01/logo-cloud.js +118 -0
- package/dist/blocks/magic-link-01/index.d.ts +3 -0
- package/dist/blocks/magic-link-01/index.d.ts.map +1 -0
- package/dist/blocks/magic-link-01/index.js +1 -0
- package/dist/blocks/magic-link-01/magic-link-01.d.ts +367 -0
- package/dist/blocks/magic-link-01/magic-link-01.d.ts.map +1 -0
- package/dist/blocks/magic-link-01/magic-link-01.js +233 -0
- package/dist/blocks/member-list-01/index.d.ts +3 -0
- package/dist/blocks/member-list-01/index.d.ts.map +1 -0
- package/dist/blocks/member-list-01/index.js +1 -0
- package/dist/blocks/member-list-01/member-list.d.ts +192 -0
- package/dist/blocks/member-list-01/member-list.d.ts.map +1 -0
- package/dist/blocks/member-list-01/member-list.js +142 -0
- package/dist/blocks/milestone-timeline-01/index.d.ts +3 -0
- package/dist/blocks/milestone-timeline-01/index.d.ts.map +1 -0
- package/dist/blocks/milestone-timeline-01/index.js +1 -0
- package/dist/blocks/milestone-timeline-01/milestone-timeline.d.ts +217 -0
- package/dist/blocks/milestone-timeline-01/milestone-timeline.d.ts.map +1 -0
- package/dist/blocks/milestone-timeline-01/milestone-timeline.js +173 -0
- package/dist/blocks/newsletter-01/index.d.ts +3 -0
- package/dist/blocks/newsletter-01/index.d.ts.map +1 -0
- package/dist/blocks/newsletter-01/index.js +1 -0
- package/dist/blocks/newsletter-01/newsletter.d.ts +216 -0
- package/dist/blocks/newsletter-01/newsletter.d.ts.map +1 -0
- package/dist/blocks/newsletter-01/newsletter.js +102 -0
- package/dist/blocks/notification-center-01/index.d.ts +3 -0
- package/dist/blocks/notification-center-01/index.d.ts.map +1 -0
- package/dist/blocks/notification-center-01/index.js +1 -0
- package/dist/blocks/notification-center-01/notification-center-01.d.ts +341 -0
- package/dist/blocks/notification-center-01/notification-center-01.d.ts.map +1 -0
- package/dist/blocks/notification-center-01/notification-center-01.js +203 -0
- package/dist/blocks/offer-01/index.d.ts +3 -0
- package/dist/blocks/offer-01/index.d.ts.map +1 -0
- package/dist/blocks/offer-01/index.js +1 -0
- package/dist/blocks/offer-01/offer.d.ts +139 -0
- package/dist/blocks/offer-01/offer.d.ts.map +1 -0
- package/dist/blocks/offer-01/offer.js +81 -0
- package/dist/blocks/offering-01/index.d.ts +3 -0
- package/dist/blocks/offering-01/index.d.ts.map +1 -0
- package/dist/blocks/offering-01/index.js +1 -0
- package/dist/blocks/offering-01/offering.d.ts +245 -0
- package/dist/blocks/offering-01/offering.d.ts.map +1 -0
- package/dist/blocks/offering-01/offering.js +144 -0
- package/dist/blocks/offering-categories-01/index.d.ts +3 -0
- package/dist/blocks/offering-categories-01/index.d.ts.map +1 -0
- package/dist/blocks/offering-categories-01/index.js +1 -0
- package/dist/blocks/offering-categories-01/offering-categories.d.ts +248 -0
- package/dist/blocks/offering-categories-01/offering-categories.d.ts.map +1 -0
- package/dist/blocks/offering-categories-01/offering-categories.js +153 -0
- package/dist/blocks/offering-list-01/index.d.ts +3 -0
- package/dist/blocks/offering-list-01/index.d.ts.map +1 -0
- package/dist/blocks/offering-list-01/index.js +1 -0
- package/dist/blocks/offering-list-01/offering-list.d.ts +362 -0
- package/dist/blocks/offering-list-01/offering-list.d.ts.map +1 -0
- package/dist/blocks/offering-list-01/offering-list.js +366 -0
- package/dist/blocks/onboarding-01/index.d.ts +3 -0
- package/dist/blocks/onboarding-01/index.d.ts.map +1 -0
- package/dist/blocks/onboarding-01/index.js +1 -0
- package/dist/blocks/onboarding-01/onboarding.d.ts +199 -0
- package/dist/blocks/onboarding-01/onboarding.d.ts.map +1 -0
- package/dist/blocks/onboarding-01/onboarding.js +182 -0
- package/dist/blocks/ops-checklist-01/index.d.ts +3 -0
- package/dist/blocks/ops-checklist-01/index.d.ts.map +1 -0
- package/dist/blocks/ops-checklist-01/index.js +1 -0
- package/dist/blocks/ops-checklist-01/ops-checklist-01.d.ts +308 -0
- package/dist/blocks/ops-checklist-01/ops-checklist-01.d.ts.map +1 -0
- package/dist/blocks/ops-checklist-01/ops-checklist-01.js +165 -0
- package/dist/blocks/page-header-01/index.d.ts +1 -1
- package/dist/blocks/page-header-01/index.d.ts.map +1 -1
- package/dist/blocks/page-header-01/page-header.d.ts +131 -11
- package/dist/blocks/page-header-01/page-header.d.ts.map +1 -1
- package/dist/blocks/page-header-01/page-header.js +33 -9
- package/dist/blocks/passkey-01/index.d.ts +3 -0
- package/dist/blocks/passkey-01/index.d.ts.map +1 -0
- package/dist/blocks/passkey-01/index.js +1 -0
- package/dist/blocks/passkey-01/passkey-01.d.ts +334 -0
- package/dist/blocks/passkey-01/passkey-01.d.ts.map +1 -0
- package/dist/blocks/passkey-01/passkey-01.js +192 -0
- package/dist/blocks/permission-matrix-01/index.d.ts +3 -0
- package/dist/blocks/permission-matrix-01/index.d.ts.map +1 -0
- package/dist/blocks/permission-matrix-01/index.js +1 -0
- package/dist/blocks/permission-matrix-01/permission-matrix.d.ts +282 -0
- package/dist/blocks/permission-matrix-01/permission-matrix.d.ts.map +1 -0
- package/dist/blocks/permission-matrix-01/permission-matrix.js +173 -0
- package/dist/blocks/pricing-01/index.d.ts +1 -0
- package/dist/blocks/pricing-01/index.d.ts.map +1 -1
- package/dist/blocks/pricing-01/pricing.d.ts +118 -1
- package/dist/blocks/pricing-01/pricing.d.ts.map +1 -1
- package/dist/blocks/pricing-01/pricing.js +9 -2
- package/dist/blocks/pricing-compare-01/index.d.ts +3 -0
- package/dist/blocks/pricing-compare-01/index.d.ts.map +1 -0
- package/dist/blocks/pricing-compare-01/index.js +1 -0
- package/dist/blocks/pricing-compare-01/pricing-compare.d.ts +277 -0
- package/dist/blocks/pricing-compare-01/pricing-compare.d.ts.map +1 -0
- package/dist/blocks/pricing-compare-01/pricing-compare.js +126 -0
- package/dist/blocks/project-01/index.d.ts +3 -0
- package/dist/blocks/project-01/index.d.ts.map +1 -0
- package/dist/blocks/project-01/index.js +1 -0
- package/dist/blocks/project-01/project.d.ts +323 -0
- package/dist/blocks/project-01/project.d.ts.map +1 -0
- package/dist/blocks/project-01/project.js +247 -0
- package/dist/blocks/project-dashboard-01/index.d.ts +3 -0
- package/dist/blocks/project-dashboard-01/index.d.ts.map +1 -0
- package/dist/blocks/project-dashboard-01/index.js +1 -0
- package/dist/blocks/project-dashboard-01/project-dashboard.d.ts +200 -0
- package/dist/blocks/project-dashboard-01/project-dashboard.d.ts.map +1 -0
- package/dist/blocks/project-dashboard-01/project-dashboard.js +124 -0
- package/dist/blocks/project-list-01/index.d.ts +3 -0
- package/dist/blocks/project-list-01/index.d.ts.map +1 -0
- package/dist/blocks/project-list-01/index.js +1 -0
- package/dist/blocks/project-list-01/project-list.d.ts +301 -0
- package/dist/blocks/project-list-01/project-list.d.ts.map +1 -0
- package/dist/blocks/project-list-01/project-list.js +305 -0
- package/dist/blocks/provisioning-01/index.d.ts +3 -0
- package/dist/blocks/provisioning-01/index.d.ts.map +1 -0
- package/dist/blocks/provisioning-01/index.js +1 -0
- package/dist/blocks/provisioning-01/provisioning.d.ts +357 -0
- package/dist/blocks/provisioning-01/provisioning.d.ts.map +1 -0
- package/dist/blocks/provisioning-01/provisioning.js +230 -0
- package/dist/blocks/quick-view-01/index.d.ts +3 -0
- package/dist/blocks/quick-view-01/index.d.ts.map +1 -0
- package/dist/blocks/quick-view-01/index.js +1 -0
- package/dist/blocks/quick-view-01/quick-view.d.ts +215 -0
- package/dist/blocks/quick-view-01/quick-view.d.ts.map +1 -0
- package/dist/blocks/quick-view-01/quick-view.js +136 -0
- package/dist/blocks/rate-card-01/index.d.ts +3 -0
- package/dist/blocks/rate-card-01/index.d.ts.map +1 -0
- package/dist/blocks/rate-card-01/index.js +1 -0
- package/dist/blocks/rate-card-01/rate-card.d.ts +184 -0
- package/dist/blocks/rate-card-01/rate-card.d.ts.map +1 -0
- package/dist/blocks/rate-card-01/rate-card.js +79 -0
- package/dist/blocks/reset-password-01/index.d.ts +3 -0
- package/dist/blocks/reset-password-01/index.d.ts.map +1 -0
- package/dist/blocks/reset-password-01/index.js +1 -0
- package/dist/blocks/reset-password-01/reset-password.d.ts +276 -0
- package/dist/blocks/reset-password-01/reset-password.d.ts.map +1 -0
- package/dist/blocks/reset-password-01/reset-password.js +175 -0
- package/dist/blocks/resource-list-01/index.d.ts +3 -0
- package/dist/blocks/resource-list-01/index.d.ts.map +1 -0
- package/dist/blocks/resource-list-01/index.js +1 -0
- package/dist/blocks/resource-list-01/resource-list.d.ts +237 -0
- package/dist/blocks/resource-list-01/resource-list.d.ts.map +1 -0
- package/dist/blocks/resource-list-01/resource-list.js +154 -0
- package/dist/blocks/retention-01/index.d.ts +3 -0
- package/dist/blocks/retention-01/index.d.ts.map +1 -0
- package/dist/blocks/retention-01/index.js +1 -0
- package/dist/blocks/retention-01/retention.d.ts +255 -0
- package/dist/blocks/retention-01/retention.d.ts.map +1 -0
- package/dist/blocks/retention-01/retention.js +145 -0
- package/dist/blocks/run-console-01/run-console.d.ts +14 -1
- package/dist/blocks/run-console-01/run-console.d.ts.map +1 -1
- package/dist/blocks/run-console-01/run-console.js +4 -2
- package/dist/blocks/services-01/index.d.ts +3 -0
- package/dist/blocks/services-01/index.d.ts.map +1 -0
- package/dist/blocks/services-01/index.js +1 -0
- package/dist/blocks/services-01/services.d.ts +159 -0
- package/dist/blocks/services-01/services.d.ts.map +1 -0
- package/dist/blocks/services-01/services.js +81 -0
- package/dist/blocks/settings-integrations-01/index.d.ts +3 -0
- package/dist/blocks/settings-integrations-01/index.d.ts.map +1 -0
- package/dist/blocks/settings-integrations-01/index.js +1 -0
- package/dist/blocks/settings-integrations-01/settings-integrations.d.ts +246 -0
- package/dist/blocks/settings-integrations-01/settings-integrations.d.ts.map +1 -0
- package/dist/blocks/settings-integrations-01/settings-integrations.js +213 -0
- package/dist/blocks/settings-members-01/index.d.ts +3 -0
- package/dist/blocks/settings-members-01/index.d.ts.map +1 -0
- package/dist/blocks/settings-members-01/index.js +1 -0
- package/dist/blocks/settings-members-01/settings-members.d.ts +396 -0
- package/dist/blocks/settings-members-01/settings-members.d.ts.map +1 -0
- package/dist/blocks/settings-members-01/settings-members.js +255 -0
- package/dist/blocks/settings-notifications-01/index.d.ts +3 -0
- package/dist/blocks/settings-notifications-01/index.d.ts.map +1 -0
- package/dist/blocks/settings-notifications-01/index.js +1 -0
- package/dist/blocks/settings-notifications-01/settings-notifications.d.ts +270 -0
- package/dist/blocks/settings-notifications-01/settings-notifications.d.ts.map +1 -0
- package/dist/blocks/settings-notifications-01/settings-notifications.js +202 -0
- package/dist/blocks/settings-security-01/index.d.ts +3 -0
- package/dist/blocks/settings-security-01/index.d.ts.map +1 -0
- package/dist/blocks/settings-security-01/index.js +1 -0
- package/dist/blocks/settings-security-01/settings-security.d.ts +439 -0
- package/dist/blocks/settings-security-01/settings-security.d.ts.map +1 -0
- package/dist/blocks/settings-security-01/settings-security.js +244 -0
- package/dist/blocks/shortlist-01/index.d.ts +3 -0
- package/dist/blocks/shortlist-01/index.d.ts.map +1 -0
- package/dist/blocks/shortlist-01/index.js +1 -0
- package/dist/blocks/shortlist-01/shortlist-01.d.ts +337 -0
- package/dist/blocks/shortlist-01/shortlist-01.d.ts.map +1 -0
- package/dist/blocks/shortlist-01/shortlist-01.js +191 -0
- package/dist/blocks/showcase-01/index.d.ts +3 -0
- package/dist/blocks/showcase-01/index.d.ts.map +1 -0
- package/dist/blocks/showcase-01/index.js +1 -0
- package/dist/blocks/showcase-01/showcase-01.d.ts +238 -0
- package/dist/blocks/showcase-01/showcase-01.d.ts.map +1 -0
- package/dist/blocks/showcase-01/showcase-01.js +84 -0
- package/dist/blocks/signup-01/index.d.ts +3 -0
- package/dist/blocks/signup-01/index.d.ts.map +1 -0
- package/dist/blocks/signup-01/index.js +1 -0
- package/dist/blocks/signup-01/signup-01.d.ts +405 -0
- package/dist/blocks/signup-01/signup-01.d.ts.map +1 -0
- package/dist/blocks/signup-01/signup-01.js +209 -0
- package/dist/blocks/site-footer/site-footer.d.ts +34 -1
- package/dist/blocks/site-footer/site-footer.d.ts.map +1 -1
- package/dist/blocks/site-footer/site-footer.js +24 -2
- package/dist/blocks/site-header/site-header.js +1 -1
- package/dist/blocks/site-navbar/site-navbar.d.ts +37 -3
- package/dist/blocks/site-navbar/site-navbar.d.ts.map +1 -1
- package/dist/blocks/site-navbar/site-navbar.js +33 -4
- package/dist/blocks/spec-table-01/index.d.ts +3 -0
- package/dist/blocks/spec-table-01/index.d.ts.map +1 -0
- package/dist/blocks/spec-table-01/index.js +1 -0
- package/dist/blocks/spec-table-01/spec-table.d.ts +293 -0
- package/dist/blocks/spec-table-01/spec-table.d.ts.map +1 -0
- package/dist/blocks/spec-table-01/spec-table.js +217 -0
- package/dist/blocks/stack-grid-01/stack-grid.d.ts +13 -0
- package/dist/blocks/stack-grid-01/stack-grid.d.ts.map +1 -1
- package/dist/blocks/stack-grid-01/stack-grid.js +14 -1
- package/dist/blocks/story-01/index.d.ts +3 -0
- package/dist/blocks/story-01/index.d.ts.map +1 -0
- package/dist/blocks/story-01/index.js +1 -0
- package/dist/blocks/story-01/story.d.ts +153 -0
- package/dist/blocks/story-01/story.d.ts.map +1 -0
- package/dist/blocks/story-01/story.js +103 -0
- package/dist/blocks/summary-01/index.d.ts +3 -0
- package/dist/blocks/summary-01/index.d.ts.map +1 -0
- package/dist/blocks/summary-01/index.js +1 -0
- package/dist/blocks/summary-01/summary.d.ts +300 -0
- package/dist/blocks/summary-01/summary.d.ts.map +1 -0
- package/dist/blocks/summary-01/summary.js +174 -0
- package/dist/blocks/team-01/index.d.ts +3 -0
- package/dist/blocks/team-01/index.d.ts.map +1 -0
- package/dist/blocks/team-01/index.js +1 -0
- package/dist/blocks/team-01/team.d.ts +176 -0
- package/dist/blocks/team-01/team.d.ts.map +1 -0
- package/dist/blocks/team-01/team.js +117 -0
- package/dist/blocks/testimonial-01/index.d.ts +3 -0
- package/dist/blocks/testimonial-01/index.d.ts.map +1 -0
- package/dist/blocks/testimonial-01/index.js +1 -0
- package/dist/blocks/testimonial-01/testimonial.d.ts +173 -0
- package/dist/blocks/testimonial-01/testimonial.d.ts.map +1 -0
- package/dist/blocks/testimonial-01/testimonial.js +87 -0
- package/dist/blocks/todo-01/index.d.ts +3 -0
- package/dist/blocks/todo-01/index.d.ts.map +1 -0
- package/dist/blocks/todo-01/index.js +1 -0
- package/dist/blocks/todo-01/todo.d.ts +286 -0
- package/dist/blocks/todo-01/todo.d.ts.map +1 -0
- package/dist/blocks/todo-01/todo.js +149 -0
- package/dist/blocks/trend-01/index.d.ts +3 -0
- package/dist/blocks/trend-01/index.d.ts.map +1 -0
- package/dist/blocks/trend-01/index.js +1 -0
- package/dist/blocks/trend-01/trend.d.ts +184 -0
- package/dist/blocks/trend-01/trend.d.ts.map +1 -0
- package/dist/blocks/trend-01/trend.js +99 -0
- package/dist/blocks/trust-strip-01/index.d.ts +3 -0
- package/dist/blocks/trust-strip-01/index.d.ts.map +1 -0
- package/dist/blocks/trust-strip-01/index.js +1 -0
- package/dist/blocks/trust-strip-01/trust-strip-01.d.ts +139 -0
- package/dist/blocks/trust-strip-01/trust-strip-01.d.ts.map +1 -0
- package/dist/blocks/trust-strip-01/trust-strip-01.js +58 -0
- package/dist/blocks/two-factor-01/index.d.ts +3 -0
- package/dist/blocks/two-factor-01/index.d.ts.map +1 -0
- package/dist/blocks/two-factor-01/index.js +1 -0
- package/dist/blocks/two-factor-01/two-factor-01.d.ts +440 -0
- package/dist/blocks/two-factor-01/two-factor-01.d.ts.map +1 -0
- package/dist/blocks/two-factor-01/two-factor-01.js +273 -0
- package/dist/blocks/user-profile-01/index.d.ts +3 -0
- package/dist/blocks/user-profile-01/index.d.ts.map +1 -0
- package/dist/blocks/user-profile-01/index.js +1 -0
- package/dist/blocks/user-profile-01/user-profile-01.d.ts +258 -0
- package/dist/blocks/user-profile-01/user-profile-01.d.ts.map +1 -0
- package/dist/blocks/user-profile-01/user-profile-01.js +158 -0
- package/dist/blocks/verify-email-01/index.d.ts +3 -0
- package/dist/blocks/verify-email-01/index.d.ts.map +1 -0
- package/dist/blocks/verify-email-01/index.js +1 -0
- package/dist/blocks/verify-email-01/verify-email.d.ts +262 -0
- package/dist/blocks/verify-email-01/verify-email.d.ts.map +1 -0
- package/dist/blocks/verify-email-01/verify-email.js +190 -0
- package/dist/blocks/waitlist-01/index.d.ts +3 -0
- package/dist/blocks/waitlist-01/index.d.ts.map +1 -0
- package/dist/blocks/waitlist-01/index.js +1 -0
- package/dist/blocks/waitlist-01/waitlist.d.ts +254 -0
- package/dist/blocks/waitlist-01/waitlist.d.ts.map +1 -0
- package/dist/blocks/waitlist-01/waitlist.js +75 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +1641 -1
- package/dist/components/index.d.ts +114 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +134 -0
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +9 -2
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +22 -4
- package/dist/components/ui/announcement.d.ts +169 -0
- package/dist/components/ui/announcement.d.ts.map +1 -0
- package/dist/components/ui/announcement.js +123 -0
- package/dist/components/ui/avatar-group.d.ts +176 -0
- package/dist/components/ui/avatar-group.d.ts.map +1 -0
- package/dist/components/ui/avatar-group.js +135 -0
- package/dist/components/ui/billing-source.d.ts +293 -0
- package/dist/components/ui/billing-source.d.ts.map +1 -0
- package/dist/components/ui/billing-source.js +136 -0
- package/dist/components/ui/button.d.ts +16 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +17 -2
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +30 -2
- package/dist/components/ui/carousel.d.ts +7 -0
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +58 -1
- package/dist/components/ui/chart.d.ts +334 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +369 -0
- package/dist/components/ui/checkbox.d.ts +10 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +19 -1
- package/dist/components/ui/checklist.d.ts +262 -0
- package/dist/components/ui/checklist.d.ts.map +1 -0
- package/dist/components/ui/checklist.js +135 -0
- package/dist/components/ui/choice-card.d.ts +273 -0
- package/dist/components/ui/choice-card.d.ts.map +1 -0
- package/dist/components/ui/choice-card.js +138 -0
- package/dist/components/ui/code-block.d.ts +182 -0
- package/dist/components/ui/code-block.d.ts.map +1 -0
- package/dist/components/ui/code-block.js +108 -0
- package/dist/components/ui/cohort-grid.d.ts +210 -0
- package/dist/components/ui/cohort-grid.d.ts.map +1 -0
- package/dist/components/ui/cohort-grid.js +202 -0
- package/dist/components/ui/collapsible.d.ts +11 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +13 -2
- package/dist/components/ui/combobox.d.ts +4 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +20 -4
- package/dist/components/ui/command-palette.d.ts +11 -0
- package/dist/components/ui/command-palette.d.ts.map +1 -1
- package/dist/components/ui/command-palette.js +49 -3
- package/dist/components/ui/contribution-graph.d.ts +156 -0
- package/dist/components/ui/contribution-graph.d.ts.map +1 -0
- package/dist/components/ui/contribution-graph.js +170 -0
- package/dist/components/ui/creatable-combobox.d.ts +153 -0
- package/dist/components/ui/creatable-combobox.d.ts.map +1 -0
- package/dist/components/ui/creatable-combobox.js +285 -0
- package/dist/components/ui/data-toolbar.d.ts +133 -0
- package/dist/components/ui/data-toolbar.d.ts.map +1 -0
- package/dist/components/ui/data-toolbar.js +67 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/date-picker.js +9 -1
- package/dist/components/ui/diagram.d.ts +38 -7
- package/dist/components/ui/diagram.d.ts.map +1 -1
- package/dist/components/ui/diagram.js +134 -52
- package/dist/components/ui/dialog.d.ts +31 -2
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +40 -6
- package/dist/components/ui/drawer.d.ts +270 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +241 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +6 -1
- package/dist/components/ui/dropzone.d.ts +147 -0
- package/dist/components/ui/dropzone.d.ts.map +1 -0
- package/dist/components/ui/dropzone.js +141 -0
- package/dist/components/ui/emoji-picker.d.ts +328 -0
- package/dist/components/ui/emoji-picker.d.ts.map +1 -0
- package/dist/components/ui/emoji-picker.js +278 -0
- package/dist/components/ui/fact-list.d.ts +17 -0
- package/dist/components/ui/fact-list.d.ts.map +1 -1
- package/dist/components/ui/fact-list.js +18 -1
- package/dist/components/ui/file-upload.d.ts +152 -0
- package/dist/components/ui/file-upload.d.ts.map +1 -0
- package/dist/components/ui/file-upload.js +101 -0
- package/dist/components/ui/filter-panel.d.ts +164 -0
- package/dist/components/ui/filter-panel.d.ts.map +1 -0
- package/dist/components/ui/filter-panel.js +91 -0
- package/dist/components/ui/form-dialog.d.ts +257 -0
- package/dist/components/ui/form-dialog.d.ts.map +1 -0
- package/dist/components/ui/form-dialog.js +176 -0
- package/dist/components/ui/form-wizard.d.ts +251 -0
- package/dist/components/ui/form-wizard.d.ts.map +1 -0
- package/dist/components/ui/form-wizard.js +151 -0
- package/dist/components/ui/image-list-field.d.ts +232 -0
- package/dist/components/ui/image-list-field.d.ts.map +1 -0
- package/dist/components/ui/image-list-field.js +168 -0
- package/dist/components/ui/image-zoom.d.ts +164 -0
- package/dist/components/ui/image-zoom.d.ts.map +1 -0
- package/dist/components/ui/image-zoom.js +169 -0
- package/dist/components/ui/intensity-grid.d.ts +270 -0
- package/dist/components/ui/intensity-grid.d.ts.map +1 -0
- package/dist/components/ui/intensity-grid.js +211 -0
- package/dist/components/ui/lifecycle-button.d.ts +276 -0
- package/dist/components/ui/lifecycle-button.d.ts.map +1 -0
- package/dist/components/ui/lifecycle-button.js +144 -0
- package/dist/components/ui/lightbox.d.ts +165 -0
- package/dist/components/ui/lightbox.d.ts.map +1 -0
- package/dist/components/ui/lightbox.js +130 -0
- package/dist/components/ui/list-panel.d.ts +288 -0
- package/dist/components/ui/list-panel.d.ts.map +1 -0
- package/dist/components/ui/list-panel.js +139 -0
- package/dist/components/ui/mega-menu.d.ts +244 -0
- package/dist/components/ui/mega-menu.d.ts.map +1 -0
- package/dist/components/ui/mega-menu.js +97 -0
- package/dist/components/ui/menubar.d.ts +9 -0
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +10 -1
- package/dist/components/ui/metric.d.ts +123 -0
- package/dist/components/ui/metric.d.ts.map +1 -0
- package/dist/components/ui/metric.js +68 -0
- package/dist/components/ui/mini-calendar.d.ts +143 -0
- package/dist/components/ui/mini-calendar.d.ts.map +1 -0
- package/dist/components/ui/mini-calendar.js +261 -0
- package/dist/components/ui/mode-toggle.d.ts +102 -0
- package/dist/components/ui/mode-toggle.d.ts.map +1 -0
- package/dist/components/ui/mode-toggle.js +83 -0
- package/dist/components/ui/money-field.d.ts +200 -0
- package/dist/components/ui/money-field.d.ts.map +1 -0
- package/dist/components/ui/money-field.js +215 -0
- package/dist/components/ui/multi-combobox.d.ts +181 -0
- package/dist/components/ui/multi-combobox.d.ts.map +1 -0
- package/dist/components/ui/multi-combobox.js +297 -0
- package/dist/components/ui/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select.js +8 -1
- package/dist/components/ui/navigation-menu.d.ts +7 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +8 -1
- package/dist/components/ui/nested-tabs.d.ts +188 -0
- package/dist/components/ui/nested-tabs.d.ts.map +1 -0
- package/dist/components/ui/nested-tabs.js +75 -0
- package/dist/components/ui/number-field.d.ts +40 -7
- package/dist/components/ui/number-field.d.ts.map +1 -1
- package/dist/components/ui/number-field.js +37 -7
- package/dist/components/ui/overflow-actions.d.ts +169 -0
- package/dist/components/ui/overflow-actions.d.ts.map +1 -0
- package/dist/components/ui/overflow-actions.js +266 -0
- package/dist/components/ui/pack-swatch.d.ts +177 -0
- package/dist/components/ui/pack-swatch.d.ts.map +1 -0
- package/dist/components/ui/pack-swatch.js +117 -0
- package/dist/components/ui/pack-switcher.d.ts +221 -0
- package/dist/components/ui/pack-switcher.d.ts.map +1 -0
- package/dist/components/ui/pack-switcher.js +94 -0
- package/dist/components/ui/pagination.d.ts +22 -0
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +23 -1
- package/dist/components/ui/password-field.d.ts +122 -0
- package/dist/components/ui/password-field.d.ts.map +1 -0
- package/dist/components/ui/password-field.js +69 -0
- package/dist/components/ui/pill.d.ts +172 -0
- package/dist/components/ui/pill.d.ts.map +1 -0
- package/dist/components/ui/pill.js +102 -0
- package/dist/components/ui/platform-modifier-key.d.ts +129 -0
- package/dist/components/ui/platform-modifier-key.d.ts.map +1 -0
- package/dist/components/ui/platform-modifier-key.js +125 -0
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +8 -1
- package/dist/components/ui/price.d.ts +144 -0
- package/dist/components/ui/price.d.ts.map +1 -0
- package/dist/components/ui/price.js +107 -0
- package/dist/components/ui/progress.d.ts +55 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +110 -2
- package/dist/components/ui/prompt-composer.d.ts +302 -0
- package/dist/components/ui/prompt-composer.d.ts.map +1 -0
- package/dist/components/ui/prompt-composer.js +145 -0
- package/dist/components/ui/proportion-list.d.ts +188 -0
- package/dist/components/ui/proportion-list.d.ts.map +1 -0
- package/dist/components/ui/proportion-list.js +134 -0
- package/dist/components/ui/prose.d.ts +34 -0
- package/dist/components/ui/prose.d.ts.map +1 -1
- package/dist/components/ui/prose.js +41 -1
- package/dist/components/ui/pulse-graph.d.ts +36 -4
- package/dist/components/ui/pulse-graph.d.ts.map +1 -1
- package/dist/components/ui/pulse-graph.js +174 -60
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +8 -1
- package/dist/components/ui/range-field.d.ts +158 -0
- package/dist/components/ui/range-field.d.ts.map +1 -0
- package/dist/components/ui/range-field.js +208 -0
- package/dist/components/ui/relative-time.d.ts +116 -0
- package/dist/components/ui/relative-time.d.ts.map +1 -0
- package/dist/components/ui/relative-time.js +67 -0
- package/dist/components/ui/reorderable-list.d.ts +262 -0
- package/dist/components/ui/reorderable-list.d.ts.map +1 -0
- package/dist/components/ui/reorderable-list.js +325 -0
- package/dist/components/ui/repeatable-rows.d.ts +241 -0
- package/dist/components/ui/repeatable-rows.d.ts.map +1 -0
- package/dist/components/ui/repeatable-rows.js +221 -0
- package/dist/components/ui/repo-stars.d.ts +165 -0
- package/dist/components/ui/repo-stars.d.ts.map +1 -0
- package/dist/components/ui/repo-stars.js +92 -0
- package/dist/components/ui/resizable.d.ts +24 -0
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +96 -4
- package/dist/components/ui/search-dialog.d.ts +40 -5
- package/dist/components/ui/search-dialog.d.ts.map +1 -1
- package/dist/components/ui/search-dialog.js +94 -16
- package/dist/components/ui/search-field.d.ts +159 -0
- package/dist/components/ui/search-field.d.ts.map +1 -0
- package/dist/components/ui/search-field.js +98 -0
- package/dist/components/ui/section.d.ts +110 -1
- package/dist/components/ui/section.d.ts.map +1 -1
- package/dist/components/ui/section.js +111 -3
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +9 -1
- package/dist/components/ui/selection-toolbar.d.ts +166 -0
- package/dist/components/ui/selection-toolbar.d.ts.map +1 -0
- package/dist/components/ui/selection-toolbar.js +139 -0
- package/dist/components/ui/sidebar.d.ts +29 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +35 -2
- package/dist/components/ui/signal-field.d.ts.map +1 -1
- package/dist/components/ui/signal-field.js +1 -1
- package/dist/components/ui/slider.d.ts +7 -0
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +32 -1
- package/dist/components/ui/sparkline.d.ts +117 -0
- package/dist/components/ui/sparkline.d.ts.map +1 -0
- package/dist/components/ui/sparkline.js +113 -0
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +13 -0
- package/dist/components/ui/split-button.d.ts +207 -0
- package/dist/components/ui/split-button.d.ts.map +1 -0
- package/dist/components/ui/split-button.js +75 -0
- package/dist/components/ui/stateful-table.d.ts +345 -0
- package/dist/components/ui/stateful-table.d.ts.map +1 -0
- package/dist/components/ui/stateful-table.js +169 -0
- package/dist/components/ui/status.d.ts +99 -0
- package/dist/components/ui/status.d.ts.map +1 -0
- package/dist/components/ui/status.js +63 -0
- package/dist/components/ui/stepper.d.ts +155 -0
- package/dist/components/ui/stepper.d.ts.map +1 -0
- package/dist/components/ui/stepper.js +83 -0
- package/dist/components/ui/steps.d.ts +141 -0
- package/dist/components/ui/steps.d.ts.map +1 -0
- package/dist/components/ui/steps.js +128 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +12 -1
- package/dist/components/ui/tabs.d.ts +21 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +23 -4
- package/dist/components/ui/tag-group.d.ts +154 -0
- package/dist/components/ui/tag-group.d.ts.map +1 -0
- package/dist/components/ui/tag-group.js +111 -0
- package/dist/components/ui/task-progress.d.ts +149 -0
- package/dist/components/ui/task-progress.d.ts.map +1 -0
- package/dist/components/ui/task-progress.js +110 -0
- package/dist/components/ui/text-format-toolbar.d.ts +211 -0
- package/dist/components/ui/text-format-toolbar.d.ts.map +1 -0
- package/dist/components/ui/text-format-toolbar.js +186 -0
- package/dist/components/ui/timeline.d.ts.map +1 -1
- package/dist/components/ui/timeline.js +10 -1
- package/dist/components/ui/toast.d.ts +32 -10
- package/dist/components/ui/toast.d.ts.map +1 -1
- package/dist/components/ui/toast.js +150 -47
- package/dist/components/ui/toggle-group.d.ts +14 -5
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +15 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +9 -1
- package/dist/components/ui/tree.d.ts +8 -0
- package/dist/components/ui/tree.d.ts.map +1 -1
- package/dist/components/ui/tree.js +92 -13
- package/dist/components/ui/video-player.d.ts +236 -0
- package/dist/components/ui/video-player.d.ts.map +1 -0
- package/dist/components/ui/video-player.js +72 -0
- package/dist/fonts/inter-latin-400-italic.woff2 +0 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -0
- package/dist/lib/figure.d.ts +149 -0
- package/dist/lib/figure.d.ts.map +1 -0
- package/dist/lib/figure.js +242 -0
- package/dist/lib/utils.d.ts +29 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +35 -0
- package/dist/live/index.d.ts +10 -3
- package/dist/live/index.d.ts.map +1 -1
- package/dist/live/index.js +12 -3
- package/dist/live/run-stream-01/run-stream.d.ts.map +1 -1
- package/dist/live/run-stream-01/run-stream.js +6 -5
- package/dist/live/tool-ledger-01/index.d.ts +3 -0
- package/dist/live/tool-ledger-01/index.d.ts.map +1 -0
- package/dist/live/tool-ledger-01/index.js +1 -0
- package/dist/live/tool-ledger-01/tool-ledger.d.ts +348 -0
- package/dist/live/tool-ledger-01/tool-ledger.d.ts.map +1 -0
- package/dist/live/tool-ledger-01/tool-ledger.js +245 -0
- package/dist/pages/about-page/index.d.ts +306 -0
- package/dist/pages/about-page/index.d.ts.map +1 -0
- package/dist/pages/about-page/index.js +161 -0
- package/dist/pages/blog-post-page/index.d.ts +36 -15
- package/dist/pages/blog-post-page/index.d.ts.map +1 -1
- package/dist/pages/blog-post-page/index.js +35 -10
- package/dist/pages/careers-page/index.d.ts +288 -0
- package/dist/pages/careers-page/index.d.ts.map +1 -0
- package/dist/pages/careers-page/index.js +182 -0
- package/dist/pages/changelog-page/index.d.ts +255 -0
- package/dist/pages/changelog-page/index.d.ts.map +1 -0
- package/dist/pages/changelog-page/index.js +86 -0
- package/dist/pages/contact-page/index.d.ts +261 -0
- package/dist/pages/contact-page/index.d.ts.map +1 -0
- package/dist/pages/contact-page/index.js +136 -0
- package/dist/pages/docs-shell/docs-shell.d.ts +126 -16
- package/dist/pages/docs-shell/docs-shell.d.ts.map +1 -1
- package/dist/pages/docs-shell/docs-shell.js +229 -28
- package/dist/pages/error-page/index.d.ts +188 -0
- package/dist/pages/error-page/index.d.ts.map +1 -0
- package/dist/pages/error-page/index.js +102 -0
- package/dist/pages/index.d.ts +10 -0
- package/dist/pages/index.d.ts.map +1 -1
- package/dist/pages/index.js +14 -0
- package/dist/pages/legal-page/index.d.ts +194 -0
- package/dist/pages/legal-page/index.d.ts.map +1 -0
- package/dist/pages/legal-page/index.js +99 -0
- package/dist/pages/not-found-page/index.d.ts.map +1 -1
- package/dist/pages/not-found-page/index.js +4 -3
- package/dist/pages/onboarding-page/index.d.ts +199 -0
- package/dist/pages/onboarding-page/index.d.ts.map +1 -0
- package/dist/pages/onboarding-page/index.js +71 -0
- package/dist/pages/pricing-page/index.d.ts +286 -0
- package/dist/pages/pricing-page/index.d.ts.map +1 -0
- package/dist/pages/pricing-page/index.js +139 -0
- package/dist/pages/search-page/index.d.ts +305 -0
- package/dist/pages/search-page/index.d.ts.map +1 -0
- package/dist/pages/search-page/index.js +142 -0
- package/dist/pages/status-page/index.d.ts +366 -0
- package/dist/pages/status-page/index.d.ts.map +1 -0
- package/dist/pages/status-page/index.js +136 -0
- package/dist/styles.css +1105 -62
- package/package.json +9 -3
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
/** The props a `ModeToggle` takes. */
|
|
3
|
+
export interface ModeToggleProps extends Omit<ComponentProps<'button'>, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* The control's accessible name.
|
|
6
|
+
*
|
|
7
|
+
* Required, and a `string` rather than a node because it is written into
|
|
8
|
+
* `aria-label` and an accessible name is a string. It names the mode the button
|
|
9
|
+
* moves to rather than the mode the page is in, so the words and the icon
|
|
10
|
+
* beside them always say the same thing. Three of the four products in this
|
|
11
|
+
* family phrase it the other way round, which is a caller's sentence and not a
|
|
12
|
+
* Component's, and the prop is where that difference goes.
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* The control's height, forwarded to `Button`.
|
|
17
|
+
*
|
|
18
|
+
* `sm` and `md` and nothing else, because those are the two heights a site
|
|
19
|
+
* header and a settings row actually need. The underlying `Button` also has an
|
|
20
|
+
* icon size, which is refused here: an icon-only control with a label's
|
|
21
|
+
* proportions is what this is, and the icon size draws a square, which shows in
|
|
22
|
+
* the corner radius a reader sees.
|
|
23
|
+
*/
|
|
24
|
+
size?: 'sm' | 'md';
|
|
25
|
+
/** Layout only, exactly as on every Component. */
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The control that moves the reader between the light and the dark mode.
|
|
30
|
+
*
|
|
31
|
+
* **This is the one Component in the library that needs `PrismProvider` above it,
|
|
32
|
+
* and the reason is that it is the only one that writes the theme rather than
|
|
33
|
+
* reading it.** Every other Component reaches its colours through the cascade: the
|
|
34
|
+
* pack is an attribute on an ancestor and the mode is a class, and a Component
|
|
35
|
+
* that draws a `bg-primary` has drawn the right thing in every pack without
|
|
36
|
+
* knowing which pack it is in. This one cannot work that way, because moving
|
|
37
|
+
* between the modes means writing `.dark` on the document element, and the
|
|
38
|
+
* document element is not a thing a Component may reach for on its own. The
|
|
39
|
+
* provider is that permission, and it is optional everywhere else in Prism, which
|
|
40
|
+
* is why this is the only Component with a hard dependency on it. Mounted without
|
|
41
|
+
* one, `usePrismTheme` throws, and that is the intended behaviour rather than a
|
|
42
|
+
* silent no-op: a control that looks like it switches the mode and does nothing
|
|
43
|
+
* is worse than a page that says the provider is missing.
|
|
44
|
+
*
|
|
45
|
+
* **It renders one button and not a group, and a two-button group here is a
|
|
46
|
+
* segmented control doing a switch's job.** The obvious alternative is a pair of
|
|
47
|
+
* buttons, one per mode, with the current one marked selected. It is worse three
|
|
48
|
+
* separate ways. It takes two tab stops where the action needs one, so a reader
|
|
49
|
+
* tabbing along a header pays for a second stop to learn a thing the first stop
|
|
50
|
+
* already said. It announces a radio group, which changes what the arrow keys do
|
|
51
|
+
* inside it, so a reader who has learned the row they are in has to learn another
|
|
52
|
+
* model in the row above it. And it is the wrong role: two options where one is
|
|
53
|
+
* always selected and choosing either one leaves the page in the same state as
|
|
54
|
+
* choosing the other is a switch, and `toggle-group.tsx` is where a switch with
|
|
55
|
+
* two labelled members belongs, with the roving tab stop and the pressed set it
|
|
56
|
+
* already implements. A `Switch` is the other candidate and is refused for a
|
|
57
|
+
* different reason: a switch says "this setting is on" and a mode is not a
|
|
58
|
+
* setting, it is which of two renderings the page is using right now.
|
|
59
|
+
*
|
|
60
|
+
* **The icon is the destination and the name is the destination, so the two can
|
|
61
|
+
* never contradict each other.** A page in light mode shows a moon, because
|
|
62
|
+
* pressing it makes the page dark. The alternative, showing the current mode, puts
|
|
63
|
+
* a sun on a light page, which reads as a control that is already on, and a reader
|
|
64
|
+
* has to reconcile the picture with the state before they can use it. The icon is
|
|
65
|
+
* swapped, not animated between: the Motion law refuses a transition whose only
|
|
66
|
+
* purpose is decoration, and a sun morphing into a moon is decoration on a
|
|
67
|
+
* control that is about to be re-rendered with the other one anyway. So there is
|
|
68
|
+
* no transition here at all, and the swap is a repaint.
|
|
69
|
+
*
|
|
70
|
+
* **There is no `aria-pressed`, and that is a decision with a cost.** A pressed
|
|
71
|
+
* state describes the current mode, and the name describes the mode the press
|
|
72
|
+
* produces, so a pressed control named for its destination announces the opposite
|
|
73
|
+
* of what it is about: a screen reader reads "Switch to dark mode, pressed" on a
|
|
74
|
+
* page that is already dark. Since this Component takes one name rather than one
|
|
75
|
+
* per mode, the name cannot describe the current mode, and the honest reading of
|
|
76
|
+
* what is left is a button that performs an action. The cost is that a reader
|
|
77
|
+
* using a screen reader cannot ask the control what the page is in; they read the
|
|
78
|
+
* mode from the page, and a caller who would rather the control carried the state
|
|
79
|
+
* passes a name for the mode itself and mounts their own control, which is a real
|
|
80
|
+
* answer this Component is declining to give.
|
|
81
|
+
*
|
|
82
|
+
* **A reader who never mounts this is not left without the mode.** The mode on the
|
|
83
|
+
* page comes from the two document attributes, `data-pack` and `.dark`, and the
|
|
84
|
+
* blocking script in the head resolves them before first paint from a stored value
|
|
85
|
+
* or from what the server rendered. That is the declarative path, it is
|
|
86
|
+
* SSR-safe, and it is the one that works with no JavaScript at all. So this
|
|
87
|
+
* Component is a convenience layered on top of a mechanism that already works, not
|
|
88
|
+
* the mechanism, and a consumer who does not want a client Component in their
|
|
89
|
+
* layout can leave this one out: they put the attributes on their root element
|
|
90
|
+
* and write a plain button in their own code that calls `setMode` from the
|
|
91
|
+
* provider's hook. That is the reason the honest dependency is stated rather than
|
|
92
|
+
* hidden. A site that wants the mode switch with no JavaScript at all renders the
|
|
93
|
+
* attributes on the root and offers the choice inside a form, which is a real
|
|
94
|
+
* answer and a slightly worse one than a button.
|
|
95
|
+
*
|
|
96
|
+
* It is a client Component, and the provider it reads is a client module, so
|
|
97
|
+
* there is no way to make this one without `'use client'`. That is the cost of
|
|
98
|
+
* writing the theme rather than reading it, paid once, here.
|
|
99
|
+
*/
|
|
100
|
+
declare function ModeToggle({ label, size, className, ...props }: ModeToggleProps): import("react").JSX.Element;
|
|
101
|
+
export { ModeToggle };
|
|
102
|
+
//# sourceMappingURL=mode-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/ui/mode-toggle.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAM3C,sCAAsC;AACtC,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACjF;;;;;;;;;OASG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,iBAAS,UAAU,CAAC,EAAE,KAAK,EAAE,IAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BA+B/E;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Moon, Sun } from 'lucide-react';
|
|
4
|
+
import { usePrismTheme } from '../../provider/index.js';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* The control that moves the reader between the light and the dark mode.
|
|
9
|
+
*
|
|
10
|
+
* **This is the one Component in the library that needs `PrismProvider` above it,
|
|
11
|
+
* and the reason is that it is the only one that writes the theme rather than
|
|
12
|
+
* reading it.** Every other Component reaches its colours through the cascade: the
|
|
13
|
+
* pack is an attribute on an ancestor and the mode is a class, and a Component
|
|
14
|
+
* that draws a `bg-primary` has drawn the right thing in every pack without
|
|
15
|
+
* knowing which pack it is in. This one cannot work that way, because moving
|
|
16
|
+
* between the modes means writing `.dark` on the document element, and the
|
|
17
|
+
* document element is not a thing a Component may reach for on its own. The
|
|
18
|
+
* provider is that permission, and it is optional everywhere else in Prism, which
|
|
19
|
+
* is why this is the only Component with a hard dependency on it. Mounted without
|
|
20
|
+
* one, `usePrismTheme` throws, and that is the intended behaviour rather than a
|
|
21
|
+
* silent no-op: a control that looks like it switches the mode and does nothing
|
|
22
|
+
* is worse than a page that says the provider is missing.
|
|
23
|
+
*
|
|
24
|
+
* **It renders one button and not a group, and a two-button group here is a
|
|
25
|
+
* segmented control doing a switch's job.** The obvious alternative is a pair of
|
|
26
|
+
* buttons, one per mode, with the current one marked selected. It is worse three
|
|
27
|
+
* separate ways. It takes two tab stops where the action needs one, so a reader
|
|
28
|
+
* tabbing along a header pays for a second stop to learn a thing the first stop
|
|
29
|
+
* already said. It announces a radio group, which changes what the arrow keys do
|
|
30
|
+
* inside it, so a reader who has learned the row they are in has to learn another
|
|
31
|
+
* model in the row above it. And it is the wrong role: two options where one is
|
|
32
|
+
* always selected and choosing either one leaves the page in the same state as
|
|
33
|
+
* choosing the other is a switch, and `toggle-group.tsx` is where a switch with
|
|
34
|
+
* two labelled members belongs, with the roving tab stop and the pressed set it
|
|
35
|
+
* already implements. A `Switch` is the other candidate and is refused for a
|
|
36
|
+
* different reason: a switch says "this setting is on" and a mode is not a
|
|
37
|
+
* setting, it is which of two renderings the page is using right now.
|
|
38
|
+
*
|
|
39
|
+
* **The icon is the destination and the name is the destination, so the two can
|
|
40
|
+
* never contradict each other.** A page in light mode shows a moon, because
|
|
41
|
+
* pressing it makes the page dark. The alternative, showing the current mode, puts
|
|
42
|
+
* a sun on a light page, which reads as a control that is already on, and a reader
|
|
43
|
+
* has to reconcile the picture with the state before they can use it. The icon is
|
|
44
|
+
* swapped, not animated between: the Motion law refuses a transition whose only
|
|
45
|
+
* purpose is decoration, and a sun morphing into a moon is decoration on a
|
|
46
|
+
* control that is about to be re-rendered with the other one anyway. So there is
|
|
47
|
+
* no transition here at all, and the swap is a repaint.
|
|
48
|
+
*
|
|
49
|
+
* **There is no `aria-pressed`, and that is a decision with a cost.** A pressed
|
|
50
|
+
* state describes the current mode, and the name describes the mode the press
|
|
51
|
+
* produces, so a pressed control named for its destination announces the opposite
|
|
52
|
+
* of what it is about: a screen reader reads "Switch to dark mode, pressed" on a
|
|
53
|
+
* page that is already dark. Since this Component takes one name rather than one
|
|
54
|
+
* per mode, the name cannot describe the current mode, and the honest reading of
|
|
55
|
+
* what is left is a button that performs an action. The cost is that a reader
|
|
56
|
+
* using a screen reader cannot ask the control what the page is in; they read the
|
|
57
|
+
* mode from the page, and a caller who would rather the control carried the state
|
|
58
|
+
* passes a name for the mode itself and mounts their own control, which is a real
|
|
59
|
+
* answer this Component is declining to give.
|
|
60
|
+
*
|
|
61
|
+
* **A reader who never mounts this is not left without the mode.** The mode on the
|
|
62
|
+
* page comes from the two document attributes, `data-pack` and `.dark`, and the
|
|
63
|
+
* blocking script in the head resolves them before first paint from a stored value
|
|
64
|
+
* or from what the server rendered. That is the declarative path, it is
|
|
65
|
+
* SSR-safe, and it is the one that works with no JavaScript at all. So this
|
|
66
|
+
* Component is a convenience layered on top of a mechanism that already works, not
|
|
67
|
+
* the mechanism, and a consumer who does not want a client Component in their
|
|
68
|
+
* layout can leave this one out: they put the attributes on their root element
|
|
69
|
+
* and write a plain button in their own code that calls `setMode` from the
|
|
70
|
+
* provider's hook. That is the reason the honest dependency is stated rather than
|
|
71
|
+
* hidden. A site that wants the mode switch with no JavaScript at all renders the
|
|
72
|
+
* attributes on the root and offers the choice inside a form, which is a real
|
|
73
|
+
* answer and a slightly worse one than a button.
|
|
74
|
+
*
|
|
75
|
+
* It is a client Component, and the provider it reads is a client module, so
|
|
76
|
+
* there is no way to make this one without `'use client'`. That is the cost of
|
|
77
|
+
* writing the theme rather than reading it, paid once, here.
|
|
78
|
+
*/
|
|
79
|
+
function ModeToggle({ label, size = 'md', className, ...props }) {
|
|
80
|
+
const { mode, toggleMode } = usePrismTheme();
|
|
81
|
+
return (_jsx(Button, { type: "button", "data-slot": "mode-toggle", variant: "ghost", size: size === 'sm' ? 'sm' : 'default', "aria-label": label, onClick: toggleMode, className: cn('shrink-0', className), ...props, children: mode === 'dark' ? (_jsx(Sun, { "aria-hidden": "true", className: "size-4" })) : (_jsx(Moon, { "aria-hidden": "true", className: "size-4" })) }));
|
|
82
|
+
}
|
|
83
|
+
export { ModeToggle };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { type FocusEventHandler } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props the Money field accepts.
|
|
4
|
+
*
|
|
5
|
+
* A declared interface rather than a forwarded native one, and the reason is the
|
|
6
|
+
* gate on the surface rather than a preference: a forwarded `value` and
|
|
7
|
+
* `onChange` would be a second way to say what the field holds, and `value` here
|
|
8
|
+
* is a number while the DOM's is a string, so forwarding the native pair would
|
|
9
|
+
* make it possible to pass a string where a number belongs. The native attributes
|
|
10
|
+
* a money field genuinely needs are named individually below.
|
|
11
|
+
*/
|
|
12
|
+
export interface MoneyFieldProps {
|
|
13
|
+
/**
|
|
14
|
+
* The amount, as a number.
|
|
15
|
+
*
|
|
16
|
+
* Required and controlled, and a number rather than a string for the whole
|
|
17
|
+
* reason this Component exists: the value the caller holds and the value the
|
|
18
|
+
* reader sees are different kinds of thing, and only one of them is arithmetic.
|
|
19
|
+
* `null` means the field is empty, which is a different fact from zero and is
|
|
20
|
+
* reported as `null` rather than as a number the reader never typed.
|
|
21
|
+
*/
|
|
22
|
+
value: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* Called with the amount the reader's text currently parses to.
|
|
25
|
+
*
|
|
26
|
+
* Required, and called on every keystroke rather than on blur, because a form
|
|
27
|
+
* that learns the amount only when the reader leaves the field has already lost
|
|
28
|
+
* the reason to keep the text at all. It is called with `null` when the text
|
|
29
|
+
* holds no amount yet, which includes a partially typed one: `12.`, `-` and `.5`
|
|
30
|
+
* are all legitimate states of a field somebody is typing into, and reporting
|
|
31
|
+
* them as a number would report a number the reader did not mean.
|
|
32
|
+
*/
|
|
33
|
+
onValueChange: (value: number | null) => void;
|
|
34
|
+
/**
|
|
35
|
+
* The locale the amount is written in.
|
|
36
|
+
*
|
|
37
|
+
* Required, because a locale is a claim about the caller's market and this
|
|
38
|
+
* Component may not guess one. It decides the grouping separator, the decimal
|
|
39
|
+
* separator, and how many fraction digits the currency has: `1.234,56` in
|
|
40
|
+
* `de-DE` and `1,234.56` in `en-US` are the same amount typed two ways, and a
|
|
41
|
+
* Component that hardcoded either one would be wrong for every reader in the
|
|
42
|
+
* other half of the world.
|
|
43
|
+
*/
|
|
44
|
+
locale: Intl.LocalesArgument;
|
|
45
|
+
/**
|
|
46
|
+
* The currency, as an ISO 4217 code.
|
|
47
|
+
*
|
|
48
|
+
* Required, and a code rather than a symbol for three reasons: the symbol is
|
|
49
|
+
* read back out of the platform so no two products can disagree about it, a code
|
|
50
|
+
* is the one currency name every product already holds, and a symbol as an input
|
|
51
|
+
* would be an input that cannot be validated. `Intl` throws on a code it does not
|
|
52
|
+
* recognise, which is the right place for that error.
|
|
53
|
+
*/
|
|
54
|
+
currency: string;
|
|
55
|
+
/**
|
|
56
|
+
* The field's own id, so a `Label` elsewhere can point at it.
|
|
57
|
+
*
|
|
58
|
+
* A native attribute forwarded untouched, because an id is a fact about the
|
|
59
|
+
* caller's form rather than about this Component.
|
|
60
|
+
*/
|
|
61
|
+
id?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The field's accessible name, when no visible label is used.
|
|
64
|
+
*
|
|
65
|
+
* Optional and not defaulted, because the visible label is the ordinary answer
|
|
66
|
+
* and a defaulted name here would be the English Prism guessed in place of the
|
|
67
|
+
* caller's own word.
|
|
68
|
+
*/
|
|
69
|
+
'aria-label'?: string;
|
|
70
|
+
/**
|
|
71
|
+
* What the reader is expected to do with the amount.
|
|
72
|
+
*
|
|
73
|
+
* Forwarded rather than drawn, so a form can describe the field in one sentence
|
|
74
|
+
* a screen reader will reach. There is no `name`: a money field submits the text
|
|
75
|
+
* the reader typed, with this locale's punctuation in it, and a caller who needs
|
|
76
|
+
* a numeric submit owns a hidden input holding the number.
|
|
77
|
+
*/
|
|
78
|
+
describedBy?: string;
|
|
79
|
+
/** Whether the reader may not change the amount. */
|
|
80
|
+
readOnly?: boolean;
|
|
81
|
+
/** Whether the field ignores interaction. */
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether an amount must be entered.
|
|
85
|
+
*
|
|
86
|
+
* Announced on the field as `aria-required` rather than enforced by the browser's
|
|
87
|
+
* own `required`, for the same reason the JSDoc on `onBlur` matters: the browser
|
|
88
|
+
* refuses to submit with a message in English, and this Component may not choose
|
|
89
|
+
* a word for the reader. Enforce it in the caller's own submit handler, where it
|
|
90
|
+
* can be said in the caller's language.
|
|
91
|
+
*/
|
|
92
|
+
required?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The keyboard the field asks for. @defaultValue 'decimal'
|
|
95
|
+
*
|
|
96
|
+
* A `decimal` keyboard is the one with the separator a money field needs, and it
|
|
97
|
+
* is the default because a `numeric` keyboard on a phone has no decimal point at
|
|
98
|
+
* all. Override it for a market that types amounts some other way; the parser
|
|
99
|
+
* reads whatever the reader produced.
|
|
100
|
+
*/
|
|
101
|
+
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal';
|
|
102
|
+
/**
|
|
103
|
+
* Called when the reader leaves the field, after the text has been re-formatted.
|
|
104
|
+
*
|
|
105
|
+
* Forwarded rather than drawn, and last in the Component's own handler on
|
|
106
|
+
* purpose: a caller's handler runs against a field that has already settled,
|
|
107
|
+
* so a validation that reads the field at that moment reads what the reader is
|
|
108
|
+
* looking at and not the keystrokes they are leaving behind.
|
|
109
|
+
*/
|
|
110
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
111
|
+
/** Layout only. Changing a Prism-owned visual property from here is prohibited. */
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A field that holds a currency amount as a number and shows it as the reader's
|
|
116
|
+
* market writes it.
|
|
117
|
+
*
|
|
118
|
+
* **The number the caller holds and the string the reader sees are different
|
|
119
|
+
* kinds of thing, and the round trip between them is the Component.** Everything
|
|
120
|
+
* else here follows from that. The caller passes a `number` and gets a `number`
|
|
121
|
+
* back; the field draws the platform's own rendering of that number in the
|
|
122
|
+
* caller's locale and the caller's currency; and every character the reader adds
|
|
123
|
+
* is parsed back into one. A field that handed the caller a string would push the
|
|
124
|
+
* parsing into every consumer, and a field that printed a hardcoded `$1,234.56`
|
|
125
|
+
* would be making three claims about every product that installed it.
|
|
126
|
+
*
|
|
127
|
+
* **The currency symbol is an input and not an output, and the difference is the
|
|
128
|
+
* whole of the composition.** It sits in the field's own frame, drawn by
|
|
129
|
+
* `InputGroupAddon`, read out of `Intl.NumberFormat` rather than written here, and
|
|
130
|
+
* it is hidden from the accessibility tree: a screen reader reads the digits, and
|
|
131
|
+
* the currency belongs in the field's accessible name, which is the caller's
|
|
132
|
+
* word. It is also not part of the value. The number a caller holds is `1234.56`
|
|
133
|
+
* whatever the reader sees on screen, and a symbol that leaked into the parse would
|
|
134
|
+
* make the same amount parse two ways depending on whether the reader typed it.
|
|
135
|
+
*
|
|
136
|
+
* **Nothing about a currency may be a literal in this file.** The symbol, the
|
|
137
|
+
* grouping and the decimal separators, and the number of fraction digits all come
|
|
138
|
+
* out of the platform for the locale and the code the caller passed. `de-DE` with
|
|
139
|
+
* `EUR` and `en-US` with `USD` differ in all four, and a Component that hardcoded
|
|
140
|
+
* any of them would be right for one market and silently wrong for the rest.
|
|
141
|
+
*
|
|
142
|
+
* **A partially typed amount is a legitimate state and the parser must not reject
|
|
143
|
+
* it.** `12.`, `-` and `.5` are all things a person is in the middle of typing,
|
|
144
|
+
* and `12,` and `,5` are the same three in a locale that separates with a comma.
|
|
145
|
+
* So the parser is not asked whether the text is a valid amount, only whether it
|
|
146
|
+
* currently means one: it reports `12` for `12.`, it reports nothing for a lone sign
|
|
147
|
+
* and for a lone separator, and it reports `0.5` for `.5`. And the text is never
|
|
148
|
+
* rewritten while the field has focus, because a field that re-formats under the
|
|
149
|
+
* reader moves the caret and eats the character being typed. That is what makes the
|
|
150
|
+
* states survivable at all.
|
|
151
|
+
*
|
|
152
|
+
* **The two values disagree for the whole of a mid-edit, and the Component
|
|
153
|
+
* resolves it in one direction.** The caller's number is always the parse of the
|
|
154
|
+
* text, and the text is never rewritten until the reader leaves. So a consumer
|
|
155
|
+
* that also renders the amount somewhere else on the page sees the parsed value and
|
|
156
|
+
* not the keystrokes, and that is deliberate: a second rendering of an amount
|
|
157
|
+
* mid-edit is a second thing to keep in step with a third. The cost is that a
|
|
158
|
+
* consumer whose own validation depends on the exact characters cannot get them
|
|
159
|
+
* from here; it gets the number, which is the thing worth validating.
|
|
160
|
+
*
|
|
161
|
+
* **On blur the text is re-formatted, and text that is not an amount is refused.**
|
|
162
|
+
* The reader leaves and the field holds what the platform writes for the number it
|
|
163
|
+
* parsed: grouped where this locale groups, padded to this currency's fraction
|
|
164
|
+
* digits, and with the grouping the reader did not type replaced by the grouping
|
|
165
|
+
* the reader's market uses. If the text held nothing that means an amount at all,
|
|
166
|
+
* the field restores the canonical rendering of the caller's own value and reports
|
|
167
|
+
* `null`. **That refusal has a real cost, and it is the cost of a snapped-back
|
|
168
|
+
* keystroke**: a reader who typed something this locale cannot write loses what
|
|
169
|
+
* they typed rather than being told it was wrong. The alternative is to keep the
|
|
170
|
+
* text and mark the field invalid, which needs an error this Component cannot
|
|
171
|
+
* render and a `required` rule this Component cannot judge. Refusing it here means
|
|
172
|
+
* an amount field never holds something that is not an amount, which is the
|
|
173
|
+
* strongest claim available; a caller who would rather explain the problem says so
|
|
174
|
+
* in their own `FieldError` beside a `value` of `null`.
|
|
175
|
+
*
|
|
176
|
+
* **A pasted amount from another market is read with this market's punctuation,
|
|
177
|
+
* and there is no better answer available.** `1,234.56` pasted into a `de-DE`
|
|
178
|
+
* field is `1.23456` here, because `,` is this locale's decimal separator. A
|
|
179
|
+
* Component that guessed the other way round would be guessing about money from a
|
|
180
|
+
* string with no locale in it, so it does not: pass the number in, and let the
|
|
181
|
+
* field format it. Grouping characters survive nothing either way, because
|
|
182
|
+
* dropping one leaves the same digits.
|
|
183
|
+
*
|
|
184
|
+
* **A `name` is deliberately absent, and the omission is the honest one.** What a
|
|
185
|
+
* form would submit from here is the reader's text, with this locale's separators
|
|
186
|
+
* in it, and a server that parses it has to guess the same things this Component
|
|
187
|
+
* guessed. A caller who needs a numeric submit writes a hidden input holding
|
|
188
|
+
* `value`. That is two lines, and it is better than a Component that submits a
|
|
189
|
+
* string and calls it a number.
|
|
190
|
+
*
|
|
191
|
+
* **It is a client Component**, because it holds the text while the reader is
|
|
192
|
+
* typing and because it takes the callback that carries the parse. What that
|
|
193
|
+
* costs is the price of every form control, and it is worth naming because the
|
|
194
|
+
* Component looks like a text input: a server render draws the canonical rendering
|
|
195
|
+
* of the caller's number, which is right, and cannot report a keystroke, which is
|
|
196
|
+
* also right.
|
|
197
|
+
*/
|
|
198
|
+
declare function MoneyField({ value, onValueChange, locale, currency, id, 'aria-label': ariaLabel, describedBy, readOnly, disabled, required, inputMode, onBlur: onBlurProp, className, }: MoneyFieldProps): import("react").JSX.Element;
|
|
199
|
+
export { MoneyField };
|
|
200
|
+
//# sourceMappingURL=money-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money-field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/money-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAA;AAKd;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;OAQG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;;;;;;;OASG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC7C;;;;;;;;;OASG;IACH,MAAM,EAAE,IAAI,CAAC,eAAe,CAAA;IAC5B;;;;;;;;OAQG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IAC7E;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;IAC5C,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAqGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,aAAa,EACb,MAAM,EACN,QAAQ,EACR,EAAE,EACF,YAAY,EAAE,SAAS,EACvB,WAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,QAAgB,EAChB,SAAqB,EACrB,MAAM,EAAE,UAAU,EAClB,SAAS,GACV,EAAE,eAAe,+BAiEjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useState, } from 'react';
|
|
4
|
+
import { InputGroup, InputGroupAddon, InputGroupInput } from './input-group.js';
|
|
5
|
+
/**
|
|
6
|
+
* Everything one locale and one currency say about the shape of an amount.
|
|
7
|
+
*
|
|
8
|
+
* Memoised on the two props that decide it and not read per keystroke, because
|
|
9
|
+
* building three `Intl.NumberFormat` objects on every character typed is a cost
|
|
10
|
+
* with no reader attached, and the answer cannot change while the locale and the
|
|
11
|
+
* currency do not.
|
|
12
|
+
*/
|
|
13
|
+
function readCurrency(locale, currency) {
|
|
14
|
+
// The currency formatter is the only thing that knows how this currency is
|
|
15
|
+
// written: where the symbol sits, how many fraction digits it has, and which
|
|
16
|
+
// characters are its own.
|
|
17
|
+
const money = new Intl.NumberFormat(locale, { style: 'currency', currency });
|
|
18
|
+
const symbol = money
|
|
19
|
+
.formatToParts(0)
|
|
20
|
+
.find((part) => part.type === 'currency')
|
|
21
|
+
?.value ?? currency;
|
|
22
|
+
const { minimumFractionDigits, maximumFractionDigits } = money.resolvedOptions();
|
|
23
|
+
// The digits come from a decimal formatter carrying the currency's own fraction
|
|
24
|
+
// digits, so the amount is grouped and padded the way this currency is padded
|
|
25
|
+
// and carries no symbol, because the symbol is already in the field's frame.
|
|
26
|
+
const digits = new Intl.NumberFormat(locale, { minimumFractionDigits, maximumFractionDigits });
|
|
27
|
+
// The decimal separator, taken from a value that has one. `undefined` is a real
|
|
28
|
+
// answer and not a gap: a locale whose numbers are written without a fractional
|
|
29
|
+
// part has no decimal separator to accept and none is offered to the reader.
|
|
30
|
+
const marks = new Intl.NumberFormat(locale).formatToParts(1.5);
|
|
31
|
+
const separator = marks.find((part) => part.type === 'decimal')?.value;
|
|
32
|
+
/*
|
|
33
|
+
* The characters this locale's own formatter could have produced.
|
|
34
|
+
*
|
|
35
|
+
* Grouping is deliberately absent. A group separator is cosmetic, and dropping
|
|
36
|
+
* one leaves the same digits, which is exactly the amount the reader meant. So a
|
|
37
|
+
* reader typing `1,234.56` into `en-US` and a reader typing `1.234,56` into
|
|
38
|
+
* `de-DE` both end up with a field holding the number they wanted, and neither
|
|
39
|
+
* has to be told which characters their market uses to write it.
|
|
40
|
+
*/
|
|
41
|
+
const allowed = new Set('0123456789-');
|
|
42
|
+
for (const character of separator ?? '')
|
|
43
|
+
allowed.add(character);
|
|
44
|
+
for (const character of symbol)
|
|
45
|
+
allowed.add(character);
|
|
46
|
+
return { symbol, digits, separator, allowed };
|
|
47
|
+
}
|
|
48
|
+
/** What is left after the allowed set has had its turn, which is what can be typed. */
|
|
49
|
+
function filterAmount(text, allowed) {
|
|
50
|
+
let out = '';
|
|
51
|
+
for (const character of text) {
|
|
52
|
+
if (allowed.has(character))
|
|
53
|
+
out += character;
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
const DIGITS_ONLY = /^[0-9]+$/;
|
|
58
|
+
/**
|
|
59
|
+
* The number the reader's text means, or nothing.
|
|
60
|
+
*
|
|
61
|
+
* `null` is the honest answer in four distinct cases and the Component does not
|
|
62
|
+
* distinguish them for the caller, because none of them is an amount: the field is
|
|
63
|
+
* empty, the field holds only a sign, the field holds only the separator, and the
|
|
64
|
+
* field holds something that is not an amount at all. The text is never rewritten
|
|
65
|
+
* in response, so all four are visible to the reader as states of a field they are
|
|
66
|
+
* in the middle of typing into.
|
|
67
|
+
*/
|
|
68
|
+
function readAmount(text, separator, symbol) {
|
|
69
|
+
let body = '';
|
|
70
|
+
for (const character of text) {
|
|
71
|
+
// The currency symbol is dropped wherever it appears rather than only at the
|
|
72
|
+
// front, because a reader pasting a formatted amount gets whatever order their
|
|
73
|
+
// source wrote it in.
|
|
74
|
+
if (symbol !== '' && symbol.includes(character))
|
|
75
|
+
continue;
|
|
76
|
+
body += character;
|
|
77
|
+
}
|
|
78
|
+
const negative = body.startsWith('-');
|
|
79
|
+
if (negative)
|
|
80
|
+
body = body.slice(1);
|
|
81
|
+
if (body === '')
|
|
82
|
+
return null;
|
|
83
|
+
const halves = separator === undefined ? [body] : body.split(separator);
|
|
84
|
+
// More than one separator is not a partially typed amount, it is a different
|
|
85
|
+
// number, and guessing which separator was meant is a guess about money.
|
|
86
|
+
if (halves.length > 2)
|
|
87
|
+
return null;
|
|
88
|
+
let [whole, fraction = ''] = halves;
|
|
89
|
+
// A separator with no whole part is that many units. The reader who typed the
|
|
90
|
+
// separator first is at the beginning of an amount, not at the end of one.
|
|
91
|
+
if (whole === '' && fraction !== '')
|
|
92
|
+
whole = '0';
|
|
93
|
+
if (!DIGITS_ONLY.test(whole))
|
|
94
|
+
return null;
|
|
95
|
+
if (fraction !== '' && !DIGITS_ONLY.test(fraction))
|
|
96
|
+
return null;
|
|
97
|
+
const amount = Number(`${whole}.${fraction}`);
|
|
98
|
+
if (!Number.isFinite(amount))
|
|
99
|
+
return null;
|
|
100
|
+
return negative ? -amount : amount;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A field that holds a currency amount as a number and shows it as the reader's
|
|
104
|
+
* market writes it.
|
|
105
|
+
*
|
|
106
|
+
* **The number the caller holds and the string the reader sees are different
|
|
107
|
+
* kinds of thing, and the round trip between them is the Component.** Everything
|
|
108
|
+
* else here follows from that. The caller passes a `number` and gets a `number`
|
|
109
|
+
* back; the field draws the platform's own rendering of that number in the
|
|
110
|
+
* caller's locale and the caller's currency; and every character the reader adds
|
|
111
|
+
* is parsed back into one. A field that handed the caller a string would push the
|
|
112
|
+
* parsing into every consumer, and a field that printed a hardcoded `$1,234.56`
|
|
113
|
+
* would be making three claims about every product that installed it.
|
|
114
|
+
*
|
|
115
|
+
* **The currency symbol is an input and not an output, and the difference is the
|
|
116
|
+
* whole of the composition.** It sits in the field's own frame, drawn by
|
|
117
|
+
* `InputGroupAddon`, read out of `Intl.NumberFormat` rather than written here, and
|
|
118
|
+
* it is hidden from the accessibility tree: a screen reader reads the digits, and
|
|
119
|
+
* the currency belongs in the field's accessible name, which is the caller's
|
|
120
|
+
* word. It is also not part of the value. The number a caller holds is `1234.56`
|
|
121
|
+
* whatever the reader sees on screen, and a symbol that leaked into the parse would
|
|
122
|
+
* make the same amount parse two ways depending on whether the reader typed it.
|
|
123
|
+
*
|
|
124
|
+
* **Nothing about a currency may be a literal in this file.** The symbol, the
|
|
125
|
+
* grouping and the decimal separators, and the number of fraction digits all come
|
|
126
|
+
* out of the platform for the locale and the code the caller passed. `de-DE` with
|
|
127
|
+
* `EUR` and `en-US` with `USD` differ in all four, and a Component that hardcoded
|
|
128
|
+
* any of them would be right for one market and silently wrong for the rest.
|
|
129
|
+
*
|
|
130
|
+
* **A partially typed amount is a legitimate state and the parser must not reject
|
|
131
|
+
* it.** `12.`, `-` and `.5` are all things a person is in the middle of typing,
|
|
132
|
+
* and `12,` and `,5` are the same three in a locale that separates with a comma.
|
|
133
|
+
* So the parser is not asked whether the text is a valid amount, only whether it
|
|
134
|
+
* currently means one: it reports `12` for `12.`, it reports nothing for a lone sign
|
|
135
|
+
* and for a lone separator, and it reports `0.5` for `.5`. And the text is never
|
|
136
|
+
* rewritten while the field has focus, because a field that re-formats under the
|
|
137
|
+
* reader moves the caret and eats the character being typed. That is what makes the
|
|
138
|
+
* states survivable at all.
|
|
139
|
+
*
|
|
140
|
+
* **The two values disagree for the whole of a mid-edit, and the Component
|
|
141
|
+
* resolves it in one direction.** The caller's number is always the parse of the
|
|
142
|
+
* text, and the text is never rewritten until the reader leaves. So a consumer
|
|
143
|
+
* that also renders the amount somewhere else on the page sees the parsed value and
|
|
144
|
+
* not the keystrokes, and that is deliberate: a second rendering of an amount
|
|
145
|
+
* mid-edit is a second thing to keep in step with a third. The cost is that a
|
|
146
|
+
* consumer whose own validation depends on the exact characters cannot get them
|
|
147
|
+
* from here; it gets the number, which is the thing worth validating.
|
|
148
|
+
*
|
|
149
|
+
* **On blur the text is re-formatted, and text that is not an amount is refused.**
|
|
150
|
+
* The reader leaves and the field holds what the platform writes for the number it
|
|
151
|
+
* parsed: grouped where this locale groups, padded to this currency's fraction
|
|
152
|
+
* digits, and with the grouping the reader did not type replaced by the grouping
|
|
153
|
+
* the reader's market uses. If the text held nothing that means an amount at all,
|
|
154
|
+
* the field restores the canonical rendering of the caller's own value and reports
|
|
155
|
+
* `null`. **That refusal has a real cost, and it is the cost of a snapped-back
|
|
156
|
+
* keystroke**: a reader who typed something this locale cannot write loses what
|
|
157
|
+
* they typed rather than being told it was wrong. The alternative is to keep the
|
|
158
|
+
* text and mark the field invalid, which needs an error this Component cannot
|
|
159
|
+
* render and a `required` rule this Component cannot judge. Refusing it here means
|
|
160
|
+
* an amount field never holds something that is not an amount, which is the
|
|
161
|
+
* strongest claim available; a caller who would rather explain the problem says so
|
|
162
|
+
* in their own `FieldError` beside a `value` of `null`.
|
|
163
|
+
*
|
|
164
|
+
* **A pasted amount from another market is read with this market's punctuation,
|
|
165
|
+
* and there is no better answer available.** `1,234.56` pasted into a `de-DE`
|
|
166
|
+
* field is `1.23456` here, because `,` is this locale's decimal separator. A
|
|
167
|
+
* Component that guessed the other way round would be guessing about money from a
|
|
168
|
+
* string with no locale in it, so it does not: pass the number in, and let the
|
|
169
|
+
* field format it. Grouping characters survive nothing either way, because
|
|
170
|
+
* dropping one leaves the same digits.
|
|
171
|
+
*
|
|
172
|
+
* **A `name` is deliberately absent, and the omission is the honest one.** What a
|
|
173
|
+
* form would submit from here is the reader's text, with this locale's separators
|
|
174
|
+
* in it, and a server that parses it has to guess the same things this Component
|
|
175
|
+
* guessed. A caller who needs a numeric submit writes a hidden input holding
|
|
176
|
+
* `value`. That is two lines, and it is better than a Component that submits a
|
|
177
|
+
* string and calls it a number.
|
|
178
|
+
*
|
|
179
|
+
* **It is a client Component**, because it holds the text while the reader is
|
|
180
|
+
* typing and because it takes the callback that carries the parse. What that
|
|
181
|
+
* costs is the price of every form control, and it is worth naming because the
|
|
182
|
+
* Component looks like a text input: a server render draws the canonical rendering
|
|
183
|
+
* of the caller's number, which is right, and cannot report a keystroke, which is
|
|
184
|
+
* also right.
|
|
185
|
+
*/
|
|
186
|
+
function MoneyField({ value, onValueChange, locale, currency, id, 'aria-label': ariaLabel, describedBy, readOnly = false, disabled = false, required = false, inputMode = 'decimal', onBlur: onBlurProp, className, }) {
|
|
187
|
+
const { symbol, digits, separator, allowed } = useMemo(() => readCurrency(locale, currency), [locale, currency]);
|
|
188
|
+
// The text while it is being typed, and `null` when it is not. A separate value
|
|
189
|
+
// from the caller's is the whole mechanism: a field whose displayed text is
|
|
190
|
+
// derived from a number on every render cannot hold `12.` without rewriting it.
|
|
191
|
+
const [draft, setDraft] = useState(null);
|
|
192
|
+
const canonical = value === null || !Number.isFinite(value) ? '' : digits.format(value);
|
|
193
|
+
const text = draft === null ? canonical : draft;
|
|
194
|
+
const handleChange = (event) => {
|
|
195
|
+
const next = filterAmount(event.target.value, allowed);
|
|
196
|
+
setDraft(next);
|
|
197
|
+
onValueChange(readAmount(next, separator, symbol));
|
|
198
|
+
};
|
|
199
|
+
const handleBlur = (event) => {
|
|
200
|
+
// A field nobody edited is not a field that resolved. Without this a reader who
|
|
201
|
+
// tabbed through a field holding an amount would have that amount reported as
|
|
202
|
+
// `null` on the way out, because an untouched field has no draft to re-formatted.
|
|
203
|
+
if (draft !== null) {
|
|
204
|
+
// The one place the text is rewritten, and the one place the parse is reported
|
|
205
|
+
// a second time: whatever parsed is what the reader is left looking at.
|
|
206
|
+
onValueChange(readAmount(draft, separator, symbol));
|
|
207
|
+
setDraft(null);
|
|
208
|
+
}
|
|
209
|
+
// Forwarded last, so a caller's own handler runs against a field that has
|
|
210
|
+
// already settled rather than one caught mid-transition.
|
|
211
|
+
onBlurProp?.(event);
|
|
212
|
+
};
|
|
213
|
+
return (_jsxs(InputGroup, { className: className, disabled: disabled, children: [_jsx(InputGroupAddon, { position: "prefix", children: _jsx("span", { "data-slot": "money-field-symbol", "aria-hidden": "true", children: symbol }) }), _jsx(InputGroupInput, { "data-slot": "money-field-input", id: id, type: "text", inputMode: inputMode, autoComplete: "off", spellCheck: false, "aria-label": ariaLabel, "aria-describedby": describedBy, "aria-required": required || undefined, readOnly: readOnly, disabled: disabled, value: text, onChange: handleChange, onBlur: handleBlur })] }));
|
|
214
|
+
}
|
|
215
|
+
export { MoneyField };
|