@bergetai/ui 0.14.2 → 0.16.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.md +32 -46
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/components/alert/Alert.cjs +31 -0
- package/dist/components/alert/Alert.cjs.map +1 -0
- package/dist/components/alert/Alert.d.cts +14 -0
- package/dist/components/alert/Alert.d.cts.map +1 -0
- package/dist/components/alert/Alert.d.mts +14 -0
- package/dist/components/alert/Alert.d.mts.map +1 -0
- package/dist/components/alert/Alert.mjs +27 -0
- package/dist/components/alert/Alert.mjs.map +1 -0
- package/dist/components/alert/index.d.cts +3 -0
- package/dist/components/alert/index.d.mts +3 -0
- package/dist/components/alert-dialog/AlertDialog.cjs +95 -0
- package/dist/components/alert-dialog/AlertDialog.cjs.map +1 -0
- package/dist/components/alert-dialog/AlertDialog.d.cts +46 -0
- package/dist/components/alert-dialog/AlertDialog.d.cts.map +1 -0
- package/dist/components/alert-dialog/AlertDialog.d.mts +46 -0
- package/dist/components/alert-dialog/AlertDialog.d.mts.map +1 -0
- package/dist/components/alert-dialog/AlertDialog.mjs +83 -0
- package/dist/components/alert-dialog/AlertDialog.mjs.map +1 -0
- package/dist/components/alert-dialog/index.d.cts +2 -0
- package/dist/components/alert-dialog/index.d.mts +2 -0
- package/dist/components/badge/Badge.cjs +57 -0
- package/dist/components/badge/Badge.cjs.map +1 -0
- package/dist/components/badge/Badge.d.cts +16 -0
- package/dist/components/badge/Badge.d.cts.map +1 -0
- package/dist/components/badge/Badge.d.mts +16 -0
- package/dist/components/badge/Badge.d.mts.map +1 -0
- package/dist/components/badge/Badge.mjs +55 -0
- package/dist/components/badge/Badge.mjs.map +1 -0
- package/dist/components/badge/index.d.cts +2 -0
- package/dist/components/badge/index.d.mts +2 -0
- package/dist/components/berget-logo/BergetLogo.cjs +87 -0
- package/dist/components/berget-logo/BergetLogo.cjs.map +1 -0
- package/dist/components/berget-logo/BergetLogo.d.cts +14 -0
- package/dist/components/berget-logo/BergetLogo.d.cts.map +1 -0
- package/dist/components/berget-logo/BergetLogo.d.mts +14 -0
- package/dist/components/berget-logo/BergetLogo.d.mts.map +1 -0
- package/dist/components/berget-logo/BergetLogo.mjs +85 -0
- package/dist/components/berget-logo/BergetLogo.mjs.map +1 -0
- package/dist/components/berget-logo/index.d.cts +2 -0
- package/dist/components/berget-logo/index.d.mts +2 -0
- package/dist/components/box/Box.cjs +67 -0
- package/dist/components/box/Box.cjs.map +1 -0
- package/dist/components/box/Box.d.cts +21 -0
- package/dist/components/box/Box.d.cts.map +1 -0
- package/dist/components/box/Box.d.mts +21 -0
- package/dist/components/box/Box.d.mts.map +1 -0
- package/dist/components/box/Box.mjs +64 -0
- package/dist/components/box/Box.mjs.map +1 -0
- package/dist/components/box/index.d.cts +2 -0
- package/dist/components/box/index.d.mts +2 -0
- package/dist/components/bubble/index.d.cts +2 -0
- package/dist/components/bubble/index.d.mts +2 -0
- package/dist/components/button/Button.cjs +75 -0
- package/dist/components/button/Button.cjs.map +1 -0
- package/dist/components/button/Button.d.cts +19 -0
- package/dist/components/button/Button.d.cts.map +1 -0
- package/dist/components/button/Button.d.mts +19 -0
- package/dist/components/button/Button.d.mts.map +1 -0
- package/dist/components/button/Button.mjs +74 -0
- package/dist/components/button/Button.mjs.map +1 -0
- package/dist/components/button/index.d.cts +3 -0
- package/dist/components/button/index.d.mts +3 -0
- package/dist/components/card/Card.cjs +36 -0
- package/dist/components/card/Card.cjs.map +1 -0
- package/dist/components/card/Card.d.cts +15 -0
- package/dist/components/card/Card.d.cts.map +1 -0
- package/dist/components/card/Card.d.mts +15 -0
- package/dist/components/card/Card.d.mts.map +1 -0
- package/dist/components/card/Card.mjs +28 -0
- package/dist/components/card/Card.mjs.map +1 -0
- package/dist/components/card/index.d.cts +3 -0
- package/dist/components/card/index.d.mts +3 -0
- package/dist/components/checkbox/Checkbox.cjs +87 -0
- package/dist/components/checkbox/Checkbox.cjs.map +1 -0
- package/dist/components/checkbox/Checkbox.d.cts +18 -0
- package/dist/components/checkbox/Checkbox.d.cts.map +1 -0
- package/dist/components/checkbox/Checkbox.d.mts +18 -0
- package/dist/components/checkbox/Checkbox.d.mts.map +1 -0
- package/dist/components/checkbox/Checkbox.mjs +84 -0
- package/dist/components/checkbox/Checkbox.mjs.map +1 -0
- package/dist/components/checkbox/index.d.cts +2 -0
- package/dist/components/checkbox/index.d.mts +2 -0
- package/dist/components/code-block/CodeBlock.cjs +58 -0
- package/dist/components/code-block/CodeBlock.cjs.map +1 -0
- package/dist/components/code-block/CodeBlock.d.cts +10 -0
- package/dist/components/code-block/CodeBlock.d.cts.map +1 -0
- package/dist/components/code-block/CodeBlock.d.mts +10 -0
- package/dist/components/code-block/CodeBlock.d.mts.map +1 -0
- package/dist/components/code-block/CodeBlock.mjs +58 -0
- package/dist/components/code-block/CodeBlock.mjs.map +1 -0
- package/dist/components/container/Container.cjs +50 -0
- package/dist/components/container/Container.cjs.map +1 -0
- package/dist/components/container/Container.d.cts +17 -0
- package/dist/components/container/Container.d.cts.map +1 -0
- package/dist/components/container/Container.d.mts +17 -0
- package/dist/components/container/Container.d.mts.map +1 -0
- package/dist/components/container/Container.mjs +47 -0
- package/dist/components/container/Container.mjs.map +1 -0
- package/dist/components/container/index.d.cts +2 -0
- package/dist/components/container/index.d.mts +2 -0
- package/dist/components/country-select/CountrySelect.cjs +95 -0
- package/dist/components/country-select/CountrySelect.cjs.map +1 -0
- package/dist/components/country-select/CountrySelect.d.cts +16 -0
- package/dist/components/country-select/CountrySelect.d.cts.map +1 -0
- package/dist/components/country-select/CountrySelect.d.mts +16 -0
- package/dist/components/country-select/CountrySelect.d.mts.map +1 -0
- package/dist/components/country-select/CountrySelect.mjs +93 -0
- package/dist/components/country-select/CountrySelect.mjs.map +1 -0
- package/dist/components/country-select/countries.cjs +409 -0
- package/dist/components/country-select/countries.cjs.map +1 -0
- package/dist/components/country-select/countries.d.cts +17 -0
- package/dist/components/country-select/countries.d.cts.map +1 -0
- package/dist/components/country-select/countries.d.mts +17 -0
- package/dist/components/country-select/countries.d.mts.map +1 -0
- package/dist/components/country-select/countries.mjs +405 -0
- package/dist/components/country-select/countries.mjs.map +1 -0
- package/dist/components/country-select/index.d.cts +3 -0
- package/dist/components/country-select/index.d.mts +3 -0
- package/dist/components/dialog/Dialog.cjs +85 -0
- package/dist/components/dialog/Dialog.cjs.map +1 -0
- package/dist/components/dialog/Dialog.d.cts +35 -0
- package/dist/components/dialog/Dialog.d.cts.map +1 -0
- package/dist/components/dialog/Dialog.d.mts +35 -0
- package/dist/components/dialog/Dialog.d.mts.map +1 -0
- package/dist/components/dialog/Dialog.mjs +74 -0
- package/dist/components/dialog/Dialog.mjs.map +1 -0
- package/dist/components/dialog/index.d.cts +2 -0
- package/dist/components/dialog/index.d.mts +2 -0
- package/dist/components/divider/Divider.cjs +72 -0
- package/dist/components/divider/Divider.cjs.map +1 -0
- package/dist/components/divider/Divider.mjs +70 -0
- package/dist/components/divider/Divider.mjs.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.cjs +101 -0
- package/dist/components/dropdown-menu/DropdownMenu.cjs.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.cts +62 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.cts.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.mts +62 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.mts.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.mjs +85 -0
- package/dist/components/dropdown-menu/DropdownMenu.mjs.map +1 -0
- package/dist/components/dropdown-menu/index.d.cts +3 -0
- package/dist/components/dropdown-menu/index.d.mts +3 -0
- package/dist/components/empty/Empty.cjs +51 -0
- package/dist/components/empty/Empty.cjs.map +1 -0
- package/dist/components/empty/Empty.d.cts +17 -0
- package/dist/components/empty/Empty.d.cts.map +1 -0
- package/dist/components/empty/Empty.d.mts +17 -0
- package/dist/components/empty/Empty.d.mts.map +1 -0
- package/dist/components/empty/Empty.mjs +44 -0
- package/dist/components/empty/Empty.mjs.map +1 -0
- package/dist/components/empty/index.d.cts +3 -0
- package/dist/components/empty/index.d.mts +3 -0
- package/dist/components/field/index.d.cts +2 -0
- package/dist/components/field/index.d.mts +2 -0
- package/dist/components/fog-illustration/FogIllustration.cjs +342 -0
- package/dist/components/fog-illustration/FogIllustration.cjs.map +1 -0
- package/dist/components/fog-illustration/FogIllustration.d.cts +35 -0
- package/dist/components/fog-illustration/FogIllustration.d.cts.map +1 -0
- package/dist/components/fog-illustration/FogIllustration.d.mts +35 -0
- package/dist/components/fog-illustration/FogIllustration.d.mts.map +1 -0
- package/dist/components/fog-illustration/FogIllustration.mjs +341 -0
- package/dist/components/fog-illustration/FogIllustration.mjs.map +1 -0
- package/dist/components/grid/Grid.cjs +51 -0
- package/dist/components/grid/Grid.cjs.map +1 -0
- package/dist/components/grid/Grid.d.cts +25 -0
- package/dist/components/grid/Grid.d.cts.map +1 -0
- package/dist/components/grid/Grid.d.mts +25 -0
- package/dist/components/grid/Grid.d.mts.map +1 -0
- package/dist/components/grid/Grid.mjs +48 -0
- package/dist/components/grid/Grid.mjs.map +1 -0
- package/dist/components/grid/index.d.cts +2 -0
- package/dist/components/grid/index.d.mts +2 -0
- package/dist/components/icon/Icon.cjs +30 -0
- package/dist/components/icon/Icon.cjs.map +1 -0
- package/dist/components/icon/Icon.d.cts +14 -0
- package/dist/components/icon/Icon.d.cts.map +1 -0
- package/dist/components/icon/Icon.d.mts +14 -0
- package/dist/components/icon/Icon.d.mts.map +1 -0
- package/dist/components/icon/Icon.mjs +28 -0
- package/dist/components/icon/Icon.mjs.map +1 -0
- package/dist/components/icon/index.d.cts +2 -0
- package/dist/components/icon/index.d.mts +2 -0
- package/dist/components/input/index.d.cts +2 -0
- package/dist/components/input/index.d.mts +2 -0
- package/dist/components/input-group/InputGroup.cjs +41 -0
- package/dist/components/input-group/InputGroup.cjs.map +1 -0
- package/dist/components/input-group/InputGroup.d.cts +33 -0
- package/dist/components/input-group/InputGroup.d.cts.map +1 -0
- package/dist/components/input-group/InputGroup.d.mts +33 -0
- package/dist/components/input-group/InputGroup.d.mts.map +1 -0
- package/dist/components/input-group/InputGroup.mjs +36 -0
- package/dist/components/input-group/InputGroup.mjs.map +1 -0
- package/dist/components/input-group/index.d.cts +3 -0
- package/dist/components/input-group/index.d.mts +3 -0
- package/dist/components/item/Item.cjs +65 -0
- package/dist/components/item/Item.cjs.map +1 -0
- package/dist/components/item/Item.d.cts +24 -0
- package/dist/components/item/Item.d.cts.map +1 -0
- package/dist/components/item/Item.d.mts +24 -0
- package/dist/components/item/Item.d.mts.map +1 -0
- package/dist/components/item/Item.mjs +54 -0
- package/dist/components/item/Item.mjs.map +1 -0
- package/dist/components/item/index.d.cts +3 -0
- package/dist/components/item/index.d.mts +3 -0
- package/dist/components/label/index.d.cts +2 -0
- package/dist/components/label/index.d.mts +2 -0
- package/dist/components/language-select/LanguageSelect.cjs +48 -0
- package/dist/components/language-select/LanguageSelect.cjs.map +1 -0
- package/dist/components/language-select/LanguageSelect.d.cts +17 -0
- package/dist/components/language-select/LanguageSelect.d.cts.map +1 -0
- package/dist/components/language-select/LanguageSelect.d.mts +17 -0
- package/dist/components/language-select/LanguageSelect.d.mts.map +1 -0
- package/dist/components/language-select/LanguageSelect.mjs +46 -0
- package/dist/components/language-select/LanguageSelect.mjs.map +1 -0
- package/dist/components/language-select/index.d.cts +2 -0
- package/dist/components/language-select/index.d.mts +2 -0
- package/dist/components/link/Link.cjs +71 -0
- package/dist/components/link/Link.cjs.map +1 -0
- package/dist/components/link/Link.d.cts +18 -0
- package/dist/components/link/Link.d.cts.map +1 -0
- package/dist/components/link/Link.d.mts +18 -0
- package/dist/components/link/Link.d.mts.map +1 -0
- package/dist/components/link/Link.mjs +68 -0
- package/dist/components/link/Link.mjs.map +1 -0
- package/dist/components/link/index.d.cts +2 -0
- package/dist/components/link/index.d.mts +2 -0
- package/dist/components/list/List.cjs +71 -0
- package/dist/components/list/List.cjs.map +1 -0
- package/dist/components/list/List.d.cts +24 -0
- package/dist/components/list/List.d.cts.map +1 -0
- package/dist/components/list/List.d.mts +24 -0
- package/dist/components/list/List.d.mts.map +1 -0
- package/dist/components/list/List.mjs +66 -0
- package/dist/components/list/List.mjs.map +1 -0
- package/dist/components/list/index.d.cts +2 -0
- package/dist/components/list/index.d.mts +2 -0
- package/dist/components/message/index.d.cts +2 -0
- package/dist/components/message/index.d.mts +2 -0
- package/dist/components/message-scroller/index.d.cts +2 -0
- package/dist/components/message-scroller/index.d.mts +2 -0
- package/dist/components/model-card/ModelCard.cjs +108 -0
- package/dist/components/model-card/ModelCard.cjs.map +1 -0
- package/dist/components/model-card/ModelCard.d.cts +58 -0
- package/dist/components/model-card/ModelCard.d.cts.map +1 -0
- package/dist/components/model-card/ModelCard.d.mts +58 -0
- package/dist/components/model-card/ModelCard.d.mts.map +1 -0
- package/dist/components/model-card/ModelCard.mjs +106 -0
- package/dist/components/model-card/ModelCard.mjs.map +1 -0
- package/dist/components/model-card/index.d.cts +3 -0
- package/dist/components/model-card/index.d.mts +3 -0
- package/dist/components/model-logo/ModelLogo.cjs +98 -0
- package/dist/components/model-logo/ModelLogo.cjs.map +1 -0
- package/dist/components/model-logo/ModelLogo.d.cts +32 -0
- package/dist/components/model-logo/ModelLogo.d.cts.map +1 -0
- package/dist/components/model-logo/ModelLogo.d.mts +32 -0
- package/dist/components/model-logo/ModelLogo.d.mts.map +1 -0
- package/dist/components/model-logo/ModelLogo.mjs +95 -0
- package/dist/components/model-logo/ModelLogo.mjs.map +1 -0
- package/dist/components/model-logo/index.d.cts +2 -0
- package/dist/components/model-logo/index.d.mts +2 -0
- package/dist/components/navigation-menu/NavigationMenu.cjs +65 -0
- package/dist/components/navigation-menu/NavigationMenu.cjs.map +1 -0
- package/dist/components/navigation-menu/NavigationMenu.d.cts +11 -0
- package/dist/components/navigation-menu/NavigationMenu.d.cts.map +1 -0
- package/dist/components/navigation-menu/NavigationMenu.d.mts +11 -0
- package/dist/components/navigation-menu/NavigationMenu.d.mts.map +1 -0
- package/dist/components/navigation-menu/NavigationMenu.mjs +57 -0
- package/dist/components/navigation-menu/NavigationMenu.mjs.map +1 -0
- package/dist/components/navigation-menu/index.d.cts +3 -0
- package/dist/components/navigation-menu/index.d.mts +3 -0
- package/dist/components/neural-flow/NeuralFlow.cjs +1038 -0
- package/dist/components/neural-flow/NeuralFlow.cjs.map +1 -0
- package/dist/components/neural-flow/NeuralFlow.d.cts +47 -0
- package/dist/components/neural-flow/NeuralFlow.d.cts.map +1 -0
- package/dist/components/neural-flow/NeuralFlow.d.mts +47 -0
- package/dist/components/neural-flow/NeuralFlow.d.mts.map +1 -0
- package/dist/components/neural-flow/NeuralFlow.mjs +1032 -0
- package/dist/components/neural-flow/NeuralFlow.mjs.map +1 -0
- package/dist/components/neural-flow/index.d.cts +2 -0
- package/dist/components/neural-flow/index.d.mts +2 -0
- package/dist/components/neural-flow/mnist-samples.cjs +73 -0
- package/dist/components/neural-flow/mnist-samples.cjs.map +1 -0
- package/dist/components/neural-flow/mnist-samples.mjs +73 -0
- package/dist/components/neural-flow/mnist-samples.mjs.map +1 -0
- package/dist/components/neural-flow/sparse-weights.cjs +21 -0
- package/dist/components/neural-flow/sparse-weights.cjs.map +1 -0
- package/dist/components/neural-flow/sparse-weights.mjs +21 -0
- package/dist/components/neural-flow/sparse-weights.mjs.map +1 -0
- package/dist/components/progress/Progress.cjs +25 -0
- package/dist/components/progress/Progress.cjs.map +1 -0
- package/dist/components/progress/Progress.d.cts +8 -0
- package/dist/components/progress/Progress.d.cts.map +1 -0
- package/dist/components/progress/Progress.d.mts +8 -0
- package/dist/components/progress/Progress.d.mts.map +1 -0
- package/dist/components/progress/Progress.mjs +19 -0
- package/dist/components/progress/Progress.mjs.map +1 -0
- package/dist/components/progress/index.d.cts +3 -0
- package/dist/components/progress/index.d.mts +3 -0
- package/dist/components/search-input/SearchInput.cjs +28 -0
- package/dist/components/search-input/SearchInput.cjs.map +1 -0
- package/dist/components/search-input/SearchInput.d.cts +10 -0
- package/dist/components/search-input/SearchInput.d.cts.map +1 -0
- package/dist/components/search-input/SearchInput.d.mts +10 -0
- package/dist/components/search-input/SearchInput.d.mts.map +1 -0
- package/dist/components/search-input/SearchInput.mjs +26 -0
- package/dist/components/search-input/SearchInput.mjs.map +1 -0
- package/dist/components/search-input/index.d.cts +2 -0
- package/dist/components/search-input/index.d.mts +2 -0
- package/dist/components/select/index.d.cts +2 -0
- package/dist/components/select/index.d.mts +2 -0
- package/dist/components/sidebar/Sidebar.cjs +203 -0
- package/dist/components/sidebar/Sidebar.cjs.map +1 -0
- package/dist/components/sidebar/Sidebar.d.cts +69 -0
- package/dist/components/sidebar/Sidebar.d.cts.map +1 -0
- package/dist/components/sidebar/Sidebar.d.mts +69 -0
- package/dist/components/sidebar/Sidebar.d.mts.map +1 -0
- package/dist/components/sidebar/Sidebar.mjs +150 -0
- package/dist/components/sidebar/Sidebar.mjs.map +1 -0
- package/dist/components/sidebar/index.d.cts +3 -0
- package/dist/components/sidebar/index.d.mts +3 -0
- package/dist/components/skeleton/Skeleton.cjs +20 -0
- package/dist/components/skeleton/Skeleton.cjs.map +1 -0
- package/dist/components/skeleton/Skeleton.d.cts +7 -0
- package/dist/components/skeleton/Skeleton.d.cts.map +1 -0
- package/dist/components/skeleton/Skeleton.d.mts +7 -0
- package/dist/components/skeleton/Skeleton.d.mts.map +1 -0
- package/dist/components/skeleton/Skeleton.mjs +18 -0
- package/dist/components/skeleton/Skeleton.mjs.map +1 -0
- package/dist/components/skeleton/index.d.cts +2 -0
- package/dist/components/skeleton/index.d.mts +2 -0
- package/dist/components/slider/Slider.cjs +23 -0
- package/dist/components/slider/Slider.cjs.map +1 -0
- package/dist/components/slider/Slider.d.cts +20 -0
- package/dist/components/slider/Slider.d.cts.map +1 -0
- package/dist/components/slider/Slider.d.mts +20 -0
- package/dist/components/slider/Slider.d.mts.map +1 -0
- package/dist/components/slider/Slider.mjs +23 -0
- package/dist/components/slider/Slider.mjs.map +1 -0
- package/dist/components/slider/index.d.cts +2 -0
- package/dist/components/slider/index.d.mts +2 -0
- package/dist/components/switch/Switch.cjs +85 -0
- package/dist/components/switch/Switch.cjs.map +1 -0
- package/dist/components/switch/Switch.d.cts +21 -0
- package/dist/components/switch/Switch.d.cts.map +1 -0
- package/dist/components/switch/Switch.d.mts +21 -0
- package/dist/components/switch/Switch.d.mts.map +1 -0
- package/dist/components/switch/Switch.mjs +81 -0
- package/dist/components/switch/Switch.mjs.map +1 -0
- package/dist/components/switch/index.d.cts +2 -0
- package/dist/components/switch/index.d.mts +2 -0
- package/dist/components/table/Table.cjs +67 -0
- package/dist/components/table/Table.cjs.map +1 -0
- package/dist/components/table/Table.d.cts +13 -0
- package/dist/components/table/Table.d.cts.map +1 -0
- package/dist/components/table/Table.d.mts +13 -0
- package/dist/components/table/Table.d.mts.map +1 -0
- package/dist/components/table/Table.mjs +58 -0
- package/dist/components/table/Table.mjs.map +1 -0
- package/dist/components/table/index.d.cts +2 -0
- package/dist/components/table/index.d.mts +2 -0
- package/dist/components/text-area/index.d.cts +2 -0
- package/dist/components/text-area/index.d.mts +2 -0
- package/dist/components/theme-provider/ThemeProvider.cjs +81 -0
- package/dist/components/theme-provider/ThemeProvider.cjs.map +1 -0
- package/dist/components/theme-provider/ThemeProvider.d.cts +21 -0
- package/dist/components/theme-provider/ThemeProvider.d.cts.map +1 -0
- package/dist/components/theme-provider/ThemeProvider.d.mts +21 -0
- package/dist/components/theme-provider/ThemeProvider.d.mts.map +1 -0
- package/dist/components/theme-provider/ThemeProvider.mjs +78 -0
- package/dist/components/theme-provider/ThemeProvider.mjs.map +1 -0
- package/dist/components/theme-provider/ThemeToggle.cjs +56 -0
- package/dist/components/theme-provider/ThemeToggle.cjs.map +1 -0
- package/dist/components/theme-provider/ThemeToggle.d.cts +12 -0
- package/dist/components/theme-provider/ThemeToggle.d.cts.map +1 -0
- package/dist/components/theme-provider/ThemeToggle.d.mts +12 -0
- package/dist/components/theme-provider/ThemeToggle.d.mts.map +1 -0
- package/dist/components/theme-provider/ThemeToggle.mjs +54 -0
- package/dist/components/theme-provider/ThemeToggle.mjs.map +1 -0
- package/dist/components/theme-provider/index.d.cts +3 -0
- package/dist/components/theme-provider/index.d.mts +3 -0
- package/dist/components/tooltip/Tooltip.cjs +28 -0
- package/dist/components/tooltip/Tooltip.cjs.map +1 -0
- package/dist/components/tooltip/Tooltip.d.cts +14 -0
- package/dist/components/tooltip/Tooltip.d.cts.map +1 -0
- package/dist/components/tooltip/Tooltip.d.mts +14 -0
- package/dist/components/tooltip/Tooltip.d.mts.map +1 -0
- package/dist/components/tooltip/Tooltip.mjs +23 -0
- package/dist/components/tooltip/Tooltip.mjs.map +1 -0
- package/dist/components/tooltip/index.d.cts +3 -0
- package/dist/components/tooltip/index.d.mts +3 -0
- package/dist/components/typography/Typography.cjs +69 -0
- package/dist/components/typography/Typography.cjs.map +1 -0
- package/dist/components/typography/Typography.d.cts +14 -0
- package/dist/components/typography/Typography.d.cts.map +1 -0
- package/dist/components/typography/Typography.d.mts +14 -0
- package/dist/components/typography/Typography.d.mts.map +1 -0
- package/dist/components/typography/Typography.mjs +67 -0
- package/dist/components/typography/Typography.mjs.map +1 -0
- package/dist/components/typography/index.d.cts +2 -0
- package/dist/components/typography/index.d.mts +2 -0
- package/dist/components/window-frame/WindowFrame.cjs +47 -0
- package/dist/components/window-frame/WindowFrame.cjs.map +1 -0
- package/dist/components/window-frame/WindowFrame.d.cts +19 -0
- package/dist/components/window-frame/WindowFrame.d.cts.map +1 -0
- package/dist/components/window-frame/WindowFrame.d.mts +19 -0
- package/dist/components/window-frame/WindowFrame.d.mts.map +1 -0
- package/dist/components/window-frame/WindowFrame.mjs +46 -0
- package/dist/components/window-frame/WindowFrame.mjs.map +1 -0
- package/dist/components/window-frame/index.d.cts +2 -0
- package/dist/components/window-frame/index.d.mts +2 -0
- package/dist/hooks/use-mobile.cjs +23 -0
- package/dist/hooks/use-mobile.cjs.map +1 -0
- package/dist/hooks/use-mobile.mjs +21 -0
- package/dist/hooks/use-mobile.mjs.map +1 -0
- package/dist/index.cjs +280 -5937
- package/dist/index.d.cts +101 -840
- package/dist/index.d.mts +101 -0
- package/dist/index.mjs +58 -0
- package/dist/lib/shiki-theme.cjs +10 -0
- package/dist/lib/shiki-theme.cjs.map +1 -0
- package/dist/lib/shiki-theme.d.cts +4 -0
- package/dist/lib/shiki-theme.d.cts.map +1 -0
- package/dist/lib/shiki-theme.d.mts +4 -0
- package/dist/lib/shiki-theme.d.mts.map +1 -0
- package/dist/lib/shiki-theme.mjs +11 -0
- package/dist/lib/shiki-theme.mjs.map +1 -0
- package/dist/lib/shiki.cjs +31 -0
- package/dist/lib/shiki.cjs.map +1 -0
- package/dist/lib/shiki.d.cts +6 -0
- package/dist/lib/shiki.d.cts.map +1 -0
- package/dist/lib/shiki.d.mts +6 -0
- package/dist/lib/shiki.d.mts.map +1 -0
- package/dist/lib/shiki.mjs +30 -0
- package/dist/lib/shiki.mjs.map +1 -0
- package/dist/lib/terminal.d.cts +12 -0
- package/dist/lib/terminal.d.cts.map +1 -0
- package/dist/lib/terminal.d.mts +12 -0
- package/dist/lib/terminal.d.mts.map +1 -0
- package/dist/lib/utils.cjs +43 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/utils.mjs +41 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/neural-flow.cjs +3 -1015
- package/dist/neural-flow.d.cts +3 -47
- package/dist/neural-flow.d.mts +3 -0
- package/dist/neural-flow.mjs +1 -0
- package/dist/primitives/alert.cjs +43 -0
- package/dist/primitives/alert.cjs.map +1 -0
- package/dist/primitives/alert.d.cts +8 -0
- package/dist/primitives/alert.d.cts.map +1 -0
- package/dist/primitives/alert.d.mts +8 -0
- package/dist/primitives/alert.d.mts.map +1 -0
- package/dist/primitives/alert.mjs +39 -0
- package/dist/primitives/alert.mjs.map +1 -0
- package/dist/primitives/bubble.cjs +80 -0
- package/dist/primitives/bubble.cjs.map +1 -0
- package/dist/primitives/bubble.d.cts +19 -0
- package/dist/primitives/bubble.d.cts.map +1 -0
- package/dist/primitives/bubble.d.mts +19 -0
- package/dist/primitives/bubble.d.mts.map +1 -0
- package/dist/primitives/bubble.mjs +75 -0
- package/dist/primitives/bubble.mjs.map +1 -0
- package/dist/primitives/button.cjs +47 -0
- package/dist/primitives/button.cjs.map +1 -0
- package/dist/primitives/button.d.cts +11 -0
- package/dist/primitives/button.d.cts.map +1 -0
- package/dist/primitives/button.d.mts +11 -0
- package/dist/primitives/button.d.mts.map +1 -0
- package/dist/primitives/button.mjs +46 -0
- package/dist/primitives/button.mjs.map +1 -0
- package/dist/primitives/card.cjs +67 -0
- package/dist/primitives/card.cjs.map +1 -0
- package/dist/primitives/card.d.cts +11 -0
- package/dist/primitives/card.d.cts.map +1 -0
- package/dist/primitives/card.d.mts +11 -0
- package/dist/primitives/card.d.mts.map +1 -0
- package/dist/primitives/card.mjs +59 -0
- package/dist/primitives/card.mjs.map +1 -0
- package/dist/primitives/checkbox.cjs +22 -0
- package/dist/primitives/checkbox.cjs.map +1 -0
- package/dist/primitives/checkbox.mjs +22 -0
- package/dist/primitives/checkbox.mjs.map +1 -0
- package/dist/primitives/command.cjs +69 -0
- package/dist/primitives/command.cjs.map +1 -0
- package/dist/primitives/command.mjs +62 -0
- package/dist/primitives/command.mjs.map +1 -0
- package/dist/primitives/dropdown-menu.cjs +155 -0
- package/dist/primitives/dropdown-menu.cjs.map +1 -0
- package/dist/primitives/dropdown-menu.d.cts +30 -0
- package/dist/primitives/dropdown-menu.d.cts.map +1 -0
- package/dist/primitives/dropdown-menu.d.mts +30 -0
- package/dist/primitives/dropdown-menu.d.mts.map +1 -0
- package/dist/primitives/dropdown-menu.mjs +139 -0
- package/dist/primitives/dropdown-menu.mjs.map +1 -0
- package/dist/primitives/empty.cjs +67 -0
- package/dist/primitives/empty.cjs.map +1 -0
- package/dist/primitives/empty.d.cts +8 -0
- package/dist/primitives/empty.d.cts.map +1 -0
- package/dist/primitives/empty.d.mts +8 -0
- package/dist/primitives/empty.d.mts.map +1 -0
- package/dist/primitives/empty.mjs +62 -0
- package/dist/primitives/empty.mjs.map +1 -0
- package/dist/primitives/field.cjs +121 -0
- package/dist/primitives/field.cjs.map +1 -0
- package/dist/primitives/field.d.cts +27 -0
- package/dist/primitives/field.d.cts.map +1 -0
- package/dist/primitives/field.d.mts +27 -0
- package/dist/primitives/field.d.mts.map +1 -0
- package/dist/primitives/field.mjs +112 -0
- package/dist/primitives/field.mjs.map +1 -0
- package/dist/primitives/input-group.cjs +88 -0
- package/dist/primitives/input-group.cjs.map +1 -0
- package/dist/primitives/input-group.d.cts +21 -0
- package/dist/primitives/input-group.d.cts.map +1 -0
- package/dist/primitives/input-group.d.mts +21 -0
- package/dist/primitives/input-group.d.mts.map +1 -0
- package/dist/primitives/input-group.mjs +81 -0
- package/dist/primitives/input-group.mjs.map +1 -0
- package/dist/primitives/input.cjs +20 -0
- package/dist/primitives/input.cjs.map +1 -0
- package/dist/primitives/input.d.cts +6 -0
- package/dist/primitives/input.d.cts.map +1 -0
- package/dist/primitives/input.d.mts +6 -0
- package/dist/primitives/input.d.mts.map +1 -0
- package/dist/primitives/input.mjs +18 -0
- package/dist/primitives/input.mjs.map +1 -0
- package/dist/primitives/item.cjs +135 -0
- package/dist/primitives/item.cjs.map +1 -0
- package/dist/primitives/item.d.cts +18 -0
- package/dist/primitives/item.d.cts.map +1 -0
- package/dist/primitives/item.d.mts +18 -0
- package/dist/primitives/item.d.mts.map +1 -0
- package/dist/primitives/item.mjs +124 -0
- package/dist/primitives/item.mjs.map +1 -0
- package/dist/primitives/label.cjs +18 -0
- package/dist/primitives/label.cjs.map +1 -0
- package/dist/primitives/label.d.cts +6 -0
- package/dist/primitives/label.d.cts.map +1 -0
- package/dist/primitives/label.d.mts +6 -0
- package/dist/primitives/label.d.mts.map +1 -0
- package/dist/primitives/label.mjs +16 -0
- package/dist/primitives/label.mjs.map +1 -0
- package/dist/primitives/message-scroller.cjs +69 -0
- package/dist/primitives/message-scroller.cjs.map +1 -0
- package/dist/primitives/message-scroller.d.cts +13 -0
- package/dist/primitives/message-scroller.d.cts.map +1 -0
- package/dist/primitives/message-scroller.d.mts +13 -0
- package/dist/primitives/message-scroller.d.mts.map +1 -0
- package/dist/primitives/message-scroller.mjs +62 -0
- package/dist/primitives/message-scroller.mjs.map +1 -0
- package/dist/primitives/message.cjs +58 -0
- package/dist/primitives/message.cjs.map +1 -0
- package/dist/primitives/message.d.cts +13 -0
- package/dist/primitives/message.d.cts.map +1 -0
- package/dist/primitives/message.d.mts +13 -0
- package/dist/primitives/message.d.mts.map +1 -0
- package/dist/primitives/message.mjs +51 -0
- package/dist/primitives/message.mjs.map +1 -0
- package/dist/primitives/navigation-menu.cjs +44 -0
- package/dist/primitives/navigation-menu.cjs.map +1 -0
- package/dist/primitives/navigation-menu.d.cts +9 -0
- package/dist/primitives/navigation-menu.d.cts.map +1 -0
- package/dist/primitives/navigation-menu.d.mts +9 -0
- package/dist/primitives/navigation-menu.d.mts.map +1 -0
- package/dist/primitives/navigation-menu.mjs +41 -0
- package/dist/primitives/navigation-menu.mjs.map +1 -0
- package/dist/primitives/popover.cjs +40 -0
- package/dist/primitives/popover.cjs.map +1 -0
- package/dist/primitives/popover.mjs +36 -0
- package/dist/primitives/popover.mjs.map +1 -0
- package/dist/primitives/progress.cjs +50 -0
- package/dist/primitives/progress.cjs.map +1 -0
- package/dist/primitives/progress.d.cts +10 -0
- package/dist/primitives/progress.d.cts.map +1 -0
- package/dist/primitives/progress.d.mts +10 -0
- package/dist/primitives/progress.d.mts.map +1 -0
- package/dist/primitives/progress.mjs +46 -0
- package/dist/primitives/progress.mjs.map +1 -0
- package/dist/primitives/select.cjs +111 -0
- package/dist/primitives/select.cjs.map +1 -0
- package/dist/primitives/select.d.cts +18 -0
- package/dist/primitives/select.d.cts.map +1 -0
- package/dist/primitives/select.d.mts +18 -0
- package/dist/primitives/select.d.mts.map +1 -0
- package/dist/primitives/select.mjs +100 -0
- package/dist/primitives/select.mjs.map +1 -0
- package/dist/primitives/separator.cjs +17 -0
- package/dist/primitives/separator.cjs.map +1 -0
- package/dist/primitives/separator.d.cts +6 -0
- package/dist/primitives/separator.d.cts.map +1 -0
- package/dist/primitives/separator.d.mts +6 -0
- package/dist/primitives/separator.d.mts.map +1 -0
- package/dist/primitives/separator.mjs +17 -0
- package/dist/primitives/separator.mjs.map +1 -0
- package/dist/primitives/sheet.cjs +78 -0
- package/dist/primitives/sheet.cjs.map +1 -0
- package/dist/primitives/sheet.mjs +72 -0
- package/dist/primitives/sheet.mjs.map +1 -0
- package/dist/primitives/sidebar.cjs +413 -0
- package/dist/primitives/sidebar.cjs.map +1 -0
- package/dist/primitives/sidebar.d.cts +66 -0
- package/dist/primitives/sidebar.d.cts.map +1 -0
- package/dist/primitives/sidebar.d.mts +66 -0
- package/dist/primitives/sidebar.d.mts.map +1 -0
- package/dist/primitives/sidebar.mjs +388 -0
- package/dist/primitives/sidebar.mjs.map +1 -0
- package/dist/primitives/skeleton.cjs +15 -0
- package/dist/primitives/skeleton.cjs.map +1 -0
- package/dist/primitives/skeleton.mjs +15 -0
- package/dist/primitives/skeleton.mjs.map +1 -0
- package/dist/primitives/slider.cjs +35 -0
- package/dist/primitives/slider.cjs.map +1 -0
- package/dist/primitives/slider.d.cts +6 -0
- package/dist/primitives/slider.d.cts.map +1 -0
- package/dist/primitives/slider.d.mts +6 -0
- package/dist/primitives/slider.d.mts.map +1 -0
- package/dist/primitives/slider.mjs +35 -0
- package/dist/primitives/slider.mjs.map +1 -0
- package/dist/primitives/table.cjs +78 -0
- package/dist/primitives/table.cjs.map +1 -0
- package/dist/primitives/table.mjs +69 -0
- package/dist/primitives/table.mjs.map +1 -0
- package/dist/primitives/textarea.cjs +18 -0
- package/dist/primitives/textarea.cjs.map +1 -0
- package/dist/primitives/textarea.d.cts +6 -0
- package/dist/primitives/textarea.d.cts.map +1 -0
- package/dist/primitives/textarea.d.mts +6 -0
- package/dist/primitives/textarea.d.mts.map +1 -0
- package/dist/primitives/textarea.mjs +16 -0
- package/dist/primitives/textarea.mjs.map +1 -0
- package/dist/primitives/tooltip.cjs +46 -0
- package/dist/primitives/tooltip.cjs.map +1 -0
- package/dist/primitives/tooltip.d.cts +9 -0
- package/dist/primitives/tooltip.d.cts.map +1 -0
- package/dist/primitives/tooltip.d.mts +9 -0
- package/dist/primitives/tooltip.d.mts.map +1 -0
- package/dist/primitives/tooltip.mjs +43 -0
- package/dist/primitives/tooltip.mjs.map +1 -0
- package/dist/shiki.cjs +6 -80
- package/dist/shiki.d.cts +3 -10
- package/dist/shiki.d.mts +3 -0
- package/dist/shiki.mjs +3 -0
- package/dist/styles/index.css +11 -0
- package/package.json +20 -13
- package/dist/chunk-3LBFYXI6.js +0 -42
- package/dist/chunk-3LBFYXI6.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -840
- package/dist/index.js +0 -5685
- package/dist/index.js.map +0 -1
- package/dist/neural-flow.cjs.map +0 -1
- package/dist/neural-flow.d.ts +0 -47
- package/dist/neural-flow.js +0 -978
- package/dist/neural-flow.js.map +0 -1
- package/dist/shiki.cjs.map +0 -1
- package/dist/shiki.d.ts +0 -10
- package/dist/shiki.js +0 -11
- package/dist/shiki.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Checkbox } from "@base-ui/react/checkbox";
|
|
4
|
+
//#region src/components/checkbox/Checkbox.d.ts
|
|
5
|
+
declare const checkboxVariants: (props?: ({
|
|
6
|
+
variant?: "error" | "default" | "success" | null | undefined;
|
|
7
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeof Checkbox.Root>, 'className'>, VariantProps<typeof checkboxVariants> {
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const Checkbox$1: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Checkbox$1 as Checkbox, checkboxVariants };
|
|
18
|
+
//# sourceMappingURL=Checkbox.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.cts","names":["CheckboxPrimitive","Checkbox"],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"mappings":";;;;cAUM,mBAAgB;;;6CAuBrB;iBAEgB,sBAEb,KAAK,MAAM,gCAAgCA,SAAkB,qBAC7D,oBAAoB;EACtB;EACA;EACA;EACA;;cAGIC,YAAQ,MAAA,0BAAA,gBAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Checkbox } from "@base-ui/react/checkbox";
|
|
4
|
+
//#region src/components/checkbox/Checkbox.d.ts
|
|
5
|
+
declare const checkboxVariants: (props?: ({
|
|
6
|
+
variant?: "error" | "default" | "success" | null | undefined;
|
|
7
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeof Checkbox.Root>, 'className'>, VariantProps<typeof checkboxVariants> {
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const Checkbox$1: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Checkbox$1 as Checkbox, checkboxVariants };
|
|
18
|
+
//# sourceMappingURL=Checkbox.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.mts","names":["CheckboxPrimitive","Checkbox"],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"mappings":";;;;cAUM,mBAAgB;;;6CAuBrB;iBAEgB,sBAEb,KAAK,MAAM,gCAAgCA,SAAkB,qBAC7D,oBAAoB;EACtB;EACA;EACA;EACA;;cAGIC,YAAQ,MAAA,0BAAA,gBAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.mjs";
|
|
3
|
+
import { Typography } from "../typography/Typography.mjs";
|
|
4
|
+
import { Checkbox as Checkbox$2 } from "../../primitives/checkbox.mjs";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
import { Check } from "lucide-react";
|
|
9
|
+
import { Checkbox } from "@base-ui/react/checkbox";
|
|
10
|
+
//#region src/components/checkbox/Checkbox.tsx
|
|
11
|
+
const checkboxVariants = cva("inline-flex items-center justify-center rounded-berget-xs transition-all duration-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "text-foreground border border-berget-border-interactive bg-berget-surface-subtle hover:bg-berget-surface-raised",
|
|
15
|
+
error: "border border-berget-destructive-border bg-berget-destructive text-berget-destructive-foreground hover:bg-berget-destructive/90",
|
|
16
|
+
success: "border border-berget-success-border bg-berget-success text-berget-success-foreground hover:bg-berget-success/90"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
sm: "w-4 h-4",
|
|
20
|
+
default: "w-5 h-5",
|
|
21
|
+
lg: "w-6 h-6"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const Checkbox$1 = React.forwardRef(({ "aria-label": ariaLabel, className, variant, size, label, description, error, id, disabled, ...props }, ref) => {
|
|
30
|
+
const generatedId = React.useId();
|
|
31
|
+
const checkboxId = id || generatedId;
|
|
32
|
+
const errorId = `${checkboxId}-error`;
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "flex items-start gap-3",
|
|
35
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "relative flex items-start pt-0.5",
|
|
37
|
+
children: /* @__PURE__ */ jsx(Checkbox$2, {
|
|
38
|
+
ref,
|
|
39
|
+
id: checkboxId,
|
|
40
|
+
disabled,
|
|
41
|
+
"aria-invalid": !!error,
|
|
42
|
+
"aria-describedby": error ? errorId : void 0,
|
|
43
|
+
"aria-label": ariaLabel || label || void 0,
|
|
44
|
+
className: cn(checkboxVariants({
|
|
45
|
+
variant,
|
|
46
|
+
size
|
|
47
|
+
}), "cursor-pointer", disabled && "cursor-not-allowed pointer-events-none", className),
|
|
48
|
+
...props,
|
|
49
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: /* @__PURE__ */ jsx(Check, {
|
|
50
|
+
className: "h-4 w-4 text-current stroke-current",
|
|
51
|
+
style: {
|
|
52
|
+
color: "currentColor",
|
|
53
|
+
stroke: "currentColor"
|
|
54
|
+
}
|
|
55
|
+
}) })
|
|
56
|
+
})
|
|
57
|
+
}), (label || description || error) && /* @__PURE__ */ jsxs("div", {
|
|
58
|
+
className: "flex flex-col gap-1",
|
|
59
|
+
children: [
|
|
60
|
+
label && /* @__PURE__ */ jsx("label", {
|
|
61
|
+
htmlFor: checkboxId,
|
|
62
|
+
className: cn("text-sm font-sans leading-none", disabled ? "text-white/40 cursor-not-allowed" : variant === "error" ? "text-berget-destructive-foreground cursor-pointer" : variant === "success" ? "text-berget-success-foreground cursor-pointer" : "cursor-pointer", error && "text-berget-destructive-foreground"),
|
|
63
|
+
children: label
|
|
64
|
+
}),
|
|
65
|
+
description && /* @__PURE__ */ jsx(Typography, {
|
|
66
|
+
variant: "xs",
|
|
67
|
+
color: "muted",
|
|
68
|
+
children: description
|
|
69
|
+
}),
|
|
70
|
+
error && /* @__PURE__ */ jsx(Typography, {
|
|
71
|
+
variant: "xs",
|
|
72
|
+
id: errorId,
|
|
73
|
+
className: "text-berget-destructive-foreground",
|
|
74
|
+
children: error
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
Checkbox$1.displayName = "Checkbox";
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Checkbox$1 as Checkbox, checkboxVariants };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=Checkbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.mjs","names":["Checkbox","CheckboxBase","CheckboxPrimitive"],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox';\nimport { Check } from 'lucide-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Checkbox as CheckboxBase } from '../../primitives/checkbox';\nimport { Typography } from '../typography';\n\nconst checkboxVariants = cva(\n 'inline-flex items-center justify-center rounded-berget-xs transition-all duration-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'text-foreground border border-berget-border-interactive bg-berget-surface-subtle hover:bg-berget-surface-raised',\n error:\n 'border border-berget-destructive-border bg-berget-destructive text-berget-destructive-foreground hover:bg-berget-destructive/90',\n success:\n 'border border-berget-success-border bg-berget-success text-berget-success-foreground hover:bg-berget-success/90',\n },\n size: {\n sm: 'w-4 h-4',\n default: 'w-5 h-5',\n lg: 'w-6 h-6',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport interface CheckboxProps\n extends\n Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'className'>,\n VariantProps<typeof checkboxVariants> {\n label?: string;\n description?: string;\n error?: string;\n className?: string;\n}\n\nconst Checkbox = React.forwardRef<React.ComponentRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n (\n {\n 'aria-label': ariaLabel,\n className,\n variant,\n size,\n label,\n description,\n error,\n id,\n disabled,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const checkboxId = id || generatedId;\n const errorId = `${checkboxId}-error`;\n\n return (\n <div className=\"flex items-start gap-3\">\n <div className=\"relative flex items-start pt-0.5\">\n <CheckboxBase\n ref={ref}\n id={checkboxId}\n disabled={disabled}\n aria-invalid={!!error}\n aria-describedby={error ? errorId : undefined}\n aria-label={ariaLabel || label || undefined}\n className={cn(\n checkboxVariants({ variant, size }),\n 'cursor-pointer',\n disabled && 'cursor-not-allowed pointer-events-none',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator>\n <Check\n className=\"h-4 w-4 text-current stroke-current\"\n style={{ color: 'currentColor', stroke: 'currentColor' }}\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxBase>\n </div>\n\n {(label || description || error) && (\n <div className=\"flex flex-col gap-1\">\n {label && (\n <label\n htmlFor={checkboxId}\n className={cn(\n 'text-sm font-sans leading-none',\n disabled\n ? 'text-white/40 cursor-not-allowed'\n : variant === 'error'\n ? 'text-berget-destructive-foreground cursor-pointer'\n : variant === 'success'\n ? 'text-berget-success-foreground cursor-pointer'\n : 'cursor-pointer',\n error && 'text-berget-destructive-foreground',\n )}\n >\n {label}\n </label>\n )}\n {description && (\n <Typography variant=\"xs\" color=\"muted\">\n {description}\n </Typography>\n )}\n {error && (\n <Typography variant=\"xs\" id={errorId} className=\"text-berget-destructive-foreground\">\n {error}\n </Typography>\n )}\n </div>\n )}\n </div>\n );\n },\n);\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox, checkboxVariants };\n"],"mappings":";;;;;;;;;;AAUA,MAAM,mBAAmB,IACvB,oKACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,OACE;GACF,SACE;EACJ;EACA,MAAM;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAYA,MAAMA,aAAW,MAAM,YAEnB,EACE,cAAc,WACd,WACA,SACA,MACA,OACA,aACA,OACA,IACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,cAAc,MAAM,MAAM;CAChC,MAAM,aAAa,MAAM;CACzB,MAAM,UAAU,GAAG,WAAW;CAE9B,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,oBAACC,YAAD;IACO;IACL,IAAI;IACM;IACV,gBAAc,CAAC,CAAC;IAChB,oBAAkB,QAAQ,UAAU,KAAA;IACpC,cAAY,aAAa,SAAS,KAAA;IAClC,WAAW,GACT,iBAAiB;KAAE;KAAS;IAAK,CAAC,GAClC,kBACA,YAAY,0CACZ,SACF;IACA,GAAI;IAEJ,UAAA,oBAACC,SAAkB,WAAnB,EAAA,UACE,oBAAC,OAAD;KACE,WAAU;KACV,OAAO;MAAE,OAAO;MAAgB,QAAQ;KAAe;IACxD,CAAA,EAC0B,CAAA;GACjB,CAAA;EACX,CAAA,IAEH,SAAS,eAAe,UACxB,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACG,SACC,oBAAC,SAAD;KACE,SAAS;KACT,WAAW,GACT,kCACA,WACI,qCACA,YAAY,UACV,sDACA,YAAY,YACV,kDACA,kBACR,SAAS,oCACX;KAEC,UAAA;IACI,CAAA;IAER,eACC,oBAAC,YAAD;KAAY,SAAQ;KAAK,OAAM;KAC5B,UAAA;IACS,CAAA;IAEb,SACC,oBAAC,YAAD;KAAY,SAAQ;KAAK,IAAI;KAAS,WAAU;KAC7C,UAAA;IACS,CAAA;GAEX;EAEJ,CAAA,CAAA;;AAET,CACF;AACA,WAAS,cAAc"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
3
|
+
const require_shiki = require("../../lib/shiki.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let lucide_react = require("lucide-react");
|
|
7
|
+
//#region src/components/code-block/CodeBlock.tsx
|
|
8
|
+
function CodeBlock({ code, language = "text", title, className }) {
|
|
9
|
+
const [html, setHtml] = (0, react.useState)(null);
|
|
10
|
+
const [copied, setCopied] = (0, react.useState)(false);
|
|
11
|
+
(0, react.useEffect)(() => {
|
|
12
|
+
require_shiki.getHighlighter().then((highlighter) => {
|
|
13
|
+
const lang = highlighter.getLoadedLanguages().includes(language) ? language : "text";
|
|
14
|
+
setHtml(highlighter.codeToHtml(code, {
|
|
15
|
+
lang,
|
|
16
|
+
theme: "berget"
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
}, [code, language]);
|
|
20
|
+
const handleCopy = (0, react.useCallback)(async () => {
|
|
21
|
+
await navigator.clipboard.writeText(code);
|
|
22
|
+
setCopied(true);
|
|
23
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
24
|
+
}, [code]);
|
|
25
|
+
const copyButton = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
26
|
+
onClick: handleCopy,
|
|
27
|
+
className: "flex items-center justify-center w-6 h-6 text-berget-muted-foreground hover:text-berget-foreground transition-colors",
|
|
28
|
+
"aria-label": "Copy code",
|
|
29
|
+
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "w-3.5 h-3.5" })
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
32
|
+
className: require_utils.cn("rounded-berget-xs border bg-berget-codeblock-bg border-berget-border backdrop-blur-[12px] relative overflow-hidden isolate", className),
|
|
33
|
+
children: [
|
|
34
|
+
title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
35
|
+
className: "!h-10 flex items-center !px-4 !text-xs !leading-normal border-b border-berget-border bg-berget-codeblock-header-bg",
|
|
36
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
37
|
+
className: "text-berget-muted-foreground",
|
|
38
|
+
children: title
|
|
39
|
+
})
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
42
|
+
className: "absolute right-2 top-2 z-10",
|
|
43
|
+
children: copyButton
|
|
44
|
+
}),
|
|
45
|
+
html ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46
|
+
className: "[&_.shiki]:!p-4 [&_.shiki]:!m-0 [&_.shiki]:overflow-x-auto [&_.shiki]:!text-sm [&_.shiki]:!leading-relaxed [&_.shiki]:bg-transparent",
|
|
47
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
48
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
49
|
+
className: "!p-4 !m-0 overflow-x-auto !text-sm !leading-relaxed text-berget-muted-foreground",
|
|
50
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: code })
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
exports.CodeBlock = CodeBlock;
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=CodeBlock.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.cjs","names":["useState","useCallback","Check","Copy","cn"],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { Copy, Check } from 'lucide-react';\nimport { cn } from '../../lib/utils';\nimport { getHighlighter } from '../../lib/shiki';\n\nexport interface CodeBlockProps {\n code: string;\n language?: string;\n title?: string;\n className?: string;\n}\n\nexport function CodeBlock({ code, language = 'text', title, className }: CodeBlockProps) {\n const [html, setHtml] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n useEffect(() => {\n getHighlighter().then((highlighter) => {\n const loadedLangs = highlighter.getLoadedLanguages();\n const lang = loadedLangs.includes(language) ? language : 'text';\n setHtml(highlighter.codeToHtml(code, { lang, theme: 'berget' }));\n });\n }, [code, language]);\n\n const handleCopy = useCallback(async () => {\n await navigator.clipboard.writeText(code);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }, [code]);\n\n const copyButton = (\n <button\n onClick={handleCopy}\n className=\"flex items-center justify-center w-6 h-6 text-berget-muted-foreground hover:text-berget-foreground transition-colors\"\n aria-label=\"Copy code\"\n >\n {copied ? <Check className=\"w-3.5 h-3.5\" /> : <Copy className=\"w-3.5 h-3.5\" />}\n </button>\n );\n\n return (\n <div\n className={cn(\n 'rounded-berget-xs border bg-berget-codeblock-bg border-berget-border backdrop-blur-[12px] relative overflow-hidden isolate',\n className,\n )}\n >\n {title && (\n <div className=\"!h-10 flex items-center !px-4 !text-xs !leading-normal border-b border-berget-border bg-berget-codeblock-header-bg\">\n <span className=\"text-berget-muted-foreground\">{title}</span>\n </div>\n )}\n <div className=\"absolute right-2 top-2 z-10\">{copyButton}</div>\n {html ? (\n <div\n className=\"[&_.shiki]:!p-4 [&_.shiki]:!m-0 [&_.shiki]:overflow-x-auto [&_.shiki]:!text-sm [&_.shiki]:!leading-relaxed [&_.shiki]:bg-transparent\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n ) : (\n <pre className=\"!p-4 !m-0 overflow-x-auto !text-sm !leading-relaxed text-berget-muted-foreground\">\n <code>{code}</code>\n </pre>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,UAAU,EAAE,MAAM,WAAW,QAAQ,OAAO,aAA6B;CACvF,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAwB,IAAI;CACpD,MAAM,CAAC,QAAQ,cAAA,GAAaA,MAAAA,SAAAA,CAAS,KAAK;CAE1C,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,cAAA,eAAe,CAAC,CAAC,MAAM,gBAAgB;GAErC,MAAM,OADc,YAAY,mBACT,CAAC,CAAC,SAAS,QAAQ,IAAI,WAAW;GACzD,QAAQ,YAAY,WAAW,MAAM;IAAE;IAAM,OAAO;GAAS,CAAC,CAAC;EACjE,CAAC;CACH,GAAG,CAAC,MAAM,QAAQ,CAAC;CAEnB,MAAM,cAAA,GAAaC,MAAAA,YAAAA,CAAY,YAAY;EACzC,MAAM,UAAU,UAAU,UAAU,IAAI;EACxC,UAAU,IAAI;EACd,iBAAiB,UAAU,KAAK,GAAG,GAAI;CACzC,GAAG,CAAC,IAAI,CAAC;CAET,MAAM,aACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,SAAS;EACT,WAAU;EACV,cAAW;EAEV,UAAA,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,OAAD,EAAO,WAAU,cAAe,CAAA,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD,EAAM,WAAU,cAAe,CAAA;CACvE,CAAA;CAGV,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACE,WAAWC,cAAAA,GACT,8HACA,SACF;EAJF,UAAA;GAMG,SACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAU;IACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KAAgC,UAAA;IAAY,CAAA;GACzD,CAAA;GAEP,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAU;IAA+B,UAAA;GAAgB,CAAA;GAC7D,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAU;IACV,yBAAyB,EAAE,QAAQ,KAAK;GACzC,CAAA,IAED,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAU;IACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAA,UAAO,KAAW,CAAA;GACf,CAAA;EAEJ;;AAET"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/components/code-block/CodeBlock.d.ts
|
|
2
|
+
export interface CodeBlockProps {
|
|
3
|
+
code: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CodeBlock({ code, language, title, className }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
//# sourceMappingURL=CodeBlock.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.cts","names":[],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"mappings":";iBAOiB;EACf;EACA;EACA;EACA;;wBAGc,YAAY,MAAM,UAAmB,OAAO,aAAa,6CAAc,IAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/components/code-block/CodeBlock.d.ts
|
|
2
|
+
export interface CodeBlockProps {
|
|
3
|
+
code: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CodeBlock({ code, language, title, className }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
//# sourceMappingURL=CodeBlock.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.mts","names":[],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"mappings":";iBAOiB;EACf;EACA;EACA;EACA;;wBAGc,YAAY,MAAM,UAAmB,OAAO,aAAa,6CAAc,IAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.mjs";
|
|
3
|
+
import { getHighlighter } from "../../lib/shiki.mjs";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Check, Copy } from "lucide-react";
|
|
7
|
+
//#region src/components/code-block/CodeBlock.tsx
|
|
8
|
+
function CodeBlock({ code, language = "text", title, className }) {
|
|
9
|
+
const [html, setHtml] = useState(null);
|
|
10
|
+
const [copied, setCopied] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
getHighlighter().then((highlighter) => {
|
|
13
|
+
const lang = highlighter.getLoadedLanguages().includes(language) ? language : "text";
|
|
14
|
+
setHtml(highlighter.codeToHtml(code, {
|
|
15
|
+
lang,
|
|
16
|
+
theme: "berget"
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
}, [code, language]);
|
|
20
|
+
const handleCopy = useCallback(async () => {
|
|
21
|
+
await navigator.clipboard.writeText(code);
|
|
22
|
+
setCopied(true);
|
|
23
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
24
|
+
}, [code]);
|
|
25
|
+
const copyButton = /* @__PURE__ */ jsx("button", {
|
|
26
|
+
onClick: handleCopy,
|
|
27
|
+
className: "flex items-center justify-center w-6 h-6 text-berget-muted-foreground hover:text-berget-foreground transition-colors",
|
|
28
|
+
"aria-label": "Copy code",
|
|
29
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "w-3.5 h-3.5" })
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: cn("rounded-berget-xs border bg-berget-codeblock-bg border-berget-border backdrop-blur-[12px] relative overflow-hidden isolate", className),
|
|
33
|
+
children: [
|
|
34
|
+
title && /* @__PURE__ */ jsx("div", {
|
|
35
|
+
className: "!h-10 flex items-center !px-4 !text-xs !leading-normal border-b border-berget-border bg-berget-codeblock-header-bg",
|
|
36
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
37
|
+
className: "text-berget-muted-foreground",
|
|
38
|
+
children: title
|
|
39
|
+
})
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "absolute right-2 top-2 z-10",
|
|
43
|
+
children: copyButton
|
|
44
|
+
}),
|
|
45
|
+
html ? /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: "[&_.shiki]:!p-4 [&_.shiki]:!m-0 [&_.shiki]:overflow-x-auto [&_.shiki]:!text-sm [&_.shiki]:!leading-relaxed [&_.shiki]:bg-transparent",
|
|
47
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
48
|
+
}) : /* @__PURE__ */ jsx("pre", {
|
|
49
|
+
className: "!p-4 !m-0 overflow-x-auto !text-sm !leading-relaxed text-berget-muted-foreground",
|
|
50
|
+
children: /* @__PURE__ */ jsx("code", { children: code })
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { CodeBlock };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=CodeBlock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.mjs","names":[],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { Copy, Check } from 'lucide-react';\nimport { cn } from '../../lib/utils';\nimport { getHighlighter } from '../../lib/shiki';\n\nexport interface CodeBlockProps {\n code: string;\n language?: string;\n title?: string;\n className?: string;\n}\n\nexport function CodeBlock({ code, language = 'text', title, className }: CodeBlockProps) {\n const [html, setHtml] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n useEffect(() => {\n getHighlighter().then((highlighter) => {\n const loadedLangs = highlighter.getLoadedLanguages();\n const lang = loadedLangs.includes(language) ? language : 'text';\n setHtml(highlighter.codeToHtml(code, { lang, theme: 'berget' }));\n });\n }, [code, language]);\n\n const handleCopy = useCallback(async () => {\n await navigator.clipboard.writeText(code);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }, [code]);\n\n const copyButton = (\n <button\n onClick={handleCopy}\n className=\"flex items-center justify-center w-6 h-6 text-berget-muted-foreground hover:text-berget-foreground transition-colors\"\n aria-label=\"Copy code\"\n >\n {copied ? <Check className=\"w-3.5 h-3.5\" /> : <Copy className=\"w-3.5 h-3.5\" />}\n </button>\n );\n\n return (\n <div\n className={cn(\n 'rounded-berget-xs border bg-berget-codeblock-bg border-berget-border backdrop-blur-[12px] relative overflow-hidden isolate',\n className,\n )}\n >\n {title && (\n <div className=\"!h-10 flex items-center !px-4 !text-xs !leading-normal border-b border-berget-border bg-berget-codeblock-header-bg\">\n <span className=\"text-berget-muted-foreground\">{title}</span>\n </div>\n )}\n <div className=\"absolute right-2 top-2 z-10\">{copyButton}</div>\n {html ? (\n <div\n className=\"[&_.shiki]:!p-4 [&_.shiki]:!m-0 [&_.shiki]:overflow-x-auto [&_.shiki]:!text-sm [&_.shiki]:!leading-relaxed [&_.shiki]:bg-transparent\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n ) : (\n <pre className=\"!p-4 !m-0 overflow-x-auto !text-sm !leading-relaxed text-berget-muted-foreground\">\n <code>{code}</code>\n </pre>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,UAAU,EAAE,MAAM,WAAW,QAAQ,OAAO,aAA6B;CACvF,MAAM,CAAC,MAAM,WAAW,SAAwB,IAAI;CACpD,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAE1C,gBAAgB;EACd,eAAe,CAAC,CAAC,MAAM,gBAAgB;GAErC,MAAM,OADc,YAAY,mBACT,CAAC,CAAC,SAAS,QAAQ,IAAI,WAAW;GACzD,QAAQ,YAAY,WAAW,MAAM;IAAE;IAAM,OAAO;GAAS,CAAC,CAAC;EACjE,CAAC;CACH,GAAG,CAAC,MAAM,QAAQ,CAAC;CAEnB,MAAM,aAAa,YAAY,YAAY;EACzC,MAAM,UAAU,UAAU,UAAU,IAAI;EACxC,UAAU,IAAI;EACd,iBAAiB,UAAU,KAAK,GAAG,GAAI;CACzC,GAAG,CAAC,IAAI,CAAC;CAET,MAAM,aACJ,oBAAC,UAAD;EACE,SAAS;EACT,WAAU;EACV,cAAW;EAEV,UAAA,SAAS,oBAAC,OAAD,EAAO,WAAU,cAAe,CAAA,IAAI,oBAAC,MAAD,EAAM,WAAU,cAAe,CAAA;CACvE,CAAA;CAGV,OACE,qBAAC,OAAD;EACE,WAAW,GACT,8HACA,SACF;EAJF,UAAA;GAMG,SACC,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,QAAD;KAAM,WAAU;KAAgC,UAAA;IAAY,CAAA;GACzD,CAAA;GAEP,oBAAC,OAAD;IAAK,WAAU;IAA+B,UAAA;GAAgB,CAAA;GAC7D,OACC,oBAAC,OAAD;IACE,WAAU;IACV,yBAAyB,EAAE,QAAQ,KAAK;GACzC,CAAA,IAED,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,QAAD,EAAA,UAAO,KAAW,CAAA;GACf,CAAA;EAEJ;;AAET"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
let class_variance_authority = require("class-variance-authority");
|
|
7
|
+
let _base_ui_react_merge_props = require("@base-ui/react/merge-props");
|
|
8
|
+
let _base_ui_react_use_render = require("@base-ui/react/use-render");
|
|
9
|
+
//#region src/components/container/Container.tsx
|
|
10
|
+
const containerVariants = (0, class_variance_authority.cva)("w-full mx-auto", {
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
sm: "max-w-3xl",
|
|
14
|
+
md: "max-w-5xl",
|
|
15
|
+
lg: "max-w-7xl",
|
|
16
|
+
xl: "max-w-screen-xl",
|
|
17
|
+
full: "max-w-full"
|
|
18
|
+
},
|
|
19
|
+
padding: {
|
|
20
|
+
none: "px-0",
|
|
21
|
+
sm: "px-4 sm:px-6",
|
|
22
|
+
md: "px-4 sm:px-6 lg:px-8",
|
|
23
|
+
lg: "px-4 sm:px-8 lg:px-12"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "lg",
|
|
28
|
+
padding: "md"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const Container = react.forwardRef(({ className, size, padding, asChild = false, children, ...props }, ref) => {
|
|
32
|
+
return (0, _base_ui_react_use_render.useRender)({
|
|
33
|
+
ref,
|
|
34
|
+
defaultTagName: "div",
|
|
35
|
+
render: asChild ? children : void 0,
|
|
36
|
+
props: (0, _base_ui_react_merge_props.mergeProps)({
|
|
37
|
+
className: require_utils.cn(containerVariants({
|
|
38
|
+
size,
|
|
39
|
+
padding
|
|
40
|
+
}), className),
|
|
41
|
+
children: asChild ? void 0 : children
|
|
42
|
+
}, props)
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
Container.displayName = "Container";
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.Container = Container;
|
|
48
|
+
exports.containerVariants = containerVariants;
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=Container.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.cjs","names":["cva","React","useRender","mergeProps","cn"],"sources":["../../../src/components/container/Container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\n\nconst containerVariants = cva('w-full mx-auto', {\n variants: {\n size: {\n sm: 'max-w-3xl',\n md: 'max-w-5xl',\n lg: 'max-w-7xl',\n xl: 'max-w-screen-xl',\n full: 'max-w-full',\n },\n padding: {\n none: 'px-0',\n sm: 'px-4 sm:px-6',\n md: 'px-4 sm:px-6 lg:px-8',\n lg: 'px-4 sm:px-8 lg:px-12',\n },\n },\n defaultVariants: {\n size: 'lg',\n padding: 'md',\n },\n});\n\nexport interface ContainerProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {\n children?: React.ReactNode;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n}\n\nconst Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ className, size, padding, asChild = false, children, ...props }, ref) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(containerVariants({ size, padding }), className),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nContainer.displayName = 'Container';\n\nexport { Container, containerVariants };\n"],"mappings":";;;;;;;;;AAQA,MAAM,qBAAA,GAAoBA,yBAAAA,IAAAA,CAAI,kBAAkB;CAC9C,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;AACF,CAAC;AASD,MAAM,YAAYC,MAAM,YACrB,EAAE,WAAW,MAAM,SAAS,UAAU,OAAO,UAAU,GAAG,SAAS,QAAQ;CAC1E,QAAA,GAAOC,0BAAAA,UAAAA,CAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,QAAA,GAAOC,2BAAAA,WAAAA,CACL;GACE,WAAWC,cAAAA,GAAG,kBAAkB;IAAE;IAAM;GAAQ,CAAC,GAAG,SAAS;GAC7D,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,UAAU,cAAc"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/container/Container.d.ts
|
|
5
|
+
declare const containerVariants: (props?: ({
|
|
6
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
7
|
+
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface ContainerProps extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Render as a different element/component. Replaces the Radix `asChild` prop. */
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Container, containerVariants };
|
|
17
|
+
//# sourceMappingURL=Container.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.d.cts","names":[],"sources":["../../../src/components/container/Container.tsx"],"mappings":";;;;cAQM,oBAAiB;;;6CAoBrB;iBAEe,uBACP,UAAU,uBAAuB,oBAAoB;EAC7D,WAAW,MAAM;;EAEjB;;cAGI,WAAS,MAAA,0BAAA,KAAA,yBAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/container/Container.d.ts
|
|
5
|
+
declare const containerVariants: (props?: ({
|
|
6
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
7
|
+
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface ContainerProps extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Render as a different element/component. Replaces the Radix `asChild` prop. */
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Container, containerVariants };
|
|
17
|
+
//# sourceMappingURL=Container.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.d.mts","names":[],"sources":["../../../src/components/container/Container.tsx"],"mappings":";;;;cAQM,oBAAiB;;;6CAoBrB;iBAEe,uBACP,UAAU,uBAAuB,oBAAoB;EAC7D,WAAW,MAAM;;EAEjB;;cAGI,WAAS,MAAA,0BAAA,KAAA,yBAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.mjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
//#region src/components/container/Container.tsx
|
|
8
|
+
const containerVariants = cva("w-full mx-auto", {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "max-w-3xl",
|
|
12
|
+
md: "max-w-5xl",
|
|
13
|
+
lg: "max-w-7xl",
|
|
14
|
+
xl: "max-w-screen-xl",
|
|
15
|
+
full: "max-w-full"
|
|
16
|
+
},
|
|
17
|
+
padding: {
|
|
18
|
+
none: "px-0",
|
|
19
|
+
sm: "px-4 sm:px-6",
|
|
20
|
+
md: "px-4 sm:px-6 lg:px-8",
|
|
21
|
+
lg: "px-4 sm:px-8 lg:px-12"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
size: "lg",
|
|
26
|
+
padding: "md"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const Container = React.forwardRef(({ className, size, padding, asChild = false, children, ...props }, ref) => {
|
|
30
|
+
return useRender({
|
|
31
|
+
ref,
|
|
32
|
+
defaultTagName: "div",
|
|
33
|
+
render: asChild ? children : void 0,
|
|
34
|
+
props: mergeProps({
|
|
35
|
+
className: cn(containerVariants({
|
|
36
|
+
size,
|
|
37
|
+
padding
|
|
38
|
+
}), className),
|
|
39
|
+
children: asChild ? void 0 : children
|
|
40
|
+
}, props)
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
Container.displayName = "Container";
|
|
44
|
+
//#endregion
|
|
45
|
+
export { Container, containerVariants };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=Container.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.mjs","names":[],"sources":["../../../src/components/container/Container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\n\nconst containerVariants = cva('w-full mx-auto', {\n variants: {\n size: {\n sm: 'max-w-3xl',\n md: 'max-w-5xl',\n lg: 'max-w-7xl',\n xl: 'max-w-screen-xl',\n full: 'max-w-full',\n },\n padding: {\n none: 'px-0',\n sm: 'px-4 sm:px-6',\n md: 'px-4 sm:px-6 lg:px-8',\n lg: 'px-4 sm:px-8 lg:px-12',\n },\n },\n defaultVariants: {\n size: 'lg',\n padding: 'md',\n },\n});\n\nexport interface ContainerProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {\n children?: React.ReactNode;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n}\n\nconst Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ className, size, padding, asChild = false, children, ...props }, ref) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(containerVariants({ size, padding }), className),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nContainer.displayName = 'Container';\n\nexport { Container, containerVariants };\n"],"mappings":";;;;;;;AAQA,MAAM,oBAAoB,IAAI,kBAAkB;CAC9C,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;AACF,CAAC;AASD,MAAM,YAAY,MAAM,YACrB,EAAE,WAAW,MAAM,SAAS,UAAU,OAAO,UAAU,GAAG,SAAS,QAAQ;CAC1E,OAAO,UAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,OAAO,WACL;GACE,WAAW,GAAG,kBAAkB;IAAE;IAAM;GAAQ,CAAC,GAAG,SAAS;GAC7D,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,UAAU,cAAc"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
4
|
+
const require_Icon = require("../icon/Icon.cjs");
|
|
5
|
+
const require_popover = require("../../primitives/popover.cjs");
|
|
6
|
+
const require_command = require("../../primitives/command.cjs");
|
|
7
|
+
const require_countries = require("./countries.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_runtime.__toESM(react, 1);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let lucide_react = require("lucide-react");
|
|
12
|
+
//#region src/components/country-select/CountrySelect.tsx
|
|
13
|
+
const CountrySelect = react.forwardRef(({ value, onValueChange, placeholder = "Select country", disabled = false, className, align = "center", sideOffset = 4 }, ref) => {
|
|
14
|
+
const [open, setOpen] = react.useState(false);
|
|
15
|
+
const selectedCountry = react.useMemo(() => require_countries.COUNTRIES.find((c) => c.code === value), [value]);
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_popover.Popover, {
|
|
17
|
+
open,
|
|
18
|
+
onOpenChange: setOpen,
|
|
19
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_popover.PopoverTrigger, {
|
|
20
|
+
ref,
|
|
21
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
disabled,
|
|
24
|
+
"aria-expanded": open,
|
|
25
|
+
className: require_utils.cn("flex w-full items-center justify-between", "rounded-berget-xs border bg-card", "px-4 py-3 text-sm", "transition-colors duration-200", "focus-visible:outline-none focus-visible:ring-0", "focus-visible:ring-offset-0 focus-visible:border-berget-form-focus-border", "disabled:cursor-not-allowed disabled:opacity-50", "border-berget-border-interactive hover:bg-berget-surface-hover", className)
|
|
26
|
+
}),
|
|
27
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
28
|
+
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
29
|
+
children: selectedCountry ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
30
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
31
|
+
className: "text-xl flex-shrink-0",
|
|
32
|
+
children: selectedCountry.flag
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
35
|
+
className: "truncate",
|
|
36
|
+
children: selectedCountry.name
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
39
|
+
className: "text-berget-muted-foreground text-xs flex-shrink-0",
|
|
40
|
+
children: [
|
|
41
|
+
"(",
|
|
42
|
+
selectedCountry.code,
|
|
43
|
+
")"
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
47
|
+
icon: lucide_react.Globe,
|
|
48
|
+
size: 16,
|
|
49
|
+
className: "flex-shrink-0 text-berget-muted-foreground"
|
|
50
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
51
|
+
className: "text-berget-muted-foreground truncate",
|
|
52
|
+
children: placeholder
|
|
53
|
+
})] })
|
|
54
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
55
|
+
icon: lucide_react.ChevronDown,
|
|
56
|
+
size: 16,
|
|
57
|
+
className: require_utils.cn("flex-shrink-0 text-berget-muted-foreground", "transition-transform duration-200", open && "rotate-180")
|
|
58
|
+
})]
|
|
59
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_popover.PopoverContent, {
|
|
60
|
+
align,
|
|
61
|
+
sideOffset,
|
|
62
|
+
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
63
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_command.Command, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandInput, { placeholder: "Search country..." }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_command.CommandList, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandEmpty, { children: "No countries found." }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandGroup, { children: require_countries.COUNTRIES.map((country) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_command.CommandItem, {
|
|
64
|
+
value: `${country.name} ${country.code}`,
|
|
65
|
+
onSelect: () => {
|
|
66
|
+
onValueChange?.(country.code);
|
|
67
|
+
setOpen(false);
|
|
68
|
+
},
|
|
69
|
+
className: require_utils.cn("flex items-center gap-3 px-3 py-2.5", "data-[selected='true']:bg-berget-brand-granite-700/40! data-[selected=true]:text-berget-foreground", value === country.code && "bg-berget-brand-granite-800/40"),
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
72
|
+
className: "text-xl flex-shrink-0",
|
|
73
|
+
children: country.flag
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
76
|
+
className: "flex-1 min-w-0",
|
|
77
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
78
|
+
className: "text-sm truncate",
|
|
79
|
+
children: country.name
|
|
80
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
81
|
+
className: "text-xs text-berget-muted-foreground",
|
|
82
|
+
children: country.code
|
|
83
|
+
})]
|
|
84
|
+
}),
|
|
85
|
+
value === country.code && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "w-2 h-2 rounded-full bg-berget-brand-granite-400 flex-shrink-0" })
|
|
86
|
+
]
|
|
87
|
+
}, country.code)) })] })] })
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
CountrySelect.displayName = "CountrySelect";
|
|
92
|
+
//#endregion
|
|
93
|
+
exports.CountrySelect = CountrySelect;
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=CountrySelect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountrySelect.cjs","names":["React","COUNTRIES","Popover","PopoverTrigger","cn","Icon","Globe","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem"],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-0',\n 'focus-visible:ring-offset-0 focus-visible:border-berget-form-focus-border',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n 'border-berget-border-interactive hover:bg-berget-surface-hover',\n className,\n )}\n />\n }\n >\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">\n {selectedCountry ? (\n <>\n <span className=\"text-xl flex-shrink-0\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"text-berget-muted-foreground text-xs flex-shrink-0\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon\n icon={Globe}\n size={16}\n className=\"flex-shrink-0 text-berget-muted-foreground\"\n />\n <span className=\"text-berget-muted-foreground truncate\">{placeholder}</span>\n </>\n )}\n </div>\n <Icon\n icon={ChevronDown}\n size={16}\n className={cn(\n 'flex-shrink-0 text-berget-muted-foreground',\n 'transition-transform duration-200',\n open && 'rotate-180',\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className=\"w-[var(--radix-popover-trigger-width)] p-0\"\n >\n <Command>\n <CommandInput placeholder=\"Search country...\" />\n <CommandList>\n <CommandEmpty>No countries found.</CommandEmpty>\n <CommandGroup>\n {COUNTRIES.map((country) => (\n <CommandItem\n key={country.code}\n value={`${country.name} ${country.code}`}\n onSelect={() => {\n onValueChange?.(country.code);\n setOpen(false);\n }}\n className={cn(\n 'flex items-center gap-3 px-3 py-2.5',\n \"data-[selected='true']:bg-berget-brand-granite-700/40! data-[selected=true]:text-berget-foreground\",\n value === country.code && 'bg-berget-brand-granite-800/40',\n )}\n >\n <span className=\"text-xl flex-shrink-0\">{country.flag}</span>\n <div className=\"flex-1 min-w-0\">\n <div className=\"text-sm truncate\">{country.name}</div>\n <div className=\"text-xs text-berget-muted-foreground\">{country.code}</div>\n </div>\n {value === country.code && (\n <div className=\"w-2 h-2 rounded-full bg-berget-brand-granite-400 flex-shrink-0\" />\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nCountrySelect.displayName = 'CountrySelect';\n\nexport { CountrySelect };\nexport type { Country };\nexport {\n COUNTRIES,\n EU_COUNTRY_CODES,\n getCountryByCode,\n getCountryByName,\n isEUCountry,\n} from './countries';\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAM,gBAAgBA,MAAM,YAExB,EACE,OACA,eACA,cAAc,kBACd,WAAW,OACX,WACA,QAAQ,UACR,aAAa,KAEf,QACG;CACH,MAAM,CAAC,MAAM,WAAWA,MAAM,SAAS,KAAK;CAC5C,MAAM,kBAAkBA,MAAM,cAAcC,kBAAAA,UAAU,MAAM,MAAM,EAAE,SAAS,KAAK,GAAG,CAAC,KAAK,CAAC;CAE5F,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,SAAD;EAAe;EAAM,cAAc;EAAnC,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,gBAAD;GACO;GACL,QACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IACE,MAAK;IACK;IACV,iBAAe;IACf,WAAWC,cAAAA,GAET,4CACA,oCACA,qBACA,kCACA,mDACA,6EACA,mDAEA,kEACA,SACF;GACD,CAAA;GApBL,UAAA,CAuBE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAU;IACZ,UAAA,kBACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;KACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;MAAM,WAAU;MAAyB,UAAA,gBAAgB;KAAW,CAAA;KACpE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;MAAM,WAAU;MAAY,UAAA,gBAAgB;KAAW,CAAA;KACvD,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;MAAM,WAAU;MAAhB,UAAA;OAAqE;OACjE,gBAAgB;OAAK;MACnB;;IACN,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD;KACE,MAAMC,aAAAA;KACN,MAAM;KACN,WAAU;IACX,CAAA,GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KAAyC,UAAA;IAAkB,CAAA,CAC3E,EAAA,CAAA;GAED,CAAA,GACL,iBAAA,GAAA,kBAAA,IAAA,CAACD,aAAAA,MAAD;IACE,MAAME,aAAAA;IACN,MAAM;IACN,WAAWH,cAAAA,GACT,8CACA,qCACA,QAAQ,YACV;GACD,CAAA,CACa;EAEhB,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAACI,gBAAAA,gBAAD;GACS;GACK;GACZ,WAAU;GAEV,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,SAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,cAAD,EAAc,aAAY,oBAAqB,CAAA,GAC/C,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,aAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,cAAD,EAAA,UAAc,sBAAiC,CAAA,GAC/C,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,cAAD,EAAA,UACGZ,kBAAAA,UAAU,KAAK,YACd,iBAAA,GAAA,kBAAA,KAAA,CAACa,gBAAAA,aAAD;IAEE,OAAO,GAAG,QAAQ,KAAK,GAAG,QAAQ;IAClC,gBAAgB;KACd,gBAAgB,QAAQ,IAAI;KAC5B,QAAQ,KAAK;IACf;IACA,WAAWV,cAAAA,GACT,uCACA,sGACA,UAAU,QAAQ,QAAQ,gCAC5B;IAXF,UAAA;KAaE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;MAAM,WAAU;MAAyB,UAAA,QAAQ;KAAW,CAAA;KAC5D,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;OAAK,WAAU;OAAoB,UAAA,QAAQ;MAAU,CAAA,GACrD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;OAAK,WAAU;OAAwC,UAAA,QAAQ;MAAU,CAAA,CACtE;;KACJ,UAAU,QAAQ,QACjB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,WAAU,iEAAkE,CAAA;IAExE;GApBN,GAAA,QAAQ,IAoBF,CACd,EACW,CAAA,CACH,EAAA,CAAA,CACN,EAAA,CAAA;EACK,CAAA,CACT;;AAEb,CACF;AAEA,cAAc,cAAc"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { COUNTRIES, Country, EU_COUNTRY_CODES, getCountryByCode, getCountryByName, isEUCountry } from "./countries.cjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/components/country-select/CountrySelect.d.ts
|
|
4
|
+
export interface CountrySelectProps {
|
|
5
|
+
value?: string | null;
|
|
6
|
+
onValueChange?: (code: string) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
align?: 'center' | 'start' | 'end';
|
|
11
|
+
sideOffset?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const CountrySelect: React.ForwardRefExoticComponent<CountrySelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CountrySelect };
|
|
16
|
+
//# sourceMappingURL=CountrySelect.d.cts.map
|