@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,72 +0,0 @@
|
|
|
1
|
-
import { SecureFieldNewPassword } from "./examples/secure-field-new-password"
|
|
2
|
-
import { SecureFieldReveal } from "./examples/secure-field-reveal"
|
|
3
|
-
import type { ComponentProps } from "react"
|
|
4
|
-
import { useState } from "react"
|
|
5
|
-
import { defineDocs } from "../../docs/types"
|
|
6
|
-
import { SecureFieldShowcase } from "./examples/secure-field-showcase"
|
|
7
|
-
import { SecureFieldUsage } from "./examples/secure-field-usage"
|
|
8
|
-
import { SecureField } from "./secure-field"
|
|
9
|
-
|
|
10
|
-
type SecureFieldProps = ComponentProps<typeof SecureField>
|
|
11
|
-
type DemoProps = Pick<
|
|
12
|
-
SecureFieldProps,
|
|
13
|
-
"label" | "placeholder" | "disabled"
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
function SecureFieldDemo(props: DemoProps) {
|
|
17
|
-
const [value, setValue] = useState("")
|
|
18
|
-
return (
|
|
19
|
-
<div className="w-full max-w-xs">
|
|
20
|
-
<SecureField
|
|
21
|
-
{...props}
|
|
22
|
-
value={value}
|
|
23
|
-
revealLabels={{ show: "Show", hide: "Hide" }}
|
|
24
|
-
onChange={(event) =>
|
|
25
|
-
setValue(event.target.value)
|
|
26
|
-
}
|
|
27
|
-
/>
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const secureFieldDocs = defineDocs<SecureFieldProps>()(
|
|
33
|
-
{
|
|
34
|
-
slug: "secure-field",
|
|
35
|
-
name: "SecureField",
|
|
36
|
-
importPath: "@passui/react/secure-field",
|
|
37
|
-
controls: {
|
|
38
|
-
label: {
|
|
39
|
-
kind: "text",
|
|
40
|
-
default: "Password",
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
placeholder: {
|
|
44
|
-
kind: "text",
|
|
45
|
-
default: "At least 8 characters",
|
|
46
|
-
},
|
|
47
|
-
disabled: { kind: "boolean", default: false },
|
|
48
|
-
},
|
|
49
|
-
render: (values) => <SecureFieldDemo {...values} />,
|
|
50
|
-
childrenSnippet: () => ({
|
|
51
|
-
imports: ['import { useState } from "react"'],
|
|
52
|
-
setup: ['const [value, setValue] = useState("")'],
|
|
53
|
-
children: "",
|
|
54
|
-
expressionProps: {
|
|
55
|
-
value: "value",
|
|
56
|
-
revealLabels:
|
|
57
|
-
'{ show: "Show", hide: "Hide" }',
|
|
58
|
-
onChange:
|
|
59
|
-
"(event) => setValue(event.target.value)",
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
usage: SecureFieldUsage,
|
|
63
|
-
showcase: SecureFieldShowcase,
|
|
64
|
-
examples: [
|
|
65
|
-
{ id: "reveal", component: SecureFieldReveal },
|
|
66
|
-
{
|
|
67
|
-
id: "new-password",
|
|
68
|
-
component: SecureFieldNewPassword,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
}
|
|
72
|
-
)
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SegmentedControl } from "@passui/react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
export function SegmentedControlOverflow() {
|
|
5
|
-
const [sort, setSort] = useState("recent")
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<div className="w-full max-w-[16rem] resize-x overflow-hidden rounded-4xl bg-elevated p-4 shadow-sm ring-1 ring-separator/60">
|
|
9
|
-
<SegmentedControl
|
|
10
|
-
label="Sort by"
|
|
11
|
-
value={sort}
|
|
12
|
-
onChange={setSort}
|
|
13
|
-
options={[
|
|
14
|
-
{
|
|
15
|
-
value: "recent",
|
|
16
|
-
label: "Recently edited",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
value: "created",
|
|
20
|
-
label: "Date created",
|
|
21
|
-
},
|
|
22
|
-
{ value: "title", label: "Title" },
|
|
23
|
-
{ value: "size", label: "Size" },
|
|
24
|
-
]}
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { SegmentedControl } from "@passui/react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
const ranges = {
|
|
5
|
-
day: {
|
|
6
|
-
label: "Today",
|
|
7
|
-
steps: "8,204",
|
|
8
|
-
bars: [3, 5, 2, 6, 4, 7, 5],
|
|
9
|
-
},
|
|
10
|
-
week: {
|
|
11
|
-
label: "This week",
|
|
12
|
-
steps: "54,910",
|
|
13
|
-
bars: [6, 4, 7, 5, 8, 6, 9],
|
|
14
|
-
},
|
|
15
|
-
month: {
|
|
16
|
-
label: "This month",
|
|
17
|
-
steps: "231,447",
|
|
18
|
-
bars: [5, 7, 6, 8, 7, 9, 8],
|
|
19
|
-
},
|
|
20
|
-
} as const
|
|
21
|
-
|
|
22
|
-
type Range = keyof typeof ranges
|
|
23
|
-
|
|
24
|
-
export function SegmentedControlShowcase() {
|
|
25
|
-
const [range, setRange] = useState<Range>("week")
|
|
26
|
-
const data = ranges[range]
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<section className="flex w-full max-w-sm flex-col gap-5 rounded-4xl bg-elevated p-6 shadow-sm ring-1 ring-separator/60">
|
|
30
|
-
<SegmentedControl
|
|
31
|
-
label="Range"
|
|
32
|
-
value={range}
|
|
33
|
-
onChange={setRange}
|
|
34
|
-
options={[
|
|
35
|
-
{ value: "day", label: "Day" },
|
|
36
|
-
{ value: "week", label: "Week" },
|
|
37
|
-
{ value: "month", label: "Month" },
|
|
38
|
-
]}
|
|
39
|
-
/>
|
|
40
|
-
<div className="flex flex-col">
|
|
41
|
-
<span className="text-footnote text-label-secondary">
|
|
42
|
-
{data.label}
|
|
43
|
-
</span>
|
|
44
|
-
<span className="text-title font-bold tabular-nums text-label">
|
|
45
|
-
{data.steps} steps
|
|
46
|
-
</span>
|
|
47
|
-
</div>
|
|
48
|
-
<div className="flex h-28 items-end gap-2">
|
|
49
|
-
{data.bars.map((bar, index) => (
|
|
50
|
-
<span
|
|
51
|
-
key={index}
|
|
52
|
-
className="flex-1 rounded-t-lg bg-accent transition-[height] duration-500"
|
|
53
|
-
style={{ height: `${bar * 10}%` }}
|
|
54
|
-
/>
|
|
55
|
-
))}
|
|
56
|
-
</div>
|
|
57
|
-
</section>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SegmentedControl } from "@passui/react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
export function SegmentedControlUsage() {
|
|
5
|
-
const [theme, setTheme] = useState("auto")
|
|
6
|
-
return (
|
|
7
|
-
<div className="w-full max-w-xs">
|
|
8
|
-
<SegmentedControl
|
|
9
|
-
label="Appearance"
|
|
10
|
-
value={theme}
|
|
11
|
-
onChange={setTheme}
|
|
12
|
-
options={[
|
|
13
|
-
{ value: "light", label: "Light" },
|
|
14
|
-
{ value: "dark", label: "Dark" },
|
|
15
|
-
{ value: "auto", label: "Auto" },
|
|
16
|
-
]}
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SegmentedControl } from "@passui/react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
const counts = { day: 4, week: 23, month: 96 }
|
|
5
|
-
|
|
6
|
-
export function SegmentedControlViews() {
|
|
7
|
-
const [range, setRange] =
|
|
8
|
-
useState<keyof typeof counts>("week")
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<div className="flex w-full max-w-sm flex-col gap-4 rounded-4xl bg-elevated p-5 shadow-sm ring-1 ring-separator/60">
|
|
12
|
-
<SegmentedControl
|
|
13
|
-
label="Range"
|
|
14
|
-
value={range}
|
|
15
|
-
onChange={setRange}
|
|
16
|
-
options={[
|
|
17
|
-
{ value: "day", label: "Day" },
|
|
18
|
-
{ value: "week", label: "Week" },
|
|
19
|
-
{ value: "month", label: "Month" },
|
|
20
|
-
]}
|
|
21
|
-
/>
|
|
22
|
-
<div className="flex flex-col items-center gap-1 py-2">
|
|
23
|
-
<span className="text-large-title font-bold text-label tabular-nums">
|
|
24
|
-
{counts[range]}
|
|
25
|
-
</span>
|
|
26
|
-
<span className="text-footnote text-label-secondary">
|
|
27
|
-
sign-ins this {range}
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { SegmentedControlOverflow } from "./examples/segmented-control-overflow"
|
|
2
|
-
import { SegmentedControlViews } from "./examples/segmented-control-views"
|
|
3
|
-
import { useState } from "react"
|
|
4
|
-
import { defineDocs } from "../../docs/types"
|
|
5
|
-
import { SegmentedControlShowcase } from "./examples/segmented-control-showcase"
|
|
6
|
-
import { SegmentedControlUsage } from "./examples/segmented-control-usage"
|
|
7
|
-
import { SegmentedControl } from "./segmented-control"
|
|
8
|
-
|
|
9
|
-
type DemoProps = { label: string }
|
|
10
|
-
|
|
11
|
-
function SegmentedControlDemo({ label }: DemoProps) {
|
|
12
|
-
const [view, setView] = useState("week")
|
|
13
|
-
return (
|
|
14
|
-
<div className="w-full max-w-xs">
|
|
15
|
-
<SegmentedControl
|
|
16
|
-
label={label}
|
|
17
|
-
value={view}
|
|
18
|
-
onChange={setView}
|
|
19
|
-
options={[
|
|
20
|
-
{ value: "day", label: "Day" },
|
|
21
|
-
{ value: "week", label: "Week" },
|
|
22
|
-
{ value: "month", label: "Month" },
|
|
23
|
-
]}
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const segmentedControlDocs = defineDocs<DemoProps>()({
|
|
30
|
-
slug: "segmented-control",
|
|
31
|
-
name: "SegmentedControl",
|
|
32
|
-
importPath: "@passui/react",
|
|
33
|
-
controls: {
|
|
34
|
-
label: {
|
|
35
|
-
kind: "text",
|
|
36
|
-
default: "Calendar view",
|
|
37
|
-
required: true,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
render: (values) => <SegmentedControlDemo {...values} />,
|
|
41
|
-
childrenSnippet: () => ({
|
|
42
|
-
imports: ['import { useState } from "react"'],
|
|
43
|
-
setup: ['const [view, setView] = useState("week")'],
|
|
44
|
-
children: "",
|
|
45
|
-
expressionProps: {
|
|
46
|
-
value: "view",
|
|
47
|
-
onChange: "setView",
|
|
48
|
-
options:
|
|
49
|
-
'[{ value: "day", label: "Day" }, { value: "week", label: "Week" }, { value: "month", label: "Month" }]',
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
usage: SegmentedControlUsage,
|
|
53
|
-
showcase: SegmentedControlShowcase,
|
|
54
|
-
examples: [
|
|
55
|
-
{ id: "views", component: SegmentedControlViews },
|
|
56
|
-
{
|
|
57
|
-
id: "overflow",
|
|
58
|
-
component: SegmentedControlOverflow,
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
})
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { LabeledContent, Section } from "@passui/react"
|
|
2
|
-
import { Button } from "@passui/react/button"
|
|
3
|
-
import { Sheet } from "@passui/react/sheet"
|
|
4
|
-
import { useState } from "react"
|
|
5
|
-
|
|
6
|
-
const languages = [
|
|
7
|
-
"English",
|
|
8
|
-
"Français",
|
|
9
|
-
"Deutsch",
|
|
10
|
-
"日本語",
|
|
11
|
-
"中文",
|
|
12
|
-
]
|
|
13
|
-
|
|
14
|
-
export function SheetChoices() {
|
|
15
|
-
const [open, setOpen] = useState(false)
|
|
16
|
-
const [language, setLanguage] = useState("English")
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="w-full max-w-sm">
|
|
20
|
-
<Section>
|
|
21
|
-
<LabeledContent label="Language">
|
|
22
|
-
<Button
|
|
23
|
-
variant="ghost"
|
|
24
|
-
size="sm"
|
|
25
|
-
onClick={() => setOpen(true)}
|
|
26
|
-
>
|
|
27
|
-
{language}
|
|
28
|
-
</Button>
|
|
29
|
-
</LabeledContent>
|
|
30
|
-
</Section>
|
|
31
|
-
<Sheet
|
|
32
|
-
open={open}
|
|
33
|
-
onClose={() => setOpen(false)}
|
|
34
|
-
label="Language"
|
|
35
|
-
>
|
|
36
|
-
<div className="flex flex-col gap-1 p-4">
|
|
37
|
-
{languages.map((item) => (
|
|
38
|
-
<button
|
|
39
|
-
key={item}
|
|
40
|
-
type="button"
|
|
41
|
-
aria-pressed={item === language}
|
|
42
|
-
onClick={() => {
|
|
43
|
-
setLanguage(item)
|
|
44
|
-
setOpen(false)
|
|
45
|
-
}}
|
|
46
|
-
className="flex items-center justify-between rounded-3xl px-4 py-3 text-start text-body text-label hover:bg-fill aria-pressed:text-accent-text"
|
|
47
|
-
>
|
|
48
|
-
{item}
|
|
49
|
-
{item === language && (
|
|
50
|
-
<span aria-hidden>✓</span>
|
|
51
|
-
)}
|
|
52
|
-
</button>
|
|
53
|
-
))}
|
|
54
|
-
</div>
|
|
55
|
-
</Sheet>
|
|
56
|
-
</div>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { toast } from "@passui/react"
|
|
2
|
-
import { Button } from "@passui/react/button"
|
|
3
|
-
import { Sheet } from "@passui/react/sheet"
|
|
4
|
-
import { Toggle } from "@passui/react/toggle"
|
|
5
|
-
import { useState } from "react"
|
|
6
|
-
|
|
7
|
-
export function SheetShare() {
|
|
8
|
-
const [open, setOpen] = useState(false)
|
|
9
|
-
const [canEdit, setCanEdit] = useState(false)
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<Button onClick={() => setOpen(true)}>
|
|
14
|
-
Share
|
|
15
|
-
</Button>
|
|
16
|
-
<Sheet
|
|
17
|
-
open={open}
|
|
18
|
-
onClose={() => setOpen(false)}
|
|
19
|
-
label="Share note"
|
|
20
|
-
>
|
|
21
|
-
<div className="flex flex-col gap-5 p-6">
|
|
22
|
-
<h2 className="text-title3 font-semibold text-label">
|
|
23
|
-
Share note
|
|
24
|
-
</h2>
|
|
25
|
-
<Toggle
|
|
26
|
-
label="People with the link can edit"
|
|
27
|
-
checked={canEdit}
|
|
28
|
-
onChange={setCanEdit}
|
|
29
|
-
/>
|
|
30
|
-
<div className="flex justify-end gap-2">
|
|
31
|
-
<Button
|
|
32
|
-
variant="secondary"
|
|
33
|
-
onClick={() => setOpen(false)}
|
|
34
|
-
>
|
|
35
|
-
Cancel
|
|
36
|
-
</Button>
|
|
37
|
-
<Button
|
|
38
|
-
variant="accent"
|
|
39
|
-
onClick={() => {
|
|
40
|
-
setOpen(false)
|
|
41
|
-
toast.success("Link copied")
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
Copy link
|
|
45
|
-
</Button>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</Sheet>
|
|
49
|
-
</>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
LabeledContent,
|
|
3
|
-
Section,
|
|
4
|
-
SwatchPicker,
|
|
5
|
-
} from "@passui/react"
|
|
6
|
-
import { Button } from "@passui/react/button"
|
|
7
|
-
import { Sheet } from "@passui/react/sheet"
|
|
8
|
-
import { useState } from "react"
|
|
9
|
-
|
|
10
|
-
const accents = [
|
|
11
|
-
{
|
|
12
|
-
value: "blush",
|
|
13
|
-
label: "Blush",
|
|
14
|
-
color: "#f2d4d7",
|
|
15
|
-
ink: "#9e3b4f",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: "sage",
|
|
19
|
-
label: "Sage",
|
|
20
|
-
color: "#d6e6d3",
|
|
21
|
-
ink: "#3f6b45",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
value: "ocean",
|
|
25
|
-
label: "Ocean",
|
|
26
|
-
color: "#d3e3f2",
|
|
27
|
-
ink: "#2f5f8f",
|
|
28
|
-
},
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
export function SheetShowcase() {
|
|
32
|
-
const [open, setOpen] = useState(false)
|
|
33
|
-
const [accent, setAccent] = useState("blush")
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div className="w-full max-w-sm">
|
|
37
|
-
<Section title="Appearance">
|
|
38
|
-
<LabeledContent label="Accent color">
|
|
39
|
-
<Button
|
|
40
|
-
variant="ghost"
|
|
41
|
-
size="sm"
|
|
42
|
-
onClick={() => setOpen(true)}
|
|
43
|
-
>
|
|
44
|
-
{
|
|
45
|
-
accents.find(
|
|
46
|
-
(a) => a.value === accent
|
|
47
|
-
)?.label
|
|
48
|
-
}
|
|
49
|
-
</Button>
|
|
50
|
-
</LabeledContent>
|
|
51
|
-
</Section>
|
|
52
|
-
<Sheet
|
|
53
|
-
open={open}
|
|
54
|
-
onClose={() => setOpen(false)}
|
|
55
|
-
label="Accent color"
|
|
56
|
-
>
|
|
57
|
-
<div className="flex flex-col gap-5 p-6">
|
|
58
|
-
<h2 className="text-title3 font-semibold text-label">
|
|
59
|
-
Accent color
|
|
60
|
-
</h2>
|
|
61
|
-
<SwatchPicker
|
|
62
|
-
label="Accent color"
|
|
63
|
-
options={accents}
|
|
64
|
-
value={accent}
|
|
65
|
-
onChange={setAccent}
|
|
66
|
-
/>
|
|
67
|
-
<Button onClick={() => setOpen(false)}>
|
|
68
|
-
Done
|
|
69
|
-
</Button>
|
|
70
|
-
</div>
|
|
71
|
-
</Sheet>
|
|
72
|
-
</div>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Button } from "@passui/react/button"
|
|
2
|
-
import { Sheet } from "@passui/react/sheet"
|
|
3
|
-
import { useState } from "react"
|
|
4
|
-
|
|
5
|
-
export function SheetUsage() {
|
|
6
|
-
const [open, setOpen] = useState(false)
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<>
|
|
10
|
-
<Button
|
|
11
|
-
variant="secondary"
|
|
12
|
-
onClick={() => setOpen(true)}
|
|
13
|
-
>
|
|
14
|
-
About this app
|
|
15
|
-
</Button>
|
|
16
|
-
<Sheet
|
|
17
|
-
open={open}
|
|
18
|
-
onClose={() => setOpen(false)}
|
|
19
|
-
label="About this app"
|
|
20
|
-
>
|
|
21
|
-
<div className="flex flex-col gap-2 p-6">
|
|
22
|
-
<h2 className="text-title3 font-semibold text-label">
|
|
23
|
-
Pass
|
|
24
|
-
</h2>
|
|
25
|
-
<p className="text-callout text-label-secondary">
|
|
26
|
-
Version 2.4. Made in Lisbon.
|
|
27
|
-
</p>
|
|
28
|
-
</div>
|
|
29
|
-
</Sheet>
|
|
30
|
-
</>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { SheetChoices } from "./examples/sheet-choices"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
import { Button } from "../button/button"
|
|
4
|
-
import { defineDocs } from "../../docs/types"
|
|
5
|
-
import { SheetShare } from "./examples/sheet-share"
|
|
6
|
-
import { SheetShowcase } from "./examples/sheet-showcase"
|
|
7
|
-
import { SheetUsage } from "./examples/sheet-usage"
|
|
8
|
-
import { Sheet } from "./sheet"
|
|
9
|
-
|
|
10
|
-
type DemoProps = {
|
|
11
|
-
label: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function SheetDemo({ label }: DemoProps) {
|
|
15
|
-
const [open, setOpen] = useState(false)
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<Button
|
|
19
|
-
variant="secondary"
|
|
20
|
-
onClick={() => setOpen(true)}
|
|
21
|
-
>
|
|
22
|
-
Open sheet
|
|
23
|
-
</Button>
|
|
24
|
-
<Sheet
|
|
25
|
-
open={open}
|
|
26
|
-
onClose={() => setOpen(false)}
|
|
27
|
-
label={label}
|
|
28
|
-
>
|
|
29
|
-
<div className="flex flex-col gap-3 p-6">
|
|
30
|
-
<h2 className="text-title3 font-semibold text-label">
|
|
31
|
-
{label}
|
|
32
|
-
</h2>
|
|
33
|
-
<p className="text-callout text-label-secondary">
|
|
34
|
-
Escape, a tap outside, or the button
|
|
35
|
-
closes it.
|
|
36
|
-
</p>
|
|
37
|
-
<Button onClick={() => setOpen(false)}>
|
|
38
|
-
Done
|
|
39
|
-
</Button>
|
|
40
|
-
</div>
|
|
41
|
-
</Sheet>
|
|
42
|
-
</>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const sheetDocs = defineDocs<DemoProps>()({
|
|
47
|
-
slug: "sheet",
|
|
48
|
-
name: "Sheet",
|
|
49
|
-
importPath: "@passui/react/sheet",
|
|
50
|
-
controls: {
|
|
51
|
-
label: {
|
|
52
|
-
kind: "text",
|
|
53
|
-
default: "Details",
|
|
54
|
-
required: true,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
render: (values) => <SheetDemo {...values} />,
|
|
58
|
-
childrenSnippet: () => ({
|
|
59
|
-
imports: ['import { useState } from "react"'],
|
|
60
|
-
setup: ["const [open, setOpen] = useState(false)"],
|
|
61
|
-
expressionProps: {
|
|
62
|
-
open: "open",
|
|
63
|
-
onClose: "() => setOpen(false)",
|
|
64
|
-
},
|
|
65
|
-
children:
|
|
66
|
-
'\n <div className="p-6">The sheet\'s content</div>\n',
|
|
67
|
-
}),
|
|
68
|
-
usage: SheetUsage,
|
|
69
|
-
showcase: SheetShowcase,
|
|
70
|
-
examples: [
|
|
71
|
-
{ id: "share", component: SheetShare },
|
|
72
|
-
{ id: "choices", component: SheetChoices },
|
|
73
|
-
],
|
|
74
|
-
previewHeight: 420,
|
|
75
|
-
})
|