@passui/react 0.1.17 → 0.1.20
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/README.md +140 -1
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/dist/types/src/appearance/index.d.ts +2 -0
- package/dist/types/src/appearance/platform.d.ts +9 -0
- package/dist/types/src/appearance/theme.d.ts +71 -0
- package/dist/types/src/components/accordion/accordion.d.ts +19 -0
- package/dist/types/src/components/ambient/ambient.d.ts +12 -0
- package/dist/types/src/components/ambient/index.d.ts +1 -0
- package/dist/types/src/components/aspect-ratio/aspect-ratio.d.ts +7 -0
- package/dist/types/src/components/breadcrumb/breadcrumb.d.ts +16 -0
- package/dist/types/src/components/button/button-styles.d.ts +12 -0
- package/dist/types/src/components/button/button.d.ts +32 -0
- package/dist/types/src/components/button/icon-button.d.ts +10 -0
- package/dist/types/src/components/button/pending-spinner.d.ts +5 -0
- package/dist/types/src/components/button/use-pending-indicator.d.ts +2 -0
- package/dist/types/src/components/chip/chip.d.ts +7 -0
- package/dist/types/src/components/code-block/code-block.d.ts +10 -0
- package/dist/types/src/components/combo-box/combo-box.d.ts +9 -0
- package/dist/types/src/components/command/command.d.ts +18 -0
- package/dist/types/src/components/compact-date-picker/calendar-month.d.ts +25 -0
- package/dist/types/src/components/compact-date-picker/compact-date-picker.d.ts +27 -0
- package/dist/types/src/components/compact-time-picker/compact-time-picker.d.ts +26 -0
- package/dist/types/src/components/compact-time-picker/time-value.d.ts +18 -0
- package/dist/types/src/components/content-unavailable-view/content-unavailable-view.d.ts +9 -0
- package/dist/types/src/components/content-view/content-view.d.ts +48 -0
- package/dist/types/src/components/content-view/index.d.ts +1 -0
- package/dist/types/src/components/context-menu/conceal-menu-source.d.ts +2 -0
- package/dist/types/src/components/context-menu/context-menu-host.d.ts +2 -0
- package/dist/types/src/components/context-menu/context-menu-store.d.ts +57 -0
- package/dist/types/src/components/context-menu/menu-navigation.d.ts +6 -0
- package/dist/types/src/components/context-menu/menu-position.d.ts +21 -0
- package/dist/types/src/components/context-menu/menu-reveal.d.ts +17 -0
- package/dist/types/src/components/context-menu/use-context-menu.d.ts +14 -0
- package/dist/types/src/components/conversation/conversation.d.ts +43 -0
- package/dist/types/src/components/conversation/index.d.ts +1 -0
- package/dist/types/src/components/date-picker/date-picker.d.ts +16 -0
- package/dist/types/src/components/date-picker/date-value.d.ts +2 -0
- package/dist/types/src/components/dialog/dialog-host.d.ts +6 -0
- package/dist/types/src/components/dialog/dialog-store.d.ts +23 -0
- package/dist/types/src/components/dialog/dialog.d.ts +30 -0
- package/dist/types/src/components/dialog/index.d.ts +1 -0
- package/dist/types/src/components/disclosure-group/disclosure-group.d.ts +15 -0
- package/dist/types/src/components/divider/divider.d.ts +9 -0
- package/dist/types/src/components/inline-disclosure/inline-disclosure.d.ts +15 -0
- package/dist/types/src/components/keyboard-shortcut/keyboard-shortcut.d.ts +5 -0
- package/dist/types/src/components/labeled-content/labeled-content.d.ts +19 -0
- package/dist/types/src/components/locale-switcher/index.d.ts +1 -0
- package/dist/types/src/components/locale-switcher/locale-switcher.d.ts +10 -0
- package/dist/types/src/components/menu/menu.d.ts +16 -0
- package/dist/types/src/components/one-time-code/one-time-code.d.ts +18 -0
- package/dist/types/src/components/picker/picker-trigger.d.ts +2 -0
- package/dist/types/src/components/picker/picker.d.ts +43 -0
- package/dist/types/src/components/popover/anchored-surface.d.ts +13 -0
- package/dist/types/src/components/popover/popover-fit.d.ts +21 -0
- package/dist/types/src/components/popover/popover.d.ts +18 -0
- package/dist/types/src/components/profile-image/profile-image.d.ts +4 -0
- package/dist/types/src/components/progress-view/progress-view.d.ts +13 -0
- package/dist/types/src/components/progress-view/use-liquid-progress.d.ts +3 -0
- package/dist/types/src/components/radio-group/radio-group.d.ts +17 -0
- package/dist/types/src/components/search-field/expanding-search-field.d.ts +5 -0
- package/dist/types/src/components/search-field/search-field.d.ts +6 -0
- package/dist/types/src/components/search-list/search-list.d.ts +19 -0
- package/dist/types/src/components/section/section.d.ts +15 -0
- package/dist/types/src/components/secure-field/secure-field.d.ts +4 -0
- package/dist/types/src/components/segmented-control/segmented-control.d.ts +20 -0
- package/dist/types/src/components/sheet/modal-environment.d.ts +2 -0
- package/dist/types/src/components/sheet/sheet-portal.d.ts +5 -0
- package/dist/types/src/components/sheet/sheet.d.ts +21 -0
- package/dist/types/src/components/sheet/use-sheet-focus.d.ts +3 -0
- package/dist/types/src/components/sidebar/sidebar.d.ts +19 -0
- package/dist/types/src/components/skeleton/skeleton.d.ts +6 -0
- package/dist/types/src/components/slider/slider.d.ts +14 -0
- package/dist/types/src/components/slosh-slider/liquid-step.d.ts +6 -0
- package/dist/types/src/components/slosh-slider/slosh-slider.d.ts +18 -0
- package/dist/types/src/components/stat-tile/index.d.ts +1 -0
- package/dist/types/src/components/stat-tile/stat-tile.d.ts +15 -0
- package/dist/types/src/components/status-indicator/status-indicator.d.ts +14 -0
- package/dist/types/src/components/stepper/rolling-digit.d.ts +11 -0
- package/dist/types/src/components/stepper/stepper.d.ts +19 -0
- package/dist/types/src/components/swatch-picker/swatch-picker.d.ts +17 -0
- package/dist/types/src/components/tab-bar/tab-bar.d.ts +40 -0
- package/dist/types/src/components/tab-view/tab-view.d.ts +24 -0
- package/dist/types/src/components/table/table.d.ts +10 -0
- package/dist/types/src/components/text-editor/text-editor.d.ts +2 -0
- package/dist/types/src/components/text-field/text-field.d.ts +20 -0
- package/dist/types/src/components/toast/toast-store.d.ts +47 -0
- package/dist/types/src/components/toast/toaster.d.ts +10 -0
- package/dist/types/src/components/toggle/toggle.d.ts +17 -0
- package/dist/types/src/components/tooltip/tooltip-host.d.ts +6 -0
- package/dist/types/src/components/view-controller/index.d.ts +1 -0
- package/dist/types/src/components/view-controller/view-controller.d.ts +21 -0
- package/dist/types/src/components/wake-slider/wake-slider.d.ts +12 -0
- package/dist/types/src/hooks/scroll/minimize-decision.d.ts +2 -0
- package/dist/types/src/hooks/use-anchored-disclosure.d.ts +9 -0
- package/dist/types/src/hooks/use-anchored-placement.d.ts +7 -0
- package/dist/types/src/hooks/use-dismiss.d.ts +9 -0
- package/dist/types/src/hooks/use-floating-dismiss.d.ts +3 -0
- package/dist/types/src/hooks/use-media-query.d.ts +21 -0
- package/dist/types/src/hooks/use-minimize-on-scroll.d.ts +6 -0
- package/dist/types/src/hooks/use-visual-viewport.d.ts +4 -0
- package/dist/types/src/hooks/viewport/types.d.ts +19 -0
- package/dist/types/src/hooks/viewport/viewport-metrics.d.ts +3 -0
- package/dist/types/src/icons/icons.d.ts +612 -0
- package/dist/types/src/index.d.ts +71 -0
- package/dist/types/src/lib/anchored-placement.d.ts +39 -0
- package/dist/types/src/lib/class-names.d.ts +2 -0
- package/dist/types/src/lib/clipboard.d.ts +6 -0
- package/dist/types/src/lib/date.d.ts +50 -0
- package/dist/types/src/lib/floating-layers.d.ts +8 -0
- package/dist/types/src/lib/haptics.d.ts +8 -0
- package/dist/types/src/lib/language.d.ts +4 -0
- package/dist/types/src/lib/range-value.d.ts +4 -0
- package/dist/types/src/lib/screen-edges.d.ts +12 -0
- package/dist/types/src/lib/shapes.d.ts +17 -0
- package/dist/types/src/motion/transitions.d.ts +97 -0
- package/dist/types/src/tokens.d.ts +1 -0
- package/package.json +248 -40
- package/src/appearance/platform.tsx +10 -47
- package/src/appearance/theme.tsx +42 -142
- package/src/components/accordion/accordion.tsx +48 -0
- package/src/components/ambient/ambient.tsx +2 -10
- package/src/components/aspect-ratio/aspect-ratio.tsx +22 -0
- package/src/components/breadcrumb/breadcrumb.tsx +53 -0
- package/src/components/button/button-styles.ts +13 -31
- package/src/components/button/button.tsx +24 -15
- package/src/components/button/icon-button.tsx +14 -56
- package/src/components/button/use-pending-indicator.ts +2 -7
- package/src/components/chip/chip.tsx +8 -13
- package/src/components/code-block/code-block.tsx +41 -0
- package/src/components/combo-box/combo-box.tsx +13 -0
- package/src/components/command/command.tsx +119 -0
- package/src/components/compact-date-picker/calendar-month.ts +13 -57
- package/src/components/compact-date-picker/compact-date-picker.tsx +72 -195
- package/src/components/compact-time-picker/compact-time-picker.tsx +74 -195
- package/src/components/compact-time-picker/time-value.ts +4 -16
- package/src/components/content-unavailable-view/content-unavailable-view.tsx +37 -0
- package/src/components/content-view/content-view.tsx +13 -56
- package/src/components/context-menu/conceal-menu-source.ts +1 -4
- package/src/components/context-menu/context-menu-host.tsx +132 -198
- package/src/components/context-menu/context-menu-store.ts +5 -14
- package/src/components/context-menu/menu-navigation.ts +29 -0
- package/src/components/context-menu/menu-position.ts +6 -27
- package/src/components/context-menu/menu-reveal.ts +14 -52
- package/src/components/context-menu/use-context-menu.ts +6 -30
- package/src/components/conversation/conversation.tsx +26 -72
- package/src/components/date-picker/date-picker.tsx +8 -37
- package/src/components/date-picker/date-value.ts +5 -30
- package/src/components/dialog/dialog-host.tsx +37 -76
- package/src/components/dialog/dialog-store.ts +16 -7
- package/src/components/dialog/dialog.tsx +23 -80
- package/src/components/disclosure-group/disclosure-group.tsx +79 -0
- package/src/components/divider/divider.tsx +31 -0
- package/src/components/inline-disclosure/inline-disclosure.tsx +49 -0
- package/src/components/keyboard-shortcut/keyboard-shortcut.tsx +17 -0
- package/src/components/labeled-content/labeled-content.tsx +24 -18
- package/src/components/locale-switcher/locale-switcher.tsx +20 -70
- package/src/components/menu/menu.tsx +68 -0
- package/src/components/one-time-code/one-time-code.tsx +168 -0
- package/src/components/picker/picker-trigger.ts +10 -0
- package/src/components/picker/picker.tsx +165 -283
- package/src/components/popover/anchored-surface.tsx +223 -0
- package/src/components/popover/popover-fit.ts +69 -0
- package/src/components/popover/popover.tsx +209 -63
- package/src/components/profile-image/profile-image.tsx +6 -28
- package/src/components/progress-view/progress-view.tsx +70 -0
- package/src/components/progress-view/use-liquid-progress.ts +43 -0
- package/src/components/radio-group/radio-group.tsx +63 -0
- package/src/components/search-field/expanding-search-field.tsx +183 -0
- package/src/components/search-field/search-field.tsx +25 -7
- package/src/components/search-list/search-list.tsx +58 -75
- package/src/components/section/section.tsx +18 -17
- package/src/components/secure-field/secure-field.tsx +5 -7
- package/src/components/segmented-control/segmented-control.tsx +20 -29
- package/src/components/sheet/modal-environment.ts +16 -54
- package/src/components/sheet/sheet-portal.tsx +10 -42
- package/src/components/sheet/sheet.tsx +17 -25
- package/src/components/sheet/use-sheet-focus.ts +15 -51
- package/src/components/sidebar/sidebar.tsx +44 -38
- package/src/components/skeleton/skeleton.tsx +19 -0
- package/src/components/slider/slider.tsx +76 -0
- package/src/components/slosh-slider/liquid-step.ts +42 -0
- package/src/components/slosh-slider/slosh-slider.tsx +251 -0
- package/src/components/stat-tile/stat-tile.tsx +9 -30
- package/src/components/status-indicator/status-indicator.tsx +12 -19
- package/src/components/stepper/rolling-digit.tsx +77 -0
- package/src/components/stepper/stepper.tsx +101 -0
- package/src/components/swatch-picker/swatch-picker.tsx +19 -15
- package/src/components/tab-bar/tab-bar.tsx +59 -59
- package/src/components/tab-view/tab-view.tsx +52 -57
- package/src/components/table/table.tsx +14 -62
- package/src/components/text-editor/text-editor.tsx +2 -12
- package/src/components/text-field/text-field.tsx +53 -44
- package/src/components/toast/toast-store.ts +9 -30
- package/src/components/toast/toaster.tsx +90 -104
- package/src/components/toggle/toggle.tsx +165 -44
- package/src/components/tooltip/tooltip-host.tsx +70 -67
- package/src/components/view-controller/view-controller.tsx +4 -21
- package/src/components/wake-slider/wake-slider.tsx +237 -0
- package/src/hooks/scroll/minimize-decision.ts +1 -5
- package/src/hooks/use-anchored-disclosure.ts +23 -0
- package/src/hooks/use-anchored-placement.ts +7 -14
- package/src/hooks/use-dismiss.ts +5 -23
- package/src/hooks/use-floating-dismiss.ts +28 -0
- package/src/hooks/use-media-query.ts +12 -31
- package/src/hooks/use-minimize-on-scroll.ts +10 -34
- package/src/hooks/use-visual-viewport.ts +5 -14
- package/src/hooks/viewport/viewport-metrics.ts +4 -16
- package/src/icons/icons.tsx +229 -183
- package/src/index.ts +27 -1
- package/src/lib/anchored-placement.ts +12 -18
- package/src/lib/class-names.ts +1 -2
- package/src/lib/clipboard.ts +14 -0
- package/src/lib/date.ts +4 -15
- package/src/lib/floating-layers.ts +18 -8
- package/src/lib/haptics.ts +1 -3
- package/src/lib/language.ts +2 -7
- package/src/lib/range-value.ts +32 -0
- package/src/lib/screen-edges.ts +2 -6
- package/src/lib/shapes.ts +5 -20
- package/src/motion/transitions.ts +18 -12
- package/src/styles/code-block.css +33 -0
- package/src/styles/motion-controls.css +189 -0
- package/src/styles/styles.css +3 -0
- package/src/components/ambient/ambient.docs.tsx +0 -68
- package/src/components/ambient/examples/ambient-images.tsx +0 -30
- package/src/components/ambient/examples/ambient-now-playing.tsx +0 -55
- package/src/components/ambient/examples/ambient-showcase.tsx +0 -33
- package/src/components/ambient/examples/ambient-usage.tsx +0 -19
- package/src/components/button/button.docs.tsx +0 -116
- package/src/components/button/examples/button-disabled.tsx +0 -19
- package/src/components/button/examples/button-icon.tsx +0 -39
- package/src/components/button/examples/button-link.tsx +0 -12
- package/src/components/button/examples/button-pending.tsx +0 -27
- package/src/components/button/examples/button-showcase.tsx +0 -115
- package/src/components/button/examples/button-sizes.tsx +0 -12
- package/src/components/button/examples/button-usage.tsx +0 -12
- package/src/components/button/examples/button-variants.tsx +0 -15
- package/src/components/button/examples/button-with-icon.tsx +0 -32
- package/src/components/button/examples/icon-button-player.tsx +0 -38
- package/src/components/button/examples/icon-button-showcase.tsx +0 -83
- package/src/components/button/examples/icon-button-usage.tsx +0 -11
- package/src/components/button/examples/icon-button-variants.tsx +0 -39
- package/src/components/button/icon-button.docs.tsx +0 -68
- package/src/components/chip/chip.docs.tsx +0 -37
- package/src/components/chip/examples/chip-in-rows.tsx +0 -19
- package/src/components/chip/examples/chip-showcase.tsx +0 -51
- package/src/components/chip/examples/chip-tones.tsx +0 -13
- package/src/components/chip/examples/chip-usage.tsx +0 -5
- package/src/components/compact-date-picker/compact-date-picker.docs.tsx +0 -81
- package/src/components/compact-date-picker/examples/compact-date-picker-showcase.tsx +0 -35
- package/src/components/compact-date-picker/examples/compact-date-picker-usage.tsx +0 -22
- package/src/components/compact-time-picker/compact-time-picker.docs.tsx +0 -80
- package/src/components/compact-time-picker/examples/compact-time-picker-showcase.tsx +0 -31
- package/src/components/compact-time-picker/examples/compact-time-picker-usage.tsx +0 -21
- package/src/components/content-view/content-view.docs.tsx +0 -61
- package/src/components/content-view/examples/content-view-header-action.tsx +0 -33
- package/src/components/content-view/examples/content-view-showcase.tsx +0 -65
- package/src/components/content-view/examples/content-view-stats.tsx +0 -35
- package/src/components/content-view/examples/content-view-usage.tsx +0 -14
- package/src/components/context-menu/context-menu.docs.tsx +0 -92
- package/src/components/context-menu/examples/context-menu-checked.tsx +0 -37
- package/src/components/context-menu/examples/context-menu-list.tsx +0 -85
- package/src/components/context-menu/examples/context-menu-showcase.tsx +0 -56
- package/src/components/context-menu/examples/context-menu-toolbar.tsx +0 -63
- package/src/components/context-menu/examples/context-menu-usage.tsx +0 -24
- package/src/components/conversation/conversation.docs.tsx +0 -88
- package/src/components/conversation/examples/conversation-composer.tsx +0 -36
- package/src/components/conversation/examples/conversation-days.tsx +0 -48
- package/src/components/conversation/examples/conversation-showcase.tsx +0 -71
- package/src/components/conversation/examples/conversation-usage.tsx +0 -28
- package/src/components/date-picker/date-picker.docs.tsx +0 -88
- package/src/components/date-picker/examples/date-picker-locales.tsx +0 -41
- package/src/components/date-picker/examples/date-picker-past-only.tsx +0 -29
- package/src/components/date-picker/examples/date-picker-showcase.tsx +0 -49
- package/src/components/date-picker/examples/date-picker-usage.tsx +0 -22
- package/src/components/dialog/dialog.docs.tsx +0 -114
- package/src/components/dialog/examples/dialog-confirm.tsx +0 -24
- package/src/components/dialog/examples/dialog-form.tsx +0 -46
- package/src/components/dialog/examples/dialog-inline.tsx +0 -48
- package/src/components/dialog/examples/dialog-showcase.tsx +0 -53
- package/src/components/dialog/examples/dialog-usage.tsx +0 -31
- package/src/components/labeled-content/examples/labeled-content-descriptions.tsx +0 -37
- package/src/components/labeled-content/examples/labeled-content-showcase.tsx +0 -54
- package/src/components/labeled-content/examples/labeled-content-usage.tsx +0 -22
- package/src/components/labeled-content/examples/labeled-content-values.tsx +0 -26
- package/src/components/labeled-content/examples/labeled-content-wide.tsx +0 -46
- package/src/components/labeled-content/labeled-content.docs.tsx +0 -69
- package/src/components/locale-switcher/examples/locale-switcher-native-names.tsx +0 -30
- package/src/components/locale-switcher/examples/locale-switcher-showcase.tsx +0 -46
- package/src/components/locale-switcher/examples/locale-switcher-translated-page.tsx +0 -35
- package/src/components/locale-switcher/examples/locale-switcher-usage.tsx +0 -20
- package/src/components/locale-switcher/locale-switcher.docs.tsx +0 -91
- package/src/components/picker/examples/picker-details.tsx +0 -44
- package/src/components/picker/examples/picker-searchable.tsx +0 -48
- package/src/components/picker/examples/picker-showcase.tsx +0 -66
- package/src/components/picker/examples/picker-usage.tsx +0 -20
- package/src/components/picker/picker.docs.tsx +0 -68
- package/src/components/popover/examples/popover-help.tsx +0 -57
- package/src/components/popover/examples/popover-menu.tsx +0 -51
- package/src/components/popover/examples/popover-showcase.tsx +0 -61
- package/src/components/popover/examples/popover-usage.tsx +0 -31
- package/src/components/popover/popover.docs.tsx +0 -84
- package/src/components/profile-image/examples/profile-image-fallbacks.tsx +0 -29
- package/src/components/profile-image/examples/profile-image-group.tsx +0 -34
- package/src/components/profile-image/examples/profile-image-showcase.tsx +0 -30
- package/src/components/profile-image/examples/profile-image-usage.tsx +0 -14
- package/src/components/profile-image/profile-image.docs.tsx +0 -81
- package/src/components/search-field/examples/search-field-filter.tsx +0 -53
- package/src/components/search-field/examples/search-field-showcase.tsx +0 -56
- package/src/components/search-field/examples/search-field-toolbar.tsx +0 -27
- package/src/components/search-field/examples/search-field-usage.tsx +0 -18
- package/src/components/search-field/search-field.docs.tsx +0 -58
- package/src/components/search-list/examples/search-list-dropdown.tsx +0 -53
- package/src/components/search-list/examples/search-list-groups.tsx +0 -64
- package/src/components/search-list/examples/search-list-showcase.tsx +0 -67
- package/src/components/search-list/examples/search-list-usage.tsx +0 -27
- package/src/components/search-list/search-list.docs.tsx +0 -87
- package/src/components/section/examples/section-actions.tsx +0 -35
- package/src/components/section/examples/section-groups.tsx +0 -41
- package/src/components/section/examples/section-showcase.tsx +0 -63
- package/src/components/section/examples/section-usage.tsx +0 -19
- package/src/components/section/section.docs.tsx +0 -51
- package/src/components/secure-field/examples/secure-field-new-password.tsx +0 -56
- package/src/components/secure-field/examples/secure-field-reveal.tsx +0 -20
- package/src/components/secure-field/examples/secure-field-showcase.tsx +0 -62
- package/src/components/secure-field/examples/secure-field-usage.tsx +0 -19
- package/src/components/secure-field/secure-field.docs.tsx +0 -72
- package/src/components/segmented-control/examples/segmented-control-overflow.tsx +0 -28
- package/src/components/segmented-control/examples/segmented-control-showcase.tsx +0 -59
- package/src/components/segmented-control/examples/segmented-control-usage.tsx +0 -20
- package/src/components/segmented-control/examples/segmented-control-views.tsx +0 -32
- package/src/components/segmented-control/segmented-control.docs.tsx +0 -61
- package/src/components/sheet/examples/sheet-choices.tsx +0 -58
- package/src/components/sheet/examples/sheet-share.tsx +0 -51
- package/src/components/sheet/examples/sheet-showcase.tsx +0 -74
- package/src/components/sheet/examples/sheet-usage.tsx +0 -32
- package/src/components/sheet/sheet.docs.tsx +0 -75
- package/src/components/sidebar/examples/sidebar-groups.tsx +0 -133
- package/src/components/sidebar/examples/sidebar-showcase.tsx +0 -123
- package/src/components/sidebar/examples/sidebar-unread.tsx +0 -66
- package/src/components/sidebar/examples/sidebar-usage.tsx +0 -52
- package/src/components/sidebar/sidebar.docs.tsx +0 -135
- package/src/components/stat-tile/examples/stat-tile-filters.tsx +0 -32
- package/src/components/stat-tile/examples/stat-tile-grid.tsx +0 -21
- package/src/components/stat-tile/examples/stat-tile-showcase.tsx +0 -52
- package/src/components/stat-tile/examples/stat-tile-usage.tsx +0 -13
- package/src/components/stat-tile/stat-tile.docs.tsx +0 -60
- package/src/components/status-indicator/examples/status-indicator-live.tsx +0 -34
- package/src/components/status-indicator/examples/status-indicator-showcase.tsx +0 -39
- package/src/components/status-indicator/examples/status-indicator-states.tsx +0 -17
- package/src/components/status-indicator/examples/status-indicator-usage.tsx +0 -9
- package/src/components/status-indicator/status-indicator.docs.tsx +0 -43
- package/src/components/swatch-picker/examples/swatch-picker-accents.tsx +0 -42
- package/src/components/swatch-picker/examples/swatch-picker-labels.tsx +0 -45
- package/src/components/swatch-picker/examples/swatch-picker-showcase.tsx +0 -70
- package/src/components/swatch-picker/examples/swatch-picker-usage.tsx +0 -39
- package/src/components/swatch-picker/swatch-picker.docs.tsx +0 -60
- package/src/components/tab-bar/examples/tab-bar-five-tabs.tsx +0 -66
- package/src/components/tab-bar/examples/tab-bar-minimize.tsx +0 -71
- package/src/components/tab-bar/examples/tab-bar-showcase.tsx +0 -82
- package/src/components/tab-bar/examples/tab-bar-usage.tsx +0 -54
- package/src/components/tab-bar/tab-bar.docs.tsx +0 -136
- package/src/components/tab-view/examples/tab-view-keyboard.tsx +0 -39
- package/src/components/tab-view/examples/tab-view-settings.tsx +0 -56
- package/src/components/tab-view/examples/tab-view-showcase.tsx +0 -53
- package/src/components/tab-view/examples/tab-view-usage.tsx +0 -23
- package/src/components/tab-view/tab-view.docs.tsx +0 -77
- package/src/components/table/examples/table-empty.tsx +0 -53
- package/src/components/table/examples/table-invoices.tsx +0 -102
- package/src/components/table/examples/table-selection.tsx +0 -150
- package/src/components/table/examples/table-showcase.tsx +0 -115
- package/src/components/table/examples/table-usage.tsx +0 -67
- package/src/components/table/examples/table-wide.tsx +0 -75
- package/src/components/table/table.docs.tsx +0 -131
- package/src/components/text-editor/examples/text-editor-comment.tsx +0 -48
- package/src/components/text-editor/examples/text-editor-count.tsx +0 -38
- package/src/components/text-editor/examples/text-editor-showcase.tsx +0 -58
- package/src/components/text-editor/examples/text-editor-usage.tsx +0 -25
- package/src/components/text-editor/text-editor.docs.tsx +0 -61
- package/src/components/text-field/examples/text-field-icons.tsx +0 -72
- package/src/components/text-field/examples/text-field-showcase.tsx +0 -50
- package/src/components/text-field/examples/text-field-usage.tsx +0 -18
- package/src/components/text-field/examples/text-field-validation.tsx +0 -27
- package/src/components/text-field/text-field.docs.tsx +0 -118
- package/src/components/toast/examples/toast-action.tsx +0 -32
- package/src/components/toast/examples/toast-promise.tsx +0 -45
- package/src/components/toast/examples/toast-showcase.tsx +0 -49
- package/src/components/toast/examples/toast-usage.tsx +0 -13
- package/src/components/toast/toast.docs.tsx +0 -79
- package/src/components/toggle/examples/toggle-checkboxes.tsx +0 -43
- package/src/components/toggle/examples/toggle-settings.tsx +0 -31
- package/src/components/toggle/examples/toggle-showcase.tsx +0 -59
- package/src/components/toggle/examples/toggle-usage.tsx +0 -13
- package/src/components/toggle/toggle.docs.tsx +0 -69
- package/src/components/tooltip/examples/tooltip-icon-buttons.tsx +0 -27
- package/src/components/tooltip/examples/tooltip-shortcuts.tsx +0 -38
- package/src/components/tooltip/examples/tooltip-showcase.tsx +0 -44
- package/src/components/tooltip/examples/tooltip-usage.tsx +0 -13
- package/src/components/tooltip/tooltip.docs.tsx +0 -56
- package/src/components/view-controller/examples/view-controller-action.tsx +0 -27
- package/src/components/view-controller/examples/view-controller-settings.tsx +0 -31
- package/src/components/view-controller/examples/view-controller-showcase.tsx +0 -45
- package/src/components/view-controller/examples/view-controller-usage.tsx +0 -19
- package/src/components/view-controller/view-controller.docs.tsx +0 -71
- package/src/docs/index.ts +0 -3
- package/src/docs/registry.ts +0 -113
- package/src/docs/snippet.ts +0 -17
- package/src/docs/types.ts +0 -180
package/src/lib/date.ts
CHANGED
|
@@ -37,10 +37,7 @@ export type DatePreset = keyof typeof PRESETS
|
|
|
37
37
|
|
|
38
38
|
const formatters = new Map<string, Intl.DateTimeFormat>()
|
|
39
39
|
|
|
40
|
-
function formatter(
|
|
41
|
-
key: string,
|
|
42
|
-
options: Intl.DateTimeFormatOptions
|
|
43
|
-
) {
|
|
40
|
+
function formatter(key: string, options: Intl.DateTimeFormatOptions) {
|
|
44
41
|
let cached = formatters.get(key)
|
|
45
42
|
if (!cached) {
|
|
46
43
|
cached = new Intl.DateTimeFormat(LOCALE, options)
|
|
@@ -50,10 +47,7 @@ function formatter(
|
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
/** A stored UTC timestamp shown as its UTC wall-clock time, whatever the viewer's timezone. */
|
|
53
|
-
export function formatUtc(
|
|
54
|
-
date: Date | string | number,
|
|
55
|
-
preset: DatePreset
|
|
56
|
-
) {
|
|
50
|
+
export function formatUtc(date: Date | string | number, preset: DatePreset) {
|
|
57
51
|
return formatter(`utc:${preset}`, {
|
|
58
52
|
...PRESETS[preset],
|
|
59
53
|
timeZone: "UTC",
|
|
@@ -83,14 +77,9 @@ export function fromNow(date: Date | string | number) {
|
|
|
83
77
|
relative ??= new Intl.RelativeTimeFormat(LOCALE, {
|
|
84
78
|
numeric: "auto",
|
|
85
79
|
})
|
|
86
|
-
const seconds =
|
|
87
|
-
(new Date(date).getTime() - Date.now()) / 1000
|
|
80
|
+
const seconds = (new Date(date).getTime() - Date.now()) / 1000
|
|
88
81
|
for (const [unit, size] of UNITS) {
|
|
89
|
-
if (Math.abs(seconds) >= size)
|
|
90
|
-
return relative.format(
|
|
91
|
-
Math.round(seconds / size),
|
|
92
|
-
unit
|
|
93
|
-
)
|
|
82
|
+
if (Math.abs(seconds) >= size) return relative.format(Math.round(seconds / size), unit)
|
|
94
83
|
}
|
|
95
84
|
return relative.format(0, "second")
|
|
96
85
|
}
|
|
@@ -3,18 +3,12 @@ export const FLOATING_LAYER = "data-floating-layer"
|
|
|
3
3
|
const anchors = new WeakMap<Element, Element>()
|
|
4
4
|
|
|
5
5
|
/** Portals retain the ownership of the control that opened them. */
|
|
6
|
-
export function registerFloatingLayer(
|
|
7
|
-
layer: Element,
|
|
8
|
-
anchor: Element
|
|
9
|
-
): () => void {
|
|
6
|
+
export function registerFloatingLayer(layer: Element, anchor: Element): () => void {
|
|
10
7
|
anchors.set(layer, anchor)
|
|
11
8
|
return () => anchors.delete(layer)
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
export function ownsFloatingLayer(
|
|
15
|
-
container: Element,
|
|
16
|
-
target: Element | null
|
|
17
|
-
): boolean {
|
|
11
|
+
export function ownsFloatingLayer(container: Element, target: Element | null): boolean {
|
|
18
12
|
let layer = target?.closest(`[${FLOATING_LAYER}]`)
|
|
19
13
|
const visited = new Set<Element>()
|
|
20
14
|
while (layer && !visited.has(layer)) {
|
|
@@ -26,3 +20,19 @@ export function ownsFloatingLayer(
|
|
|
26
20
|
}
|
|
27
21
|
return false
|
|
28
22
|
}
|
|
23
|
+
|
|
24
|
+
/** An element belongs to a surface either directly or through a portaled child layer. */
|
|
25
|
+
export function belongsToFloatingSurface(surface: Element, target: Element | null): boolean {
|
|
26
|
+
return Boolean(target && (surface.contains(target) || ownsFloatingLayer(surface, target)))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Whether a pointer target is outside both an anchored surface and its nested portals. */
|
|
30
|
+
export function isOutsideFloatingSurface(
|
|
31
|
+
surface: Element | null,
|
|
32
|
+
anchor: Element,
|
|
33
|
+
target: EventTarget | null
|
|
34
|
+
): boolean {
|
|
35
|
+
if (!target || !("closest" in target) || !("contains" in target)) return false
|
|
36
|
+
const element = target as Element
|
|
37
|
+
return !anchor.contains(element) && (!surface || !belongsToFloatingSurface(surface, element))
|
|
38
|
+
}
|
package/src/lib/haptics.ts
CHANGED
|
@@ -14,9 +14,7 @@ let player: (kind: HapticKind) => void = () => {}
|
|
|
14
14
|
* Components only ask for feedback; the app decides how it plays on this
|
|
15
15
|
* device (system haptics, a vibration, or nothing) and whether it's on.
|
|
16
16
|
*/
|
|
17
|
-
export function setHapticPlayer(
|
|
18
|
-
next: (kind: HapticKind) => void
|
|
19
|
-
): void {
|
|
17
|
+
export function setHapticPlayer(next: (kind: HapticKind) => void): void {
|
|
20
18
|
player = next
|
|
21
19
|
}
|
|
22
20
|
|
package/src/lib/language.ts
CHANGED
|
@@ -3,16 +3,11 @@ export function getNativeLanguageName(tag: string) {
|
|
|
3
3
|
const name = new Intl.DisplayNames([tag], {
|
|
4
4
|
type: "language",
|
|
5
5
|
}).of(tag)
|
|
6
|
-
return name
|
|
7
|
-
? name.charAt(0).toUpperCase() + name.slice(1)
|
|
8
|
-
: tag
|
|
6
|
+
return name ? name.charAt(0).toUpperCase() + name.slice(1) : tag
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
/** A language's name as read in `displayLocale`: "French" in English. */
|
|
12
|
-
export function getLocalizedLanguageName(
|
|
13
|
-
tag: string,
|
|
14
|
-
displayLocale: string
|
|
15
|
-
) {
|
|
10
|
+
export function getLocalizedLanguageName(tag: string, displayLocale: string) {
|
|
16
11
|
return (
|
|
17
12
|
new Intl.DisplayNames([displayLocale], {
|
|
18
13
|
type: "language",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Keep controlled numeric inputs within finite bounds without floating-point drift. */
|
|
2
|
+
export function clampRange(value: number, min: number, max: number): number {
|
|
3
|
+
if (!Number.isFinite(value)) return min
|
|
4
|
+
return Math.min(max, Math.max(min, value))
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** The nearest reachable step from min, optionally allowing an exact maximum. */
|
|
8
|
+
export function stepRange(
|
|
9
|
+
value: number,
|
|
10
|
+
direction: -1 | 1,
|
|
11
|
+
min: number,
|
|
12
|
+
max: number,
|
|
13
|
+
step: number
|
|
14
|
+
): number {
|
|
15
|
+
const precision = Math.min(12, Math.max(0, ...[min, max, step].map(decimalPlaces)))
|
|
16
|
+
const factor = 10 ** precision
|
|
17
|
+
const low = Math.round(min * factor)
|
|
18
|
+
const high = Math.round(max * factor)
|
|
19
|
+
const increment = Math.max(1, Math.round(step * factor))
|
|
20
|
+
const current = Math.round(clampRange(value, min, max) * factor)
|
|
21
|
+
const next =
|
|
22
|
+
direction > 0
|
|
23
|
+
? low + (Math.floor((current - low) / increment) + 1) * increment
|
|
24
|
+
: low + (Math.ceil((current - low) / increment) - 1) * increment
|
|
25
|
+
return clampRange(Math.min(high, Math.max(low, next)) / factor, min, max)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function decimalPlaces(value: number): number {
|
|
29
|
+
const text = String(value)
|
|
30
|
+
const [mantissa, exponent] = text.toLowerCase().split("e")
|
|
31
|
+
return Math.max(0, (mantissa?.split(".")[1]?.length ?? 0) - Number(exponent ?? 0))
|
|
32
|
+
}
|
package/src/lib/screen-edges.ts
CHANGED
|
@@ -14,10 +14,7 @@ let probe: HTMLDivElement | undefined
|
|
|
14
14
|
*/
|
|
15
15
|
export function screenEdges(): ScreenEdges {
|
|
16
16
|
const margin =
|
|
17
|
-
typeof window !== "undefined" &&
|
|
18
|
-
window.matchMedia("(pointer: coarse)").matches
|
|
19
|
-
? 12
|
|
20
|
-
: 8
|
|
17
|
+
typeof window !== "undefined" && window.matchMedia("(pointer: coarse)").matches ? 12 : 8
|
|
21
18
|
if (typeof document === "undefined") {
|
|
22
19
|
return {
|
|
23
20
|
top: margin,
|
|
@@ -38,8 +35,7 @@ export function screenEdges(): ScreenEdges {
|
|
|
38
35
|
return {
|
|
39
36
|
top: Number.parseFloat(style.paddingTop) + margin,
|
|
40
37
|
right: Number.parseFloat(style.paddingRight) + margin,
|
|
41
|
-
bottom:
|
|
42
|
-
Number.parseFloat(style.paddingBottom) + margin,
|
|
38
|
+
bottom: Number.parseFloat(style.paddingBottom) + margin,
|
|
43
39
|
left: Number.parseFloat(style.paddingLeft) + margin,
|
|
44
40
|
}
|
|
45
41
|
}
|
package/src/lib/shapes.ts
CHANGED
|
@@ -13,10 +13,7 @@ export const shapes = [
|
|
|
13
13
|
export type Shape = (typeof shapes)[number]
|
|
14
14
|
|
|
15
15
|
/** Lobe count and wave depth (as a fraction of the radius) for each wavy shape. */
|
|
16
|
-
const waves: Record<
|
|
17
|
-
Exclude<Shape, "circle">,
|
|
18
|
-
{ lobes: number; depth: number }
|
|
19
|
-
> = {
|
|
16
|
+
const waves: Record<Exclude<Shape, "circle">, { lobes: number; depth: number }> = {
|
|
20
17
|
cookie4: { lobes: 4, depth: 0.08 },
|
|
21
18
|
cookie6: { lobes: 6, depth: 0.07 },
|
|
22
19
|
cookie9: { lobes: 9, depth: 0.055 },
|
|
@@ -33,12 +30,7 @@ const STEPS = 144
|
|
|
33
30
|
* "clover", and "sunny" outlines. The wave is normalised so every shape fills
|
|
34
31
|
* the same `r`, keeping icons optically the same size.
|
|
35
32
|
*/
|
|
36
|
-
export function shapePath(
|
|
37
|
-
shape: Shape,
|
|
38
|
-
cx: number,
|
|
39
|
-
cy: number,
|
|
40
|
-
r: number
|
|
41
|
-
) {
|
|
33
|
+
export function shapePath(shape: Shape, cx: number, cy: number, r: number) {
|
|
42
34
|
if (shape === "circle") {
|
|
43
35
|
return `M ${cx - r} ${cy} a ${r} ${r} 0 1 0 ${r * 2} 0 a ${r} ${r} 0 1 0 ${-r * 2} 0 Z`
|
|
44
36
|
}
|
|
@@ -48,16 +40,10 @@ export function shapePath(
|
|
|
48
40
|
const points: string[] = []
|
|
49
41
|
for (let i = 0; i < STEPS; i++) {
|
|
50
42
|
const theta = (i / STEPS) * Math.PI * 2 - Math.PI / 2
|
|
51
|
-
const radius =
|
|
52
|
-
base *
|
|
53
|
-
(1 +
|
|
54
|
-
depth *
|
|
55
|
-
Math.cos(lobes * (theta + Math.PI / 2)))
|
|
43
|
+
const radius = base * (1 + depth * Math.cos(lobes * (theta + Math.PI / 2)))
|
|
56
44
|
const x = cx + radius * Math.cos(theta)
|
|
57
45
|
const y = cy + radius * Math.sin(theta)
|
|
58
|
-
points.push(
|
|
59
|
-
`${i === 0 ? "M" : "L"} ${x.toFixed(2)} ${y.toFixed(2)}`
|
|
60
|
-
)
|
|
46
|
+
points.push(`${i === 0 ? "M" : "L"} ${x.toFixed(2)} ${y.toFixed(2)}`)
|
|
61
47
|
}
|
|
62
48
|
return `${points.join(" ")} Z`
|
|
63
49
|
}
|
|
@@ -66,5 +52,4 @@ export function shapePath(
|
|
|
66
52
|
* The app wide `dualTone` rule dims every svg path for two tone icons; a
|
|
67
53
|
* drawn shape or illustration opts out with this so its colors stay true.
|
|
68
54
|
*/
|
|
69
|
-
export const plainSvg =
|
|
70
|
-
"cursor-[inherit] [&_path]:opacity-100 [&_path]:transform-none"
|
|
55
|
+
export const plainSvg = "cursor-[inherit] [&_path]:opacity-100 [&_path]:transform-none"
|
|
@@ -8,18 +8,24 @@ export const spring = {
|
|
|
8
8
|
bouncy: { type: "spring", ...springs.bouncy },
|
|
9
9
|
} as const satisfies Record<keyof typeof springs, Transition>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
y:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
export type FloatingPanelSide = "above" | "below"
|
|
12
|
+
|
|
13
|
+
/** Anchored panels settle toward their source without shrinking their text. */
|
|
14
|
+
export function floatingPanelMotion(side: FloatingPanelSide = "below") {
|
|
15
|
+
const direction = side === "above" ? 1 : -1
|
|
16
|
+
return {
|
|
17
|
+
initial: { opacity: 0, scale: 1, y: direction * 6 },
|
|
18
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
19
|
+
exit: { opacity: 0, scale: 1, y: direction * 4 },
|
|
20
|
+
transition: {
|
|
21
|
+
...spring.smooth,
|
|
22
|
+
opacity: { duration: 0.16 },
|
|
23
|
+
},
|
|
24
|
+
} as const
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Default below-anchor presentation, retained for existing consumers. */
|
|
28
|
+
export const popoverMotion = floatingPanelMotion()
|
|
23
29
|
|
|
24
30
|
/** Floating bars that rise from the bottom edge. */
|
|
25
31
|
export const riseMotion = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.passui-code-block pre {
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding-block: 1rem;
|
|
5
|
+
padding-inline-end: 1.5rem;
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
font-family: var(--font-mono);
|
|
8
|
+
font-size: var(--text-footnote);
|
|
9
|
+
line-height: 1.75;
|
|
10
|
+
color: var(--color-label);
|
|
11
|
+
background: transparent !important;
|
|
12
|
+
counter-reset: code-line;
|
|
13
|
+
tab-size: 4;
|
|
14
|
+
}
|
|
15
|
+
.passui-code-block .line { display: inline-block; min-width: 100%; }
|
|
16
|
+
.passui-code-block[data-line-numbers] .line::before {
|
|
17
|
+
counter-increment: code-line;
|
|
18
|
+
content: counter(code-line);
|
|
19
|
+
display: inline-block;
|
|
20
|
+
width: 3rem;
|
|
21
|
+
margin-inline-end: 1.25rem;
|
|
22
|
+
color: var(--color-label-tertiary);
|
|
23
|
+
text-align: end;
|
|
24
|
+
user-select: none;
|
|
25
|
+
}
|
|
26
|
+
.passui-code-block:not([data-line-numbers]) pre { padding-inline-start: 1rem; }
|
|
27
|
+
.passui-code-block .shiki, .passui-code-block .shiki span { color: var(--shiki-light); background: transparent !important; }
|
|
28
|
+
@media (prefers-color-scheme: dark) {
|
|
29
|
+
.passui-code-block .shiki, .passui-code-block .shiki span { color: var(--shiki-dark); }
|
|
30
|
+
}
|
|
31
|
+
[data-theme="light"] .passui-code-block .shiki, [data-theme="light"] .passui-code-block .shiki span { color: var(--shiki-light); }
|
|
32
|
+
[data-theme="dark"] .passui-code-block .shiki, [data-theme="dark"] .passui-code-block .shiki span { color: var(--shiki-dark); }
|
|
33
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/* Slosh and Wake adapted from Bencho; see THIRD_PARTY_NOTICES.md.
|
|
2
|
+
Bencho ink/fill-on map to label; board/fill-slab to elevated; bg to
|
|
3
|
+
background; pane-edge to separator; font-ui to font-sans. Color mixes
|
|
4
|
+
replace rgba RGB triples, so no Bencho variables or new globals leak. */
|
|
5
|
+
@layer components {
|
|
6
|
+
.passui-search-pill { transition: scale 90ms ease; }
|
|
7
|
+
.passui-search-pill:active { scale: 0.98; }
|
|
8
|
+
/* The outline stays whole; its legend opens a real gap under the label.
|
|
9
|
+
No painted background patch needs to match the field's surroundings. */
|
|
10
|
+
.passui-field-outline {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: -0.45em 0 0;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0 0.5rem;
|
|
16
|
+
border: 1px solid var(--color-separator);
|
|
17
|
+
border-radius: inherit;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
transition: border-color 200ms ease;
|
|
20
|
+
}
|
|
21
|
+
.passui-field-outline legend {
|
|
22
|
+
max-width: 0;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
padding: 0;
|
|
25
|
+
font-size: var(--text-footnote);
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
visibility: hidden;
|
|
28
|
+
transition: max-width 320ms ease, padding 320ms ease;
|
|
29
|
+
}
|
|
30
|
+
.passui-floating-label {
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset-inline-start: 0.75rem;
|
|
33
|
+
top: 50%;
|
|
34
|
+
z-index: 1;
|
|
35
|
+
max-width: calc(100% - 1.5rem);
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
color: var(--color-label-secondary);
|
|
40
|
+
font-size: var(--text-body);
|
|
41
|
+
transform: translateY(-50%);
|
|
42
|
+
transform-origin: left center;
|
|
43
|
+
transition: top 320ms ease, transform 320ms ease, color 200ms ease;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
}
|
|
46
|
+
.passui-floating-label:dir(rtl) { transform-origin: right center; }
|
|
47
|
+
.passui-floating-label-with-icon { inset-inline-start: 2.5rem; }
|
|
48
|
+
.passui-floating-field input::placeholder { opacity: 0; }
|
|
49
|
+
.passui-floating-field:focus-within input::placeholder { opacity: 1; }
|
|
50
|
+
.passui-floating-field:focus-within .passui-field-outline { border-color: var(--color-label); }
|
|
51
|
+
.passui-floating-field:has(input[aria-invalid="true"]) .passui-field-outline { border-color: var(--color-danger); }
|
|
52
|
+
.passui-floating-field:is(:focus-within, :has(input:not(:placeholder-shown))) .passui-floating-label {
|
|
53
|
+
top: 0;
|
|
54
|
+
inset-inline-start: 0.75rem;
|
|
55
|
+
transform: translateY(-50%) scale(0.78);
|
|
56
|
+
color: var(--color-label);
|
|
57
|
+
}
|
|
58
|
+
.passui-floating-field:is(:focus-within, :has(input:not(:placeholder-shown))) legend {
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
padding-inline: 0.25rem;
|
|
61
|
+
}
|
|
62
|
+
.passui-one-time-code { width: 100%; max-width: calc(var(--otp-length) * 2.5rem + (var(--otp-length) - 1) * 0.5rem); }
|
|
63
|
+
.passui-otp-row { position: relative; height: 3rem; }
|
|
64
|
+
.passui-otp-materials, .passui-otp-digits { display: flex; position: absolute; inset: 0; gap: 0.5rem; pointer-events: none; }
|
|
65
|
+
.passui-otp-cell, .passui-otp-digit { flex: 1; min-width: 0; border-radius: var(--radius-xl); }
|
|
66
|
+
.passui-otp-cell {
|
|
67
|
+
background: var(--color-fill);
|
|
68
|
+
transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms;
|
|
69
|
+
}
|
|
70
|
+
.passui-otp-digit { display: grid; place-items: center; font-size: var(--text-title3); color: var(--color-label); font-variant-numeric: tabular-nums; }
|
|
71
|
+
.passui-otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: text; }
|
|
72
|
+
.passui-one-time-code:focus-within .passui-otp-digit[data-active] { box-shadow: inset 0 0 0 2px var(--color-accent-text); }
|
|
73
|
+
.passui-otp-glyph { animation: passui-otp-in 200ms ease-out both; }
|
|
74
|
+
@keyframes passui-otp-in { from { transform: translateY(45%) scale(0.86); opacity: 0; filter: blur(3px); } }
|
|
75
|
+
.passui-otp-capsule { position: absolute; inset-block: 0; left: 50%; width: 60%; border-radius: var(--radius-full); background: var(--color-accent); transform: translateX(-50%) scaleX(0); opacity: 0; transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms; }
|
|
76
|
+
.passui-one-time-code:is([data-status="verifying"], [data-status="success"]) .passui-otp-cell { transform: translateX(calc((var(--otp-middle) - var(--otp-index)) * (100% + 0.5rem))); background: var(--color-accent); }
|
|
77
|
+
.passui-one-time-code:is([data-status="verifying"], [data-status="success"]) .passui-otp-capsule { opacity: 1; transform: translateX(-50%) scaleX(1); }
|
|
78
|
+
.passui-one-time-code:is([data-status="verifying"], [data-status="success"]) .passui-otp-digits { opacity: 0; }
|
|
79
|
+
.passui-otp-check { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--color-on-accent); opacity: 0; pointer-events: none; }
|
|
80
|
+
.passui-one-time-code[data-status="success"] .passui-otp-check { opacity: 1; transition: opacity 160ms 240ms; }
|
|
81
|
+
/* A wrong code shivers, then drains right to left. Selecting the single
|
|
82
|
+
input afterward lets the next keystroke replace it without a trap. */
|
|
83
|
+
.passui-one-time-code[data-status="error"] .passui-otp-digit { animation: passui-otp-shiver 380ms ease-out; }
|
|
84
|
+
.passui-one-time-code[data-status="error"] .passui-otp-glyph { animation: passui-otp-drain 220ms calc(380ms + (var(--otp-length) - var(--otp-index)) * 35ms) both; }
|
|
85
|
+
@keyframes passui-otp-shiver { 20% { transform: translateX(4px); } 40% { transform: translateX(-3px); } 60% { transform: translateX(2px); } 80% { transform: translateX(-1px); } }
|
|
86
|
+
@keyframes passui-otp-drain { to { transform: translateY(65%); opacity: 0; filter: blur(3px); } }
|
|
87
|
+
.passui-progress-fill {
|
|
88
|
+
clip-path: polygon(0 0, calc(100% + var(--progress-lean, 0px)) 0,
|
|
89
|
+
calc(100% - var(--progress-lean, 0px)) 100%, 0 100%);
|
|
90
|
+
}
|
|
91
|
+
.passui-slosh-slider {
|
|
92
|
+
width: 100%;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
font-family: var(--font-sans);
|
|
95
|
+
color: var(--color-label);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* No transitions: every geometry value is written by the loop, and
|
|
99
|
+
a transition on top of a spring is two opinions about one number. */
|
|
100
|
+
.passui-slosh-track {
|
|
101
|
+
position: relative;
|
|
102
|
+
height: 2.5rem;
|
|
103
|
+
border-radius: var(--slosh-radius, var(--radius-full));
|
|
104
|
+
/* Opaque, mixed from the surface's own pair. A translucent wash
|
|
105
|
+
changes with the stage behind it and can disappear in dark mode. */
|
|
106
|
+
background: color-mix(in srgb, var(--color-label) 11%, var(--color-elevated));
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
cursor: ew-resize;
|
|
109
|
+
touch-action: pan-y;
|
|
110
|
+
}
|
|
111
|
+
.passui-slosh-track[aria-disabled="true"],
|
|
112
|
+
.passui-wake-track[aria-disabled="true"] { cursor: not-allowed; }
|
|
113
|
+
.passui-slosh-track:focus-visible,
|
|
114
|
+
.passui-wake-track:focus-visible {
|
|
115
|
+
outline: 2px solid var(--color-accent-text);
|
|
116
|
+
outline-offset: 4px;
|
|
117
|
+
}
|
|
118
|
+
.passui-slosh-fill {
|
|
119
|
+
position: absolute;
|
|
120
|
+
inset-block: 0;
|
|
121
|
+
inset-inline-start: 0;
|
|
122
|
+
background: light-dark(var(--color-elevated), color-mix(in srgb, var(--color-label) 15%, var(--color-elevated)));
|
|
123
|
+
/* Clipped, never skewed: a skew lifts the whole body off the floor;
|
|
124
|
+
a meniscus leans only the moving edge. The track clips end stops. */
|
|
125
|
+
clip-path: polygon(0 0, calc(100% + var(--slosh-lean, 0px)) 0,
|
|
126
|
+
calc(100% - var(--slosh-lean, 0px)) 100%, 0 100%);
|
|
127
|
+
}
|
|
128
|
+
.passui-slosh-track:dir(rtl) .passui-slosh-fill { transform: scaleX(-1); }
|
|
129
|
+
.passui-slosh-knob {
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 6px;
|
|
132
|
+
bottom: 6px;
|
|
133
|
+
width: 3px;
|
|
134
|
+
margin-inline-start: -1.5px;
|
|
135
|
+
border-radius: var(--radius-full);
|
|
136
|
+
background: var(--color-label);
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
/* Each bar holds energy. Its height is written directly, while React
|
|
140
|
+
owns the value and lit marks. No standing animation runs at rest. */
|
|
141
|
+
.passui-wake-slider {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 1rem;
|
|
145
|
+
width: 100%;
|
|
146
|
+
min-width: 0;
|
|
147
|
+
color: var(--color-label);
|
|
148
|
+
}
|
|
149
|
+
.passui-wake-track {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex: 1;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: space-between;
|
|
155
|
+
gap: min(4px, calc(25% / var(--wake-bars, 36)));
|
|
156
|
+
cursor: ew-resize;
|
|
157
|
+
touch-action: pan-y;
|
|
158
|
+
user-select: none;
|
|
159
|
+
-webkit-user-select: none;
|
|
160
|
+
-webkit-tap-highlight-color: transparent;
|
|
161
|
+
border-radius: var(--radius-sm);
|
|
162
|
+
}
|
|
163
|
+
.passui-wake-bar {
|
|
164
|
+
flex: 1 1 3px;
|
|
165
|
+
max-width: 3px;
|
|
166
|
+
min-width: 0;
|
|
167
|
+
border-radius: var(--radius-full);
|
|
168
|
+
background: color-mix(in srgb, var(--color-label) 24%, var(--color-elevated));
|
|
169
|
+
transform-origin: 50% 50%;
|
|
170
|
+
transition: background-color 160ms ease;
|
|
171
|
+
}
|
|
172
|
+
.passui-wake-bar[data-on] { background: var(--color-label); }
|
|
173
|
+
.passui-wake-value {
|
|
174
|
+
min-width: 3ch;
|
|
175
|
+
font-family: var(--font-sans);
|
|
176
|
+
font-size: var(--text-footnote);
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
font-variant-numeric: tabular-nums;
|
|
179
|
+
color: var(--color-label-secondary);
|
|
180
|
+
}
|
|
181
|
+
@media (prefers-reduced-motion: reduce) {
|
|
182
|
+
.passui-wake-bar, .passui-search-pill { transition: none; }
|
|
183
|
+
.passui-search-pill:active { scale: 1; }
|
|
184
|
+
.passui-floating-label, .passui-field-outline, .passui-field-outline legend,
|
|
185
|
+
.passui-otp-cell, .passui-otp-capsule, .passui-otp-check { transition: none; }
|
|
186
|
+
.passui-otp-glyph, .passui-otp-digit { animation: none !important; }
|
|
187
|
+
.passui-otp-materials { filter: none !important; }
|
|
188
|
+
}
|
|
189
|
+
}
|
package/src/styles/styles.css
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { AmbientNowPlaying } from "./examples/ambient-now-playing"
|
|
2
|
-
import { Ambient } from "./ambient"
|
|
3
|
-
import { defineDocs } from "../../docs/types"
|
|
4
|
-
import { AmbientImages } from "./examples/ambient-images"
|
|
5
|
-
import { AmbientShowcase } from "./examples/ambient-showcase"
|
|
6
|
-
import { AmbientUsage } from "./examples/ambient-usage"
|
|
7
|
-
|
|
8
|
-
// src is any image URL; the playground offers the three sample images.
|
|
9
|
-
type DemoProps = {
|
|
10
|
-
image: "aiko" | "kenji" | "mira" | "none"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const ambientDocs = defineDocs<DemoProps>()({
|
|
14
|
-
slug: "ambient",
|
|
15
|
-
name: "Ambient",
|
|
16
|
-
importPath: "@passui/react/ambient",
|
|
17
|
-
controls: {
|
|
18
|
-
image: {
|
|
19
|
-
kind: "select",
|
|
20
|
-
options: {
|
|
21
|
-
aiko: true,
|
|
22
|
-
kenji: true,
|
|
23
|
-
mira: true,
|
|
24
|
-
none: true,
|
|
25
|
-
},
|
|
26
|
-
default: "aiko",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
render: ({ image }) => (
|
|
30
|
-
<Ambient
|
|
31
|
-
key={image}
|
|
32
|
-
src={
|
|
33
|
-
image === "none"
|
|
34
|
-
? undefined
|
|
35
|
-
: `/avatars/${image}.svg`
|
|
36
|
-
}
|
|
37
|
-
className="flex w-72 flex-col items-center gap-3 py-12 text-center"
|
|
38
|
-
>
|
|
39
|
-
<img
|
|
40
|
-
src={
|
|
41
|
-
image === "none"
|
|
42
|
-
? "/avatars/aiko.svg"
|
|
43
|
-
: `/avatars/${image}.svg`
|
|
44
|
-
}
|
|
45
|
-
alt=""
|
|
46
|
-
className="size-24 rounded-3xl shadow-sm"
|
|
47
|
-
/>
|
|
48
|
-
<p className="text-headline font-semibold text-label">
|
|
49
|
-
Now playing
|
|
50
|
-
</p>
|
|
51
|
-
</Ambient>
|
|
52
|
-
),
|
|
53
|
-
childrenSnippet: ({ image }) => ({
|
|
54
|
-
imports: [],
|
|
55
|
-
omit: ["image"],
|
|
56
|
-
extraProps:
|
|
57
|
-
image === "none"
|
|
58
|
-
? undefined
|
|
59
|
-
: { src: `/avatars/${image}.svg` },
|
|
60
|
-
children: `\n <img src="/avatars/${image === "none" ? "aiko" : image}.svg" alt="" />\n`,
|
|
61
|
-
}),
|
|
62
|
-
usage: AmbientUsage,
|
|
63
|
-
showcase: AmbientShowcase,
|
|
64
|
-
examples: [
|
|
65
|
-
{ id: "images", component: AmbientImages },
|
|
66
|
-
{ id: "now-playing", component: AmbientNowPlaying },
|
|
67
|
-
],
|
|
68
|
-
})
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Ambient } from "@passui/react/ambient"
|
|
2
|
-
|
|
3
|
-
const people = [
|
|
4
|
-
{ name: "Aiko", src: "/avatars/aiko.svg" },
|
|
5
|
-
{ name: "Kenji", src: "/avatars/kenji.svg" },
|
|
6
|
-
{ name: "Mira", src: "/avatars/mira.svg" },
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
export function AmbientImages() {
|
|
10
|
-
return (
|
|
11
|
-
<div className="grid w-full max-w-xl grid-cols-3 gap-2">
|
|
12
|
-
{people.map((person) => (
|
|
13
|
-
<Ambient
|
|
14
|
-
key={person.name}
|
|
15
|
-
src={person.src}
|
|
16
|
-
className="flex flex-col items-center gap-2 py-8"
|
|
17
|
-
>
|
|
18
|
-
<img
|
|
19
|
-
src={person.src}
|
|
20
|
-
alt=""
|
|
21
|
-
className="size-14 rounded-full"
|
|
22
|
-
/>
|
|
23
|
-
<span className="text-subheadline font-medium text-label">
|
|
24
|
-
{person.name}
|
|
25
|
-
</span>
|
|
26
|
-
</Ambient>
|
|
27
|
-
))}
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PauseIcon,
|
|
3
|
-
NextIcon,
|
|
4
|
-
PreviousIcon,
|
|
5
|
-
} from "@hugeicons/core-free-icons"
|
|
6
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
7
|
-
import { Ambient } from "@passui/react/ambient"
|
|
8
|
-
import { IconButton } from "@passui/react/icon-button"
|
|
9
|
-
|
|
10
|
-
export function AmbientNowPlaying() {
|
|
11
|
-
return (
|
|
12
|
-
<Ambient
|
|
13
|
-
src="/avatars/kenji.svg"
|
|
14
|
-
className="flex w-full max-w-xs flex-col items-center gap-4 py-10 text-center"
|
|
15
|
-
>
|
|
16
|
-
<img
|
|
17
|
-
src="/avatars/kenji.svg"
|
|
18
|
-
alt=""
|
|
19
|
-
className="size-40 rounded-4xl shadow-sm"
|
|
20
|
-
/>
|
|
21
|
-
<div className="flex flex-col">
|
|
22
|
-
<span className="text-headline font-semibold text-label">
|
|
23
|
-
Morning Light
|
|
24
|
-
</span>
|
|
25
|
-
<span className="text-footnote text-label-secondary">
|
|
26
|
-
Kenji Mori
|
|
27
|
-
</span>
|
|
28
|
-
</div>
|
|
29
|
-
<div className="flex items-center gap-2">
|
|
30
|
-
<IconButton label="Previous" variant="ghost">
|
|
31
|
-
<HugeiconsIcon
|
|
32
|
-
icon={PreviousIcon}
|
|
33
|
-
size={22}
|
|
34
|
-
/>
|
|
35
|
-
</IconButton>
|
|
36
|
-
<IconButton
|
|
37
|
-
label="Pause"
|
|
38
|
-
variant="secondary"
|
|
39
|
-
size="icon-lg"
|
|
40
|
-
>
|
|
41
|
-
<HugeiconsIcon
|
|
42
|
-
icon={PauseIcon}
|
|
43
|
-
size={24}
|
|
44
|
-
/>
|
|
45
|
-
</IconButton>
|
|
46
|
-
<IconButton label="Next" variant="ghost">
|
|
47
|
-
<HugeiconsIcon
|
|
48
|
-
icon={NextIcon}
|
|
49
|
-
size={22}
|
|
50
|
-
/>
|
|
51
|
-
</IconButton>
|
|
52
|
-
</div>
|
|
53
|
-
</Ambient>
|
|
54
|
-
)
|
|
55
|
-
}
|