@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,160 +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 * as Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
export function SwitchGroup(_a) {
|
|
16
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
-
return (_jsx("div", Object.assign({ "data-slot": "control" }, props, { className: clsx(className,
|
|
18
|
-
// Basic groups
|
|
19
|
-
'space-y-3 **:data-[slot=label]:font-normal',
|
|
20
|
-
// With descriptions
|
|
21
|
-
'has-data-[slot=description]:space-y-6 has-data-[slot=description]:**:data-[slot=label]:font-medium') })));
|
|
22
|
-
}
|
|
23
|
-
export function SwitchField(_a) {
|
|
24
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
25
|
-
return (_jsx(Headless.Field, Object.assign({ "data-slot": "field" }, props, { className: clsx(className,
|
|
26
|
-
// Base layout
|
|
27
|
-
'grid grid-cols-[1fr_auto] gap-x-8 gap-y-1 sm:grid-cols-[1fr_auto]',
|
|
28
|
-
// Control layout
|
|
29
|
-
'*:data-[slot=control]:col-start-2 *:data-[slot=control]:self-start sm:*:data-[slot=control]:mt-0.5',
|
|
30
|
-
// Label layout
|
|
31
|
-
'*:data-[slot=label]:col-start-1 *:data-[slot=label]:row-start-1',
|
|
32
|
-
// Description layout
|
|
33
|
-
'*:data-[slot=description]:col-start-1 *:data-[slot=description]:row-start-2',
|
|
34
|
-
// With description
|
|
35
|
-
'has-data-[slot=description]:**:data-[slot=label]:font-medium') })));
|
|
36
|
-
}
|
|
37
|
-
const colors = {
|
|
38
|
-
'dark/zinc': [
|
|
39
|
-
'[--switch-bg-ring:var(--color-zinc-950)]/90 [--switch-bg:var(--color-zinc-900)] dark:[--switch-bg-ring:transparent] dark:[--switch-bg:var(--color-white)]/25',
|
|
40
|
-
'[--switch-ring:var(--color-zinc-950)]/90 [--switch-shadow:var(--color-black)]/10 [--switch:white] dark:[--switch-ring:var(--color-zinc-700)]/90',
|
|
41
|
-
],
|
|
42
|
-
'dark/white': [
|
|
43
|
-
'[--switch-bg-ring:var(--color-zinc-950)]/90 [--switch-bg:var(--color-zinc-900)] dark:[--switch-bg-ring:transparent] dark:[--switch-bg:var(--color-white)]',
|
|
44
|
-
'[--switch-ring:var(--color-zinc-950)]/90 [--switch-shadow:var(--color-black)]/10 [--switch:white] dark:[--switch-ring:transparent] dark:[--switch:var(--color-zinc-900)]',
|
|
45
|
-
],
|
|
46
|
-
dark: [
|
|
47
|
-
'[--switch-bg-ring:var(--color-zinc-950)]/90 [--switch-bg:var(--color-zinc-900)] dark:[--switch-bg-ring:var(--color-white)]/15',
|
|
48
|
-
'[--switch-ring:var(--color-zinc-950)]/90 [--switch-shadow:var(--color-black)]/10 [--switch:white]',
|
|
49
|
-
],
|
|
50
|
-
zinc: [
|
|
51
|
-
'[--switch-bg-ring:var(--color-zinc-700)]/90 [--switch-bg:var(--color-zinc-600)] dark:[--switch-bg-ring:transparent]',
|
|
52
|
-
'[--switch-shadow:var(--color-black)]/10 [--switch:white] [--switch-ring:var(--color-zinc-700)]/90',
|
|
53
|
-
],
|
|
54
|
-
white: [
|
|
55
|
-
'[--switch-bg-ring:var(--color-black)]/15 [--switch-bg:white] dark:[--switch-bg-ring:transparent]',
|
|
56
|
-
'[--switch-shadow:var(--color-black)]/10 [--switch-ring:transparent] [--switch:var(--color-zinc-950)]',
|
|
57
|
-
],
|
|
58
|
-
red: [
|
|
59
|
-
'[--switch-bg-ring:var(--color-red-700)]/90 [--switch-bg:var(--color-red-600)] dark:[--switch-bg-ring:transparent]',
|
|
60
|
-
'[--switch:white] [--switch-ring:var(--color-red-700)]/90 [--switch-shadow:var(--color-red-900)]/20',
|
|
61
|
-
],
|
|
62
|
-
orange: [
|
|
63
|
-
'[--switch-bg-ring:var(--color-orange-600)]/90 [--switch-bg:var(--color-orange-500)] dark:[--switch-bg-ring:transparent]',
|
|
64
|
-
'[--switch:white] [--switch-ring:var(--color-orange-600)]/90 [--switch-shadow:var(--color-orange-900)]/20',
|
|
65
|
-
],
|
|
66
|
-
amber: [
|
|
67
|
-
'[--switch-bg-ring:var(--color-amber-500)]/80 [--switch-bg:var(--color-amber-400)] dark:[--switch-bg-ring:transparent]',
|
|
68
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-amber-950)]',
|
|
69
|
-
],
|
|
70
|
-
yellow: [
|
|
71
|
-
'[--switch-bg-ring:var(--color-yellow-400)]/80 [--switch-bg:var(--color-yellow-300)] dark:[--switch-bg-ring:transparent]',
|
|
72
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-yellow-950)]',
|
|
73
|
-
],
|
|
74
|
-
lime: [
|
|
75
|
-
'[--switch-bg-ring:var(--color-lime-400)]/80 [--switch-bg:var(--color-lime-300)] dark:[--switch-bg-ring:transparent]',
|
|
76
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-lime-950)]',
|
|
77
|
-
],
|
|
78
|
-
green: [
|
|
79
|
-
'[--switch-bg-ring:var(--color-green-700)]/90 [--switch-bg:var(--color-green-600)] dark:[--switch-bg-ring:transparent]',
|
|
80
|
-
'[--switch:white] [--switch-ring:var(--color-green-700)]/90 [--switch-shadow:var(--color-green-900)]/20',
|
|
81
|
-
],
|
|
82
|
-
emerald: [
|
|
83
|
-
'[--switch-bg-ring:var(--color-emerald-600)]/90 [--switch-bg:var(--color-emerald-500)] dark:[--switch-bg-ring:transparent]',
|
|
84
|
-
'[--switch:white] [--switch-ring:var(--color-emerald-600)]/90 [--switch-shadow:var(--color-emerald-900)]/20',
|
|
85
|
-
],
|
|
86
|
-
teal: [
|
|
87
|
-
'[--switch-bg-ring:var(--color-teal-700)]/90 [--switch-bg:var(--color-teal-600)] dark:[--switch-bg-ring:transparent]',
|
|
88
|
-
'[--switch:white] [--switch-ring:var(--color-teal-700)]/90 [--switch-shadow:var(--color-teal-900)]/20',
|
|
89
|
-
],
|
|
90
|
-
cyan: [
|
|
91
|
-
'[--switch-bg-ring:var(--color-cyan-400)]/80 [--switch-bg:var(--color-cyan-300)] dark:[--switch-bg-ring:transparent]',
|
|
92
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-cyan-950)]',
|
|
93
|
-
],
|
|
94
|
-
sky: [
|
|
95
|
-
'[--switch-bg-ring:var(--color-sky-600)]/80 [--switch-bg:var(--color-sky-500)] dark:[--switch-bg-ring:transparent]',
|
|
96
|
-
'[--switch:white] [--switch-ring:var(--color-sky-600)]/80 [--switch-shadow:var(--color-sky-900)]/20',
|
|
97
|
-
],
|
|
98
|
-
blue: [
|
|
99
|
-
'[--switch-bg-ring:var(--color-blue-700)]/90 [--switch-bg:var(--color-blue-600)] dark:[--switch-bg-ring:transparent]',
|
|
100
|
-
'[--switch:white] [--switch-ring:var(--color-blue-700)]/90 [--switch-shadow:var(--color-blue-900)]/20',
|
|
101
|
-
],
|
|
102
|
-
indigo: [
|
|
103
|
-
'[--switch-bg-ring:var(--color-indigo-600)]/90 [--switch-bg:var(--color-indigo-500)] dark:[--switch-bg-ring:transparent]',
|
|
104
|
-
'[--switch:white] [--switch-ring:var(--color-indigo-600)]/90 [--switch-shadow:var(--color-indigo-900)]/20',
|
|
105
|
-
],
|
|
106
|
-
violet: [
|
|
107
|
-
'[--switch-bg-ring:var(--color-violet-600)]/90 [--switch-bg:var(--color-violet-500)] dark:[--switch-bg-ring:transparent]',
|
|
108
|
-
'[--switch:white] [--switch-ring:var(--color-violet-600)]/90 [--switch-shadow:var(--color-violet-900)]/20',
|
|
109
|
-
],
|
|
110
|
-
purple: [
|
|
111
|
-
'[--switch-bg-ring:var(--color-purple-600)]/90 [--switch-bg:var(--color-purple-500)] dark:[--switch-bg-ring:transparent]',
|
|
112
|
-
'[--switch:white] [--switch-ring:var(--color-purple-600)]/90 [--switch-shadow:var(--color-purple-900)]/20',
|
|
113
|
-
],
|
|
114
|
-
fuchsia: [
|
|
115
|
-
'[--switch-bg-ring:var(--color-fuchsia-600)]/90 [--switch-bg:var(--color-fuchsia-500)] dark:[--switch-bg-ring:transparent]',
|
|
116
|
-
'[--switch:white] [--switch-ring:var(--color-fuchsia-600)]/90 [--switch-shadow:var(--color-fuchsia-900)]/20',
|
|
117
|
-
],
|
|
118
|
-
pink: [
|
|
119
|
-
'[--switch-bg-ring:var(--color-pink-600)]/90 [--switch-bg:var(--color-pink-500)] dark:[--switch-bg-ring:transparent]',
|
|
120
|
-
'[--switch:white] [--switch-ring:var(--color-pink-600)]/90 [--switch-shadow:var(--color-pink-900)]/20',
|
|
121
|
-
],
|
|
122
|
-
rose: [
|
|
123
|
-
'[--switch-bg-ring:var(--color-rose-600)]/90 [--switch-bg:var(--color-rose-500)] dark:[--switch-bg-ring:transparent]',
|
|
124
|
-
'[--switch:white] [--switch-ring:var(--color-rose-600)]/90 [--switch-shadow:var(--color-rose-900)]/20',
|
|
125
|
-
],
|
|
126
|
-
};
|
|
127
|
-
export function Switch(_a) {
|
|
128
|
-
var { color = 'dark/zinc', className } = _a, props = __rest(_a, ["color", "className"]);
|
|
129
|
-
return (_jsx(Headless.Switch, Object.assign({ "data-slot": "control" }, props, { className: clsx(className,
|
|
130
|
-
// Base styles
|
|
131
|
-
'group relative isolate inline-flex h-6 w-10 cursor-default rounded-full p-[3px] sm:h-5 sm:w-8',
|
|
132
|
-
// Transitions
|
|
133
|
-
'transition duration-0 ease-in-out data-changing:duration-200',
|
|
134
|
-
// Outline and background color in forced-colors mode so switch is still visible
|
|
135
|
-
'forced-colors:outline forced-colors:[--switch-bg:Highlight] dark:forced-colors:[--switch-bg:Highlight]',
|
|
136
|
-
// Unchecked
|
|
137
|
-
'bg-zinc-200 ring-1 ring-black/5 ring-inset dark:bg-white/5 dark:ring-white/15',
|
|
138
|
-
// Checked
|
|
139
|
-
'data-checked:bg-(--switch-bg) data-checked:ring-(--switch-bg-ring) dark:data-checked:bg-(--switch-bg) dark:data-checked:ring-(--switch-bg-ring)',
|
|
140
|
-
// Focus
|
|
141
|
-
'focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500',
|
|
142
|
-
// Hover
|
|
143
|
-
'data-hover:ring-black/15 data-hover:data-checked:ring-(--switch-bg-ring)', 'dark:data-hover:ring-white/25 dark:data-hover:data-checked:ring-(--switch-bg-ring)',
|
|
144
|
-
// Disabled
|
|
145
|
-
'data-disabled:bg-zinc-200 data-disabled:opacity-50 data-disabled:data-checked:bg-zinc-200 data-disabled:data-checked:ring-black/5', 'dark:data-disabled:bg-white/15 dark:data-disabled:data-checked:bg-white/15 dark:data-disabled:data-checked:ring-white/15',
|
|
146
|
-
// Color specific styles
|
|
147
|
-
colors[color]), children: _jsx("span", { "aria-hidden": "true", className: clsx(
|
|
148
|
-
// Basic layout
|
|
149
|
-
'pointer-events-none relative inline-block size-4.5 rounded-full sm:size-3.5',
|
|
150
|
-
// Transition
|
|
151
|
-
'translate-x-0 transition duration-200 ease-in-out',
|
|
152
|
-
// Invisible border so the switch is still visible in forced-colors mode
|
|
153
|
-
'border border-transparent',
|
|
154
|
-
// Unchecked
|
|
155
|
-
'bg-white shadow-sm ring-1 ring-black/5',
|
|
156
|
-
// Checked
|
|
157
|
-
'group-data-checked:bg-(--switch) group-data-checked:shadow-(--switch-shadow) group-data-checked:ring-(--switch-ring)', 'group-data-checked:translate-x-4 sm:group-data-checked:translate-x-3',
|
|
158
|
-
// Disabled
|
|
159
|
-
'group-data-checked:group-data-disabled:bg-white group-data-checked:group-data-disabled:shadow-sm group-data-checked:group-data-disabled:ring-black/5') }) })));
|
|
160
|
-
}
|
|
@@ -1,161 +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
|
-
export function SwitchGroup(_a) {
|
|
15
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
-
return (<div data-slot="control" {...props} className={clsx(className,
|
|
17
|
-
// Basic groups
|
|
18
|
-
'space-y-3 **:data-[slot=label]:font-normal',
|
|
19
|
-
// With descriptions
|
|
20
|
-
'has-data-[slot=description]:space-y-6 has-data-[slot=description]:**:data-[slot=label]:font-medium')}/>);
|
|
21
|
-
}
|
|
22
|
-
export function SwitchField(_a) {
|
|
23
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
-
return (<Headless.Field data-slot="field" {...props} className={clsx(className,
|
|
25
|
-
// Base layout
|
|
26
|
-
'grid grid-cols-[1fr_auto] gap-x-8 gap-y-1 sm:grid-cols-[1fr_auto]',
|
|
27
|
-
// Control layout
|
|
28
|
-
'*:data-[slot=control]:col-start-2 *:data-[slot=control]:self-start sm:*:data-[slot=control]:mt-0.5',
|
|
29
|
-
// Label layout
|
|
30
|
-
'*:data-[slot=label]:col-start-1 *:data-[slot=label]:row-start-1',
|
|
31
|
-
// Description layout
|
|
32
|
-
'*:data-[slot=description]:col-start-1 *:data-[slot=description]:row-start-2',
|
|
33
|
-
// With description
|
|
34
|
-
'has-data-[slot=description]:**:data-[slot=label]:font-medium')}/>);
|
|
35
|
-
}
|
|
36
|
-
const colors = {
|
|
37
|
-
'dark/zinc': [
|
|
38
|
-
'[--switch-bg-ring:var(--color-zinc-950)]/90 [--switch-bg:var(--color-zinc-900)] dark:[--switch-bg-ring:transparent] dark:[--switch-bg:var(--color-white)]/25',
|
|
39
|
-
'[--switch-ring:var(--color-zinc-950)]/90 [--switch-shadow:var(--color-black)]/10 [--switch:white] dark:[--switch-ring:var(--color-zinc-700)]/90',
|
|
40
|
-
],
|
|
41
|
-
'dark/white': [
|
|
42
|
-
'[--switch-bg-ring:var(--color-zinc-950)]/90 [--switch-bg:var(--color-zinc-900)] dark:[--switch-bg-ring:transparent] dark:[--switch-bg:var(--color-white)]',
|
|
43
|
-
'[--switch-ring:var(--color-zinc-950)]/90 [--switch-shadow:var(--color-black)]/10 [--switch:white] dark:[--switch-ring:transparent] dark:[--switch:var(--color-zinc-900)]',
|
|
44
|
-
],
|
|
45
|
-
dark: [
|
|
46
|
-
'[--switch-bg-ring:var(--color-zinc-950)]/90 [--switch-bg:var(--color-zinc-900)] dark:[--switch-bg-ring:var(--color-white)]/15',
|
|
47
|
-
'[--switch-ring:var(--color-zinc-950)]/90 [--switch-shadow:var(--color-black)]/10 [--switch:white]',
|
|
48
|
-
],
|
|
49
|
-
zinc: [
|
|
50
|
-
'[--switch-bg-ring:var(--color-zinc-700)]/90 [--switch-bg:var(--color-zinc-600)] dark:[--switch-bg-ring:transparent]',
|
|
51
|
-
'[--switch-shadow:var(--color-black)]/10 [--switch:white] [--switch-ring:var(--color-zinc-700)]/90',
|
|
52
|
-
],
|
|
53
|
-
white: [
|
|
54
|
-
'[--switch-bg-ring:var(--color-black)]/15 [--switch-bg:white] dark:[--switch-bg-ring:transparent]',
|
|
55
|
-
'[--switch-shadow:var(--color-black)]/10 [--switch-ring:transparent] [--switch:var(--color-zinc-950)]',
|
|
56
|
-
],
|
|
57
|
-
red: [
|
|
58
|
-
'[--switch-bg-ring:var(--color-red-700)]/90 [--switch-bg:var(--color-red-600)] dark:[--switch-bg-ring:transparent]',
|
|
59
|
-
'[--switch:white] [--switch-ring:var(--color-red-700)]/90 [--switch-shadow:var(--color-red-900)]/20',
|
|
60
|
-
],
|
|
61
|
-
orange: [
|
|
62
|
-
'[--switch-bg-ring:var(--color-orange-600)]/90 [--switch-bg:var(--color-orange-500)] dark:[--switch-bg-ring:transparent]',
|
|
63
|
-
'[--switch:white] [--switch-ring:var(--color-orange-600)]/90 [--switch-shadow:var(--color-orange-900)]/20',
|
|
64
|
-
],
|
|
65
|
-
amber: [
|
|
66
|
-
'[--switch-bg-ring:var(--color-amber-500)]/80 [--switch-bg:var(--color-amber-400)] dark:[--switch-bg-ring:transparent]',
|
|
67
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-amber-950)]',
|
|
68
|
-
],
|
|
69
|
-
yellow: [
|
|
70
|
-
'[--switch-bg-ring:var(--color-yellow-400)]/80 [--switch-bg:var(--color-yellow-300)] dark:[--switch-bg-ring:transparent]',
|
|
71
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-yellow-950)]',
|
|
72
|
-
],
|
|
73
|
-
lime: [
|
|
74
|
-
'[--switch-bg-ring:var(--color-lime-400)]/80 [--switch-bg:var(--color-lime-300)] dark:[--switch-bg-ring:transparent]',
|
|
75
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-lime-950)]',
|
|
76
|
-
],
|
|
77
|
-
green: [
|
|
78
|
-
'[--switch-bg-ring:var(--color-green-700)]/90 [--switch-bg:var(--color-green-600)] dark:[--switch-bg-ring:transparent]',
|
|
79
|
-
'[--switch:white] [--switch-ring:var(--color-green-700)]/90 [--switch-shadow:var(--color-green-900)]/20',
|
|
80
|
-
],
|
|
81
|
-
emerald: [
|
|
82
|
-
'[--switch-bg-ring:var(--color-emerald-600)]/90 [--switch-bg:var(--color-emerald-500)] dark:[--switch-bg-ring:transparent]',
|
|
83
|
-
'[--switch:white] [--switch-ring:var(--color-emerald-600)]/90 [--switch-shadow:var(--color-emerald-900)]/20',
|
|
84
|
-
],
|
|
85
|
-
teal: [
|
|
86
|
-
'[--switch-bg-ring:var(--color-teal-700)]/90 [--switch-bg:var(--color-teal-600)] dark:[--switch-bg-ring:transparent]',
|
|
87
|
-
'[--switch:white] [--switch-ring:var(--color-teal-700)]/90 [--switch-shadow:var(--color-teal-900)]/20',
|
|
88
|
-
],
|
|
89
|
-
cyan: [
|
|
90
|
-
'[--switch-bg-ring:var(--color-cyan-400)]/80 [--switch-bg:var(--color-cyan-300)] dark:[--switch-bg-ring:transparent]',
|
|
91
|
-
'[--switch-ring:transparent] [--switch-shadow:transparent] [--switch:var(--color-cyan-950)]',
|
|
92
|
-
],
|
|
93
|
-
sky: [
|
|
94
|
-
'[--switch-bg-ring:var(--color-sky-600)]/80 [--switch-bg:var(--color-sky-500)] dark:[--switch-bg-ring:transparent]',
|
|
95
|
-
'[--switch:white] [--switch-ring:var(--color-sky-600)]/80 [--switch-shadow:var(--color-sky-900)]/20',
|
|
96
|
-
],
|
|
97
|
-
blue: [
|
|
98
|
-
'[--switch-bg-ring:var(--color-blue-700)]/90 [--switch-bg:var(--color-blue-600)] dark:[--switch-bg-ring:transparent]',
|
|
99
|
-
'[--switch:white] [--switch-ring:var(--color-blue-700)]/90 [--switch-shadow:var(--color-blue-900)]/20',
|
|
100
|
-
],
|
|
101
|
-
indigo: [
|
|
102
|
-
'[--switch-bg-ring:var(--color-indigo-600)]/90 [--switch-bg:var(--color-indigo-500)] dark:[--switch-bg-ring:transparent]',
|
|
103
|
-
'[--switch:white] [--switch-ring:var(--color-indigo-600)]/90 [--switch-shadow:var(--color-indigo-900)]/20',
|
|
104
|
-
],
|
|
105
|
-
violet: [
|
|
106
|
-
'[--switch-bg-ring:var(--color-violet-600)]/90 [--switch-bg:var(--color-violet-500)] dark:[--switch-bg-ring:transparent]',
|
|
107
|
-
'[--switch:white] [--switch-ring:var(--color-violet-600)]/90 [--switch-shadow:var(--color-violet-900)]/20',
|
|
108
|
-
],
|
|
109
|
-
purple: [
|
|
110
|
-
'[--switch-bg-ring:var(--color-purple-600)]/90 [--switch-bg:var(--color-purple-500)] dark:[--switch-bg-ring:transparent]',
|
|
111
|
-
'[--switch:white] [--switch-ring:var(--color-purple-600)]/90 [--switch-shadow:var(--color-purple-900)]/20',
|
|
112
|
-
],
|
|
113
|
-
fuchsia: [
|
|
114
|
-
'[--switch-bg-ring:var(--color-fuchsia-600)]/90 [--switch-bg:var(--color-fuchsia-500)] dark:[--switch-bg-ring:transparent]',
|
|
115
|
-
'[--switch:white] [--switch-ring:var(--color-fuchsia-600)]/90 [--switch-shadow:var(--color-fuchsia-900)]/20',
|
|
116
|
-
],
|
|
117
|
-
pink: [
|
|
118
|
-
'[--switch-bg-ring:var(--color-pink-600)]/90 [--switch-bg:var(--color-pink-500)] dark:[--switch-bg-ring:transparent]',
|
|
119
|
-
'[--switch:white] [--switch-ring:var(--color-pink-600)]/90 [--switch-shadow:var(--color-pink-900)]/20',
|
|
120
|
-
],
|
|
121
|
-
rose: [
|
|
122
|
-
'[--switch-bg-ring:var(--color-rose-600)]/90 [--switch-bg:var(--color-rose-500)] dark:[--switch-bg-ring:transparent]',
|
|
123
|
-
'[--switch:white] [--switch-ring:var(--color-rose-600)]/90 [--switch-shadow:var(--color-rose-900)]/20',
|
|
124
|
-
],
|
|
125
|
-
};
|
|
126
|
-
export function Switch(_a) {
|
|
127
|
-
var { color = 'dark/zinc', className } = _a, props = __rest(_a, ["color", "className"]);
|
|
128
|
-
return (<Headless.Switch data-slot="control" {...props} className={clsx(className,
|
|
129
|
-
// Base styles
|
|
130
|
-
'group relative isolate inline-flex h-6 w-10 cursor-default rounded-full p-[3px] sm:h-5 sm:w-8',
|
|
131
|
-
// Transitions
|
|
132
|
-
'transition duration-0 ease-in-out data-changing:duration-200',
|
|
133
|
-
// Outline and background color in forced-colors mode so switch is still visible
|
|
134
|
-
'forced-colors:outline forced-colors:[--switch-bg:Highlight] dark:forced-colors:[--switch-bg:Highlight]',
|
|
135
|
-
// Unchecked
|
|
136
|
-
'bg-zinc-200 ring-1 ring-black/5 ring-inset dark:bg-white/5 dark:ring-white/15',
|
|
137
|
-
// Checked
|
|
138
|
-
'data-checked:bg-(--switch-bg) data-checked:ring-(--switch-bg-ring) dark:data-checked:bg-(--switch-bg) dark:data-checked:ring-(--switch-bg-ring)',
|
|
139
|
-
// Focus
|
|
140
|
-
'focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500',
|
|
141
|
-
// Hover
|
|
142
|
-
'data-hover:ring-black/15 data-hover:data-checked:ring-(--switch-bg-ring)', 'dark:data-hover:ring-white/25 dark:data-hover:data-checked:ring-(--switch-bg-ring)',
|
|
143
|
-
// Disabled
|
|
144
|
-
'data-disabled:bg-zinc-200 data-disabled:opacity-50 data-disabled:data-checked:bg-zinc-200 data-disabled:data-checked:ring-black/5', 'dark:data-disabled:bg-white/15 dark:data-disabled:data-checked:bg-white/15 dark:data-disabled:data-checked:ring-white/15',
|
|
145
|
-
// Color specific styles
|
|
146
|
-
colors[color])}>
|
|
147
|
-
<span aria-hidden="true" className={clsx(
|
|
148
|
-
// Basic layout
|
|
149
|
-
'pointer-events-none relative inline-block size-4.5 rounded-full sm:size-3.5',
|
|
150
|
-
// Transition
|
|
151
|
-
'translate-x-0 transition duration-200 ease-in-out',
|
|
152
|
-
// Invisible border so the switch is still visible in forced-colors mode
|
|
153
|
-
'border border-transparent',
|
|
154
|
-
// Unchecked
|
|
155
|
-
'bg-white shadow-sm ring-1 ring-black/5',
|
|
156
|
-
// Checked
|
|
157
|
-
'group-data-checked:bg-(--switch) group-data-checked:shadow-(--switch-shadow) group-data-checked:ring-(--switch-ring)', 'group-data-checked:translate-x-4 sm:group-data-checked:translate-x-3',
|
|
158
|
-
// Disabled
|
|
159
|
-
'group-data-checked:group-data-disabled:bg-white group-data-checked:group-data-disabled:shadow-sm group-data-checked:group-data-disabled:ring-black/5')}/>
|
|
160
|
-
</Headless.Switch>);
|
|
161
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export declare function Table({ bleed, dense, grid, striped, className, children, ...props }: {
|
|
3
|
-
bleed?: boolean;
|
|
4
|
-
dense?: boolean;
|
|
5
|
-
grid?: boolean;
|
|
6
|
-
striped?: boolean;
|
|
7
|
-
} & React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function TableHead({ className, ...props }: React.ComponentPropsWithoutRef<'thead'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function TableBody(props: React.ComponentPropsWithoutRef<'tbody'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function TableRow({ href, target, title, className, ...props }: {
|
|
11
|
-
href?: string;
|
|
12
|
-
target?: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
} & React.ComponentPropsWithoutRef<'tr'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function TableHeader({ className, ...props }: React.ComponentPropsWithoutRef<'th'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function TableCell({ className, children, ...props }: React.ComponentPropsWithoutRef<'td'>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../source/catalyst/table.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,wBAAgB,KAAK,CAAC,EACpB,KAAa,EACb,KAAa,EACb,IAAY,EACZ,OAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAYjH;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,2CAEzF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,2CAEvE;AAQD,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAkB3F;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAcxF;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CA+BhG"}
|
package/output/catalyst/table.js
DELETED
|
@@ -1,56 +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 clsx from 'clsx';
|
|
15
|
-
import { createContext, useContext, useState } from 'react';
|
|
16
|
-
import { Link } from './link';
|
|
17
|
-
const TableContext = createContext({
|
|
18
|
-
bleed: false,
|
|
19
|
-
dense: false,
|
|
20
|
-
grid: false,
|
|
21
|
-
striped: false,
|
|
22
|
-
});
|
|
23
|
-
export function Table(_a) {
|
|
24
|
-
var { bleed = false, dense = false, grid = false, striped = false, className, children } = _a, props = __rest(_a, ["bleed", "dense", "grid", "striped", "className", "children"]);
|
|
25
|
-
return (_jsx(TableContext.Provider, { value: { bleed, dense, grid, striped }, children: _jsx("div", { className: "flow-root", children: _jsx("div", Object.assign({}, props, { className: clsx(className, '-mx-(--gutter) overflow-x-auto whitespace-nowrap'), children: _jsx("div", { className: clsx('inline-block min-w-full align-middle', !bleed && 'sm:px-(--gutter)'), children: _jsx("table", { className: "min-w-full text-left text-sm/6 text-zinc-950 dark:text-white", children: children }) }) })) }) }));
|
|
26
|
-
}
|
|
27
|
-
export function TableHead(_a) {
|
|
28
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
-
return _jsx("thead", Object.assign({}, props, { className: clsx(className, 'text-zinc-500 dark:text-zinc-400') }));
|
|
30
|
-
}
|
|
31
|
-
export function TableBody(props) {
|
|
32
|
-
return _jsx("tbody", Object.assign({}, props));
|
|
33
|
-
}
|
|
34
|
-
const TableRowContext = createContext({
|
|
35
|
-
href: undefined,
|
|
36
|
-
target: undefined,
|
|
37
|
-
title: undefined,
|
|
38
|
-
});
|
|
39
|
-
export function TableRow(_a) {
|
|
40
|
-
var { href, target, title, className } = _a, props = __rest(_a, ["href", "target", "title", "className"]);
|
|
41
|
-
let { striped } = useContext(TableContext);
|
|
42
|
-
return (_jsx(TableRowContext.Provider, { value: { href, target, title }, children: _jsx("tr", Object.assign({}, props, { className: clsx(className, href &&
|
|
43
|
-
'has-[[data-row-link][data-focus]]:outline-2 has-[[data-row-link][data-focus]]:-outline-offset-2 has-[[data-row-link][data-focus]]:outline-blue-500 dark:focus-within:bg-white/2.5', striped && 'even:bg-zinc-950/2.5 dark:even:bg-white/2.5', href && striped && 'hover:bg-zinc-950/5 dark:hover:bg-white/5', href && !striped && 'hover:bg-zinc-950/2.5 dark:hover:bg-white/2.5') })) }));
|
|
44
|
-
}
|
|
45
|
-
export function TableHeader(_a) {
|
|
46
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
47
|
-
let { bleed, grid } = useContext(TableContext);
|
|
48
|
-
return (_jsx("th", Object.assign({}, props, { className: clsx(className, 'border-b border-b-zinc-950/10 px-4 py-2 font-medium first:pl-(--gutter,--spacing(2)) last:pr-(--gutter,--spacing(2)) dark:border-b-white/10', grid && 'border-l border-l-zinc-950/5 first:border-l-0 dark:border-l-white/5', !bleed && 'sm:first:pl-1 sm:last:pr-1') })));
|
|
49
|
-
}
|
|
50
|
-
export function TableCell(_a) {
|
|
51
|
-
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
52
|
-
let { bleed, dense, grid, striped } = useContext(TableContext);
|
|
53
|
-
let { href, target, title } = useContext(TableRowContext);
|
|
54
|
-
let [cellRef, setCellRef] = useState(null);
|
|
55
|
-
return (_jsxs("td", Object.assign({ ref: href ? setCellRef : undefined }, props, { className: clsx(className, 'relative px-4 first:pl-(--gutter,--spacing(2)) last:pr-(--gutter,--spacing(2))', !striped && 'border-b border-zinc-950/5 dark:border-white/5', grid && 'border-l border-l-zinc-950/5 first:border-l-0 dark:border-l-white/5', dense ? 'py-2.5' : 'py-4', !bleed && 'sm:first:pl-1 sm:last:pr-1'), children: [href && (_jsx(Link, { "data-row-link": true, href: href, target: target, "aria-label": title, tabIndex: (cellRef === null || cellRef === void 0 ? void 0 : cellRef.previousElementSibling) === null ? 0 : -1, className: "absolute inset-0 focus:outline-hidden" })), children] })));
|
|
56
|
-
}
|
|
@@ -1,68 +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 clsx from 'clsx';
|
|
14
|
-
import { createContext, useContext, useState } from 'react';
|
|
15
|
-
import { Link } from './link';
|
|
16
|
-
const TableContext = createContext({
|
|
17
|
-
bleed: false,
|
|
18
|
-
dense: false,
|
|
19
|
-
grid: false,
|
|
20
|
-
striped: false,
|
|
21
|
-
});
|
|
22
|
-
export function Table(_a) {
|
|
23
|
-
var { bleed = false, dense = false, grid = false, striped = false, className, children } = _a, props = __rest(_a, ["bleed", "dense", "grid", "striped", "className", "children"]);
|
|
24
|
-
return (<TableContext.Provider value={{ bleed, dense, grid, striped }}>
|
|
25
|
-
<div className="flow-root">
|
|
26
|
-
<div {...props} className={clsx(className, '-mx-(--gutter) overflow-x-auto whitespace-nowrap')}>
|
|
27
|
-
<div className={clsx('inline-block min-w-full align-middle', !bleed && 'sm:px-(--gutter)')}>
|
|
28
|
-
<table className="min-w-full text-left text-sm/6 text-zinc-950 dark:text-white">{children}</table>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</TableContext.Provider>);
|
|
33
|
-
}
|
|
34
|
-
export function TableHead(_a) {
|
|
35
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
36
|
-
return <thead {...props} className={clsx(className, 'text-zinc-500 dark:text-zinc-400')}/>;
|
|
37
|
-
}
|
|
38
|
-
export function TableBody(props) {
|
|
39
|
-
return <tbody {...props}/>;
|
|
40
|
-
}
|
|
41
|
-
const TableRowContext = createContext({
|
|
42
|
-
href: undefined,
|
|
43
|
-
target: undefined,
|
|
44
|
-
title: undefined,
|
|
45
|
-
});
|
|
46
|
-
export function TableRow(_a) {
|
|
47
|
-
var { href, target, title, className } = _a, props = __rest(_a, ["href", "target", "title", "className"]);
|
|
48
|
-
let { striped } = useContext(TableContext);
|
|
49
|
-
return (<TableRowContext.Provider value={{ href, target, title }}>
|
|
50
|
-
<tr {...props} className={clsx(className, href &&
|
|
51
|
-
'has-[[data-row-link][data-focus]]:outline-2 has-[[data-row-link][data-focus]]:-outline-offset-2 has-[[data-row-link][data-focus]]:outline-blue-500 dark:focus-within:bg-white/2.5', striped && 'even:bg-zinc-950/2.5 dark:even:bg-white/2.5', href && striped && 'hover:bg-zinc-950/5 dark:hover:bg-white/5', href && !striped && 'hover:bg-zinc-950/2.5 dark:hover:bg-white/2.5')}/>
|
|
52
|
-
</TableRowContext.Provider>);
|
|
53
|
-
}
|
|
54
|
-
export function TableHeader(_a) {
|
|
55
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
56
|
-
let { bleed, grid } = useContext(TableContext);
|
|
57
|
-
return (<th {...props} className={clsx(className, 'border-b border-b-zinc-950/10 px-4 py-2 font-medium first:pl-(--gutter,--spacing(2)) last:pr-(--gutter,--spacing(2)) dark:border-b-white/10', grid && 'border-l border-l-zinc-950/5 first:border-l-0 dark:border-l-white/5', !bleed && 'sm:first:pl-1 sm:last:pr-1')}/>);
|
|
58
|
-
}
|
|
59
|
-
export function TableCell(_a) {
|
|
60
|
-
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
61
|
-
let { bleed, dense, grid, striped } = useContext(TableContext);
|
|
62
|
-
let { href, target, title } = useContext(TableRowContext);
|
|
63
|
-
let [cellRef, setCellRef] = useState(null);
|
|
64
|
-
return (<td ref={href ? setCellRef : undefined} {...props} className={clsx(className, 'relative px-4 first:pl-(--gutter,--spacing(2)) last:pr-(--gutter,--spacing(2))', !striped && 'border-b border-zinc-950/5 dark:border-white/5', grid && 'border-l border-l-zinc-950/5 first:border-l-0 dark:border-l-white/5', dense ? 'py-2.5' : 'py-4', !bleed && 'sm:first:pl-1 sm:last:pr-1')}>
|
|
65
|
-
{href && (<Link data-row-link href={href} target={target} aria-label={title} tabIndex={(cellRef === null || cellRef === void 0 ? void 0 : cellRef.previousElementSibling) === null ? 0 : -1} className="absolute inset-0 focus:outline-hidden"/>)}
|
|
66
|
-
{children}
|
|
67
|
-
</td>);
|
|
68
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Link } from './link';
|
|
2
|
-
export declare function Text({ className, ...props }: React.ComponentPropsWithoutRef<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare function TextLink({ className, ...props }: React.ComponentPropsWithoutRef<typeof Link>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function Strong({ className, ...props }: React.ComponentPropsWithoutRef<'strong'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare function Code({ className, ...props }: React.ComponentPropsWithoutRef<'code'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../source/catalyst/text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,2CAQhF;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,IAAI,CAAC,2CAU5F;AAED,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,2CAEvF;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAUnF"}
|
package/output/catalyst/text.js
DELETED
|
@@ -1,30 +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
|
-
import { Link } from './link';
|
|
15
|
-
export function Text(_a) {
|
|
16
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
-
return (_jsx("p", Object.assign({ "data-slot": "text" }, props, { className: clsx(className, 'text-base/6 text-zinc-500 sm:text-sm/6 dark:text-zinc-400') })));
|
|
18
|
-
}
|
|
19
|
-
export function TextLink(_a) {
|
|
20
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
-
return (_jsx(Link, Object.assign({}, props, { className: clsx(className, 'text-zinc-950 underline decoration-zinc-950/50 data-hover:decoration-zinc-950 dark:text-white dark:decoration-white/50 dark:data-hover:decoration-white') })));
|
|
22
|
-
}
|
|
23
|
-
export function Strong(_a) {
|
|
24
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
25
|
-
return _jsx("strong", Object.assign({}, props, { className: clsx(className, 'font-medium text-zinc-950 dark:text-white') }));
|
|
26
|
-
}
|
|
27
|
-
export function Code(_a) {
|
|
28
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
-
return (_jsx("code", Object.assign({}, props, { className: clsx(className, 'rounded-sm border border-zinc-950/10 bg-zinc-950/2.5 px-0.5 text-sm font-medium text-zinc-950 sm:text-[0.8125rem] dark:border-white/20 dark:bg-white/5 dark:text-white') })));
|
|
30
|
-
}
|
package/output/catalyst/text.jsx
DELETED
|
@@ -1,29 +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
|
-
import { Link } from './link';
|
|
14
|
-
export function Text(_a) {
|
|
15
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
-
return (<p data-slot="text" {...props} className={clsx(className, 'text-base/6 text-zinc-500 sm:text-sm/6 dark:text-zinc-400')}/>);
|
|
17
|
-
}
|
|
18
|
-
export function TextLink(_a) {
|
|
19
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
20
|
-
return (<Link {...props} className={clsx(className, 'text-zinc-950 underline decoration-zinc-950/50 data-hover:decoration-zinc-950 dark:text-white dark:decoration-white/50 dark:data-hover:decoration-white')}/>);
|
|
21
|
-
}
|
|
22
|
-
export function Strong(_a) {
|
|
23
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
-
return <strong {...props} className={clsx(className, 'font-medium text-zinc-950 dark:text-white')}/>;
|
|
25
|
-
}
|
|
26
|
-
export function Code(_a) {
|
|
27
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
28
|
-
return (<code {...props} className={clsx(className, 'rounded-sm border border-zinc-950/10 bg-zinc-950/2.5 px-0.5 text-sm font-medium text-zinc-950 sm:text-[0.8125rem] dark:border-white/20 dark:bg-white/5 dark:text-white')}/>);
|
|
29
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare const Textarea: React.ForwardRefExoticComponent<{
|
|
4
|
-
className?: string;
|
|
5
|
-
resizable?: boolean;
|
|
6
|
-
} & Omit<Headless.TextareaProps<"textarea">, "className" | "as"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
7
|
-
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../source/catalyst/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,eAAO,MAAM,QAAQ;gBAKF,MAAM;gBAAc,OAAO;4GA4C5C,CAAA"}
|
|
@@ -1,48 +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 * as Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { forwardRef } from 'react';
|
|
16
|
-
export const Textarea = forwardRef(function Textarea(_a, ref) {
|
|
17
|
-
var { className, resizable = true } = _a, props = __rest(_a, ["className", "resizable"]);
|
|
18
|
-
return (_jsx("span", { "data-slot": "control", className: clsx([
|
|
19
|
-
className,
|
|
20
|
-
// Basic layout
|
|
21
|
-
'relative block w-full',
|
|
22
|
-
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
23
|
-
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
24
|
-
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
25
|
-
'dark:before:hidden',
|
|
26
|
-
// Focus ring
|
|
27
|
-
'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',
|
|
28
|
-
// Disabled state
|
|
29
|
-
'has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none',
|
|
30
|
-
]), children: _jsx(Headless.Textarea, Object.assign({ ref: ref }, props, { className: clsx([
|
|
31
|
-
// Basic layout
|
|
32
|
-
'relative block h-full w-full appearance-none rounded-lg px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)]',
|
|
33
|
-
// Typography
|
|
34
|
-
'text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white',
|
|
35
|
-
// Border
|
|
36
|
-
'border border-zinc-950/10 data-hover:border-zinc-950/20 dark:border-white/10 dark:data-hover:border-white/20',
|
|
37
|
-
// Background color
|
|
38
|
-
'bg-transparent dark:bg-white/5',
|
|
39
|
-
// Hide default focus styles
|
|
40
|
-
'focus:outline-hidden',
|
|
41
|
-
// Invalid state
|
|
42
|
-
'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',
|
|
43
|
-
// Disabled state
|
|
44
|
-
'disabled:border-zinc-950/20 dark:disabled:border-white/15 dark:disabled:bg-white/2.5 dark:data-hover:disabled:border-white/15',
|
|
45
|
-
// Resizable
|
|
46
|
-
resizable ? 'resize-y' : 'resize-none',
|
|
47
|
-
]) })) }));
|
|
48
|
-
});
|