@hanzo/ui 4.5.3 → 4.6.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/README-MCP.md +3 -3
- package/README.md +229 -0
- package/assets/ai-icons.tsx +207 -0
- package/assets/crypto.tsx +33 -0
- package/assets/file-type-icon.tsx +66 -0
- package/assets/file.tsx +45 -0
- package/assets/general.tsx +2318 -0
- package/assets/hanzo-logo.svg +9 -0
- package/assets/hanzo-logo.tsx +15 -0
- package/assets/index.ts +8 -0
- package/assets/index.tsx +4 -0
- package/assets/llm-provider.tsx +1094 -0
- package/bin/create-registry.js +1 -1
- package/bin/test-mcp.sh +1 -1
- package/bin/update-registry.js +2 -2
- package/blocks/components/content.tsx +1 -1
- package/blocks/components/grid-block/index.tsx +1 -1
- package/blocks/components/screenful-block/content.tsx +1 -1
- package/blocks/components/screenful-block/poster-background.tsx +1 -1
- package/components/index.ts +56 -0
- package/dist/button.d.ts +1 -0
- package/dist/button.js +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/use-click-away.d.ts +2 -0
- package/dist/hooks/use-click-away.js +23 -0
- package/dist/hooks/use-combined-refs.d.ts +3 -0
- package/dist/hooks/use-combined-refs.js +18 -0
- package/dist/hooks/use-copy-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-clipboard.js +21 -0
- package/dist/hooks/use-debounce.d.ts +1 -0
- package/dist/hooks/use-debounce.js +13 -0
- package/dist/hooks/use-fill-ids.d.ts +8 -0
- package/dist/hooks/use-fill-ids.js +20 -0
- package/dist/hooks/use-map.d.ts +1 -0
- package/dist/hooks/use-map.js +20 -0
- package/dist/hooks/use-measure.d.ts +8 -0
- package/dist/hooks/use-measure.js +25 -0
- package/dist/hooks/use-reverse-video-playback.d.ts +1 -0
- package/dist/hooks/use-reverse-video-playback.js +41 -0
- package/dist/hooks/use-scroll-restoration.d.ts +8 -0
- package/dist/hooks/use-scroll-restoration.js +36 -0
- package/dist/mcp/enhanced-server.js +3 -3
- package/dist/mcp/index.js +1 -1
- package/dist/registry/api.d.ts +1 -1
- package/dist/registry/api.js +3 -4
- package/dist/registry/index.d.ts +348 -4
- package/dist/registry/index.js +3 -3
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/helpers/file.ts +33 -0
- package/helpers/memoization.ts +40 -0
- package/package.json +27 -6
- package/primitives/accordion.tsx +53 -45
- package/primitives/alert-dialog.tsx +185 -0
- package/primitives/alert.tsx +74 -0
- package/primitives/apply-typography.tsx +1 -1
- package/primitives/avatar.tsx +37 -29
- package/primitives/background-beams.tsx +142 -0
- package/primitives/badge.tsx +27 -19
- package/primitives/breadcrumb.tsx +77 -62
- package/primitives/button.tsx +69 -72
- package/primitives/card.tsx +73 -59
- package/primitives/chat/chat-input-area.tsx +87 -0
- package/primitives/chat/chat-input.tsx +71 -0
- package/primitives/chat/files-preview.tsx +330 -0
- package/primitives/chat/index.ts +6 -0
- package/primitives/chat/json-form.tsx +8 -0
- package/primitives/chat/message-list.tsx +307 -0
- package/primitives/chat/message.tsx +569 -0
- package/primitives/chat/sqlite-preview.tsx +215 -0
- package/primitives/checkbox.tsx +18 -19
- package/primitives/collapsible.tsx +9 -0
- package/primitives/command.tsx +75 -83
- package/primitives/context-menu.tsx +115 -109
- package/primitives/copy-to-clipboard-icon.tsx +60 -0
- package/primitives/dialog-video-controller.tsx +1 -1
- package/primitives/dialog.tsx +111 -145
- package/primitives/dot-pattern.tsx +57 -0
- package/primitives/dots-loader.tsx +13 -0
- package/primitives/drawer.tsx +59 -87
- package/primitives/dropdown-menu.tsx +199 -0
- package/primitives/error-message.tsx +19 -0
- package/primitives/file-uploader.tsx +200 -0
- package/primitives/form.tsx +92 -87
- package/primitives/hover-card.tsx +28 -0
- package/primitives/icons/github.tsx +1 -1
- package/primitives/icons/youtube-logo.tsx +1 -1
- package/primitives/index-common.ts +121 -42
- package/primitives/index-next.ts +3 -1
- package/primitives/input.tsx +115 -20
- package/primitives/label.tsx +15 -23
- package/primitives/loading-spinner.tsx +1 -1
- package/primitives/markdown-preview.tsx +609 -0
- package/primitives/mermaid.tsx +196 -0
- package/primitives/next/link-element.tsx +1 -1
- package/primitives/next/mdx-link.tsx +1 -1
- package/primitives/pagination.tsx +117 -0
- package/primitives/popover.tsx +20 -25
- package/primitives/pretty-json-print.tsx +28 -0
- package/primitives/progress.tsx +14 -15
- package/primitives/prompt-textarea.tsx +72 -0
- package/primitives/qr-code.tsx +112 -0
- package/primitives/radio-group.tsx +25 -39
- package/primitives/resizable.tsx +47 -0
- package/primitives/scroll-area.tsx +35 -25
- package/primitives/search-input.tsx +66 -0
- package/primitives/select.tsx +62 -109
- package/primitives/separator.tsx +22 -26
- package/primitives/sheet.tsx +78 -117
- package/primitives/skeleton.tsx +13 -16
- package/primitives/slider.tsx +50 -60
- package/primitives/stepper.tsx +272 -0
- package/primitives/switch.tsx +14 -23
- package/primitives/table.tsx +65 -77
- package/primitives/tabs.tsx +29 -39
- package/primitives/text-link.tsx +25 -0
- package/primitives/textarea.tsx +61 -0
- package/primitives/textfield.tsx +75 -0
- package/primitives/toast.tsx +30 -0
- package/primitives/toggle-group.tsx +33 -33
- package/primitives/toggle.tsx +22 -51
- package/primitives/tooltip.tsx +37 -38
- package/registry.json +1 -1
- package/src/button.ts +1 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/use-click-away.ts +31 -0
- package/src/hooks/use-combined-refs.ts +22 -0
- package/src/hooks/use-copy-clipboard.ts +30 -0
- package/src/hooks/use-debounce.ts +17 -0
- package/src/hooks/use-fill-ids.ts +25 -0
- package/src/hooks/use-map.ts +26 -0
- package/src/hooks/use-measure.ts +42 -0
- package/src/hooks/use-reverse-video-playback.ts +43 -0
- package/src/hooks/use-scroll-restoration.ts +50 -0
- package/{mcp → src/mcp}/README.md +1 -1
- package/{mcp → src/mcp}/enhanced-server.ts +2 -2
- package/{registry → src/registry}/api.ts +3 -3
- package/{registry → src/registry}/index.ts +3 -3
- package/src/utils.ts +1 -0
- package/style/theme-provider.tsx +1 -1
- package/test-imports.mjs +19 -0
- package/tsconfig.json +9 -4
- package/types/animation-def.ts +1 -1
- package/types/button-def.ts +1 -1
- package/types/index.ts +1 -1
- package/util/blob.ts +28 -0
- package/util/copy-to-clipboard.ts +17 -0
- package/util/create-shadow-root.ts +22 -0
- package/util/date.ts +83 -0
- package/util/debounce.ts +11 -0
- package/util/file.ts +15 -0
- package/util/format-and-abbreviate-as-currency.ts +1 -1
- package/util/format-text.ts +33 -0
- package/util/index.ts +9 -78
- package/util/timing.ts +3 -0
- package/util/toasts.tsx +17 -0
- package/utils.ts +9 -0
- package/dist/blocks/components/accordian-block.d.ts +0 -4
- package/dist/blocks/components/accordian-block.jsx +0 -25
- package/dist/blocks/components/block-component-props.d.ts +0 -7
- package/dist/blocks/components/block-component-props.js +0 -1
- package/dist/blocks/components/bullet-cards-block.d.ts +0 -4
- package/dist/blocks/components/bullet-cards-block.jsx +0 -25
- package/dist/blocks/components/card-block/index.d.ts +0 -6
- package/dist/blocks/components/card-block/index.jsx +0 -87
- package/dist/blocks/components/card-block/link-out-button.d.ts +0 -6
- package/dist/blocks/components/card-block/link-out-button.jsx +0 -4
- package/dist/blocks/components/card-block/util.d.ts +0 -4
- package/dist/blocks/components/card-block/util.js +0 -6
- package/dist/blocks/components/carte-blanche-block/index.d.ts +0 -4
- package/dist/blocks/components/carte-blanche-block/index.jsx +0 -82
- package/dist/blocks/components/carte-blanche-block/variant-content-left.d.ts +0 -10
- package/dist/blocks/components/carte-blanche-block/variant-content-left.jsx +0 -23
- package/dist/blocks/components/content.d.ts +0 -10
- package/dist/blocks/components/content.jsx +0 -47
- package/dist/blocks/components/cta-block.d.ts +0 -12
- package/dist/blocks/components/cta-block.jsx +0 -69
- package/dist/blocks/components/enh-heading-block.d.ts +0 -7
- package/dist/blocks/components/enh-heading-block.jsx +0 -142
- package/dist/blocks/components/grid-block/grid-block-mutator.d.ts +0 -5
- package/dist/blocks/components/grid-block/grid-block-mutator.js +0 -1
- package/dist/blocks/components/grid-block/index.d.ts +0 -9
- package/dist/blocks/components/grid-block/index.jsx +0 -56
- package/dist/blocks/components/grid-block/mutator-registry.d.ts +0 -3
- package/dist/blocks/components/grid-block/mutator-registry.js +0 -5
- package/dist/blocks/components/grid-block/table-borders.mutator.d.ts +0 -3
- package/dist/blocks/components/grid-block/table-borders.mutator.js +0 -36
- package/dist/blocks/components/group-block.d.ts +0 -7
- package/dist/blocks/components/group-block.jsx +0 -61
- package/dist/blocks/components/heading-block.d.ts +0 -4
- package/dist/blocks/components/heading-block.jsx +0 -99
- package/dist/blocks/components/image-block.d.ts +0 -7
- package/dist/blocks/components/image-block.jsx +0 -69
- package/dist/blocks/components/index.d.ts +0 -14
- package/dist/blocks/components/index.js +0 -13
- package/dist/blocks/components/screenful-block/content.d.ts +0 -8
- package/dist/blocks/components/screenful-block/content.jsx +0 -71
- package/dist/blocks/components/screenful-block/index.d.ts +0 -12
- package/dist/blocks/components/screenful-block/index.jsx +0 -57
- package/dist/blocks/components/screenful-block/poster-background.d.ts +0 -7
- package/dist/blocks/components/screenful-block/poster-background.jsx +0 -14
- package/dist/blocks/components/screenful-block/video-background.d.ts +0 -8
- package/dist/blocks/components/screenful-block/video-background.jsx +0 -20
- package/dist/blocks/components/space-block.d.ts +0 -4
- package/dist/blocks/components/space-block.jsx +0 -42
- package/dist/blocks/components/video-block.d.ts +0 -9
- package/dist/blocks/components/video-block.jsx +0 -83
- package/dist/blocks/def/accordian-block.d.ts +0 -10
- package/dist/blocks/def/accordian-block.js +0 -2
- package/dist/blocks/def/block.d.ts +0 -4
- package/dist/blocks/def/block.js +0 -1
- package/dist/blocks/def/bullet-cards-block.d.ts +0 -17
- package/dist/blocks/def/bullet-cards-block.js +0 -1
- package/dist/blocks/def/card-block.d.ts +0 -17
- package/dist/blocks/def/card-block.js +0 -2
- package/dist/blocks/def/carte-blanche-block.d.ts +0 -12
- package/dist/blocks/def/carte-blanche-block.js +0 -1
- package/dist/blocks/def/cta-block.d.ts +0 -8
- package/dist/blocks/def/cta-block.js +0 -1
- package/dist/blocks/def/element-block.d.ts +0 -7
- package/dist/blocks/def/element-block.js +0 -2
- package/dist/blocks/def/enh-heading-block.d.ts +0 -22
- package/dist/blocks/def/enh-heading-block.js +0 -1
- package/dist/blocks/def/grid-block.d.ts +0 -12
- package/dist/blocks/def/grid-block.js +0 -1
- package/dist/blocks/def/group-block.d.ts +0 -7
- package/dist/blocks/def/group-block.js +0 -1
- package/dist/blocks/def/heading-block.d.ts +0 -11
- package/dist/blocks/def/heading-block.js +0 -1
- package/dist/blocks/def/image-block.d.ts +0 -26
- package/dist/blocks/def/image-block.js +0 -1
- package/dist/blocks/def/index.d.ts +0 -17
- package/dist/blocks/def/index.js +0 -2
- package/dist/blocks/def/screenful-block.d.ts +0 -41
- package/dist/blocks/def/screenful-block.js +0 -1
- package/dist/blocks/def/space-block.d.ts +0 -47
- package/dist/blocks/def/space-block.js +0 -8
- package/dist/blocks/def/video-block.d.ts +0 -5
- package/dist/blocks/def/video-block.js +0 -1
- package/dist/blocks/index.d.ts +0 -2
- package/dist/blocks/index.js +0 -2
- package/dist/primitives/accordion.d.ts +0 -10
- package/dist/primitives/accordion.jsx +0 -21
- package/dist/primitives/action-button.d.ts +0 -9
- package/dist/primitives/action-button.jsx +0 -16
- package/dist/primitives/apply-typography.d.ts +0 -7
- package/dist/primitives/apply-typography.jsx +0 -38
- package/dist/primitives/aspect-ratio.d.ts +0 -3
- package/dist/primitives/aspect-ratio.jsx +0 -4
- package/dist/primitives/avatar.d.ts +0 -6
- package/dist/primitives/avatar.jsx +0 -11
- package/dist/primitives/badge.d.ts +0 -9
- package/dist/primitives/badge.jsx +0 -18
- package/dist/primitives/breadcrumb.d.ts +0 -19
- package/dist/primitives/breadcrumb.jsx +0 -27
- package/dist/primitives/breakpoint-indicator.d.ts +0 -3
- package/dist/primitives/breakpoint-indicator.jsx +0 -14
- package/dist/primitives/button.d.ts +0 -12
- package/dist/primitives/button.jsx +0 -55
- package/dist/primitives/calendar.d.ts +0 -8
- package/dist/primitives/calendar.jsx +0 -40
- package/dist/primitives/card.d.ts +0 -8
- package/dist/primitives/card.jsx +0 -18
- package/dist/primitives/carousel.d.ts +0 -18
- package/dist/primitives/carousel.jsx +0 -106
- package/dist/primitives/checkbox.d.ts +0 -4
- package/dist/primitives/checkbox.jsx +0 -15
- package/dist/primitives/combobox.d.ts +0 -41
- package/dist/primitives/combobox.jsx +0 -77
- package/dist/primitives/command.d.ts +0 -17
- package/dist/primitives/command.jsx +0 -38
- package/dist/primitives/context-menu.d.ts +0 -27
- package/dist/primitives/context-menu.jsx +0 -57
- package/dist/primitives/dialog-video-controller.d.ts +0 -3
- package/dist/primitives/dialog-video-controller.jsx +0 -24
- package/dist/primitives/dialog.d.ts +0 -28
- package/dist/primitives/dialog.jsx +0 -37
- package/dist/primitives/drawer.d.ts +0 -29
- package/dist/primitives/drawer.jsx +0 -34
- package/dist/primitives/form.d.ts +0 -12
- package/dist/primitives/form.jsx +0 -69
- package/dist/primitives/icons/github.d.ts +0 -4
- package/dist/primitives/icons/github.jsx +0 -6
- package/dist/primitives/icons/index.d.ts +0 -4
- package/dist/primitives/icons/index.js +0 -4
- package/dist/primitives/icons/youtube-logo.d.ts +0 -4
- package/dist/primitives/icons/youtube-logo.jsx +0 -39
- package/dist/primitives/index-common.d.ts +0 -47
- package/dist/primitives/index-common.js +0 -46
- package/dist/primitives/index-next.d.ts +0 -2
- package/dist/primitives/index-next.js +0 -2
- package/dist/primitives/input-otp.d.ts +0 -7
- package/dist/primitives/input-otp.jsx +0 -24
- package/dist/primitives/input.d.ts +0 -5
- package/dist/primitives/input.jsx +0 -11
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.jsx +0 -11
- package/dist/primitives/list-adaptor.d.ts +0 -9
- package/dist/primitives/list-adaptor.js +0 -1
- package/dist/primitives/list-box.d.ts +0 -10
- package/dist/primitives/list-box.jsx +0 -14
- package/dist/primitives/loading-spinner.d.ts +0 -5
- package/dist/primitives/loading-spinner.jsx +0 -8
- package/dist/primitives/navigation-menu.d.ts +0 -12
- package/dist/primitives/navigation-menu.jsx +0 -38
- package/dist/primitives/next/image.d.ts +0 -11
- package/dist/primitives/next/image.jsx +0 -42
- package/dist/primitives/next/index.d.ts +0 -7
- package/dist/primitives/next/index.js +0 -7
- package/dist/primitives/next/inline-icon.d.ts +0 -13
- package/dist/primitives/next/inline-icon.jsx +0 -15
- package/dist/primitives/next/link-element.d.ts +0 -23
- package/dist/primitives/next/link-element.jsx +0 -56
- package/dist/primitives/next/mdx-link.d.ts +0 -3
- package/dist/primitives/next/mdx-link.jsx +0 -12
- package/dist/primitives/next/media-stack.d.ts +0 -8
- package/dist/primitives/next/media-stack.jsx +0 -28
- package/dist/primitives/next/nav-items.d.ts +0 -10
- package/dist/primitives/next/nav-items.jsx +0 -24
- package/dist/primitives/next/youtube-embed.d.ts +0 -11
- package/dist/primitives/next/youtube-embed.jsx +0 -23
- package/dist/primitives/popover.d.ts +0 -9
- package/dist/primitives/popover.jsx +0 -18
- package/dist/primitives/progress.d.ts +0 -4
- package/dist/primitives/progress.jsx +0 -9
- package/dist/primitives/radio-group.d.ts +0 -7
- package/dist/primitives/radio-group.jsx +0 -18
- package/dist/primitives/scroll-area.d.ts +0 -5
- package/dist/primitives/scroll-area.jsx +0 -19
- package/dist/primitives/select.d.ts +0 -13
- package/dist/primitives/select.jsx +0 -62
- package/dist/primitives/separator.d.ts +0 -4
- package/dist/primitives/separator.jsx +0 -7
- package/dist/primitives/sheet.d.ts +0 -30
- package/dist/primitives/sheet.jsx +0 -56
- package/dist/primitives/skeleton.d.ts +0 -4
- package/dist/primitives/skeleton.jsx +0 -3
- package/dist/primitives/slider.d.ts +0 -9
- package/dist/primitives/slider.jsx +0 -30
- package/dist/primitives/sonner.d.ts +0 -5
- package/dist/primitives/sonner.jsx +0 -16
- package/dist/primitives/step-indicator.d.ts +0 -9
- package/dist/primitives/step-indicator.jsx +0 -23
- package/dist/primitives/switch.d.ts +0 -6
- package/dist/primitives/switch.jsx +0 -14
- package/dist/primitives/table.d.ts +0 -10
- package/dist/primitives/table.jsx +0 -21
- package/dist/primitives/tabs.d.ts +0 -7
- package/dist/primitives/tabs.jsx +0 -18
- package/dist/primitives/text-area.d.ts +0 -5
- package/dist/primitives/text-area.jsx +0 -9
- package/dist/primitives/toggle-group.d.ts +0 -14
- package/dist/primitives/toggle-group.jsx +0 -28
- package/dist/primitives/toggle.d.ts +0 -14
- package/dist/primitives/toggle.jsx +0 -52
- package/dist/primitives/tooltip.d.ts +0 -11
- package/dist/primitives/tooltip.jsx +0 -18
- package/dist/primitives/video-player.d.ts +0 -6
- package/dist/primitives/video-player.jsx +0 -8
- package/dist/style/theme-provider.d.ts +0 -4
- package/dist/style/theme-provider.jsx +0 -11
- package/dist/tailwind/fontFamily.tailwind.d.ts +0 -8
- package/dist/tailwind/fontFamily.tailwind.js +0 -7
- package/dist/tailwind/fontSize.tailwind.d.ts +0 -36
- package/dist/tailwind/fontSize.tailwind.js +0 -13
- package/dist/tailwind/index.d.ts +0 -3
- package/dist/tailwind/index.js +0 -2
- package/dist/tailwind/screens.tailwind.d.ts +0 -9
- package/dist/tailwind/screens.tailwind.js +0 -8
- package/dist/tailwind/tw-font-desc.d.ts +0 -6
- package/dist/tailwind/tw-font-desc.js +0 -6
- package/dist/types/animation-def.d.ts +0 -2
- package/dist/types/animation-def.js +0 -1
- package/dist/types/breakpoints.d.ts +0 -4
- package/dist/types/breakpoints.js +0 -4
- package/dist/types/bullet-item.d.ts +0 -6
- package/dist/types/bullet-item.js +0 -2
- package/dist/types/button-def.d.ts +0 -29
- package/dist/types/button-def.js +0 -2
- package/dist/types/dimensions.d.ts +0 -5
- package/dist/types/dimensions.js +0 -1
- package/dist/types/grid-def.d.ts +0 -36
- package/dist/types/grid-def.js +0 -33
- package/dist/types/image-def.d.ts +0 -27
- package/dist/types/image-def.js +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.js +0 -2
- package/dist/types/link-def.d.ts +0 -44
- package/dist/types/link-def.js +0 -1
- package/dist/types/media-stack-def.d.ts +0 -25
- package/dist/types/media-stack-def.js +0 -1
- package/dist/types/t-shirt-size.d.ts +0 -2
- package/dist/types/t-shirt-size.js +0 -1
- package/dist/types/tshirt-dimensions.d.ts +0 -12
- package/dist/types/tshirt-dimensions.js +0 -1
- package/dist/types/video-def.d.ts +0 -9
- package/dist/types/video-def.js +0 -1
- package/dist/util/format-and-abbreviate-as-currency.d.ts +0 -11
- package/dist/util/format-and-abbreviate-as-currency.js +0 -91
- package/dist/util/format-to-max-char.d.ts +0 -5
- package/dist/util/format-to-max-char.js +0 -57
- package/dist/util/index-client.d.ts +0 -2
- package/dist/util/index-client.js +0 -3
- package/dist/util/index.d.ts +0 -17
- package/dist/util/index.js +0 -41
- package/dist/util/number-abbreviate.d.ts +0 -9
- package/dist/util/number-abbreviate.js +0 -30
- package/dist/util/specifier.d.ts +0 -7
- package/dist/util/specifier.js +0 -31
- package/dist/util/spread-to-transform.d.ts +0 -7
- package/dist/util/spread-to-transform.js +0 -18
- package/dist/util/step-animation.d.ts +0 -5
- package/dist/util/step-animation.js +0 -60
- package/dist/util/two-way-map.d.ts +0 -8
- package/dist/util/two-way-map.js +0 -16
- /package/{mcp → src/mcp}/index.ts +0 -0
- /package/{mcp → src/mcp}/package.json +0 -0
- /package/{registry → src/registry}/package.json +0 -0
|
@@ -1,56 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
|
+
import { Circle } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
6
|
|
|
7
|
-
import { cn } from
|
|
7
|
+
import { cn } from '../src/utils';
|
|
8
8
|
|
|
9
|
-
const RadioGroup =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const RadioGroup = ({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) => {
|
|
13
13
|
return (
|
|
14
14
|
<RadioGroupPrimitive.Root
|
|
15
|
-
className={cn(
|
|
15
|
+
className={cn('grid gap-2', className)}
|
|
16
16
|
{...props}
|
|
17
|
-
ref={ref}
|
|
18
17
|
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
22
21
|
|
|
23
|
-
const RadioGroupItem =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
>(({
|
|
29
|
-
larger=false,
|
|
30
|
-
className,
|
|
31
|
-
...props
|
|
32
|
-
}, ref) => {
|
|
22
|
+
const RadioGroupItem = ({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) => {
|
|
33
26
|
return (
|
|
34
27
|
<RadioGroupPrimitive.Item
|
|
35
|
-
ref={ref}
|
|
36
28
|
className={cn(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
40
|
-
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
41
|
-
className
|
|
29
|
+
'border-brand text-brand ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
30
|
+
className,
|
|
42
31
|
)}
|
|
43
32
|
{...props}
|
|
44
33
|
>
|
|
45
|
-
<RadioGroupPrimitive.Indicator className="
|
|
46
|
-
<
|
|
47
|
-
larger ? 'h-[70%] w-[70%] ' : 'h-[75%] w-[75%]',
|
|
48
|
-
'rounded-full aspect-square bg-foreground' ,
|
|
49
|
-
)}/>
|
|
34
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
35
|
+
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
50
36
|
</RadioGroupPrimitive.Indicator>
|
|
51
37
|
</RadioGroupPrimitive.Item>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
55
41
|
|
|
56
|
-
export { RadioGroup, RadioGroupItem }
|
|
42
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { GripVertical } from 'lucide-react';
|
|
2
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../src/utils';
|
|
5
|
+
|
|
6
|
+
const ResizablePanelGroup = ({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
|
|
10
|
+
<ResizablePrimitive.PanelGroup
|
|
11
|
+
className={cn(
|
|
12
|
+
'flex h-full w-full data-[panel-group-direction=vertical]:flex-col',
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const ResizablePanel = ResizablePrimitive.Panel;
|
|
20
|
+
|
|
21
|
+
const ResizableHandle = ({
|
|
22
|
+
withHandle,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
26
|
+
withHandle?: boolean;
|
|
27
|
+
}) => (
|
|
28
|
+
<ResizablePrimitive.PanelResizeHandle
|
|
29
|
+
className={cn(
|
|
30
|
+
'focus-visible:ring-ring relative flex w-px items-center justify-center bg-gray-100 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden',
|
|
31
|
+
'data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90',
|
|
32
|
+
'data-[resize-handle-state=drag]:after:bg-bg-secondary',
|
|
33
|
+
'data-[resize-handle-state=hover]:after:bg-bg-secondary',
|
|
34
|
+
'after:w-[1px] data-[panel-group-direction=vertical]:after:h-[1px]',
|
|
35
|
+
className,
|
|
36
|
+
)}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{withHandle && (
|
|
40
|
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-gray-200">
|
|
41
|
+
<GripVertical className="h-2.5 w-2.5" />
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
</ResizablePrimitive.PanelResizeHandle>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'
|
|
1
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
2
|
+
import * as React from 'react';
|
|
4
3
|
|
|
5
|
-
import { cn } from '../
|
|
4
|
+
import { cn } from '../src/utils';
|
|
6
5
|
|
|
7
|
-
const ScrollArea =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const ScrollArea = ({
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
ref,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
|
|
12
|
+
ref?: React.RefObject<HTMLDivElement | null>;
|
|
13
|
+
}) => (
|
|
11
14
|
<ScrollAreaPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
15
|
className={cn('relative overflow-hidden', className)}
|
|
14
16
|
{...props}
|
|
15
17
|
>
|
|
16
|
-
<ScrollAreaPrimitive.Viewport
|
|
18
|
+
<ScrollAreaPrimitive.Viewport
|
|
19
|
+
className="h-full w-full rounded-[inherit]"
|
|
20
|
+
ref={ref}
|
|
21
|
+
>
|
|
17
22
|
{children}
|
|
18
23
|
</ScrollAreaPrimitive.Viewport>
|
|
19
24
|
<ScrollBar />
|
|
20
25
|
<ScrollAreaPrimitive.Corner />
|
|
21
26
|
</ScrollAreaPrimitive.Root>
|
|
22
|
-
)
|
|
23
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
27
|
+
);
|
|
28
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
24
29
|
|
|
25
|
-
const ScrollBar =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
const ScrollBar = ({
|
|
31
|
+
className,
|
|
32
|
+
orientation = 'vertical',
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) => (
|
|
29
35
|
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
30
|
-
ref={ref}
|
|
31
|
-
orientation={orientation}
|
|
32
36
|
className={cn(
|
|
33
|
-
'flex touch-none select-none
|
|
37
|
+
'flex touch-none transition-colors select-none',
|
|
34
38
|
orientation === 'vertical' &&
|
|
35
39
|
'h-full w-2.5 border-l border-l-transparent p-[1px]',
|
|
36
40
|
orientation === 'horizontal' &&
|
|
37
|
-
'h-2.5
|
|
38
|
-
className
|
|
41
|
+
'h-2.5 border-t border-t-transparent p-[1px]',
|
|
42
|
+
className,
|
|
39
43
|
)}
|
|
44
|
+
orientation={orientation}
|
|
40
45
|
{...props}
|
|
41
46
|
>
|
|
42
|
-
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
47
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
48
|
+
className={cn(
|
|
49
|
+
'relative rounded-full bg-gray-300',
|
|
50
|
+
orientation === 'vertical' && 'flex-1',
|
|
51
|
+
)}
|
|
52
|
+
/>
|
|
43
53
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
44
|
-
)
|
|
45
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
54
|
+
);
|
|
55
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
46
56
|
|
|
47
|
-
export { ScrollArea, ScrollBar }
|
|
57
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SearchIcon, XIcon } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../src/utils';
|
|
5
|
+
import { Button } from './button';
|
|
6
|
+
import { Input } from './input';
|
|
7
|
+
|
|
8
|
+
export type SearchInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
9
|
+
classNames?: {
|
|
10
|
+
container?: string;
|
|
11
|
+
input?: string;
|
|
12
|
+
button?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const SearchInput = ({
|
|
17
|
+
className,
|
|
18
|
+
value,
|
|
19
|
+
onChange,
|
|
20
|
+
classNames,
|
|
21
|
+
...props
|
|
22
|
+
}: SearchInputProps) => {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
className={cn(
|
|
26
|
+
'shadow-border-input focus-within:shadow-border-input-focus relative flex h-10 flex-1 items-center overflow-hidden rounded-full shadow-[0_0_0_1px_currentColor] transition-shadow',
|
|
27
|
+
classNames?.container,
|
|
28
|
+
)}
|
|
29
|
+
>
|
|
30
|
+
<Input
|
|
31
|
+
className={cn(
|
|
32
|
+
'placeholder:!text-text-placeholder !h-full border-none bg-transparent py-2 pl-10',
|
|
33
|
+
classNames?.input,
|
|
34
|
+
)}
|
|
35
|
+
onChange={(e) => {
|
|
36
|
+
onChange?.(e);
|
|
37
|
+
}}
|
|
38
|
+
placeholder="Search..."
|
|
39
|
+
spellCheck={false}
|
|
40
|
+
value={value}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
<SearchIcon className="text-text-tertiary absolute top-1/2 left-4 -z-[1px] h-4 w-4 -translate-y-1/2" />
|
|
44
|
+
{value && (
|
|
45
|
+
<Button
|
|
46
|
+
className={cn('absolute right-1 h-8 w-8 p-2', classNames?.button)}
|
|
47
|
+
onClick={() => {
|
|
48
|
+
onChange?.({
|
|
49
|
+
target: { value: '' },
|
|
50
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
|
51
|
+
}}
|
|
52
|
+
size="auto"
|
|
53
|
+
type="button"
|
|
54
|
+
variant="tertiary"
|
|
55
|
+
>
|
|
56
|
+
<XIcon />
|
|
57
|
+
<span className="sr-only">Clear</span>
|
|
58
|
+
</Button>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
SearchInput.displayName = 'SearchInput';
|
|
65
|
+
|
|
66
|
+
export { SearchInput };
|
package/primitives/select.tsx
CHANGED
|
@@ -1,159 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
import { CheckIcon } from '@radix-ui/react-icons';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
2
5
|
|
|
3
|
-
import
|
|
4
|
-
import * as SelectPrimitive from '@radix-ui/react-select'
|
|
5
|
-
import { Check, ChevronDown, ChevronUp } from 'lucide-react'
|
|
6
|
+
import { cn } from '../src/utils';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const Select = SelectPrimitive.Root;
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
const SelectGroup = SelectPrimitive.Group
|
|
11
|
-
const SelectValue = SelectPrimitive.Value
|
|
10
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
12
11
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const SelectValue = SelectPrimitive.Value;
|
|
13
|
+
|
|
14
|
+
const SelectTrigger = ({
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger>) => (
|
|
17
19
|
<SelectPrimitive.Trigger
|
|
18
|
-
ref={ref}
|
|
19
20
|
className={cn(
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
21
|
+
'h-input border-divider bg-bg-secondary relative flex w-full items-center justify-between rounded-md border px-4 py-2 text-sm shadow-xs',
|
|
22
|
+
'focus:ring-border-input-focus placeholder:text-text-secondary focus:ring-1 focus:outline-hidden focus:ring-inset disabled:cursor-not-allowed disabled:opacity-50',
|
|
23
|
+
'peer/select [&[data-placeholder]>svg]:mt-0',
|
|
24
|
+
'pt-6 data-[placeholder]:pt-2',
|
|
25
|
+
'aria-expanded:ring-border-input-focus aria-expanded:ring-1 aria-expanded:ring-inset',
|
|
26
|
+
className,
|
|
25
27
|
)}
|
|
26
28
|
{...props}
|
|
27
29
|
>
|
|
28
30
|
{children}
|
|
29
31
|
<SelectPrimitive.Icon asChild>
|
|
30
|
-
<ChevronDown className=
|
|
32
|
+
<ChevronDown className="absolute top-[23px] right-3 h-4 w-4 opacity-50" />
|
|
31
33
|
</SelectPrimitive.Icon>
|
|
32
34
|
</SelectPrimitive.Trigger>
|
|
33
|
-
)
|
|
34
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
35
|
-
|
|
36
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
37
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
38
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
39
|
-
>(({ className, ...props }, ref) => (
|
|
40
|
-
<SelectPrimitive.ScrollUpButton
|
|
41
|
-
ref={ref}
|
|
42
|
-
className={cn(
|
|
43
|
-
'flex cursor-default items-center justify-center py-1',
|
|
44
|
-
className
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
>
|
|
48
|
-
<ChevronUp className='h-4 w-4' />
|
|
49
|
-
</SelectPrimitive.ScrollUpButton>
|
|
50
|
-
))
|
|
51
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
35
|
+
);
|
|
36
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
52
37
|
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
className={cn(
|
|
60
|
-
'flex cursor-default items-center justify-center py-1',
|
|
61
|
-
className
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
>
|
|
65
|
-
<ChevronDown className='h-4 w-4' />
|
|
66
|
-
</SelectPrimitive.ScrollDownButton>
|
|
67
|
-
))
|
|
68
|
-
SelectScrollDownButton.displayName =
|
|
69
|
-
SelectPrimitive.ScrollDownButton.displayName
|
|
70
|
-
|
|
71
|
-
const SelectContent = React.forwardRef<
|
|
72
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
73
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
74
|
-
>(({ className, children, position = 'popper', ...props }, ref) => (
|
|
38
|
+
const SelectContent = ({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
position = 'popper',
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) => (
|
|
75
44
|
<SelectPrimitive.Portal>
|
|
76
45
|
<SelectPrimitive.Content
|
|
77
|
-
ref={ref}
|
|
78
46
|
className={cn(
|
|
79
|
-
'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 ' +
|
|
84
|
-
'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
85
|
-
(position === 'popper') &&
|
|
86
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 ' +
|
|
87
|
-
'data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
88
|
-
className
|
|
47
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-divider bg-bg-dark relative z-50 min-w-[8rem] overflow-hidden rounded-md border text-gray-50/70 shadow-md',
|
|
48
|
+
position === 'popper' &&
|
|
49
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
50
|
+
className,
|
|
89
51
|
)}
|
|
90
52
|
position={position}
|
|
91
53
|
{...props}
|
|
92
54
|
>
|
|
93
|
-
<SelectScrollUpButton />
|
|
94
55
|
<SelectPrimitive.Viewport
|
|
95
56
|
className={cn(
|
|
96
57
|
'p-1',
|
|
97
58
|
position === 'popper' &&
|
|
98
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'
|
|
59
|
+
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',
|
|
99
60
|
)}
|
|
100
61
|
>
|
|
101
62
|
{children}
|
|
102
63
|
</SelectPrimitive.Viewport>
|
|
103
|
-
<SelectScrollDownButton />
|
|
104
64
|
</SelectPrimitive.Content>
|
|
105
65
|
</SelectPrimitive.Portal>
|
|
106
|
-
)
|
|
107
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
66
|
+
);
|
|
67
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
108
68
|
|
|
109
|
-
const SelectLabel =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
69
|
+
const SelectLabel = ({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) => (
|
|
113
73
|
<SelectPrimitive.Label
|
|
114
|
-
|
|
115
|
-
className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}
|
|
74
|
+
className={cn('px-2 py-1.5 text-sm font-semibold', className)}
|
|
116
75
|
{...props}
|
|
117
76
|
/>
|
|
118
|
-
)
|
|
119
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
77
|
+
);
|
|
78
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
120
79
|
|
|
121
|
-
const SelectItem =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
80
|
+
const SelectItem = ({
|
|
81
|
+
className,
|
|
82
|
+
children,
|
|
83
|
+
...props
|
|
84
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) => (
|
|
125
85
|
<SelectPrimitive.Item
|
|
126
|
-
ref={ref}
|
|
127
86
|
className={cn(
|
|
128
|
-
'relative flex w-full cursor-default
|
|
129
|
-
|
|
130
|
-
'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
131
|
-
className
|
|
87
|
+
'focus:bg-bg-secondary focus:text-text-default relative flex w-full cursor-default items-center rounded-xs py-2 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
88
|
+
className,
|
|
132
89
|
)}
|
|
133
90
|
{...props}
|
|
134
91
|
>
|
|
135
|
-
<span className=
|
|
92
|
+
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
136
93
|
<SelectPrimitive.ItemIndicator>
|
|
137
|
-
<
|
|
94
|
+
<CheckIcon className="h-4 w-4" />
|
|
138
95
|
</SelectPrimitive.ItemIndicator>
|
|
139
96
|
</span>
|
|
140
|
-
|
|
141
97
|
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
142
98
|
</SelectPrimitive.Item>
|
|
143
|
-
)
|
|
144
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
99
|
+
);
|
|
100
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
145
101
|
|
|
146
|
-
const SelectSeparator =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
102
|
+
const SelectSeparator = ({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) => (
|
|
150
106
|
<SelectPrimitive.Separator
|
|
151
|
-
|
|
152
|
-
className={cn('-mx-1 my-1 h-px bg-level-1', className)}
|
|
107
|
+
className={cn('bg-muted -mx-1 my-1 h-px', className)}
|
|
153
108
|
{...props}
|
|
154
109
|
/>
|
|
155
|
-
)
|
|
156
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
110
|
+
);
|
|
111
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
157
112
|
|
|
158
113
|
export {
|
|
159
114
|
Select,
|
|
@@ -164,6 +119,4 @@ export {
|
|
|
164
119
|
SelectLabel,
|
|
165
120
|
SelectItem,
|
|
166
121
|
SelectSeparator,
|
|
167
|
-
|
|
168
|
-
SelectScrollDownButton,
|
|
169
|
-
}
|
|
122
|
+
};
|
package/primitives/separator.tsx
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
|
1
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
2
|
+
import * as React from 'react';
|
|
4
3
|
|
|
5
|
-
import { cn } from '../
|
|
4
|
+
import { cn } from '../src/utils';
|
|
6
5
|
|
|
7
|
-
const Separator =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
)
|
|
27
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
6
|
+
const Separator = ({
|
|
7
|
+
className,
|
|
8
|
+
orientation = 'horizontal',
|
|
9
|
+
decorative = true,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) => (
|
|
12
|
+
<SeparatorPrimitive.Root
|
|
13
|
+
className={cn(
|
|
14
|
+
'bg-divider shrink-0',
|
|
15
|
+
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
decorative={decorative}
|
|
19
|
+
orientation={orientation}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
28
24
|
|
|
29
|
-
export
|
|
25
|
+
export { Separator };
|