@allxsmith/bestax-bulma 5.27.0 → 5.27.2
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/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/columns/Column.js +48 -0
- package/dist/esm/columns/Column.js.map +1 -0
- package/dist/esm/columns/Columns.js +53 -0
- package/dist/esm/columns/Columns.js.map +1 -0
- package/dist/esm/components/Avatar.js +299 -0
- package/dist/esm/components/Avatar.js.map +1 -0
- package/dist/esm/components/Avatars.js +81 -0
- package/dist/esm/components/Avatars.js.map +1 -0
- package/dist/esm/components/Badge.js +105 -0
- package/dist/esm/components/Badge.js.map +1 -0
- package/dist/esm/components/Breadcrumb.js +36 -0
- package/dist/esm/components/Breadcrumb.js.map +1 -0
- package/dist/esm/components/Card.js +252 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/Carousel.js +351 -0
- package/dist/esm/components/Carousel.js.map +1 -0
- package/dist/esm/components/Collapse.js +193 -0
- package/dist/esm/components/Collapse.js.map +1 -0
- package/dist/esm/components/Collapses.js +99 -0
- package/dist/esm/components/Collapses.js.map +1 -0
- package/dist/esm/components/Dialog.js +230 -0
- package/dist/esm/components/Dialog.js.map +1 -0
- package/dist/esm/components/Dropdown.js +362 -0
- package/dist/esm/components/Dropdown.js.map +1 -0
- package/dist/esm/components/Loading.js +87 -0
- package/dist/esm/components/Loading.js.map +1 -0
- package/dist/esm/components/Menu.js +117 -0
- package/dist/esm/components/Menu.js.map +1 -0
- package/dist/esm/components/Message.js +56 -0
- package/dist/esm/components/Message.js.map +1 -0
- package/dist/esm/components/Modal.js +354 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/Navbar.js +287 -0
- package/dist/esm/components/Navbar.js.map +1 -0
- package/dist/esm/components/Pagination.js +191 -0
- package/dist/esm/components/Pagination.js.map +1 -0
- package/dist/esm/components/Panel.js +100 -0
- package/dist/esm/components/Panel.js.map +1 -0
- package/dist/esm/components/Popover.js +298 -0
- package/dist/esm/components/Popover.js.map +1 -0
- package/dist/esm/components/Reveal.js +157 -0
- package/dist/esm/components/Reveal.js.map +1 -0
- package/dist/esm/components/Sidebar.js +209 -0
- package/dist/esm/components/Sidebar.js.map +1 -0
- package/dist/esm/components/Steps.js +128 -0
- package/dist/esm/components/Steps.js.map +1 -0
- package/dist/esm/components/Tabs.js +335 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Toast.js +322 -0
- package/dist/esm/components/Toast.js.map +1 -0
- package/dist/esm/components/Tooltip.js +202 -0
- package/dist/esm/components/Tooltip.js.map +1 -0
- package/dist/esm/components/collapsesContext.js +12 -0
- package/dist/esm/components/collapsesContext.js.map +1 -0
- package/dist/esm/elements/Block.js +29 -0
- package/dist/esm/elements/Block.js.map +1 -0
- package/dist/esm/elements/Box.js +32 -0
- package/dist/esm/elements/Box.js.map +1 -0
- package/dist/esm/elements/Button.js +139 -0
- package/dist/esm/elements/Button.js.map +1 -0
- package/dist/esm/elements/Buttons.js +42 -0
- package/dist/esm/elements/Buttons.js.map +1 -0
- package/dist/esm/elements/Code.js +25 -0
- package/dist/esm/elements/Code.js.map +1 -0
- package/dist/esm/elements/Content.js +33 -0
- package/dist/esm/elements/Content.js.map +1 -0
- package/dist/esm/elements/Delete.js +35 -0
- package/dist/esm/elements/Delete.js.map +1 -0
- package/dist/esm/elements/Divider.js +27 -0
- package/dist/esm/elements/Divider.js.map +1 -0
- package/dist/esm/elements/Emphasis.js +25 -0
- package/dist/esm/elements/Emphasis.js.map +1 -0
- package/dist/esm/elements/Figure.js +58 -0
- package/dist/esm/elements/Figure.js.map +1 -0
- package/dist/esm/elements/Icon.js +256 -0
- package/dist/esm/elements/Icon.js.map +1 -0
- package/dist/esm/elements/IconText.js +36 -0
- package/dist/esm/elements/IconText.js.map +1 -0
- package/dist/esm/elements/Image.js +46 -0
- package/dist/esm/elements/Image.js.map +1 -0
- package/dist/esm/elements/Link.js +36 -0
- package/dist/esm/elements/Link.js.map +1 -0
- package/dist/esm/elements/LinkButton.js +37 -0
- package/dist/esm/elements/LinkButton.js.map +1 -0
- package/dist/esm/elements/ListItem.js +28 -0
- package/dist/esm/elements/ListItem.js.map +1 -0
- package/dist/esm/elements/Loader.js +37 -0
- package/dist/esm/elements/Loader.js.map +1 -0
- package/dist/esm/elements/Notification.js +316 -0
- package/dist/esm/elements/Notification.js.map +1 -0
- package/dist/esm/elements/OrderedList.js +31 -0
- package/dist/esm/elements/OrderedList.js.map +1 -0
- package/dist/esm/elements/Paragraph.js +28 -0
- package/dist/esm/elements/Paragraph.js.map +1 -0
- package/dist/esm/elements/Pre.js +25 -0
- package/dist/esm/elements/Pre.js.map +1 -0
- package/dist/esm/elements/Progress.js +33 -0
- package/dist/esm/elements/Progress.js.map +1 -0
- package/dist/esm/elements/Skeleton.js +30 -0
- package/dist/esm/elements/Skeleton.js.map +1 -0
- package/dist/esm/elements/Span.js +28 -0
- package/dist/esm/elements/Span.js.map +1 -0
- package/dist/esm/elements/Strong.js +25 -0
- package/dist/esm/elements/Strong.js.map +1 -0
- package/dist/esm/elements/SubTitle.js +51 -0
- package/dist/esm/elements/SubTitle.js.map +1 -0
- package/dist/esm/elements/Table.js +51 -0
- package/dist/esm/elements/Table.js.map +1 -0
- package/dist/esm/elements/Tag.js +49 -0
- package/dist/esm/elements/Tag.js.map +1 -0
- package/dist/esm/elements/Tags.js +34 -0
- package/dist/esm/elements/Tags.js.map +1 -0
- package/dist/esm/elements/Tbody.js +26 -0
- package/dist/esm/elements/Tbody.js.map +1 -0
- package/dist/esm/elements/Td.js +61 -0
- package/dist/esm/elements/Td.js.map +1 -0
- package/dist/esm/elements/Tfoot.js +26 -0
- package/dist/esm/elements/Tfoot.js.map +1 -0
- package/dist/esm/elements/Th.js +34 -0
- package/dist/esm/elements/Th.js.map +1 -0
- package/dist/esm/elements/Thead.js +26 -0
- package/dist/esm/elements/Thead.js.map +1 -0
- package/dist/esm/elements/Title.js +44 -0
- package/dist/esm/elements/Title.js.map +1 -0
- package/dist/esm/elements/Tr.js +31 -0
- package/dist/esm/elements/Tr.js.map +1 -0
- package/dist/esm/elements/UnorderedList.js +31 -0
- package/dist/esm/elements/UnorderedList.js.map +1 -0
- package/dist/esm/elements/iconProps.js +49 -0
- package/dist/esm/elements/iconProps.js.map +1 -0
- package/dist/esm/form/Autocomplete.js +279 -0
- package/dist/esm/form/Autocomplete.js.map +1 -0
- package/dist/esm/form/Checkbox.js +111 -0
- package/dist/esm/form/Checkbox.js.map +1 -0
- package/dist/esm/form/Checkboxes.js +90 -0
- package/dist/esm/form/Checkboxes.js.map +1 -0
- package/dist/esm/form/Control.js +79 -0
- package/dist/esm/form/Control.js.map +1 -0
- package/dist/esm/form/DateInput.js +88 -0
- package/dist/esm/form/DateInput.js.map +1 -0
- package/dist/esm/form/DateInputBase.js +263 -0
- package/dist/esm/form/DateInputBase.js.map +1 -0
- package/dist/esm/form/DateRangeInput.js +77 -0
- package/dist/esm/form/DateRangeInput.js.map +1 -0
- package/dist/esm/form/DateRangeInputBase.js +301 -0
- package/dist/esm/form/DateRangeInputBase.js.map +1 -0
- package/dist/esm/form/DateTimeInput.js +88 -0
- package/dist/esm/form/DateTimeInput.js.map +1 -0
- package/dist/esm/form/DateTimeInputBase.js +333 -0
- package/dist/esm/form/DateTimeInputBase.js.map +1 -0
- package/dist/esm/form/Field.js +167 -0
- package/dist/esm/form/Field.js.map +1 -0
- package/dist/esm/form/File.js +112 -0
- package/dist/esm/form/File.js.map +1 -0
- package/dist/esm/form/FormContext.js +194 -0
- package/dist/esm/form/FormContext.js.map +1 -0
- package/dist/esm/form/Input.js +88 -0
- package/dist/esm/form/Input.js.map +1 -0
- package/dist/esm/form/InputBase.js +40 -0
- package/dist/esm/form/InputBase.js.map +1 -0
- package/dist/esm/form/Numberinput.js +201 -0
- package/dist/esm/form/Numberinput.js.map +1 -0
- package/dist/esm/form/Radio.js +108 -0
- package/dist/esm/form/Radio.js.map +1 -0
- package/dist/esm/form/Radios.js +92 -0
- package/dist/esm/form/Radios.js.map +1 -0
- package/dist/esm/form/Rate.js +280 -0
- package/dist/esm/form/Rate.js.map +1 -0
- package/dist/esm/form/Select.js +81 -0
- package/dist/esm/form/Select.js.map +1 -0
- package/dist/esm/form/SelectBase.js +54 -0
- package/dist/esm/form/SelectBase.js.map +1 -0
- package/dist/esm/form/Slider.js +461 -0
- package/dist/esm/form/Slider.js.map +1 -0
- package/dist/esm/form/Switch.js +96 -0
- package/dist/esm/form/Switch.js.map +1 -0
- package/dist/esm/form/Taginput.js +351 -0
- package/dist/esm/form/Taginput.js.map +1 -0
- package/dist/esm/form/TextArea.js +77 -0
- package/dist/esm/form/TextArea.js.map +1 -0
- package/dist/esm/form/TextAreaBase.js +45 -0
- package/dist/esm/form/TextAreaBase.js.map +1 -0
- package/dist/esm/form/TimeInput.js +84 -0
- package/dist/esm/form/TimeInput.js.map +1 -0
- package/dist/esm/form/TimeInputBase.js +246 -0
- package/dist/esm/form/TimeInputBase.js.map +1 -0
- package/dist/esm/form/_pickerInternals/Calendar.js +760 -0
- package/dist/esm/form/_pickerInternals/Calendar.js.map +1 -0
- package/dist/esm/form/_pickerInternals/PickerPopover.js +95 -0
- package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -0
- package/dist/esm/form/_pickerInternals/TimeWheels.js +721 -0
- package/dist/esm/form/_pickerInternals/TimeWheels.js.map +1 -0
- package/dist/esm/form/_pickerInternals/audioTick.js +109 -0
- package/dist/esm/form/_pickerInternals/audioTick.js.map +1 -0
- package/dist/esm/form/_pickerInternals/dateUtils.js +267 -0
- package/dist/esm/form/_pickerInternals/dateUtils.js.map +1 -0
- package/dist/esm/form/_pickerInternals/formatters.js +322 -0
- package/dist/esm/form/_pickerInternals/formatters.js.map +1 -0
- package/dist/esm/form/_pickerInternals/haptics.js +38 -0
- package/dist/esm/form/_pickerInternals/haptics.js.map +1 -0
- package/dist/esm/form/_pickerInternals/nativeInputSupport.js +25 -0
- package/dist/esm/form/_pickerInternals/nativeInputSupport.js.map +1 -0
- package/dist/esm/form/_pickerInternals/pickerTypes.js +50 -0
- package/dist/esm/form/_pickerInternals/pickerTypes.js.map +1 -0
- package/dist/esm/form/_pickerInternals/segmentMap.js +315 -0
- package/dist/esm/form/_pickerInternals/segmentMap.js.map +1 -0
- package/dist/esm/form/_pickerInternals/useNativeMobilePicker.js +49 -0
- package/dist/esm/form/_pickerInternals/useNativeMobilePicker.js.map +1 -0
- package/dist/esm/form/_pickerInternals/useSegmentedEntry.js +427 -0
- package/dist/esm/form/_pickerInternals/useSegmentedEntry.js.map +1 -0
- package/dist/esm/form/controlLoading.js +18 -0
- package/dist/esm/form/controlLoading.js.map +1 -0
- package/dist/esm/form/useAutoLabelId.js +88 -0
- package/dist/esm/form/useAutoLabelId.js.map +1 -0
- package/dist/esm/grid/Cell.js +35 -0
- package/dist/esm/grid/Cell.js.map +1 -0
- package/dist/esm/grid/Grid.js +51 -0
- package/dist/esm/grid/Grid.js.map +1 -0
- package/dist/esm/helpers/ClientOnly.js +33 -0
- package/dist/esm/helpers/ClientOnly.js.map +1 -0
- package/dist/esm/helpers/Config.js +60 -0
- package/dist/esm/helpers/Config.js.map +1 -0
- package/dist/esm/helpers/Theme.js +947 -0
- package/dist/esm/helpers/Theme.js.map +1 -0
- package/dist/esm/helpers/anchorAttrs.js +72 -0
- package/dist/esm/helpers/anchorAttrs.js.map +1 -0
- package/dist/esm/helpers/bulmaClassHelpers.js +415 -0
- package/dist/esm/helpers/bulmaClassHelpers.js.map +1 -0
- package/dist/esm/helpers/buttonType.js +24 -0
- package/dist/esm/helpers/buttonType.js.map +1 -0
- package/dist/esm/helpers/classNames.js +137 -0
- package/dist/esm/helpers/classNames.js.map +1 -0
- package/dist/esm/helpers/colorDeprecations.js +50 -0
- package/dist/esm/helpers/colorDeprecations.js.map +1 -0
- package/dist/esm/helpers/devWarnings.js +27 -0
- package/dist/esm/helpers/devWarnings.js.map +1 -0
- package/dist/esm/helpers/inertProps.js +27 -0
- package/dist/esm/helpers/inertProps.js.map +1 -0
- package/dist/esm/helpers/mergeBulmaStyles.js +20 -0
- package/dist/esm/helpers/mergeBulmaStyles.js.map +1 -0
- package/dist/esm/helpers/polymorphic.js +18 -0
- package/dist/esm/helpers/polymorphic.js.map +1 -0
- package/dist/esm/helpers/portal.js +76 -0
- package/dist/esm/helpers/portal.js.map +1 -0
- package/dist/esm/helpers/positionStacks.js +45 -0
- package/dist/esm/helpers/positionStacks.js.map +1 -0
- package/dist/esm/helpers/scrollLock.js +38 -0
- package/dist/esm/helpers/scrollLock.js.map +1 -0
- package/dist/esm/helpers/shadowDom.js +71 -0
- package/dist/esm/helpers/shadowDom.js.map +1 -0
- package/dist/esm/helpers/statusRegion.js +282 -0
- package/dist/esm/helpers/statusRegion.js.map +1 -0
- package/dist/esm/helpers/useAnchoredPosition.js +86 -0
- package/dist/esm/helpers/useAnchoredPosition.js.map +1 -0
- package/dist/esm/helpers/useBulmaClasses.js +158 -0
- package/dist/esm/helpers/useBulmaClasses.js.map +1 -0
- package/dist/esm/helpers/useClientLayoutEffect.js +13 -0
- package/dist/esm/helpers/useClientLayoutEffect.js.map +1 -0
- package/dist/esm/helpers/useColorClasses.js +84 -0
- package/dist/esm/helpers/useColorClasses.js.map +1 -0
- package/dist/esm/helpers/useFlexboxClasses.js +92 -0
- package/dist/esm/helpers/useFlexboxClasses.js.map +1 -0
- package/dist/esm/helpers/useFocusTrap.js +470 -0
- package/dist/esm/helpers/useFocusTrap.js.map +1 -0
- package/dist/esm/helpers/useIsHydrated.js +31 -0
- package/dist/esm/helpers/useIsHydrated.js.map +1 -0
- package/dist/esm/helpers/useOtherClasses.js +115 -0
- package/dist/esm/helpers/useOtherClasses.js.map +1 -0
- package/dist/esm/helpers/useSpacingClasses.js +82 -0
- package/dist/esm/helpers/useSpacingClasses.js.map +1 -0
- package/dist/esm/helpers/useTypographyClasses.js +93 -0
- package/dist/esm/helpers/useTypographyClasses.js.map +1 -0
- package/dist/esm/helpers/useVisibilityClasses.js +134 -0
- package/dist/esm/helpers/useVisibilityClasses.js.map +1 -0
- package/dist/esm/helpers/withSubComponents.js +24 -0
- package/dist/esm/helpers/withSubComponents.js.map +1 -0
- package/dist/esm/layout/Container.js +48 -0
- package/dist/esm/layout/Container.js.map +1 -0
- package/dist/esm/layout/Footer.js +33 -0
- package/dist/esm/layout/Footer.js.map +1 -0
- package/dist/esm/layout/Hero.js +90 -0
- package/dist/esm/layout/Hero.js.map +1 -0
- package/dist/esm/layout/Level.js +110 -0
- package/dist/esm/layout/Level.js.map +1 -0
- package/dist/esm/layout/Media.js +86 -0
- package/dist/esm/layout/Media.js.map +1 -0
- package/dist/esm/layout/Section.js +30 -0
- package/dist/esm/layout/Section.js.map +1 -0
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +187 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +115 -17516
- package/dist/index.esm.js.map +1 -1
- package/dist/types/elements/Icon.d.ts +10 -7
- package/dist/types/form/Autocomplete.d.ts +1 -1
- package/dist/types/form/Checkboxes.d.ts +1 -1
- package/dist/types/form/DateInput.d.ts +1 -1
- package/dist/types/form/DateInputBase.d.ts +3 -4
- package/dist/types/form/DateRangeInput.d.ts +1 -1
- package/dist/types/form/DateTimeInput.d.ts +1 -1
- package/dist/types/form/DateTimeInputBase.d.ts +3 -4
- package/dist/types/form/Field.d.ts +2 -2
- package/dist/types/form/File.d.ts +4 -4
- package/dist/types/form/FormContext.d.ts +24 -2
- package/dist/types/form/Numberinput.d.ts +1 -1
- package/dist/types/form/Radios.d.ts +1 -1
- package/dist/types/form/Rate.d.ts +1 -1
- package/dist/types/form/Slider.d.ts +1 -1
- package/dist/types/form/Taginput.d.ts +1 -1
- package/dist/types/form/TimeInput.d.ts +1 -1
- package/dist/types/form/useAutoLabelId.d.ts +25 -4
- package/dist/types/helpers/Config.d.ts +3 -4
- package/dist/types/helpers/Theme.d.ts +44 -40
- package/dist/types-cjs/elements/Icon.d.ts +10 -7
- package/dist/types-cjs/form/Autocomplete.d.ts +1 -1
- package/dist/types-cjs/form/Checkboxes.d.ts +1 -1
- package/dist/types-cjs/form/DateInput.d.ts +1 -1
- package/dist/types-cjs/form/DateInputBase.d.ts +3 -4
- package/dist/types-cjs/form/DateRangeInput.d.ts +1 -1
- package/dist/types-cjs/form/DateTimeInput.d.ts +1 -1
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +3 -4
- package/dist/types-cjs/form/Field.d.ts +2 -2
- package/dist/types-cjs/form/File.d.ts +4 -4
- package/dist/types-cjs/form/FormContext.d.ts +24 -2
- package/dist/types-cjs/form/Numberinput.d.ts +1 -1
- package/dist/types-cjs/form/Radios.d.ts +1 -1
- package/dist/types-cjs/form/Rate.d.ts +1 -1
- package/dist/types-cjs/form/Slider.d.ts +1 -1
- package/dist/types-cjs/form/Taginput.d.ts +1 -1
- package/dist/types-cjs/form/TimeInput.d.ts +1 -1
- package/dist/types-cjs/form/useAutoLabelId.d.ts +25 -4
- package/dist/types-cjs/helpers/Config.d.ts +3 -4
- package/dist/types-cjs/helpers/Theme.d.ts +44 -40
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/form/_dateinput.scss +37 -6
- package/src/scss/form/_datetimeinput.scss +7 -2
- package/src/scss/form/_picker-popover.scss +1 -4
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
|
|
5
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
6
|
+
|
|
7
|
+
const badgeColors = [
|
|
8
|
+
'primary',
|
|
9
|
+
'link',
|
|
10
|
+
'info',
|
|
11
|
+
'success',
|
|
12
|
+
'warning',
|
|
13
|
+
'danger',
|
|
14
|
+
'black',
|
|
15
|
+
'dark',
|
|
16
|
+
'light',
|
|
17
|
+
'white',
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* The `Badge` component is a small status/count indicator overlaid on the corner of another element, or rendered standalone.
|
|
21
|
+
*
|
|
22
|
+
* @function
|
|
23
|
+
* @param {BadgeProps} props - Props for the Badge component.
|
|
24
|
+
* @returns {JSX.Element | null} The rendered badge (and children, if provided).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <Badge dot color="success" overlap="circle">
|
|
28
|
+
* <Avatar src="/users/ada.jpg" name="Ada" />
|
|
29
|
+
* </Badge>
|
|
30
|
+
* @example
|
|
31
|
+
* <Badge content={128} max={99} color="danger">
|
|
32
|
+
* <Icon name="bell" />
|
|
33
|
+
* </Badge>
|
|
34
|
+
*/
|
|
35
|
+
const Badge = ({ className, badgeClassName, content, max = 99, dot = false, showZero = false, color = 'danger', position = 'top-right', overlap = 'square', pulse = false, invisible = false, children, ...props }) => {
|
|
36
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses(props);
|
|
37
|
+
const hasChildren = children != null && children !== false;
|
|
38
|
+
const isZero = typeof content === 'number' && content === 0;
|
|
39
|
+
const hasContent = content != null &&
|
|
40
|
+
content !== false &&
|
|
41
|
+
content !== true &&
|
|
42
|
+
content !== '' &&
|
|
43
|
+
(!isZero || showZero);
|
|
44
|
+
// A hidden zero keeps the pill mounted (visually hidden via .is-zero) so the
|
|
45
|
+
// role="status" live region exists before a 0 -> 1 change — mutating text in
|
|
46
|
+
// an existing region is reliably announced, inserting an already-populated
|
|
47
|
+
// region is not.
|
|
48
|
+
const zeroPlaceholder = isZero && !showZero && !dot && !invisible;
|
|
49
|
+
const shouldRender = dot || hasContent || invisible || zeroPlaceholder;
|
|
50
|
+
// A negative or non-integer max is nonsensical; fall back to the default
|
|
51
|
+
// rather than render e.g. "-1+" (mirrors Avatars' max sanitization).
|
|
52
|
+
const sanitizedMax = Number.isInteger(max) && max >= 0 ? max : 99;
|
|
53
|
+
const displayValue = useMemo(() => {
|
|
54
|
+
if (dot || !hasContent)
|
|
55
|
+
return undefined;
|
|
56
|
+
// max only applies to numeric content; any other node renders verbatim.
|
|
57
|
+
if (typeof content === 'number') {
|
|
58
|
+
return content > sanitizedMax ? `${sanitizedMax}+` : String(content);
|
|
59
|
+
}
|
|
60
|
+
return content;
|
|
61
|
+
}, [dot, hasContent, content, sanitizedMax]);
|
|
62
|
+
// Only primitive content produces a meaningful aria-label; a custom node
|
|
63
|
+
// supplies its own accessible text, so we leave role="status" unlabeled.
|
|
64
|
+
const ariaLabel = typeof displayValue === 'string' || typeof displayValue === 'number'
|
|
65
|
+
? String(displayValue)
|
|
66
|
+
: undefined;
|
|
67
|
+
// Both prefixed-classname hooks stay above the early returns (Rules of Hooks).
|
|
68
|
+
const wrapperClass = usePrefixedClassNames('badge-wrapper');
|
|
69
|
+
const badgeClasses = usePrefixedClassNames('badge', {
|
|
70
|
+
[`is-${color}`]: !!color && badgeColors.includes(color),
|
|
71
|
+
// Corner position / overlap only mean anything inside a wrapper; emitting
|
|
72
|
+
// them on a standalone badge shifts it out of normal flow via the transform.
|
|
73
|
+
[`is-${position}`]: !!position && hasChildren,
|
|
74
|
+
[`is-overlap-${overlap}`]: !!overlap && hasChildren,
|
|
75
|
+
'is-standalone': !hasChildren,
|
|
76
|
+
'is-dot': dot,
|
|
77
|
+
'is-pulse': pulse,
|
|
78
|
+
'is-invisible': invisible,
|
|
79
|
+
'is-zero': zeroPlaceholder,
|
|
80
|
+
});
|
|
81
|
+
// badgeClassName is a plain (unprefixed) slot merged onto the pill, mirroring
|
|
82
|
+
// Tooltip's tooltipClassName. Standalone badges have no wrapper, so the pill
|
|
83
|
+
// is the root and takes className/helpers/rest directly.
|
|
84
|
+
const pillClass = hasChildren
|
|
85
|
+
? classNames(badgeClasses, badgeClassName)
|
|
86
|
+
: classNames(badgeClasses, badgeClassName, bulmaHelperClasses, className);
|
|
87
|
+
const a11yProps = dot
|
|
88
|
+
? { 'aria-hidden': true }
|
|
89
|
+
: {
|
|
90
|
+
role: 'status',
|
|
91
|
+
...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),
|
|
92
|
+
};
|
|
93
|
+
const indicator = shouldRender ? (jsx("span", { className: pillClass, ...a11yProps, ...(hasChildren ? {} : rest), children: !dot && displayValue })) : null;
|
|
94
|
+
if (!hasChildren) {
|
|
95
|
+
return indicator;
|
|
96
|
+
}
|
|
97
|
+
// Always render the wrapper when there are children so the root keeps
|
|
98
|
+
// className/helpers/rest (data-testid, id, onClick, ...) even when the badge
|
|
99
|
+
// itself is hidden.
|
|
100
|
+
return (jsxs("span", { className: classNames(wrapperClass, bulmaHelperClasses, className), ...rest, children: [children, indicator] }));
|
|
101
|
+
};
|
|
102
|
+
Badge.displayName = 'Badge';
|
|
103
|
+
|
|
104
|
+
export { Badge };
|
|
105
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../src/components/Badge.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\nconst badgeColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'dark',\n 'light',\n 'white',\n] as const;\n\n/** Valid color values for the Badge component. */\nexport type BadgeColor = (typeof badgeColors)[number];\n\n/** Valid corner position values for the Badge component. */\nexport type BadgePosition =\n 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';\n\n/** Valid overlap adjustment values for the Badge component. */\nexport type BadgeOverlap = 'circle' | 'square';\n\n/**\n * Props for the Badge component.\n */\nexport interface BadgeProps\n extends\n Omit<React.HTMLAttributes<HTMLSpanElement>, 'color' | 'content'>,\n Omit<BulmaClassesProps, 'color'> {\n /** Additional CSS classes for the root — the wrapper when `children` are present, else the badge pill. */\n className?: string;\n /** Additional CSS classes applied to the badge pill itself (unprefixed, like `Tooltip`'s `tooltipClassName`). */\n badgeClassName?: string;\n /** Count, short text, or a custom node to display; omit with `dot` for a plain dot. `max`/`showZero` apply only to numeric content. */\n content?: React.ReactNode;\n /** Numeric `content` above this renders as `\"{max}+\"`. A negative or non-integer value falls back to the default. */\n max?: number;\n /** Render a small dot with no content. */\n dot?: boolean;\n /** Show the badge when `content` is `0`. Default `false`. */\n showZero?: boolean;\n /** Status color. Default `'danger'`. */\n color?: BadgeColor;\n /** Corner to overlay the badge on, relative to `children`. Ignored for standalone badges (no `children`). */\n position?: BadgePosition;\n /** Nudges the offset for a round (`'circle'`) vs rectangular (`'square'`) child. Ignored for standalone badges (no `children`). */\n overlap?: BadgeOverlap;\n /** Processing/pulse animation; no-ops under `prefers-reduced-motion: reduce`. */\n pulse?: boolean;\n /** Hide the badge pill without unmounting it (the wrapper and `children` stay visible). */\n invisible?: boolean;\n /** The element the badge overlays. Omit to render a standalone badge. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Badge` component is a small status/count indicator overlaid on the corner of another element, or rendered standalone.\n *\n * @function\n * @param {BadgeProps} props - Props for the Badge component.\n * @returns {JSX.Element | null} The rendered badge (and children, if provided).\n *\n * @example\n * <Badge dot color=\"success\" overlap=\"circle\">\n * <Avatar src=\"/users/ada.jpg\" name=\"Ada\" />\n * </Badge>\n * @example\n * <Badge content={128} max={99} color=\"danger\">\n * <Icon name=\"bell\" />\n * </Badge>\n */\nexport const Badge: React.FC<BadgeProps> = ({\n className,\n badgeClassName,\n content,\n max = 99,\n dot = false,\n showZero = false,\n color = 'danger',\n position = 'top-right',\n overlap = 'square',\n pulse = false,\n invisible = false,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n\n const hasChildren = children != null && children !== false;\n\n const isZero = typeof content === 'number' && content === 0;\n const hasContent =\n content != null &&\n content !== false &&\n content !== true &&\n content !== '' &&\n (!isZero || showZero);\n // A hidden zero keeps the pill mounted (visually hidden via .is-zero) so the\n // role=\"status\" live region exists before a 0 -> 1 change — mutating text in\n // an existing region is reliably announced, inserting an already-populated\n // region is not.\n const zeroPlaceholder = isZero && !showZero && !dot && !invisible;\n const shouldRender = dot || hasContent || invisible || zeroPlaceholder;\n\n // A negative or non-integer max is nonsensical; fall back to the default\n // rather than render e.g. \"-1+\" (mirrors Avatars' max sanitization).\n const sanitizedMax = Number.isInteger(max) && max >= 0 ? max : 99;\n\n const displayValue = useMemo<React.ReactNode>(() => {\n if (dot || !hasContent) return undefined;\n // max only applies to numeric content; any other node renders verbatim.\n if (typeof content === 'number') {\n return content > sanitizedMax ? `${sanitizedMax}+` : String(content);\n }\n return content;\n }, [dot, hasContent, content, sanitizedMax]);\n\n // Only primitive content produces a meaningful aria-label; a custom node\n // supplies its own accessible text, so we leave role=\"status\" unlabeled.\n const ariaLabel =\n typeof displayValue === 'string' || typeof displayValue === 'number'\n ? String(displayValue)\n : undefined;\n\n // Both prefixed-classname hooks stay above the early returns (Rules of Hooks).\n const wrapperClass = usePrefixedClassNames('badge-wrapper');\n const badgeClasses = usePrefixedClassNames('badge', {\n [`is-${color}`]: !!color && badgeColors.includes(color),\n // Corner position / overlap only mean anything inside a wrapper; emitting\n // them on a standalone badge shifts it out of normal flow via the transform.\n [`is-${position}`]: !!position && hasChildren,\n [`is-overlap-${overlap}`]: !!overlap && hasChildren,\n 'is-standalone': !hasChildren,\n 'is-dot': dot,\n 'is-pulse': pulse,\n 'is-invisible': invisible,\n 'is-zero': zeroPlaceholder,\n });\n\n // badgeClassName is a plain (unprefixed) slot merged onto the pill, mirroring\n // Tooltip's tooltipClassName. Standalone badges have no wrapper, so the pill\n // is the root and takes className/helpers/rest directly.\n const pillClass = hasChildren\n ? classNames(badgeClasses, badgeClassName)\n : classNames(badgeClasses, badgeClassName, bulmaHelperClasses, className);\n\n const a11yProps = dot\n ? { 'aria-hidden': true as const }\n : {\n role: 'status' as const,\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),\n };\n\n const indicator = shouldRender ? (\n <span className={pillClass} {...a11yProps} {...(hasChildren ? {} : rest)}>\n {!dot && displayValue}\n </span>\n ) : null;\n\n if (!hasChildren) {\n return indicator;\n }\n\n // Always render the wrapper when there are children so the root keeps\n // className/helpers/rest (data-testid, id, onClick, ...) even when the badge\n // itself is hidden.\n return (\n <span\n className={classNames(wrapperClass, bulmaHelperClasses, className)}\n {...rest}\n >\n {children}\n {indicator}\n </span>\n );\n};\n\nBadge.displayName = 'Badge';\n\nexport default Badge;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAIA,MAAM,WAAW,GAAG;IAClB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;CACC;AA6CV;;;;;;;;;;;;;;;AAeG;MACU,KAAK,GAAyB,CAAC,EAC1C,SAAS,EACT,cAAc,EACd,OAAO,EACP,GAAG,GAAG,EAAE,EACR,GAAG,GAAG,KAAK,EACX,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,QAAQ,EAChB,QAAQ,GAAG,WAAW,EACtB,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,KAAK,EACb,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;IACH,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC;IAE3D,MAAM,WAAW,GAAG,QAAQ,IAAI,IAAI,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 @@
|
|
|
1
|
+
/* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
|
|
4
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
5
|
+
|
|
6
|
+
const validBreadcrumbAlignments = ['centered', 'right'];
|
|
7
|
+
const validBreadcrumbSeparators = [
|
|
8
|
+
'arrow',
|
|
9
|
+
'bullet',
|
|
10
|
+
'dot',
|
|
11
|
+
'succeeds',
|
|
12
|
+
];
|
|
13
|
+
const validBreadcrumbSizes = ['small', 'medium', 'large'];
|
|
14
|
+
/**
|
|
15
|
+
* The `Breadcrumb` component renders a Bulma-styled breadcrumb navigation.
|
|
16
|
+
*
|
|
17
|
+
* @function
|
|
18
|
+
* @param {BreadcrumbProps} props - Props for the Breadcrumb component.
|
|
19
|
+
* @returns {JSX.Element} The rendered breadcrumb element.
|
|
20
|
+
* @see {@link https://bulma.io/documentation/components/breadcrumb/ | Bulma Breadcrumb documentation}
|
|
21
|
+
*/
|
|
22
|
+
const Breadcrumb = ({ className, alignment, separator, size, children, ...props }) => {
|
|
23
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
24
|
+
// Generate Bulma classes with prefix
|
|
25
|
+
const bulmaClasses = usePrefixedClassNames('breadcrumb', {
|
|
26
|
+
[`is-${alignment}`]: alignment && validBreadcrumbAlignments.includes(alignment),
|
|
27
|
+
[`has-${separator}-separator`]: separator && validBreadcrumbSeparators.includes(separator),
|
|
28
|
+
[`is-${size}`]: size && validBreadcrumbSizes.includes(size),
|
|
29
|
+
});
|
|
30
|
+
// Combine prefixed Bulma classes with unprefixed user className and prefixed helper classes
|
|
31
|
+
const breadcrumbClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
32
|
+
return (jsx("nav", { className: breadcrumbClasses, "aria-label": "breadcrumbs", ...rest, children: jsx("ul", { children: children }) }));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { Breadcrumb };
|
|
36
|
+
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../../src/components/Breadcrumb.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\nconst validBreadcrumbAlignments = ['centered', 'right'] as const;\n/**\n * Valid alignment values for the Breadcrumb component.\n */\nexport type BreadcrumbAlignment = (typeof validBreadcrumbAlignments)[number];\n\nconst validBreadcrumbSeparators = [\n 'arrow',\n 'bullet',\n 'dot',\n 'succeeds',\n] as const;\n/**\n * Valid separator values for the Breadcrumb component.\n */\nexport type BreadcrumbSeparator = (typeof validBreadcrumbSeparators)[number];\n\nconst validBreadcrumbSizes = ['small', 'medium', 'large'] as const;\n/**\n * Valid size values for the Breadcrumb component.\n */\nexport type BreadcrumbSize = (typeof validBreadcrumbSizes)[number];\n\n/**\n * Props for the Breadcrumb component.\n */\nexport interface BreadcrumbProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Alignment of the breadcrumb (`is-centered`, `is-right`). */\n alignment?: BreadcrumbAlignment;\n /** Type of separator between breadcrumb items. */\n separator?: BreadcrumbSeparator;\n /** Breadcrumb size. */\n size?: BreadcrumbSize;\n /** Breadcrumb items (`<li>`s with `<a>` or `<span>`). */\n children?: React.ReactNode;\n}\n\n/**\n * The `Breadcrumb` component renders a Bulma-styled breadcrumb navigation.\n *\n * @function\n * @param {BreadcrumbProps} props - Props for the Breadcrumb component.\n * @returns {JSX.Element} The rendered breadcrumb element.\n * @see {@link https://bulma.io/documentation/components/breadcrumb/ | Bulma Breadcrumb documentation}\n */\nexport const Breadcrumb: React.FC<BreadcrumbProps> = ({\n className,\n alignment,\n separator,\n size,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n // Generate Bulma classes with prefix\n const bulmaClasses = usePrefixedClassNames('breadcrumb', {\n [`is-${alignment}`]:\n alignment && validBreadcrumbAlignments.includes(alignment),\n [`has-${separator}-separator`]:\n separator && validBreadcrumbSeparators.includes(separator),\n [`is-${size}`]: size && validBreadcrumbSizes.includes(size),\n });\n\n // Combine prefixed Bulma classes with unprefixed user className and prefixed helper classes\n const breadcrumbClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <nav className={breadcrumbClasses} aria-label=\"breadcrumbs\" {...rest}>\n <ul>{children}</ul>\n </nav>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAIA,MAAM,yBAAyB,GAAG,CAAC,UAAU,EAAE,OAAO,CAAU;AAMhE,MAAM,yBAAyB,GAAG;IAChC,OAAO;IACP,QAAQ;IACR,KAAK;IACL,UAAU;CACF;AAMV,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AAyBlE;;;;;;;AAOG;MACU,UAAU,GAA8B,CAAC,EACpD,SAAS,EACT,SAAS,EACT,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;;AAGlE,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,YAAY,EAAE;AACvD,QAAA,CAAC,CAAA,GAAA,EAAM,SAAS,CAAA,CAAE,GAChB,SAAS,IAAI,yBAAyB,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC5D,QAAA,CAAC,CAAA,IAAA,EAAO,SAAS,CAAA,UAAA,CAAY,GAC3B,SAAS,IAAI,yBAAyB,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC5D,QAAA,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,CAAE,GAAG,IAAI,IAAI,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC5D,KAAA,CAAC;;IAGF,MAAM,iBAAiB,GAAG,UAAU,CAClC,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;AAED,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,EAAA,YAAA,EAAa,aAAa,EAAA,GAAK,IAAI,YAClEA,GAAA,CAAA,IAAA,EAAA,EAAA,QAAA,EAAK,QAAQ,EAAA,CAAM,EAAA,CACf;AAEV;;"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { classNames, usePrefixedClassNames, prefixedClassNames } from '../helpers/classNames.js';
|
|
5
|
+
import { withSubComponents } from '../helpers/withSubComponents.js';
|
|
6
|
+
import { ANCHOR_ONLY_ATTRS, omitAttrs } from '../helpers/anchorAttrs.js';
|
|
7
|
+
import { buttonType } from '../helpers/buttonType.js';
|
|
8
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
9
|
+
import { mergeBulmaStyles } from '../helpers/mergeBulmaStyles.js';
|
|
10
|
+
import { useConfig } from '../helpers/Config.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Check if children contain any Card compound sub-components.
|
|
14
|
+
* @param {React.ReactNode} children - The children to inspect.
|
|
15
|
+
* @returns {boolean} True if any child is a Card compound component.
|
|
16
|
+
*/
|
|
17
|
+
const hasCompoundComponents = (children) => {
|
|
18
|
+
return React.Children.toArray(children).some(child => {
|
|
19
|
+
if (!React.isValidElement(child))
|
|
20
|
+
return false;
|
|
21
|
+
// Direct comparison with our compound component functions
|
|
22
|
+
return (child.type === CardHeader ||
|
|
23
|
+
child.type === CardContent ||
|
|
24
|
+
child.type === CardImage ||
|
|
25
|
+
child.type === CardFooter ||
|
|
26
|
+
child.type === CardFooterItem ||
|
|
27
|
+
child.type === CardHeaderIcon);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The `Card` component renders a Bulma-styled card with optional header, image, content, and footer.
|
|
32
|
+
*
|
|
33
|
+
* @function
|
|
34
|
+
* @param {CardProps} props - Props for the Card component.
|
|
35
|
+
* @returns {JSX.Element} The rendered card element.
|
|
36
|
+
* @see {@link https://bulma.io/documentation/components/card/ | Bulma Card documentation}
|
|
37
|
+
*/
|
|
38
|
+
const CardComponent = ({ className, children, textColor, color, bgColor, hasShadow = true, header, headerCentered, headerIcon, footer, image, imageAlt, style, ...props }) => {
|
|
39
|
+
const { classPrefix } = useConfig();
|
|
40
|
+
const { bulmaHelperClasses, bulmaHelperStyles, rest } = useBulmaClasses({
|
|
41
|
+
color: textColor ?? color,
|
|
42
|
+
backgroundColor: bgColor,
|
|
43
|
+
...props,
|
|
44
|
+
});
|
|
45
|
+
// Generate Bulma classes with prefix
|
|
46
|
+
const bulmaClasses = usePrefixedClassNames('card', {
|
|
47
|
+
'is-shadowless': !hasShadow,
|
|
48
|
+
});
|
|
49
|
+
// Combine prefixed Bulma classes with unprefixed user className and prefixed helper classes
|
|
50
|
+
const cardClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
51
|
+
// Render header with optional icon and is-centered modifier
|
|
52
|
+
const renderHeader = (header, headerIcon, headerCentered, classPrefix) => {
|
|
53
|
+
if (!header && !headerIcon)
|
|
54
|
+
return null;
|
|
55
|
+
return (jsxs("header", { className: prefixedClassNames(classPrefix, 'card-header'), children: [header && (jsx("div", { className: prefixedClassNames(classPrefix, 'card-header-title', {
|
|
56
|
+
'is-centered': headerCentered,
|
|
57
|
+
}), children: header })), headerIcon] }));
|
|
58
|
+
};
|
|
59
|
+
// Any falsy footer (including `0`) and an empty array render no footer bar,
|
|
60
|
+
// rather than a stray `0` or an empty `.card-footer`.
|
|
61
|
+
const hasFooter = Array.isArray(footer) ? footer.length > 0 : Boolean(footer);
|
|
62
|
+
return (jsxs("div", { className: cardClasses, style: mergeBulmaStyles(bulmaHelperStyles, style), ...rest, children: [renderHeader(header, headerIcon, headerCentered, classPrefix), image && (jsx("div", { className: prefixedClassNames(classPrefix, 'card-image'), children: typeof image === 'string' ? (jsx("figure", { className: prefixedClassNames(classPrefix, 'image'), children: jsx("img", { src: image, alt: imageAlt ?? 'Card image' }) })) : (image) })), typeof children !== 'undefined' &&
|
|
63
|
+
children !== null &&
|
|
64
|
+
children !== '' &&
|
|
65
|
+
!hasCompoundComponents(children) && (jsx("div", { className: prefixedClassNames(classPrefix, 'card-content'), children: children })), typeof children !== 'undefined' &&
|
|
66
|
+
children !== null &&
|
|
67
|
+
children !== '' &&
|
|
68
|
+
hasCompoundComponents(children) &&
|
|
69
|
+
children, hasFooter && (jsx("footer", { className: prefixedClassNames(classPrefix, 'card-footer'), children: Array.isArray(footer) ? (footer.map((item, idx) => (jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: item }, idx)))) : (jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: footer })) }))] }));
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The set withheld from a non-anchor `Card.FooterItem` (`span`/`button`): the
|
|
73
|
+
* derived anchor-only attributes, minus `type` (also valid on a `<button>` as
|
|
74
|
+
* `submit`/`button`/`reset`, so stripping it there would remove a working
|
|
75
|
+
* attribute; one set for both tags means a `type` also reaches a `<span>`,
|
|
76
|
+
* which `Dropdown.Item` avoids by choosing its set per tag), plus `rel` (React
|
|
77
|
+
* declares it on `HTMLAttributes` for every element, so the derived set alone
|
|
78
|
+
* would not withhold it — the same addition `Level.Item` makes).
|
|
79
|
+
*/
|
|
80
|
+
const STRIP_FROM_NON_ANCHOR$1 = (() => {
|
|
81
|
+
const { type: _type, ...rest } = ANCHOR_ONLY_ATTRS;
|
|
82
|
+
return { ...rest, rel: true };
|
|
83
|
+
})();
|
|
84
|
+
/**
|
|
85
|
+
* The set withheld from a non-button `Card.FooterItem` (`span`/`a`), keyed so
|
|
86
|
+
* it stops compiling until a button attribute React adds is named here.
|
|
87
|
+
*/
|
|
88
|
+
const STRIP_FROM_NON_BUTTON = {
|
|
89
|
+
disabled: true,
|
|
90
|
+
form: true,
|
|
91
|
+
formAction: true,
|
|
92
|
+
formEncType: true,
|
|
93
|
+
formMethod: true,
|
|
94
|
+
formNoValidate: true,
|
|
95
|
+
formTarget: true,
|
|
96
|
+
name: true,
|
|
97
|
+
value: true,
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Card header compound component. Wraps children in a `.card-header` element.
|
|
101
|
+
*
|
|
102
|
+
* @function
|
|
103
|
+
* @param {CardHeaderProps} props - Props for the CardHeader component.
|
|
104
|
+
* @returns {JSX.Element} The rendered card header.
|
|
105
|
+
*/
|
|
106
|
+
const CardHeader = ({ className, children, centered, color, bgColor, textColor, ...props }) => {
|
|
107
|
+
const { classPrefix } = useConfig();
|
|
108
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
109
|
+
color: textColor ?? color,
|
|
110
|
+
backgroundColor: bgColor,
|
|
111
|
+
...props,
|
|
112
|
+
});
|
|
113
|
+
// Check if children contains a CardHeaderTitle component
|
|
114
|
+
const hasHeaderTitle = React.Children.toArray(children).some(child => React.isValidElement(child) &&
|
|
115
|
+
typeof child.type === 'function' &&
|
|
116
|
+
child.type === CardHeaderTitle);
|
|
117
|
+
const headerClasses = usePrefixedClassNames('card-header');
|
|
118
|
+
return (jsx("header", { className: classNames(headerClasses, bulmaHelperClasses, className), ...rest, children: hasHeaderTitle ? (children) : (jsx("div", { className: classNames(prefixedClassNames(classPrefix, 'card-header-title', {
|
|
119
|
+
'is-centered': centered,
|
|
120
|
+
}), className), children: children })) }));
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Card header title compound component. Renders a `.card-header-title` element.
|
|
124
|
+
*
|
|
125
|
+
* @function
|
|
126
|
+
* @param {CardHeaderTitleProps} props - Props for the CardHeaderTitle component.
|
|
127
|
+
* @returns {JSX.Element} The rendered card header title.
|
|
128
|
+
*/
|
|
129
|
+
const CardHeaderTitle = ({ as = 'div', className, children, centered, color, bgColor, textColor, ...props }) => {
|
|
130
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
131
|
+
color: textColor ?? color,
|
|
132
|
+
backgroundColor: bgColor,
|
|
133
|
+
...props,
|
|
134
|
+
});
|
|
135
|
+
const Tag = as;
|
|
136
|
+
return (jsx(Tag, { className: classNames(usePrefixedClassNames('card-header-title', {
|
|
137
|
+
'is-centered': centered,
|
|
138
|
+
}), bulmaHelperClasses, className), ...rest, children: children }));
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Card header icon compound component. Renders a `.card-header-icon` button.
|
|
142
|
+
*
|
|
143
|
+
* @function
|
|
144
|
+
* @param {CardHeaderIconProps} props - Props for the CardHeaderIcon component.
|
|
145
|
+
* @returns {JSX.Element} The rendered card header icon button.
|
|
146
|
+
*/
|
|
147
|
+
const CardHeaderIcon = ({ className, children, color, bgColor, textColor, ...props }) => {
|
|
148
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
149
|
+
color: textColor ?? color,
|
|
150
|
+
backgroundColor: bgColor,
|
|
151
|
+
...props,
|
|
152
|
+
});
|
|
153
|
+
return (jsx("button", { className: classNames(usePrefixedClassNames('card-header-icon'), bulmaHelperClasses, className), ...rest, "aria-label": rest['aria-label'] || 'more options', type: buttonType(rest.type), children: children }));
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Card image compound component. Wraps children in a `.card-image` element.
|
|
157
|
+
*
|
|
158
|
+
* @function
|
|
159
|
+
* @param {CardImageProps} props - Props for the CardImage component.
|
|
160
|
+
* @returns {JSX.Element} The rendered card image container.
|
|
161
|
+
*/
|
|
162
|
+
const CardImage = ({ className, children, color, bgColor, textColor, ...props }) => {
|
|
163
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
164
|
+
color: textColor ?? color,
|
|
165
|
+
backgroundColor: bgColor,
|
|
166
|
+
...props,
|
|
167
|
+
});
|
|
168
|
+
return (jsx("div", { className: classNames(usePrefixedClassNames('card-image'), bulmaHelperClasses, className), ...rest, children: children }));
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Card content compound component. Wraps children in a `.card-content` element.
|
|
172
|
+
*
|
|
173
|
+
* @function
|
|
174
|
+
* @param {CardContentProps} props - Props for the CardContent component.
|
|
175
|
+
* @returns {JSX.Element} The rendered card content container.
|
|
176
|
+
*/
|
|
177
|
+
const CardContent = ({ className, children, color, bgColor, textColor, ...props }) => {
|
|
178
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
179
|
+
color: textColor ?? color,
|
|
180
|
+
backgroundColor: bgColor,
|
|
181
|
+
...props,
|
|
182
|
+
});
|
|
183
|
+
return (jsx("div", { className: classNames(usePrefixedClassNames('card-content'), bulmaHelperClasses, className), ...rest, children: children }));
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Card footer compound component. Wraps children in a `.card-footer` element.
|
|
187
|
+
*
|
|
188
|
+
* @function
|
|
189
|
+
* @param {CardFooterProps} props - Props for the CardFooter component.
|
|
190
|
+
* @returns {JSX.Element} The rendered card footer.
|
|
191
|
+
*/
|
|
192
|
+
const CardFooter = ({ className, children, color, bgColor, textColor, ...props }) => {
|
|
193
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
194
|
+
color: textColor ?? color,
|
|
195
|
+
backgroundColor: bgColor,
|
|
196
|
+
...props,
|
|
197
|
+
});
|
|
198
|
+
return (jsx("footer", { className: classNames(usePrefixedClassNames('card-footer'), bulmaHelperClasses, className), ...rest, children: children }));
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Card footer item compound component. Wraps children in a `.card-footer-item` span.
|
|
202
|
+
*
|
|
203
|
+
* @function
|
|
204
|
+
* @param {CardFooterItemProps} props - Props for the CardFooterItem component.
|
|
205
|
+
* @returns {JSX.Element} The rendered card footer item.
|
|
206
|
+
*/
|
|
207
|
+
const CardFooterItem = ({ as = 'span', className, children, color, bgColor, textColor, ...props }) => {
|
|
208
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
209
|
+
color: textColor ?? color,
|
|
210
|
+
backgroundColor: bgColor,
|
|
211
|
+
...props,
|
|
212
|
+
});
|
|
213
|
+
const itemClasses = classNames(usePrefixedClassNames('card-footer-item'), bulmaHelperClasses, className);
|
|
214
|
+
// The anchor's own attributes reach an `<a>` and nothing else, and the button's a
|
|
215
|
+
// `<button>` — `STRIP_FROM_NON_ANCHOR` above names the anchor set and why `type`
|
|
216
|
+
// stays while `rel` is added, and `STRIP_FROM_NON_BUTTON` the button set.
|
|
217
|
+
if (as === 'a') {
|
|
218
|
+
return (jsx("a", { className: itemClasses, ...omitAttrs(rest, STRIP_FROM_NON_BUTTON), children: children }));
|
|
219
|
+
}
|
|
220
|
+
const forwarded = omitAttrs(rest, STRIP_FROM_NON_ANCHOR$1);
|
|
221
|
+
if (as === 'button') {
|
|
222
|
+
return (jsx("button", { className: itemClasses, ...forwarded,
|
|
223
|
+
// A footer item button must not submit an enclosing form by default —
|
|
224
|
+
// `<button>` defaults to `type="submit"`, and a Save/Cancel action row
|
|
225
|
+
// sitting in a form is the common case this `as` exists for.
|
|
226
|
+
//
|
|
227
|
+
// A MISSING `type` is not the only way that default arrives: `type` is
|
|
228
|
+
// typed here as the `<a>` MIME string (`STRIP_FROM_NON_ANCHOR` above
|
|
229
|
+
// says why it is not withheld), so `as="button" type="text/html"`
|
|
230
|
+
// compiles, and HTML's INVALID-value default for a button's `type` is
|
|
231
|
+
// submit too. `buttonType` keeps `button`, `submit` and `reset` and
|
|
232
|
+
// turns anything else into `button`.
|
|
233
|
+
type: buttonType(forwarded.type), children: children }));
|
|
234
|
+
}
|
|
235
|
+
return (jsx("span", { className: itemClasses, ...omitAttrs(forwarded, STRIP_FROM_NON_BUTTON), children: children }));
|
|
236
|
+
};
|
|
237
|
+
// Attach nested Title and Icon components to CardHeader
|
|
238
|
+
const CardHeaderCompound = withSubComponents(CardHeader, {
|
|
239
|
+
Title: CardHeaderTitle,
|
|
240
|
+
Icon: CardHeaderIcon,
|
|
241
|
+
});
|
|
242
|
+
/** Card component with Header, Image, Content, Footer, and FooterItem sub-components. */
|
|
243
|
+
const Card = withSubComponents(CardComponent, {
|
|
244
|
+
Header: CardHeaderCompound,
|
|
245
|
+
Image: CardImage,
|
|
246
|
+
Content: CardContent,
|
|
247
|
+
Footer: CardFooter,
|
|
248
|
+
FooterItem: CardFooterItem,
|
|
249
|
+
}, 'Card');
|
|
250
|
+
|
|
251
|
+
export { Card };
|
|
252
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/components/Card.tsx"],"sourcesContent":["import React from 'react';\nimport {\n classNames,\n usePrefixedClassNames,\n prefixedClassNames,\n} from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport {\n type AnchorOnlyAttributes,\n ANCHOR_ONLY_ATTRS,\n omitAttrs,\n} from '../helpers/anchorAttrs';\nimport { buttonType } from '../helpers/buttonType';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n validSchemeColors,\n} from '../helpers/useBulmaClasses';\nimport { mergeBulmaStyles } from '../helpers/mergeBulmaStyles';\nimport { useConfig } from '../helpers/Config';\n\n/**\n * Props for the Card component.\n * @extraProp {'centered' | 'justified' | 'left' | 'right'} [textAlign] - Text alignment.\n */\nexport interface CardProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color for the card. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Text color alias: renders `has-text-<color>`, exactly like `textColor`.\n * Not a filled card variant (no `.card.is-<color>` CSS exists). Prefer\n * `textColor`, which takes precedence when both are set; use `bgColor` for\n * a colored surface.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /**\n * Background color for the card. `scheme-*` values render as a\n * dark-mode-safe inline `background-color: var(--bulma-scheme-*)` instead\n * of a class. The `scheme-invert*` values do not change text color — pair\n * them with a contrasting foreground.\n */\n bgColor?:\n | (typeof validColors)[number]\n | (typeof validSchemeColors)[number]\n | 'inherit'\n | 'current';\n /** Whether the card has a shadow (default: `true`). */\n hasShadow?: boolean;\n /** Card header content, rendered inside `.card-header-title`. */\n header?: React.ReactNode;\n /** If true, centers the header title. */\n headerCentered?: boolean;\n /** Card header icon, rendered as a sibling to the header title. */\n headerIcon?: React.ReactNode;\n /** Card footer content; each item is wrapped in `.card-footer-item`. */\n footer?: React.ReactNode | React.ReactNode[];\n /** Card image node or image src string. */\n image?: React.ReactNode | string;\n /** Alternate text for the card image. */\n imageAlt?: string;\n /** Card content (body). */\n children?: React.ReactNode;\n}\n\n/**\n * Check if children contain any Card compound sub-components.\n * @param {React.ReactNode} children - The children to inspect.\n * @returns {boolean} True if any child is a Card compound component.\n */\nconst hasCompoundComponents = (children: React.ReactNode): boolean => {\n return React.Children.toArray(children).some(child => {\n if (!React.isValidElement(child)) return false;\n\n // Direct comparison with our compound component functions\n return (\n child.type === CardHeader ||\n child.type === CardContent ||\n child.type === CardImage ||\n child.type === CardFooter ||\n child.type === CardFooterItem ||\n child.type === CardHeaderIcon\n );\n });\n};\n\n/**\n * The `Card` component renders a Bulma-styled card with optional header, image, content, and footer.\n *\n * @function\n * @param {CardProps} props - Props for the Card component.\n * @returns {JSX.Element} The rendered card element.\n * @see {@link https://bulma.io/documentation/components/card/ | Bulma Card documentation}\n */\nconst CardComponent: React.FC<CardProps> = ({\n className,\n children,\n textColor,\n color,\n bgColor,\n hasShadow = true,\n header,\n headerCentered,\n headerIcon,\n footer,\n image,\n imageAlt,\n style,\n ...props\n}) => {\n const { classPrefix } = useConfig();\n const { bulmaHelperClasses, bulmaHelperStyles, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Generate Bulma classes with prefix\n const bulmaClasses = usePrefixedClassNames('card', {\n 'is-shadowless': !hasShadow,\n });\n\n // Combine prefixed Bulma classes with unprefixed user className and prefixed helper classes\n const cardClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n // Render header with optional icon and is-centered modifier\n const renderHeader = (\n header: React.ReactNode,\n headerIcon: React.ReactNode,\n headerCentered: boolean | undefined,\n classPrefix: string | undefined\n ) => {\n if (!header && !headerIcon) return null;\n return (\n <header className={prefixedClassNames(classPrefix, 'card-header')}>\n {header && (\n <div\n className={prefixedClassNames(classPrefix, 'card-header-title', {\n 'is-centered': headerCentered,\n })}\n >\n {header}\n </div>\n )}\n {headerIcon}\n </header>\n );\n };\n\n // Any falsy footer (including `0`) and an empty array render no footer bar,\n // rather than a stray `0` or an empty `.card-footer`.\n const hasFooter = Array.isArray(footer) ? footer.length > 0 : Boolean(footer);\n return (\n <div\n className={cardClasses}\n style={mergeBulmaStyles(bulmaHelperStyles, style)}\n {...rest}\n >\n {renderHeader(header, headerIcon, headerCentered, classPrefix)}\n {image && (\n <div className={prefixedClassNames(classPrefix, 'card-image')}>\n {typeof image === 'string' ? (\n <figure className={prefixedClassNames(classPrefix, 'image')}>\n <img src={image} alt={imageAlt ?? 'Card image'} />\n </figure>\n ) : (\n image\n )}\n </div>\n )}\n {/* Only render card-content if children is specified and doesn't contain compound components */}\n {typeof children !== 'undefined' &&\n children !== null &&\n children !== '' &&\n !hasCompoundComponents(children) && (\n <div className={prefixedClassNames(classPrefix, 'card-content')}>\n {children}\n </div>\n )}\n {/* Render children directly if they contain compound components */}\n {typeof children !== 'undefined' &&\n children !== null &&\n children !== '' &&\n hasCompoundComponents(children) &&\n children}\n {hasFooter && (\n <footer className={prefixedClassNames(classPrefix, 'card-footer')}>\n {Array.isArray(footer) ? (\n footer.map((item, idx) => (\n <span\n className={prefixedClassNames(classPrefix, 'card-footer-item')}\n key={idx}\n >\n {item}\n </span>\n ))\n ) : (\n <span\n className={prefixedClassNames(classPrefix, 'card-footer-item')}\n >\n {footer}\n </span>\n )}\n </footer>\n )}\n </div>\n );\n};\n\n// Compound components for flexible composition\n\n/**\n * Props for the Card.Header compound component.\n */\nexport interface CardHeaderProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Header content. Wrap in Card.Header.Title for Bulma styling. */\n children?: React.ReactNode;\n /** Whether to center the header title text. */\n centered?: boolean;\n}\n\n/**\n * Props for the Card.Image compound component.\n */\nexport interface CardImageProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Image content (e.g. a `<figure>` with an `<img>`). */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the Card.Content compound component.\n */\nexport interface CardContentProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Card body content. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the Card.Footer compound component.\n */\nexport interface CardFooterProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Footer content, typically Card.FooterItem elements. */\n children?: React.ReactNode;\n}\n\n/**\n * The set withheld from a non-anchor `Card.FooterItem` (`span`/`button`): the\n * derived anchor-only attributes, minus `type` (also valid on a `<button>` as\n * `submit`/`button`/`reset`, so stripping it there would remove a working\n * attribute; one set for both tags means a `type` also reaches a `<span>`,\n * which `Dropdown.Item` avoids by choosing its set per tag), plus `rel` (React\n * declares it on `HTMLAttributes` for every element, so the derived set alone\n * would not withhold it — the same addition `Level.Item` makes).\n */\nconst STRIP_FROM_NON_ANCHOR: Readonly<\n Record<Exclude<keyof AnchorOnlyAttributes, 'type'> | 'rel', true>\n> = (() => {\n const { type: _type, ...rest } = ANCHOR_ONLY_ATTRS;\n return { ...rest, rel: true };\n})();\n\n/**\n * What `<button>` adds over the attributes every element has (`disabled`,\n * `form`, `name`, `value` and the `form*` submit overrides), subtracted from\n * React's types the way `AnchorOnlyAttributes` is, so it grows when React's\n * does. Minus `type`, which `AnchorOnlyAttributes` already declares as the\n * `<a>` MIME string: two heritage clauses declaring it differently do not\n * compile, and the `<button>` branch reads it back off the forwarded props.\n */\ntype ButtonOnlyAttributes = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof React.HTMLAttributes<HTMLButtonElement> | 'type'\n>;\n\n/**\n * The set withheld from a non-button `Card.FooterItem` (`span`/`a`), keyed so\n * it stops compiling until a button attribute React adds is named here.\n */\nconst STRIP_FROM_NON_BUTTON: Readonly<\n Record<keyof ButtonOnlyAttributes, true>\n> = {\n disabled: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: true,\n formTarget: true,\n name: true,\n value: true,\n};\n\n/**\n * Props for the Card.FooterItem compound component.\n *\n * The anchor and button attributes arrive through `AnchorOnlyAttributes` and\n * `ButtonOnlyAttributes` at every `as`, and each set is forwarded only to its\n * own tag: `STRIP_FROM_NON_ANCHOR` and `STRIP_FROM_NON_BUTTON` above withhold\n * them from the others at runtime, since narrowing the type per `as` is\n * source-breaking (see `Level.Item`'s own note on #672).\n */\nexport interface CardFooterItemProps\n extends\n AnchorOnlyAttributes,\n ButtonOnlyAttributes,\n React.HTMLAttributes<\n HTMLSpanElement | HTMLAnchorElement | HTMLButtonElement\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Element type to render (default: `span`). Bulma's own card markup uses `a`. */\n as?: 'span' | 'a' | 'button';\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Footer item content (link, button, text, etc.). */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the Card.Header.Title compound component.\n */\nexport interface CardHeaderTitleProps\n extends\n React.HTMLAttributes<\n HTMLDivElement | HTMLParagraphElement | HTMLHeadingElement\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Element type to render (default: `div`). Bulma's own card markup uses `p`; a heading suits a title that should read as one. */\n as?: 'div' | 'p' | 'h2' | 'h3' | 'h4';\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Title text content. */\n children?: React.ReactNode;\n /** Whether to center the title text. */\n centered?: boolean;\n}\n\n/**\n * Props for the Card.Header.Icon compound component.\n * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a header icon inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.\n * @extraProp {string} [aria-label='more options'] - Accessible name. Pass your own to replace it. An empty one, or a spread carrying `'aria-label': undefined`, keeps the default rather than leaving the button unnamed.\n */\nexport interface CardHeaderIconProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Bulma color modifier (text color helper). */\n color?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Text color helper; wins over `color` when both are set. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Additional CSS classes. */\n className?: string;\n /** Icon content (e.g. an icon element). */\n children?: React.ReactNode;\n}\n\n/**\n * Card header compound component. Wraps children in a `.card-header` element.\n *\n * @function\n * @param {CardHeaderProps} props - Props for the CardHeader component.\n * @returns {JSX.Element} The rendered card header.\n */\nconst CardHeader: React.FC<CardHeaderProps> = ({\n className,\n children,\n centered,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { classPrefix } = useConfig();\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Check if children contains a CardHeaderTitle component\n const hasHeaderTitle = React.Children.toArray(children).some(\n child =>\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n child.type === CardHeaderTitle\n );\n\n const headerClasses = usePrefixedClassNames('card-header');\n\n return (\n <header\n className={classNames(headerClasses, bulmaHelperClasses, className)}\n {...rest}\n >\n {hasHeaderTitle ? (\n children\n ) : (\n <div\n className={classNames(\n prefixedClassNames(classPrefix, 'card-header-title', {\n 'is-centered': centered,\n }),\n className\n )}\n >\n {children}\n </div>\n )}\n </header>\n );\n};\n\n/**\n * Card header title compound component. Renders a `.card-header-title` element.\n *\n * @function\n * @param {CardHeaderTitleProps} props - Props for the CardHeaderTitle component.\n * @returns {JSX.Element} The rendered card header title.\n */\nconst CardHeaderTitle: React.FC<CardHeaderTitleProps> = ({\n as = 'div',\n className,\n children,\n centered,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n const Tag = as;\n return (\n <Tag\n className={classNames(\n usePrefixedClassNames('card-header-title', {\n 'is-centered': centered,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </Tag>\n );\n};\n\n/**\n * Card header icon compound component. Renders a `.card-header-icon` button.\n *\n * @function\n * @param {CardHeaderIconProps} props - Props for the CardHeaderIcon component.\n * @returns {JSX.Element} The rendered card header icon button.\n */\nconst CardHeaderIcon: React.FC<CardHeaderIconProps> = ({\n className,\n children,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n return (\n <button\n className={classNames(\n usePrefixedClassNames('card-header-icon'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n // After the spread, reading through it: a key the spread carries with no\n // value would otherwise erase the default, leaving a nameless button\n // that submits the form around it. An empty label falls back too: the\n // button is drawn as an icon, so `''` would leave it unnamed. A caller's\n // own value still wins; `buttonType` says more.\n aria-label={rest['aria-label'] || 'more options'}\n type={buttonType(rest.type)}\n >\n {children}\n </button>\n );\n};\n\n/**\n * Card image compound component. Wraps children in a `.card-image` element.\n *\n * @function\n * @param {CardImageProps} props - Props for the CardImage component.\n * @returns {JSX.Element} The rendered card image container.\n */\nconst CardImage: React.FC<CardImageProps> = ({\n className,\n children,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n return (\n <div\n className={classNames(\n usePrefixedClassNames('card-image'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Card content compound component. Wraps children in a `.card-content` element.\n *\n * @function\n * @param {CardContentProps} props - Props for the CardContent component.\n * @returns {JSX.Element} The rendered card content container.\n */\nconst CardContent: React.FC<CardContentProps> = ({\n className,\n children,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n return (\n <div\n className={classNames(\n usePrefixedClassNames('card-content'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Card footer compound component. Wraps children in a `.card-footer` element.\n *\n * @function\n * @param {CardFooterProps} props - Props for the CardFooter component.\n * @returns {JSX.Element} The rendered card footer.\n */\nconst CardFooter: React.FC<CardFooterProps> = ({\n className,\n children,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n return (\n <footer\n className={classNames(\n usePrefixedClassNames('card-footer'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </footer>\n );\n};\n\n/**\n * Card footer item compound component. Wraps children in a `.card-footer-item` span.\n *\n * @function\n * @param {CardFooterItemProps} props - Props for the CardFooterItem component.\n * @returns {JSX.Element} The rendered card footer item.\n */\nconst CardFooterItem: React.FC<CardFooterItemProps> = ({\n as = 'span',\n className,\n children,\n color,\n bgColor,\n textColor,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n backgroundColor: bgColor,\n ...props,\n });\n const itemClasses = classNames(\n usePrefixedClassNames('card-footer-item'),\n bulmaHelperClasses,\n className\n );\n\n // The anchor's own attributes reach an `<a>` and nothing else, and the button's a\n // `<button>` — `STRIP_FROM_NON_ANCHOR` above names the anchor set and why `type`\n // stays while `rel` is added, and `STRIP_FROM_NON_BUTTON` the button set.\n if (as === 'a') {\n return (\n <a className={itemClasses} {...omitAttrs(rest, STRIP_FROM_NON_BUTTON)}>\n {children}\n </a>\n );\n }\n\n const forwarded = omitAttrs(rest, STRIP_FROM_NON_ANCHOR);\n\n if (as === 'button') {\n return (\n <button\n className={itemClasses}\n {...forwarded}\n // A footer item button must not submit an enclosing form by default —\n // `<button>` defaults to `type=\"submit\"`, and a Save/Cancel action row\n // sitting in a form is the common case this `as` exists for.\n //\n // A MISSING `type` is not the only way that default arrives: `type` is\n // typed here as the `<a>` MIME string (`STRIP_FROM_NON_ANCHOR` above\n // says why it is not withheld), so `as=\"button\" type=\"text/html\"`\n // compiles, and HTML's INVALID-value default for a button's `type` is\n // submit too. `buttonType` keeps `button`, `submit` and `reset` and\n // turns anything else into `button`.\n type={buttonType((forwarded as { type?: string }).type)}\n >\n {children}\n </button>\n );\n }\n\n return (\n <span\n className={itemClasses}\n {...omitAttrs(forwarded, STRIP_FROM_NON_BUTTON)}\n >\n {children}\n </span>\n );\n};\n\n// Attach nested Title and Icon components to CardHeader\nconst CardHeaderCompound = withSubComponents(CardHeader, {\n Title: CardHeaderTitle,\n Icon: CardHeaderIcon,\n});\n\n/** Card component with Header, Image, Content, Footer, and FooterItem sub-components. */\nexport const Card = withSubComponents(\n CardComponent,\n {\n Header: CardHeaderCompound,\n Image: CardImage,\n Content: CardContent,\n Footer: CardFooter,\n FooterItem: CardFooterItem,\n },\n 'Card'\n);\n"],"names":["_jsxs","_jsx","STRIP_FROM_NON_ANCHOR"],"mappings":";;;;;;;;;;;AAsEA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