@taicode/common-web 3.0.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/output/components/alert-dialog.d.ts +20 -0
- package/output/components/alert-dialog.d.ts.map +1 -0
- package/output/components/alert-dialog.js +65 -0
- package/output/components/alert.d.ts +11 -0
- package/output/components/alert.d.ts.map +1 -0
- package/output/components/alert.js +38 -0
- package/output/components/avatar.d.ts +13 -0
- package/output/components/avatar.d.ts.map +1 -0
- package/output/components/avatar.js +40 -0
- package/output/components/badge.d.ts +10 -0
- package/output/components/badge.d.ts.map +1 -0
- package/output/components/badge.js +31 -0
- package/output/components/button.d.ts +12 -0
- package/output/components/button.d.ts.map +1 -0
- package/output/components/button.js +44 -0
- package/output/components/card.d.ts +8 -0
- package/output/components/card.d.ts.map +1 -0
- package/output/components/card.js +38 -0
- package/output/components/checkbox.d.ts +5 -0
- package/output/components/checkbox.d.ts.map +1 -0
- package/output/components/checkbox.js +21 -0
- package/output/components/command.d.ts +20 -0
- package/output/components/command.d.ts.map +1 -0
- package/output/components/command.js +55 -0
- package/output/components/dialog.d.ts +20 -0
- package/output/components/dialog.d.ts.map +1 -0
- package/output/components/dialog.js +58 -0
- package/output/components/direction.d.ts +9 -0
- package/output/components/direction.d.ts.map +1 -0
- package/output/components/direction.js +10 -0
- package/output/components/dropdown-menu.d.ts +29 -0
- package/output/components/dropdown-menu.d.ts.map +1 -0
- package/output/components/dropdown-menu.js +78 -0
- package/output/components/field.d.ts +39 -0
- package/output/components/field.d.ts.map +1 -0
- package/output/components/field.js +102 -0
- package/output/components/index.d.ts +36 -0
- package/output/components/index.d.ts.map +1 -0
- package/output/components/index.js +35 -0
- package/output/components/input-group.d.ts +17 -0
- package/output/components/input-group.d.ts.map +1 -0
- package/output/components/input-group.js +75 -0
- package/output/components/input.d.ts +3 -0
- package/output/components/input.d.ts.map +1 -0
- package/output/components/input.js +19 -0
- package/output/components/item.d.ts +25 -0
- package/output/components/item.d.ts.map +1 -0
- package/output/components/item.js +89 -0
- package/output/components/json-view/index.d.ts +11 -0
- package/output/components/json-view/index.d.ts.map +1 -0
- package/output/components/json-view/index.js +52 -0
- package/output/components/kbd.d.ts +4 -0
- package/output/components/kbd.d.ts.map +1 -0
- package/output/components/kbd.js +22 -0
- package/output/components/label.d.ts +5 -0
- package/output/components/label.d.ts.map +1 -0
- package/output/components/label.js +20 -0
- package/output/{loading-button → components/loading-button}/index.d.ts +1 -1
- package/output/components/loading-button/index.d.ts.map +1 -0
- package/output/{loading-button → components/loading-button}/index.js +3 -7
- package/output/components/loading-button/index.test.d.ts.map +1 -0
- package/output/{loading-button → components/loading-button}/index.test.js +4 -4
- package/output/components/native-select.d.ts +9 -0
- package/output/components/native-select.d.ts.map +1 -0
- package/output/components/native-select.js +28 -0
- package/output/components/page-state.d.ts +19 -0
- package/output/components/page-state.d.ts.map +1 -0
- package/output/components/page-state.js +13 -0
- package/output/components/popover.d.ts +11 -0
- package/output/components/popover.d.ts.map +1 -0
- package/output/components/popover.js +44 -0
- package/output/components/progress.d.ts +5 -0
- package/output/components/progress.d.ts.map +1 -0
- package/output/components/progress.js +21 -0
- package/output/components/radio-group.d.ts +6 -0
- package/output/components/radio-group.d.ts.map +1 -0
- package/output/components/radio-group.js +25 -0
- package/output/components/scroll-area.d.ts +6 -0
- package/output/components/scroll-area.d.ts.map +1 -0
- package/output/components/scroll-area.js +24 -0
- package/output/components/select.d.ts +17 -0
- package/output/components/select.d.ts.map +1 -0
- package/output/components/select.js +58 -0
- package/output/components/separator.d.ts +6 -0
- package/output/components/separator.d.ts.map +1 -0
- package/output/components/separator.js +19 -0
- package/output/components/sheet.d.ts +16 -0
- package/output/components/sheet.d.ts.map +1 -0
- package/output/components/sheet.js +58 -0
- package/output/components/size-provider/index.d.ts +2 -0
- package/output/components/size-provider/index.d.ts.map +1 -0
- package/output/components/size-provider/index.js +1 -0
- package/output/{size-provider → components/size-provider}/size-provider.d.ts +1 -1
- package/output/components/size-provider/size-provider.d.ts.map +1 -0
- package/output/{size-provider → components/size-provider}/size-provider.js +1 -1
- package/output/components/skeleton.d.ts +3 -0
- package/output/components/skeleton.d.ts.map +1 -0
- package/output/{catalyst/divider.js → components/skeleton.js} +4 -4
- package/output/components/sonner.d.ts +8 -0
- package/output/components/sonner.d.ts.map +1 -0
- package/output/components/sonner.js +34 -0
- package/output/components/spinner.d.ts +3 -0
- package/output/components/spinner.d.ts.map +1 -0
- package/output/{catalyst/divider.jsx → components/spinner.js} +7 -4
- package/output/components/switch.d.ts +8 -0
- package/output/components/switch.d.ts.map +1 -0
- package/output/components/switch.js +20 -0
- package/output/components/table.d.ts +11 -0
- package/output/components/table.d.ts.map +1 -0
- package/output/components/table.js +47 -0
- package/output/components/tabs.d.ts +12 -0
- package/output/components/tabs.d.ts.map +1 -0
- package/output/components/tabs.js +45 -0
- package/output/components/textarea.d.ts +4 -0
- package/output/components/textarea.d.ts.map +1 -0
- package/output/components/textarea.js +19 -0
- package/output/components/theme-switcher.d.ts +6 -0
- package/output/components/theme-switcher.d.ts.map +1 -0
- package/output/components/theme-switcher.js +19 -0
- package/output/{toaster → components/toaster}/index.d.ts +1 -1
- package/output/components/toaster/index.d.ts.map +1 -0
- package/output/{toaster → components/toaster}/index.js +1 -1
- package/output/components/tooltip.d.ts +8 -0
- package/output/components/tooltip.d.ts.map +1 -0
- package/output/components/tooltip.js +33 -0
- package/output/features/confirm-dialog/index.d.ts +39 -0
- package/output/features/confirm-dialog/index.d.ts.map +1 -0
- package/output/features/confirm-dialog/index.js +19 -0
- package/output/features/input-confirm/index.d.ts +26 -0
- package/output/features/input-confirm/index.d.ts.map +1 -0
- package/output/features/input-confirm/index.js +59 -0
- package/output/{signin → features/signin}/context.d.ts +1 -2
- package/output/features/signin/context.d.ts.map +1 -0
- package/output/{signin → features/signin}/context.js +3 -3
- package/output/{signin → features/signin}/index.d.ts +4 -4
- package/output/features/signin/index.d.ts.map +1 -0
- package/output/{signin → features/signin}/index.js +9 -9
- package/output/{signin → features/signin}/service.d.ts +1 -1
- package/output/features/signin/service.d.ts.map +1 -0
- package/output/{signin → features/signin}/service.js +1 -4
- package/output/features/signin/service.test.d.ts.map +1 -0
- package/output/{signin → features/signin}/service.test.js +1 -1
- package/output/features/signin/types.d.ts.map +1 -0
- package/output/hooks/use-loading/index.d.ts +6 -0
- package/output/hooks/use-loading/index.d.ts.map +1 -0
- package/output/hooks/use-loading/index.js +14 -0
- package/output/hooks/use-loading/index.test.d.ts +2 -0
- package/output/hooks/use-loading/index.test.d.ts.map +1 -0
- package/output/hooks/use-loading/index.test.js +24 -0
- package/output/hooks/use-mobile/index.d.ts +2 -0
- package/output/hooks/use-mobile/index.d.ts.map +1 -0
- package/output/hooks/use-mobile/index.js +16 -0
- package/output/hooks/use-observer/index.d.ts +2 -0
- package/output/hooks/use-observer/index.d.ts.map +1 -0
- package/output/hooks/use-observer/index.js +1 -0
- package/output/hooks/use-observer/use-observer.d.ts.map +1 -0
- package/output/{helpers → hooks}/use-observer/use-observer.js +2 -2
- package/output/hooks/use-observer/use-observer.test.d.ts.map +1 -0
- package/output/{use-observer → hooks/use-observer}/use-observer.test.js +2 -2
- package/output/hooks/use-offline/index.d.ts +6 -0
- package/output/hooks/use-offline/index.d.ts.map +1 -0
- package/output/hooks/use-offline/index.js +19 -0
- package/output/layout/app/index.d.ts +34 -0
- package/output/layout/app/index.d.ts.map +1 -0
- package/output/layout/app/index.js +34 -0
- package/output/layout/dashboard/index.d.ts +58 -0
- package/output/layout/dashboard/index.d.ts.map +1 -0
- package/output/layout/dashboard/index.js +71 -0
- package/output/layout/index.d.ts +3 -0
- package/output/layout/index.d.ts.map +1 -0
- package/output/layout/index.js +2 -0
- package/output/services/cache-api/cache-api.d.ts.map +1 -0
- package/output/{cache-api → services/cache-api}/cache-api.js +1 -1
- package/output/services/cache-api/cache-api.test.d.ts.map +1 -0
- package/output/{cache-api → services/cache-api}/cache-api.test.js +1 -1
- package/output/services/cache-api/index.d.ts +2 -0
- package/output/services/cache-api/index.d.ts.map +1 -0
- package/output/services/cache-api/index.js +1 -0
- package/output/{service → services/service}/index.d.ts +1 -1
- package/output/services/service/index.d.ts.map +1 -0
- package/output/{service → services/service}/index.js +1 -1
- package/output/services/service/service.d.ts +135 -0
- package/output/services/service/service.d.ts.map +1 -0
- package/output/services/service/service.js +276 -0
- package/output/services/service/service.test.d.ts.map +1 -0
- package/output/{service → services/service}/service.test.js +1 -1
- package/output/services/side-cache/index.d.ts +2 -0
- package/output/services/side-cache/index.d.ts.map +1 -0
- package/output/services/side-cache/index.js +1 -0
- package/output/services/side-cache/side-cache.d.ts.map +1 -0
- package/output/services/side-cache/side-cache.test.d.ts.map +1 -0
- package/output/{side-cache → services/side-cache}/side-cache.test.js +1 -1
- package/output/utils/avatar/index.d.ts +28 -0
- package/output/utils/avatar/index.d.ts.map +1 -0
- package/output/utils/avatar/index.js +35 -0
- package/output/utils/cn/index.d.ts +3 -0
- package/output/utils/cn/index.d.ts.map +1 -0
- package/output/utils/cn/index.js +5 -0
- package/output/utils/cn/index.test.d.ts +2 -0
- package/output/utils/cn/index.test.d.ts.map +1 -0
- package/output/utils/cn/index.test.js +7 -0
- package/output/utils/delay/index.d.ts +2 -0
- package/output/utils/delay/index.d.ts.map +1 -0
- package/output/utils/delay/index.js +5 -0
- package/output/utils/form/index.d.ts +3 -0
- package/output/utils/form/index.d.ts.map +1 -0
- package/output/utils/form/index.js +1 -0
- package/output/utils/performance/index.d.ts +82 -0
- package/output/utils/performance/index.d.ts.map +1 -0
- package/output/utils/performance/index.js +129 -0
- package/output/utils/redirect/index.d.ts +6 -0
- package/output/utils/redirect/index.d.ts.map +1 -0
- package/output/utils/redirect/index.js +32 -0
- package/package.json +117 -28
- package/styles.css +123 -0
- package/output/cache-api/cache-api.d.ts.map +0 -1
- package/output/cache-api/cache-api.test.d.ts.map +0 -1
- package/output/cache-api/index.d.ts +0 -2
- package/output/cache-api/index.d.ts.map +0 -1
- package/output/cache-api/index.js +0 -1
- package/output/catalyst/alert.d.ts +0 -29
- package/output/catalyst/alert.d.ts.map +0 -1
- package/output/catalyst/alert.js +0 -46
- package/output/catalyst/alert.jsx +0 -55
- package/output/catalyst/auth-layout.d.ts +0 -5
- package/output/catalyst/auth-layout.d.ts.map +0 -1
- package/output/catalyst/auth-layout.js +0 -4
- package/output/catalyst/auth-layout.jsx +0 -7
- package/output/catalyst/avatar.d.ts +0 -16
- package/output/catalyst/avatar.d.ts.map +0 -1
- package/output/catalyst/avatar.js +0 -30
- package/output/catalyst/avatar.jsx +0 -45
- package/output/catalyst/badge.d.ts +0 -35
- package/output/catalyst/badge.d.ts.map +0 -1
- package/output/catalyst/badge.js +0 -46
- package/output/catalyst/badge.jsx +0 -53
- package/output/catalyst/button.d.ts +0 -59
- package/output/catalyst/button.d.ts.map +0 -1
- package/output/catalyst/button.js +0 -181
- package/output/catalyst/button.jsx +0 -187
- package/output/catalyst/checkbox.d.ts +0 -37
- package/output/catalyst/checkbox.d.ts.map +0 -1
- package/output/catalyst/checkbox.js +0 -97
- package/output/catalyst/checkbox.jsx +0 -105
- package/output/catalyst/combobox.d.ts +0 -20
- package/output/catalyst/combobox.d.ts.map +0 -1
- package/output/catalyst/combobox.js +0 -101
- package/output/catalyst/combobox.jsx +0 -120
- package/output/catalyst/description-list.d.ts +0 -4
- package/output/catalyst/description-list.d.ts.map +0 -1
- package/output/catalyst/description-list.js +0 -25
- package/output/catalyst/description-list.jsx +0 -24
- package/output/catalyst/dialog.d.ts +0 -29
- package/output/catalyst/dialog.d.ts.map +0 -1
- package/output/catalyst/dialog.js +0 -46
- package/output/catalyst/dialog.jsx +0 -55
- package/output/catalyst/divider.d.ts +0 -4
- package/output/catalyst/divider.d.ts.map +0 -1
- package/output/catalyst/dropdown.d.ts +0 -33
- package/output/catalyst/dropdown.d.ts.map +0 -1
- package/output/catalyst/dropdown.js +0 -99
- package/output/catalyst/dropdown.jsx +0 -102
- package/output/catalyst/fieldset.d.ts +0 -22
- package/output/catalyst/fieldset.d.ts.map +0 -1
- package/output/catalyst/fieldset.js +0 -42
- package/output/catalyst/fieldset.jsx +0 -41
- package/output/catalyst/heading.d.ts +0 -7
- package/output/catalyst/heading.d.ts.map +0 -1
- package/output/catalyst/heading.js +0 -23
- package/output/catalyst/heading.jsx +0 -22
- package/output/catalyst/input.d.ts +0 -11
- package/output/catalyst/input.d.ts.map +0 -1
- package/output/catalyst/input.js +0 -70
- package/output/catalyst/input.jsx +0 -73
- package/output/catalyst/link.d.ts +0 -13
- package/output/catalyst/link.d.ts.map +0 -1
- package/output/catalyst/link.js +0 -37
- package/output/catalyst/link.jsx +0 -14
- package/output/catalyst/listbox.d.ts +0 -16
- package/output/catalyst/listbox.d.ts.map +0 -1
- package/output/catalyst/listbox.js +0 -99
- package/output/catalyst/listbox.jsx +0 -120
- package/output/catalyst/navbar.d.ts +0 -16
- package/output/catalyst/navbar.d.ts.map +0 -1
- package/output/catalyst/navbar.js +0 -59
- package/output/catalyst/navbar.jsx +0 -67
- package/output/catalyst/pagination.d.ts +0 -18
- package/output/catalyst/pagination.d.ts.map +0 -1
- package/output/catalyst/pagination.js +0 -35
- package/output/catalyst/pagination.jsx +0 -52
- package/output/catalyst/radio.d.ts +0 -38
- package/output/catalyst/radio.d.ts.map +0 -1
- package/output/catalyst/radio.js +0 -100
- package/output/catalyst/radio.jsx +0 -103
- package/output/catalyst/select.d.ts +0 -6
- package/output/catalyst/select.d.ts.map +0 -1
- package/output/catalyst/select.js +0 -52
- package/output/catalyst/select.jsx +0 -59
- package/output/catalyst/sidebar-layout.d.ts +0 -6
- package/output/catalyst/sidebar-layout.d.ts.map +0 -1
- package/output/catalyst/sidebar-layout.js +0 -18
- package/output/catalyst/sidebar-layout.jsx +0 -58
- package/output/catalyst/sidebar.d.ts +0 -20
- package/output/catalyst/sidebar.d.ts.map +0 -1
- package/output/catalyst/sidebar.js +0 -77
- package/output/catalyst/sidebar.jsx +0 -85
- package/output/catalyst/stacked-layout.d.ts +0 -6
- package/output/catalyst/stacked-layout.d.ts.map +0 -1
- package/output/catalyst/stacked-layout.js +0 -18
- package/output/catalyst/stacked-layout.jsx +0 -55
- package/output/catalyst/switch.d.ts +0 -37
- package/output/catalyst/switch.d.ts.map +0 -1
- package/output/catalyst/switch.js +0 -160
- package/output/catalyst/switch.jsx +0 -161
- package/output/catalyst/table.d.ts +0 -17
- package/output/catalyst/table.d.ts.map +0 -1
- package/output/catalyst/table.js +0 -56
- package/output/catalyst/table.jsx +0 -68
- package/output/catalyst/text.d.ts +0 -6
- package/output/catalyst/text.d.ts.map +0 -1
- package/output/catalyst/text.js +0 -30
- package/output/catalyst/text.jsx +0 -29
- package/output/catalyst/textarea.d.ts +0 -7
- package/output/catalyst/textarea.d.ts.map +0 -1
- package/output/catalyst/textarea.js +0 -48
- package/output/catalyst/textarea.jsx +0 -49
- package/output/catalyst-config/catalyst-config.d.ts +0 -14
- package/output/catalyst-config/catalyst-config.d.ts.map +0 -1
- package/output/catalyst-config/catalyst-config.js +0 -14
- package/output/catalyst-config/index.d.ts +0 -3
- package/output/catalyst-config/index.d.ts.map +0 -1
- package/output/catalyst-config/index.js +0 -1
- package/output/helpers/cache-api/cache-api.d.ts +0 -13
- package/output/helpers/cache-api/cache-api.d.ts.map +0 -1
- package/output/helpers/cache-api/cache-api.js +0 -114
- package/output/helpers/cache-api/cache-api.test.d.ts +0 -2
- package/output/helpers/cache-api/cache-api.test.d.ts.map +0 -1
- package/output/helpers/cache-api/cache-api.test.js +0 -348
- package/output/helpers/cache-api/index.d.ts +0 -2
- package/output/helpers/cache-api/index.d.ts.map +0 -1
- package/output/helpers/cache-api/index.js +0 -1
- package/output/helpers/service/index.d.ts +0 -1
- package/output/helpers/service/index.d.ts.map +0 -1
- package/output/helpers/service/index.js +0 -1
- package/output/helpers/service/service.d.ts +0 -5
- package/output/helpers/service/service.d.ts.map +0 -1
- package/output/helpers/service/service.js +0 -2
- package/output/helpers/side-cache/index.d.ts +0 -2
- package/output/helpers/side-cache/index.d.ts.map +0 -1
- package/output/helpers/side-cache/index.js +0 -1
- package/output/helpers/side-cache/side-cache.d.ts +0 -10
- package/output/helpers/side-cache/side-cache.d.ts.map +0 -1
- package/output/helpers/side-cache/side-cache.js +0 -137
- package/output/helpers/side-cache/side-cache.test.d.ts.map +0 -1
- package/output/helpers/side-cache/side-cache.test.js +0 -179
- package/output/helpers/use-observer/index.d.ts +0 -2
- package/output/helpers/use-observer/index.d.ts.map +0 -1
- package/output/helpers/use-observer/index.js +0 -1
- package/output/helpers/use-observer/use-observer.d.ts.map +0 -1
- package/output/helpers/use-observer/use-observer.test.d.ts.map +0 -1
- package/output/helpers/use-observer/use-observer.test.jsx +0 -134
- package/output/loading-button/index.d.ts.map +0 -1
- package/output/loading-button/index.test.d.ts.map +0 -1
- package/output/service/index.d.ts.map +0 -1
- package/output/service/service.d.ts +0 -286
- package/output/service/service.d.ts.map +0 -1
- package/output/service/service.js +0 -351
- package/output/service/service.test.d.ts.map +0 -1
- package/output/service/service.test.jsx +0 -367
- package/output/side-cache/index.d.ts +0 -2
- package/output/side-cache/index.d.ts.map +0 -1
- package/output/side-cache/index.js +0 -1
- package/output/side-cache/side-cache.d.ts.map +0 -1
- package/output/side-cache/side-cache.test.d.ts +0 -2
- package/output/side-cache/side-cache.test.d.ts.map +0 -1
- package/output/signin/context.d.ts.map +0 -1
- package/output/signin/index.d.ts.map +0 -1
- package/output/signin/service.d.ts.map +0 -1
- package/output/signin/service.test.d.ts.map +0 -1
- package/output/signin/types.d.ts.map +0 -1
- package/output/size-provider/index.d.ts +0 -2
- package/output/size-provider/index.d.ts.map +0 -1
- package/output/size-provider/index.js +0 -1
- package/output/size-provider/size-provider.d.ts.map +0 -1
- package/output/toaster/index.d.ts.map +0 -1
- package/output/use-observer/index.d.ts +0 -2
- package/output/use-observer/index.d.ts.map +0 -1
- package/output/use-observer/index.js +0 -1
- package/output/use-observer/use-observer.d.ts +0 -3
- package/output/use-observer/use-observer.d.ts.map +0 -1
- package/output/use-observer/use-observer.js +0 -16
- package/output/use-observer/use-observer.test.d.ts +0 -2
- package/output/use-observer/use-observer.test.d.ts.map +0 -1
- package/output/use-observer/use-observer.test.jsx +0 -134
- /package/output/{loading-button → components/loading-button}/index.test.d.ts +0 -0
- /package/output/{service → features/signin}/service.test.d.ts +0 -0
- /package/output/{signin → features/signin}/types.d.ts +0 -0
- /package/output/{signin → features/signin}/types.js +0 -0
- /package/output/{helpers → hooks}/use-observer/use-observer.d.ts +0 -0
- /package/output/{helpers → hooks}/use-observer/use-observer.test.d.ts +0 -0
- /package/output/{cache-api → services/cache-api}/cache-api.d.ts +0 -0
- /package/output/{cache-api → services/cache-api}/cache-api.test.d.ts +0 -0
- /package/output/{signin → services/service}/service.test.d.ts +0 -0
- /package/output/{side-cache → services/side-cache}/side-cache.d.ts +0 -0
- /package/output/{side-cache → services/side-cache}/side-cache.js +0 -0
- /package/output/{helpers → services}/side-cache/side-cache.test.d.ts +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import * as Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { useState } from 'react';
|
|
16
|
-
export function Combobox(_a) {
|
|
17
|
-
var { options, displayValue, filter, anchor = 'bottom', className, placeholder, autoFocus, 'aria-label': ariaLabel, children } = _a, props = __rest(_a, ["options", "displayValue", "filter", "anchor", "className", "placeholder", "autoFocus", 'aria-label', "children"]);
|
|
18
|
-
const [query, setQuery] = useState('');
|
|
19
|
-
const filteredOptions = query === ''
|
|
20
|
-
? options
|
|
21
|
-
: options.filter((option) => { var _a; return filter ? filter(option, query) : (_a = displayValue(option)) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(query.toLowerCase()); });
|
|
22
|
-
return (<Headless.Combobox {...props} multiple={false} virtual={{ options: filteredOptions }} onClose={() => setQuery('')}>
|
|
23
|
-
<span data-slot="control" className={clsx([
|
|
24
|
-
className,
|
|
25
|
-
// Basic layout
|
|
26
|
-
'relative block w-full',
|
|
27
|
-
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
28
|
-
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
29
|
-
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
30
|
-
'dark:before:hidden',
|
|
31
|
-
// Focus ring
|
|
32
|
-
'after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-transparent after:ring-inset sm:focus-within:after:ring-2 sm:focus-within:after:ring-blue-500',
|
|
33
|
-
// Disabled state
|
|
34
|
-
'has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none',
|
|
35
|
-
// Invalid state
|
|
36
|
-
'has-data-invalid:before:shadow-red-500/10',
|
|
37
|
-
])}>
|
|
38
|
-
<Headless.ComboboxInput autoFocus={autoFocus} data-slot="control" aria-label={ariaLabel} displayValue={(option) => { var _a; return (_a = displayValue(option)) !== null && _a !== void 0 ? _a : ''; }} onChange={(event) => setQuery(event.target.value)} placeholder={placeholder} className={clsx([
|
|
39
|
-
className,
|
|
40
|
-
// Basic layout
|
|
41
|
-
'relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]',
|
|
42
|
-
// Horizontal padding
|
|
43
|
-
'pr-[calc(--spacing(10)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pr-[calc(--spacing(9)-1px)] sm:pl-[calc(--spacing(3)-1px)]',
|
|
44
|
-
// Typography
|
|
45
|
-
'text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white',
|
|
46
|
-
// Border
|
|
47
|
-
'border border-zinc-950/10 data-hover:border-zinc-950/20 dark:border-white/10 dark:data-hover:border-white/20',
|
|
48
|
-
// Background color
|
|
49
|
-
'bg-transparent dark:bg-white/5',
|
|
50
|
-
// Hide default focus styles
|
|
51
|
-
'focus:outline-hidden',
|
|
52
|
-
// Invalid state
|
|
53
|
-
'data-invalid:border-red-500 data-invalid:data-hover:border-red-500 dark:data-invalid:border-red-500 dark:data-invalid:data-hover:border-red-500',
|
|
54
|
-
// Disabled state
|
|
55
|
-
'data-disabled:border-zinc-950/20 dark:data-disabled:border-white/15 dark:data-disabled:bg-white/2.5 dark:data-hover:data-disabled:border-white/15',
|
|
56
|
-
// System icons
|
|
57
|
-
'dark:scheme-dark',
|
|
58
|
-
])}/>
|
|
59
|
-
<Headless.ComboboxButton className="group absolute inset-y-0 right-0 flex items-center px-2">
|
|
60
|
-
<svg className="size-5 stroke-zinc-500 group-data-disabled:stroke-zinc-600 group-data-hover:stroke-zinc-700 sm:size-4 dark:stroke-zinc-400 dark:group-data-hover:stroke-zinc-300 forced-colors:stroke-[CanvasText]" viewBox="0 0 16 16" aria-hidden="true" fill="none">
|
|
61
|
-
<path d="M5.75 10.75L8 13L10.25 10.75" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
|
|
62
|
-
<path d="M10.25 5.25L8 3L5.75 5.25" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
|
|
63
|
-
</svg>
|
|
64
|
-
</Headless.ComboboxButton>
|
|
65
|
-
</span>
|
|
66
|
-
<Headless.ComboboxOptions transition anchor={anchor} className={clsx(
|
|
67
|
-
// Anchor positioning
|
|
68
|
-
'[--anchor-gap:--spacing(2)] [--anchor-padding:--spacing(4)] sm:data-[anchor~=start]:[--anchor-offset:-4px]',
|
|
69
|
-
// Base styles,
|
|
70
|
-
'isolate min-w-[calc(var(--input-width)+8px)] scroll-py-1 rounded-xl p-1 select-none empty:invisible',
|
|
71
|
-
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
|
|
72
|
-
'outline outline-transparent focus:outline-hidden',
|
|
73
|
-
// Handle scrolling when menu won't fit in viewport
|
|
74
|
-
'overflow-y-scroll overscroll-contain',
|
|
75
|
-
// Popover background
|
|
76
|
-
'bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75',
|
|
77
|
-
// Shadows
|
|
78
|
-
'shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset',
|
|
79
|
-
// Transitions
|
|
80
|
-
'transition-opacity duration-100 ease-in data-closed:data-leave:opacity-0 data-transition:pointer-events-none')}>
|
|
81
|
-
{({ option }) => children(option)}
|
|
82
|
-
</Headless.ComboboxOptions>
|
|
83
|
-
</Headless.Combobox>);
|
|
84
|
-
}
|
|
85
|
-
export function ComboboxOption(_a) {
|
|
86
|
-
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
|
87
|
-
let sharedClasses = clsx(
|
|
88
|
-
// Base
|
|
89
|
-
'flex min-w-0 items-center',
|
|
90
|
-
// Icons
|
|
91
|
-
'*:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 sm:*:data-[slot=icon]:size-4', '*:data-[slot=icon]:text-zinc-500 group-data-focus/option:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400', 'forced-colors:*:data-[slot=icon]:text-[CanvasText] forced-colors:group-data-focus/option:*:data-[slot=icon]:text-[Canvas]',
|
|
92
|
-
// Avatars
|
|
93
|
-
'*:data-[slot=avatar]:-mx-0.5 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:size-5');
|
|
94
|
-
return (<Headless.ComboboxOption {...props} className={clsx(
|
|
95
|
-
// Basic layout
|
|
96
|
-
'group/option grid w-full cursor-default grid-cols-[1fr_--spacing(5)] items-baseline gap-x-2 rounded-lg py-2.5 pr-2 pl-3.5 sm:grid-cols-[1fr_--spacing(4)] sm:py-1.5 sm:pr-2 sm:pl-3',
|
|
97
|
-
// Typography
|
|
98
|
-
'text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
99
|
-
// Focus
|
|
100
|
-
'outline-hidden data-focus:bg-blue-500 data-focus:text-white',
|
|
101
|
-
// Forced colors mode
|
|
102
|
-
'forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText]',
|
|
103
|
-
// Disabled
|
|
104
|
-
'data-disabled:opacity-50')}>
|
|
105
|
-
<span className={clsx(className, sharedClasses)}>{children}</span>
|
|
106
|
-
<svg className="relative col-start-2 hidden size-5 self-center stroke-current group-data-selected/option:inline sm:size-4" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
107
|
-
<path d="M4 8.5l3 3L12 4" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
|
|
108
|
-
</svg>
|
|
109
|
-
</Headless.ComboboxOption>);
|
|
110
|
-
}
|
|
111
|
-
export function ComboboxLabel(_a) {
|
|
112
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
113
|
-
return <span {...props} className={clsx(className, 'ml-2.5 truncate first:ml-0 sm:ml-2 sm:first:ml-0')}/>;
|
|
114
|
-
}
|
|
115
|
-
export function ComboboxDescription(_a) {
|
|
116
|
-
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
117
|
-
return (<span {...props} className={clsx(className, 'flex flex-1 overflow-hidden text-zinc-500 group-data-focus/option:text-white before:w-2 before:min-w-0 before:shrink dark:text-zinc-400')}>
|
|
118
|
-
<span className="flex-1 truncate">{children}</span>
|
|
119
|
-
</span>);
|
|
120
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function DescriptionList({ className, ...props }: React.ComponentPropsWithoutRef<'dl'>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
export declare function DescriptionTerm({ className, ...props }: React.ComponentPropsWithoutRef<'dt'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare function DescriptionDetails({ className, ...props }: React.ComponentPropsWithoutRef<'dd'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
//# sourceMappingURL=description-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"description-list.d.ts","sourceRoot":"","sources":["../../source/catalyst/description-list.tsx"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAU5F;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAU5F;AAED,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAU/F"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import clsx from 'clsx';
|
|
14
|
-
export function DescriptionList(_a) {
|
|
15
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
-
return (_jsx("dl", Object.assign({}, props, { className: clsx(className, 'grid grid-cols-1 text-base/6 sm:grid-cols-[min(50%,--spacing(80))_auto] sm:text-sm/6') })));
|
|
17
|
-
}
|
|
18
|
-
export function DescriptionTerm(_a) {
|
|
19
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
20
|
-
return (_jsx("dt", Object.assign({}, props, { className: clsx(className, 'col-start-1 border-t border-zinc-950/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:py-3 dark:border-white/5 dark:text-zinc-400 sm:dark:border-white/5') })));
|
|
21
|
-
}
|
|
22
|
-
export function DescriptionDetails(_a) {
|
|
23
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
-
return (_jsx("dd", Object.assign({}, props, { className: clsx(className, 'pt-1 pb-3 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:py-3 sm:nth-2:border-none dark:text-white dark:sm:border-white/5') })));
|
|
25
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import clsx from 'clsx';
|
|
13
|
-
export function DescriptionList(_a) {
|
|
14
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
15
|
-
return (<dl {...props} className={clsx(className, 'grid grid-cols-1 text-base/6 sm:grid-cols-[min(50%,--spacing(80))_auto] sm:text-sm/6')}/>);
|
|
16
|
-
}
|
|
17
|
-
export function DescriptionTerm(_a) {
|
|
18
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
-
return (<dt {...props} className={clsx(className, 'col-start-1 border-t border-zinc-950/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:py-3 dark:border-white/5 dark:text-zinc-400 sm:dark:border-white/5')}/>);
|
|
20
|
-
}
|
|
21
|
-
export function DescriptionDetails(_a) {
|
|
22
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
-
return (<dd {...props} className={clsx(className, 'pt-1 pb-3 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:py-3 sm:nth-2:border-none dark:text-white dark:sm:border-white/5')}/>);
|
|
24
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import { Text } from './text';
|
|
4
|
-
declare const sizes: {
|
|
5
|
-
xs: string;
|
|
6
|
-
sm: string;
|
|
7
|
-
md: string;
|
|
8
|
-
lg: string;
|
|
9
|
-
xl: string;
|
|
10
|
-
'2xl': string;
|
|
11
|
-
'3xl': string;
|
|
12
|
-
'4xl': string;
|
|
13
|
-
'5xl': string;
|
|
14
|
-
};
|
|
15
|
-
export declare function Dialog({ size, className, children, ...props }: {
|
|
16
|
-
size?: keyof typeof sizes;
|
|
17
|
-
className?: string;
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
} & Omit<Headless.DialogProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export declare function DialogTitle({ className, ...props }: {
|
|
21
|
-
className?: string;
|
|
22
|
-
} & Omit<Headless.DialogTitleProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare function DialogDescription({ className, ...props }: {
|
|
24
|
-
className?: string;
|
|
25
|
-
} & Omit<Headless.DescriptionProps<typeof Text>, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare function DialogBody({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare function DialogActions({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../source/catalyst/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,KAAK;;;;;;;;;;CAUV,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAW,EACX,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,IAAI,CACpF,QAAQ,CAAC,WAAW,EACpB,IAAI,GAAG,WAAW,CACnB,2CAyBA;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAO9E;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,2CAE3F;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAExF;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAU3F"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { Text } from './text';
|
|
16
|
-
const sizes = {
|
|
17
|
-
xs: 'sm:max-w-xs',
|
|
18
|
-
sm: 'sm:max-w-sm',
|
|
19
|
-
md: 'sm:max-w-md',
|
|
20
|
-
lg: 'sm:max-w-lg',
|
|
21
|
-
xl: 'sm:max-w-xl',
|
|
22
|
-
'2xl': 'sm:max-w-2xl',
|
|
23
|
-
'3xl': 'sm:max-w-3xl',
|
|
24
|
-
'4xl': 'sm:max-w-4xl',
|
|
25
|
-
'5xl': 'sm:max-w-5xl',
|
|
26
|
-
};
|
|
27
|
-
export function Dialog(_a) {
|
|
28
|
-
var { size = 'lg', className, children } = _a, props = __rest(_a, ["size", "className", "children"]);
|
|
29
|
-
return (_jsxs(Headless.Dialog, Object.assign({}, props, { children: [_jsx(Headless.DialogBackdrop, { transition: true, className: "fixed inset-0 flex w-screen justify-center overflow-y-auto bg-zinc-950/25 px-2 py-2 transition duration-100 focus:outline-0 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:px-6 sm:py-8 lg:px-8 lg:py-16 dark:bg-zinc-950/50" }), _jsx("div", { className: "fixed inset-0 w-screen overflow-y-auto pt-6 sm:pt-0", children: _jsx("div", { className: "grid min-h-full grid-rows-[1fr_auto] justify-items-center sm:grid-rows-[1fr_auto_3fr] sm:p-4", children: _jsx(Headless.DialogPanel, { transition: true, className: clsx(className, sizes[size], 'row-start-2 w-full min-w-0 rounded-t-3xl bg-white p-(--gutter) shadow-lg ring-1 ring-zinc-950/10 [--gutter:--spacing(8)] sm:mb-auto sm:rounded-2xl dark:bg-zinc-900 dark:ring-white/10 forced-colors:outline', 'transition duration-100 will-change-transform data-closed:translate-y-12 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:data-closed:translate-y-0 sm:data-closed:data-enter:scale-95'), children: children }) }) })] })));
|
|
30
|
-
}
|
|
31
|
-
export function DialogTitle(_a) {
|
|
32
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
-
return (_jsx(Headless.DialogTitle, Object.assign({}, props, { className: clsx(className, 'text-lg/6 font-semibold text-balance text-zinc-950 sm:text-base/6 dark:text-white') })));
|
|
34
|
-
}
|
|
35
|
-
export function DialogDescription(_a) {
|
|
36
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
-
return _jsx(Headless.Description, Object.assign({ as: Text }, props, { className: clsx(className, 'mt-2 text-pretty') }));
|
|
38
|
-
}
|
|
39
|
-
export function DialogBody(_a) {
|
|
40
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
-
return _jsx("div", Object.assign({}, props, { className: clsx(className, 'mt-6') }));
|
|
42
|
-
}
|
|
43
|
-
export function DialogActions(_a) {
|
|
44
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
45
|
-
return (_jsx("div", Object.assign({}, props, { className: clsx(className, 'mt-8 flex flex-col-reverse items-center justify-end gap-3 *:w-full sm:flex-row sm:*:w-auto') })));
|
|
46
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as Headless from '@headlessui/react';
|
|
13
|
-
import clsx from 'clsx';
|
|
14
|
-
import { Text } from './text';
|
|
15
|
-
const sizes = {
|
|
16
|
-
xs: 'sm:max-w-xs',
|
|
17
|
-
sm: 'sm:max-w-sm',
|
|
18
|
-
md: 'sm:max-w-md',
|
|
19
|
-
lg: 'sm:max-w-lg',
|
|
20
|
-
xl: 'sm:max-w-xl',
|
|
21
|
-
'2xl': 'sm:max-w-2xl',
|
|
22
|
-
'3xl': 'sm:max-w-3xl',
|
|
23
|
-
'4xl': 'sm:max-w-4xl',
|
|
24
|
-
'5xl': 'sm:max-w-5xl',
|
|
25
|
-
};
|
|
26
|
-
export function Dialog(_a) {
|
|
27
|
-
var { size = 'lg', className, children } = _a, props = __rest(_a, ["size", "className", "children"]);
|
|
28
|
-
return (<Headless.Dialog {...props}>
|
|
29
|
-
<Headless.DialogBackdrop transition className="fixed inset-0 flex w-screen justify-center overflow-y-auto bg-zinc-950/25 px-2 py-2 transition duration-100 focus:outline-0 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:px-6 sm:py-8 lg:px-8 lg:py-16 dark:bg-zinc-950/50"/>
|
|
30
|
-
|
|
31
|
-
<div className="fixed inset-0 w-screen overflow-y-auto pt-6 sm:pt-0">
|
|
32
|
-
<div className="grid min-h-full grid-rows-[1fr_auto] justify-items-center sm:grid-rows-[1fr_auto_3fr] sm:p-4">
|
|
33
|
-
<Headless.DialogPanel transition className={clsx(className, sizes[size], 'row-start-2 w-full min-w-0 rounded-t-3xl bg-white p-(--gutter) shadow-lg ring-1 ring-zinc-950/10 [--gutter:--spacing(8)] sm:mb-auto sm:rounded-2xl dark:bg-zinc-900 dark:ring-white/10 forced-colors:outline', 'transition duration-100 will-change-transform data-closed:translate-y-12 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:data-closed:translate-y-0 sm:data-closed:data-enter:scale-95')}>
|
|
34
|
-
{children}
|
|
35
|
-
</Headless.DialogPanel>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</Headless.Dialog>);
|
|
39
|
-
}
|
|
40
|
-
export function DialogTitle(_a) {
|
|
41
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
42
|
-
return (<Headless.DialogTitle {...props} className={clsx(className, 'text-lg/6 font-semibold text-balance text-zinc-950 sm:text-base/6 dark:text-white')}/>);
|
|
43
|
-
}
|
|
44
|
-
export function DialogDescription(_a) {
|
|
45
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
46
|
-
return <Headless.Description as={Text} {...props} className={clsx(className, 'mt-2 text-pretty')}/>;
|
|
47
|
-
}
|
|
48
|
-
export function DialogBody(_a) {
|
|
49
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
50
|
-
return <div {...props} className={clsx(className, 'mt-6')}/>;
|
|
51
|
-
}
|
|
52
|
-
export function DialogActions(_a) {
|
|
53
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
-
return (<div {...props} className={clsx(className, 'mt-8 flex flex-col-reverse items-center justify-end gap-3 *:w-full sm:flex-row sm:*:w-auto')}/>);
|
|
55
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../source/catalyst/divider.tsx"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,EACtB,IAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAa3D"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import { Button } from './button';
|
|
4
|
-
import { Link } from './link';
|
|
5
|
-
export declare function Dropdown(props: Headless.MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare function DropdownButton<T extends React.ElementType = typeof Button>({ as, ...props }: {
|
|
7
|
-
className?: string;
|
|
8
|
-
} & Omit<Headless.MenuButtonProps<T>, 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function DropdownMenu({ anchor, className, ...props }: {
|
|
10
|
-
className?: string;
|
|
11
|
-
} & Omit<Headless.MenuItemsProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare function DropdownItem({ className, ...props }: {
|
|
13
|
-
className?: string;
|
|
14
|
-
} & (Omit<Headless.MenuItemProps<'button'>, 'as' | 'className'> | Omit<Headless.MenuItemProps<typeof Link>, 'as' | 'className'>)): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function DropdownHeader({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function DropdownSection({ className, ...props }: {
|
|
17
|
-
className?: string;
|
|
18
|
-
} & Omit<Headless.MenuSectionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare function DropdownHeading({ className, ...props }: {
|
|
20
|
-
className?: string;
|
|
21
|
-
} & Omit<Headless.MenuHeadingProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare function DropdownDivider({ className, ...props }: {
|
|
23
|
-
className?: string;
|
|
24
|
-
} & Omit<Headless.MenuSeparatorProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare function DropdownLabel({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare function DropdownDescription({ className, ...props }: {
|
|
27
|
-
className?: string;
|
|
28
|
-
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export declare function DropdownShortcut({ keys, className, ...props }: {
|
|
30
|
-
keys: string | string[];
|
|
31
|
-
className?: string;
|
|
32
|
-
} & Omit<Headless.DescriptionProps<'kbd'>, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../source/catalyst/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,2CAEjD;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,OAAO,MAAM,EAAE,EAC1E,EAAW,EACX,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,2CAEzE;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,GAAG,WAAW,CAAC,2CA2B5E;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CACxB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,GAC1D,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,CAChE,2CA2BA;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAE5F;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAW9E;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAU9E;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAUhF;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAE3F;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAW9E;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,2CAqB9G"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import * as Headless from '@headlessui/react';
|
|
15
|
-
import clsx from 'clsx';
|
|
16
|
-
import { Button } from './button';
|
|
17
|
-
import { Link } from './link';
|
|
18
|
-
export function Dropdown(props) {
|
|
19
|
-
return _jsx(Headless.Menu, Object.assign({}, props));
|
|
20
|
-
}
|
|
21
|
-
export function DropdownButton(_a) {
|
|
22
|
-
var { as = Button } = _a, props = __rest(_a, ["as"]);
|
|
23
|
-
return _jsx(Headless.MenuButton, Object.assign({ as: as }, props));
|
|
24
|
-
}
|
|
25
|
-
export function DropdownMenu(_a) {
|
|
26
|
-
var { anchor = 'bottom', className } = _a, props = __rest(_a, ["anchor", "className"]);
|
|
27
|
-
return (_jsx(Headless.MenuItems, Object.assign({}, props, { transition: true, anchor: anchor, className: clsx(className,
|
|
28
|
-
// Anchor positioning
|
|
29
|
-
'[--anchor-gap:--spacing(2)] [--anchor-padding:--spacing(1)] data-[anchor~=end]:[--anchor-offset:6px] data-[anchor~=start]:[--anchor-offset:-6px] sm:data-[anchor~=end]:[--anchor-offset:4px] sm:data-[anchor~=start]:[--anchor-offset:-4px]',
|
|
30
|
-
// Base styles
|
|
31
|
-
'isolate w-max rounded-xl p-1',
|
|
32
|
-
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
|
|
33
|
-
'outline outline-transparent focus:outline-hidden',
|
|
34
|
-
// Handle scrolling when menu won't fit in viewport
|
|
35
|
-
'overflow-y-auto',
|
|
36
|
-
// Popover background
|
|
37
|
-
'bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75',
|
|
38
|
-
// Shadows
|
|
39
|
-
'shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset',
|
|
40
|
-
// Define grid at the menu level if subgrid is supported
|
|
41
|
-
'supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]',
|
|
42
|
-
// Transitions
|
|
43
|
-
'transition data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0') })));
|
|
44
|
-
}
|
|
45
|
-
export function DropdownItem(_a) {
|
|
46
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
47
|
-
let classes = clsx(className,
|
|
48
|
-
// Base styles
|
|
49
|
-
'group cursor-default rounded-lg px-3.5 py-2.5 focus:outline-hidden sm:px-3 sm:py-1.5',
|
|
50
|
-
// Text styles
|
|
51
|
-
'text-left text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
52
|
-
// Focus
|
|
53
|
-
'data-focus:bg-blue-500 data-focus:text-white',
|
|
54
|
-
// Disabled state
|
|
55
|
-
'data-disabled:opacity-50',
|
|
56
|
-
// Forced colors mode
|
|
57
|
-
'forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText] forced-colors:data-focus:*:data-[slot=icon]:text-[HighlightText]',
|
|
58
|
-
// Use subgrid when available but fallback to an explicit grid layout if not
|
|
59
|
-
'col-span-full grid grid-cols-[auto_1fr_1.5rem_0.5rem_auto] items-center supports-[grid-template-columns:subgrid]:grid-cols-subgrid',
|
|
60
|
-
// Icons
|
|
61
|
-
'*:data-[slot=icon]:col-start-1 *:data-[slot=icon]:row-start-1 *:data-[slot=icon]:mr-2.5 *:data-[slot=icon]:-ml-0.5 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:mr-2 sm:*:data-[slot=icon]:size-4', '*:data-[slot=icon]:text-zinc-500 data-focus:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400 dark:data-focus:*:data-[slot=icon]:text-white',
|
|
62
|
-
// Avatar
|
|
63
|
-
'*:data-[slot=avatar]:mr-2.5 *:data-[slot=avatar]:-ml-1 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:mr-2 sm:*:data-[slot=avatar]:size-5');
|
|
64
|
-
return 'href' in props ? (_jsx(Headless.MenuItem, Object.assign({ as: Link }, props, { className: classes }))) : (_jsx(Headless.MenuItem, Object.assign({ as: "button", type: "button" }, props, { className: classes })));
|
|
65
|
-
}
|
|
66
|
-
export function DropdownHeader(_a) {
|
|
67
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
68
|
-
return _jsx("div", Object.assign({}, props, { className: clsx(className, 'col-span-5 px-3.5 pt-2.5 pb-1 sm:px-3') }));
|
|
69
|
-
}
|
|
70
|
-
export function DropdownSection(_a) {
|
|
71
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
72
|
-
return (_jsx(Headless.MenuSection, Object.assign({}, props, { className: clsx(className,
|
|
73
|
-
// Define grid at the section level instead of the item level if subgrid is supported
|
|
74
|
-
'col-span-full supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]') })));
|
|
75
|
-
}
|
|
76
|
-
export function DropdownHeading(_a) {
|
|
77
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
78
|
-
return (_jsx(Headless.MenuHeading, Object.assign({}, props, { className: clsx(className, 'col-span-full grid grid-cols-[1fr_auto] gap-x-12 px-3.5 pt-2 pb-1 text-sm/5 font-medium text-zinc-500 sm:px-3 sm:text-xs/5 dark:text-zinc-400') })));
|
|
79
|
-
}
|
|
80
|
-
export function DropdownDivider(_a) {
|
|
81
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
82
|
-
return (_jsx(Headless.MenuSeparator, Object.assign({}, props, { className: clsx(className, 'col-span-full mx-3.5 my-1 h-px border-0 bg-zinc-950/5 sm:mx-3 dark:bg-white/10 forced-colors:bg-[CanvasText]') })));
|
|
83
|
-
}
|
|
84
|
-
export function DropdownLabel(_a) {
|
|
85
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
86
|
-
return _jsx("div", Object.assign({}, props, { "data-slot": "label", className: clsx(className, 'col-start-2 row-start-1') }, props));
|
|
87
|
-
}
|
|
88
|
-
export function DropdownDescription(_a) {
|
|
89
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
90
|
-
return (_jsx(Headless.Description, Object.assign({ "data-slot": "description" }, props, { className: clsx(className, 'col-span-2 col-start-2 row-start-2 text-sm/5 text-zinc-500 group-data-focus:text-white sm:text-xs/5 dark:text-zinc-400 forced-colors:group-data-focus:text-[HighlightText]') })));
|
|
91
|
-
}
|
|
92
|
-
export function DropdownShortcut(_a) {
|
|
93
|
-
var { keys, className } = _a, props = __rest(_a, ["keys", "className"]);
|
|
94
|
-
return (_jsx(Headless.Description, Object.assign({ as: "kbd" }, props, { className: clsx(className, 'col-start-5 row-start-1 flex justify-self-end'), children: (Array.isArray(keys) ? keys : keys.split('')).map((char, index) => (_jsx("kbd", { className: clsx([
|
|
95
|
-
'min-w-[2ch] text-center font-sans text-zinc-400 capitalize group-data-focus:text-white forced-colors:group-data-focus:text-[HighlightText]',
|
|
96
|
-
// Make sure key names that are longer than one character (like "Tab") have extra space
|
|
97
|
-
index > 0 && char.length > 1 && 'pl-1',
|
|
98
|
-
]), children: char }, index))) })));
|
|
99
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import * as Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { Button } from './button';
|
|
16
|
-
import { Link } from './link';
|
|
17
|
-
export function Dropdown(props) {
|
|
18
|
-
return <Headless.Menu {...props}/>;
|
|
19
|
-
}
|
|
20
|
-
export function DropdownButton(_a) {
|
|
21
|
-
var { as = Button } = _a, props = __rest(_a, ["as"]);
|
|
22
|
-
return <Headless.MenuButton as={as} {...props}/>;
|
|
23
|
-
}
|
|
24
|
-
export function DropdownMenu(_a) {
|
|
25
|
-
var { anchor = 'bottom', className } = _a, props = __rest(_a, ["anchor", "className"]);
|
|
26
|
-
return (<Headless.MenuItems {...props} transition anchor={anchor} className={clsx(className,
|
|
27
|
-
// Anchor positioning
|
|
28
|
-
'[--anchor-gap:--spacing(2)] [--anchor-padding:--spacing(1)] data-[anchor~=end]:[--anchor-offset:6px] data-[anchor~=start]:[--anchor-offset:-6px] sm:data-[anchor~=end]:[--anchor-offset:4px] sm:data-[anchor~=start]:[--anchor-offset:-4px]',
|
|
29
|
-
// Base styles
|
|
30
|
-
'isolate w-max rounded-xl p-1',
|
|
31
|
-
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
|
|
32
|
-
'outline outline-transparent focus:outline-hidden',
|
|
33
|
-
// Handle scrolling when menu won't fit in viewport
|
|
34
|
-
'overflow-y-auto',
|
|
35
|
-
// Popover background
|
|
36
|
-
'bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75',
|
|
37
|
-
// Shadows
|
|
38
|
-
'shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset',
|
|
39
|
-
// Define grid at the menu level if subgrid is supported
|
|
40
|
-
'supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]',
|
|
41
|
-
// Transitions
|
|
42
|
-
'transition data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0')}/>);
|
|
43
|
-
}
|
|
44
|
-
export function DropdownItem(_a) {
|
|
45
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
46
|
-
let classes = clsx(className,
|
|
47
|
-
// Base styles
|
|
48
|
-
'group cursor-default rounded-lg px-3.5 py-2.5 focus:outline-hidden sm:px-3 sm:py-1.5',
|
|
49
|
-
// Text styles
|
|
50
|
-
'text-left text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
51
|
-
// Focus
|
|
52
|
-
'data-focus:bg-blue-500 data-focus:text-white',
|
|
53
|
-
// Disabled state
|
|
54
|
-
'data-disabled:opacity-50',
|
|
55
|
-
// Forced colors mode
|
|
56
|
-
'forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText] forced-colors:data-focus:*:data-[slot=icon]:text-[HighlightText]',
|
|
57
|
-
// Use subgrid when available but fallback to an explicit grid layout if not
|
|
58
|
-
'col-span-full grid grid-cols-[auto_1fr_1.5rem_0.5rem_auto] items-center supports-[grid-template-columns:subgrid]:grid-cols-subgrid',
|
|
59
|
-
// Icons
|
|
60
|
-
'*:data-[slot=icon]:col-start-1 *:data-[slot=icon]:row-start-1 *:data-[slot=icon]:mr-2.5 *:data-[slot=icon]:-ml-0.5 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:mr-2 sm:*:data-[slot=icon]:size-4', '*:data-[slot=icon]:text-zinc-500 data-focus:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400 dark:data-focus:*:data-[slot=icon]:text-white',
|
|
61
|
-
// Avatar
|
|
62
|
-
'*:data-[slot=avatar]:mr-2.5 *:data-[slot=avatar]:-ml-1 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:mr-2 sm:*:data-[slot=avatar]:size-5');
|
|
63
|
-
return 'href' in props ? (<Headless.MenuItem as={Link} {...props} className={classes}/>) : (<Headless.MenuItem as="button" type="button" {...props} className={classes}/>);
|
|
64
|
-
}
|
|
65
|
-
export function DropdownHeader(_a) {
|
|
66
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
67
|
-
return <div {...props} className={clsx(className, 'col-span-5 px-3.5 pt-2.5 pb-1 sm:px-3')}/>;
|
|
68
|
-
}
|
|
69
|
-
export function DropdownSection(_a) {
|
|
70
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
71
|
-
return (<Headless.MenuSection {...props} className={clsx(className,
|
|
72
|
-
// Define grid at the section level instead of the item level if subgrid is supported
|
|
73
|
-
'col-span-full supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]')}/>);
|
|
74
|
-
}
|
|
75
|
-
export function DropdownHeading(_a) {
|
|
76
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
77
|
-
return (<Headless.MenuHeading {...props} className={clsx(className, 'col-span-full grid grid-cols-[1fr_auto] gap-x-12 px-3.5 pt-2 pb-1 text-sm/5 font-medium text-zinc-500 sm:px-3 sm:text-xs/5 dark:text-zinc-400')}/>);
|
|
78
|
-
}
|
|
79
|
-
export function DropdownDivider(_a) {
|
|
80
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
81
|
-
return (<Headless.MenuSeparator {...props} className={clsx(className, 'col-span-full mx-3.5 my-1 h-px border-0 bg-zinc-950/5 sm:mx-3 dark:bg-white/10 forced-colors:bg-[CanvasText]')}/>);
|
|
82
|
-
}
|
|
83
|
-
export function DropdownLabel(_a) {
|
|
84
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
85
|
-
return <div {...props} data-slot="label" className={clsx(className, 'col-start-2 row-start-1')} {...props}/>;
|
|
86
|
-
}
|
|
87
|
-
export function DropdownDescription(_a) {
|
|
88
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
89
|
-
return (<Headless.Description data-slot="description" {...props} className={clsx(className, 'col-span-2 col-start-2 row-start-2 text-sm/5 text-zinc-500 group-data-focus:text-white sm:text-xs/5 dark:text-zinc-400 forced-colors:group-data-focus:text-[HighlightText]')}/>);
|
|
90
|
-
}
|
|
91
|
-
export function DropdownShortcut(_a) {
|
|
92
|
-
var { keys, className } = _a, props = __rest(_a, ["keys", "className"]);
|
|
93
|
-
return (<Headless.Description as="kbd" {...props} className={clsx(className, 'col-start-5 row-start-1 flex justify-self-end')}>
|
|
94
|
-
{(Array.isArray(keys) ? keys : keys.split('')).map((char, index) => (<kbd key={index} className={clsx([
|
|
95
|
-
'min-w-[2ch] text-center font-sans text-zinc-400 capitalize group-data-focus:text-white forced-colors:group-data-focus:text-[HighlightText]',
|
|
96
|
-
// Make sure key names that are longer than one character (like "Tab") have extra space
|
|
97
|
-
index > 0 && char.length > 1 && 'pl-1',
|
|
98
|
-
])}>
|
|
99
|
-
{char}
|
|
100
|
-
</kbd>))}
|
|
101
|
-
</Headless.Description>);
|
|
102
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
export declare function Fieldset({ className, ...props }: {
|
|
4
|
-
className?: string;
|
|
5
|
-
} & Omit<Headless.FieldsetProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare function Legend({ className, ...props }: {
|
|
7
|
-
className?: string;
|
|
8
|
-
} & Omit<Headless.LegendProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function FieldGroup({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function Field({ className, ...props }: {
|
|
11
|
-
className?: string;
|
|
12
|
-
} & Omit<Headless.FieldProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function Label({ className, ...props }: {
|
|
14
|
-
className?: string;
|
|
15
|
-
} & Omit<Headless.LabelProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function Description({ className, ...props }: {
|
|
17
|
-
className?: string;
|
|
18
|
-
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare function ErrorMessage({ className, ...props }: {
|
|
20
|
-
className?: string;
|
|
21
|
-
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=fieldset.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../source/catalyst/fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,2CAO3E;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,WAAW,CAAC,2CAWzE;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAExF;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,2CAepH;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,2CAWpH;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAQ9E;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAQ9E"}
|