@allxsmith/bestax-bulma 5.26.6 → 5.27.1
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 +89 -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 +87 -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 +76 -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 +87 -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 +153 -0
- package/dist/esm/form/Field.js.map +1 -0
- package/dist/esm/form/File.js +109 -0
- package/dist/esm/form/File.js.map +1 -0
- package/dist/esm/form/FormContext.js +170 -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 +199 -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 +91 -0
- package/dist/esm/form/Radios.js.map +1 -0
- package/dist/esm/form/Rate.js +279 -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 +459 -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 +352 -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 +83 -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 +54 -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 +821 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +115 -16845
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Tabs.d.ts +25 -3
- package/dist/types/elements/Icon.d.ts +10 -7
- package/dist/types/form/DateInputBase.d.ts +8 -6
- package/dist/types/form/DateRangeInput.d.ts +91 -0
- package/dist/types/form/DateRangeInputBase.d.ts +172 -0
- package/dist/types/form/DateTimeInputBase.d.ts +10 -6
- package/dist/types/form/File.d.ts +18 -5
- package/dist/types/form/FormContext.d.ts +11 -0
- package/dist/types/form/TimeInputBase.d.ts +1 -1
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +1 -0
- package/dist/types/form/_pickerInternals/dateUtils.d.ts +7 -0
- package/dist/types/form/_pickerInternals/formatters.d.ts +14 -0
- package/dist/types/form/_pickerInternals/pickerTypes.d.ts +13 -0
- package/dist/types/form/_pickerInternals/useSegmentedEntry.d.ts +12 -3
- package/dist/types/index.d.ts +4 -0
- package/dist/types-cjs/components/Tabs.d.ts +25 -3
- package/dist/types-cjs/elements/Icon.d.ts +10 -7
- package/dist/types-cjs/form/DateInputBase.d.ts +8 -6
- package/dist/types-cjs/form/DateRangeInput.d.ts +91 -0
- package/dist/types-cjs/form/DateRangeInputBase.d.ts +172 -0
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +10 -6
- package/dist/types-cjs/form/File.d.ts +18 -5
- package/dist/types-cjs/form/FormContext.d.ts +11 -0
- package/dist/types-cjs/form/TimeInputBase.d.ts +1 -1
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +1 -0
- package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +7 -0
- package/dist/types-cjs/form/_pickerInternals/formatters.d.ts +14 -0
- package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +13 -0
- package/dist/types-cjs/form/_pickerInternals/useSegmentedEntry.d.ts +12 -3
- package/dist/types-cjs/index.d.ts +4 -0
- 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/components/_tabs.scss +44 -0
- package/src/scss/form/_dateinput.scss +87 -8
- package/src/scss/form/_daterangeinput.scss +63 -0
- package/src/scss/form/_datetimeinput.scss +7 -2
- package/src/scss/form/_file.scss +37 -0
- package/src/scss/form/_index.scss +2 -0
- package/src/scss/form/_picker-popover.scss +1 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Strong.js","sources":["../../../src/elements/Strong.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Strong component.\n */\nexport interface StrongProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Content to render inside the strong element. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Strong` component renders a styled `<strong>` element with Bulma helper class integration.\n *\n * @function\n * @param {StrongProps} props - Props for the Strong component.\n * @returns {JSX.Element} The rendered strong element.\n */\nexport const Strong: React.FC<StrongProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const strongClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <strong className={strongClasses || undefined} {...rest}>\n {children}\n </strong>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAyBA;;;;;;AAMG;AACI,MAAM,MAAM,GAA0B,CAAC,EAC5C,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE7E,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EAAQ,SAAS,EAAE,aAAa,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EACpD,QAAQ,EAAA,CACF;AAEb;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 validSubTitleSizes = ['1', '2', '3', '4', '5', '6'];
|
|
7
|
+
const validSubTitleElements = [
|
|
8
|
+
'h1',
|
|
9
|
+
'h2',
|
|
10
|
+
'h3',
|
|
11
|
+
'h4',
|
|
12
|
+
'h5',
|
|
13
|
+
'h6',
|
|
14
|
+
'p',
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* The `SubTitle` component renders a Bulma-styled subtitle (secondary heading), supporting sizes `1-6` and rendering as any heading or paragraph element (`h1-h6`, `p`).
|
|
18
|
+
*
|
|
19
|
+
* @function
|
|
20
|
+
* @param {SubTitleProps} props - Props for the SubTitle component.
|
|
21
|
+
* @returns {JSX.Element} The rendered subtitle element.
|
|
22
|
+
* @see {@link https://bulma.io/documentation/elements/title/#subtitle | Bulma Subtitle documentation}
|
|
23
|
+
*/
|
|
24
|
+
const SubTitle = ({ className, size, as = 'h1', hasSkeleton, textColor, bgColor, children, ...props }) => {
|
|
25
|
+
/**
|
|
26
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
27
|
+
*/
|
|
28
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
29
|
+
color: textColor,
|
|
30
|
+
backgroundColor: bgColor,
|
|
31
|
+
...props,
|
|
32
|
+
});
|
|
33
|
+
// Validate 'as' prop at runtime
|
|
34
|
+
const element = validSubTitleElements.includes(as) ? as : 'h1';
|
|
35
|
+
// Validate 'size' prop at runtime (numeric sizes normalize to strings)
|
|
36
|
+
const normalized = size == null ? undefined : String(size);
|
|
37
|
+
const validSize = normalized && validSubTitleSizes.includes(normalized)
|
|
38
|
+
? normalized
|
|
39
|
+
: undefined;
|
|
40
|
+
const bulmaClasses = usePrefixedClassNames('subtitle', {
|
|
41
|
+
[`is-${validSize}`]: validSize,
|
|
42
|
+
'has-skeleton': hasSkeleton,
|
|
43
|
+
});
|
|
44
|
+
const subTitleClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
45
|
+
// Determine the tag based on 'element' and 'validSize'
|
|
46
|
+
const Tag = element === 'p' ? 'p' : validSize ? `h${validSize}` : element;
|
|
47
|
+
return (jsx(Tag, { className: subTitleClasses, ...rest, children: children }));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { SubTitle };
|
|
51
|
+
//# sourceMappingURL=SubTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubTitle.js","sources":["../../../src/elements/SubTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\nconst validSubTitleSizes = ['1', '2', '3', '4', '5', '6'] as const;\n/**\n * Valid size values for the SubTitle component (Bulma subtitle sizes): `'1'`–`'6'` as a string or number (`3` and `'3'` are equivalent).\n */\nexport type SubTitleSize =\n '1' | '2' | '3' | '4' | '5' | '6' | 1 | 2 | 3 | 4 | 5 | 6;\n\nconst validSubTitleElements = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'p',\n] as const;\n/**\n * Valid HTML elements for the SubTitle component.\n */\nexport type SubTitleElement = (typeof validSubTitleElements)[number];\n\n/**\n * Props for the SubTitle component.\n * @extraProp {boolean} [skeleton] - Applies the `is-skeleton` class to the entire component.\n */\nexport interface SubTitleProps\n extends\n Omit<\n React.HTMLAttributes<HTMLHeadingElement | HTMLParagraphElement>,\n 'color'\n >,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Size of the subtitle (Bulma sizes `1`-`6`, as a string or number). */\n size?: SubTitleSize;\n /** HTML element to render as (h1-h6 or p). */\n as?: SubTitleElement;\n /** Applies the `has-skeleton` class to part of the content. */\n hasSkeleton?: boolean;\n /** Subtitle content. */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * The `SubTitle` component renders a Bulma-styled subtitle (secondary heading), supporting sizes `1-6` and rendering as any heading or paragraph element (`h1-h6`, `p`).\n *\n * @function\n * @param {SubTitleProps} props - Props for the SubTitle component.\n * @returns {JSX.Element} The rendered subtitle element.\n * @see {@link https://bulma.io/documentation/elements/title/#subtitle | Bulma Subtitle documentation}\n */\nexport const SubTitle: React.FC<SubTitleProps> = ({\n className,\n size,\n as = 'h1',\n hasSkeleton,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Validate 'as' prop at runtime\n const element = validSubTitleElements.includes(as) ? as : 'h1';\n\n // Validate 'size' prop at runtime (numeric sizes normalize to strings)\n const normalized = size == null ? undefined : String(size);\n const validSize =\n normalized && (validSubTitleSizes as readonly string[]).includes(normalized)\n ? (normalized as (typeof validSubTitleSizes)[number])\n : undefined;\n\n const bulmaClasses = usePrefixedClassNames('subtitle', {\n [`is-${validSize}`]: validSize,\n 'has-skeleton': hasSkeleton,\n });\n\n const subTitleClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n // Determine the tag based on 'element' and 'validSize'\n const Tag: React.ElementType =\n element === 'p' ? 'p' : validSize ? `h${validSize}` : element;\n\n return (\n <Tag className={subTitleClasses} {...rest}>\n {children}\n </Tag>\n );\n};\n\nexport default SubTitle;\n"],"names":["_jsx"],"mappings":";;;;;AAQA,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU;AAOlE,MAAM,qBAAqB,GAAG;IAC5B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;CACK;AAiCV;;;;;;;AAOG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAChD,SAAS,EACT,IAAI,EACJ,EAAE,GAAG,IAAI,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;AAGF,IAAA,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;;AAG9D,IAAA,MAAM,UAAU,GAAG,IAAI,IAAI,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1D,MAAM,SAAS,GACb,UAAU,IAAK,kBAAwC,CAAC,QAAQ,CAAC,UAAU;AACzE,UAAG;UACD,SAAS;AAEf,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,UAAU,EAAE;AACrD,QAAA,CAAC,CAAA,GAAA,EAAM,SAAS,CAAA,CAAE,GAAG,SAAS;AAC9B,QAAA,cAAc,EAAE,WAAW;AAC5B,KAAA,CAAC;IAEF,MAAM,eAAe,GAAG,UAAU,CAChC,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;;IAGD,MAAM,GAAG,GACP,OAAO,KAAK,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,CAAA,CAAA,EAAI,SAAS,EAAE,GAAG,OAAO;AAE/D,IAAA,QACEA,GAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,eAAe,EAAA,GAAM,IAAI,EAAA,QAAA,EACtC,QAAQ,EAAA,CACL;AAEV;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { withSubComponents } from '../helpers/withSubComponents.js';
|
|
5
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
6
|
+
import { Thead } from './Thead.js';
|
|
7
|
+
import { Tbody } from './Tbody.js';
|
|
8
|
+
import { Tfoot } from './Tfoot.js';
|
|
9
|
+
import { Tr } from './Tr.js';
|
|
10
|
+
import { Th } from './Th.js';
|
|
11
|
+
import { Td } from './Td.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `Table` component and its subcomponents provide a highly composable, Bulma-styled table system for React.
|
|
15
|
+
*
|
|
16
|
+
* @function
|
|
17
|
+
* @param {TableProps} props - Props for the Table component.
|
|
18
|
+
* @returns {JSX.Element} The rendered table element.
|
|
19
|
+
* @see {@link https://bulma.io/documentation/elements/table/ | Bulma Table documentation}
|
|
20
|
+
*/
|
|
21
|
+
const TableComponent = ({ className, isBordered, isStriped, isNarrow, isHoverable, isFullwidth, isFullWidth, isResponsive, children, ...props }) => {
|
|
22
|
+
/**
|
|
23
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
24
|
+
*/
|
|
25
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
26
|
+
const bulmaClasses = usePrefixedClassNames('table', {
|
|
27
|
+
'is-bordered': isBordered,
|
|
28
|
+
'is-striped': isStriped,
|
|
29
|
+
'is-narrow': isNarrow,
|
|
30
|
+
'is-hoverable': isHoverable,
|
|
31
|
+
'is-fullwidth': isFullwidth ?? isFullWidth,
|
|
32
|
+
});
|
|
33
|
+
const containerClass = usePrefixedClassNames('table-container');
|
|
34
|
+
const tableClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
35
|
+
const tableElement = (jsx("table", { className: tableClasses, ...rest, children: children }));
|
|
36
|
+
if (isResponsive) {
|
|
37
|
+
return jsx("div", { className: containerClass, children: tableElement });
|
|
38
|
+
}
|
|
39
|
+
return tableElement;
|
|
40
|
+
};
|
|
41
|
+
const Table = withSubComponents(TableComponent, {
|
|
42
|
+
Thead,
|
|
43
|
+
Tbody,
|
|
44
|
+
Tfoot,
|
|
45
|
+
Tr,
|
|
46
|
+
Th,
|
|
47
|
+
Td,
|
|
48
|
+
}, 'Table');
|
|
49
|
+
|
|
50
|
+
export { Table };
|
|
51
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../src/elements/Table.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { Thead } from './Thead';\nimport { Tbody } from './Tbody';\nimport { Tfoot } from './Tfoot';\nimport { Tr } from './Tr';\nimport { Th } from './Th';\nimport { Td } from './Td';\n\n/**\n * Props for the Table component.\n */\nexport interface TableProps\n extends\n Omit<React.TableHTMLAttributes<HTMLTableElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Adds borders to all cells. */\n isBordered?: boolean;\n /** Adds zebra-striping to rows. */\n isStriped?: boolean;\n /** Makes the table more compact by cutting cell padding in half. */\n isNarrow?: boolean;\n /** Adds a hover effect on rows. */\n isHoverable?: boolean;\n /** Makes the table span the full width of its parent. */\n isFullwidth?: boolean;\n /** Makes the table span the full width of its parent. @deprecated Use `isFullwidth` instead — `isFullwidth` wins if both are set. */\n isFullWidth?: boolean;\n /** Makes the table horizontally scrollable on small screens. */\n isResponsive?: boolean;\n /** Table content (should use subcomponents). */\n children?: React.ReactNode;\n}\n\n/**\n * The `Table` component and its subcomponents provide a highly composable, Bulma-styled table system for React.\n *\n * @function\n * @param {TableProps} props - Props for the Table component.\n * @returns {JSX.Element} The rendered table element.\n * @see {@link https://bulma.io/documentation/elements/table/ | Bulma Table documentation}\n */\nconst TableComponent: React.FC<TableProps> = ({\n className,\n isBordered,\n isStriped,\n isNarrow,\n isHoverable,\n isFullwidth,\n isFullWidth,\n isResponsive,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const bulmaClasses = usePrefixedClassNames('table', {\n 'is-bordered': isBordered,\n 'is-striped': isStriped,\n 'is-narrow': isNarrow,\n 'is-hoverable': isHoverable,\n 'is-fullwidth': isFullwidth ?? isFullWidth,\n });\n\n const containerClass = usePrefixedClassNames('table-container');\n const tableClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n const tableElement = (\n <table className={tableClasses} {...rest}>\n {children}\n </table>\n );\n\n if (isResponsive) {\n return <div className={containerClass}>{tableElement}</div>;\n }\n\n return tableElement;\n};\n\nexport const Table = withSubComponents(\n TableComponent,\n {\n Thead,\n Tbody,\n Tfoot,\n Tr,\n Th,\n Td,\n },\n 'Table'\n);\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;AAyCA;;;;;;;AAOG;AACH,MAAM,cAAc,GAAyB,CAAC,EAC5C,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;AAElE,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,EAAE;AAClD,QAAA,aAAa,EAAE,UAAU;AACzB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,WAAW,EAAE,QAAQ;AACrB,QAAA,cAAc,EAAE,WAAW;QAC3B,cAAc,EAAE,WAAW,IAAI,WAAW;AAC3C,KAAA,CAAC;AAEF,IAAA,MAAM,cAAc,GAAG,qBAAqB,CAAC,iBAAiB,CAAC;IAC/D,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE5E,IAAA,MAAM,YAAY,IAChBA,GAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAE,YAAY,EAAA,GAAM,IAAI,EAAA,QAAA,EACrC,QAAQ,EAAA,CACH,CACT;IAED,IAAI,YAAY,EAAE;AAChB,QAAA,OAAOA,aAAK,SAAS,EAAE,cAAc,EAAA,QAAA,EAAG,YAAY,GAAO;IAC7D;AAEA,IAAA,OAAO,YAAY;AACrB,CAAC;AAEM,MAAM,KAAK,GAAG,iBAAiB,CACpC,cAAc,EACd;IACE,KAAK;IACL,KAAK;IACL,KAAK;IACL,EAAE;IACF,EAAE;IACF,EAAE;CACH,EACD,OAAO;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
import { buttonType } from '../helpers/buttonType.js';
|
|
6
|
+
|
|
7
|
+
const validTagColors = [
|
|
8
|
+
'primary',
|
|
9
|
+
'link',
|
|
10
|
+
'info',
|
|
11
|
+
'success',
|
|
12
|
+
'warning',
|
|
13
|
+
'danger',
|
|
14
|
+
'black',
|
|
15
|
+
'dark',
|
|
16
|
+
'light',
|
|
17
|
+
'white',
|
|
18
|
+
];
|
|
19
|
+
const validTagSizes = ['normal', 'medium', 'large'];
|
|
20
|
+
/**
|
|
21
|
+
* The `Tag` component renders a Bulma-styled label or badge.
|
|
22
|
+
*
|
|
23
|
+
* @function
|
|
24
|
+
* @param {TagProps} props - Props for the Tag component.
|
|
25
|
+
* @returns {JSX.Element} The rendered tag element.
|
|
26
|
+
* @see {@link https://bulma.io/documentation/elements/tag/ | Bulma Tag documentation}
|
|
27
|
+
*/
|
|
28
|
+
const Tag = ({ className, color, size, isLight, isRounded, isDelete, isHoverable, onDelete, children, ...props }) => {
|
|
29
|
+
/**
|
|
30
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
31
|
+
*/
|
|
32
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
33
|
+
const bulmaClasses = usePrefixedClassNames('tag', {
|
|
34
|
+
[`is-${color}`]: color && validTagColors.includes(color),
|
|
35
|
+
[`is-${size}`]: size && size !== 'normal' && validTagSizes.includes(size),
|
|
36
|
+
'is-light': isLight,
|
|
37
|
+
'is-rounded': isRounded,
|
|
38
|
+
'is-delete': isDelete,
|
|
39
|
+
'is-hoverable': isHoverable,
|
|
40
|
+
});
|
|
41
|
+
const tagClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
42
|
+
if (isDelete) {
|
|
43
|
+
return (jsx("button", { className: tagClasses, onClick: onDelete, ...rest, "aria-label": rest['aria-label'] || 'Delete tag', type: buttonType(rest.type) }));
|
|
44
|
+
}
|
|
45
|
+
return (jsx("span", { className: tagClasses, ...rest, children: children }));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { Tag };
|
|
49
|
+
//# sourceMappingURL=Tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../src/elements/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { buttonType } from '../helpers/buttonType';\n\nconst validTagColors = [\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/**\n * Valid color values for the Tag component (Bulma tag colors).\n */\nexport type TagColor = (typeof validTagColors)[number];\n\nconst validTagSizes = ['normal', 'medium', 'large'] as const;\n/**\n * Valid size values for the Tag component (Bulma tag sizes).\n */\nexport type TagSize = (typeof validTagSizes)[number];\n\n/**\n * Props for the Tag component.\n */\nexport interface TagProps\n extends\n Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'>,\n Omit<BulmaClassesProps, 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Bulma color modifier for the tag. */\n color?: TagColor;\n /** Tag size. */\n size?: TagSize;\n /** Use the light color variant. */\n isLight?: boolean;\n /** Renders a rounded tag. */\n isRounded?: boolean;\n /**\n * Renders a delete-style tag (delete button). The button renders\n * `type=\"button\"`, so it does not submit a form around it, and is named\n * \"Delete tag\" unless you pass an `aria-label`. An empty one, or a spread\n * carrying `'aria-label': undefined`, keeps that name rather than leaving\n * the button unnamed.\n */\n isDelete?: boolean;\n /** Adds hover effect to the tag. */\n isHoverable?: boolean;\n /** Callback for delete tag/button. */\n onDelete?: () => void;\n /** Tag content. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Tag` component renders a Bulma-styled label or badge.\n *\n * @function\n * @param {TagProps} props - Props for the Tag component.\n * @returns {JSX.Element} The rendered tag element.\n * @see {@link https://bulma.io/documentation/elements/tag/ | Bulma Tag documentation}\n */\nexport const Tag: React.FC<TagProps> = ({\n className,\n color,\n size,\n isLight,\n isRounded,\n isDelete,\n isHoverable,\n onDelete,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const bulmaClasses = usePrefixedClassNames('tag', {\n [`is-${color}`]: color && validTagColors.includes(color),\n [`is-${size}`]: size && size !== 'normal' && validTagSizes.includes(size),\n 'is-light': isLight,\n 'is-rounded': isRounded,\n 'is-delete': isDelete,\n 'is-hoverable': isHoverable,\n });\n\n const tagClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n if (isDelete) {\n return (\n <button\n className={tagClasses}\n onClick={onDelete}\n {...rest}\n // After the spread, reading through it: a key the spread carries with\n // no value would otherwise erase the default, leaving a nameless\n // button that submits the form around it. An empty label falls back\n // too: the button is drawn as an icon, so `''` would leave it unnamed.\n // A caller's own value still wins; `buttonType` says more.\n aria-label={rest['aria-label'] || 'Delete tag'}\n type={buttonType((rest as { type?: unknown }).type)}\n />\n );\n }\n\n return (\n <span className={tagClasses} {...rest}>\n {children}\n </span>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAKA,MAAM,cAAc,GAAG;IACrB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;CACC;AAOV,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AAuC5D;;;;;;;AAOG;AACI,MAAM,GAAG,GAAuB,CAAC,EACtC,SAAS,EACT,KAAK,EACL,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;AAElE,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAChD,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;AACxD,QAAA,CAAC,MAAM,IAAI,CAAA,CAAE,GAAG,IAAI,IAAI,IAAI,KAAK,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC;AACzE,QAAA,UAAU,EAAE,OAAO;AACnB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,WAAW,EAAE,QAAQ;AACrB,QAAA,cAAc,EAAE,WAAW;AAC5B,KAAA,CAAC;IAEF,MAAM,UAAU,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;IAE1E,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,QAAQ,EAAA,GACb,IAAI,EAAA,YAAA,EAMI,IAAI,CAAC,YAAY,CAAC,IAAI,YAAY,EAC9C,IAAI,EAAE,UAAU,CAAE,IAA2B,CAAC,IAAI,CAAC,EAAA,CACnD;IAEN;IAEA,QACEA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,UAAU,EAAA,GAAM,IAAI,EAAA,QAAA,EAClC,QAAQ,EAAA,CACJ;AAEX;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { withSubComponents } from '../helpers/withSubComponents.js';
|
|
5
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
6
|
+
import { Tag } from './Tag.js';
|
|
7
|
+
|
|
8
|
+
const validTagsSizes = ['medium', 'large'];
|
|
9
|
+
/**
|
|
10
|
+
* The `Tags` component groups multiple `Tag` components together in a Bulma-styled container that wraps onto multiple lines by default.
|
|
11
|
+
*
|
|
12
|
+
* @function
|
|
13
|
+
* @param {TagsProps} props - Props for the Tags component.
|
|
14
|
+
* @returns {JSX.Element} The rendered tags container.
|
|
15
|
+
* @see {@link https://bulma.io/documentation/elements/tag/#list-of-tags | Bulma Tags documentation}
|
|
16
|
+
*/
|
|
17
|
+
const TagsComponent = ({ className, hasAddons,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- accepted for backwards compatibility, deprecated no-op (no `are-multiline` CSS ships)
|
|
19
|
+
isMultiline, size, children, ...props }) => {
|
|
20
|
+
/**
|
|
21
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
22
|
+
*/
|
|
23
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
24
|
+
const bulmaClasses = usePrefixedClassNames('tags', {
|
|
25
|
+
'has-addons': hasAddons,
|
|
26
|
+
[`are-${size}`]: size && validTagsSizes.includes(size),
|
|
27
|
+
});
|
|
28
|
+
const tagsClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
29
|
+
return (jsx("div", { className: tagsClasses, ...rest, children: children }));
|
|
30
|
+
};
|
|
31
|
+
const Tags = withSubComponents(TagsComponent, { Tag }, 'Tags');
|
|
32
|
+
|
|
33
|
+
export { Tags };
|
|
34
|
+
//# sourceMappingURL=Tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tags.js","sources":["../../../src/elements/Tags.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { Tag } from './Tag';\n\nconst validTagsSizes = ['medium', 'large'] as const;\n/**\n * Valid size values for the Tags component (Bulma tag group sizes).\n */\nexport type TagsSize = (typeof validTagsSizes)[number];\n\n/**\n * Props for the Tags component.\n */\nexport interface TagsProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color' | 'size'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Group tags together as add-ons (no spacing). */\n hasAddons?: boolean;\n /**\n * No-op retained for backwards compatibility.\n *\n * @deprecated Bulma's `.tags` wraps by default (no shipped `are-multiline`\n * CSS exists for it) — this prop has never had a visual effect and will be\n * removed in the next major version.\n */\n isMultiline?: boolean;\n /** Size of every tag in the group. */\n size?: TagsSize;\n /** Tag elements to render inside the container. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Tags` component groups multiple `Tag` components together in a Bulma-styled container that wraps onto multiple lines by default.\n *\n * @function\n * @param {TagsProps} props - Props for the Tags component.\n * @returns {JSX.Element} The rendered tags container.\n * @see {@link https://bulma.io/documentation/elements/tag/#list-of-tags | Bulma Tags documentation}\n */\nconst TagsComponent: React.FC<TagsProps> = ({\n className,\n hasAddons,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- accepted for backwards compatibility, deprecated no-op (no `are-multiline` CSS ships)\n isMultiline,\n size,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const bulmaClasses = usePrefixedClassNames('tags', {\n 'has-addons': hasAddons,\n [`are-${size}`]: size && validTagsSizes.includes(size),\n });\n\n const tagsClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <div className={tagsClasses} {...rest}>\n {children}\n </div>\n );\n};\n\nexport const Tags = withSubComponents(TagsComponent, { Tag }, 'Tags');\n"],"names":["_jsx"],"mappings":";;;;;;;AAMA,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AA+BnD;;;;;;;AAOG;AACH,MAAM,aAAa,GAAwB,CAAC,EAC1C,SAAS,EACT,SAAS;AACT;AACA,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;AAElE,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,EAAE;AACjD,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,CAAC,CAAA,IAAA,EAAO,IAAI,CAAA,CAAE,GAAG,IAAI,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC;AACvD,KAAA,CAAC;IAEF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;IAE3E,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,WAAW,EAAA,GAAM,IAAI,EAAA,QAAA,EAClC,QAAQ,EAAA,CACL;AAEV,CAAC;AAEM,MAAM,IAAI,GAAG,iBAAiB,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,EAAE,MAAM;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { classNames } from '../helpers/classNames.js';
|
|
4
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Tbody component for rendering a styled Bulma table body.
|
|
8
|
+
*
|
|
9
|
+
* Supports Bulma helper classes for additional styling.
|
|
10
|
+
*
|
|
11
|
+
* @function
|
|
12
|
+
* @param {TbodyProps} props - Props for the Tbody component.
|
|
13
|
+
* @returns {JSX.Element} The rendered table body element.
|
|
14
|
+
* @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}
|
|
15
|
+
*/
|
|
16
|
+
const Tbody = ({ className, children, ...props }) => {
|
|
17
|
+
/**
|
|
18
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
19
|
+
*/
|
|
20
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
21
|
+
const tbodyClasses = classNames(className, bulmaHelperClasses);
|
|
22
|
+
return (jsx("tbody", { className: tbodyClasses || undefined, ...rest, children: children }));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { Tbody };
|
|
26
|
+
//# sourceMappingURL=Tbody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tbody.js","sources":["../../../src/elements/Tbody.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport classNames from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Tbody component.\n */\nexport interface TbodyProps\n extends\n Omit<React.HTMLAttributes<HTMLTableSectionElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Table body content (rows). */\n children?: React.ReactNode;\n}\n\n/**\n * Tbody component for rendering a styled Bulma table body.\n *\n * Supports Bulma helper classes for additional styling.\n *\n * @function\n * @param {TbodyProps} props - Props for the Tbody component.\n * @returns {JSX.Element} The rendered table body element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}\n */\nexport const Tbody: React.FC<TbodyProps> = ({\n className,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const tbodyClasses = classNames(className, bulmaHelperClasses);\n\n return (\n <tbody className={tbodyClasses || undefined} {...rest}>\n {children}\n </tbody>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAoBA;;;;;;;;;AASG;AACI,MAAM,KAAK,GAAyB,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;AAE9D,IAAA,QACEA,GAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAE,YAAY,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAClD,QAAQ,EAAA,CACH;AAEZ;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* The values the table `color` prop accepts, as a readonly tuple.
|
|
8
|
+
*
|
|
9
|
+
* `TableColor` is typed from it, and `Tr`, `Th` and `Td` all take a
|
|
10
|
+
* `TableColor`, so the tuple and those props list the same values. Map over
|
|
11
|
+
* it to build a color picker, or check a value that arrives at runtime before
|
|
12
|
+
* passing it in: the components add no color class for a value outside the
|
|
13
|
+
* tuple.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { Tr, Td, validTableColors } from '@allxsmith/bestax-bulma';
|
|
17
|
+
*
|
|
18
|
+
* <Tr>
|
|
19
|
+
* {validTableColors.map(color => (
|
|
20
|
+
* <Td key={color} color={color}>
|
|
21
|
+
* {color}
|
|
22
|
+
* </Td>
|
|
23
|
+
* ))}
|
|
24
|
+
* </Tr>;
|
|
25
|
+
*/
|
|
26
|
+
const validTableColors = [
|
|
27
|
+
'primary',
|
|
28
|
+
'link',
|
|
29
|
+
'info',
|
|
30
|
+
'success',
|
|
31
|
+
'warning',
|
|
32
|
+
'danger',
|
|
33
|
+
'black',
|
|
34
|
+
'dark',
|
|
35
|
+
'light',
|
|
36
|
+
'white',
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Td component for rendering a styled Bulma table cell.
|
|
40
|
+
*
|
|
41
|
+
* Supports Bulma color modifiers and helper classes for additional styling.
|
|
42
|
+
*
|
|
43
|
+
* @function
|
|
44
|
+
* @param {TdProps} props - Props for the Td component.
|
|
45
|
+
* @returns {JSX.Element} The rendered table cell element.
|
|
46
|
+
* @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}
|
|
47
|
+
*/
|
|
48
|
+
const Td = ({ className, color, children, ...props }) => {
|
|
49
|
+
const colorClass = usePrefixedClassNames('', {
|
|
50
|
+
[`is-${color}`]: color && validTableColors.includes(color),
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
54
|
+
*/
|
|
55
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
56
|
+
const tdClasses = classNames(colorClass, className, bulmaHelperClasses);
|
|
57
|
+
return (jsx("td", { className: tdClasses || undefined, ...rest, children: children }));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { Td, validTableColors };
|
|
61
|
+
//# sourceMappingURL=Td.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Td.js","sources":["../../../src/elements/Td.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\n/**\n * The values the table `color` prop accepts, as a readonly tuple.\n *\n * `TableColor` is typed from it, and `Tr`, `Th` and `Td` all take a\n * `TableColor`, so the tuple and those props list the same values. Map over\n * it to build a color picker, or check a value that arrives at runtime before\n * passing it in: the components add no color class for a value outside the\n * tuple.\n *\n * @example\n * import { Tr, Td, validTableColors } from '@allxsmith/bestax-bulma';\n *\n * <Tr>\n * {validTableColors.map(color => (\n * <Td key={color} color={color}>\n * {color}\n * </Td>\n * ))}\n * </Tr>;\n */\nexport const validTableColors = [\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/**\n * The color values `Tr`, `Th` and `Td` accept, typed from `validTableColors`.\n */\nexport type TableColor = (typeof validTableColors)[number];\n\n/**\n * Props for the Td component.\n */\nexport interface TdProps\n extends\n Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Bulma color modifier for the table cell. */\n color?: TableColor;\n /** Table cell content. */\n children?: React.ReactNode;\n}\n\n/**\n * Td component for rendering a styled Bulma table cell.\n *\n * Supports Bulma color modifiers and helper classes for additional styling.\n *\n * @function\n * @param {TdProps} props - Props for the Td component.\n * @returns {JSX.Element} The rendered table cell element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}\n */\nexport const Td: React.FC<TdProps> = ({\n className,\n color,\n children,\n ...props\n}) => {\n const colorClass = usePrefixedClassNames('', {\n [`is-${color}`]: color && validTableColors.includes(color),\n });\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const tdClasses = classNames(colorClass, className, bulmaHelperClasses);\n\n return (\n <td className={tdClasses || undefined} {...rest}>\n {children}\n </td>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;AAmBG;AACI,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;;AAuBT;;;;;;;;;AASG;AACI,MAAM,EAAE,GAAsB,CAAC,EACpC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,UAAU,GAAG,qBAAqB,CAAC,EAAE,EAAE;AAC3C,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC3D,KAAA,CAAC;AAEF;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,EAAE,SAAS,EAAE,kBAAkB,CAAC;AAEvE,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,SAAS,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAC5C,QAAQ,EAAA,CACN;AAET;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { classNames } from '../helpers/classNames.js';
|
|
4
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Tfoot component for rendering a styled Bulma table footer.
|
|
8
|
+
*
|
|
9
|
+
* Supports Bulma helper classes for additional styling.
|
|
10
|
+
*
|
|
11
|
+
* @function
|
|
12
|
+
* @param {TfootProps} props - Props for the Tfoot component.
|
|
13
|
+
* @returns {JSX.Element} The rendered table footer element.
|
|
14
|
+
* @see {@link https://bulma.io/documentation/elements/table/#table-footer | Bulma Table documentation}
|
|
15
|
+
*/
|
|
16
|
+
const Tfoot = ({ className, children, ...props }) => {
|
|
17
|
+
/**
|
|
18
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
19
|
+
*/
|
|
20
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
21
|
+
const tfootClasses = classNames(className, bulmaHelperClasses);
|
|
22
|
+
return (jsx("tfoot", { className: tfootClasses || undefined, ...rest, children: children }));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { Tfoot };
|
|
26
|
+
//# sourceMappingURL=Tfoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tfoot.js","sources":["../../../src/elements/Tfoot.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport classNames from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Tfoot component.\n */\nexport interface TfootProps\n extends\n Omit<React.HTMLAttributes<HTMLTableSectionElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Table footer content (rows). */\n children?: React.ReactNode;\n}\n\n/**\n * Tfoot component for rendering a styled Bulma table footer.\n *\n * Supports Bulma helper classes for additional styling.\n *\n * @function\n * @param {TfootProps} props - Props for the Tfoot component.\n * @returns {JSX.Element} The rendered table footer element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-footer | Bulma Table documentation}\n */\nexport const Tfoot: React.FC<TfootProps> = ({\n className,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const tfootClasses = classNames(className, bulmaHelperClasses);\n\n return (\n <tfoot className={tfootClasses || undefined} {...rest}>\n {children}\n </tfoot>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAoBA;;;;;;;;;AASG;AACI,MAAM,KAAK,GAAyB,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;AAE9D,IAAA,QACEA,GAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAE,YAAY,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAClD,QAAQ,EAAA,CACH;AAEZ;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { validTableColors } from './Td.js';
|
|
6
|
+
|
|
7
|
+
const validAlignments = ['left', 'right', 'centered'];
|
|
8
|
+
/**
|
|
9
|
+
* Th component for rendering a styled Bulma table header cell.
|
|
10
|
+
*
|
|
11
|
+
* Supports alignment, width, and color modifiers.
|
|
12
|
+
*
|
|
13
|
+
* @function
|
|
14
|
+
* @param {ThProps} props - Props for the Th component.
|
|
15
|
+
* @returns {JSX.Element} The rendered table header cell element.
|
|
16
|
+
* @see {@link https://bulma.io/documentation/elements/table/#table-head | Bulma Table documentation}
|
|
17
|
+
*/
|
|
18
|
+
const Th = ({ className, isAligned, width, color, children, ...props }) => {
|
|
19
|
+
const bulmaClasses = usePrefixedClassNames('', {
|
|
20
|
+
[`has-text-${isAligned}`]: isAligned && validAlignments.includes(isAligned),
|
|
21
|
+
[`is-${color}`]: color && validTableColors.includes(color),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
25
|
+
*/
|
|
26
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
27
|
+
const thClasses = classNames(bulmaClasses, className, bulmaHelperClasses);
|
|
28
|
+
return (jsx("th", { className: thClasses || undefined, style: width
|
|
29
|
+
? { width: typeof width === 'number' ? `${width}px` : width }
|
|
30
|
+
: undefined, ...rest, children: children }));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { Th };
|
|
34
|
+
//# sourceMappingURL=Th.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Th.js","sources":["../../../src/elements/Th.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { TableColor, validTableColors } from './Td';\n\nconst validAlignments = ['left', 'right', 'centered'] as const;\n/**\n * Valid alignment values for the Th component.\n */\ntype TableAlignment = (typeof validAlignments)[number];\n\n/**\n * Props for the Th component.\n */\nexport interface ThProps\n extends\n Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text alignment for the header cell ('left', 'right', 'centered'). */\n isAligned?: TableAlignment;\n /** Width of the header cell (e.g., '100px' or 100). */\n width?: string | number;\n /** Bulma color modifier for the header cell. */\n color?: TableColor;\n /** Table header cell content. */\n children?: React.ReactNode;\n}\n\n/**\n * Th component for rendering a styled Bulma table header cell.\n *\n * Supports alignment, width, and color modifiers.\n *\n * @function\n * @param {ThProps} props - Props for the Th component.\n * @returns {JSX.Element} The rendered table header cell element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-head | Bulma Table documentation}\n */\nexport const Th: React.FC<ThProps> = ({\n className,\n isAligned,\n width,\n color,\n children,\n ...props\n}) => {\n const bulmaClasses = usePrefixedClassNames('', {\n [`has-text-${isAligned}`]: isAligned && validAlignments.includes(isAligned),\n [`is-${color}`]: color && validTableColors.includes(color),\n });\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const thClasses = classNames(bulmaClasses, className, bulmaHelperClasses);\n\n return (\n <th\n className={thClasses || undefined}\n style={\n width\n ? { width: typeof width === 'number' ? `${width}px` : width }\n : undefined\n }\n {...rest}\n >\n {children}\n </th>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAQA,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAU;AAyB9D;;;;;;;;;AASG;MACU,EAAE,GAAsB,CAAC,EACpC,SAAS,EACT,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,EAAE,EAAE;AAC7C,QAAA,CAAC,CAAA,SAAA,EAAY,SAAS,CAAA,CAAE,GAAG,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC3E,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC3D,KAAA,CAAC;AAEF;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC;IAEzE,QACEA,GAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,KAAK,EACH;AACE,cAAE,EAAE,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,GAAG,GAAG,KAAK,CAAA,EAAA,CAAI,GAAG,KAAK;cACzD,SAAS,EAAA,GAEX,IAAI,YAEP,QAAQ,EAAA,CACN;AAET;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { classNames } from '../helpers/classNames.js';
|
|
4
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Thead component for rendering a styled Bulma table header.
|
|
8
|
+
*
|
|
9
|
+
* Supports Bulma helper classes for additional styling.
|
|
10
|
+
*
|
|
11
|
+
* @function
|
|
12
|
+
* @param {TheadProps} props - Props for the Thead component.
|
|
13
|
+
* @returns {JSX.Element} The rendered table header element.
|
|
14
|
+
* @see {@link https://bulma.io/documentation/elements/table/#table-head | Bulma Table documentation}
|
|
15
|
+
*/
|
|
16
|
+
const Thead = ({ className, children, ...props }) => {
|
|
17
|
+
/**
|
|
18
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
19
|
+
*/
|
|
20
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
21
|
+
const theadClasses = classNames(className, bulmaHelperClasses);
|
|
22
|
+
return (jsx("thead", { className: theadClasses || undefined, ...rest, children: children }));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { Thead };
|
|
26
|
+
//# sourceMappingURL=Thead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thead.js","sources":["../../../src/elements/Thead.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport classNames from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\n/**\n * Props for the Thead component.\n */\nexport interface TheadProps\n extends\n Omit<React.HTMLAttributes<HTMLTableSectionElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Table header content (rows). */\n children?: React.ReactNode;\n}\n\n/**\n * Thead component for rendering a styled Bulma table header.\n *\n * Supports Bulma helper classes for additional styling.\n *\n * @function\n * @param {TheadProps} props - Props for the Thead component.\n * @returns {JSX.Element} The rendered table header element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-head | Bulma Table documentation}\n */\nexport const Thead: React.FC<TheadProps> = ({\n className,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const theadClasses = classNames(className, bulmaHelperClasses);\n\n return (\n <thead className={theadClasses || undefined} {...rest}>\n {children}\n </thead>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAoBA;;;;;;;;;AASG;AACI,MAAM,KAAK,GAAyB,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;AAE9D,IAAA,QACEA,GAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAE,YAAY,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAClD,QAAQ,EAAA,CACH;AAEZ;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 validTitleSizes = ['1', '2', '3', '4', '5', '6'];
|
|
7
|
+
const validTitleElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
|
|
8
|
+
/**
|
|
9
|
+
* The `Title` component renders a Bulma-styled title (heading), supporting sizes `1`-`6`, spacing, and rendering as any heading or paragraph element (`h1`-`h6`, `p`).
|
|
10
|
+
*
|
|
11
|
+
* @function
|
|
12
|
+
* @param {TitleProps} props - Props for the Title component.
|
|
13
|
+
* @returns {JSX.Element} The rendered title element.
|
|
14
|
+
* @see {@link https://bulma.io/documentation/elements/title/ | Bulma Title documentation}
|
|
15
|
+
*/
|
|
16
|
+
const Title = ({ className, size, isSpaced, as = 'h1', hasSkeleton, textColor, bgColor, children, ...props }) => {
|
|
17
|
+
/**
|
|
18
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
19
|
+
*/
|
|
20
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
21
|
+
color: textColor,
|
|
22
|
+
backgroundColor: bgColor,
|
|
23
|
+
...props,
|
|
24
|
+
});
|
|
25
|
+
// Validate 'as' prop at runtime
|
|
26
|
+
const element = validTitleElements.includes(as) ? as : 'h1';
|
|
27
|
+
// Validate 'size' prop at runtime (numeric sizes normalize to strings)
|
|
28
|
+
const normalized = size == null ? undefined : String(size);
|
|
29
|
+
const validSize = normalized && validTitleSizes.includes(normalized)
|
|
30
|
+
? normalized
|
|
31
|
+
: undefined;
|
|
32
|
+
const bulmaClasses = usePrefixedClassNames('title', {
|
|
33
|
+
[`is-${validSize}`]: validSize,
|
|
34
|
+
'is-spaced': isSpaced,
|
|
35
|
+
'has-skeleton': hasSkeleton,
|
|
36
|
+
});
|
|
37
|
+
const titleClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
38
|
+
// Determine the tag based on 'element' and 'validSize'
|
|
39
|
+
const Tag = element === 'p' ? 'p' : validSize ? `h${validSize}` : element;
|
|
40
|
+
return (jsx(Tag, { className: titleClasses, ...rest, children: children }));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { Title };
|
|
44
|
+
//# sourceMappingURL=Title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Title.js","sources":["../../../src/elements/Title.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\nconst validTitleSizes = ['1', '2', '3', '4', '5', '6'] as const;\n/**\n * Valid size values for the Title component (Bulma title sizes): `'1'`–`'6'` as a string or number (`3` and `'3'` are equivalent).\n */\nexport type TitleSize =\n '1' | '2' | '3' | '4' | '5' | '6' | 1 | 2 | 3 | 4 | 5 | 6;\n\nconst validTitleElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'] as const;\n/**\n * Valid HTML elements for the Title component.\n */\nexport type TitleElement = (typeof validTitleElements)[number];\n\n/**\n * Props for the Title component.\n * @extraProp {boolean} [skeleton] - Applies the `is-skeleton` class to the entire component.\n */\nexport interface TitleProps\n extends\n Omit<\n React.HTMLAttributes<HTMLHeadingElement | HTMLParagraphElement>,\n 'color'\n >,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Size of the title (Bulma sizes `1`-`6`, as a string or number). */\n size?: TitleSize;\n /** Adds margin below the title. */\n isSpaced?: boolean;\n /** HTML element to render as (h1-h6 or p). */\n as?: TitleElement;\n /** Applies the `has-skeleton` class to part of the content. */\n hasSkeleton?: boolean;\n /** Title content. */\n children?: React.ReactNode;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n}\n\n/**\n * The `Title` component renders a Bulma-styled title (heading), supporting sizes `1`-`6`, spacing, and rendering as any heading or paragraph element (`h1`-`h6`, `p`).\n *\n * @function\n * @param {TitleProps} props - Props for the Title component.\n * @returns {JSX.Element} The rendered title element.\n * @see {@link https://bulma.io/documentation/elements/title/ | Bulma Title documentation}\n */\nexport const Title: React.FC<TitleProps> = ({\n className,\n size,\n isSpaced,\n as = 'h1',\n hasSkeleton,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Validate 'as' prop at runtime\n const element = validTitleElements.includes(as) ? as : 'h1';\n\n // Validate 'size' prop at runtime (numeric sizes normalize to strings)\n const normalized = size == null ? undefined : String(size);\n const validSize =\n normalized && (validTitleSizes as readonly string[]).includes(normalized)\n ? (normalized as (typeof validTitleSizes)[number])\n : undefined;\n\n const bulmaClasses = usePrefixedClassNames('title', {\n [`is-${validSize}`]: validSize,\n 'is-spaced': isSpaced,\n 'has-skeleton': hasSkeleton,\n });\n\n const titleClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n // Determine the tag based on 'element' and 'validSize'\n const Tag: React.ElementType =\n element === 'p' ? 'p' : validSize ? `h${validSize}` : element;\n\n return (\n <Tag className={titleClasses} {...rest}>\n {children}\n </Tag>\n );\n};\n\nexport default Title;\n"],"names":["_jsx"],"mappings":";;;;;AAQA,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU;AAO/D,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAU;AAmC7E;;;;;;;AAOG;AACI,MAAM,KAAK,GAAyB,CAAC,EAC1C,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,EAAE,GAAG,IAAI,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;AAGF,IAAA,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;;AAG3D,IAAA,MAAM,UAAU,GAAG,IAAI,IAAI,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1D,MAAM,SAAS,GACb,UAAU,IAAK,eAAqC,CAAC,QAAQ,CAAC,UAAU;AACtE,UAAG;UACD,SAAS;AAEf,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,EAAE;AAClD,QAAA,CAAC,CAAA,GAAA,EAAM,SAAS,CAAA,CAAE,GAAG,SAAS;AAC9B,QAAA,WAAW,EAAE,QAAQ;AACrB,QAAA,cAAc,EAAE,WAAW;AAC5B,KAAA,CAAC;IAEF,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;;IAG5E,MAAM,GAAG,GACP,OAAO,KAAK,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,CAAA,CAAA,EAAI,SAAS,EAAE,GAAG,OAAO;AAE/D,IAAA,QACEA,GAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,YAAY,EAAA,GAAM,IAAI,EAAA,QAAA,EACnC,QAAQ,EAAA,CACL;AAEV;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
import { validTableColors } from './Td.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Tr component for rendering a styled Bulma table row.
|
|
9
|
+
*
|
|
10
|
+
* Supports the is-selected modifier and color modifiers.
|
|
11
|
+
*
|
|
12
|
+
* @function
|
|
13
|
+
* @param {TrProps} props - Props for the Tr component.
|
|
14
|
+
* @returns {JSX.Element} The rendered table row element.
|
|
15
|
+
* @see {@link https://bulma.io/documentation/elements/table/#table-row | Bulma Table documentation}
|
|
16
|
+
*/
|
|
17
|
+
const Tr = ({ className, isSelected, color, children, ...props }) => {
|
|
18
|
+
const bulmaClasses = usePrefixedClassNames('', {
|
|
19
|
+
'is-selected': isSelected,
|
|
20
|
+
[`is-${color}`]: color && validTableColors.includes(color),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
24
|
+
*/
|
|
25
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
26
|
+
const trClasses = classNames(bulmaClasses, className, bulmaHelperClasses);
|
|
27
|
+
return (jsx("tr", { className: trClasses || undefined, ...rest, children: children }));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { Tr };
|
|
31
|
+
//# sourceMappingURL=Tr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tr.js","sources":["../../../src/elements/Tr.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { TableColor, validTableColors } from './Td'; // Import TableColor from Td\n\n/**\n * Props for the Tr component.\n */\nexport interface TrProps\n extends\n Omit<React.HTMLAttributes<HTMLTableRowElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Whether the row is selected (adds Bulma's is-selected class). */\n isSelected?: boolean;\n /** Bulma color modifier for the table row. */\n color?: TableColor;\n /** Table row content (cells). */\n children?: React.ReactNode;\n}\n\n/**\n * Tr component for rendering a styled Bulma table row.\n *\n * Supports the is-selected modifier and color modifiers.\n *\n * @function\n * @param {TrProps} props - Props for the Tr component.\n * @returns {JSX.Element} The rendered table row element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-row | Bulma Table documentation}\n */\nexport const Tr: React.FC<TrProps> = ({\n className,\n isSelected,\n color,\n children,\n ...props\n}) => {\n const bulmaClasses = usePrefixedClassNames('', {\n 'is-selected': isSelected,\n [`is-${color}`]: color && validTableColors.includes(color),\n });\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const trClasses = classNames(bulmaClasses, className, bulmaHelperClasses);\n\n return (\n <tr className={trClasses || undefined} {...rest}>\n {children}\n </tr>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAyBA;;;;;;;;;AASG;AACI,MAAM,EAAE,GAAsB,CAAC,EACpC,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,EAAE,EAAE;AAC7C,QAAA,aAAa,EAAE,UAAU;AACzB,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC3D,KAAA,CAAC;AAEF;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC;AAEzE,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,SAAS,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAC5C,QAAQ,EAAA,CACN;AAET;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { withSubComponents } from '../helpers/withSubComponents.js';
|
|
5
|
+
import { ListItem } from './ListItem.js';
|
|
6
|
+
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The `UnorderedList` component renders a styled unordered list (`<ul>`) element with Bulma helper class integration.
|
|
10
|
+
*
|
|
11
|
+
* @function
|
|
12
|
+
* @param {UnorderedListProps} props - Props for the UnorderedList component.
|
|
13
|
+
* @returns {JSX.Element} The rendered ul element.
|
|
14
|
+
*/
|
|
15
|
+
const UnorderedListComponent = ({ className, textColor, bgColor, children, ...props }) => {
|
|
16
|
+
/**
|
|
17
|
+
* Generates Bulma helper classes and separates out remaining props.
|
|
18
|
+
*/
|
|
19
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
20
|
+
color: textColor,
|
|
21
|
+
backgroundColor: bgColor,
|
|
22
|
+
...props,
|
|
23
|
+
});
|
|
24
|
+
const bulmaClasses = usePrefixedClassNames();
|
|
25
|
+
const listClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
26
|
+
return (jsx("ul", { className: listClasses || undefined, ...rest, children: children }));
|
|
27
|
+
};
|
|
28
|
+
const UnorderedList = withSubComponents(UnorderedListComponent, { Item: ListItem }, 'UnorderedList');
|
|
29
|
+
|
|
30
|
+
export { UnorderedList };
|
|
31
|
+
//# sourceMappingURL=UnorderedList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnorderedList.js","sources":["../../../src/elements/UnorderedList.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport { ListItem } from './ListItem';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Props for the UnorderedList component.\n */\nexport interface UnorderedListProps\n extends\n React.HTMLAttributes<HTMLUListElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color helper. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** List items to render inside the list. */\n children?: React.ReactNode;\n}\n\n/**\n * The `UnorderedList` component renders a styled unordered list (`<ul>`) element with Bulma helper class integration.\n *\n * @function\n * @param {UnorderedListProps} props - Props for the UnorderedList component.\n * @returns {JSX.Element} The rendered ul element.\n */\nconst UnorderedListComponent: React.FC<UnorderedListProps> = ({\n className,\n textColor,\n bgColor,\n children,\n ...props\n}) => {\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n } as BulmaClassesProps & typeof props);\n\n const bulmaClasses = usePrefixedClassNames();\n const listClasses = classNames(bulmaClasses, bulmaHelperClasses, className);\n\n return (\n <ul className={listClasses || undefined} {...rest}>\n {children}\n </ul>\n );\n};\n\nexport const UnorderedList = withSubComponents(\n UnorderedListComponent,\n { Item: ListItem },\n 'UnorderedList'\n);\n"],"names":["_jsx"],"mappings":";;;;;;;AA2BA;;;;;;AAMG;AACH,MAAM,sBAAsB,GAAiC,CAAC,EAC5D,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AAC2B,KAAA,CAAC;AAEtC,IAAA,MAAM,YAAY,GAAG,qBAAqB,EAAE;IAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAE3E,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,WAAW,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAC9C,QAAQ,EAAA,CACN;AAET,CAAC;AAEM,MAAM,aAAa,GAAG,iBAAiB,CAC5C,sBAAsB,EACtB,EAAE,IAAI,EAAE,QAAQ,EAAE,EAClB,eAAe;;"}
|