@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,64 @@
|
|
|
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/box/Box.tsx
|
|
8
|
+
const boxVariants = cva("flex", {
|
|
9
|
+
variants: {
|
|
10
|
+
direction: {
|
|
11
|
+
row: "flex-row",
|
|
12
|
+
column: "flex-col",
|
|
13
|
+
"row-reverse": "flex-row-reverse",
|
|
14
|
+
"column-reverse": "flex-col-reverse"
|
|
15
|
+
},
|
|
16
|
+
align: {
|
|
17
|
+
start: "items-start",
|
|
18
|
+
center: "items-center",
|
|
19
|
+
end: "items-end",
|
|
20
|
+
stretch: "items-stretch",
|
|
21
|
+
baseline: "items-baseline"
|
|
22
|
+
},
|
|
23
|
+
justify: {
|
|
24
|
+
start: "justify-start",
|
|
25
|
+
center: "justify-center",
|
|
26
|
+
end: "justify-end",
|
|
27
|
+
between: "justify-between",
|
|
28
|
+
around: "justify-around",
|
|
29
|
+
evenly: "justify-evenly"
|
|
30
|
+
},
|
|
31
|
+
wrap: {
|
|
32
|
+
nowrap: "flex-nowrap",
|
|
33
|
+
wrap: "flex-wrap",
|
|
34
|
+
"wrap-reverse": "flex-wrap-reverse"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
direction: "column",
|
|
39
|
+
align: "start",
|
|
40
|
+
justify: "start",
|
|
41
|
+
wrap: "nowrap"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const Box = React.forwardRef(({ className, direction, align, justify, wrap, gap, asChild = false, children, ...props }, ref) => {
|
|
45
|
+
return useRender({
|
|
46
|
+
ref,
|
|
47
|
+
defaultTagName: "div",
|
|
48
|
+
render: asChild ? children : void 0,
|
|
49
|
+
props: mergeProps({
|
|
50
|
+
className: cn(boxVariants({
|
|
51
|
+
direction,
|
|
52
|
+
align,
|
|
53
|
+
justify,
|
|
54
|
+
wrap
|
|
55
|
+
}), gap !== void 0 && `gap-${gap}`, className),
|
|
56
|
+
children: asChild ? void 0 : children
|
|
57
|
+
}, props)
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
Box.displayName = "Box";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Box, boxVariants };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=Box.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.mjs","names":[],"sources":["../../../src/components/box/Box.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../lib/utils';\n\nconst boxVariants = cva('flex', {\n variants: {\n direction: {\n row: 'flex-row',\n column: 'flex-col',\n 'row-reverse': 'flex-row-reverse',\n 'column-reverse': 'flex-col-reverse',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n wrap: {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n },\n },\n defaultVariants: {\n direction: 'column',\n align: 'start',\n justify: 'start',\n wrap: 'nowrap',\n },\n});\n\nexport type SpacingScale =\n | 0\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 8\n | 10\n | 12\n | 16\n | 20\n | 24\n | 32\n | 40\n | 48\n | 56\n | 64\n | 72\n | 80\n | 96;\n\nexport interface BoxProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof boxVariants> {\n children?: React.ReactNode;\n gap?: SpacingScale;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n}\n\nconst Box = React.forwardRef<HTMLElement, BoxProps>(\n (\n { className, direction, align, justify, wrap, gap, asChild = false, children, ...props },\n ref,\n ) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(\n boxVariants({ direction, align, justify, wrap }),\n gap !== undefined && `gap-${gap}`,\n className,\n ),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nBox.displayName = 'Box';\n\nexport { Box, boxVariants };\n"],"mappings":";;;;;;;AAQA,MAAM,cAAc,IAAI,QAAQ;CAC9B,UAAU;EACR,WAAW;GACT,KAAK;GACL,QAAQ;GACR,eAAe;GACf,kBAAkB;EACpB;EACA,OAAO;GACL,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,UAAU;EACZ;EACA,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;EACV;EACA,MAAM;GACJ,QAAQ;GACR,MAAM;GACN,gBAAgB;EAClB;CACF;CACA,iBAAiB;EACf,WAAW;EACX,OAAO;EACP,SAAS;EACT,MAAM;CACR;AACF,CAAC;AAiCD,MAAM,MAAM,MAAM,YAEd,EAAE,WAAW,WAAW,OAAO,SAAS,MAAM,KAAK,UAAU,OAAO,UAAU,GAAG,SACjF,QACG;CACH,OAAO,UAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,OAAO,WACL;GACE,WAAW,GACT,YAAY;IAAE;IAAW;IAAO;IAAS;GAAK,CAAC,GAC/C,QAAQ,KAAA,KAAa,OAAO,OAC5B,SACF;GACA,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,IAAI,cAAc"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
3
|
+
const require_button = require("../../primitives/button.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
//#region src/components/button/Button.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Shared interaction chrome for every variant.
|
|
8
|
+
*
|
|
9
|
+
* The primitive already provides hover/focus/disabled plumbing via shadcn
|
|
10
|
+
* tokens (`--primary`, `--muted`, `--ring`, …), which the shadcn bridge in
|
|
11
|
+
* `styles/index.css` maps to brand values. These classes neutralise the bits
|
|
12
|
+
* that don't fit the Berget system and apply the component-scoped
|
|
13
|
+
* `--berget-button-*` state tokens:
|
|
14
|
+
*
|
|
15
|
+
* - Focus: always visible on keyboard focus (`focus-visible`), drawn as a
|
|
16
|
+
* real CSS **outline** (2px, offset 2px) in `--berget-button-focus-ring`
|
|
17
|
+
* (moss-300 dark / moss-600 light, ≥3:1 against the surface per
|
|
18
|
+
* WCAG 2.4.7) — not a ring/box-shadow hugging the edge, and the control's
|
|
19
|
+
* own border keeps its resting colour.
|
|
20
|
+
* - Disabled: replaces the primitive's flat `opacity-50` fade with explicit
|
|
21
|
+
* muted tokens so every variant stays legible (≥3:1, and disabled UI is
|
|
22
|
+
* exempt from AA text contrast per WCAG 1.4.3).
|
|
23
|
+
*
|
|
24
|
+
* `dark:` is intentionally absent — it tracks `prefers-color-scheme`, not the
|
|
25
|
+
* Berget theme. Theme switching is driven entirely by the semantic tokens.
|
|
26
|
+
*/
|
|
27
|
+
const interactionClasses = require_utils.cn("focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:ring-0", "disabled:pointer-events-none disabled:opacity-100 disabled:cursor-not-allowed", "active:not-aria-[haspopup]:translate-y-0");
|
|
28
|
+
/** Disabled treatment shared by every variant. */
|
|
29
|
+
const disabledClasses = "disabled:text-berget-button-disabled-fg disabled:shadow-none";
|
|
30
|
+
/** Brand-specific classes applied *on top* of the upstream primitive. */
|
|
31
|
+
function brandVariantClasses(variant) {
|
|
32
|
+
switch (variant) {
|
|
33
|
+
case "primary": return require_utils.cn("bg-berget-button-primary-bg text-berget-button-primary-fg", "hover:bg-berget-button-primary-hover", "hover:text-berget-button-primary-fg", "active:bg-berget-button-primary-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-berget-button-primary-disabled-bg");
|
|
34
|
+
case "destructive": return require_utils.cn("bg-berget-button-destructive-bg text-berget-button-destructive-fg", "hover:bg-berget-button-destructive-hover", "hover:text-berget-button-destructive-hover-fg", "active:bg-berget-button-destructive-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-berget-button-destructive-disabled-bg");
|
|
35
|
+
case "outline": return require_utils.cn("bg-transparent border-berget-button-outline-border text-berget-button-outline-fg", "hover:bg-berget-button-outline-hover dark:hover:bg-berget-button-outline-hover", "active:bg-transparent dark:active:bg-transparent", "focus-visible:border-berget-button-outline-border", disabledClasses, "disabled:bg-transparent disabled:border-berget-button-disabled-border");
|
|
36
|
+
case "ghost": return require_utils.cn("bg-transparent text-berget-button-ghost-fg", "hover:bg-berget-button-ghost-hover hover:text-berget-button-ghost-fg", "dark:hover:bg-berget-button-ghost-hover", "active:bg-berget-button-ghost-active dark:active:bg-berget-button-ghost-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-transparent");
|
|
37
|
+
case "link": return require_utils.cn("h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none", "hover:bg-transparent hover:text-berget-button-link-hover-fg", "active:text-berget-button-link-fg", "focus:bg-transparent", "focus-visible:border-transparent focus-visible:ring-0", "focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:rounded-berget-xs", "disabled:text-berget-button-disabled-fg disabled:no-underline", "disabled:opacity-100 disabled:cursor-not-allowed");
|
|
38
|
+
default: return require_utils.cn("bg-berget-button-default-bg border-berget-button-default-border text-berget-button-default-fg", "hover:bg-berget-button-default-hover", "active:bg-berget-button-default-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-berget-button-default-disabled-bg");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Map custom variants to the closest upstream primitive variant. */
|
|
42
|
+
function primitiveVariant(variant) {
|
|
43
|
+
switch (variant) {
|
|
44
|
+
case "primary":
|
|
45
|
+
case "destructive":
|
|
46
|
+
case "outline":
|
|
47
|
+
case "ghost": return "ghost";
|
|
48
|
+
default: return variant;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function Button({ className, variant = "default", size, asChild = false, width = "default", type = "button", ref, children, ...props }) {
|
|
52
|
+
const isIcon = typeof size === "string" && size.startsWith("icon");
|
|
53
|
+
const isLink = variant === "link";
|
|
54
|
+
const baseClass = require_utils.cn(!isLink && require_button.buttonVariants({
|
|
55
|
+
variant: primitiveVariant(variant),
|
|
56
|
+
size
|
|
57
|
+
}), !isLink && (width === "full" ? "rounded-berget-xs" : "rounded-full"), !isLink && !isIcon && "py-[0.57em] px-[1.14em] h-auto", !isLink && !isIcon && (size === "lg" ? "text-lg" : size === "sm" ? "text-sm" : size === "xs" ? "" : "text-base"), !isLink && "font-normal", brandVariantClasses(variant), interactionClasses, !isLink && width === "full" && "w-full", isIcon && "rounded-full shadow-[0px_1px_3px_rgba(0,0,0,0.1),0px_1px_2px_-1px_rgba(0,0,0,0.1)]", className);
|
|
58
|
+
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
59
|
+
className: require_utils.cn("inline-flex items-center", !isIcon && "gap-2"),
|
|
60
|
+
children
|
|
61
|
+
});
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
63
|
+
className: baseClass,
|
|
64
|
+
ref,
|
|
65
|
+
render: require_utils.asChildRender(asChild, children),
|
|
66
|
+
type,
|
|
67
|
+
...props,
|
|
68
|
+
children: asChild ? void 0 : content
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.Button = Button;
|
|
73
|
+
exports.buttonVariants = require_button.buttonVariants;
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=Button.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.cjs","names":["cn","buttonVariants","ButtonPrimitive","asChildRender"],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Button as ButtonPrimitive, buttonVariants } from '../../primitives/button';\nimport type { VariantProps } from 'class-variance-authority';\n\n/** Variants exposed by the Berget wrapper. */\ntype CustomVariant = 'default' | 'primary' | 'destructive' | 'outline' | 'ghost' | 'link';\n\n/** Props for the Berget Button wrapper. */\nexport interface ButtonProps extends Omit<\n React.ComponentProps<typeof ButtonPrimitive>,\n 'variant' | 'ref'\n> {\n /** Visual style variant. `primary` is Berget-specific. */\n variant?: CustomVariant;\n /** Full width or auto width. */\n width?: 'default' | 'full';\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * Shared interaction chrome for every variant.\n *\n * The primitive already provides hover/focus/disabled plumbing via shadcn\n * tokens (`--primary`, `--muted`, `--ring`, …), which the shadcn bridge in\n * `styles/index.css` maps to brand values. These classes neutralise the bits\n * that don't fit the Berget system and apply the component-scoped\n * `--berget-button-*` state tokens:\n *\n * - Focus: always visible on keyboard focus (`focus-visible`), drawn as a\n * real CSS **outline** (2px, offset 2px) in `--berget-button-focus-ring`\n * (moss-300 dark / moss-600 light, ≥3:1 against the surface per\n * WCAG 2.4.7) — not a ring/box-shadow hugging the edge, and the control's\n * own border keeps its resting colour.\n * - Disabled: replaces the primitive's flat `opacity-50` fade with explicit\n * muted tokens so every variant stays legible (≥3:1, and disabled UI is\n * exempt from AA text contrast per WCAG 1.4.3).\n *\n * `dark:` is intentionally absent — it tracks `prefers-color-scheme`, not the\n * Berget theme. Theme switching is driven entirely by the semantic tokens.\n */\nconst interactionClasses = cn(\n // Outline-based focus indicator; neutralise the primitive's ring (the\n // ring colour class is left — harmless at width 0).\n 'focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:ring-0',\n // Neutralise the primitive's disabled fade; variants apply their own tokens.\n 'disabled:pointer-events-none disabled:opacity-100 disabled:cursor-not-allowed',\n // No press movement: same compound selector as the primitive base's 1px\n // active translate so tailwind-merge strips it down to 0.\n 'active:not-aria-[haspopup]:translate-y-0',\n);\n\n/** Disabled treatment shared by every variant. */\nconst disabledClasses = 'disabled:text-berget-button-disabled-fg disabled:shadow-none';\n\n/** Brand-specific classes applied *on top* of the upstream primitive. */\nfunction brandVariantClasses(variant?: CustomVariant): string {\n switch (variant) {\n case 'primary':\n return cn(\n // Flat tinted-glass fill; the alpha carries the state, so no shadow lift.\n 'bg-berget-button-primary-bg text-berget-button-primary-fg',\n 'hover:bg-berget-button-primary-hover',\n // Pin the foreground on hover — the underlying primitive ghost adds\n // hover:text-foreground, which would override the primary fg token.\n 'hover:text-berget-button-primary-fg',\n 'active:bg-berget-button-primary-active',\n // Keep the resting (transparent) border on focus — the outline is the indicator.\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-berget-button-primary-disabled-bg',\n );\n case 'destructive':\n return cn(\n 'bg-berget-button-destructive-bg text-berget-button-destructive-fg',\n 'hover:bg-berget-button-destructive-hover',\n // Pin the foreground on hover — the underlying primitive ghost adds\n // hover:text-foreground, which would override the destructive fg token.\n 'hover:text-berget-button-destructive-hover-fg',\n 'active:bg-berget-button-destructive-active',\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-berget-button-destructive-disabled-bg',\n );\n case 'outline':\n return cn(\n // Transparent fill with a theme-foreground-derived border (25% of the\n // foreground). The state treatment is static: hover, press and\n // keyboard focus render identically to rest — only the shared focus\n // outline and the disabled treatment deviate.\n 'bg-transparent border-berget-button-outline-border text-berget-button-outline-fg',\n // Hover: slight brightening (hover bg token); the border and\n // foreground stay at rest. The dark:hover twin also neutralises\n // the primitive ghost's dark:hover:bg-muted/50. Pressed drops the\n // fill back to transparent (a pressed element is still hovered, so\n // an explicit active override is needed in both colour schemes).\n 'hover:bg-berget-button-outline-hover dark:hover:bg-berget-button-outline-hover',\n 'active:bg-transparent dark:active:bg-transparent',\n // Keep the resting border on focus — the shared outline is the indicator.\n 'focus-visible:border-berget-button-outline-border',\n disabledClasses,\n 'disabled:bg-transparent disabled:border-berget-button-disabled-border',\n );\n case 'ghost':\n // Transparent fill with foreground text; hover and press add subtle\n // theme-foreground-derived fills (10% / 5%). No border of its own —\n // the primitive's resting transparent border persists. The primitive\n // ghost variant's aria-expanded state (bg-muted + foreground text)\n // passes through for dropdown-trigger use.\n return cn(\n 'bg-transparent text-berget-button-ghost-fg',\n // Pin the foreground on hover — the underlying primitive ghost adds\n // hover:text-foreground, which is the same value here but pinned\n // explicitly for parity with the other fg-token variants.\n 'hover:bg-berget-button-ghost-hover hover:text-berget-button-ghost-fg',\n // The dark:hover twin neutralises the primitive ghost's\n // dark:hover:bg-muted/50 so only the token fill applies.\n 'dark:hover:bg-berget-button-ghost-hover',\n 'active:bg-berget-button-ghost-active dark:active:bg-berget-button-ghost-active',\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-transparent',\n );\n case 'link':\n // Rendered without buttonVariants — needs its own sizing, focus ring and\n // disabled treatment (the primitive's fade is not legible on text links).\n return cn(\n 'h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none',\n 'hover:bg-transparent hover:text-berget-button-link-hover-fg',\n // On press, return to the resting foreground (hover fg otherwise sticks).\n 'active:text-berget-button-link-fg',\n 'focus:bg-transparent',\n // Neutralise the primitive base's focus-visible:border-ring + ring-3,\n // which land on link too (the primitive merges its cva base under\n // every variant): the outline above is the only focus indicator.\n 'focus-visible:border-transparent focus-visible:ring-0',\n 'focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:rounded-berget-xs',\n 'disabled:text-berget-button-disabled-fg disabled:no-underline',\n 'disabled:opacity-100 disabled:cursor-not-allowed',\n );\n\n case 'default':\n default:\n return cn(\n // Solid granite-800 fill with a granite-700 border on dark surfaces\n // (ink glass in light theme).\n 'bg-berget-button-default-bg border-berget-button-default-border text-berget-button-default-fg',\n 'hover:bg-berget-button-default-hover',\n 'active:bg-berget-button-default-active',\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-berget-button-default-disabled-bg',\n );\n }\n}\n\n/** Map custom variants to the closest upstream primitive variant. */\nfunction primitiveVariant(variant?: CustomVariant): VariantProps<typeof buttonVariants>['variant'] {\n switch (variant) {\n case 'primary':\n case 'destructive':\n case 'outline':\n case 'ghost':\n return 'ghost';\n default:\n return variant;\n }\n}\n\nexport function Button({\n className,\n variant = 'default',\n size,\n asChild = false,\n width = 'default',\n type = 'button',\n ref,\n children,\n ...props\n}: ButtonProps) {\n const isIcon = typeof size === 'string' && size.startsWith('icon');\n const isLink = variant === 'link';\n\n const baseClass = cn(\n !isLink && buttonVariants({ variant: primitiveVariant(variant), size }),\n // Berget brand overrides — full-width buttons use the square radius;\n // everything else stays pill-shaped.\n !isLink && (width === 'full' ? 'rounded-berget-xs' : 'rounded-full'),\n // Em-based padding, inline = 2× block — matches the 8px/16px spacing-scale\n // values at the default text-sm (14px) and scales down/up with smaller or\n // larger button text. h-auto drops the primitive's fixed h-* so the\n // vertical paddings take effect.\n !isLink && !isIcon && 'py-[0.57em] px-[1.14em] h-auto',\n // Text ladder: size = typography scale; the em-based padding above\n // follows automatically, so no per-size paddings are needed. Only\n // default/lg/sm need overrides — xs keeps the primitive's text-xs.\n !isLink &&\n !isIcon &&\n (size === 'lg' ? 'text-lg' : size === 'sm' ? 'text-sm' : size === 'xs' ? '' : 'text-base'),\n // Normal weight for every non-link variant — tailwind-merge strips the\n // primitive's font-medium (font-weight: var(--font-weight-medium)); the\n // link variant keeps medium via its own classes above.\n !isLink && 'font-normal',\n brandVariantClasses(variant),\n interactionClasses,\n !isLink && width === 'full' && 'w-full',\n isIcon && 'rounded-full shadow-[0px_1px_3px_rgba(0,0,0,0.1),0px_1px_2px_-1px_rgba(0,0,0,0.1)]',\n className,\n );\n\n const content = (\n <span className={cn('inline-flex items-center', !isIcon && 'gap-2')}>{children}</span>\n );\n\n return (\n <ButtonPrimitive\n className={baseClass}\n ref={ref}\n render={asChildRender(asChild, children)}\n type={type}\n {...props}\n >\n {asChild ? undefined : content}\n </ButtonPrimitive>\n );\n}\n\nexport { buttonVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,qBAAqBA,cAAAA,GAGzB,0JAEA,iFAGA,0CACF;;AAGA,MAAM,kBAAkB;;AAGxB,SAAS,oBAAoB,SAAiC;CAC5D,QAAQ,SAAR;EACE,KAAK,WACH,OAAOA,cAAAA,GAEL,6DACA,wCAGA,uCACA,0CAEA,oCACA,iBACA,+CACF;EACF,KAAK,eACH,OAAOA,cAAAA,GACL,qEACA,4CAGA,iDACA,8CACA,oCACA,iBACA,mDACF;EACF,KAAK,WACH,OAAOA,cAAAA,GAKL,oFAMA,kFACA,oDAEA,qDACA,iBACA,uEACF;EACF,KAAK,SAMH,OAAOA,cAAAA,GACL,8CAIA,wEAGA,2CACA,kFACA,oCACA,iBACA,yBACF;EACF,KAAK,QAGH,OAAOA,cAAAA,GACL,mGACA,+DAEA,qCACA,wBAIA,yDACA,qKACA,iEACA,kDACF;EAGF,SACE,OAAOA,cAAAA,GAGL,iGACA,wCACA,0CACA,oCACA,iBACA,+CACF;CACJ;AACF;;AAGA,SAAS,iBAAiB,SAAyE;CACjG,QAAQ,SAAR;EACE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,SACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,SAAgB,OAAO,EACrB,WACA,UAAU,WACV,MACA,UAAU,OACV,QAAQ,WACR,OAAO,UACP,KACA,UACA,GAAG,SACW;CACd,MAAM,SAAS,OAAO,SAAS,YAAY,KAAK,WAAW,MAAM;CACjE,MAAM,SAAS,YAAY;CAE3B,MAAM,YAAYA,cAAAA,GAChB,CAAC,UAAUC,eAAAA,eAAe;EAAE,SAAS,iBAAiB,OAAO;EAAG;CAAK,CAAC,GAGtE,CAAC,WAAW,UAAU,SAAS,sBAAsB,iBAKrD,CAAC,UAAU,CAAC,UAAU,kCAItB,CAAC,UACC,CAAC,WACA,SAAS,OAAO,YAAY,SAAS,OAAO,YAAY,SAAS,OAAO,KAAK,cAIhF,CAAC,UAAU,eACX,oBAAoB,OAAO,GAC3B,oBACA,CAAC,UAAU,UAAU,UAAU,UAC/B,UAAU,sFACV,SACF;CAEA,MAAM,UACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAWD,cAAAA,GAAG,4BAA4B,CAAC,UAAU,OAAO;EAAI;CAAe,CAAA;CAGvF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,eAAAA,QAAD;EACE,WAAW;EACN;EACL,QAAQC,cAAAA,cAAc,SAAS,QAAQ;EACjC;EACN,GAAI;EAEH,UAAA,UAAU,KAAA,IAAY;CACR,CAAA;AAErB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Button as Button$1, buttonVariants } from "../../primitives/button.cjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/components/button/Button.d.ts
|
|
4
|
+
/** Variants exposed by the Berget wrapper. */
|
|
5
|
+
type CustomVariant = 'default' | 'primary' | 'destructive' | 'outline' | 'ghost' | 'link';
|
|
6
|
+
/** Props for the Berget Button wrapper. */
|
|
7
|
+
export interface ButtonProps extends Omit<React.ComponentProps<typeof Button$1>, 'variant' | 'ref'> {
|
|
8
|
+
/** Visual style variant. `primary` is Berget-specific. */
|
|
9
|
+
variant?: CustomVariant;
|
|
10
|
+
/** Full width or auto width. */
|
|
11
|
+
width?: 'default' | 'full';
|
|
12
|
+
/** Render as a different element/component. Replaces the Radix `asChild` prop. */
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
15
|
+
}
|
|
16
|
+
export declare function Button({ className, variant, size, asChild, width, type, ref, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { buttonVariants };
|
|
19
|
+
//# sourceMappingURL=Button.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.cts","names":["ButtonPrimitive"],"sources":["../../../src/components/button/Button.tsx"],"mappings":";;;;KAQK;;iBAGY,oBAAoB,KACnC,MAAM,sBAAsBA;;EAI5B,UAAU;;EAEV;;EAEA;EACA,MAAM,MAAM,IAAI;;wBAwJF,SACd,WACA,SACA,MACA,SACA,OACA,MACA,KACA,aACG,SACF,0CAAW,IAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Button as Button$1, buttonVariants } from "../../primitives/button.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/components/button/Button.d.ts
|
|
4
|
+
/** Variants exposed by the Berget wrapper. */
|
|
5
|
+
type CustomVariant = 'default' | 'primary' | 'destructive' | 'outline' | 'ghost' | 'link';
|
|
6
|
+
/** Props for the Berget Button wrapper. */
|
|
7
|
+
export interface ButtonProps extends Omit<React.ComponentProps<typeof Button$1>, 'variant' | 'ref'> {
|
|
8
|
+
/** Visual style variant. `primary` is Berget-specific. */
|
|
9
|
+
variant?: CustomVariant;
|
|
10
|
+
/** Full width or auto width. */
|
|
11
|
+
width?: 'default' | 'full';
|
|
12
|
+
/** Render as a different element/component. Replaces the Radix `asChild` prop. */
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
15
|
+
}
|
|
16
|
+
export declare function Button({ className, variant, size, asChild, width, type, ref, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { buttonVariants };
|
|
19
|
+
//# sourceMappingURL=Button.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.mts","names":["ButtonPrimitive"],"sources":["../../../src/components/button/Button.tsx"],"mappings":";;;;KAQK;;iBAGY,oBAAoB,KACnC,MAAM,sBAAsBA;;EAI5B,UAAU;;EAEV;;EAEA;EACA,MAAM,MAAM,IAAI;;wBAwJF,SACd,WACA,SACA,MACA,SACA,OACA,MACA,KACA,aACG,SACF,0CAAW,IAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { asChildRender, cn } from "../../lib/utils.mjs";
|
|
3
|
+
import { Button as Button$1, buttonVariants } from "../../primitives/button.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/button/Button.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Shared interaction chrome for every variant.
|
|
8
|
+
*
|
|
9
|
+
* The primitive already provides hover/focus/disabled plumbing via shadcn
|
|
10
|
+
* tokens (`--primary`, `--muted`, `--ring`, …), which the shadcn bridge in
|
|
11
|
+
* `styles/index.css` maps to brand values. These classes neutralise the bits
|
|
12
|
+
* that don't fit the Berget system and apply the component-scoped
|
|
13
|
+
* `--berget-button-*` state tokens:
|
|
14
|
+
*
|
|
15
|
+
* - Focus: always visible on keyboard focus (`focus-visible`), drawn as a
|
|
16
|
+
* real CSS **outline** (2px, offset 2px) in `--berget-button-focus-ring`
|
|
17
|
+
* (moss-300 dark / moss-600 light, ≥3:1 against the surface per
|
|
18
|
+
* WCAG 2.4.7) — not a ring/box-shadow hugging the edge, and the control's
|
|
19
|
+
* own border keeps its resting colour.
|
|
20
|
+
* - Disabled: replaces the primitive's flat `opacity-50` fade with explicit
|
|
21
|
+
* muted tokens so every variant stays legible (≥3:1, and disabled UI is
|
|
22
|
+
* exempt from AA text contrast per WCAG 1.4.3).
|
|
23
|
+
*
|
|
24
|
+
* `dark:` is intentionally absent — it tracks `prefers-color-scheme`, not the
|
|
25
|
+
* Berget theme. Theme switching is driven entirely by the semantic tokens.
|
|
26
|
+
*/
|
|
27
|
+
const interactionClasses = cn("focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:ring-0", "disabled:pointer-events-none disabled:opacity-100 disabled:cursor-not-allowed", "active:not-aria-[haspopup]:translate-y-0");
|
|
28
|
+
/** Disabled treatment shared by every variant. */
|
|
29
|
+
const disabledClasses = "disabled:text-berget-button-disabled-fg disabled:shadow-none";
|
|
30
|
+
/** Brand-specific classes applied *on top* of the upstream primitive. */
|
|
31
|
+
function brandVariantClasses(variant) {
|
|
32
|
+
switch (variant) {
|
|
33
|
+
case "primary": return cn("bg-berget-button-primary-bg text-berget-button-primary-fg", "hover:bg-berget-button-primary-hover", "hover:text-berget-button-primary-fg", "active:bg-berget-button-primary-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-berget-button-primary-disabled-bg");
|
|
34
|
+
case "destructive": return cn("bg-berget-button-destructive-bg text-berget-button-destructive-fg", "hover:bg-berget-button-destructive-hover", "hover:text-berget-button-destructive-hover-fg", "active:bg-berget-button-destructive-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-berget-button-destructive-disabled-bg");
|
|
35
|
+
case "outline": return cn("bg-transparent border-berget-button-outline-border text-berget-button-outline-fg", "hover:bg-berget-button-outline-hover dark:hover:bg-berget-button-outline-hover", "active:bg-transparent dark:active:bg-transparent", "focus-visible:border-berget-button-outline-border", disabledClasses, "disabled:bg-transparent disabled:border-berget-button-disabled-border");
|
|
36
|
+
case "ghost": return cn("bg-transparent text-berget-button-ghost-fg", "hover:bg-berget-button-ghost-hover hover:text-berget-button-ghost-fg", "dark:hover:bg-berget-button-ghost-hover", "active:bg-berget-button-ghost-active dark:active:bg-berget-button-ghost-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-transparent");
|
|
37
|
+
case "link": return cn("h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none", "hover:bg-transparent hover:text-berget-button-link-hover-fg", "active:text-berget-button-link-fg", "focus:bg-transparent", "focus-visible:border-transparent focus-visible:ring-0", "focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:rounded-berget-xs", "disabled:text-berget-button-disabled-fg disabled:no-underline", "disabled:opacity-100 disabled:cursor-not-allowed");
|
|
38
|
+
default: return cn("bg-berget-button-default-bg border-berget-button-default-border text-berget-button-default-fg", "hover:bg-berget-button-default-hover", "active:bg-berget-button-default-active", "focus-visible:border-transparent", disabledClasses, "disabled:bg-berget-button-default-disabled-bg");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Map custom variants to the closest upstream primitive variant. */
|
|
42
|
+
function primitiveVariant(variant) {
|
|
43
|
+
switch (variant) {
|
|
44
|
+
case "primary":
|
|
45
|
+
case "destructive":
|
|
46
|
+
case "outline":
|
|
47
|
+
case "ghost": return "ghost";
|
|
48
|
+
default: return variant;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function Button({ className, variant = "default", size, asChild = false, width = "default", type = "button", ref, children, ...props }) {
|
|
52
|
+
const isIcon = typeof size === "string" && size.startsWith("icon");
|
|
53
|
+
const isLink = variant === "link";
|
|
54
|
+
const baseClass = cn(!isLink && buttonVariants({
|
|
55
|
+
variant: primitiveVariant(variant),
|
|
56
|
+
size
|
|
57
|
+
}), !isLink && (width === "full" ? "rounded-berget-xs" : "rounded-full"), !isLink && !isIcon && "py-[0.57em] px-[1.14em] h-auto", !isLink && !isIcon && (size === "lg" ? "text-lg" : size === "sm" ? "text-sm" : size === "xs" ? "" : "text-base"), !isLink && "font-normal", brandVariantClasses(variant), interactionClasses, !isLink && width === "full" && "w-full", isIcon && "rounded-full shadow-[0px_1px_3px_rgba(0,0,0,0.1),0px_1px_2px_-1px_rgba(0,0,0,0.1)]", className);
|
|
58
|
+
const content = /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: cn("inline-flex items-center", !isIcon && "gap-2"),
|
|
60
|
+
children
|
|
61
|
+
});
|
|
62
|
+
return /* @__PURE__ */ jsx(Button$1, {
|
|
63
|
+
className: baseClass,
|
|
64
|
+
ref,
|
|
65
|
+
render: asChildRender(asChild, children),
|
|
66
|
+
type,
|
|
67
|
+
...props,
|
|
68
|
+
children: asChild ? void 0 : content
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Button, buttonVariants };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=Button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":["ButtonPrimitive"],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Button as ButtonPrimitive, buttonVariants } from '../../primitives/button';\nimport type { VariantProps } from 'class-variance-authority';\n\n/** Variants exposed by the Berget wrapper. */\ntype CustomVariant = 'default' | 'primary' | 'destructive' | 'outline' | 'ghost' | 'link';\n\n/** Props for the Berget Button wrapper. */\nexport interface ButtonProps extends Omit<\n React.ComponentProps<typeof ButtonPrimitive>,\n 'variant' | 'ref'\n> {\n /** Visual style variant. `primary` is Berget-specific. */\n variant?: CustomVariant;\n /** Full width or auto width. */\n width?: 'default' | 'full';\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * Shared interaction chrome for every variant.\n *\n * The primitive already provides hover/focus/disabled plumbing via shadcn\n * tokens (`--primary`, `--muted`, `--ring`, …), which the shadcn bridge in\n * `styles/index.css` maps to brand values. These classes neutralise the bits\n * that don't fit the Berget system and apply the component-scoped\n * `--berget-button-*` state tokens:\n *\n * - Focus: always visible on keyboard focus (`focus-visible`), drawn as a\n * real CSS **outline** (2px, offset 2px) in `--berget-button-focus-ring`\n * (moss-300 dark / moss-600 light, ≥3:1 against the surface per\n * WCAG 2.4.7) — not a ring/box-shadow hugging the edge, and the control's\n * own border keeps its resting colour.\n * - Disabled: replaces the primitive's flat `opacity-50` fade with explicit\n * muted tokens so every variant stays legible (≥3:1, and disabled UI is\n * exempt from AA text contrast per WCAG 1.4.3).\n *\n * `dark:` is intentionally absent — it tracks `prefers-color-scheme`, not the\n * Berget theme. Theme switching is driven entirely by the semantic tokens.\n */\nconst interactionClasses = cn(\n // Outline-based focus indicator; neutralise the primitive's ring (the\n // ring colour class is left — harmless at width 0).\n 'focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:ring-0',\n // Neutralise the primitive's disabled fade; variants apply their own tokens.\n 'disabled:pointer-events-none disabled:opacity-100 disabled:cursor-not-allowed',\n // No press movement: same compound selector as the primitive base's 1px\n // active translate so tailwind-merge strips it down to 0.\n 'active:not-aria-[haspopup]:translate-y-0',\n);\n\n/** Disabled treatment shared by every variant. */\nconst disabledClasses = 'disabled:text-berget-button-disabled-fg disabled:shadow-none';\n\n/** Brand-specific classes applied *on top* of the upstream primitive. */\nfunction brandVariantClasses(variant?: CustomVariant): string {\n switch (variant) {\n case 'primary':\n return cn(\n // Flat tinted-glass fill; the alpha carries the state, so no shadow lift.\n 'bg-berget-button-primary-bg text-berget-button-primary-fg',\n 'hover:bg-berget-button-primary-hover',\n // Pin the foreground on hover — the underlying primitive ghost adds\n // hover:text-foreground, which would override the primary fg token.\n 'hover:text-berget-button-primary-fg',\n 'active:bg-berget-button-primary-active',\n // Keep the resting (transparent) border on focus — the outline is the indicator.\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-berget-button-primary-disabled-bg',\n );\n case 'destructive':\n return cn(\n 'bg-berget-button-destructive-bg text-berget-button-destructive-fg',\n 'hover:bg-berget-button-destructive-hover',\n // Pin the foreground on hover — the underlying primitive ghost adds\n // hover:text-foreground, which would override the destructive fg token.\n 'hover:text-berget-button-destructive-hover-fg',\n 'active:bg-berget-button-destructive-active',\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-berget-button-destructive-disabled-bg',\n );\n case 'outline':\n return cn(\n // Transparent fill with a theme-foreground-derived border (25% of the\n // foreground). The state treatment is static: hover, press and\n // keyboard focus render identically to rest — only the shared focus\n // outline and the disabled treatment deviate.\n 'bg-transparent border-berget-button-outline-border text-berget-button-outline-fg',\n // Hover: slight brightening (hover bg token); the border and\n // foreground stay at rest. The dark:hover twin also neutralises\n // the primitive ghost's dark:hover:bg-muted/50. Pressed drops the\n // fill back to transparent (a pressed element is still hovered, so\n // an explicit active override is needed in both colour schemes).\n 'hover:bg-berget-button-outline-hover dark:hover:bg-berget-button-outline-hover',\n 'active:bg-transparent dark:active:bg-transparent',\n // Keep the resting border on focus — the shared outline is the indicator.\n 'focus-visible:border-berget-button-outline-border',\n disabledClasses,\n 'disabled:bg-transparent disabled:border-berget-button-disabled-border',\n );\n case 'ghost':\n // Transparent fill with foreground text; hover and press add subtle\n // theme-foreground-derived fills (10% / 5%). No border of its own —\n // the primitive's resting transparent border persists. The primitive\n // ghost variant's aria-expanded state (bg-muted + foreground text)\n // passes through for dropdown-trigger use.\n return cn(\n 'bg-transparent text-berget-button-ghost-fg',\n // Pin the foreground on hover — the underlying primitive ghost adds\n // hover:text-foreground, which is the same value here but pinned\n // explicitly for parity with the other fg-token variants.\n 'hover:bg-berget-button-ghost-hover hover:text-berget-button-ghost-fg',\n // The dark:hover twin neutralises the primitive ghost's\n // dark:hover:bg-muted/50 so only the token fill applies.\n 'dark:hover:bg-berget-button-ghost-hover',\n 'active:bg-berget-button-ghost-active dark:active:bg-berget-button-ghost-active',\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-transparent',\n );\n case 'link':\n // Rendered without buttonVariants — needs its own sizing, focus ring and\n // disabled treatment (the primitive's fade is not legible on text links).\n return cn(\n 'h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none',\n 'hover:bg-transparent hover:text-berget-button-link-hover-fg',\n // On press, return to the resting foreground (hover fg otherwise sticks).\n 'active:text-berget-button-link-fg',\n 'focus:bg-transparent',\n // Neutralise the primitive base's focus-visible:border-ring + ring-3,\n // which land on link too (the primitive merges its cva base under\n // every variant): the outline above is the only focus indicator.\n 'focus-visible:border-transparent focus-visible:ring-0',\n 'focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-berget-button-focus-ring focus-visible:rounded-berget-xs',\n 'disabled:text-berget-button-disabled-fg disabled:no-underline',\n 'disabled:opacity-100 disabled:cursor-not-allowed',\n );\n\n case 'default':\n default:\n return cn(\n // Solid granite-800 fill with a granite-700 border on dark surfaces\n // (ink glass in light theme).\n 'bg-berget-button-default-bg border-berget-button-default-border text-berget-button-default-fg',\n 'hover:bg-berget-button-default-hover',\n 'active:bg-berget-button-default-active',\n 'focus-visible:border-transparent',\n disabledClasses,\n 'disabled:bg-berget-button-default-disabled-bg',\n );\n }\n}\n\n/** Map custom variants to the closest upstream primitive variant. */\nfunction primitiveVariant(variant?: CustomVariant): VariantProps<typeof buttonVariants>['variant'] {\n switch (variant) {\n case 'primary':\n case 'destructive':\n case 'outline':\n case 'ghost':\n return 'ghost';\n default:\n return variant;\n }\n}\n\nexport function Button({\n className,\n variant = 'default',\n size,\n asChild = false,\n width = 'default',\n type = 'button',\n ref,\n children,\n ...props\n}: ButtonProps) {\n const isIcon = typeof size === 'string' && size.startsWith('icon');\n const isLink = variant === 'link';\n\n const baseClass = cn(\n !isLink && buttonVariants({ variant: primitiveVariant(variant), size }),\n // Berget brand overrides — full-width buttons use the square radius;\n // everything else stays pill-shaped.\n !isLink && (width === 'full' ? 'rounded-berget-xs' : 'rounded-full'),\n // Em-based padding, inline = 2× block — matches the 8px/16px spacing-scale\n // values at the default text-sm (14px) and scales down/up with smaller or\n // larger button text. h-auto drops the primitive's fixed h-* so the\n // vertical paddings take effect.\n !isLink && !isIcon && 'py-[0.57em] px-[1.14em] h-auto',\n // Text ladder: size = typography scale; the em-based padding above\n // follows automatically, so no per-size paddings are needed. Only\n // default/lg/sm need overrides — xs keeps the primitive's text-xs.\n !isLink &&\n !isIcon &&\n (size === 'lg' ? 'text-lg' : size === 'sm' ? 'text-sm' : size === 'xs' ? '' : 'text-base'),\n // Normal weight for every non-link variant — tailwind-merge strips the\n // primitive's font-medium (font-weight: var(--font-weight-medium)); the\n // link variant keeps medium via its own classes above.\n !isLink && 'font-normal',\n brandVariantClasses(variant),\n interactionClasses,\n !isLink && width === 'full' && 'w-full',\n isIcon && 'rounded-full shadow-[0px_1px_3px_rgba(0,0,0,0.1),0px_1px_2px_-1px_rgba(0,0,0,0.1)]',\n className,\n );\n\n const content = (\n <span className={cn('inline-flex items-center', !isIcon && 'gap-2')}>{children}</span>\n );\n\n return (\n <ButtonPrimitive\n className={baseClass}\n ref={ref}\n render={asChildRender(asChild, children)}\n type={type}\n {...props}\n >\n {asChild ? undefined : content}\n </ButtonPrimitive>\n );\n}\n\nexport { buttonVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,qBAAqB,GAGzB,0JAEA,iFAGA,0CACF;;AAGA,MAAM,kBAAkB;;AAGxB,SAAS,oBAAoB,SAAiC;CAC5D,QAAQ,SAAR;EACE,KAAK,WACH,OAAO,GAEL,6DACA,wCAGA,uCACA,0CAEA,oCACA,iBACA,+CACF;EACF,KAAK,eACH,OAAO,GACL,qEACA,4CAGA,iDACA,8CACA,oCACA,iBACA,mDACF;EACF,KAAK,WACH,OAAO,GAKL,oFAMA,kFACA,oDAEA,qDACA,iBACA,uEACF;EACF,KAAK,SAMH,OAAO,GACL,8CAIA,wEAGA,2CACA,kFACA,oCACA,iBACA,yBACF;EACF,KAAK,QAGH,OAAO,GACL,mGACA,+DAEA,qCACA,wBAIA,yDACA,qKACA,iEACA,kDACF;EAGF,SACE,OAAO,GAGL,iGACA,wCACA,0CACA,oCACA,iBACA,+CACF;CACJ;AACF;;AAGA,SAAS,iBAAiB,SAAyE;CACjG,QAAQ,SAAR;EACE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,SACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,SAAgB,OAAO,EACrB,WACA,UAAU,WACV,MACA,UAAU,OACV,QAAQ,WACR,OAAO,UACP,KACA,UACA,GAAG,SACW;CACd,MAAM,SAAS,OAAO,SAAS,YAAY,KAAK,WAAW,MAAM;CACjE,MAAM,SAAS,YAAY;CAE3B,MAAM,YAAY,GAChB,CAAC,UAAU,eAAe;EAAE,SAAS,iBAAiB,OAAO;EAAG;CAAK,CAAC,GAGtE,CAAC,WAAW,UAAU,SAAS,sBAAsB,iBAKrD,CAAC,UAAU,CAAC,UAAU,kCAItB,CAAC,UACC,CAAC,WACA,SAAS,OAAO,YAAY,SAAS,OAAO,YAAY,SAAS,OAAO,KAAK,cAIhF,CAAC,UAAU,eACX,oBAAoB,OAAO,GAC3B,oBACA,CAAC,UAAU,UAAU,UAAU,UAC/B,UAAU,sFACV,SACF;CAEA,MAAM,UACJ,oBAAC,QAAD;EAAM,WAAW,GAAG,4BAA4B,CAAC,UAAU,OAAO;EAAI;CAAe,CAAA;CAGvF,OACE,oBAACA,UAAD;EACE,WAAW;EACN;EACL,QAAQ,cAAc,SAAS,QAAQ;EACjC;EACN,GAAI;EAEH,UAAA,UAAU,KAAA,IAAY;CACR,CAAA;AAErB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
4
|
+
const require_card = require("../../primitives/card.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_runtime.__toESM(react, 1);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region src/components/card/Card.tsx
|
|
9
|
+
const cardVariants = (0, require("class-variance-authority").cva)("ring-0", {
|
|
10
|
+
variants: { variant: {
|
|
11
|
+
outlined: "bg-transparent border border-berget-border-subtle",
|
|
12
|
+
filled: "bg-berget-card-filled-bg border border-berget-border-subtle"
|
|
13
|
+
} },
|
|
14
|
+
defaultVariants: { variant: "outlined" }
|
|
15
|
+
});
|
|
16
|
+
const Card = react.forwardRef(({ className, variant, size, children, ...props }, ref) => {
|
|
17
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_card.Card, {
|
|
18
|
+
ref,
|
|
19
|
+
size,
|
|
20
|
+
className: require_utils.cn(cardVariants({ variant }), className),
|
|
21
|
+
...props,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
Card.displayName = "Card";
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.Card = Card;
|
|
28
|
+
exports.CardAction = require_card.CardAction;
|
|
29
|
+
exports.CardContent = require_card.CardContent;
|
|
30
|
+
exports.CardDescription = require_card.CardDescription;
|
|
31
|
+
exports.CardFooter = require_card.CardFooter;
|
|
32
|
+
exports.CardHeader = require_card.CardHeader;
|
|
33
|
+
exports.CardTitle = require_card.CardTitle;
|
|
34
|
+
exports.cardVariants = cardVariants;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=Card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.cjs","names":["cva","React","CardPrimitive","cn"],"sources":["../../../src/components/card/Card.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport {\n Card as CardPrimitive,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n CardAction,\n} from '../../primitives/card';\n\nconst cardVariants = cva('ring-0', {\n variants: {\n variant: {\n outlined: 'bg-transparent border border-berget-border-subtle',\n filled: 'bg-berget-card-filled-bg border border-berget-border-subtle',\n },\n },\n defaultVariants: {\n variant: 'outlined',\n },\n});\n\nexport interface CardProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {\n /** Spacing scale of the card. `sm` uses a compact 16px spacing, `default` 24px. */\n size?: 'default' | 'sm';\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, variant, size, children, ...props }, ref) => {\n return (\n <CardPrimitive\n ref={ref}\n size={size}\n className={cn(cardVariants({ variant }), className)}\n {...props}\n >\n {children}\n </CardPrimitive>\n );\n },\n);\nCard.displayName = 'Card';\n\nexport {\n Card,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n CardAction,\n cardVariants,\n};\n"],"mappings":";;;;;;;;AAeA,MAAM,gBAAA,G,kCAAeA,CAAAA,CAAAA,IAAAA,CAAI,UAAU;CACjC,UAAU,EACR,SAAS;EACP,UAAU;EACV,QAAQ;CACV,EACF;CACA,iBAAiB,EACf,SAAS,WACX;AACF,CAAC;AAQD,MAAM,OAAOC,MAAM,YAChB,EAAE,WAAW,SAAS,MAAM,UAAU,GAAG,SAAS,QAAQ;CACzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD;EACO;EACC;EACN,WAAWC,cAAAA,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;EAClD,GAAI;EAEH;CACY,CAAA;AAEnB,CACF;AACA,KAAK,cAAc"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../primitives/card.cjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/card/Card.d.ts
|
|
5
|
+
declare const cardVariants: (props?: ({
|
|
6
|
+
variant?: "outlined" | "filled" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
9
|
+
/** Spacing scale of the card. `sm` uses a compact 16px spacing, `default` 24px. */
|
|
10
|
+
size?: 'default' | 'sm';
|
|
11
|
+
}
|
|
12
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants };
|
|
15
|
+
//# sourceMappingURL=Card.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.cts","names":[],"sources":["../../../src/components/card/Card.tsx"],"mappings":";;;;cAeM,eAAY;;6CAUhB;iBAEe,kBACP,MAAM,eAAe,iBAAiB,oBAAoB;;EAElE;;cAGI,MAAI,MAAA,0BAAA,YAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../primitives/card.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/card/Card.d.ts
|
|
5
|
+
declare const cardVariants: (props?: ({
|
|
6
|
+
variant?: "outlined" | "filled" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
9
|
+
/** Spacing scale of the card. `sm` uses a compact 16px spacing, `default` 24px. */
|
|
10
|
+
size?: 'default' | 'sm';
|
|
11
|
+
}
|
|
12
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants };
|
|
15
|
+
//# sourceMappingURL=Card.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.mts","names":[],"sources":["../../../src/components/card/Card.tsx"],"mappings":";;;;cAeM,eAAY;;6CAUhB;iBAEe,kBACP,MAAM,eAAe,iBAAiB,oBAAoB;;EAElE;;cAGI,MAAI,MAAA,0BAAA,YAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.mjs";
|
|
3
|
+
import { Card as Card$1, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../primitives/card.mjs";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/components/card/Card.tsx
|
|
8
|
+
const cardVariants = cva("ring-0", {
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
outlined: "bg-transparent border border-berget-border-subtle",
|
|
11
|
+
filled: "bg-berget-card-filled-bg border border-berget-border-subtle"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { variant: "outlined" }
|
|
14
|
+
});
|
|
15
|
+
const Card = React.forwardRef(({ className, variant, size, children, ...props }, ref) => {
|
|
16
|
+
return /* @__PURE__ */ jsx(Card$1, {
|
|
17
|
+
ref,
|
|
18
|
+
size,
|
|
19
|
+
className: cn(cardVariants({ variant }), className),
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
Card.displayName = "Card";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=Card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.mjs","names":["CardPrimitive"],"sources":["../../../src/components/card/Card.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport {\n Card as CardPrimitive,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n CardAction,\n} from '../../primitives/card';\n\nconst cardVariants = cva('ring-0', {\n variants: {\n variant: {\n outlined: 'bg-transparent border border-berget-border-subtle',\n filled: 'bg-berget-card-filled-bg border border-berget-border-subtle',\n },\n },\n defaultVariants: {\n variant: 'outlined',\n },\n});\n\nexport interface CardProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {\n /** Spacing scale of the card. `sm` uses a compact 16px spacing, `default` 24px. */\n size?: 'default' | 'sm';\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, variant, size, children, ...props }, ref) => {\n return (\n <CardPrimitive\n ref={ref}\n size={size}\n className={cn(cardVariants({ variant }), className)}\n {...props}\n >\n {children}\n </CardPrimitive>\n );\n },\n);\nCard.displayName = 'Card';\n\nexport {\n Card,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n CardAction,\n cardVariants,\n};\n"],"mappings":";;;;;;;AAeA,MAAM,eAAe,IAAI,UAAU;CACjC,UAAU,EACR,SAAS;EACP,UAAU;EACV,QAAQ;CACV,EACF;CACA,iBAAiB,EACf,SAAS,WACX;AACF,CAAC;AAQD,MAAM,OAAO,MAAM,YAChB,EAAE,WAAW,SAAS,MAAM,UAAU,GAAG,SAAS,QAAQ;CACzD,OACE,oBAACA,QAAD;EACO;EACC;EACN,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;EAClD,GAAI;EAEH;CACY,CAAA;AAEnB,CACF;AACA,KAAK,cAAc"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../primitives/card.cjs";
|
|
2
|
+
import { Card, CardProps, cardVariants } from "./Card.cjs";
|
|
3
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../primitives/card.mjs";
|
|
2
|
+
import { Card, CardProps, cardVariants } from "./Card.mjs";
|
|
3
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
4
|
+
const require_Typography = require("../typography/Typography.cjs");
|
|
5
|
+
const require_checkbox = require("../../primitives/checkbox.cjs");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_runtime.__toESM(react, 1);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let class_variance_authority = require("class-variance-authority");
|
|
10
|
+
let lucide_react = require("lucide-react");
|
|
11
|
+
let _base_ui_react_checkbox = require("@base-ui/react/checkbox");
|
|
12
|
+
//#region src/components/checkbox/Checkbox.tsx
|
|
13
|
+
const checkboxVariants = (0, class_variance_authority.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", {
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
default: "text-foreground border border-berget-border-interactive bg-berget-surface-subtle hover:bg-berget-surface-raised",
|
|
17
|
+
error: "border border-berget-destructive-border bg-berget-destructive text-berget-destructive-foreground hover:bg-berget-destructive/90",
|
|
18
|
+
success: "border border-berget-success-border bg-berget-success text-berget-success-foreground hover:bg-berget-success/90"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "w-4 h-4",
|
|
22
|
+
default: "w-5 h-5",
|
|
23
|
+
lg: "w-6 h-6"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const Checkbox = react.forwardRef(({ "aria-label": ariaLabel, className, variant, size, label, description, error, id, disabled, ...props }, ref) => {
|
|
32
|
+
const generatedId = react.useId();
|
|
33
|
+
const checkboxId = id || generatedId;
|
|
34
|
+
const errorId = `${checkboxId}-error`;
|
|
35
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
36
|
+
className: "flex items-start gap-3",
|
|
37
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
38
|
+
className: "relative flex items-start pt-0.5",
|
|
39
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_checkbox.Checkbox, {
|
|
40
|
+
ref,
|
|
41
|
+
id: checkboxId,
|
|
42
|
+
disabled,
|
|
43
|
+
"aria-invalid": !!error,
|
|
44
|
+
"aria-describedby": error ? errorId : void 0,
|
|
45
|
+
"aria-label": ariaLabel || label || void 0,
|
|
46
|
+
className: require_utils.cn(checkboxVariants({
|
|
47
|
+
variant,
|
|
48
|
+
size
|
|
49
|
+
}), "cursor-pointer", disabled && "cursor-not-allowed pointer-events-none", className),
|
|
50
|
+
...props,
|
|
51
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_checkbox.Checkbox.Indicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
52
|
+
className: "h-4 w-4 text-current stroke-current",
|
|
53
|
+
style: {
|
|
54
|
+
color: "currentColor",
|
|
55
|
+
stroke: "currentColor"
|
|
56
|
+
}
|
|
57
|
+
}) })
|
|
58
|
+
})
|
|
59
|
+
}), (label || description || error) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
60
|
+
className: "flex flex-col gap-1",
|
|
61
|
+
children: [
|
|
62
|
+
label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
63
|
+
htmlFor: checkboxId,
|
|
64
|
+
className: require_utils.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"),
|
|
65
|
+
children: label
|
|
66
|
+
}),
|
|
67
|
+
description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
68
|
+
variant: "xs",
|
|
69
|
+
color: "muted",
|
|
70
|
+
children: description
|
|
71
|
+
}),
|
|
72
|
+
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
73
|
+
variant: "xs",
|
|
74
|
+
id: errorId,
|
|
75
|
+
className: "text-berget-destructive-foreground",
|
|
76
|
+
children: error
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
Checkbox.displayName = "Checkbox";
|
|
83
|
+
//#endregion
|
|
84
|
+
exports.Checkbox = Checkbox;
|
|
85
|
+
exports.checkboxVariants = checkboxVariants;
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=Checkbox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.cjs","names":["cva","React","CheckboxBase","cn","CheckboxPrimitive","Check","Typography"],"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,oBAAA,GAAmBA,yBAAAA,IAAAA,CACvB,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,MAAM,WAAWC,MAAM,YAEnB,EACE,cAAc,WACd,WACA,SACA,MACA,OACA,aACA,OACA,IACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,cAAcA,MAAM,MAAM;CAChC,MAAM,aAAa,MAAM;CACzB,MAAM,UAAU,GAAG,WAAW;CAE9B,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,UAAD;IACO;IACL,IAAI;IACM;IACV,gBAAc,CAAC,CAAC;IAChB,oBAAkB,QAAQ,UAAU,KAAA;IACpC,cAAY,aAAa,SAAS,KAAA;IAClC,WAAWC,cAAAA,GACT,iBAAiB;KAAE;KAAS;IAAK,CAAC,GAClC,kBACA,YAAY,0CACZ,SACF;IACA,GAAI;IAEJ,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,SAAkB,WAAnB,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,OAAD;KACE,WAAU;KACV,OAAO;MAAE,OAAO;MAAgB,QAAQ;KAAe;IACxD,CAAA,EAC0B,CAAA;GACjB,CAAA;EACX,CAAA,IAEH,SAAS,eAAe,UACxB,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACG,SACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;KACE,SAAS;KACT,WAAWF,cAAAA,GACT,kCACA,WACI,qCACA,YAAY,UACV,sDACA,YAAY,YACV,kDACA,kBACR,SAAS,oCACX;KAEC,UAAA;IACI,CAAA;IAER,eACC,iBAAA,GAAA,kBAAA,IAAA,CAACG,mBAAAA,YAAD;KAAY,SAAQ;KAAK,OAAM;KAC5B,UAAA;IACS,CAAA;IAEb,SACC,iBAAA,GAAA,kBAAA,IAAA,CAACA,mBAAAA,YAAD;KAAY,SAAQ;KAAK,IAAI;KAAS,WAAU;KAC7C,UAAA;IACS,CAAA;GAEX;EAEJ,CAAA,CAAA;;AAET,CACF;AACA,SAAS,cAAc"}
|