@allxsmith/bestax-bulma 5.16.4 → 5.16.6
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/types-cjs/columns/Column.d.ts +68 -0
- package/dist/types-cjs/columns/Columns.d.ts +63 -0
- package/dist/types-cjs/components/Avatar.d.ts +91 -0
- package/dist/types-cjs/components/Avatars.d.ts +30 -0
- package/dist/types-cjs/components/Badge.d.ts +56 -0
- package/dist/types-cjs/components/Breadcrumb.d.ts +42 -0
- package/dist/types-cjs/components/Card.d.ts +166 -0
- package/dist/types-cjs/components/Carousel.d.ts +104 -0
- package/dist/types-cjs/components/Collapse.d.ts +69 -0
- package/dist/types-cjs/components/Dialog.d.ts +142 -0
- package/dist/types-cjs/components/Dropdown.d.ts +104 -0
- package/dist/types-cjs/components/Loading.d.ts +68 -0
- package/dist/types-cjs/components/Menu.d.ts +100 -0
- package/dist/types-cjs/components/Message.d.ts +51 -0
- package/dist/types-cjs/components/Modal.d.ts +126 -0
- package/dist/types-cjs/components/Navbar.d.ts +302 -0
- package/dist/types-cjs/components/Pagination.d.ts +130 -0
- package/dist/types-cjs/components/Panel.d.ts +147 -0
- package/dist/types-cjs/components/Reveal.d.ts +47 -0
- package/dist/types-cjs/components/Sidebar.d.ts +76 -0
- package/dist/types-cjs/components/Steps.d.ts +101 -0
- package/dist/types-cjs/components/Tabs.d.ts +160 -0
- package/dist/types-cjs/components/Toast.d.ts +150 -0
- package/dist/types-cjs/components/Tooltip.d.ts +68 -0
- package/dist/types-cjs/elements/Block.d.ts +31 -0
- package/dist/types-cjs/elements/Box.d.ts +41 -0
- package/dist/types-cjs/elements/Button.d.ts +74 -0
- package/dist/types-cjs/elements/Buttons.d.ts +40 -0
- package/dist/types-cjs/elements/Code.d.ts +23 -0
- package/dist/types-cjs/elements/Content.d.ts +34 -0
- package/dist/types-cjs/elements/Delete.d.ts +38 -0
- package/dist/types-cjs/elements/Divider.d.ts +19 -0
- package/dist/types-cjs/elements/Emphasis.d.ts +23 -0
- package/dist/types-cjs/elements/Figure.d.ts +40 -0
- package/dist/types-cjs/elements/Icon.d.ts +138 -0
- package/dist/types-cjs/elements/IconText.d.ts +40 -0
- package/dist/types-cjs/elements/Image.d.ts +44 -0
- package/dist/types-cjs/elements/Link.d.ts +55 -0
- package/dist/types-cjs/elements/LinkButton.d.ts +57 -0
- package/dist/types-cjs/elements/ListItem.d.ts +24 -0
- package/dist/types-cjs/elements/Notification.d.ts +148 -0
- package/dist/types-cjs/elements/OrderedList.d.ts +21 -0
- package/dist/types-cjs/elements/Paragraph.d.ts +23 -0
- package/dist/types-cjs/elements/Pre.d.ts +23 -0
- package/dist/types-cjs/elements/Progress.d.ts +36 -0
- package/dist/types-cjs/elements/Skeleton.d.ts +30 -0
- package/dist/types-cjs/elements/Span.d.ts +23 -0
- package/dist/types-cjs/elements/Strong.d.ts +23 -0
- package/dist/types-cjs/elements/SubTitle.d.ts +41 -0
- package/dist/types-cjs/elements/Table.d.ts +36 -0
- package/dist/types-cjs/elements/Tag.d.ts +45 -0
- package/dist/types-cjs/elements/Tags.d.ts +32 -0
- package/dist/types-cjs/elements/Tbody.d.ts +25 -0
- package/dist/types-cjs/elements/Td.d.ts +33 -0
- package/dist/types-cjs/elements/Tfoot.d.ts +25 -0
- package/dist/types-cjs/elements/Th.d.ts +38 -0
- package/dist/types-cjs/elements/Thead.d.ts +25 -0
- package/dist/types-cjs/elements/Title.d.ts +43 -0
- package/dist/types-cjs/elements/Tr.d.ts +30 -0
- package/dist/types-cjs/elements/UnorderedList.d.ts +18 -0
- package/dist/types-cjs/elements/iconProps.d.ts +30 -0
- package/dist/types-cjs/form/Autocomplete.d.ts +114 -0
- package/dist/types-cjs/form/Checkbox.d.ts +47 -0
- package/dist/types-cjs/form/Checkboxes.d.ts +30 -0
- package/dist/types-cjs/form/Control.d.ts +68 -0
- package/dist/types-cjs/form/DateInput.d.ts +70 -0
- package/dist/types-cjs/form/DateInputBase.d.ts +91 -0
- package/dist/types-cjs/form/DateTimeInput.d.ts +68 -0
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +108 -0
- package/dist/types-cjs/form/Field.d.ts +101 -0
- package/dist/types-cjs/form/File.d.ts +52 -0
- package/dist/types-cjs/form/FormContext.d.ts +78 -0
- package/dist/types-cjs/form/Input.d.ts +72 -0
- package/dist/types-cjs/form/InputBase.d.ts +37 -0
- package/dist/types-cjs/form/Numberinput.d.ts +83 -0
- package/dist/types-cjs/form/Radio.d.ts +47 -0
- package/dist/types-cjs/form/Radios.d.ts +30 -0
- package/dist/types-cjs/form/Rate.d.ts +99 -0
- package/dist/types-cjs/form/Select.d.ts +58 -0
- package/dist/types-cjs/form/SelectBase.d.ts +45 -0
- package/dist/types-cjs/form/Slider.d.ts +141 -0
- package/dist/types-cjs/form/Switch.d.ts +67 -0
- package/dist/types-cjs/form/Taginput.d.ts +140 -0
- package/dist/types-cjs/form/TextArea.d.ts +52 -0
- package/dist/types-cjs/form/TextAreaBase.d.ts +43 -0
- package/dist/types-cjs/form/TimeInput.d.ts +66 -0
- package/dist/types-cjs/form/TimeInputBase.d.ts +95 -0
- package/dist/types-cjs/form/_pickerInternals/Calendar.d.ts +32 -0
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +20 -0
- package/dist/types-cjs/form/_pickerInternals/TimeWheels.d.ts +42 -0
- package/dist/types-cjs/form/_pickerInternals/audioTick.d.ts +50 -0
- package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +52 -0
- package/dist/types-cjs/form/_pickerInternals/formatters.d.ts +32 -0
- package/dist/types-cjs/form/_pickerInternals/haptics.d.ts +24 -0
- package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +39 -0
- package/dist/types-cjs/form/_pickerInternals/segmentMap.d.ts +68 -0
- package/dist/types-cjs/form/_pickerInternals/useFocusTrap.d.ts +7 -0
- package/dist/types-cjs/form/_pickerInternals/useNativeMobilePicker.d.ts +11 -0
- package/dist/types-cjs/form/_pickerInternals/useSegmentedEntry.d.ts +75 -0
- package/dist/types-cjs/form/fieldProps.d.ts +24 -0
- package/dist/types-cjs/form/useAutoLabelId.d.ts +51 -0
- package/dist/types-cjs/grid/Cell.d.ts +42 -0
- package/dist/types-cjs/grid/Grid.d.ts +59 -0
- package/dist/types-cjs/helpers/Config.d.ts +67 -0
- package/dist/types-cjs/helpers/Theme.d.ts +116 -0
- package/dist/types-cjs/helpers/anchorAttrs.d.ts +37 -0
- package/dist/types-cjs/helpers/bulmaClassHelpers.d.ts +197 -0
- package/dist/types-cjs/helpers/classNames.d.ts +55 -0
- package/dist/types-cjs/helpers/colorDeprecations.d.ts +17 -0
- package/dist/types-cjs/helpers/mergeBulmaStyles.d.ts +17 -0
- package/dist/types-cjs/helpers/polymorphic.d.ts +138 -0
- package/dist/types-cjs/helpers/portal.d.ts +15 -0
- package/dist/types-cjs/helpers/scrollLock.d.ts +9 -0
- package/dist/types-cjs/helpers/useBulmaClasses.d.ts +60 -0
- package/dist/types-cjs/helpers/useColorClasses.d.ts +69 -0
- package/dist/types-cjs/helpers/useFlexboxClasses.d.ts +46 -0
- package/dist/types-cjs/helpers/useIsHydrated.d.ts +12 -0
- package/dist/types-cjs/helpers/useOtherClasses.d.ts +43 -0
- package/dist/types-cjs/helpers/useSpacingClasses.d.ts +45 -0
- package/dist/types-cjs/helpers/useTypographyClasses.d.ts +51 -0
- package/dist/types-cjs/helpers/useVisibilityClasses.d.ts +43 -0
- package/dist/types-cjs/helpers/withSubComponents.d.ts +16 -0
- package/dist/types-cjs/index.d.ts +113 -0
- package/dist/types-cjs/layout/Container.d.ts +51 -0
- package/dist/types-cjs/layout/Footer.d.ts +39 -0
- package/dist/types-cjs/layout/Hero.d.ts +126 -0
- package/dist/types-cjs/layout/Level.d.ts +112 -0
- package/dist/types-cjs/layout/Media.d.ts +97 -0
- package/dist/types-cjs/layout/Section.d.ts +38 -0
- package/dist/types-cjs/package.json +3 -0
- package/dist/types-cjs/skill-examples/ExampleMeta.d.ts +15 -0
- package/dist/types-cjs/skill-examples/ProfileCard.d.ts +23 -0
- package/package.json +9 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type PolymorphicComponent } from '../helpers/polymorphic.js';
|
|
3
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Button component's own props — everything it adds on top of the
|
|
6
|
+
* attributes of whatever element `as` renders.
|
|
7
|
+
*/
|
|
8
|
+
export interface ButtonOwnProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {
|
|
9
|
+
/**
|
|
10
|
+
* Not accepted under this name. `useBulmaClasses` consumes any
|
|
11
|
+
* `backgroundColor` key before `rest` is spread, so a custom `as` target
|
|
12
|
+
* declaring one would never receive it. Use `bgColor`.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
backgroundColor?: never;
|
|
16
|
+
/** Bulma color variant for the button. `ghost` renders a link-like button; `text` renders a minimal text-only button. */
|
|
17
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'white' | 'light' | 'dark' | 'black' | 'text' | 'ghost';
|
|
18
|
+
/** Size of the button. */
|
|
19
|
+
size?: 'small' | 'normal' | 'medium' | 'large';
|
|
20
|
+
/** Applies a lighter color variant. */
|
|
21
|
+
isLight?: boolean;
|
|
22
|
+
/** Makes the button rounded. */
|
|
23
|
+
isRounded?: boolean;
|
|
24
|
+
/** Displays a loading spinner. */
|
|
25
|
+
isLoading?: boolean;
|
|
26
|
+
/** Makes the button non-interactive. */
|
|
27
|
+
isStatic?: boolean;
|
|
28
|
+
/** Makes the button full-width. */
|
|
29
|
+
isFullwidth?: boolean;
|
|
30
|
+
/** Makes the button full-width. @deprecated Use `isFullwidth` instead — `isFullwidth` wins if both are set. */
|
|
31
|
+
isFullWidth?: boolean;
|
|
32
|
+
/** Applies outlined styling (requires color). */
|
|
33
|
+
isOutlined?: boolean;
|
|
34
|
+
/** Applies inverted styling (requires color). */
|
|
35
|
+
isInverted?: boolean;
|
|
36
|
+
/** Applies focused styling (visual only). */
|
|
37
|
+
isFocused?: boolean;
|
|
38
|
+
/** Applies active styling (visual only). */
|
|
39
|
+
isActive?: boolean;
|
|
40
|
+
/** Applies hovered styling (visual only). */
|
|
41
|
+
isHovered?: boolean;
|
|
42
|
+
/** Applies disabled styling. */
|
|
43
|
+
isDisabled?: boolean;
|
|
44
|
+
/** Custom class name. */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Text color helper. */
|
|
47
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
48
|
+
/** Background color helper. */
|
|
49
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
50
|
+
/** Button content. */
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Props for the Button component. The DOM attributes and the `ref` both follow
|
|
55
|
+
* `as`: with `as="a"` the anchor attributes are accepted, with `as="div"` they
|
|
56
|
+
* are not.
|
|
57
|
+
*
|
|
58
|
+
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
59
|
+
*/
|
|
60
|
+
export type ButtonProps<T extends React.ElementType = 'button'> = ButtonOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof ButtonOwnProps | 'as'> & {
|
|
61
|
+
/** Render as a `<button>`, `<a>`, or a custom component (e.g. a router `Link`). Defaults to `'button'`; anything else renders through the anchor path, which adds `href`/`target`/`rel` and withholds the submit-override attributes (`formAction` and friends) from an `<a>`. */
|
|
62
|
+
as?: T;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The `Button` component provides a flexible and highly customizable button for your Bulma React UI.
|
|
66
|
+
*
|
|
67
|
+
* @function
|
|
68
|
+
* @param {ButtonProps} props - Props for the Button component.
|
|
69
|
+
* @param {React.Ref} ref - Forwarded ref to the element `as` renders.
|
|
70
|
+
* @returns {JSX.Element} The rendered button, anchor, or custom element.
|
|
71
|
+
* @see {@link https://bulma.io/documentation/elements/button/ | Bulma Button documentation}
|
|
72
|
+
*/
|
|
73
|
+
export declare const Button: PolymorphicComponent<ButtonOwnProps, "button">;
|
|
74
|
+
export default Button;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
declare const validButtonsSizes: readonly ["small", "medium", "large"];
|
|
4
|
+
/**
|
|
5
|
+
* Valid size values for the Buttons component (Bulma button group sizes).
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonsSize = (typeof validButtonsSizes)[number];
|
|
8
|
+
/**
|
|
9
|
+
* Props for the Buttons component.
|
|
10
|
+
*/
|
|
11
|
+
interface ButtonsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'size'> {
|
|
12
|
+
/** Additional CSS classes to apply. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Text color helper for the button group. */
|
|
15
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
16
|
+
/**
|
|
17
|
+
* Text color alias: renders `has-text-<color>`, exactly like `textColor`.
|
|
18
|
+
* Not a filled variant (no `.buttons.is-<color>` CSS exists; color the
|
|
19
|
+
* individual `Button`s instead). Prefer `textColor`, which takes precedence
|
|
20
|
+
* when both are set; use `bgColor` for a colored surface.
|
|
21
|
+
*/
|
|
22
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
23
|
+
/** Background color helper for the button group. */
|
|
24
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
25
|
+
/** Center the group of buttons. */
|
|
26
|
+
isCentered?: boolean;
|
|
27
|
+
/** Align the group of buttons to the right. */
|
|
28
|
+
isRight?: boolean;
|
|
29
|
+
/** Group buttons together as addons (removes spacing between them). */
|
|
30
|
+
hasAddons?: boolean;
|
|
31
|
+
/** Size of the button group. */
|
|
32
|
+
size?: ButtonsSize;
|
|
33
|
+
/** The button elements to render inside the group. */
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export declare const Buttons: React.FC<ButtonsProps> & {
|
|
37
|
+
Button: import("../index.js").PolymorphicComponent<import("./Button.js").ButtonOwnProps, "button">;
|
|
38
|
+
LinkButton: import("../index.js").PolymorphicComponent<import("./LinkButton.js").LinkButtonOwnProps, "button">;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Code component.
|
|
5
|
+
*/
|
|
6
|
+
export interface CodeProps extends React.HTMLAttributes<HTMLElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text color helper. */
|
|
10
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
/** Background color helper. */
|
|
12
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
13
|
+
/** Code content to render inside the element. */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The `Code` component renders a styled `<code>` element with Bulma helper class integration.
|
|
18
|
+
*
|
|
19
|
+
* @function
|
|
20
|
+
* @param {CodeProps} props - Props for the Code component.
|
|
21
|
+
* @returns {JSX.Element} The rendered code element.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Code: React.FC<CodeProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Content component.
|
|
5
|
+
*/
|
|
6
|
+
interface ContentProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text color helper (e.g., `'danger'` for `has-text-danger`). */
|
|
10
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
/**
|
|
12
|
+
* Text color alias: renders `has-text-<color>`, exactly like `textColor`.
|
|
13
|
+
* Not a filled variant (no `.content.is-<color>` CSS exists). Prefer
|
|
14
|
+
* `textColor`, which takes precedence when both are set; use `bgColor` for
|
|
15
|
+
* a colored surface.
|
|
16
|
+
*/
|
|
17
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
18
|
+
/** Background color helper (e.g., `'info'` for `has-background-info`). */
|
|
19
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
20
|
+
/** Size modifier for the content. */
|
|
21
|
+
size?: 'small' | 'normal' | 'medium' | 'large';
|
|
22
|
+
/** Content to be rendered inside the block. */
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The `Content` component applies Bulma’s typographic styles to its children, enhancing the appearance of HTML elements like paragraphs, headings, lists, and tables.
|
|
27
|
+
*
|
|
28
|
+
* @function
|
|
29
|
+
* @param {ContentProps} props - Props for the Content component.
|
|
30
|
+
* @returns {JSX.Element} The rendered content block.
|
|
31
|
+
* @see {@link https://bulma.io/documentation/elements/content/ | Bulma Content documentation}
|
|
32
|
+
*/
|
|
33
|
+
export declare const Content: React.FC<ContentProps>;
|
|
34
|
+
export default Content;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Delete component.
|
|
5
|
+
*/
|
|
6
|
+
interface DeleteProps extends React.HTMLAttributes<HTMLButtonElement>, BulmaClassesProps {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text color helper. */
|
|
10
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
/**
|
|
12
|
+
* Text color alias: renders `has-text-<color>`, exactly like `textColor`.
|
|
13
|
+
* Not a filled variant (no `.delete.is-<color>` CSS exists). Prefer
|
|
14
|
+
* `textColor`, which takes precedence when both are set; use `bgColor` for
|
|
15
|
+
* a colored surface.
|
|
16
|
+
*/
|
|
17
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
18
|
+
/** Background color helper. */
|
|
19
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
20
|
+
/** Click handler for the button. */
|
|
21
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
22
|
+
/** Size modifier for the delete button. */
|
|
23
|
+
size?: 'small' | 'medium' | 'large';
|
|
24
|
+
/** ARIA label for accessibility (default: 'Close'). */
|
|
25
|
+
ariaLabel?: string;
|
|
26
|
+
/** Whether the button is disabled (default: false). */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more.
|
|
31
|
+
*
|
|
32
|
+
* @function
|
|
33
|
+
* @param {DeleteProps} props - Props for the Delete component.
|
|
34
|
+
* @returns {JSX.Element} The rendered delete button.
|
|
35
|
+
* @see {@link https://bulma.io/documentation/elements/delete/ | Bulma Delete documentation}
|
|
36
|
+
*/
|
|
37
|
+
export declare const Delete: React.FC<DeleteProps>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Divider component.
|
|
5
|
+
*/
|
|
6
|
+
export interface DividerProps extends React.HTMLAttributes<HTMLHRElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Background color helper. */
|
|
10
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The `Divider` component renders a styled horizontal rule (`<hr>`) element with Bulma helper class integration.
|
|
14
|
+
*
|
|
15
|
+
* @function
|
|
16
|
+
* @param {DividerProps} props - Props for the Divider component.
|
|
17
|
+
* @returns {JSX.Element} The rendered hr element.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Divider: React.FC<DividerProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Emphasis component.
|
|
5
|
+
*/
|
|
6
|
+
export interface EmphasisProps extends React.HTMLAttributes<HTMLElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text color helper. */
|
|
10
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
/** Background color helper. */
|
|
12
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
13
|
+
/** Content to render inside the em element. */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The `Emphasis` component renders a styled `<em>` element with Bulma helper class integration.
|
|
18
|
+
*
|
|
19
|
+
* @function
|
|
20
|
+
* @param {EmphasisProps} props - Props for the Emphasis component.
|
|
21
|
+
* @returns {JSX.Element} The rendered em element.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Emphasis: React.FC<EmphasisProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the FigureCaption component.
|
|
5
|
+
*/
|
|
6
|
+
export interface FigureCaptionProps extends React.HTMLAttributes<HTMLElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text color (Bulma color, 'inherit', or 'current'). */
|
|
10
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
/** Background color (Bulma color, 'inherit', or 'current'). */
|
|
12
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
13
|
+
/** Content to be rendered inside the figcaption. */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Props for the Figure component.
|
|
18
|
+
*/
|
|
19
|
+
export interface FigureProps extends React.HTMLAttributes<HTMLElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
20
|
+
/** Additional CSS classes to apply. */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Text color helper. */
|
|
23
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
24
|
+
/** Background color helper. */
|
|
25
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
26
|
+
/** Content to render inside the figure. */
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Figure component with Caption subcomponent.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <Figure>
|
|
34
|
+
* <img src="image.jpg" alt="Description" />
|
|
35
|
+
* <Figure.Caption>Image caption text</Figure.Caption>
|
|
36
|
+
* </Figure>
|
|
37
|
+
*/
|
|
38
|
+
export declare const Figure: React.FC<FigureProps> & {
|
|
39
|
+
Caption: React.FC<FigureCaptionProps>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
interface IonIconProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
name?: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
icon?: unknown;
|
|
7
|
+
size?: string;
|
|
8
|
+
lazy?: boolean;
|
|
9
|
+
sanitize?: boolean;
|
|
10
|
+
color?: string;
|
|
11
|
+
flipRtl?: boolean;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
ariaHidden?: string;
|
|
14
|
+
}
|
|
15
|
+
declare module 'react' {
|
|
16
|
+
namespace JSX {
|
|
17
|
+
interface IntrinsicElements {
|
|
18
|
+
'ion-icon': IonIconProps;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
23
|
+
/**
|
|
24
|
+
* Shared props for the Icon component, independent of whether a class-based `name` or a
|
|
25
|
+
* custom `children` node supplies the glyph.
|
|
26
|
+
*/
|
|
27
|
+
interface IconBaseProps extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {
|
|
28
|
+
/** Additional CSS classes to apply. */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Text color helper. */
|
|
31
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
32
|
+
/** Bulma color modifier for the icon. */
|
|
33
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
34
|
+
/** Background color helper. */
|
|
35
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
36
|
+
/**
|
|
37
|
+
* Legacy icon class string (e.g. `'fas fa-star'`). Only its last segment is read, as the
|
|
38
|
+
* glyph name; the library still comes from `library` or `ConfigProvider`, so
|
|
39
|
+
* `'mdi mdi-rocket'` renders an `fa` class unless the effective library is already `mdi` —
|
|
40
|
+
* set it here or on the provider.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated Use `name` instead.
|
|
43
|
+
*/
|
|
44
|
+
icon?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The icon library to use ('fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols). Defaults to the value set in ConfigProvider or 'fa' if not configured. Ignored when `children` supplies the glyph instead of `name`.
|
|
47
|
+
* @defaultValue 'fa'
|
|
48
|
+
*/
|
|
49
|
+
library?: IconLibrary;
|
|
50
|
+
/** Icon style variant (e.g. `'solid'`, `'outlined'`, `'rounded'`). Ignored when `children` supplies the glyph instead of `name`. */
|
|
51
|
+
variant?: string;
|
|
52
|
+
/** Additional modifiers (e.g. `'fa-lg'`, `'fa-spin'`, `'is-size-1'`). Ignored when `children` supplies the glyph instead of `name`. */
|
|
53
|
+
features?: string | string[];
|
|
54
|
+
/**
|
|
55
|
+
* Additional modifiers in the older combined form, parsed into `variant` and `features`.
|
|
56
|
+
*
|
|
57
|
+
* @deprecated Use `variant` and `features` instead.
|
|
58
|
+
*/
|
|
59
|
+
libraryFeatures?: string | string[];
|
|
60
|
+
/** Size modifier for the icon container. */
|
|
61
|
+
size?: 'small' | 'medium' | 'large';
|
|
62
|
+
/**
|
|
63
|
+
* ARIA label for accessibility. Applied unconditionally to the container span, so an
|
|
64
|
+
* icon that never sets it still renders `aria-label="icon"`. For an icon-only control,
|
|
65
|
+
* put the real `aria-label` on the control (e.g. `Button`) and set `aria-hidden` here
|
|
66
|
+
* instead — otherwise the control's accessible name is announced as just "icon". For a
|
|
67
|
+
* decorative icon beside visible text, set `aria-hidden` here rather than leaving the
|
|
68
|
+
* default, so it doesn't add "icon" to the text's accessible name.
|
|
69
|
+
* @defaultValue 'icon'
|
|
70
|
+
*/
|
|
71
|
+
ariaLabel?: string;
|
|
72
|
+
/** Inline style object. */
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
/** Override the default `'icon'` container class (e.g., `'panel-icon'`). */
|
|
75
|
+
containerClassName?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Props for `Icon` rendering a class-based glyph from an icon library.
|
|
79
|
+
*/
|
|
80
|
+
export interface IconNameProps extends IconBaseProps {
|
|
81
|
+
/** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */
|
|
82
|
+
name: string;
|
|
83
|
+
/** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */
|
|
84
|
+
children?: never;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Props for `Icon` rendering a custom node (an inline SVG, a `react-icons` component, a Font
|
|
88
|
+
* Awesome React `<FontAwesomeIcon>`, …) in place of a class-based glyph.
|
|
89
|
+
*/
|
|
90
|
+
export interface IconChildrenProps extends IconBaseProps {
|
|
91
|
+
/** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */
|
|
92
|
+
name?: undefined;
|
|
93
|
+
/** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */
|
|
94
|
+
children: Exclude<React.ReactNode, undefined>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Props for `Icon` naming its glyph through the deprecated `icon` prop instead of `name`.
|
|
98
|
+
*
|
|
99
|
+
* The runtime has always accepted `icon` on its own — it strips a leading library prefix off
|
|
100
|
+
* the class string and falls through to the `name` path — but the type offered no member without
|
|
101
|
+
* a `name` or `children`, so every caller still on the deprecated prop got an error the
|
|
102
|
+
* package could not see — until #663 nothing here type-checked a test or a story, so the
|
|
103
|
+
* three `Icon.test.tsx` cases exercising this path proved the runtime and said nothing about
|
|
104
|
+
* the type. Declaring the path is the honest resolution: it is deprecated, not removed, and a
|
|
105
|
+
* deprecation that does not type-check is a removal announced only to whoever tries it.
|
|
106
|
+
*
|
|
107
|
+
* @deprecated Pass `name` instead. This member goes when `icon` does.
|
|
108
|
+
*/
|
|
109
|
+
export interface IconDeprecatedProps extends IconBaseProps {
|
|
110
|
+
/**
|
|
111
|
+
* Legacy icon class string (e.g. `'fas fa-star'`). Only its last segment is read, as the
|
|
112
|
+
* glyph name; the library still comes from `library` or `ConfigProvider`, so
|
|
113
|
+
* `'mdi mdi-rocket'` renders an `fa` class unless the effective library is already `mdi` —
|
|
114
|
+
* set it here or on the provider.
|
|
115
|
+
*
|
|
116
|
+
* @deprecated Use `name` instead.
|
|
117
|
+
*/
|
|
118
|
+
icon: string;
|
|
119
|
+
/** The icon name. Absent on this path — `icon` supplies the glyph. */
|
|
120
|
+
name?: undefined;
|
|
121
|
+
/** A custom node. Mutually exclusive with `icon`. */
|
|
122
|
+
children?: never;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Props for the Icon component — a discriminated union of a class-based `name`, a custom
|
|
126
|
+
* `children` node, and the deprecated `icon` class string.
|
|
127
|
+
*/
|
|
128
|
+
export type IconProps = IconNameProps | IconChildrenProps | IconDeprecatedProps;
|
|
129
|
+
/**
|
|
130
|
+
* The `Icon` component is a Bulma-styled wrapper for displaying icons from various libraries (Font Awesome, Material Design Icons, Ionicons, Google Material Icons, Material Symbols, etc.).
|
|
131
|
+
*
|
|
132
|
+
* @function
|
|
133
|
+
* @param {IconProps} props - Props for the Icon component.
|
|
134
|
+
* @returns {JSX.Element} The rendered icon element.
|
|
135
|
+
* @see {@link https://bulma.io/documentation/elements/icon/ | Bulma Icon documentation}
|
|
136
|
+
*/
|
|
137
|
+
export declare const Icon: React.FC<IconProps>;
|
|
138
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
import { IconProps } from './Icon.js';
|
|
4
|
+
/**
|
|
5
|
+
* Represents an item for the IconText component, containing icon props and optional text.
|
|
6
|
+
*/
|
|
7
|
+
interface IconTextItem {
|
|
8
|
+
/** Props for the Icon component, or a custom node (an inline SVG, a `react-icons` component, …) rendered in place of a class-based glyph. */
|
|
9
|
+
iconProps: IconProps | React.ReactNode;
|
|
10
|
+
/** Optional text to display next to the icon. */
|
|
11
|
+
text?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for the IconText component.
|
|
15
|
+
*/
|
|
16
|
+
interface IconTextProps extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {
|
|
17
|
+
/** Additional CSS classes to apply. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Text color helper. */
|
|
20
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
21
|
+
/**
|
|
22
|
+
* Text color alias: renders `has-text-<color>`, exactly like `textColor`.
|
|
23
|
+
* Not a filled variant (no `.icon-text.is-<color>` CSS exists). Prefer
|
|
24
|
+
* `textColor`, which takes precedence when both are set; use `bgColor` for
|
|
25
|
+
* a colored surface.
|
|
26
|
+
*/
|
|
27
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
28
|
+
/** Background color helper. */
|
|
29
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
30
|
+
/** Props for a single Icon component, or a custom node, for single icon mode. */
|
|
31
|
+
iconProps?: IconProps | React.ReactNode;
|
|
32
|
+
/** Text for a single icon (for single icon mode). */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
/** Array of icon/text pairs (for multiple icons mode). */
|
|
35
|
+
items?: IconTextItem[];
|
|
36
|
+
}
|
|
37
|
+
export declare const IconText: React.FC<IconTextProps> & {
|
|
38
|
+
Icon: React.FC<IconProps>;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Image component.
|
|
5
|
+
*/
|
|
6
|
+
export interface ImageProps extends React.HTMLAttributes<HTMLElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Additional CSS classes to apply. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text color helper for the container. */
|
|
10
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
11
|
+
/**
|
|
12
|
+
* Text color alias: renders `has-text-<color>`, exactly like `textColor`.
|
|
13
|
+
* Not a filled variant (no `.image.is-<color>` CSS exists). Prefer
|
|
14
|
+
* `textColor`, which takes precedence when both are set; use `bgColor` for
|
|
15
|
+
* a colored surface.
|
|
16
|
+
*/
|
|
17
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
18
|
+
/** Background color helper for the container. */
|
|
19
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
20
|
+
/** Fixed size or aspect ratio modifier for the image container. */
|
|
21
|
+
size?: '16x16' | '24x24' | '32x32' | '48x48' | '64x64' | '96x96' | '128x128' | 'square' | '1by1' | '5by4' | '4by3' | '3by2' | '5by3' | '16by9' | '2by1' | '3by1' | '4by5' | '3by4' | '2by3' | '3by5' | '9by16' | '1by2' | '1by3';
|
|
22
|
+
/** Renders the image with rounded corners. */
|
|
23
|
+
isRounded?: boolean;
|
|
24
|
+
/** Uses retina (2x) image source. */
|
|
25
|
+
isRetina?: boolean;
|
|
26
|
+
/** Image source URL. */
|
|
27
|
+
src?: string;
|
|
28
|
+
/** Alternate text for the image. */
|
|
29
|
+
alt?: string;
|
|
30
|
+
/** Arbitrary content (e.g., iframe, custom HTML) inside the image container. */
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
/** Container element tag. Defaults to `'figure'` when using aspect-ratio sizes, `'div'` otherwise. */
|
|
33
|
+
as?: 'figure' | 'div' | 'p';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The `Image` component wraps images, iframes, or custom content in a Bulma-styled container, supporting fixed sizes, aspect ratios, rounded corners, retina images, and all Bulma helper props for color and spacing.
|
|
37
|
+
*
|
|
38
|
+
* @function
|
|
39
|
+
* @param {ImageProps} props - Props for the Image component.
|
|
40
|
+
* @returns {JSX.Element} The rendered image element.
|
|
41
|
+
* @see {@link https://bulma.io/documentation/elements/image/ | Bulma Image documentation}
|
|
42
|
+
*/
|
|
43
|
+
export declare const Image: React.FC<ImageProps>;
|
|
44
|
+
export default Image;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PolymorphicComponent } from '../helpers/polymorphic.js';
|
|
3
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Link component's own props — everything it adds on top of the attributes
|
|
6
|
+
* of whatever element `as` renders.
|
|
7
|
+
*/
|
|
8
|
+
export interface LinkOwnProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
9
|
+
/**
|
|
10
|
+
* Not accepted. `color` on this component would be the deprecated
|
|
11
|
+
* presentational HTML attribute, and `useBulmaClasses` consumes any `color`
|
|
12
|
+
* key as a Bulma helper before the target could see it — so it is declared
|
|
13
|
+
* unavailable rather than silently eaten. Use `textColor` / `bgColor`.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
color?: never;
|
|
17
|
+
/**
|
|
18
|
+
* Not accepted under this name. `useBulmaClasses` consumes any
|
|
19
|
+
* `backgroundColor` key before `rest` is spread, so a custom `as` target
|
|
20
|
+
* declaring one would never receive it. Use `bgColor`.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
backgroundColor?: never;
|
|
24
|
+
/** Additional CSS classes to apply. */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Text color helper. */
|
|
27
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
28
|
+
/** Background color helper. */
|
|
29
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
30
|
+
/** Whether the link appears active. */
|
|
31
|
+
isActive?: boolean;
|
|
32
|
+
/** Content to render inside the link. */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Props for the Link component. The DOM attributes and the `ref` both follow
|
|
37
|
+
* `as`: with the default `'a'` the anchor attributes (`href`, `target`, `rel`)
|
|
38
|
+
* are accepted, with `as="span"` they are not.
|
|
39
|
+
*
|
|
40
|
+
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
41
|
+
*/
|
|
42
|
+
export type LinkProps<T extends React.ElementType = 'a'> = LinkOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof LinkOwnProps | 'as'> & {
|
|
43
|
+
/** Render as another intrinsic element (`'span'`, `'button'`) or a custom component (e.g. a router `Link`) instead of `<a>`. Defaults to `'a'`. */
|
|
44
|
+
as?: T;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The `Link` component renders a styled anchor (`<a>`) element with Bulma helper class integration.
|
|
48
|
+
*
|
|
49
|
+
* @function
|
|
50
|
+
* @param {LinkProps} props - Props for the Link component.
|
|
51
|
+
* @param {React.Ref} ref - Forwarded ref to the element `as` renders.
|
|
52
|
+
* @returns {JSX.Element} The rendered anchor, or whatever `as` names.
|
|
53
|
+
* @see {@link https://bulma.io/documentation/elements/content/ | Bulma Content documentation}
|
|
54
|
+
*/
|
|
55
|
+
export declare const Link: PolymorphicComponent<LinkOwnProps, "a">;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonOwnProps } from './Button.js';
|
|
3
|
+
import type { PolymorphicComponent } from '../helpers/polymorphic.js';
|
|
4
|
+
/**
|
|
5
|
+
* The LinkButton component's own props — everything it adds on top of the
|
|
6
|
+
* attributes of whatever element `as` renders.
|
|
7
|
+
*/
|
|
8
|
+
export interface LinkButtonOwnProps extends Omit<ButtonOwnProps, 'color' | 'isOutlined' | 'isInverted' | 'isLight'> {
|
|
9
|
+
/** Display mode. `text` has no underline and highlights its background on hover; `ghost` uses the default text color and underlines on hover; `underline` drops the button chrome entirely (transparent background and border) and underlines on hover or focus. */
|
|
10
|
+
variant?: 'text' | 'ghost' | 'underline';
|
|
11
|
+
/** Text color override for the button. */
|
|
12
|
+
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'white' | 'light' | 'dark' | 'black';
|
|
13
|
+
/**
|
|
14
|
+
* Not available on `LinkButton`, and declared so that a custom `as` target
|
|
15
|
+
* cannot reintroduce it. `Button` consumes these three for styling variants
|
|
16
|
+
* `LinkButton` does not offer, and strips them before rendering the target —
|
|
17
|
+
* so without this a component requiring one would type-check and silently
|
|
18
|
+
* never receive it.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
isOutlined?: never;
|
|
22
|
+
/** @internal Not available on `LinkButton` — see `isOutlined`. */
|
|
23
|
+
isInverted?: never;
|
|
24
|
+
/** @internal Not available on `LinkButton` — see `isOutlined`. */
|
|
25
|
+
isLight?: never;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props for the LinkButton component. The DOM attributes and the `ref` both
|
|
29
|
+
* follow `as`, exactly as they do on `Button`.
|
|
30
|
+
*
|
|
31
|
+
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
32
|
+
*/
|
|
33
|
+
export type LinkButtonProps<T extends React.ElementType = 'button'> = LinkButtonOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof LinkButtonOwnProps | 'as'> & {
|
|
34
|
+
/**
|
|
35
|
+
* Render as a `<button>`, `<a>`, or a custom component (e.g. a router `Link`).
|
|
36
|
+
* @defaultValue 'button'
|
|
37
|
+
*/
|
|
38
|
+
as?: T;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The `LinkButton` component renders a `<button>` that visually looks like text or a link.
|
|
42
|
+
*
|
|
43
|
+
* @function
|
|
44
|
+
* @param {LinkButtonProps} props - Props for the LinkButton component.
|
|
45
|
+
* @param {React.Ref} ref - Forwarded ref to the element `as` renders.
|
|
46
|
+
* @returns {JSX.Element} The rendered link-styled button element.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Text variant (default)
|
|
50
|
+
* <LinkButton onClick={handleClick}>Click me</LinkButton>
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Underline variant with color
|
|
54
|
+
* <LinkButton variant="underline" color="primary">Learn more</LinkButton>
|
|
55
|
+
*/
|
|
56
|
+
export declare const LinkButton: PolymorphicComponent<LinkButtonOwnProps, "button">;
|
|
57
|
+
export default LinkButton;
|