@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,59 +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 React, { forwardRef } from 'react';
|
|
15
|
-
export const Select = forwardRef(function Select(_a, ref) {
|
|
16
|
-
var { className, multiple } = _a, props = __rest(_a, ["className", "multiple"]);
|
|
17
|
-
return (<span data-slot="control" className={clsx([
|
|
18
|
-
className,
|
|
19
|
-
// Basic layout
|
|
20
|
-
'group relative block w-full',
|
|
21
|
-
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
22
|
-
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
23
|
-
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
24
|
-
'dark:before:hidden',
|
|
25
|
-
// Focus ring
|
|
26
|
-
'after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-transparent after:ring-inset has-data-focus:after:ring-2 has-data-focus:after:ring-blue-500',
|
|
27
|
-
// Disabled state
|
|
28
|
-
'has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none',
|
|
29
|
-
])}>
|
|
30
|
-
<Headless.Select ref={ref} multiple={multiple} {...props} className={clsx([
|
|
31
|
-
// Basic layout
|
|
32
|
-
'relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]',
|
|
33
|
-
// Horizontal padding
|
|
34
|
-
multiple
|
|
35
|
-
? 'px-[calc(--spacing(3.5)-1px)] sm:px-[calc(--spacing(3)-1px)]'
|
|
36
|
-
: 'pr-[calc(--spacing(10)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pr-[calc(--spacing(9)-1px)] sm:pl-[calc(--spacing(3)-1px)]',
|
|
37
|
-
// Options (multi-select)
|
|
38
|
-
'[&_optgroup]:font-semibold',
|
|
39
|
-
// Typography
|
|
40
|
-
'text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white dark:*:text-white',
|
|
41
|
-
// Border
|
|
42
|
-
'border border-zinc-950/10 data-hover:border-zinc-950/20 dark:border-white/10 dark:data-hover:border-white/20',
|
|
43
|
-
// Background color
|
|
44
|
-
'bg-transparent dark:bg-white/5 dark:*:bg-zinc-800',
|
|
45
|
-
// Hide default focus styles
|
|
46
|
-
'focus:outline-hidden',
|
|
47
|
-
// Invalid state
|
|
48
|
-
'data-invalid:border-red-500 data-invalid:data-hover:border-red-500 dark:data-invalid:border-red-600 dark:data-invalid:data-hover:border-red-600',
|
|
49
|
-
// Disabled state
|
|
50
|
-
'data-disabled:border-zinc-950/20 data-disabled:opacity-100 dark:data-disabled:border-white/15 dark:data-disabled:bg-white/2.5 dark:data-hover:data-disabled:border-white/15',
|
|
51
|
-
])}/>
|
|
52
|
-
{!multiple && (<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
|
|
53
|
-
<svg className="size-5 stroke-zinc-500 group-has-data-disabled:stroke-zinc-600 sm:size-4 dark:stroke-zinc-400 forced-colors:stroke-[CanvasText]" viewBox="0 0 16 16" aria-hidden="true" fill="none">
|
|
54
|
-
<path d="M5.75 10.75L8 13L10.25 10.75" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
|
|
55
|
-
<path d="M10.25 5.25L8 3L5.75 5.25" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
|
|
56
|
-
</svg>
|
|
57
|
-
</span>)}
|
|
58
|
-
</span>);
|
|
59
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare function SidebarLayout({ navbar, sidebar, children, }: React.PropsWithChildren<{
|
|
3
|
-
navbar: React.ReactNode;
|
|
4
|
-
sidebar: React.ReactNode;
|
|
5
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=sidebar-layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-layout.d.ts","sourceRoot":"","sources":["../../source/catalyst/sidebar-layout.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAA;AA2CvC,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,2CA+BhF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as Headless from '@headlessui/react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { NavbarItem } from './navbar';
|
|
6
|
-
function OpenMenuIcon() {
|
|
7
|
-
return (_jsx("svg", { "data-slot": "icon", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z" }) }));
|
|
8
|
-
}
|
|
9
|
-
function CloseMenuIcon() {
|
|
10
|
-
return (_jsx("svg", { "data-slot": "icon", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" }) }));
|
|
11
|
-
}
|
|
12
|
-
function MobileSidebar({ open, close, children }) {
|
|
13
|
-
return (_jsxs(Headless.Dialog, { open: open, onClose: close, className: "lg:hidden", children: [_jsx(Headless.DialogBackdrop, { transition: true, className: "fixed inset-0 bg-black/30 transition data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in" }), _jsx(Headless.DialogPanel, { transition: true, className: "fixed inset-y-0 w-full max-w-80 p-2 transition duration-300 ease-in-out data-closed:-translate-x-full", children: _jsxs("div", { className: "flex h-full flex-col rounded-lg bg-white shadow-xs ring-1 ring-zinc-950/5 dark:bg-zinc-900 dark:ring-white/10", children: [_jsx("div", { className: "-mb-3 px-4 pt-3", children: _jsx(Headless.CloseButton, { as: NavbarItem, "aria-label": "Close navigation", children: _jsx(CloseMenuIcon, {}) }) }), children] }) })] }));
|
|
14
|
-
}
|
|
15
|
-
export function SidebarLayout({ navbar, sidebar, children, }) {
|
|
16
|
-
let [showSidebar, setShowSidebar] = useState(false);
|
|
17
|
-
return (_jsxs("div", { className: "relative isolate flex min-h-svh w-full bg-white max-lg:flex-col lg:bg-zinc-100 dark:bg-zinc-900 dark:lg:bg-zinc-950", children: [_jsx("div", { className: "fixed inset-y-0 left-0 w-64 max-lg:hidden", children: sidebar }), _jsx(MobileSidebar, { open: showSidebar, close: () => setShowSidebar(false), children: sidebar }), _jsxs("header", { className: "flex items-center px-4 lg:hidden", children: [_jsx("div", { className: "py-2.5", children: _jsx(NavbarItem, { onClick: () => setShowSidebar(true), "aria-label": "Open navigation", children: _jsx(OpenMenuIcon, {}) }) }), _jsx("div", { className: "min-w-0 flex-1", children: navbar })] }), _jsx("main", { className: "flex flex-1 flex-col pb-2 lg:min-w-0 lg:pt-2 lg:pr-2 lg:pl-64", children: _jsx("div", { className: "grow p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-xs lg:ring-1 lg:ring-zinc-950/5 dark:lg:bg-zinc-900 dark:lg:ring-white/10", children: _jsx("div", { className: "mx-auto max-w-6xl", children: children }) }) })] }));
|
|
18
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as Headless from '@headlessui/react';
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { NavbarItem } from './navbar';
|
|
5
|
-
function OpenMenuIcon() {
|
|
6
|
-
return (<svg data-slot="icon" viewBox="0 0 20 20" aria-hidden="true">
|
|
7
|
-
<path d="M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z"/>
|
|
8
|
-
</svg>);
|
|
9
|
-
}
|
|
10
|
-
function CloseMenuIcon() {
|
|
11
|
-
return (<svg data-slot="icon" viewBox="0 0 20 20" aria-hidden="true">
|
|
12
|
-
<path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"/>
|
|
13
|
-
</svg>);
|
|
14
|
-
}
|
|
15
|
-
function MobileSidebar({ open, close, children }) {
|
|
16
|
-
return (<Headless.Dialog open={open} onClose={close} className="lg:hidden">
|
|
17
|
-
<Headless.DialogBackdrop transition className="fixed inset-0 bg-black/30 transition data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"/>
|
|
18
|
-
<Headless.DialogPanel transition className="fixed inset-y-0 w-full max-w-80 p-2 transition duration-300 ease-in-out data-closed:-translate-x-full">
|
|
19
|
-
<div className="flex h-full flex-col rounded-lg bg-white shadow-xs ring-1 ring-zinc-950/5 dark:bg-zinc-900 dark:ring-white/10">
|
|
20
|
-
<div className="-mb-3 px-4 pt-3">
|
|
21
|
-
<Headless.CloseButton as={NavbarItem} aria-label="Close navigation">
|
|
22
|
-
<CloseMenuIcon />
|
|
23
|
-
</Headless.CloseButton>
|
|
24
|
-
</div>
|
|
25
|
-
{children}
|
|
26
|
-
</div>
|
|
27
|
-
</Headless.DialogPanel>
|
|
28
|
-
</Headless.Dialog>);
|
|
29
|
-
}
|
|
30
|
-
export function SidebarLayout({ navbar, sidebar, children, }) {
|
|
31
|
-
let [showSidebar, setShowSidebar] = useState(false);
|
|
32
|
-
return (<div className="relative isolate flex min-h-svh w-full bg-white max-lg:flex-col lg:bg-zinc-100 dark:bg-zinc-900 dark:lg:bg-zinc-950">
|
|
33
|
-
{/* Sidebar on desktop */}
|
|
34
|
-
<div className="fixed inset-y-0 left-0 w-64 max-lg:hidden">{sidebar}</div>
|
|
35
|
-
|
|
36
|
-
{/* Sidebar on mobile */}
|
|
37
|
-
<MobileSidebar open={showSidebar} close={() => setShowSidebar(false)}>
|
|
38
|
-
{sidebar}
|
|
39
|
-
</MobileSidebar>
|
|
40
|
-
|
|
41
|
-
{/* Navbar on mobile */}
|
|
42
|
-
<header className="flex items-center px-4 lg:hidden">
|
|
43
|
-
<div className="py-2.5">
|
|
44
|
-
<NavbarItem onClick={() => setShowSidebar(true)} aria-label="Open navigation">
|
|
45
|
-
<OpenMenuIcon />
|
|
46
|
-
</NavbarItem>
|
|
47
|
-
</div>
|
|
48
|
-
<div className="min-w-0 flex-1">{navbar}</div>
|
|
49
|
-
</header>
|
|
50
|
-
|
|
51
|
-
{/* Content */}
|
|
52
|
-
<main className="flex flex-1 flex-col pb-2 lg:min-w-0 lg:pt-2 lg:pr-2 lg:pl-64">
|
|
53
|
-
<div className="grow p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-xs lg:ring-1 lg:ring-zinc-950/5 dark:lg:bg-zinc-900 dark:lg:ring-white/10">
|
|
54
|
-
<div className="mx-auto max-w-6xl">{children}</div>
|
|
55
|
-
</div>
|
|
56
|
-
</main>
|
|
57
|
-
</div>);
|
|
58
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare function Sidebar({ className, ...props }: React.ComponentPropsWithoutRef<'nav'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function SidebarHeader({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare function SidebarBody({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare function SidebarFooter({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function SidebarSection({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function SidebarDivider({ className, ...props }: React.ComponentPropsWithoutRef<'hr'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function SidebarSpacer({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function SidebarHeading({ className, ...props }: React.ComponentPropsWithoutRef<'h3'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare const SidebarItem: React.ForwardRefExoticComponent<({
|
|
12
|
-
current?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
} & (Omit<Headless.ButtonProps<"button">, "className" | "as"> | Omit<Headless.ButtonProps<React.ForwardRefExoticComponent<{
|
|
16
|
-
href: string;
|
|
17
|
-
as?: React.ElementType;
|
|
18
|
-
} & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>>, "className" | "as">)) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
19
|
-
export declare function SidebarLabel({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../source/catalyst/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAErF;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAU3F;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAUzF;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAU3F;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAQ5F;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAE3F;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAE3F;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAI3F;AAED,eAAO,MAAM,WAAW;cAMP,OAAO;gBAAc,MAAM;cAAY,KAAK,CAAC,SAAS;;;;0OA0DrE,CAAA;AAEF,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAE3F"}
|
|
@@ -1,77 +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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import * as Headless from '@headlessui/react';
|
|
15
|
-
import clsx from 'clsx';
|
|
16
|
-
import { LayoutGroup, motion } from 'framer-motion';
|
|
17
|
-
import { forwardRef, useId } from 'react';
|
|
18
|
-
import { TouchTarget } from './button';
|
|
19
|
-
import { Link } from './link';
|
|
20
|
-
export function Sidebar(_a) {
|
|
21
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
-
return _jsx("nav", Object.assign({}, props, { className: clsx(className, 'flex h-full min-h-0 flex-col') }));
|
|
23
|
-
}
|
|
24
|
-
export function SidebarHeader(_a) {
|
|
25
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
-
return (_jsx("div", Object.assign({}, props, { className: clsx(className, 'flex flex-col border-b border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5') })));
|
|
27
|
-
}
|
|
28
|
-
export function SidebarBody(_a) {
|
|
29
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
30
|
-
return (_jsx("div", Object.assign({}, props, { className: clsx(className, 'flex flex-1 flex-col overflow-y-auto p-4 [&>[data-slot=section]+[data-slot=section]]:mt-8') })));
|
|
31
|
-
}
|
|
32
|
-
export function SidebarFooter(_a) {
|
|
33
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
34
|
-
return (_jsx("div", Object.assign({}, props, { className: clsx(className, 'flex flex-col border-t border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5') })));
|
|
35
|
-
}
|
|
36
|
-
export function SidebarSection(_a) {
|
|
37
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
-
let id = useId();
|
|
39
|
-
return (_jsx(LayoutGroup, { id: id, children: _jsx("div", Object.assign({}, props, { "data-slot": "section", className: clsx(className, 'flex flex-col gap-0.5') })) }));
|
|
40
|
-
}
|
|
41
|
-
export function SidebarDivider(_a) {
|
|
42
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
43
|
-
return _jsx("hr", Object.assign({}, props, { className: clsx(className, 'my-4 border-t border-zinc-950/5 lg:-mx-4 dark:border-white/5') }));
|
|
44
|
-
}
|
|
45
|
-
export function SidebarSpacer(_a) {
|
|
46
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
47
|
-
return _jsx("div", Object.assign({ "aria-hidden": "true" }, props, { className: clsx(className, 'mt-8 flex-1') }));
|
|
48
|
-
}
|
|
49
|
-
export function SidebarHeading(_a) {
|
|
50
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
51
|
-
return (_jsx("h3", Object.assign({}, props, { className: clsx(className, 'mb-1 px-2 text-xs/6 font-medium text-zinc-500 dark:text-zinc-400') })));
|
|
52
|
-
}
|
|
53
|
-
export const SidebarItem = forwardRef(function SidebarItem(_a, ref) {
|
|
54
|
-
var { current, className, children } = _a, props = __rest(_a, ["current", "className", "children"]);
|
|
55
|
-
let classes = clsx(
|
|
56
|
-
// Base
|
|
57
|
-
'flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-base/6 font-medium text-zinc-950 sm:py-2 sm:text-sm/5',
|
|
58
|
-
// Leading icon/icon-only
|
|
59
|
-
'*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5',
|
|
60
|
-
// Trailing icon (down chevron or similar)
|
|
61
|
-
'*:last:data-[slot=icon]:ml-auto *:last:data-[slot=icon]:size-5 sm:*:last:data-[slot=icon]:size-4',
|
|
62
|
-
// Avatar
|
|
63
|
-
'*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 sm:*:data-[slot=avatar]:size-6',
|
|
64
|
-
// Hover
|
|
65
|
-
'data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950',
|
|
66
|
-
// Active
|
|
67
|
-
'data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950',
|
|
68
|
-
// Current
|
|
69
|
-
'data-current:*:data-[slot=icon]:fill-zinc-950',
|
|
70
|
-
// Dark mode
|
|
71
|
-
'dark:text-white dark:*:data-[slot=icon]:fill-zinc-400', 'dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white', 'dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white', 'dark:data-current:*:data-[slot=icon]:fill-white');
|
|
72
|
-
return (_jsxs("span", { className: clsx(className, 'relative'), children: [current && (_jsx(motion.span, { layoutId: "current-indicator", className: "absolute inset-y-2 -left-4 w-0.5 rounded-full bg-zinc-950 dark:bg-white" })), 'href' in props ? (_jsx(Headless.CloseButton, Object.assign({ as: Link }, props, { className: classes, "data-current": current ? 'true' : undefined, ref: ref, children: _jsx(TouchTarget, { children: children }) }))) : (_jsx(Headless.Button, Object.assign({}, props, { className: clsx('cursor-default', classes), "data-current": current ? 'true' : undefined, ref: ref, children: _jsx(TouchTarget, { children: children }) })))] }));
|
|
73
|
-
});
|
|
74
|
-
export function SidebarLabel(_a) {
|
|
75
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
76
|
-
return _jsx("span", Object.assign({}, props, { className: clsx(className, 'truncate') }));
|
|
77
|
-
}
|
|
@@ -1,85 +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 { LayoutGroup, motion } from 'framer-motion';
|
|
16
|
-
import React, { forwardRef, useId } from 'react';
|
|
17
|
-
import { TouchTarget } from './button';
|
|
18
|
-
import { Link } from './link';
|
|
19
|
-
export function Sidebar(_a) {
|
|
20
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
-
return <nav {...props} className={clsx(className, 'flex h-full min-h-0 flex-col')}/>;
|
|
22
|
-
}
|
|
23
|
-
export function SidebarHeader(_a) {
|
|
24
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
25
|
-
return (<div {...props} className={clsx(className, 'flex flex-col border-b border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5')}/>);
|
|
26
|
-
}
|
|
27
|
-
export function SidebarBody(_a) {
|
|
28
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
-
return (<div {...props} className={clsx(className, 'flex flex-1 flex-col overflow-y-auto p-4 [&>[data-slot=section]+[data-slot=section]]:mt-8')}/>);
|
|
30
|
-
}
|
|
31
|
-
export function SidebarFooter(_a) {
|
|
32
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
-
return (<div {...props} className={clsx(className, 'flex flex-col border-t border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5')}/>);
|
|
34
|
-
}
|
|
35
|
-
export function SidebarSection(_a) {
|
|
36
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
-
let id = useId();
|
|
38
|
-
return (<LayoutGroup id={id}>
|
|
39
|
-
<div {...props} data-slot="section" className={clsx(className, 'flex flex-col gap-0.5')}/>
|
|
40
|
-
</LayoutGroup>);
|
|
41
|
-
}
|
|
42
|
-
export function SidebarDivider(_a) {
|
|
43
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
-
return <hr {...props} className={clsx(className, 'my-4 border-t border-zinc-950/5 lg:-mx-4 dark:border-white/5')}/>;
|
|
45
|
-
}
|
|
46
|
-
export function SidebarSpacer(_a) {
|
|
47
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
48
|
-
return <div aria-hidden="true" {...props} className={clsx(className, 'mt-8 flex-1')}/>;
|
|
49
|
-
}
|
|
50
|
-
export function SidebarHeading(_a) {
|
|
51
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
52
|
-
return (<h3 {...props} className={clsx(className, 'mb-1 px-2 text-xs/6 font-medium text-zinc-500 dark:text-zinc-400')}/>);
|
|
53
|
-
}
|
|
54
|
-
export const SidebarItem = forwardRef(function SidebarItem(_a, ref) {
|
|
55
|
-
var { current, className, children } = _a, props = __rest(_a, ["current", "className", "children"]);
|
|
56
|
-
let classes = clsx(
|
|
57
|
-
// Base
|
|
58
|
-
'flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-base/6 font-medium text-zinc-950 sm:py-2 sm:text-sm/5',
|
|
59
|
-
// Leading icon/icon-only
|
|
60
|
-
'*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5',
|
|
61
|
-
// Trailing icon (down chevron or similar)
|
|
62
|
-
'*:last:data-[slot=icon]:ml-auto *:last:data-[slot=icon]:size-5 sm:*:last:data-[slot=icon]:size-4',
|
|
63
|
-
// Avatar
|
|
64
|
-
'*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 sm:*:data-[slot=avatar]:size-6',
|
|
65
|
-
// Hover
|
|
66
|
-
'data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950',
|
|
67
|
-
// Active
|
|
68
|
-
'data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950',
|
|
69
|
-
// Current
|
|
70
|
-
'data-current:*:data-[slot=icon]:fill-zinc-950',
|
|
71
|
-
// Dark mode
|
|
72
|
-
'dark:text-white dark:*:data-[slot=icon]:fill-zinc-400', 'dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white', 'dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white', 'dark:data-current:*:data-[slot=icon]:fill-white');
|
|
73
|
-
return (<span className={clsx(className, 'relative')}>
|
|
74
|
-
{current && (<motion.span layoutId="current-indicator" className="absolute inset-y-2 -left-4 w-0.5 rounded-full bg-zinc-950 dark:bg-white"/>)}
|
|
75
|
-
{'href' in props ? (<Headless.CloseButton as={Link} {...props} className={classes} data-current={current ? 'true' : undefined} ref={ref}>
|
|
76
|
-
<TouchTarget>{children}</TouchTarget>
|
|
77
|
-
</Headless.CloseButton>) : (<Headless.Button {...props} className={clsx('cursor-default', classes)} data-current={current ? 'true' : undefined} ref={ref}>
|
|
78
|
-
<TouchTarget>{children}</TouchTarget>
|
|
79
|
-
</Headless.Button>)}
|
|
80
|
-
</span>);
|
|
81
|
-
});
|
|
82
|
-
export function SidebarLabel(_a) {
|
|
83
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
84
|
-
return <span {...props} className={clsx(className, 'truncate')}/>;
|
|
85
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare function StackedLayout({ navbar, sidebar, children, }: React.PropsWithChildren<{
|
|
3
|
-
navbar: React.ReactNode;
|
|
4
|
-
sidebar: React.ReactNode;
|
|
5
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=stacked-layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stacked-layout.d.ts","sourceRoot":"","sources":["../../source/catalyst/stacked-layout.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAA;AA2CvC,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,2CA4BhF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as Headless from '@headlessui/react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { NavbarItem } from './navbar';
|
|
6
|
-
function OpenMenuIcon() {
|
|
7
|
-
return (_jsx("svg", { "data-slot": "icon", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z" }) }));
|
|
8
|
-
}
|
|
9
|
-
function CloseMenuIcon() {
|
|
10
|
-
return (_jsx("svg", { "data-slot": "icon", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" }) }));
|
|
11
|
-
}
|
|
12
|
-
function MobileSidebar({ open, close, children }) {
|
|
13
|
-
return (_jsxs(Headless.Dialog, { open: open, onClose: close, className: "lg:hidden", children: [_jsx(Headless.DialogBackdrop, { transition: true, className: "fixed inset-0 bg-black/30 transition data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in" }), _jsx(Headless.DialogPanel, { transition: true, className: "fixed inset-y-0 w-full max-w-80 p-2 transition duration-300 ease-in-out data-closed:-translate-x-full", children: _jsxs("div", { className: "flex h-full flex-col rounded-lg bg-white shadow-xs ring-1 ring-zinc-950/5 dark:bg-zinc-900 dark:ring-white/10", children: [_jsx("div", { className: "-mb-3 px-4 pt-3", children: _jsx(Headless.CloseButton, { as: NavbarItem, "aria-label": "Close navigation", children: _jsx(CloseMenuIcon, {}) }) }), children] }) })] }));
|
|
14
|
-
}
|
|
15
|
-
export function StackedLayout({ navbar, sidebar, children, }) {
|
|
16
|
-
let [showSidebar, setShowSidebar] = useState(false);
|
|
17
|
-
return (_jsxs("div", { className: "relative isolate flex min-h-svh w-full flex-col bg-white lg:bg-zinc-100 dark:bg-zinc-900 dark:lg:bg-zinc-950", children: [_jsx(MobileSidebar, { open: showSidebar, close: () => setShowSidebar(false), children: sidebar }), _jsxs("header", { className: "flex items-center px-4", children: [_jsx("div", { className: "py-2.5 lg:hidden", children: _jsx(NavbarItem, { onClick: () => setShowSidebar(true), "aria-label": "Open navigation", children: _jsx(OpenMenuIcon, {}) }) }), _jsx("div", { className: "min-w-0 flex-1", children: navbar })] }), _jsx("main", { className: "flex flex-1 flex-col pb-2 lg:px-2", children: _jsx("div", { className: "grow p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-xs lg:ring-1 lg:ring-zinc-950/5 dark:lg:bg-zinc-900 dark:lg:ring-white/10", children: _jsx("div", { className: "mx-auto max-w-6xl", children: children }) }) })] }));
|
|
18
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as Headless from '@headlessui/react';
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { NavbarItem } from './navbar';
|
|
5
|
-
function OpenMenuIcon() {
|
|
6
|
-
return (<svg data-slot="icon" viewBox="0 0 20 20" aria-hidden="true">
|
|
7
|
-
<path d="M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z"/>
|
|
8
|
-
</svg>);
|
|
9
|
-
}
|
|
10
|
-
function CloseMenuIcon() {
|
|
11
|
-
return (<svg data-slot="icon" viewBox="0 0 20 20" aria-hidden="true">
|
|
12
|
-
<path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"/>
|
|
13
|
-
</svg>);
|
|
14
|
-
}
|
|
15
|
-
function MobileSidebar({ open, close, children }) {
|
|
16
|
-
return (<Headless.Dialog open={open} onClose={close} className="lg:hidden">
|
|
17
|
-
<Headless.DialogBackdrop transition className="fixed inset-0 bg-black/30 transition data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"/>
|
|
18
|
-
<Headless.DialogPanel transition className="fixed inset-y-0 w-full max-w-80 p-2 transition duration-300 ease-in-out data-closed:-translate-x-full">
|
|
19
|
-
<div className="flex h-full flex-col rounded-lg bg-white shadow-xs ring-1 ring-zinc-950/5 dark:bg-zinc-900 dark:ring-white/10">
|
|
20
|
-
<div className="-mb-3 px-4 pt-3">
|
|
21
|
-
<Headless.CloseButton as={NavbarItem} aria-label="Close navigation">
|
|
22
|
-
<CloseMenuIcon />
|
|
23
|
-
</Headless.CloseButton>
|
|
24
|
-
</div>
|
|
25
|
-
{children}
|
|
26
|
-
</div>
|
|
27
|
-
</Headless.DialogPanel>
|
|
28
|
-
</Headless.Dialog>);
|
|
29
|
-
}
|
|
30
|
-
export function StackedLayout({ navbar, sidebar, children, }) {
|
|
31
|
-
let [showSidebar, setShowSidebar] = useState(false);
|
|
32
|
-
return (<div className="relative isolate flex min-h-svh w-full flex-col bg-white lg:bg-zinc-100 dark:bg-zinc-900 dark:lg:bg-zinc-950">
|
|
33
|
-
{/* Sidebar on mobile */}
|
|
34
|
-
<MobileSidebar open={showSidebar} close={() => setShowSidebar(false)}>
|
|
35
|
-
{sidebar}
|
|
36
|
-
</MobileSidebar>
|
|
37
|
-
|
|
38
|
-
{/* Navbar */}
|
|
39
|
-
<header className="flex items-center px-4">
|
|
40
|
-
<div className="py-2.5 lg:hidden">
|
|
41
|
-
<NavbarItem onClick={() => setShowSidebar(true)} aria-label="Open navigation">
|
|
42
|
-
<OpenMenuIcon />
|
|
43
|
-
</NavbarItem>
|
|
44
|
-
</div>
|
|
45
|
-
<div className="min-w-0 flex-1">{navbar}</div>
|
|
46
|
-
</header>
|
|
47
|
-
|
|
48
|
-
{/* Content */}
|
|
49
|
-
<main className="flex flex-1 flex-col pb-2 lg:px-2">
|
|
50
|
-
<div className="grow p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-xs lg:ring-1 lg:ring-zinc-950/5 dark:lg:bg-zinc-900 dark:lg:ring-white/10">
|
|
51
|
-
<div className="mx-auto max-w-6xl">{children}</div>
|
|
52
|
-
</div>
|
|
53
|
-
</main>
|
|
54
|
-
</div>);
|
|
55
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
export declare function SwitchGroup({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function SwitchField({ className, ...props }: {
|
|
5
|
-
className?: string;
|
|
6
|
-
} & Omit<Headless.FieldProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare const colors: {
|
|
8
|
-
'dark/zinc': string[];
|
|
9
|
-
'dark/white': string[];
|
|
10
|
-
dark: string[];
|
|
11
|
-
zinc: string[];
|
|
12
|
-
white: string[];
|
|
13
|
-
red: string[];
|
|
14
|
-
orange: string[];
|
|
15
|
-
amber: string[];
|
|
16
|
-
yellow: string[];
|
|
17
|
-
lime: string[];
|
|
18
|
-
green: string[];
|
|
19
|
-
emerald: string[];
|
|
20
|
-
teal: string[];
|
|
21
|
-
cyan: string[];
|
|
22
|
-
sky: string[];
|
|
23
|
-
blue: string[];
|
|
24
|
-
indigo: string[];
|
|
25
|
-
violet: string[];
|
|
26
|
-
purple: string[];
|
|
27
|
-
fuchsia: string[];
|
|
28
|
-
pink: string[];
|
|
29
|
-
rose: string[];
|
|
30
|
-
};
|
|
31
|
-
type Color = keyof typeof colors;
|
|
32
|
-
export declare function Switch({ color, className, ...props }: {
|
|
33
|
-
color?: Color;
|
|
34
|
-
className?: string;
|
|
35
|
-
} & Omit<Headless.SwitchProps, 'as' | 'className' | 'children'>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../source/catalyst/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAczF;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,2CAoBxE;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAyFX,CAAA;AAED,KAAK,KAAK,GAAG,MAAM,OAAO,MAAM,CAAA;AAEhC,wBAAgB,MAAM,CAAC,EACrB,KAAmB,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IACD,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,WAAW,GAAG,UAAU,CAAC,2CAiD9D"}
|