@passui/react 0.1.46 → 0.2.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/README.md +29 -109
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/accordion.d.ts +15 -0
- package/dist/accordion.js +93 -0
- package/dist/alert-dialog.d.ts +26 -0
- package/dist/alert-dialog.js +142 -0
- package/dist/alert.d.ts +10 -0
- package/dist/alert.js +28 -0
- package/dist/{types/src/components/ambient/ambient.d.ts → ambient.d.ts} +4 -4
- package/dist/ambient.js +22 -0
- package/dist/{types/src/appearance → appearance}/platform.d.ts +3 -3
- package/dist/appearance/platform.js +43 -0
- package/dist/appearance/theme.d.ts +71 -0
- package/dist/appearance/theme.js +236 -0
- package/dist/appearance.d.ts +3 -0
- package/dist/appearance.js +3 -0
- package/dist/{types/src/components/aspect-ratio/aspect-ratio.d.ts → aspect-ratio.d.ts} +4 -4
- package/dist/aspect-ratio.js +17 -0
- package/dist/avatar.d.ts +5 -0
- package/dist/avatar.js +43 -0
- package/dist/badge.d.ts +8 -0
- package/dist/badge.js +21 -0
- package/dist/breadcrumb.d.ts +13 -0
- package/dist/breadcrumb.js +63 -0
- package/dist/button-group.d.ts +5 -0
- package/dist/button-group.js +14 -0
- package/dist/button.d.ts +21 -0
- package/dist/button.js +58 -0
- package/dist/calendar.d.ts +35 -0
- package/dist/calendar.js +225 -0
- package/dist/card.d.ts +9 -0
- package/dist/card.js +54 -0
- package/dist/chart.d.ts +30 -0
- package/dist/chart.js +226 -0
- package/dist/checkbox.d.ts +13 -0
- package/dist/checkbox.js +53 -0
- package/dist/{types/src/lib/clipboard.d.ts → clipboard.d.ts} +1 -1
- package/dist/clipboard.js +16 -0
- package/dist/cn.d.ts +2 -0
- package/dist/cn.js +10 -0
- package/dist/code-block.d.ts +34 -0
- package/dist/code-block.js +87 -0
- package/dist/collapsible.d.ts +13 -0
- package/dist/collapsible.js +49 -0
- package/dist/combobox.d.ts +25 -0
- package/dist/combobox.js +112 -0
- package/dist/command.d.ts +22 -0
- package/dist/command.js +129 -0
- package/dist/components/toast/toast-store.d.ts +60 -0
- package/dist/components/toast/toast-store.js +96 -0
- package/dist/{types/src/components → components}/toast/toaster.d.ts +4 -4
- package/dist/components/toast/toaster.js +345 -0
- package/dist/context-menu.d.ts +2 -0
- package/dist/context-menu.js +2 -0
- package/dist/conversation.d.ts +48 -0
- package/dist/conversation.js +202 -0
- package/dist/date-time-picker.d.ts +50 -0
- package/dist/date-time-picker.js +235 -0
- package/dist/date.d.ts +50 -0
- package/dist/date.js +77 -0
- package/dist/dialog.d.ts +21 -0
- package/dist/dialog.js +113 -0
- package/dist/drawer.d.ts +30 -0
- package/dist/drawer.js +140 -0
- package/dist/dropdown-menu.d.ts +56 -0
- package/dist/dropdown-menu.js +295 -0
- package/dist/empty.d.ts +11 -0
- package/dist/empty.js +51 -0
- package/dist/field.d.ts +16 -0
- package/dist/field.js +47 -0
- package/{src/hooks/scroll/minimize-decision.ts → dist/hooks/scroll/minimize-decision.js} +3 -5
- package/dist/{types/src/hooks → hooks}/use-anchored-placement.d.ts +2 -2
- package/dist/hooks/use-anchored-placement.js +33 -0
- package/dist/{types/src/hooks → hooks}/use-minimize-on-scroll.d.ts +1 -1
- package/dist/hooks/use-minimize-on-scroll.js +59 -0
- package/dist/{types/src/hooks → hooks}/use-visual-viewport.d.ts +2 -2
- package/{src/hooks/use-visual-viewport.ts → dist/hooks/use-visual-viewport.js} +20 -35
- package/dist/hooks/viewport/types.d.ts +7 -0
- package/dist/hooks/viewport/viewport-metrics.js +13 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.js +80 -0
- package/dist/input-group.d.ts +17 -0
- package/dist/input-group.js +55 -0
- package/dist/input-otp.d.ts +13 -0
- package/dist/input-otp.js +36 -0
- package/dist/input.d.ts +4 -0
- package/dist/input.js +14 -0
- package/dist/item.d.ts +49 -0
- package/dist/item.js +142 -0
- package/dist/kbd.d.ts +4 -0
- package/dist/kbd.js +86 -0
- package/dist/label.d.ts +3 -0
- package/dist/label.js +12 -0
- package/dist/labeled-content.d.ts +24 -0
- package/dist/labeled-content.js +41 -0
- package/dist/{types/src/lib/language.d.ts → language.d.ts} +1 -1
- package/dist/language.js +11 -0
- package/dist/layout.d.ts +24 -0
- package/dist/layout.js +36 -0
- package/dist/{types/src/lib → lib}/anchored-placement.d.ts +27 -27
- package/dist/lib/anchored-placement.js +42 -0
- package/dist/lib/calendar-month.js +90 -0
- package/dist/lib/cx.js +6 -0
- package/dist/lib/drawer.math.js +29 -0
- package/dist/lib/floating-layers.d.ts +3 -0
- package/dist/lib/floating-layers.js +25 -0
- package/dist/{types/src/lib → lib}/haptics.d.ts +1 -1
- package/dist/lib/haptics.js +13 -0
- package/dist/lib/liquid-step.js +33 -0
- package/dist/lib/page-scale.js +58 -0
- package/dist/lib/portal.js +12 -0
- package/dist/lib/presence.js +53 -0
- package/dist/lib/range-value.js +25 -0
- package/dist/lib/render.d.ts +8 -0
- package/dist/lib/render.js +42 -0
- package/dist/lib/rolling-digit.js +83 -0
- package/dist/{types/src/lib → lib}/screen-edges.d.ts +5 -5
- package/dist/lib/screen-edges.js +30 -0
- package/dist/lib/swipe-touch-action.js +34 -0
- package/dist/lib/visual-viewport.js +27 -0
- package/dist/lib/water-drop.js +412 -0
- package/dist/lib/wheel.js +125 -0
- package/dist/list.d.ts +26 -0
- package/dist/list.js +80 -0
- package/dist/locales.d.ts +18 -0
- package/dist/locales.js +36 -0
- package/dist/marker.d.ts +13 -0
- package/dist/marker.js +33 -0
- package/dist/motion/transitions.d.ts +170 -0
- package/dist/motion/transitions.js +156 -0
- package/dist/pagination.d.ts +30 -0
- package/dist/pagination.js +117 -0
- package/dist/popover.d.ts +26 -0
- package/dist/popover.js +101 -0
- package/dist/progress.d.ts +9 -0
- package/dist/progress.js +24 -0
- package/dist/questionnaire.d.ts +46 -0
- package/dist/questionnaire.js +133 -0
- package/dist/radio-group.d.ts +21 -0
- package/dist/radio-group.js +67 -0
- package/dist/search-field.d.ts +18 -0
- package/dist/search-field.js +45 -0
- package/dist/segmented-control.d.ts +16 -0
- package/dist/segmented-control.js +25 -0
- package/dist/select.d.ts +24 -0
- package/dist/select.js +107 -0
- package/dist/separator.d.ts +9 -0
- package/dist/separator.js +17 -0
- package/dist/{types/src/lib/shapes.d.ts → shapes.d.ts} +2 -2
- package/dist/shapes.js +65 -0
- package/dist/sheet.d.ts +24 -0
- package/dist/sheet.js +141 -0
- package/dist/sidebar.d.ts +32 -0
- package/dist/sidebar.js +85 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.js +13 -0
- package/dist/slider.d.ts +9 -0
- package/dist/slider.js +42 -0
- package/dist/slosh-slider.d.ts +21 -0
- package/dist/slosh-slider.js +205 -0
- package/dist/spinner.d.ts +3 -0
- package/dist/spinner.js +20 -0
- package/dist/stat-tile.d.ts +20 -0
- package/dist/stat-tile.js +53 -0
- package/dist/stepper.d.ts +22 -0
- package/dist/stepper.js +98 -0
- package/dist/swatch-picker.d.ts +22 -0
- package/dist/swatch-picker.js +70 -0
- package/dist/switch.d.ts +10 -0
- package/dist/switch.js +44 -0
- package/dist/tab-bar.d.ts +15 -0
- package/dist/tab-bar.js +34 -0
- package/dist/{types/src/components/table/table.d.ts → table.d.ts} +3 -3
- package/dist/table.js +93 -0
- package/dist/tabs.d.ts +32 -0
- package/dist/tabs.js +131 -0
- package/dist/text.d.ts +25 -0
- package/dist/text.js +44 -0
- package/dist/textarea.d.ts +3 -0
- package/dist/textarea.js +13 -0
- package/dist/toast.d.ts +3 -0
- package/dist/toast.js +3 -0
- package/dist/toggle-group.d.ts +20 -0
- package/dist/toggle-group.js +68 -0
- package/dist/toggle.d.ts +24 -0
- package/dist/toggle.js +37 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tooltip.d.ts +21 -0
- package/dist/tooltip.js +61 -0
- package/dist/trace.d.ts +14 -0
- package/dist/trace.js +54 -0
- package/dist/{types/src/hooks/use-dismiss.d.ts → use-dismiss.d.ts} +3 -3
- package/dist/use-dismiss.js +38 -0
- package/dist/{types/src/hooks/use-media-query.d.ts → use-media-query.d.ts} +12 -12
- package/dist/use-media-query.js +56 -0
- package/dist/use-os.d.ts +12 -0
- package/dist/use-os.js +17 -0
- package/dist/wake-slider.d.ts +15 -0
- package/dist/wake-slider.js +174 -0
- package/package.json +122 -253
- package/src/styles/code-block.css +4 -0
- package/src/styles/globals.css +5 -0
- package/src/styles/motion-controls.css +10 -0
- package/src/styles/page-scale.css +27 -0
- package/src/styles/styles.css +4 -2
- package/dist/types/src/appearance/index.d.ts +0 -2
- package/dist/types/src/appearance/theme.d.ts +0 -71
- package/dist/types/src/components/accordion/accordion.d.ts +0 -23
- package/dist/types/src/components/ambient/index.d.ts +0 -1
- package/dist/types/src/components/breadcrumb/breadcrumb.d.ts +0 -19
- package/dist/types/src/components/button/button-styles.d.ts +0 -12
- package/dist/types/src/components/button/button.d.ts +0 -32
- package/dist/types/src/components/button/icon-button.d.ts +0 -10
- package/dist/types/src/components/button/pending-spinner.d.ts +0 -5
- package/dist/types/src/components/button/use-pending-indicator.d.ts +0 -2
- package/dist/types/src/components/chip/chip.d.ts +0 -10
- package/dist/types/src/components/code-block/code-block.d.ts +0 -13
- package/dist/types/src/components/combo-box/combo-box.d.ts +0 -9
- package/dist/types/src/components/command/command.d.ts +0 -18
- package/dist/types/src/components/compact-date-picker/calendar-month.d.ts +0 -25
- package/dist/types/src/components/compact-date-picker/compact-date-picker.d.ts +0 -30
- package/dist/types/src/components/compact-time-picker/compact-time-picker.d.ts +0 -29
- package/dist/types/src/components/compact-time-picker/time-value.d.ts +0 -18
- package/dist/types/src/components/content-unavailable-view/content-unavailable-view.d.ts +0 -12
- package/dist/types/src/components/content-view/content-view.d.ts +0 -51
- package/dist/types/src/components/content-view/index.d.ts +0 -1
- package/dist/types/src/components/context-menu/conceal-menu-source.d.ts +0 -2
- package/dist/types/src/components/context-menu/context-menu-host.d.ts +0 -2
- package/dist/types/src/components/context-menu/context-menu-store.d.ts +0 -62
- package/dist/types/src/components/context-menu/menu-navigation.d.ts +0 -6
- package/dist/types/src/components/context-menu/menu-position.d.ts +0 -21
- package/dist/types/src/components/context-menu/menu-reveal.d.ts +0 -26
- package/dist/types/src/components/context-menu/use-context-menu.d.ts +0 -14
- package/dist/types/src/components/conversation/conversation.d.ts +0 -48
- package/dist/types/src/components/conversation/index.d.ts +0 -1
- package/dist/types/src/components/date-picker/date-picker.d.ts +0 -19
- package/dist/types/src/components/date-picker/date-value.d.ts +0 -2
- package/dist/types/src/components/dialog/dialog-host.d.ts +0 -6
- package/dist/types/src/components/dialog/dialog-store.d.ts +0 -23
- package/dist/types/src/components/dialog/dialog.d.ts +0 -33
- package/dist/types/src/components/dialog/index.d.ts +0 -1
- package/dist/types/src/components/disclosure-group/disclosure-group.d.ts +0 -18
- package/dist/types/src/components/divider/divider.d.ts +0 -9
- package/dist/types/src/components/inline-disclosure/inline-disclosure.d.ts +0 -15
- package/dist/types/src/components/keyboard-shortcut/keyboard-shortcut.d.ts +0 -8
- package/dist/types/src/components/labeled-content/labeled-content.d.ts +0 -22
- package/dist/types/src/components/locale-switcher/index.d.ts +0 -1
- package/dist/types/src/components/locale-switcher/locale-switcher.d.ts +0 -13
- package/dist/types/src/components/menu/menu.d.ts +0 -16
- package/dist/types/src/components/morph/index.d.ts +0 -2
- package/dist/types/src/components/morph/morph.d.ts +0 -32
- package/dist/types/src/components/morph/use-morph-disclosure.d.ts +0 -13
- package/dist/types/src/components/one-time-code/one-time-code.d.ts +0 -26
- package/dist/types/src/components/picker/picker-trigger.d.ts +0 -3
- package/dist/types/src/components/picker/picker.d.ts +0 -46
- package/dist/types/src/components/popover/anchored-surface.d.ts +0 -17
- package/dist/types/src/components/popover/index.d.ts +0 -41
- package/dist/types/src/components/popover/popover-content.d.ts +0 -32
- package/dist/types/src/components/popover/popover-fit.d.ts +0 -21
- package/dist/types/src/components/popover/popover-root.d.ts +0 -22
- package/dist/types/src/components/popover/popover-trigger.d.ts +0 -23
- package/dist/types/src/components/profile-image/profile-image.d.ts +0 -9
- package/dist/types/src/components/progress-view/progress-view.d.ts +0 -13
- package/dist/types/src/components/progress-view/use-liquid-progress.d.ts +0 -3
- package/dist/types/src/components/radio-group/radio-group.d.ts +0 -20
- package/dist/types/src/components/search-field/expanding-search-field.d.ts +0 -5
- package/dist/types/src/components/search-field/search-field.d.ts +0 -9
- package/dist/types/src/components/search-list/search-list.d.ts +0 -22
- package/dist/types/src/components/section/section.d.ts +0 -18
- package/dist/types/src/components/secure-field/secure-field.d.ts +0 -4
- package/dist/types/src/components/segmented-control/segmented-control.d.ts +0 -25
- package/dist/types/src/components/sheet/modal-environment.d.ts +0 -2
- package/dist/types/src/components/sheet/sheet-portal.d.ts +0 -5
- package/dist/types/src/components/sheet/sheet.d.ts +0 -26
- package/dist/types/src/components/sheet/use-sheet-focus.d.ts +0 -3
- package/dist/types/src/components/sidebar/sidebar.d.ts +0 -24
- package/dist/types/src/components/skeleton/skeleton.d.ts +0 -9
- package/dist/types/src/components/slider/slider.d.ts +0 -17
- package/dist/types/src/components/slosh-slider/liquid-step.d.ts +0 -6
- package/dist/types/src/components/slosh-slider/slosh-slider.d.ts +0 -21
- package/dist/types/src/components/stat-tile/index.d.ts +0 -1
- package/dist/types/src/components/stat-tile/stat-tile.d.ts +0 -20
- package/dist/types/src/components/status-indicator/status-indicator.d.ts +0 -17
- package/dist/types/src/components/stepper/rolling-digit.d.ts +0 -11
- package/dist/types/src/components/stepper/stepper.d.ts +0 -22
- package/dist/types/src/components/swatch-picker/swatch-picker.d.ts +0 -22
- package/dist/types/src/components/tab-bar/tab-bar.d.ts +0 -43
- package/dist/types/src/components/tab-view/tab-view.d.ts +0 -27
- package/dist/types/src/components/text-editor/text-editor.d.ts +0 -9
- package/dist/types/src/components/text-field/text-field.d.ts +0 -33
- package/dist/types/src/components/toast/toast-store.d.ts +0 -52
- package/dist/types/src/components/toggle/toggle.d.ts +0 -22
- package/dist/types/src/components/tooltip/tooltip-host.d.ts +0 -7
- package/dist/types/src/components/view-controller/index.d.ts +0 -1
- package/dist/types/src/components/view-controller/view-controller.d.ts +0 -21
- package/dist/types/src/components/wake-slider/wake-slider.d.ts +0 -15
- package/dist/types/src/hooks/scroll/minimize-decision.d.ts +0 -2
- package/dist/types/src/hooks/use-anchored-disclosure.d.ts +0 -9
- package/dist/types/src/hooks/use-floating-dismiss.d.ts +0 -3
- package/dist/types/src/hooks/viewport/types.d.ts +0 -19
- package/dist/types/src/hooks/viewport/viewport-metrics.d.ts +0 -3
- package/dist/types/src/icons/icons.d.ts +0 -616
- package/dist/types/src/index.d.ts +0 -73
- package/dist/types/src/lib/class-names.d.ts +0 -2
- package/dist/types/src/lib/date.d.ts +0 -50
- package/dist/types/src/lib/floating-layers.d.ts +0 -8
- package/dist/types/src/lib/range-value.d.ts +0 -4
- package/dist/types/src/machines/popover.machine.d.ts +0 -30
- package/dist/types/src/motion/transitions.d.ts +0 -170
- package/src/appearance/index.ts +0 -2
- package/src/appearance/platform.tsx +0 -102
- package/src/appearance/theme.tsx +0 -467
- package/src/components/accordion/accordion.tsx +0 -70
- package/src/components/ambient/ambient.tsx +0 -35
- package/src/components/ambient/index.ts +0 -1
- package/src/components/aspect-ratio/aspect-ratio.tsx +0 -27
- package/src/components/breadcrumb/breadcrumb.tsx +0 -73
- package/src/components/button/button-styles.ts +0 -49
- package/src/components/button/button.tsx +0 -107
- package/src/components/button/icon-button.tsx +0 -33
- package/src/components/button/pending-spinner.tsx +0 -14
- package/src/components/button/use-pending-indicator.ts +0 -22
- package/src/components/chip/chip.tsx +0 -45
- package/src/components/code-block/code-block.tsx +0 -48
- package/src/components/combo-box/combo-box.tsx +0 -13
- package/src/components/command/command.tsx +0 -149
- package/src/components/compact-date-picker/calendar-month.ts +0 -109
- package/src/components/compact-date-picker/compact-date-picker.tsx +0 -337
- package/src/components/compact-time-picker/compact-time-picker.tsx +0 -321
- package/src/components/compact-time-picker/time-value.ts +0 -58
- package/src/components/content-unavailable-view/content-unavailable-view.tsx +0 -78
- package/src/components/content-view/content-view.tsx +0 -215
- package/src/components/content-view/index.ts +0 -1
- package/src/components/context-menu/conceal-menu-source.ts +0 -30
- package/src/components/context-menu/context-menu-host.tsx +0 -459
- package/src/components/context-menu/context-menu-store.ts +0 -167
- package/src/components/context-menu/menu-navigation.ts +0 -36
- package/src/components/context-menu/menu-position.ts +0 -38
- package/src/components/context-menu/menu-reveal.ts +0 -42
- package/src/components/context-menu/use-context-menu.ts +0 -73
- package/src/components/conversation/conversation.tsx +0 -309
- package/src/components/conversation/index.ts +0 -1
- package/src/components/date-picker/date-picker.tsx +0 -106
- package/src/components/date-picker/date-value.ts +0 -22
- package/src/components/dialog/dialog-host.tsx +0 -119
- package/src/components/dialog/dialog-store.ts +0 -66
- package/src/components/dialog/dialog.tsx +0 -211
- package/src/components/dialog/index.ts +0 -1
- package/src/components/disclosure-group/disclosure-group.tsx +0 -108
- package/src/components/divider/divider.tsx +0 -33
- package/src/components/inline-disclosure/inline-disclosure.tsx +0 -53
- package/src/components/keyboard-shortcut/keyboard-shortcut.tsx +0 -32
- package/src/components/labeled-content/labeled-content.tsx +0 -84
- package/src/components/locale-switcher/index.ts +0 -1
- package/src/components/locale-switcher/locale-switcher.tsx +0 -311
- package/src/components/menu/menu.tsx +0 -85
- package/src/components/morph/index.ts +0 -2
- package/src/components/morph/morph.tsx +0 -258
- package/src/components/morph/use-morph-disclosure.ts +0 -27
- package/src/components/one-time-code/one-time-code.tsx +0 -234
- package/src/components/picker/picker-trigger.ts +0 -22
- package/src/components/picker/picker.tsx +0 -404
- package/src/components/popover/anchored-surface.tsx +0 -264
- package/src/components/popover/index.ts +0 -50
- package/src/components/popover/popover-content.tsx +0 -334
- package/src/components/popover/popover-fit.ts +0 -74
- package/src/components/popover/popover-root.tsx +0 -97
- package/src/components/popover/popover-trigger.tsx +0 -71
- package/src/components/profile-image/profile-image.tsx +0 -96
- package/src/components/progress-view/progress-view.tsx +0 -72
- package/src/components/progress-view/use-liquid-progress.ts +0 -43
- package/src/components/radio-group/radio-group.tsx +0 -86
- package/src/components/search-field/expanding-search-field.tsx +0 -197
- package/src/components/search-field/search-field.tsx +0 -66
- package/src/components/search-list/search-list.tsx +0 -276
- package/src/components/section/section.tsx +0 -75
- package/src/components/secure-field/secure-field.tsx +0 -8
- package/src/components/segmented-control/segmented-control.tsx +0 -157
- package/src/components/sheet/modal-environment.ts +0 -82
- package/src/components/sheet/sheet-portal.tsx +0 -62
- package/src/components/sheet/sheet.tsx +0 -165
- package/src/components/sheet/use-sheet-focus.ts +0 -109
- package/src/components/sidebar/sidebar.tsx +0 -102
- package/src/components/skeleton/skeleton.tsx +0 -38
- package/src/components/slider/slider.tsx +0 -134
- package/src/components/slosh-slider/liquid-step.ts +0 -43
- package/src/components/slosh-slider/slosh-slider.tsx +0 -294
- package/src/components/stat-tile/index.ts +0 -1
- package/src/components/stat-tile/stat-tile.tsx +0 -90
- package/src/components/status-indicator/status-indicator.tsx +0 -54
- package/src/components/stepper/rolling-digit.tsx +0 -91
- package/src/components/stepper/stepper.tsx +0 -136
- package/src/components/swatch-picker/swatch-picker.tsx +0 -138
- package/src/components/tab-bar/tab-bar.tsx +0 -182
- package/src/components/tab-view/tab-view.tsx +0 -155
- package/src/components/table/table.tsx +0 -151
- package/src/components/text-editor/text-editor.tsx +0 -42
- package/src/components/text-field/text-field.tsx +0 -200
- package/src/components/toast/toast-store.ts +0 -164
- package/src/components/toast/toaster.tsx +0 -407
- package/src/components/toggle/toggle.tsx +0 -320
- package/src/components/tooltip/tooltip-host.tsx +0 -178
- package/src/components/view-controller/index.ts +0 -1
- package/src/components/view-controller/view-controller.tsx +0 -75
- package/src/components/wake-slider/wake-slider.tsx +0 -260
- package/src/hooks/use-anchored-disclosure.ts +0 -23
- package/src/hooks/use-anchored-placement.ts +0 -40
- package/src/hooks/use-dismiss.ts +0 -44
- package/src/hooks/use-floating-dismiss.ts +0 -30
- package/src/hooks/use-media-query.ts +0 -94
- package/src/hooks/use-minimize-on-scroll.ts +0 -77
- package/src/hooks/viewport/types.ts +0 -19
- package/src/hooks/viewport/viewport-metrics.ts +0 -19
- package/src/icons/icons.tsx +0 -458
- package/src/index.ts +0 -107
- package/src/lib/anchored-placement.ts +0 -91
- package/src/lib/class-names.ts +0 -21
- package/src/lib/clipboard.ts +0 -15
- package/src/lib/date.ts +0 -86
- package/src/lib/floating-layers.ts +0 -53
- package/src/lib/haptics.ts +0 -23
- package/src/lib/language.ts +0 -16
- package/src/lib/range-value.ts +0 -38
- package/src/lib/screen-edges.ts +0 -44
- package/src/lib/shapes.ts +0 -59
- package/src/machines/popover.machine.ts +0 -51
- package/src/motion/transitions.ts +0 -97
- package/src/tokens.ts +0 -1
- /package/dist/{types/src/tokens.d.ts → tokens.js} +0 -0
package/dist/marker.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
/** `status` is an inline dot and label, `note` a centred system line, `row` a bordered row, `divider` a labelled rule. */
|
|
3
|
+
export type MarkerVariant = "status" | "note" | "row" | "divider";
|
|
4
|
+
export type MarkerProps = ComponentProps<"div"> & {
|
|
5
|
+
/** How the marker reads in the flow. @default "note" */
|
|
6
|
+
variant?: MarkerVariant;
|
|
7
|
+
/** Leading icon or dot. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** Trailing action, such as a Button, shown by `row`. */
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/** A small non-message line in a conversation or a feed: a status, a system note, a row or a labelled separator. */
|
|
13
|
+
export declare function Marker({ variant, icon, action, className, children, ...props }: MarkerProps): import("react").JSX.Element;
|
package/dist/marker.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cx } from "./lib/cx.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
// src/components/marker.tsx
|
|
4
|
+
const styles = {
|
|
5
|
+
status: "inline-flex items-center gap-1.5 text-caption text-label-secondary",
|
|
6
|
+
note: "flex items-center justify-center gap-1.5 text-caption text-label-tertiary",
|
|
7
|
+
row: "flex items-center gap-2 rounded-xl border border-separator/60 px-3 py-2 text-footnote text-label-secondary",
|
|
8
|
+
divider: "flex items-center gap-3 text-caption text-label-tertiary before:h-px before:flex-1 before:bg-separator/60 after:h-px after:flex-1 after:bg-separator/60"
|
|
9
|
+
};
|
|
10
|
+
/** A small non-message line in a conversation or a feed: a status, a system note, a row or a labelled separator. */
|
|
11
|
+
function Marker({ variant = "note", icon, action, className, children, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
"data-slot": "marker",
|
|
14
|
+
"data-variant": variant,
|
|
15
|
+
className: cx(styles[variant], className),
|
|
16
|
+
...props,
|
|
17
|
+
children: [
|
|
18
|
+
icon ? /* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "shrink-0 [&_svg]:size-3.5",
|
|
20
|
+
children: icon
|
|
21
|
+
}) : null,
|
|
22
|
+
variant === "row" ? /* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: "min-w-0 flex-1 truncate",
|
|
24
|
+
children
|
|
25
|
+
}) : children,
|
|
26
|
+
variant === "row" && action ? /* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: "shrink-0",
|
|
28
|
+
children: action
|
|
29
|
+
}) : null
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { Marker };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** Design-token springs as motion/react transitions. */
|
|
2
|
+
export declare const spring: {
|
|
3
|
+
readonly smooth: {
|
|
4
|
+
readonly damping: 26;
|
|
5
|
+
readonly stiffness: 240;
|
|
6
|
+
readonly mass: 1;
|
|
7
|
+
readonly type: "spring";
|
|
8
|
+
};
|
|
9
|
+
readonly snappy: {
|
|
10
|
+
readonly damping: 22;
|
|
11
|
+
readonly stiffness: 380;
|
|
12
|
+
readonly mass: 1;
|
|
13
|
+
readonly type: "spring";
|
|
14
|
+
};
|
|
15
|
+
readonly bouncy: {
|
|
16
|
+
readonly damping: 14;
|
|
17
|
+
readonly stiffness: 220;
|
|
18
|
+
readonly mass: 1;
|
|
19
|
+
readonly type: "spring";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Apple's fluid overshoot: cubic-bezier(0.34, 1.56, 0.1, 1).
|
|
24
|
+
* Replaces traditional ease profiles with an authentic fluid bounce
|
|
25
|
+
* that overshoots and settles, matching Apple's custom interface physics.
|
|
26
|
+
* Used for zoom/matched-geometry transitions where the surface emerges
|
|
27
|
+
* from the trigger and snaps into place with a physical bounce.
|
|
28
|
+
*/
|
|
29
|
+
export declare const fluidOvershoot: {
|
|
30
|
+
readonly duration: 0.4;
|
|
31
|
+
readonly ease: [number, number, number, number];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Exit motion: content collapses back toward its source.
|
|
35
|
+
* The surface shrinks toward the trigger's position while fading,
|
|
36
|
+
* like a water drop absorbing back into its origin.
|
|
37
|
+
*/
|
|
38
|
+
export declare const fluidCollapse: {
|
|
39
|
+
readonly duration: 0.28;
|
|
40
|
+
readonly ease: [number, number, number, number];
|
|
41
|
+
};
|
|
42
|
+
export type FloatingPanelSide = "above" | "below";
|
|
43
|
+
/**
|
|
44
|
+
* Anchored panels settle toward their source without shrinking their text.
|
|
45
|
+
* Now uses origin-based scaling: the panel grows from the trigger's
|
|
46
|
+
* position (transform-origin set by the caller) with a scale + opacity
|
|
47
|
+
* crossfade, rather than a plain slide.
|
|
48
|
+
*/
|
|
49
|
+
export declare function floatingPanelMotion(side?: FloatingPanelSide): {
|
|
50
|
+
readonly initial: {
|
|
51
|
+
readonly opacity: 0;
|
|
52
|
+
readonly scale: 0.92;
|
|
53
|
+
readonly y: number;
|
|
54
|
+
};
|
|
55
|
+
readonly animate: {
|
|
56
|
+
readonly opacity: 1;
|
|
57
|
+
readonly scale: 1;
|
|
58
|
+
readonly y: 0;
|
|
59
|
+
};
|
|
60
|
+
readonly exit: {
|
|
61
|
+
readonly opacity: 0;
|
|
62
|
+
readonly scale: 0.95;
|
|
63
|
+
readonly y: number;
|
|
64
|
+
};
|
|
65
|
+
readonly transition: {
|
|
66
|
+
readonly duration: 0.4;
|
|
67
|
+
readonly ease: [number, number, number, number];
|
|
68
|
+
readonly opacity: {
|
|
69
|
+
readonly duration: 0.16;
|
|
70
|
+
readonly ease: [number, number, number, number];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/** Default below-anchor presentation, retained for existing consumers. */
|
|
75
|
+
export declare const popoverMotion: {
|
|
76
|
+
readonly initial: {
|
|
77
|
+
readonly opacity: 0;
|
|
78
|
+
readonly scale: 0.92;
|
|
79
|
+
readonly y: number;
|
|
80
|
+
};
|
|
81
|
+
readonly animate: {
|
|
82
|
+
readonly opacity: 1;
|
|
83
|
+
readonly scale: 1;
|
|
84
|
+
readonly y: 0;
|
|
85
|
+
};
|
|
86
|
+
readonly exit: {
|
|
87
|
+
readonly opacity: 0;
|
|
88
|
+
readonly scale: 0.95;
|
|
89
|
+
readonly y: number;
|
|
90
|
+
};
|
|
91
|
+
readonly transition: {
|
|
92
|
+
readonly duration: 0.4;
|
|
93
|
+
readonly ease: [number, number, number, number];
|
|
94
|
+
readonly opacity: {
|
|
95
|
+
readonly duration: 0.16;
|
|
96
|
+
readonly ease: [number, number, number, number];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Zoom/matched-geometry transition for dialogs and center-placed sheets.
|
|
102
|
+
* The surface starts small (scale 0.88) and invisible, then grows to
|
|
103
|
+
* full size with the fluid overshoot bounce. Content elements inside
|
|
104
|
+
* crossfade in slightly delayed so they phase into visibility
|
|
105
|
+
* asynchronously — not a harsh switch.
|
|
106
|
+
*/
|
|
107
|
+
export declare const zoomReveal: {
|
|
108
|
+
readonly initial: {
|
|
109
|
+
readonly opacity: 0;
|
|
110
|
+
readonly scale: 0.88;
|
|
111
|
+
};
|
|
112
|
+
readonly animate: {
|
|
113
|
+
readonly opacity: 1;
|
|
114
|
+
readonly scale: 1;
|
|
115
|
+
};
|
|
116
|
+
readonly exit: {
|
|
117
|
+
readonly opacity: 0;
|
|
118
|
+
readonly scale: 0.92;
|
|
119
|
+
};
|
|
120
|
+
readonly transition: {
|
|
121
|
+
readonly duration: 0.4;
|
|
122
|
+
readonly ease: [number, number, number, number];
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Content crossfade for elements inside an overlay.
|
|
127
|
+
* Rather than a harsh switch, sub-elements scale and phase into
|
|
128
|
+
* visibility asynchronously. Use for children of dialogs, sheets,
|
|
129
|
+
* and popovers — the container arrives first, then content fades in.
|
|
130
|
+
*/
|
|
131
|
+
export declare const contentCrossfade: {
|
|
132
|
+
readonly initial: {
|
|
133
|
+
readonly opacity: 0;
|
|
134
|
+
readonly scale: 0.96;
|
|
135
|
+
};
|
|
136
|
+
readonly animate: {
|
|
137
|
+
readonly opacity: 1;
|
|
138
|
+
readonly scale: 1;
|
|
139
|
+
};
|
|
140
|
+
readonly exit: {
|
|
141
|
+
readonly opacity: 0;
|
|
142
|
+
readonly scale: 0.98;
|
|
143
|
+
};
|
|
144
|
+
readonly transition: {
|
|
145
|
+
readonly duration: 0.24;
|
|
146
|
+
readonly ease: [number, number, number, number];
|
|
147
|
+
readonly delay: 0.04;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
/** Floating bars that rise from the bottom edge. */
|
|
151
|
+
export declare const riseMotion: {
|
|
152
|
+
readonly initial: {
|
|
153
|
+
readonly opacity: 0;
|
|
154
|
+
readonly y: 32;
|
|
155
|
+
};
|
|
156
|
+
readonly animate: {
|
|
157
|
+
readonly opacity: 1;
|
|
158
|
+
readonly y: 0;
|
|
159
|
+
};
|
|
160
|
+
readonly exit: {
|
|
161
|
+
readonly opacity: 0;
|
|
162
|
+
readonly y: 24;
|
|
163
|
+
};
|
|
164
|
+
readonly transition: {
|
|
165
|
+
readonly damping: 26;
|
|
166
|
+
readonly stiffness: 240;
|
|
167
|
+
readonly mass: 1;
|
|
168
|
+
readonly type: "spring";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { springs } from "@passui/tokens/motion";
|
|
2
|
+
// src/motion/transitions.ts
|
|
3
|
+
/** Design-token springs as motion/react transitions. */
|
|
4
|
+
const spring = {
|
|
5
|
+
smooth: {
|
|
6
|
+
type: "spring",
|
|
7
|
+
...springs.smooth
|
|
8
|
+
},
|
|
9
|
+
snappy: {
|
|
10
|
+
type: "spring",
|
|
11
|
+
...springs.snappy
|
|
12
|
+
},
|
|
13
|
+
bouncy: {
|
|
14
|
+
type: "spring",
|
|
15
|
+
...springs.bouncy
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Apple's fluid overshoot: cubic-bezier(0.34, 1.56, 0.1, 1).
|
|
20
|
+
* Replaces traditional ease profiles with an authentic fluid bounce
|
|
21
|
+
* that overshoots and settles, matching Apple's custom interface physics.
|
|
22
|
+
* Used for zoom/matched-geometry transitions where the surface emerges
|
|
23
|
+
* from the trigger and snaps into place with a physical bounce.
|
|
24
|
+
*/
|
|
25
|
+
const fluidOvershoot = {
|
|
26
|
+
duration: .4,
|
|
27
|
+
ease: [
|
|
28
|
+
.34,
|
|
29
|
+
1.56,
|
|
30
|
+
.1,
|
|
31
|
+
1
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Exit motion: content collapses back toward its source.
|
|
36
|
+
* The surface shrinks toward the trigger's position while fading,
|
|
37
|
+
* like a water drop absorbing back into its origin.
|
|
38
|
+
*/
|
|
39
|
+
const fluidCollapse = {
|
|
40
|
+
duration: .28,
|
|
41
|
+
ease: [
|
|
42
|
+
.4,
|
|
43
|
+
0,
|
|
44
|
+
.6,
|
|
45
|
+
1
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Anchored panels settle toward their source without shrinking their text.
|
|
50
|
+
* Now uses origin-based scaling: the panel grows from the trigger's
|
|
51
|
+
* position (transform-origin set by the caller) with a scale + opacity
|
|
52
|
+
* crossfade, rather than a plain slide.
|
|
53
|
+
*/
|
|
54
|
+
function floatingPanelMotion(side = "below") {
|
|
55
|
+
const direction = side === "above" ? 1 : -1;
|
|
56
|
+
return {
|
|
57
|
+
initial: {
|
|
58
|
+
opacity: 0,
|
|
59
|
+
scale: .92,
|
|
60
|
+
y: direction * 6
|
|
61
|
+
},
|
|
62
|
+
animate: {
|
|
63
|
+
opacity: 1,
|
|
64
|
+
scale: 1,
|
|
65
|
+
y: 0
|
|
66
|
+
},
|
|
67
|
+
exit: {
|
|
68
|
+
opacity: 0,
|
|
69
|
+
scale: .95,
|
|
70
|
+
y: direction * 4
|
|
71
|
+
},
|
|
72
|
+
transition: {
|
|
73
|
+
...fluidOvershoot,
|
|
74
|
+
opacity: {
|
|
75
|
+
duration: .16,
|
|
76
|
+
ease: [
|
|
77
|
+
.4,
|
|
78
|
+
0,
|
|
79
|
+
.2,
|
|
80
|
+
1
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/** Default below-anchor presentation, retained for existing consumers. */
|
|
87
|
+
const popoverMotion = floatingPanelMotion();
|
|
88
|
+
/**
|
|
89
|
+
* Zoom/matched-geometry transition for dialogs and center-placed sheets.
|
|
90
|
+
* The surface starts small (scale 0.88) and invisible, then grows to
|
|
91
|
+
* full size with the fluid overshoot bounce. Content elements inside
|
|
92
|
+
* crossfade in slightly delayed so they phase into visibility
|
|
93
|
+
* asynchronously — not a harsh switch.
|
|
94
|
+
*/
|
|
95
|
+
const zoomReveal = {
|
|
96
|
+
initial: {
|
|
97
|
+
opacity: 0,
|
|
98
|
+
scale: .88
|
|
99
|
+
},
|
|
100
|
+
animate: {
|
|
101
|
+
opacity: 1,
|
|
102
|
+
scale: 1
|
|
103
|
+
},
|
|
104
|
+
exit: {
|
|
105
|
+
opacity: 0,
|
|
106
|
+
scale: .92
|
|
107
|
+
},
|
|
108
|
+
transition: fluidOvershoot
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Content crossfade for elements inside an overlay.
|
|
112
|
+
* Rather than a harsh switch, sub-elements scale and phase into
|
|
113
|
+
* visibility asynchronously. Use for children of dialogs, sheets,
|
|
114
|
+
* and popovers — the container arrives first, then content fades in.
|
|
115
|
+
*/
|
|
116
|
+
const contentCrossfade = {
|
|
117
|
+
initial: {
|
|
118
|
+
opacity: 0,
|
|
119
|
+
scale: .96
|
|
120
|
+
},
|
|
121
|
+
animate: {
|
|
122
|
+
opacity: 1,
|
|
123
|
+
scale: 1
|
|
124
|
+
},
|
|
125
|
+
exit: {
|
|
126
|
+
opacity: 0,
|
|
127
|
+
scale: .98
|
|
128
|
+
},
|
|
129
|
+
transition: {
|
|
130
|
+
duration: .24,
|
|
131
|
+
ease: [
|
|
132
|
+
.4,
|
|
133
|
+
0,
|
|
134
|
+
.2,
|
|
135
|
+
1
|
|
136
|
+
],
|
|
137
|
+
delay: .04
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
/** Floating bars that rise from the bottom edge. */
|
|
141
|
+
const riseMotion = {
|
|
142
|
+
initial: {
|
|
143
|
+
opacity: 0,
|
|
144
|
+
y: 32
|
|
145
|
+
},
|
|
146
|
+
animate: {
|
|
147
|
+
opacity: 1,
|
|
148
|
+
y: 0
|
|
149
|
+
},
|
|
150
|
+
exit: {
|
|
151
|
+
opacity: 0,
|
|
152
|
+
y: 24
|
|
153
|
+
},
|
|
154
|
+
transition: spring.smooth
|
|
155
|
+
};
|
|
156
|
+
export { contentCrossfade, floatingPanelMotion, fluidCollapse, fluidOvershoot, popoverMotion, riseMotion, spring, zoomReveal };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RenderProp } from "./lib/render.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The page numbers to show, with `"ellipsis"` where a run is folded:
|
|
5
|
+
* the first and last page, the current one and `siblings` on each side.
|
|
6
|
+
* `pageRange(8, 20)` is `[1, "ellipsis", 7, 8, 9, "ellipsis", 20]`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function pageRange(current: number, total: number, siblings?: number): Array<number | "ellipsis">;
|
|
9
|
+
export type PaginationSize = "xs" | "sm" | "default" | "lg";
|
|
10
|
+
/** Which theme role marks the current page: the neutral raised chip, the app's accent, or the primary ink. */
|
|
11
|
+
export type PaginationTone = "neutral" | "accent" | "primary";
|
|
12
|
+
export declare function Pagination({ className, size, tone, ...props }: ComponentProps<"nav"> & {
|
|
13
|
+
/** Height of every page button, like the other controls. @default "default" */
|
|
14
|
+
size?: PaginationSize;
|
|
15
|
+
/** The theme role that marks the current page. @default "neutral" */
|
|
16
|
+
tone?: PaginationTone;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function PaginationContent({ className, ...props }: ComponentProps<"ul">): import("react").JSX.Element;
|
|
19
|
+
export declare function PaginationItem(props: ComponentProps<"li">): import("react").JSX.Element;
|
|
20
|
+
export type PaginationLinkProps = ComponentProps<"a"> & {
|
|
21
|
+
isActive?: boolean;
|
|
22
|
+
/** Sizes the link by its label instead of as a square page number. */
|
|
23
|
+
wide?: boolean;
|
|
24
|
+
render?: RenderProp;
|
|
25
|
+
};
|
|
26
|
+
/** A page link. Pass `render` to use your router's link element. */
|
|
27
|
+
export declare function PaginationLink({ isActive, wide, className, render, ...props }: PaginationLinkProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
28
|
+
export declare function PaginationPrevious({ className, children, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
29
|
+
export declare function PaginationNext({ className, children, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
30
|
+
export declare function PaginationEllipsis({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { cx } from "./lib/cx.js";
|
|
2
|
+
import { mergeProps, renderPart } from "./lib/render.js";
|
|
3
|
+
import { buttonVariants } from "./button.js";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronLeftIcon } from "@passui/icons/chevron-left";
|
|
7
|
+
import { ChevronRightIcon } from "@passui/icons/chevron-right";
|
|
8
|
+
// src/components/pagination.tsx
|
|
9
|
+
/**
|
|
10
|
+
* The page numbers to show, with `"ellipsis"` where a run is folded:
|
|
11
|
+
* the first and last page, the current one and `siblings` on each side.
|
|
12
|
+
* `pageRange(8, 20)` is `[1, "ellipsis", 7, 8, 9, "ellipsis", 20]`.
|
|
13
|
+
*/
|
|
14
|
+
function pageRange(current, total, siblings = 1) {
|
|
15
|
+
if (total <= siblings * 2 + 5) return Array.from({ length: total }, (_, index) => index + 1);
|
|
16
|
+
const left = Math.max(current - siblings, 2);
|
|
17
|
+
const right = Math.min(current + siblings, total - 1);
|
|
18
|
+
const range = [1];
|
|
19
|
+
if (left > 2) range.push("ellipsis");
|
|
20
|
+
for (let page = left; page <= right; page++) range.push(page);
|
|
21
|
+
if (right < total - 1) range.push("ellipsis");
|
|
22
|
+
range.push(total);
|
|
23
|
+
return range;
|
|
24
|
+
}
|
|
25
|
+
const squareSizes = {
|
|
26
|
+
xs: "icon-xs",
|
|
27
|
+
sm: "icon-sm",
|
|
28
|
+
default: "icon",
|
|
29
|
+
lg: "icon-lg"
|
|
30
|
+
};
|
|
31
|
+
const ellipsisSizes = {
|
|
32
|
+
xs: "size-6.5 text-caption",
|
|
33
|
+
sm: "size-7.5 text-footnote",
|
|
34
|
+
default: "size-8.5 text-footnote",
|
|
35
|
+
lg: "size-9.5 text-subheadline"
|
|
36
|
+
};
|
|
37
|
+
const activeVariants = {
|
|
38
|
+
neutral: "secondary",
|
|
39
|
+
accent: "accent",
|
|
40
|
+
primary: "default"
|
|
41
|
+
};
|
|
42
|
+
const PaginationContext = createContext({
|
|
43
|
+
size: "default",
|
|
44
|
+
tone: "neutral"
|
|
45
|
+
});
|
|
46
|
+
function Pagination({ className, size = "default", tone = "neutral", ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(PaginationContext, {
|
|
48
|
+
value: {
|
|
49
|
+
size,
|
|
50
|
+
tone
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
53
|
+
"aria-label": "Pagination",
|
|
54
|
+
"data-slot": "pagination",
|
|
55
|
+
"data-size": size,
|
|
56
|
+
"data-tone": tone,
|
|
57
|
+
className: cx("mx-auto flex w-full justify-center", className),
|
|
58
|
+
...props
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function PaginationContent({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
64
|
+
"data-slot": "pagination-content",
|
|
65
|
+
className: cx("m-0 flex list-none flex-row items-center gap-1 p-0", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function PaginationItem(props) {
|
|
70
|
+
return /* @__PURE__ */ jsx("li", {
|
|
71
|
+
"data-slot": "pagination-item",
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** A page link. Pass `render` to use your router's link element. */
|
|
76
|
+
function PaginationLink({ isActive, wide, className, render, ...props }) {
|
|
77
|
+
const { size, tone } = useContext(PaginationContext);
|
|
78
|
+
return renderPart("a", mergeProps({
|
|
79
|
+
"aria-current": isActive ? "page" : void 0,
|
|
80
|
+
"data-slot": "pagination-link",
|
|
81
|
+
"data-active": isActive ? "" : void 0,
|
|
82
|
+
className: buttonVariants({
|
|
83
|
+
variant: isActive ? activeVariants[tone] : "ghost",
|
|
84
|
+
size: wide ? size : squareSizes[size],
|
|
85
|
+
className
|
|
86
|
+
})
|
|
87
|
+
}, props), render);
|
|
88
|
+
}
|
|
89
|
+
function PaginationPrevious({ className, children = "Previous", ...props }) {
|
|
90
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
91
|
+
"aria-label": "Go to previous page",
|
|
92
|
+
wide: true,
|
|
93
|
+
className: cx("gap-1 ps-2.5 pe-3", className),
|
|
94
|
+
...props,
|
|
95
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { size: 14 }), children]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function PaginationNext({ className, children = "Next", ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
100
|
+
"aria-label": "Go to next page",
|
|
101
|
+
wide: true,
|
|
102
|
+
className: cx("gap-1 ps-3 pe-2.5", className),
|
|
103
|
+
...props,
|
|
104
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { size: 14 })]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
108
|
+
const { size } = useContext(PaginationContext);
|
|
109
|
+
return /* @__PURE__ */ jsx("span", {
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
"data-slot": "pagination-ellipsis",
|
|
112
|
+
className: cx("flex items-center justify-center text-label-secondary", ellipsisSizes[size], className),
|
|
113
|
+
...props,
|
|
114
|
+
children: "…"
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, pageRange };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RenderProp } from "./lib/render.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import * as popover from "@zag-js/popover";
|
|
4
|
+
export interface PopoverProps extends Omit<popover.Props, "id" | "ids" | "positioning"> {
|
|
5
|
+
/** Where the panel sits against its trigger. Defaults to `bottom`. */
|
|
6
|
+
placement?: popover.Placement;
|
|
7
|
+
/** Gap between trigger and panel, in pixels. Defaults to 8. */
|
|
8
|
+
offset?: number;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** Owns the open state and position. Renders no element of its own. */
|
|
12
|
+
export declare function Popover({ children, placement, offset, ...props }: PopoverProps): import("react").JSX.Element;
|
|
13
|
+
type PartProps<T extends "button" | "div"> = ComponentProps<T> & {
|
|
14
|
+
/** Render your own element instead of the default one. */
|
|
15
|
+
render?: RenderProp;
|
|
16
|
+
};
|
|
17
|
+
export declare function PopoverTrigger({ render, ...props }: PartProps<"button">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
18
|
+
/** Positions the panel against another element instead of the trigger. */
|
|
19
|
+
export declare function PopoverAnchor({ render, ...props }: PartProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
20
|
+
/** Closes the popover. Several of these can sit in one panel. */
|
|
21
|
+
export declare function PopoverClose({ render, ...props }: PartProps<"button">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
22
|
+
/** The floating panel. Mounts only while open or leaving, and grows from its trigger side. */
|
|
23
|
+
export declare function PopoverContent({ className, render, ...props }: PartProps<"div">): import("react").JSX.Element | null;
|
|
24
|
+
export declare function PopoverTitle({ className, ...props }: ComponentProps<"h2">): import("react").JSX.Element;
|
|
25
|
+
export declare function PopoverDescription({ className, ...props }: ComponentProps<"p">): import("react").JSX.Element;
|
|
26
|
+
export {};
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "./lib/cx.js";
|
|
3
|
+
import { Portal } from "./lib/portal.js";
|
|
4
|
+
import { usePresence } from "./lib/presence.js";
|
|
5
|
+
import { mergeProps, renderPart } from "./lib/render.js";
|
|
6
|
+
import { positionerSide, useAnchorFollow, useTriggerAnchor, useWaterDrop } from "./lib/water-drop.js";
|
|
7
|
+
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
8
|
+
import { createContext, useContext, useId } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import * as popover from "@zag-js/popover";
|
|
11
|
+
// src/components/popover.tsx
|
|
12
|
+
const Context = createContext(null);
|
|
13
|
+
function usePopover() {
|
|
14
|
+
const api = useContext(Context);
|
|
15
|
+
if (!api) throw new Error("Popover parts must be used inside <Popover>.");
|
|
16
|
+
return api;
|
|
17
|
+
}
|
|
18
|
+
/** Owns the open state and position. Renders no element of its own. */
|
|
19
|
+
function Popover({ children, placement = "bottom", offset = 8, ...props }) {
|
|
20
|
+
const id = useId();
|
|
21
|
+
const anchor = useTriggerAnchor(placement, offset);
|
|
22
|
+
const service = useMachine(popover.machine, {
|
|
23
|
+
id,
|
|
24
|
+
positioning: {
|
|
25
|
+
placement,
|
|
26
|
+
offset: { mainAxis: offset },
|
|
27
|
+
getAnchorRect: anchor.getAnchorRect
|
|
28
|
+
},
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
const api = popover.connect(service, normalizeProps);
|
|
32
|
+
useAnchorFollow(anchor, api.open, positionerSide(api.getPositionerProps()), api.reposition);
|
|
33
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
34
|
+
value: api,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function PopoverTrigger({ render, ...props }) {
|
|
39
|
+
const api = usePopover();
|
|
40
|
+
return renderPart("button", mergeProps({
|
|
41
|
+
...api.getTriggerProps(),
|
|
42
|
+
"data-slot": "popover-trigger"
|
|
43
|
+
}, props), render);
|
|
44
|
+
}
|
|
45
|
+
/** Positions the panel against another element instead of the trigger. */
|
|
46
|
+
function PopoverAnchor({ render, ...props }) {
|
|
47
|
+
const api = usePopover();
|
|
48
|
+
return renderPart("div", mergeProps({
|
|
49
|
+
...api.getAnchorProps(),
|
|
50
|
+
"data-slot": "popover-anchor"
|
|
51
|
+
}, props), render);
|
|
52
|
+
}
|
|
53
|
+
/** Closes the popover. Several of these can sit in one panel. */
|
|
54
|
+
function PopoverClose({ render, ...props }) {
|
|
55
|
+
const { id: _id, ...closeProps } = usePopover().getCloseTriggerProps();
|
|
56
|
+
return renderPart("button", mergeProps({
|
|
57
|
+
...closeProps,
|
|
58
|
+
"data-slot": "popover-close"
|
|
59
|
+
}, props), render);
|
|
60
|
+
}
|
|
61
|
+
/** The floating panel. Mounts only while open or leaving, and grows from its trigger side. */
|
|
62
|
+
function PopoverContent({ className, render, ...props }) {
|
|
63
|
+
const api = usePopover();
|
|
64
|
+
const drop = useWaterDrop({
|
|
65
|
+
sourceId: api.getTriggerProps().id,
|
|
66
|
+
material: "liquid-glass-dense squircle [--squircle-radius:1.5rem]"
|
|
67
|
+
});
|
|
68
|
+
const { ref, mounted, attrs } = usePresence(api.open, drop);
|
|
69
|
+
if (!mounted) return null;
|
|
70
|
+
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx("div", {
|
|
71
|
+
...api.getPositionerProps(),
|
|
72
|
+
className: "z-[70]",
|
|
73
|
+
children: renderPart("div", mergeProps({
|
|
74
|
+
...api.getContentProps(),
|
|
75
|
+
...attrs,
|
|
76
|
+
ref,
|
|
77
|
+
hidden: false,
|
|
78
|
+
"data-slot": "popover-content",
|
|
79
|
+
className: cx("w-72 liquid-glass-dense squircle morph-reset [--squircle-radius:1.5rem] p-4 text-label outline-none transition spring-smooth origin-(--transform-origin,center) data-ending-style:scale-[0.88] data-starting-style:scale-[0.88] data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:origin-top data-[side=top]:origin-bottom data-[side=left]:origin-right data-[side=right]:origin-left motion-reduce:transition-none motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100", className)
|
|
80
|
+
}, props), render)
|
|
81
|
+
}) });
|
|
82
|
+
}
|
|
83
|
+
function PopoverTitle({ className, ...props }) {
|
|
84
|
+
const api = usePopover();
|
|
85
|
+
return /* @__PURE__ */ jsx("h2", {
|
|
86
|
+
...api.getTitleProps(),
|
|
87
|
+
"data-slot": "popover-title",
|
|
88
|
+
className: cx("text-headline font-semibold text-label", className),
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function PopoverDescription({ className, ...props }) {
|
|
93
|
+
const api = usePopover();
|
|
94
|
+
return /* @__PURE__ */ jsx("p", {
|
|
95
|
+
...api.getDescriptionProps(),
|
|
96
|
+
"data-slot": "popover-description",
|
|
97
|
+
className: cx("text-footnote text-label-secondary", className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
export type ProgressProps = Omit<ComponentProps<"div">, "children"> & {
|
|
3
|
+
/** 0 to `max`. Leave undefined for an indeterminate bar. */
|
|
4
|
+
value?: number | null;
|
|
5
|
+
/** @default 100 */
|
|
6
|
+
max?: number;
|
|
7
|
+
};
|
|
8
|
+
/** A read only progress bar. */
|
|
9
|
+
export declare function Progress({ value, max, className, ...props }: ProgressProps): import("react").JSX.Element;
|
package/dist/progress.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cx } from "./lib/cx.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/progress.tsx
|
|
4
|
+
/** A read only progress bar. */
|
|
5
|
+
function Progress({ value, max = 100, className, ...props }) {
|
|
6
|
+
const determinate = typeof value === "number";
|
|
7
|
+
const ratio = determinate ? Math.min(1, Math.max(0, value / max)) : 0;
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
role: "progressbar",
|
|
10
|
+
"aria-valuemin": 0,
|
|
11
|
+
"aria-valuemax": max,
|
|
12
|
+
"aria-valuenow": determinate ? value : void 0,
|
|
13
|
+
"data-slot": "progress",
|
|
14
|
+
"data-state": determinate ? ratio >= 1 ? "complete" : "loading" : "indeterminate",
|
|
15
|
+
className: cx("relative h-2 w-full overflow-hidden rounded-full bg-fill", className),
|
|
16
|
+
...props,
|
|
17
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
18
|
+
"data-slot": "progress-indicator",
|
|
19
|
+
className: cx("h-full rounded-full bg-accent spring-smooth transition-[width] motion-reduce:transition-none", !determinate && "w-2/5 animate-pulse motion-reduce:animate-none"),
|
|
20
|
+
style: determinate ? { width: `${ratio * 100}%` } : void 0
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { Progress };
|