@passui/react 0.1.17 → 0.1.19
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 +102 -1
- 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/ambient/ambient.d.ts +12 -0
- package/dist/types/src/components/ambient/index.d.ts +1 -0
- package/dist/types/src/components/button/button-styles.d.ts +12 -0
- package/dist/types/src/components/button/button.d.ts +30 -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/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-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 +22 -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 +21 -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 +13 -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/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/picker/picker-trigger.d.ts +2 -0
- package/dist/types/src/components/picker/picker.d.ts +37 -0
- package/dist/types/src/components/popover/popover-fit.d.ts +21 -0
- package/dist/types/src/components/popover/popover.d.ts +14 -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/search-field/search-field.d.ts +2 -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 +18 -0
- package/dist/types/src/components/slider/slider.d.ts +14 -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/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 +18 -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/hooks/scroll/minimize-decision.d.ts +2 -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 +58 -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 +192 -40
- package/src/appearance/platform.tsx +10 -47
- package/src/appearance/theme.tsx +42 -142
- package/src/components/ambient/ambient.tsx +2 -10
- package/src/components/button/button-styles.ts +13 -31
- package/src/components/button/button.tsx +19 -14
- 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/compact-date-picker/calendar-month.ts +13 -57
- package/src/components/compact-date-picker/compact-date-picker.tsx +44 -123
- package/src/components/compact-time-picker/compact-time-picker.tsx +46 -130
- package/src/components/compact-time-picker/time-value.ts +4 -16
- 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 +125 -195
- package/src/components/context-menu/context-menu-store.ts +3 -11
- 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 +13 -54
- 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 +31 -76
- package/src/components/dialog/dialog-store.ts +1 -3
- package/src/components/dialog/dialog.tsx +23 -80
- package/src/components/disclosure-group/disclosure-group.tsx +70 -0
- package/src/components/divider/divider.tsx +31 -0
- package/src/components/inline-disclosure/inline-disclosure.tsx +49 -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/picker/picker-trigger.ts +10 -0
- package/src/components/picker/picker.tsx +72 -203
- package/src/components/popover/popover-fit.ts +69 -0
- package/src/components/popover/popover.tsx +94 -77
- package/src/components/profile-image/profile-image.tsx +6 -28
- package/src/components/progress-view/progress-view.tsx +65 -0
- package/src/components/search-field/search-field.tsx +27 -25
- package/src/components/search-list/search-list.tsx +43 -69
- 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 +27 -30
- package/src/components/slider/slider.tsx +76 -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/stepper.tsx +80 -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 +11 -40
- package/src/components/toast/toast-store.ts +9 -30
- package/src/components/toast/toaster.tsx +90 -104
- package/src/components/toggle/toggle.tsx +28 -24
- package/src/components/tooltip/tooltip-host.tsx +70 -67
- package/src/components/view-controller/view-controller.tsx +4 -21
- package/src/hooks/scroll/minimize-decision.ts +1 -5
- package/src/hooks/use-anchored-placement.ts +4 -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 +167 -121
- package/src/index.ts +9 -1
- package/src/lib/anchored-placement.ts +5 -15
- 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/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,15 +0,0 @@
|
|
|
1
|
-
import { Button } from "@passui/react/button"
|
|
2
|
-
|
|
3
|
-
export function ButtonVariants() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="flex flex-wrap items-center justify-center gap-3">
|
|
6
|
-
<Button>Default</Button>
|
|
7
|
-
<Button variant="secondary">Secondary</Button>
|
|
8
|
-
<Button variant="outline">Outline</Button>
|
|
9
|
-
<Button variant="ghost">Ghost</Button>
|
|
10
|
-
<Button variant="link">Link</Button>
|
|
11
|
-
<Button variant="accent">Accent</Button>
|
|
12
|
-
<Button variant="destructive">Destructive</Button>
|
|
13
|
-
</div>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Delete02Icon,
|
|
3
|
-
Download04Icon,
|
|
4
|
-
Mail01Icon,
|
|
5
|
-
} from "@hugeicons/core-free-icons"
|
|
6
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
7
|
-
import { Button } from "@passui/react/button"
|
|
8
|
-
|
|
9
|
-
export function ButtonWithIcon() {
|
|
10
|
-
return (
|
|
11
|
-
<div className="flex flex-wrap items-center justify-center gap-3">
|
|
12
|
-
<Button variant="accent">
|
|
13
|
-
<HugeiconsIcon icon={Mail01Icon} size={18} />
|
|
14
|
-
Email
|
|
15
|
-
</Button>
|
|
16
|
-
<Button variant="secondary">
|
|
17
|
-
<HugeiconsIcon
|
|
18
|
-
icon={Download04Icon}
|
|
19
|
-
size={18}
|
|
20
|
-
/>
|
|
21
|
-
Download
|
|
22
|
-
</Button>
|
|
23
|
-
<Button variant="destructive">
|
|
24
|
-
<HugeiconsIcon
|
|
25
|
-
icon={Delete02Icon}
|
|
26
|
-
size={18}
|
|
27
|
-
/>
|
|
28
|
-
Delete
|
|
29
|
-
</Button>
|
|
30
|
-
</div>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NextIcon,
|
|
3
|
-
PauseIcon,
|
|
4
|
-
PlayIcon,
|
|
5
|
-
PreviousIcon,
|
|
6
|
-
} from "@hugeicons/core-free-icons"
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
8
|
-
import { IconButton } from "@passui/react/icon-button"
|
|
9
|
-
import { useState } from "react"
|
|
10
|
-
|
|
11
|
-
export function IconButtonPlayer() {
|
|
12
|
-
const [playing, setPlaying] = useState(false)
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div className="flex items-center gap-3">
|
|
16
|
-
<IconButton label="Previous" variant="ghost">
|
|
17
|
-
<HugeiconsIcon
|
|
18
|
-
icon={PreviousIcon}
|
|
19
|
-
size={20}
|
|
20
|
-
/>
|
|
21
|
-
</IconButton>
|
|
22
|
-
<IconButton
|
|
23
|
-
label={playing ? "Pause" : "Play"}
|
|
24
|
-
variant="accent"
|
|
25
|
-
size="icon-lg"
|
|
26
|
-
onClick={() => setPlaying((value) => !value)}
|
|
27
|
-
>
|
|
28
|
-
<HugeiconsIcon
|
|
29
|
-
icon={playing ? PauseIcon : PlayIcon}
|
|
30
|
-
size={22}
|
|
31
|
-
/>
|
|
32
|
-
</IconButton>
|
|
33
|
-
<IconButton label="Next" variant="ghost">
|
|
34
|
-
<HugeiconsIcon icon={NextIcon} size={20} />
|
|
35
|
-
</IconButton>
|
|
36
|
-
</div>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ArrowLeft01Icon,
|
|
3
|
-
Bookmark02Icon,
|
|
4
|
-
MoreHorizontalIcon,
|
|
5
|
-
Share08Icon,
|
|
6
|
-
} from "@hugeicons/core-free-icons"
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
8
|
-
import { toast } from "@passui/react"
|
|
9
|
-
import { IconButton } from "@passui/react/icon-button"
|
|
10
|
-
import { useState } from "react"
|
|
11
|
-
|
|
12
|
-
export function IconButtonShowcase() {
|
|
13
|
-
const [saved, setSaved] = useState(false)
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<article className="flex w-full max-w-sm flex-col overflow-hidden rounded-4xl bg-elevated shadow-sm ring-1 ring-separator/60">
|
|
17
|
-
<header className="flex items-center justify-between p-3">
|
|
18
|
-
<IconButton
|
|
19
|
-
label="Back"
|
|
20
|
-
variant="ghost"
|
|
21
|
-
size="icon-sm"
|
|
22
|
-
>
|
|
23
|
-
<HugeiconsIcon
|
|
24
|
-
icon={ArrowLeft01Icon}
|
|
25
|
-
size={18}
|
|
26
|
-
/>
|
|
27
|
-
</IconButton>
|
|
28
|
-
<div className="flex gap-1">
|
|
29
|
-
<IconButton
|
|
30
|
-
label={
|
|
31
|
-
saved
|
|
32
|
-
? "Remove bookmark"
|
|
33
|
-
: "Bookmark"
|
|
34
|
-
}
|
|
35
|
-
variant={saved ? "accent" : "ghost"}
|
|
36
|
-
size="icon-sm"
|
|
37
|
-
onClick={() =>
|
|
38
|
-
setSaved((value) => !value)
|
|
39
|
-
}
|
|
40
|
-
>
|
|
41
|
-
<HugeiconsIcon
|
|
42
|
-
icon={Bookmark02Icon}
|
|
43
|
-
size={18}
|
|
44
|
-
/>
|
|
45
|
-
</IconButton>
|
|
46
|
-
<IconButton
|
|
47
|
-
label="Share"
|
|
48
|
-
variant="ghost"
|
|
49
|
-
size="icon-sm"
|
|
50
|
-
onClick={() =>
|
|
51
|
-
toast.success("Link copied")
|
|
52
|
-
}
|
|
53
|
-
>
|
|
54
|
-
<HugeiconsIcon
|
|
55
|
-
icon={Share08Icon}
|
|
56
|
-
size={18}
|
|
57
|
-
/>
|
|
58
|
-
</IconButton>
|
|
59
|
-
<IconButton
|
|
60
|
-
label="More"
|
|
61
|
-
variant="ghost"
|
|
62
|
-
size="icon-sm"
|
|
63
|
-
>
|
|
64
|
-
<HugeiconsIcon
|
|
65
|
-
icon={MoreHorizontalIcon}
|
|
66
|
-
size={18}
|
|
67
|
-
/>
|
|
68
|
-
</IconButton>
|
|
69
|
-
</div>
|
|
70
|
-
</header>
|
|
71
|
-
<div className="h-36 bg-accent-soft" />
|
|
72
|
-
<div className="flex flex-col gap-1 p-5">
|
|
73
|
-
<h2 className="text-headline font-semibold text-label">
|
|
74
|
-
Designing for calm
|
|
75
|
-
</h2>
|
|
76
|
-
<p className="text-footnote text-label-secondary">
|
|
77
|
-
Six minutes · Saved items stay on every
|
|
78
|
-
device.
|
|
79
|
-
</p>
|
|
80
|
-
</div>
|
|
81
|
-
</article>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Settings02Icon } from "@hugeicons/core-free-icons"
|
|
2
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
3
|
-
import { IconButton } from "@passui/react/icon-button"
|
|
4
|
-
|
|
5
|
-
export function IconButtonUsage() {
|
|
6
|
-
return (
|
|
7
|
-
<IconButton label="Settings" variant="ghost">
|
|
8
|
-
<HugeiconsIcon icon={Settings02Icon} size={20} />
|
|
9
|
-
</IconButton>
|
|
10
|
-
)
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Delete02Icon,
|
|
3
|
-
FavouriteIcon,
|
|
4
|
-
PlusSignIcon,
|
|
5
|
-
Settings02Icon,
|
|
6
|
-
} from "@hugeicons/core-free-icons"
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
8
|
-
import { IconButton } from "@passui/react/icon-button"
|
|
9
|
-
|
|
10
|
-
export function IconButtonVariants() {
|
|
11
|
-
return (
|
|
12
|
-
<div className="flex flex-wrap items-center justify-center gap-3">
|
|
13
|
-
<IconButton label="Add" variant="accent">
|
|
14
|
-
<HugeiconsIcon
|
|
15
|
-
icon={PlusSignIcon}
|
|
16
|
-
size={20}
|
|
17
|
-
/>
|
|
18
|
-
</IconButton>
|
|
19
|
-
<IconButton label="Like" variant="secondary">
|
|
20
|
-
<HugeiconsIcon
|
|
21
|
-
icon={FavouriteIcon}
|
|
22
|
-
size={20}
|
|
23
|
-
/>
|
|
24
|
-
</IconButton>
|
|
25
|
-
<IconButton label="Settings" variant="outline">
|
|
26
|
-
<HugeiconsIcon
|
|
27
|
-
icon={Settings02Icon}
|
|
28
|
-
size={20}
|
|
29
|
-
/>
|
|
30
|
-
</IconButton>
|
|
31
|
-
<IconButton label="Delete" variant="destructive">
|
|
32
|
-
<HugeiconsIcon
|
|
33
|
-
icon={Delete02Icon}
|
|
34
|
-
size={20}
|
|
35
|
-
/>
|
|
36
|
-
</IconButton>
|
|
37
|
-
</div>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Settings02Icon } from "@hugeicons/core-free-icons"
|
|
2
|
-
import { HugeiconsIcon } from "@hugeicons/react"
|
|
3
|
-
import { defineDocs } from "../../docs/types"
|
|
4
|
-
import { IconButtonPlayer } from "./examples/icon-button-player"
|
|
5
|
-
import { IconButtonShowcase } from "./examples/icon-button-showcase"
|
|
6
|
-
import { IconButtonUsage } from "./examples/icon-button-usage"
|
|
7
|
-
import { IconButtonVariants } from "./examples/icon-button-variants"
|
|
8
|
-
import {
|
|
9
|
-
IconButton,
|
|
10
|
-
type IconButtonProps,
|
|
11
|
-
} from "./icon-button"
|
|
12
|
-
|
|
13
|
-
export const iconButtonDocs = defineDocs<IconButtonProps>()({
|
|
14
|
-
slug: "icon-button",
|
|
15
|
-
name: "IconButton",
|
|
16
|
-
importPath: "@passui/react/icon-button",
|
|
17
|
-
controls: {
|
|
18
|
-
variant: {
|
|
19
|
-
kind: "select",
|
|
20
|
-
options: {
|
|
21
|
-
default: true,
|
|
22
|
-
secondary: true,
|
|
23
|
-
outline: true,
|
|
24
|
-
ghost: true,
|
|
25
|
-
link: true,
|
|
26
|
-
accent: true,
|
|
27
|
-
destructive: true,
|
|
28
|
-
},
|
|
29
|
-
default: "ghost",
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
kind: "select",
|
|
33
|
-
options: {
|
|
34
|
-
icon: true,
|
|
35
|
-
"icon-xs": true,
|
|
36
|
-
"icon-sm": true,
|
|
37
|
-
"icon-lg": true,
|
|
38
|
-
},
|
|
39
|
-
default: "icon",
|
|
40
|
-
},
|
|
41
|
-
isPending: { kind: "boolean", default: false },
|
|
42
|
-
disabled: { kind: "boolean", default: false },
|
|
43
|
-
label: {
|
|
44
|
-
kind: "text",
|
|
45
|
-
default: "Settings",
|
|
46
|
-
required: true,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
render: (values) => (
|
|
50
|
-
<IconButton {...values}>
|
|
51
|
-
<HugeiconsIcon icon={Settings02Icon} size={20} />
|
|
52
|
-
</IconButton>
|
|
53
|
-
),
|
|
54
|
-
childrenSnippet: () => ({
|
|
55
|
-
imports: [
|
|
56
|
-
'import { Settings02Icon } from "@hugeicons/core-free-icons"',
|
|
57
|
-
'import { HugeiconsIcon } from "@hugeicons/react"',
|
|
58
|
-
],
|
|
59
|
-
children:
|
|
60
|
-
"<HugeiconsIcon icon={Settings02Icon} size={20} />",
|
|
61
|
-
}),
|
|
62
|
-
usage: IconButtonUsage,
|
|
63
|
-
showcase: IconButtonShowcase,
|
|
64
|
-
examples: [
|
|
65
|
-
{ id: "variants", component: IconButtonVariants },
|
|
66
|
-
{ id: "player", component: IconButtonPlayer },
|
|
67
|
-
],
|
|
68
|
-
})
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ChipInRows } from "./examples/chip-in-rows"
|
|
2
|
-
import { defineDocs } from "../../docs/types"
|
|
3
|
-
import { Chip, type ChipTone } from "./chip"
|
|
4
|
-
import { ChipShowcase } from "./examples/chip-showcase"
|
|
5
|
-
import { ChipTones } from "./examples/chip-tones"
|
|
6
|
-
import { ChipUsage } from "./examples/chip-usage"
|
|
7
|
-
|
|
8
|
-
type ChipProps = { tone?: ChipTone; children?: string }
|
|
9
|
-
|
|
10
|
-
export const chipDocs = defineDocs<ChipProps>()({
|
|
11
|
-
slug: "chip",
|
|
12
|
-
name: "Chip",
|
|
13
|
-
importPath: "@passui/react",
|
|
14
|
-
controls: {
|
|
15
|
-
tone: {
|
|
16
|
-
kind: "select",
|
|
17
|
-
options: {
|
|
18
|
-
neutral: true,
|
|
19
|
-
accent: true,
|
|
20
|
-
public: true,
|
|
21
|
-
family: true,
|
|
22
|
-
friends: true,
|
|
23
|
-
},
|
|
24
|
-
default: "neutral",
|
|
25
|
-
},
|
|
26
|
-
children: { kind: "text", default: "Draft" },
|
|
27
|
-
},
|
|
28
|
-
render: ({ children, ...values }) => (
|
|
29
|
-
<Chip {...values}>{children}</Chip>
|
|
30
|
-
),
|
|
31
|
-
usage: ChipUsage,
|
|
32
|
-
showcase: ChipShowcase,
|
|
33
|
-
examples: [
|
|
34
|
-
{ id: "tones", component: ChipTones },
|
|
35
|
-
{ id: "in-rows", component: ChipInRows },
|
|
36
|
-
],
|
|
37
|
-
})
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Chip, LabeledContent, Section } from "@passui/react"
|
|
2
|
-
|
|
3
|
-
export function ChipInRows() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="w-full max-w-sm">
|
|
6
|
-
<Section title="Shared with">
|
|
7
|
-
<LabeledContent label="Aiko Kamado">
|
|
8
|
-
<Chip tone="accent">Owner</Chip>
|
|
9
|
-
</LabeledContent>
|
|
10
|
-
<LabeledContent label="Kenji Mori">
|
|
11
|
-
<Chip tone="family">Family</Chip>
|
|
12
|
-
</LabeledContent>
|
|
13
|
-
<LabeledContent label="Anyone with the link">
|
|
14
|
-
<Chip tone="public">Public</Chip>
|
|
15
|
-
</LabeledContent>
|
|
16
|
-
</Section>
|
|
17
|
-
</div>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Chip } from "@passui/react"
|
|
2
|
-
|
|
3
|
-
const notes = [
|
|
4
|
-
{
|
|
5
|
-
title: "Trip to Kyoto",
|
|
6
|
-
detail: "Edited today",
|
|
7
|
-
tone: "friends",
|
|
8
|
-
tag: "Friends",
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
title: "Grandma's recipes",
|
|
12
|
-
detail: "Edited yesterday",
|
|
13
|
-
tone: "family",
|
|
14
|
-
tag: "Family",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
title: "Reading list",
|
|
18
|
-
detail: "Edited Monday",
|
|
19
|
-
tone: "public",
|
|
20
|
-
tag: "Public",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
title: "Q4 plan",
|
|
24
|
-
detail: "Edited last week",
|
|
25
|
-
tone: "neutral",
|
|
26
|
-
tag: "Draft",
|
|
27
|
-
},
|
|
28
|
-
] as const
|
|
29
|
-
|
|
30
|
-
export function ChipShowcase() {
|
|
31
|
-
return (
|
|
32
|
-
<ul className="m-0 flex w-full max-w-sm list-none flex-col divide-y divide-separator/60 overflow-hidden rounded-4xl bg-elevated p-0 shadow-sm ring-1 ring-separator/60">
|
|
33
|
-
{notes.map((note) => (
|
|
34
|
-
<li
|
|
35
|
-
key={note.title}
|
|
36
|
-
className="flex items-center justify-between gap-3 px-5 py-3.5"
|
|
37
|
-
>
|
|
38
|
-
<div className="flex flex-col">
|
|
39
|
-
<span className="text-subheadline font-semibold text-label">
|
|
40
|
-
{note.title}
|
|
41
|
-
</span>
|
|
42
|
-
<span className="text-footnote text-label-secondary">
|
|
43
|
-
{note.detail}
|
|
44
|
-
</span>
|
|
45
|
-
</div>
|
|
46
|
-
<Chip tone={note.tone}>{note.tag}</Chip>
|
|
47
|
-
</li>
|
|
48
|
-
))}
|
|
49
|
-
</ul>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Chip } from "@passui/react"
|
|
2
|
-
|
|
3
|
-
export function ChipTones() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="flex flex-wrap items-center justify-center gap-2">
|
|
6
|
-
<Chip tone="neutral">Draft</Chip>
|
|
7
|
-
<Chip tone="accent">Featured</Chip>
|
|
8
|
-
<Chip tone="public">Public</Chip>
|
|
9
|
-
<Chip tone="family">Family</Chip>
|
|
10
|
-
<Chip tone="friends">Friends</Chip>
|
|
11
|
-
</div>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
import { defineDocs } from "../../docs/types"
|
|
4
|
-
import { CompactDatePicker } from "./compact-date-picker"
|
|
5
|
-
import { CompactDatePickerShowcase } from "./examples/compact-date-picker-showcase"
|
|
6
|
-
import { CompactDatePickerUsage } from "./examples/compact-date-picker-usage"
|
|
7
|
-
|
|
8
|
-
type CompactDatePickerProps = ComponentProps<
|
|
9
|
-
typeof CompactDatePicker
|
|
10
|
-
>
|
|
11
|
-
|
|
12
|
-
// Locales whose weeks start on different days, so the playground shows it.
|
|
13
|
-
type DemoProps = Pick<CompactDatePickerProps, "label"> & {
|
|
14
|
-
locale: "en-US" | "en-GB" | "fr-FR" | "ar-EG" | "zh-CN"
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const labels = {
|
|
18
|
-
previousMonth: "Previous month",
|
|
19
|
-
nextMonth: "Next month",
|
|
20
|
-
clear: "Remove date",
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function CompactDatePickerDemo({ locale, label }: DemoProps) {
|
|
24
|
-
const [date, setDate] = useState("")
|
|
25
|
-
return (
|
|
26
|
-
<div
|
|
27
|
-
className="w-full max-w-xs"
|
|
28
|
-
dir={locale === "ar-EG" ? "rtl" : undefined}
|
|
29
|
-
>
|
|
30
|
-
<CompactDatePicker
|
|
31
|
-
key={locale}
|
|
32
|
-
label={label}
|
|
33
|
-
labels={labels}
|
|
34
|
-
locale={locale}
|
|
35
|
-
placeholder="None"
|
|
36
|
-
value={date}
|
|
37
|
-
onChange={setDate}
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const compactDatePickerDocs = defineDocs<DemoProps>()({
|
|
44
|
-
slug: "compact-date-picker",
|
|
45
|
-
name: "CompactDatePicker",
|
|
46
|
-
importPath: "@passui/react/compact-date-picker",
|
|
47
|
-
controls: {
|
|
48
|
-
label: {
|
|
49
|
-
kind: "text",
|
|
50
|
-
default: "Starts",
|
|
51
|
-
required: true,
|
|
52
|
-
},
|
|
53
|
-
locale: {
|
|
54
|
-
kind: "select",
|
|
55
|
-
options: {
|
|
56
|
-
"en-US": true,
|
|
57
|
-
"en-GB": true,
|
|
58
|
-
"fr-FR": true,
|
|
59
|
-
"ar-EG": true,
|
|
60
|
-
"zh-CN": true,
|
|
61
|
-
},
|
|
62
|
-
default: "en-US",
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
render: (values) => <CompactDatePickerDemo {...values} />,
|
|
66
|
-
childrenSnippet: ({ locale }) => ({
|
|
67
|
-
imports: ['import { useState } from "react"'],
|
|
68
|
-
setup: ['const [date, setDate] = useState("")'],
|
|
69
|
-
children: "",
|
|
70
|
-
omit: ["locale"],
|
|
71
|
-
extraProps: { locale },
|
|
72
|
-
expressionProps: {
|
|
73
|
-
labels: '{ previousMonth: "Previous month", nextMonth: "Next month", clear: "Remove date" }',
|
|
74
|
-
value: "date",
|
|
75
|
-
onChange: "setDate",
|
|
76
|
-
},
|
|
77
|
-
}),
|
|
78
|
-
usage: CompactDatePickerUsage,
|
|
79
|
-
showcase: CompactDatePickerShowcase,
|
|
80
|
-
examples: [],
|
|
81
|
-
})
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { CompactDatePicker } from "@passui/react/compact-date-picker"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
const labels = {
|
|
5
|
-
previousMonth: "Previous month",
|
|
6
|
-
nextMonth: "Next month",
|
|
7
|
-
clear: "Remove date",
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function CompactDatePickerShowcase() {
|
|
11
|
-
const [starts, setStarts] = useState("2026-10-15")
|
|
12
|
-
const [ends, setEnds] = useState("")
|
|
13
|
-
return (
|
|
14
|
-
<div className="grid w-full max-w-sm grid-cols-2 gap-3">
|
|
15
|
-
<CompactDatePicker
|
|
16
|
-
label="Starts"
|
|
17
|
-
labels={labels}
|
|
18
|
-
locale="en-GB"
|
|
19
|
-
value={starts}
|
|
20
|
-
onChange={(value) =>
|
|
21
|
-
value && setStarts(value)
|
|
22
|
-
}
|
|
23
|
-
/>
|
|
24
|
-
<CompactDatePicker
|
|
25
|
-
label="Ends"
|
|
26
|
-
placeholder="None"
|
|
27
|
-
labels={labels}
|
|
28
|
-
locale="en-GB"
|
|
29
|
-
min={starts}
|
|
30
|
-
value={ends}
|
|
31
|
-
onChange={setEnds}
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CompactDatePicker } from "@passui/react/compact-date-picker"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
|
|
4
|
-
export function CompactDatePickerUsage() {
|
|
5
|
-
const [due, setDue] = useState("")
|
|
6
|
-
return (
|
|
7
|
-
<div className="w-full max-w-xs">
|
|
8
|
-
<CompactDatePicker
|
|
9
|
-
label="Due"
|
|
10
|
-
placeholder="None"
|
|
11
|
-
labels={{
|
|
12
|
-
previousMonth: "Previous month",
|
|
13
|
-
nextMonth: "Next month",
|
|
14
|
-
clear: "Remove date",
|
|
15
|
-
}}
|
|
16
|
-
locale="en-US"
|
|
17
|
-
value={due}
|
|
18
|
-
onChange={setDue}
|
|
19
|
-
/>
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react"
|
|
2
|
-
import { useState } from "react"
|
|
3
|
-
import { defineDocs } from "../../docs/types"
|
|
4
|
-
import { CompactTimePicker } from "./compact-time-picker"
|
|
5
|
-
import { CompactTimePickerShowcase } from "./examples/compact-time-picker-showcase"
|
|
6
|
-
import { CompactTimePickerUsage } from "./examples/compact-time-picker-usage"
|
|
7
|
-
|
|
8
|
-
type CompactTimePickerProps = ComponentProps<
|
|
9
|
-
typeof CompactTimePicker
|
|
10
|
-
>
|
|
11
|
-
|
|
12
|
-
// Locales on 12 and 24 hour clocks, so the playground shows both.
|
|
13
|
-
type DemoProps = Pick<CompactTimePickerProps, "label"> & {
|
|
14
|
-
locale: "en-US" | "en-GB" | "fr-FR" | "ar-EG" | "zh-CN"
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const labels = {
|
|
18
|
-
hour: "Hour",
|
|
19
|
-
minute: "Minute",
|
|
20
|
-
period: "AM or PM",
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function CompactTimePickerDemo({ locale, label }: DemoProps) {
|
|
24
|
-
const [time, setTime] = useState("18:30")
|
|
25
|
-
return (
|
|
26
|
-
<div
|
|
27
|
-
className="w-full max-w-xs"
|
|
28
|
-
dir={locale === "ar-EG" ? "rtl" : undefined}
|
|
29
|
-
>
|
|
30
|
-
<CompactTimePicker
|
|
31
|
-
key={locale}
|
|
32
|
-
label={label}
|
|
33
|
-
labels={labels}
|
|
34
|
-
locale={locale}
|
|
35
|
-
value={time}
|
|
36
|
-
onChange={setTime}
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const compactTimePickerDocs = defineDocs<DemoProps>()({
|
|
43
|
-
slug: "compact-time-picker",
|
|
44
|
-
name: "CompactTimePicker",
|
|
45
|
-
importPath: "@passui/react/compact-time-picker",
|
|
46
|
-
controls: {
|
|
47
|
-
label: {
|
|
48
|
-
kind: "text",
|
|
49
|
-
default: "Time",
|
|
50
|
-
required: true,
|
|
51
|
-
},
|
|
52
|
-
locale: {
|
|
53
|
-
kind: "select",
|
|
54
|
-
options: {
|
|
55
|
-
"en-US": true,
|
|
56
|
-
"en-GB": true,
|
|
57
|
-
"fr-FR": true,
|
|
58
|
-
"ar-EG": true,
|
|
59
|
-
"zh-CN": true,
|
|
60
|
-
},
|
|
61
|
-
default: "en-US",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
render: (values) => <CompactTimePickerDemo {...values} />,
|
|
65
|
-
childrenSnippet: ({ locale }) => ({
|
|
66
|
-
imports: ['import { useState } from "react"'],
|
|
67
|
-
setup: ['const [time, setTime] = useState("18:30")'],
|
|
68
|
-
children: "",
|
|
69
|
-
omit: ["locale"],
|
|
70
|
-
extraProps: { locale },
|
|
71
|
-
expressionProps: {
|
|
72
|
-
labels: '{ hour: "Hour", minute: "Minute", period: "AM or PM" }',
|
|
73
|
-
value: "time",
|
|
74
|
-
onChange: "setTime",
|
|
75
|
-
},
|
|
76
|
-
}),
|
|
77
|
-
usage: CompactTimePickerUsage,
|
|
78
|
-
showcase: CompactTimePickerShowcase,
|
|
79
|
-
examples: [],
|
|
80
|
-
})
|