@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
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Button } from "@passui/react/button"
|
|
2
|
-
import { Popover } from "@passui/react/popover"
|
|
3
|
-
import { useDismiss } from "@passui/react/use-dismiss"
|
|
4
|
-
import { toast } from "@passui/react"
|
|
5
|
-
import { useRef, useState } from "react"
|
|
6
|
-
|
|
7
|
-
const actions = [
|
|
8
|
-
"Duplicate",
|
|
9
|
-
"Move to folder",
|
|
10
|
-
"Export as PDF",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
export function PopoverMenu() {
|
|
14
|
-
const [open, setOpen] = useState(false)
|
|
15
|
-
const anchor = useRef<HTMLDivElement>(null)
|
|
16
|
-
useDismiss(anchor, open, () => setOpen(false))
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div ref={anchor} className="relative">
|
|
20
|
-
<Button
|
|
21
|
-
variant="secondary"
|
|
22
|
-
aria-haspopup="menu"
|
|
23
|
-
aria-expanded={open}
|
|
24
|
-
onClick={() => setOpen(!open)}
|
|
25
|
-
>
|
|
26
|
-
More
|
|
27
|
-
</Button>
|
|
28
|
-
<Popover
|
|
29
|
-
open={open}
|
|
30
|
-
origin="top-right"
|
|
31
|
-
role="menu"
|
|
32
|
-
className="top-full right-0 mt-2 flex w-56 flex-col p-1.5"
|
|
33
|
-
>
|
|
34
|
-
{actions.map((action) => (
|
|
35
|
-
<button
|
|
36
|
-
key={action}
|
|
37
|
-
type="button"
|
|
38
|
-
role="menuitem"
|
|
39
|
-
className="rounded-3xl px-3 py-2 text-start text-subheadline text-label hover:bg-fill"
|
|
40
|
-
onClick={() => {
|
|
41
|
-
setOpen(false)
|
|
42
|
-
toast(action)
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
{action}
|
|
46
|
-
</button>
|
|
47
|
-
))}
|
|
48
|
-
</Popover>
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Button } from "@passui/react/button"
|
|
2
|
-
import { Popover } from "@passui/react/popover"
|
|
3
|
-
import {
|
|
4
|
-
ProfileImage,
|
|
5
|
-
ProfileImageContent,
|
|
6
|
-
ProfileImageFallback,
|
|
7
|
-
} from "@passui/react/profile-image"
|
|
8
|
-
import { useDismiss } from "@passui/react/use-dismiss"
|
|
9
|
-
import { useRef, useState } from "react"
|
|
10
|
-
|
|
11
|
-
export function PopoverShowcase() {
|
|
12
|
-
const [open, setOpen] = useState(true)
|
|
13
|
-
const anchor = useRef<HTMLDivElement>(null)
|
|
14
|
-
useDismiss(anchor, open, () => setOpen(false))
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<div className="flex h-80 w-full max-w-sm justify-end">
|
|
18
|
-
<div ref={anchor} className="relative">
|
|
19
|
-
<button
|
|
20
|
-
type="button"
|
|
21
|
-
aria-label="Account"
|
|
22
|
-
aria-expanded={open}
|
|
23
|
-
onClick={() => setOpen(!open)}
|
|
24
|
-
className="rounded-full"
|
|
25
|
-
>
|
|
26
|
-
<ProfileImage className="size-11">
|
|
27
|
-
<ProfileImageContent src="/avatars/aiko.svg" />
|
|
28
|
-
<ProfileImageFallback>
|
|
29
|
-
AK
|
|
30
|
-
</ProfileImageFallback>
|
|
31
|
-
</ProfileImage>
|
|
32
|
-
</button>
|
|
33
|
-
<Popover
|
|
34
|
-
open={open}
|
|
35
|
-
origin="top-right"
|
|
36
|
-
role="dialog"
|
|
37
|
-
aria-label="Account"
|
|
38
|
-
className="top-full right-0 mt-2 flex w-64 flex-col items-center gap-3 p-5 text-center"
|
|
39
|
-
>
|
|
40
|
-
<ProfileImage className="size-16 text-title3">
|
|
41
|
-
<ProfileImageContent src="/avatars/aiko.svg" />
|
|
42
|
-
<ProfileImageFallback>
|
|
43
|
-
AK
|
|
44
|
-
</ProfileImageFallback>
|
|
45
|
-
</ProfileImage>
|
|
46
|
-
<div className="flex flex-col">
|
|
47
|
-
<span className="text-headline font-semibold text-label">
|
|
48
|
-
Aiko Kamado
|
|
49
|
-
</span>
|
|
50
|
-
<span className="text-footnote text-label-secondary">
|
|
51
|
-
aiko@example.com
|
|
52
|
-
</span>
|
|
53
|
-
</div>
|
|
54
|
-
<Button variant="secondary" size="sm">
|
|
55
|
-
Manage your account
|
|
56
|
-
</Button>
|
|
57
|
-
</Popover>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Button } from "@passui/react/button"
|
|
2
|
-
import { Popover } from "@passui/react/popover"
|
|
3
|
-
import { useDismiss } from "@passui/react/use-dismiss"
|
|
4
|
-
import { useRef, useState } from "react"
|
|
5
|
-
|
|
6
|
-
export function PopoverUsage() {
|
|
7
|
-
const [open, setOpen] = useState(false)
|
|
8
|
-
const anchor = useRef<HTMLDivElement>(null)
|
|
9
|
-
useDismiss(anchor, open, () => setOpen(false))
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<div ref={anchor} className="relative">
|
|
13
|
-
<Button
|
|
14
|
-
variant="secondary"
|
|
15
|
-
aria-expanded={open}
|
|
16
|
-
onClick={() => setOpen(!open)}
|
|
17
|
-
>
|
|
18
|
-
What's this?
|
|
19
|
-
</Button>
|
|
20
|
-
<Popover
|
|
21
|
-
open={open}
|
|
22
|
-
className="top-full left-0 mt-2 w-64 p-4"
|
|
23
|
-
>
|
|
24
|
-
<p className="text-callout text-label">
|
|
25
|
-
A passkey signs you in with your face,
|
|
26
|
-
fingerprint or screen lock.
|
|
27
|
-
</p>
|
|
28
|
-
</Popover>
|
|
29
|
-
</div>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { PopoverHelp } from "./examples/popover-help"
|
|
2
|
-
import { useRef, useState } from "react"
|
|
3
|
-
import { Button } from "../button/button"
|
|
4
|
-
import { defineDocs } from "../../docs/types"
|
|
5
|
-
import { useDismiss } from "../../hooks/use-dismiss"
|
|
6
|
-
import { PopoverMenu } from "./examples/popover-menu"
|
|
7
|
-
import { PopoverShowcase } from "./examples/popover-showcase"
|
|
8
|
-
import { PopoverUsage } from "./examples/popover-usage"
|
|
9
|
-
import { Popover, type PopoverProps } from "./popover"
|
|
10
|
-
|
|
11
|
-
type DemoProps = Pick<PopoverProps, "origin">
|
|
12
|
-
|
|
13
|
-
function PopoverDemo({ origin }: DemoProps) {
|
|
14
|
-
const [open, setOpen] = useState(false)
|
|
15
|
-
const anchor = useRef<HTMLDivElement>(null)
|
|
16
|
-
useDismiss(anchor, open, () => setOpen(false))
|
|
17
|
-
return (
|
|
18
|
-
<div ref={anchor} className="relative">
|
|
19
|
-
<Button
|
|
20
|
-
variant="secondary"
|
|
21
|
-
aria-expanded={open}
|
|
22
|
-
onClick={() => setOpen(!open)}
|
|
23
|
-
>
|
|
24
|
-
Open popover
|
|
25
|
-
</Button>
|
|
26
|
-
<Popover
|
|
27
|
-
open={open}
|
|
28
|
-
origin={origin}
|
|
29
|
-
className={
|
|
30
|
-
origin === "top-right"
|
|
31
|
-
? "top-full right-0 mt-2 w-60 p-4"
|
|
32
|
-
: "top-full left-0 mt-2 w-60 p-4"
|
|
33
|
-
}
|
|
34
|
-
>
|
|
35
|
-
<p className="text-callout text-label">
|
|
36
|
-
Grows from its {origin ?? "top-left"}{" "}
|
|
37
|
-
corner. Escape or a click outside closes
|
|
38
|
-
it.
|
|
39
|
-
</p>
|
|
40
|
-
</Popover>
|
|
41
|
-
</div>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const popoverDocs = defineDocs<PopoverProps>()({
|
|
46
|
-
slug: "popover",
|
|
47
|
-
name: "Popover",
|
|
48
|
-
importPath: "@passui/react/popover",
|
|
49
|
-
controls: {
|
|
50
|
-
origin: {
|
|
51
|
-
kind: "select",
|
|
52
|
-
options: { "top-left": true, "top-right": true },
|
|
53
|
-
default: "top-left",
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
render: (values) => <PopoverDemo {...values} />,
|
|
57
|
-
childrenSnippet: ({ origin }) => ({
|
|
58
|
-
imports: [
|
|
59
|
-
'import { useRef, useState } from "react"',
|
|
60
|
-
'import { useDismiss } from "@passui/react/use-dismiss"',
|
|
61
|
-
],
|
|
62
|
-
setup: [
|
|
63
|
-
"const [open, setOpen] = useState(false)",
|
|
64
|
-
"const anchor = useRef<HTMLDivElement>(null)",
|
|
65
|
-
"useDismiss(anchor, open, () => setOpen(false))",
|
|
66
|
-
],
|
|
67
|
-
expressionProps: { open: "open" },
|
|
68
|
-
extraProps: {
|
|
69
|
-
className:
|
|
70
|
-
origin === "top-right"
|
|
71
|
-
? "top-full right-0 mt-2 w-60 p-4"
|
|
72
|
-
: "top-full left-0 mt-2 w-60 p-4",
|
|
73
|
-
},
|
|
74
|
-
children:
|
|
75
|
-
"\n {/* inside a relative parent with ref={anchor} */}\n",
|
|
76
|
-
}),
|
|
77
|
-
usage: PopoverUsage,
|
|
78
|
-
showcase: PopoverShowcase,
|
|
79
|
-
examples: [
|
|
80
|
-
{ id: "menu", component: PopoverMenu },
|
|
81
|
-
{ id: "help", component: PopoverHelp },
|
|
82
|
-
],
|
|
83
|
-
previewHeight: 320,
|
|
84
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ProfileImage,
|
|
3
|
-
ProfileImageContent,
|
|
4
|
-
ProfileImageFallback,
|
|
5
|
-
} from "@passui/react/profile-image"
|
|
6
|
-
|
|
7
|
-
export function ProfileImageFallbacks() {
|
|
8
|
-
return (
|
|
9
|
-
<div className="flex items-center gap-4">
|
|
10
|
-
<ProfileImage className="size-11">
|
|
11
|
-
<ProfileImageContent src="/avatars/kenji.svg" />
|
|
12
|
-
<ProfileImageFallback>
|
|
13
|
-
KM
|
|
14
|
-
</ProfileImageFallback>
|
|
15
|
-
</ProfileImage>
|
|
16
|
-
<ProfileImage className="size-11">
|
|
17
|
-
<ProfileImageContent src="/avatars/missing.png" />
|
|
18
|
-
<ProfileImageFallback>
|
|
19
|
-
MP
|
|
20
|
-
</ProfileImageFallback>
|
|
21
|
-
</ProfileImage>
|
|
22
|
-
<ProfileImage className="size-11">
|
|
23
|
-
<ProfileImageFallback>
|
|
24
|
-
JS
|
|
25
|
-
</ProfileImageFallback>
|
|
26
|
-
</ProfileImage>
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ProfileImage,
|
|
3
|
-
ProfileImageContent,
|
|
4
|
-
ProfileImageFallback,
|
|
5
|
-
} from "@passui/react/profile-image"
|
|
6
|
-
|
|
7
|
-
const people = [
|
|
8
|
-
{ initials: "AK", src: "/avatars/aiko.svg" },
|
|
9
|
-
{ initials: "KM", src: "/avatars/kenji.svg" },
|
|
10
|
-
{ initials: "MP", src: "/avatars/mira.svg" },
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
export function ProfileImageGroup() {
|
|
14
|
-
return (
|
|
15
|
-
<div className="flex items-center">
|
|
16
|
-
{people.map((person) => (
|
|
17
|
-
<ProfileImage
|
|
18
|
-
key={person.initials}
|
|
19
|
-
className="-ms-2 size-9 ring-2 ring-background first:ms-0"
|
|
20
|
-
>
|
|
21
|
-
<ProfileImageContent src={person.src} />
|
|
22
|
-
<ProfileImageFallback>
|
|
23
|
-
{person.initials}
|
|
24
|
-
</ProfileImageFallback>
|
|
25
|
-
</ProfileImage>
|
|
26
|
-
))}
|
|
27
|
-
<ProfileImage className="-ms-2 size-9 ring-2 ring-background">
|
|
28
|
-
<ProfileImageFallback>
|
|
29
|
-
+4
|
|
30
|
-
</ProfileImageFallback>
|
|
31
|
-
</ProfileImage>
|
|
32
|
-
</div>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Button } from "@passui/react/button"
|
|
2
|
-
import {
|
|
3
|
-
ProfileImage,
|
|
4
|
-
ProfileImageContent,
|
|
5
|
-
ProfileImageFallback,
|
|
6
|
-
} from "@passui/react/profile-image"
|
|
7
|
-
|
|
8
|
-
export function ProfileImageShowcase() {
|
|
9
|
-
return (
|
|
10
|
-
<div className="flex w-full max-w-xs flex-col items-center gap-4 rounded-4xl bg-elevated p-6 text-center shadow-sm ring-1 ring-separator/60">
|
|
11
|
-
<ProfileImage className="size-20 text-title3">
|
|
12
|
-
<ProfileImageContent src="/avatars/aiko.svg" />
|
|
13
|
-
<ProfileImageFallback>
|
|
14
|
-
AK
|
|
15
|
-
</ProfileImageFallback>
|
|
16
|
-
</ProfileImage>
|
|
17
|
-
<div className="flex flex-col gap-0.5">
|
|
18
|
-
<h2 className="text-headline font-semibold text-label">
|
|
19
|
-
Aiko Kamado
|
|
20
|
-
</h2>
|
|
21
|
-
<p className="text-footnote text-label-secondary">
|
|
22
|
-
aiko@example.com
|
|
23
|
-
</p>
|
|
24
|
-
</div>
|
|
25
|
-
<Button variant="secondary" size="sm">
|
|
26
|
-
Change photo
|
|
27
|
-
</Button>
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ProfileImage,
|
|
3
|
-
ProfileImageContent,
|
|
4
|
-
ProfileImageFallback,
|
|
5
|
-
} from "@passui/react/profile-image"
|
|
6
|
-
|
|
7
|
-
export function ProfileImageUsage() {
|
|
8
|
-
return (
|
|
9
|
-
<ProfileImage className="size-11">
|
|
10
|
-
<ProfileImageContent src="/avatars/aiko.svg" />
|
|
11
|
-
<ProfileImageFallback>AK</ProfileImageFallback>
|
|
12
|
-
</ProfileImage>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { jsxText } from "../../docs/snippet"
|
|
2
|
-
import { defineDocs } from "../../docs/types"
|
|
3
|
-
import { ProfileImageFallbacks } from "./examples/profile-image-fallbacks"
|
|
4
|
-
import { ProfileImageGroup } from "./examples/profile-image-group"
|
|
5
|
-
import { ProfileImageShowcase } from "./examples/profile-image-showcase"
|
|
6
|
-
import { ProfileImageUsage } from "./examples/profile-image-usage"
|
|
7
|
-
import {
|
|
8
|
-
ProfileImage,
|
|
9
|
-
ProfileImageContent,
|
|
10
|
-
ProfileImageFallback,
|
|
11
|
-
} from "./profile-image"
|
|
12
|
-
|
|
13
|
-
// Size is a class name on ProfileImage, and the photo and initials are
|
|
14
|
-
// its children; the snippet writes all three itself.
|
|
15
|
-
type DemoProps = {
|
|
16
|
-
size: "small" | "medium" | "large"
|
|
17
|
-
photo: boolean
|
|
18
|
-
initials: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const sizes = {
|
|
22
|
-
small: "size-7",
|
|
23
|
-
medium: "size-11",
|
|
24
|
-
large: "size-20 text-title3",
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const profileImageDocs = defineDocs<DemoProps>()({
|
|
28
|
-
slug: "profile-image",
|
|
29
|
-
name: "ProfileImage",
|
|
30
|
-
importPath: "@passui/react/profile-image",
|
|
31
|
-
controls: {
|
|
32
|
-
size: {
|
|
33
|
-
kind: "select",
|
|
34
|
-
options: {
|
|
35
|
-
small: true,
|
|
36
|
-
medium: true,
|
|
37
|
-
large: true,
|
|
38
|
-
},
|
|
39
|
-
default: "medium",
|
|
40
|
-
},
|
|
41
|
-
photo: { kind: "boolean", default: true },
|
|
42
|
-
initials: { kind: "text", default: "AK" },
|
|
43
|
-
},
|
|
44
|
-
render: ({ size, photo, initials }) => (
|
|
45
|
-
<ProfileImage className={sizes[size]}>
|
|
46
|
-
<ProfileImageContent
|
|
47
|
-
src={photo ? "/avatars/aiko.svg" : undefined}
|
|
48
|
-
/>
|
|
49
|
-
<ProfileImageFallback>
|
|
50
|
-
{initials}
|
|
51
|
-
</ProfileImageFallback>
|
|
52
|
-
</ProfileImage>
|
|
53
|
-
),
|
|
54
|
-
childrenSnippet: ({ size, photo, initials }) => ({
|
|
55
|
-
imports: [
|
|
56
|
-
'import { ProfileImageContent, ProfileImageFallback } from "@passui/react/profile-image"',
|
|
57
|
-
],
|
|
58
|
-
omit: ["size", "photo", "initials"],
|
|
59
|
-
extraProps: { className: sizes[size] },
|
|
60
|
-
children: [
|
|
61
|
-
"",
|
|
62
|
-
...(photo
|
|
63
|
-
? [
|
|
64
|
-
' <ProfileImageContent src="/avatars/aiko.svg" />',
|
|
65
|
-
]
|
|
66
|
-
: []),
|
|
67
|
-
` <ProfileImageFallback>${jsxText(initials)}</ProfileImageFallback>`,
|
|
68
|
-
"",
|
|
69
|
-
].join("\n"),
|
|
70
|
-
}),
|
|
71
|
-
usage: ProfileImageUsage,
|
|
72
|
-
showcase: ProfileImageShowcase,
|
|
73
|
-
examples: [
|
|
74
|
-
{
|
|
75
|
-
id: "fallbacks",
|
|
76
|
-
component: ProfileImageFallbacks,
|
|
77
|
-
playground: { photo: false },
|
|
78
|
-
},
|
|
79
|
-
{ id: "group", component: ProfileImageGroup },
|
|
80
|
-
],
|
|
81
|
-
})
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
LabeledContent,
|
|
3
|
-
SearchField,
|
|
4
|
-
Section,
|
|
5
|
-
} from "@passui/react"
|
|
6
|
-
import { useState } from "react"
|
|
7
|
-
|
|
8
|
-
const apps = [
|
|
9
|
-
{ name: "Pass console", people: 12 },
|
|
10
|
-
{ name: "Accounts", people: 1284 },
|
|
11
|
-
{ name: "Notables", people: 431 },
|
|
12
|
-
{ name: "Showcase", people: 58 },
|
|
13
|
-
]
|
|
14
|
-
|
|
15
|
-
export function SearchFieldFilter() {
|
|
16
|
-
const [query, setQuery] = useState("")
|
|
17
|
-
const matches = apps.filter((app) =>
|
|
18
|
-
app.name
|
|
19
|
-
.toLowerCase()
|
|
20
|
-
.includes(query.trim().toLowerCase())
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className="flex w-full max-w-sm flex-col gap-3">
|
|
25
|
-
<SearchField
|
|
26
|
-
aria-label="Search applications"
|
|
27
|
-
placeholder="Search applications"
|
|
28
|
-
value={query}
|
|
29
|
-
onChange={(event) =>
|
|
30
|
-
setQuery(event.target.value)
|
|
31
|
-
}
|
|
32
|
-
/>
|
|
33
|
-
<Section>
|
|
34
|
-
{matches.length ? (
|
|
35
|
-
matches.map((app) => (
|
|
36
|
-
<LabeledContent
|
|
37
|
-
key={app.name}
|
|
38
|
-
label={app.name}
|
|
39
|
-
>
|
|
40
|
-
<span className="text-footnote text-label-secondary tabular-nums">
|
|
41
|
-
{app.people} people
|
|
42
|
-
</span>
|
|
43
|
-
</LabeledContent>
|
|
44
|
-
))
|
|
45
|
-
) : (
|
|
46
|
-
<p className="px-4 py-6 text-center text-footnote text-label-secondary">
|
|
47
|
-
No applications match “{query}”
|
|
48
|
-
</p>
|
|
49
|
-
)}
|
|
50
|
-
</Section>
|
|
51
|
-
</div>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { SearchField } from "@passui/react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
const people = [
|
|
5
|
-
"Aiko Kamado",
|
|
6
|
-
"Ben Ito",
|
|
7
|
-
"Chiara Rossi",
|
|
8
|
-
"Dev Patel",
|
|
9
|
-
"Emma Laurent",
|
|
10
|
-
"Farah Haddad",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
export function SearchFieldShowcase() {
|
|
14
|
-
const [query, setQuery] = useState("")
|
|
15
|
-
const results = people.filter((person) =>
|
|
16
|
-
person
|
|
17
|
-
.toLowerCase()
|
|
18
|
-
.includes(query.trim().toLowerCase())
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div className="flex w-full max-w-sm flex-col gap-3 rounded-4xl bg-elevated p-4 shadow-sm ring-1 ring-separator/60">
|
|
23
|
-
<SearchField
|
|
24
|
-
aria-label="Search people"
|
|
25
|
-
placeholder="Search people"
|
|
26
|
-
value={query}
|
|
27
|
-
onChange={(event) =>
|
|
28
|
-
setQuery(event.target.value)
|
|
29
|
-
}
|
|
30
|
-
/>
|
|
31
|
-
<ul className="m-0 flex list-none flex-col p-0">
|
|
32
|
-
{results.map((person) => (
|
|
33
|
-
<li
|
|
34
|
-
key={person}
|
|
35
|
-
className="flex items-center gap-3 rounded-2xl px-2 py-2 hover:bg-fill/60"
|
|
36
|
-
>
|
|
37
|
-
<span className="flex size-8 items-center justify-center rounded-full bg-accent-soft text-caption font-bold text-accent-text">
|
|
38
|
-
{person
|
|
39
|
-
.split(" ")
|
|
40
|
-
.map((part) => part[0])
|
|
41
|
-
.join("")}
|
|
42
|
-
</span>
|
|
43
|
-
<span className="text-subheadline text-label">
|
|
44
|
-
{person}
|
|
45
|
-
</span>
|
|
46
|
-
</li>
|
|
47
|
-
))}
|
|
48
|
-
{results.length === 0 && (
|
|
49
|
-
<li className="px-2 py-6 text-center text-footnote text-label-secondary">
|
|
50
|
-
No one matches “{query}”.
|
|
51
|
-
</li>
|
|
52
|
-
)}
|
|
53
|
-
</ul>
|
|
54
|
-
</div>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SearchField } from "@passui/react"
|
|
2
|
-
import { Button } from "@passui/react/button"
|
|
3
|
-
import { useState } from "react"
|
|
4
|
-
|
|
5
|
-
export function SearchFieldToolbar() {
|
|
6
|
-
const [query, setQuery] = useState("")
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div className="flex w-full max-w-lg items-center gap-2 rounded-4xl bg-elevated p-2 shadow-sm ring-1 ring-separator/60">
|
|
10
|
-
<SearchField
|
|
11
|
-
aria-label="Search people"
|
|
12
|
-
placeholder="Search people"
|
|
13
|
-
className="flex-1"
|
|
14
|
-
value={query}
|
|
15
|
-
onChange={(event) =>
|
|
16
|
-
setQuery(event.target.value)
|
|
17
|
-
}
|
|
18
|
-
/>
|
|
19
|
-
<Button variant="secondary" size="sm">
|
|
20
|
-
Filters
|
|
21
|
-
</Button>
|
|
22
|
-
<Button variant="accent" size="sm">
|
|
23
|
-
Invite
|
|
24
|
-
</Button>
|
|
25
|
-
</div>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SearchField } from "@passui/react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
export function SearchFieldUsage() {
|
|
5
|
-
const [query, setQuery] = useState("")
|
|
6
|
-
return (
|
|
7
|
-
<div className="w-full max-w-xs">
|
|
8
|
-
<SearchField
|
|
9
|
-
aria-label="Search notes"
|
|
10
|
-
placeholder="Search notes"
|
|
11
|
-
value={query}
|
|
12
|
-
onChange={(event) =>
|
|
13
|
-
setQuery(event.target.value)
|
|
14
|
-
}
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { SearchFieldToolbar } from "./examples/search-field-toolbar"
|
|
2
|
-
import { SearchFieldFilter } from "./examples/search-field-filter"
|
|
3
|
-
import type { InputHTMLAttributes } from "react"
|
|
4
|
-
import { useState } from "react"
|
|
5
|
-
import { defineDocs } from "../../docs/types"
|
|
6
|
-
import { SearchFieldShowcase } from "./examples/search-field-showcase"
|
|
7
|
-
import { SearchFieldUsage } from "./examples/search-field-usage"
|
|
8
|
-
import { SearchField } from "./search-field"
|
|
9
|
-
|
|
10
|
-
type SearchFieldProps = InputHTMLAttributes<HTMLInputElement>
|
|
11
|
-
|
|
12
|
-
function SearchFieldDemo(
|
|
13
|
-
props: Pick<SearchFieldProps, "placeholder" | "disabled">
|
|
14
|
-
) {
|
|
15
|
-
const [query, setQuery] = useState("")
|
|
16
|
-
return (
|
|
17
|
-
<div className="w-full max-w-xs">
|
|
18
|
-
<SearchField
|
|
19
|
-
{...props}
|
|
20
|
-
aria-label="Search"
|
|
21
|
-
value={query}
|
|
22
|
-
onChange={(event) =>
|
|
23
|
-
setQuery(event.target.value)
|
|
24
|
-
}
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const searchFieldDocs = defineDocs<SearchFieldProps>()(
|
|
31
|
-
{
|
|
32
|
-
slug: "search-field",
|
|
33
|
-
name: "SearchField",
|
|
34
|
-
importPath: "@passui/react",
|
|
35
|
-
controls: {
|
|
36
|
-
placeholder: { kind: "text", default: "Search" },
|
|
37
|
-
disabled: { kind: "boolean", default: false },
|
|
38
|
-
},
|
|
39
|
-
render: (values) => <SearchFieldDemo {...values} />,
|
|
40
|
-
childrenSnippet: () => ({
|
|
41
|
-
imports: ['import { useState } from "react"'],
|
|
42
|
-
setup: ['const [query, setQuery] = useState("")'],
|
|
43
|
-
children: "",
|
|
44
|
-
extraProps: { "aria-label": "Search" },
|
|
45
|
-
expressionProps: {
|
|
46
|
-
value: "query",
|
|
47
|
-
onChange:
|
|
48
|
-
"(event) => setQuery(event.target.value)",
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
usage: SearchFieldUsage,
|
|
52
|
-
showcase: SearchFieldShowcase,
|
|
53
|
-
examples: [
|
|
54
|
-
{ id: "filter", component: SearchFieldFilter },
|
|
55
|
-
{ id: "toolbar", component: SearchFieldToolbar },
|
|
56
|
-
],
|
|
57
|
-
}
|
|
58
|
-
)
|