@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.
Files changed (133) hide show
  1. package/dist/types-cjs/columns/Column.d.ts +68 -0
  2. package/dist/types-cjs/columns/Columns.d.ts +63 -0
  3. package/dist/types-cjs/components/Avatar.d.ts +91 -0
  4. package/dist/types-cjs/components/Avatars.d.ts +30 -0
  5. package/dist/types-cjs/components/Badge.d.ts +56 -0
  6. package/dist/types-cjs/components/Breadcrumb.d.ts +42 -0
  7. package/dist/types-cjs/components/Card.d.ts +166 -0
  8. package/dist/types-cjs/components/Carousel.d.ts +104 -0
  9. package/dist/types-cjs/components/Collapse.d.ts +69 -0
  10. package/dist/types-cjs/components/Dialog.d.ts +142 -0
  11. package/dist/types-cjs/components/Dropdown.d.ts +104 -0
  12. package/dist/types-cjs/components/Loading.d.ts +68 -0
  13. package/dist/types-cjs/components/Menu.d.ts +100 -0
  14. package/dist/types-cjs/components/Message.d.ts +51 -0
  15. package/dist/types-cjs/components/Modal.d.ts +126 -0
  16. package/dist/types-cjs/components/Navbar.d.ts +302 -0
  17. package/dist/types-cjs/components/Pagination.d.ts +130 -0
  18. package/dist/types-cjs/components/Panel.d.ts +147 -0
  19. package/dist/types-cjs/components/Reveal.d.ts +47 -0
  20. package/dist/types-cjs/components/Sidebar.d.ts +76 -0
  21. package/dist/types-cjs/components/Steps.d.ts +101 -0
  22. package/dist/types-cjs/components/Tabs.d.ts +160 -0
  23. package/dist/types-cjs/components/Toast.d.ts +150 -0
  24. package/dist/types-cjs/components/Tooltip.d.ts +68 -0
  25. package/dist/types-cjs/elements/Block.d.ts +31 -0
  26. package/dist/types-cjs/elements/Box.d.ts +41 -0
  27. package/dist/types-cjs/elements/Button.d.ts +74 -0
  28. package/dist/types-cjs/elements/Buttons.d.ts +40 -0
  29. package/dist/types-cjs/elements/Code.d.ts +23 -0
  30. package/dist/types-cjs/elements/Content.d.ts +34 -0
  31. package/dist/types-cjs/elements/Delete.d.ts +38 -0
  32. package/dist/types-cjs/elements/Divider.d.ts +19 -0
  33. package/dist/types-cjs/elements/Emphasis.d.ts +23 -0
  34. package/dist/types-cjs/elements/Figure.d.ts +40 -0
  35. package/dist/types-cjs/elements/Icon.d.ts +138 -0
  36. package/dist/types-cjs/elements/IconText.d.ts +40 -0
  37. package/dist/types-cjs/elements/Image.d.ts +44 -0
  38. package/dist/types-cjs/elements/Link.d.ts +55 -0
  39. package/dist/types-cjs/elements/LinkButton.d.ts +57 -0
  40. package/dist/types-cjs/elements/ListItem.d.ts +24 -0
  41. package/dist/types-cjs/elements/Notification.d.ts +148 -0
  42. package/dist/types-cjs/elements/OrderedList.d.ts +21 -0
  43. package/dist/types-cjs/elements/Paragraph.d.ts +23 -0
  44. package/dist/types-cjs/elements/Pre.d.ts +23 -0
  45. package/dist/types-cjs/elements/Progress.d.ts +36 -0
  46. package/dist/types-cjs/elements/Skeleton.d.ts +30 -0
  47. package/dist/types-cjs/elements/Span.d.ts +23 -0
  48. package/dist/types-cjs/elements/Strong.d.ts +23 -0
  49. package/dist/types-cjs/elements/SubTitle.d.ts +41 -0
  50. package/dist/types-cjs/elements/Table.d.ts +36 -0
  51. package/dist/types-cjs/elements/Tag.d.ts +45 -0
  52. package/dist/types-cjs/elements/Tags.d.ts +32 -0
  53. package/dist/types-cjs/elements/Tbody.d.ts +25 -0
  54. package/dist/types-cjs/elements/Td.d.ts +33 -0
  55. package/dist/types-cjs/elements/Tfoot.d.ts +25 -0
  56. package/dist/types-cjs/elements/Th.d.ts +38 -0
  57. package/dist/types-cjs/elements/Thead.d.ts +25 -0
  58. package/dist/types-cjs/elements/Title.d.ts +43 -0
  59. package/dist/types-cjs/elements/Tr.d.ts +30 -0
  60. package/dist/types-cjs/elements/UnorderedList.d.ts +18 -0
  61. package/dist/types-cjs/elements/iconProps.d.ts +30 -0
  62. package/dist/types-cjs/form/Autocomplete.d.ts +114 -0
  63. package/dist/types-cjs/form/Checkbox.d.ts +47 -0
  64. package/dist/types-cjs/form/Checkboxes.d.ts +30 -0
  65. package/dist/types-cjs/form/Control.d.ts +68 -0
  66. package/dist/types-cjs/form/DateInput.d.ts +70 -0
  67. package/dist/types-cjs/form/DateInputBase.d.ts +91 -0
  68. package/dist/types-cjs/form/DateTimeInput.d.ts +68 -0
  69. package/dist/types-cjs/form/DateTimeInputBase.d.ts +108 -0
  70. package/dist/types-cjs/form/Field.d.ts +101 -0
  71. package/dist/types-cjs/form/File.d.ts +52 -0
  72. package/dist/types-cjs/form/FormContext.d.ts +78 -0
  73. package/dist/types-cjs/form/Input.d.ts +72 -0
  74. package/dist/types-cjs/form/InputBase.d.ts +37 -0
  75. package/dist/types-cjs/form/Numberinput.d.ts +83 -0
  76. package/dist/types-cjs/form/Radio.d.ts +47 -0
  77. package/dist/types-cjs/form/Radios.d.ts +30 -0
  78. package/dist/types-cjs/form/Rate.d.ts +99 -0
  79. package/dist/types-cjs/form/Select.d.ts +58 -0
  80. package/dist/types-cjs/form/SelectBase.d.ts +45 -0
  81. package/dist/types-cjs/form/Slider.d.ts +141 -0
  82. package/dist/types-cjs/form/Switch.d.ts +67 -0
  83. package/dist/types-cjs/form/Taginput.d.ts +140 -0
  84. package/dist/types-cjs/form/TextArea.d.ts +52 -0
  85. package/dist/types-cjs/form/TextAreaBase.d.ts +43 -0
  86. package/dist/types-cjs/form/TimeInput.d.ts +66 -0
  87. package/dist/types-cjs/form/TimeInputBase.d.ts +95 -0
  88. package/dist/types-cjs/form/_pickerInternals/Calendar.d.ts +32 -0
  89. package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +20 -0
  90. package/dist/types-cjs/form/_pickerInternals/TimeWheels.d.ts +42 -0
  91. package/dist/types-cjs/form/_pickerInternals/audioTick.d.ts +50 -0
  92. package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +52 -0
  93. package/dist/types-cjs/form/_pickerInternals/formatters.d.ts +32 -0
  94. package/dist/types-cjs/form/_pickerInternals/haptics.d.ts +24 -0
  95. package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +39 -0
  96. package/dist/types-cjs/form/_pickerInternals/segmentMap.d.ts +68 -0
  97. package/dist/types-cjs/form/_pickerInternals/useFocusTrap.d.ts +7 -0
  98. package/dist/types-cjs/form/_pickerInternals/useNativeMobilePicker.d.ts +11 -0
  99. package/dist/types-cjs/form/_pickerInternals/useSegmentedEntry.d.ts +75 -0
  100. package/dist/types-cjs/form/fieldProps.d.ts +24 -0
  101. package/dist/types-cjs/form/useAutoLabelId.d.ts +51 -0
  102. package/dist/types-cjs/grid/Cell.d.ts +42 -0
  103. package/dist/types-cjs/grid/Grid.d.ts +59 -0
  104. package/dist/types-cjs/helpers/Config.d.ts +67 -0
  105. package/dist/types-cjs/helpers/Theme.d.ts +116 -0
  106. package/dist/types-cjs/helpers/anchorAttrs.d.ts +37 -0
  107. package/dist/types-cjs/helpers/bulmaClassHelpers.d.ts +197 -0
  108. package/dist/types-cjs/helpers/classNames.d.ts +55 -0
  109. package/dist/types-cjs/helpers/colorDeprecations.d.ts +17 -0
  110. package/dist/types-cjs/helpers/mergeBulmaStyles.d.ts +17 -0
  111. package/dist/types-cjs/helpers/polymorphic.d.ts +138 -0
  112. package/dist/types-cjs/helpers/portal.d.ts +15 -0
  113. package/dist/types-cjs/helpers/scrollLock.d.ts +9 -0
  114. package/dist/types-cjs/helpers/useBulmaClasses.d.ts +60 -0
  115. package/dist/types-cjs/helpers/useColorClasses.d.ts +69 -0
  116. package/dist/types-cjs/helpers/useFlexboxClasses.d.ts +46 -0
  117. package/dist/types-cjs/helpers/useIsHydrated.d.ts +12 -0
  118. package/dist/types-cjs/helpers/useOtherClasses.d.ts +43 -0
  119. package/dist/types-cjs/helpers/useSpacingClasses.d.ts +45 -0
  120. package/dist/types-cjs/helpers/useTypographyClasses.d.ts +51 -0
  121. package/dist/types-cjs/helpers/useVisibilityClasses.d.ts +43 -0
  122. package/dist/types-cjs/helpers/withSubComponents.d.ts +16 -0
  123. package/dist/types-cjs/index.d.ts +113 -0
  124. package/dist/types-cjs/layout/Container.d.ts +51 -0
  125. package/dist/types-cjs/layout/Footer.d.ts +39 -0
  126. package/dist/types-cjs/layout/Hero.d.ts +126 -0
  127. package/dist/types-cjs/layout/Level.d.ts +112 -0
  128. package/dist/types-cjs/layout/Media.d.ts +97 -0
  129. package/dist/types-cjs/layout/Section.d.ts +38 -0
  130. package/dist/types-cjs/package.json +3 -0
  131. package/dist/types-cjs/skill-examples/ExampleMeta.d.ts +15 -0
  132. package/dist/types-cjs/skill-examples/ProfileCard.d.ts +23 -0
  133. package/package.json +9 -4
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
3
+ /**
4
+ * Props for the Collapse component.
5
+ * @extraProp {React.ReactNode} [children] - The collapsible content.
6
+ * @extraProp {string} [className] - Additional CSS classes.
7
+ */
8
+ export interface CollapseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
9
+ /** Controlled open state. If provided, component is controlled. */
10
+ open?: boolean;
11
+ /** Initial open state for uncontrolled usage. */
12
+ defaultOpen?: boolean;
13
+ /** Callback when collapse opens. */
14
+ onOpen?: () => void;
15
+ /** Callback when collapse closes. */
16
+ onClose?: () => void;
17
+ /** The clickable trigger element (header/button). */
18
+ trigger?: React.ReactNode;
19
+ /** Animation style, or `false` to disable. */
20
+ animation?: 'fade' | 'slide' | false;
21
+ /** Position of the trigger relative to content. */
22
+ position?: 'top' | 'bottom';
23
+ /**
24
+ * Custom aria id for accessibility.
25
+ * @defaultValue auto
26
+ */
27
+ ariaId?: string;
28
+ /** Adds a border around the collapse. */
29
+ bordered?: boolean;
30
+ /** Additional classes for the trigger wrapper. */
31
+ triggerClassName?: string;
32
+ /** Additional classes for the content wrapper. */
33
+ contentClassName?: string;
34
+ }
35
+ /**
36
+ * The `Collapse` component provides an expandable/collapsible content panel.
37
+ *
38
+ * @function
39
+ * @param {CollapseProps} props - Props for the Collapse component.
40
+ * @returns {JSX.Element} The rendered collapse component.
41
+ *
42
+ * @example
43
+ * // Basic uncontrolled collapse
44
+ * <Collapse trigger={<button>Click to toggle</button>}>
45
+ * <p>Collapsible content here</p>
46
+ * </Collapse>
47
+ *
48
+ * @example
49
+ * // Controlled collapse
50
+ * const [isOpen, setIsOpen] = useState(false);
51
+ * <Collapse
52
+ * open={isOpen}
53
+ * trigger={<button onClick={() => setIsOpen(!isOpen)}>Toggle</button>}
54
+ * >
55
+ * <p>Content</p>
56
+ * </Collapse>
57
+ *
58
+ * @example
59
+ * // With callbacks
60
+ * <Collapse
61
+ * trigger={<button>Toggle</button>}
62
+ * onOpen={() => console.log('Opened!')}
63
+ * onClose={() => console.log('Closed!')}
64
+ * >
65
+ * <p>Content</p>
66
+ * </Collapse>
67
+ */
68
+ export declare const Collapse: React.FC<CollapseProps>;
69
+ export default Collapse;
@@ -0,0 +1,142 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
3
+ /** Valid dialog type/color values. */
4
+ export type DialogType = 'default' | 'success' | 'danger' | 'warning' | 'info';
5
+ /**
6
+ * Props for the Dialog component.
7
+ * @extraProp {string} [className] - Additional CSS classes.
8
+ * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the dialog element.
9
+ */
10
+ export interface DialogProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color'> {
11
+ /** Whether the dialog is open (required). */
12
+ isOpen: boolean;
13
+ /** Dialog title. */
14
+ title?: string;
15
+ /** Dialog message/content (required). */
16
+ message: string | React.ReactNode;
17
+ /** The type/color of the dialog. Default: 'default'. */
18
+ type?: DialogType;
19
+ /** Text for confirm button. Default: 'OK'. */
20
+ confirmText?: string;
21
+ /** Text for cancel button. Default: 'Cancel'. */
22
+ cancelText?: string;
23
+ /** Callback when confirm button is clicked. */
24
+ onConfirm?: () => void;
25
+ /** Callback when cancel button is clicked or dismissed. */
26
+ onCancel?: () => void;
27
+ /** Whether to show cancel button. Default: true for confirm dialogs. */
28
+ showCancel?: boolean;
29
+ /** Whether the dialog can be dismissed. Default: true. */
30
+ canCancel?: boolean;
31
+ /** Focus cancel button instead of confirm. Default: false. */
32
+ focusCancel?: boolean;
33
+ /** Custom icon to display. */
34
+ icon?: React.ReactNode;
35
+ /**
36
+ * Renders the dialog into a portal target instead of inline. Forwarded to
37
+ * the underlying `Modal`; see its `portal` prop for the accepted values.
38
+ * @defaultValue false
39
+ */
40
+ portal?: boolean | string | HTMLElement;
41
+ }
42
+ /**
43
+ * The `Dialog` component provides ready-made confirm and alert dialogs, so a destructive action stays one `await dialog.confirm()` call away.
44
+ *
45
+ * @function
46
+ * @param {DialogProps} props - Props for the Dialog component.
47
+ * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the dialog element.
48
+ * @returns {JSX.Element | null} The rendered dialog component.
49
+ *
50
+ * @example
51
+ * // Alert dialog
52
+ * <Dialog
53
+ * isOpen={showAlert}
54
+ * title="Success"
55
+ * message="Operation completed successfully!"
56
+ * type="success"
57
+ * onConfirm={() => setShowAlert(false)}
58
+ * showCancel={false}
59
+ * />
60
+ *
61
+ * @example
62
+ * // Confirm dialog
63
+ * <Dialog
64
+ * isOpen={showConfirm}
65
+ * title="Delete Item?"
66
+ * message="This action cannot be undone."
67
+ * type="danger"
68
+ * confirmText="Delete"
69
+ * onConfirm={handleDelete}
70
+ * onCancel={() => setShowConfirm(false)}
71
+ * />
72
+ */
73
+ export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLDivElement>>;
74
+ /**
75
+ * Options for showing a programmatic alert dialog.
76
+ */
77
+ export interface AlertOptions {
78
+ /** Dialog title. */
79
+ title?: string;
80
+ /** Dialog message/content. */
81
+ message: string | React.ReactNode;
82
+ /** Dialog type/color. */
83
+ type?: DialogType;
84
+ /** Text for the confirm button. */
85
+ confirmText?: string;
86
+ /** Custom icon to display. */
87
+ icon?: React.ReactNode;
88
+ }
89
+ /**
90
+ * Options for showing a programmatic confirm dialog.
91
+ */
92
+ export interface ConfirmOptions extends AlertOptions {
93
+ /** Text for the cancel button. */
94
+ cancelText?: string;
95
+ /** Focus cancel button instead of confirm. */
96
+ focusCancel?: boolean;
97
+ }
98
+ /**
99
+ * Options for showing a programmatic prompt dialog.
100
+ */
101
+ export interface PromptOptions extends ConfirmOptions {
102
+ /** Input placeholder text. */
103
+ placeholder?: string;
104
+ /** Default input value. */
105
+ defaultValue?: string;
106
+ }
107
+ type DialogResolve = (value?: void | boolean | string) => void;
108
+ type DialogState = {
109
+ type: 'alert' | 'confirm' | 'prompt';
110
+ options: PromptOptions;
111
+ resolve: DialogResolve;
112
+ };
113
+ /**
114
+ * Programmatic dialog API for showing dialogs from anywhere.
115
+ */
116
+ export declare const dialog: {
117
+ /**
118
+ * Show an alert dialog. Returns a promise that resolves when closed.
119
+ */
120
+ alert: (options: AlertOptions | string) => Promise<void>;
121
+ /**
122
+ * Show a confirm dialog. Returns a promise that resolves to true/false.
123
+ */
124
+ confirm: (options: ConfirmOptions | string) => Promise<boolean>;
125
+ /**
126
+ * Close the current dialog.
127
+ */
128
+ close: (value?: string | boolean | void | undefined) => void;
129
+ /**
130
+ * Subscribe to dialog changes.
131
+ */
132
+ subscribe: (listener: (dialog: DialogState | null) => void) => (() => void);
133
+ };
134
+ /**
135
+ * DialogContainer component to render programmatic dialogs.
136
+ * Place this once at the root of your app.
137
+ *
138
+ * @function
139
+ * @returns {JSX.Element | null} The rendered dialog, or null if none is active.
140
+ */
141
+ export declare const DialogContainer: React.FC;
142
+ export default Dialog;
@@ -0,0 +1,104 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
3
+ import type { ConstrainedPolymorphicComponentWithoutRef } from '../helpers/polymorphic.js';
4
+ /**
5
+ * Checks if code is running in a browser environment.
6
+ * @param win - Window object.
7
+ * @param doc - Document object.
8
+ * @returns {boolean} True if in browser, false otherwise.
9
+ */
10
+ export declare const isBrowser: (win?: typeof window, doc?: typeof document) => boolean;
11
+ /**
12
+ * Props for the Dropdown component.
13
+ * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the root dropdown element.
14
+ */
15
+ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, keyof BulmaClassesProps>, BulmaClassesProps {
16
+ /** The dropdown button/trigger content. */
17
+ label: React.ReactNode;
18
+ /** Dropdown menu items and dividers. */
19
+ children: React.ReactNode;
20
+ /** Additional CSS classes for root. */
21
+ className?: string;
22
+ /** Additional CSS classes for the dropdown menu. */
23
+ menuClassName?: string;
24
+ /** Whether the dropdown is open (controlled). */
25
+ active?: boolean;
26
+ /** Dropdown menu opens upward. */
27
+ up?: boolean;
28
+ /** Menu is right-aligned. */
29
+ right?: boolean;
30
+ /** Open on hover instead of click. */
31
+ hoverable?: boolean;
32
+ /** Disables the dropdown trigger. */
33
+ disabled?: boolean;
34
+ /** Callback when dropdown active state changes. */
35
+ onActiveChange?: (active: boolean) => void;
36
+ /** Close dropdown when a menu item is clicked. */
37
+ closeOnClick?: boolean;
38
+ /** Root element ID (for aria-controls, etc). */
39
+ id?: string;
40
+ }
41
+ /**
42
+ * The elements a dropdown item may render as. Bulma's dropdown markup names
43
+ * these three and no others, so `as` is a closed set rather than an open
44
+ * `React.ElementType`.
45
+ */
46
+ export type DropdownItemElement = 'a' | 'div' | 'button';
47
+ /**
48
+ * The DropdownItem component's own props.
49
+ */
50
+ export interface DropdownItemOwnProps extends BulmaClassesProps {
51
+ /** Whether the item is active. */
52
+ active?: boolean;
53
+ /** Additional CSS classes. */
54
+ className?: string;
55
+ /** Marks the item as disabled; disabled items are skipped during keyboard navigation. Use with `as="button"` for a native disabled control, or pair with `aria-disabled` on a link. */
56
+ disabled?: boolean;
57
+ /** Item content. */
58
+ children?: React.ReactNode;
59
+ }
60
+ /**
61
+ * Props for the DropdownItem component. Everything the item does not own
62
+ * follows `as`: `href`, `target` and `rel` under the default `'a'`, `type` and
63
+ * `form` under `'button'`, and the shared HTML attributes under any of them.
64
+ *
65
+ * Pinning these to `React.HTMLAttributes<HTMLElement>` instead — which is what
66
+ * this type did before — rejected `href` on an anchor and `type` on a button,
67
+ * both of which have always worked at runtime. Same defect as #641, in the
68
+ * narrower shape a constrained `as` takes.
69
+ *
70
+ * **Name the tag you mean.** The type parameter defaults to the whole union, not
71
+ * to the rendered element, so bare `DropdownItemProps` keeps accepting
72
+ * `{ as: 'div' }` the way it always has. The cost is that it is not
73
+ * distributive: `Omit` over a union keeps only the shared keys, so the bare
74
+ * alias carries no `href` even though the component takes one under `as="a"`.
75
+ * Write `DropdownItemProps<'a'>` for the anchor's props. That is the #667 alias
76
+ * limitation Button carries, labelled next-major because closing it is
77
+ * source-breaking, and pinned for this component in
78
+ * `__typetests__/polymorphic.tsx`; the component itself is unaffected.
79
+ */
80
+ export type DropdownItemProps<T extends DropdownItemElement = DropdownItemElement> = DropdownItemOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof DropdownItemOwnProps | 'as'> & {
81
+ /** The element type to render. */
82
+ as?: T;
83
+ };
84
+ /**
85
+ * Bulma Dropdown item.
86
+ *
87
+ * @function
88
+ * @param {DropdownItemProps} props - Props for the DropdownItem component.
89
+ * @returns {JSX.Element} The rendered dropdown item.
90
+ */
91
+ export declare const DropdownItem: ConstrainedPolymorphicComponentWithoutRef<DropdownItemOwnProps, DropdownItemElement, "a">;
92
+ /**
93
+ * Bulma Dropdown divider.
94
+ *
95
+ * @function
96
+ * @returns {JSX.Element} The rendered divider element.
97
+ */
98
+ export declare const DropdownDivider: React.FC;
99
+ /** Bulma Dropdown component with Item and Divider sub-components. */
100
+ export declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLDivElement>> & {
101
+ Item: ConstrainedPolymorphicComponentWithoutRef<DropdownItemOwnProps, DropdownItemElement, "a">;
102
+ Divider: React.FC<{}>;
103
+ };
104
+ export default Dropdown;
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
3
+ /**
4
+ * Overlay opacity levels for the Loading background.
5
+ */
6
+ export type LoadingOverlay = 'light' | 'dark' | 'opaque';
7
+ /**
8
+ * Color variants for the Loading spinner.
9
+ */
10
+ export type LoadingColor = 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
11
+ /**
12
+ * Props for the Loading component.
13
+ * @extraProp {React.ReactNode} [children] - Content to display below the spinner.
14
+ * @extraProp {string} [className] - Additional CSS classes.
15
+ */
16
+ export interface LoadingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size' | 'overlay'> {
17
+ /** Whether the loading overlay is visible. */
18
+ active?: boolean;
19
+ /** Cover the entire viewport. */
20
+ isFullPage?: boolean;
21
+ /** Size of the loading spinner. */
22
+ size?: 'small' | 'medium' | 'large';
23
+ /** Color variant for the spinner. Default is light grey. */
24
+ color?: LoadingColor;
25
+ /** Show a cancel button and allow closing. */
26
+ canCancel?: boolean;
27
+ /** Callback when cancel is triggered. */
28
+ onCancel?: () => void;
29
+ /** Additional classes for the overlay. */
30
+ overlayClassName?: string;
31
+ /** Additional classes for the spinner icon. */
32
+ iconClassName?: string;
33
+ /** Custom loading indicator element. */
34
+ indicator?: React.ReactNode;
35
+ /** Style of the loading overlay. */
36
+ overlay?: LoadingOverlay;
37
+ }
38
+ /**
39
+ * The `Loading` component provides a loading overlay with a spinner animation.
40
+ *
41
+ * @function
42
+ * @param {LoadingProps} props - Props for the Loading component.
43
+ * @returns {JSX.Element | null} The rendered loading overlay or null if not active.
44
+ *
45
+ * @example
46
+ * // Full page loading
47
+ * <Loading active isFullPage />
48
+ *
49
+ * @example
50
+ * // Container loading with message
51
+ * <div style={{ position: 'relative', height: '200px' }}>
52
+ * <Loading active>Loading data...</Loading>
53
+ * </div>
54
+ *
55
+ * @example
56
+ * // With color variant
57
+ * <Loading active color="primary" />
58
+ *
59
+ * @example
60
+ * // With cancel functionality
61
+ * <Loading
62
+ * active={isLoading}
63
+ * canCancel
64
+ * onCancel={() => setIsLoading(false)}
65
+ * />
66
+ */
67
+ export declare const Loading: React.FC<LoadingProps>;
68
+ export default Loading;
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
3
+ import { type PolymorphicComponent } from '../helpers/polymorphic.js';
4
+ /**
5
+ * Props for the Menu component.
6
+ */
7
+ export interface MenuProps extends Omit<React.HTMLAttributes<HTMLElement>, keyof BulmaClassesProps>, BulmaClassesProps {
8
+ /** Additional CSS classes. */
9
+ className?: string;
10
+ /** Menu content (labels, lists, items, etc). */
11
+ children: React.ReactNode;
12
+ }
13
+ /**
14
+ * Props for the MenuLabel component.
15
+ */
16
+ export interface MenuLabelProps extends Omit<React.HTMLAttributes<HTMLParagraphElement>, keyof BulmaClassesProps>, BulmaClassesProps {
17
+ /** Additional CSS classes. */
18
+ className?: string;
19
+ /** Label content. */
20
+ children: React.ReactNode;
21
+ }
22
+ /**
23
+ * Bulma Menu label component.
24
+ *
25
+ * @function
26
+ * @param {MenuLabelProps} props - Props for the MenuLabel component.
27
+ * @returns {JSX.Element} The rendered menu label.
28
+ */
29
+ export declare const MenuLabel: React.FC<MenuLabelProps>;
30
+ /**
31
+ * Props for the MenuList component.
32
+ */
33
+ export interface MenuListProps extends Omit<React.HTMLAttributes<HTMLUListElement>, keyof BulmaClassesProps>, BulmaClassesProps {
34
+ /** Additional CSS classes. */
35
+ className?: string;
36
+ /** List items. */
37
+ children: React.ReactNode;
38
+ }
39
+ /**
40
+ * MenuList applies `menu-list` class only at the top level (not for nested lists).
41
+ *
42
+ * @function
43
+ * @param {MenuListProps} props - Props for the MenuList component.
44
+ * @returns {JSX.Element} The rendered menu list.
45
+ */
46
+ export declare const MenuList: React.FC<MenuListProps>;
47
+ /**
48
+ * The MenuItem component's own props.
49
+ *
50
+ * A menu item is two elements: a wrapping `<li>` and, inside it, the element
51
+ * `as` names. The props here are the ones the `<li>` consumes; everything else
52
+ * follows `as` onto the inner element.
53
+ */
54
+ export interface MenuItemOwnProps extends BulmaClassesProps {
55
+ /** Additional CSS classes for the wrapping `<li>`. */
56
+ className?: string;
57
+ /** Item content and optional nested MenuList. */
58
+ children: React.ReactNode;
59
+ /** Highlight item as active. */
60
+ active?: boolean;
61
+ /** Inline styles for the wrapping `<li>`. */
62
+ style?: React.CSSProperties;
63
+ /** `id` for the wrapping `<li>`. */
64
+ id?: string;
65
+ /** `title` for the wrapping `<li>`. */
66
+ title?: string;
67
+ /** ARIA role for the wrapping `<li>`. */
68
+ role?: React.AriaRole;
69
+ /** Tab index for the wrapping `<li>`. */
70
+ tabIndex?: number;
71
+ /** Test id for the wrapping `<li>`. */
72
+ 'data-testid'?: string;
73
+ }
74
+ /**
75
+ * Props for the MenuItem component. Everything the `<li>` does not consume
76
+ * follows `as` onto the inner element: with the default `'a'` that means `href`
77
+ * and the other anchor attributes, and with `as={Link}` it means that
78
+ * component's own props.
79
+ *
80
+ * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the inner element `as` renders, not the wrapping `<li>`, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
81
+ */
82
+ export type MenuItemProps<T extends React.ElementType = 'a'> = MenuItemOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof MenuItemOwnProps | 'as'> & {
83
+ /** Custom link component (e.g. `Link` from router). */
84
+ as?: T;
85
+ };
86
+ /**
87
+ * MenuItem supports `as` prop for custom link components, e.g., react-router-dom Link.
88
+ *
89
+ * @function
90
+ * @param {MenuItemProps} props - Props for the MenuItem component.
91
+ * @param {React.Ref} ref - Forwarded ref to the inner element `as` renders.
92
+ * @returns {JSX.Element} The rendered menu item.
93
+ */
94
+ export declare const MenuItem: PolymorphicComponent<MenuItemOwnProps, "a">;
95
+ export declare const Menu: React.FC<MenuProps> & {
96
+ Label: React.FC<MenuLabelProps>;
97
+ List: React.FC<MenuListProps>;
98
+ Item: PolymorphicComponent<MenuItemOwnProps, "a">;
99
+ };
100
+ export default Menu;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
3
+ declare const validMessageSizes: readonly ["small", "medium", "large"];
4
+ /**
5
+ * Valid size values for the Message component (Bulma message sizes).
6
+ */
7
+ export type MessageSize = (typeof validMessageSizes)[number];
8
+ /**
9
+ * Props for the Message component.
10
+ */
11
+ export interface MessageProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {
12
+ /** Additional CSS classes. */
13
+ className?: string;
14
+ /** Title string/node (renders header section). */
15
+ title?: React.ReactNode;
16
+ /** Text color for the message (Bulma helper). */
17
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
18
+ /** Bulma color modifier for the message. */
19
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
20
+ /** Background color for the message (Bulma helper). */
21
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
22
+ /** Size of the message. */
23
+ size?: MessageSize;
24
+ /** Callback for the close ("X") button. */
25
+ onClose?: () => void;
26
+ /** Body content for the message. */
27
+ children?: React.ReactNode;
28
+ }
29
+ /**
30
+ * Props for the Message.Header compound component.
31
+ */
32
+ export interface MessageHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
33
+ /** Additional CSS classes. */
34
+ className?: string;
35
+ /** Header content (title, close button, etc.). */
36
+ children?: React.ReactNode;
37
+ }
38
+ /**
39
+ * Props for the Message.Body compound component.
40
+ */
41
+ export interface MessageBodyProps extends React.HTMLAttributes<HTMLDivElement> {
42
+ /** Additional CSS classes. */
43
+ className?: string;
44
+ /** Message body content. */
45
+ children?: React.ReactNode;
46
+ }
47
+ export declare const Message: React.FC<MessageProps> & {
48
+ Header: React.FC<MessageHeaderProps>;
49
+ Body: React.FC<MessageBodyProps>;
50
+ };
51
+ export default Message;
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
3
+ /**
4
+ * Props for the Modal component.
5
+ * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the root `.modal` element.
6
+ */
7
+ export interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'title'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
8
+ /** Whether the modal is open/visible. */
9
+ active?: boolean;
10
+ /** Alias for `active`. Whether the modal is open/visible. */
11
+ isActive?: boolean;
12
+ /** Callback invoked to request modal close (background or close button). */
13
+ onClose?: () => void;
14
+ /** Additional CSS classes for the modal. */
15
+ className?: string;
16
+ /** Text color for modal content. */
17
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
18
+ /** Background color for modal content. */
19
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
20
+ /** Title/header for modal-card variant. (Legacy API only) */
21
+ modalCardTitle?: React.ReactNode;
22
+ /** Footer for modal-card variant. (Legacy API only) */
23
+ modalCardFoot?: React.ReactNode;
24
+ /**
25
+ * Modal style: `'card'` for modal-card, `'content'` for modal-content. (Legacy API only)
26
+ * @defaultValue auto
27
+ */
28
+ type?: 'card' | 'content';
29
+ /** Modal body/content or compound components. */
30
+ children?: React.ReactNode;
31
+ /**
32
+ * Close the modal when the Escape key is pressed (calls `onClose`). Only the
33
+ * topmost open modal responds, so Escape closes one layer at a time.
34
+ * @defaultValue true
35
+ */
36
+ closeOnEscape?: boolean;
37
+ /**
38
+ * Lock body scroll while the modal is active. Ref-counted and shared with
39
+ * `Dialog`, `Sidebar` and `Loading`, so whichever overlay closes first does
40
+ * not unlock the page underneath one that is still open.
41
+ * @defaultValue true
42
+ */
43
+ lockScroll?: boolean;
44
+ /**
45
+ * Renders the modal into a portal target instead of inline, so it isn't
46
+ * clipped by an ancestor with `overflow: hidden`, `filter` or `transform`.
47
+ * `true` portals to `document.body`; a string is used as a
48
+ * `document.querySelector` selector; an element is used directly. Renders
49
+ * inline on the server and while hydrating, moving into the portal once the
50
+ * client takes over, so hydration matches.
51
+ * @defaultValue false
52
+ */
53
+ portal?: boolean | string | HTMLElement;
54
+ }
55
+ /**
56
+ * Props for Modal.Background component.
57
+ */
58
+ export interface ModalBackgroundProps extends React.HTMLAttributes<HTMLDivElement> {
59
+ /** Additional CSS classes. */
60
+ className?: string;
61
+ }
62
+ /**
63
+ * Props for Modal.Content component.
64
+ */
65
+ export interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement> {
66
+ /** Additional CSS classes. */
67
+ className?: string;
68
+ }
69
+ /**
70
+ * Props for Modal.Card component.
71
+ */
72
+ export interface ModalCardProps extends React.HTMLAttributes<HTMLDivElement> {
73
+ /** Additional CSS classes. */
74
+ className?: string;
75
+ }
76
+ /**
77
+ * Props for Modal.Card.Head component.
78
+ */
79
+ export interface ModalCardHeadProps extends React.HTMLAttributes<HTMLElement> {
80
+ /** Additional CSS classes. */
81
+ className?: string;
82
+ }
83
+ /**
84
+ * Props for Modal.Card.Title component.
85
+ */
86
+ export interface ModalCardTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {
87
+ /** Additional CSS classes. */
88
+ className?: string;
89
+ }
90
+ /**
91
+ * Props for Modal.Card.Body component.
92
+ */
93
+ export interface ModalCardBodyProps extends React.HTMLAttributes<HTMLElement> {
94
+ /** Additional CSS classes. */
95
+ className?: string;
96
+ }
97
+ /**
98
+ * Props for Modal.Card.Foot component.
99
+ */
100
+ export interface ModalCardFootProps extends React.HTMLAttributes<HTMLElement> {
101
+ /** Additional CSS classes. */
102
+ className?: string;
103
+ }
104
+ /**
105
+ * Props for Modal.Close component.
106
+ */
107
+ export interface ModalCloseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
108
+ /** Additional CSS classes. */
109
+ className?: string;
110
+ /** Size of the close button (only applies to 'floating' variant). */
111
+ size?: 'small' | 'medium' | 'large';
112
+ /** Button variant. 'delete' (default) for modal card headers, 'floating' for overlay close button. */
113
+ variant?: 'delete' | 'floating';
114
+ }
115
+ export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>> & {
116
+ Background: React.FC<ModalBackgroundProps>;
117
+ Content: React.FC<ModalContentProps>;
118
+ Card: React.FC<ModalCardProps> & {
119
+ Head: React.FC<ModalCardHeadProps>;
120
+ Title: React.FC<ModalCardTitleProps>;
121
+ Body: React.FC<ModalCardBodyProps>;
122
+ Foot: React.FC<ModalCardFootProps>;
123
+ };
124
+ Close: React.FC<ModalCloseProps>;
125
+ };
126
+ export default Modal;