@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,55 @@
1
+ /**
2
+ * Returns a space-separated string of class names based on input arguments.
3
+ *
4
+ * Accepts any mix of strings, numbers, arrays, or objects. Falsy values are ignored.
5
+ * Array and object values are recursively flattened, and object keys are included
6
+ * if their value is truthy. Duplicate class names are removed.
7
+ *
8
+ * @param {...(string | number | undefined | null | false | Record<string, unknown> | unknown[])} args - Class values to join.
9
+ * @returns {string} A space-separated string of unique class names.
10
+ *
11
+ * @example
12
+ * classNames('foo', ['bar', { baz: true }], { qux: false, quux: true });
13
+ * // => 'foo bar baz quux'
14
+ */
15
+ export declare function classNames(...args: (string | number | undefined | null | false | Record<string, unknown> | unknown[])[]): string;
16
+ /**
17
+ * Creates a prefixed version of classNames that automatically applies a prefix to all class names.
18
+ *
19
+ * @param {string} classPrefix - The prefix to apply to all class names.
20
+ * @returns {Function} A classNames function that applies the prefix.
21
+ *
22
+ * @example
23
+ * const prefixedClassNames = createPrefixedClassNames('bulma-');
24
+ * prefixedClassNames('button', { 'is-primary': true });
25
+ * // => 'bulma-button bulma-is-primary'
26
+ */
27
+ export declare function createPrefixedClassNames(classPrefix: string): (...args: (string | number | undefined | null | false | Record<string, unknown> | unknown[])[]) => string;
28
+ export default classNames;
29
+ /**
30
+ * A simple wrapper around classNames that applies an optional prefix to all class names.
31
+ *
32
+ * @param {string | undefined} prefix - The prefix to apply to all class names. If undefined, no prefix is applied.
33
+ * @param {...(string | number | undefined | null | false | Record<string, unknown> | unknown[])} args - Class values to join.
34
+ * @returns {string} A space-separated string of unique class names, with prefix applied if provided.
35
+ *
36
+ * @example
37
+ * prefixedClassNames('bulma-', 'button', { 'is-primary': true });
38
+ * // => 'bulma-button bulma-is-primary'
39
+ *
40
+ * prefixedClassNames(undefined, 'button', { 'is-primary': true });
41
+ * // => 'button is-primary'
42
+ */
43
+ export declare function prefixedClassNames(prefix: string | undefined, ...args: (string | number | undefined | null | false | Record<string, unknown> | unknown[])[]): string;
44
+ /**
45
+ * Hook that automatically applies the classPrefix from Config context to class names.
46
+ *
47
+ * @param {...(string | number | undefined | null | false | Record<string, unknown> | unknown[])} args - Class values to join.
48
+ * @returns {string} A space-separated string of unique class names with prefix applied from context.
49
+ *
50
+ * @example
51
+ * // With ConfigProvider providing classPrefix="bulma-"
52
+ * const classes = usePrefixedClassNames('button', { 'is-primary': true });
53
+ * // => 'bulma-button bulma-is-primary'
54
+ */
55
+ export declare function usePrefixedClassNames(...args: (string | number | undefined | null | false | Record<string, unknown> | unknown[])[]): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Color values that emit an `is-<color>` modifier no shipped Bulma 1.0.4 rule
3
+ * matches on `.progress`/`.notification`/`.hero`. The `has-text-*` and
4
+ * `has-background-*` helpers DO cover these values — only the
5
+ * component-modifier form is dead.
6
+ */
7
+ export declare const UNSTYLED_MODIFIER_COLORS: readonly ["black-bis", "black-ter", "white-bis", "white-ter", "grey-darker", "grey-dark", "grey", "grey-light", "grey-lighter"];
8
+ /** Test-only: re-arm the warn-once registry. */
9
+ export declare const resetColorDeprecationWarnings: () => void;
10
+ /**
11
+ * Dev warning for a `color` value whose `is-<color>` modifier has no shipped
12
+ * CSS. `extraUnstyled` covers per-component dead values beyond the shared
13
+ * list (e.g. Hero's `inherit`/`current`).
14
+ */
15
+ export declare const warnUnstyledColor: (component: string, value: string | undefined, extraUnstyled?: readonly string[]) => void;
16
+ /** Dev warning for a `color` prop that has no shipped CSS for any value. */
17
+ export declare const warnDeprecatedColorProp: (component: string, value: string | undefined, hint: string) => void;
@@ -0,0 +1,17 @@
1
+ import type { CSSProperties } from 'react';
2
+ /**
3
+ * Merges helper-emitted inline styles (e.g., `bulmaHelperStyles` from
4
+ * `useBulmaClasses`) with a user-supplied `style` prop.
5
+ *
6
+ * The user's `style` wins on conflicting properties, and when both inputs are
7
+ * absent the result is `undefined` — so components that receive neither
8
+ * render with no `style` attribute at all, exactly as before.
9
+ *
10
+ * @function mergeBulmaStyles
11
+ * @param helperStyles - Inline styles emitted by the Bulma helper hooks.
12
+ * @param style - The component consumer's `style` prop.
13
+ * @returns The merged style object, or `undefined` when both are absent.
14
+ * @example
15
+ * <section style={mergeBulmaStyles(bulmaHelperStyles, style)} />
16
+ */
17
+ export declare const mergeBulmaStyles: (helperStyles?: CSSProperties, style?: CSSProperties) => CSSProperties | undefined;
@@ -0,0 +1,138 @@
1
+ import type React from 'react';
2
+ /**
3
+ * Whether an `as` target is a custom element rather than a built-in tag.
4
+ *
5
+ * HTML requires a custom element's name to contain a hyphen, and no built-in
6
+ * element name has one, so this is exact rather than a heuristic. It matters
7
+ * because a custom element is an intrinsic STRING — `typeof as === 'string'` is
8
+ * true — while its props are whatever a consumer declared through
9
+ * `React.JSX.IntrinsicElements`, the way this package declares `<ion-icon>`.
10
+ * A runtime backstop that filters built-in attributes must leave those alone,
11
+ * or it strips props the derived type just promised to forward.
12
+ */
13
+ export declare function isCustomElement(as: unknown): as is string;
14
+ /**
15
+ * The ref type of whatever element `as` renders.
16
+ *
17
+ * Derived from `ComponentPropsWithRef` rather than `React.ComponentRef` so it
18
+ * resolves on every `@types/react` a consumer may be on: this package supports
19
+ * React 18 and 19, and the CI matrix pins only `react`/`react-dom`, never the
20
+ * types, so a types-only regression here would not be caught.
21
+ *
22
+ * `never` when the target takes no ref. A plain function component has no `ref`
23
+ * key at all, and React's own types reject `<PlainFC ref={…} />`; without the
24
+ * guard the indexed access degraded to `unknown` and we accepted a ref that
25
+ * silently does nothing — `ref.current` stays null and a later `.focus()`
26
+ * throws. Matching React's strictness is the point.
27
+ */
28
+ export type PolymorphicRef<T extends React.ElementType> = 'ref' extends keyof React.ComponentPropsWithRef<T> ? React.ComponentPropsWithRef<T>['ref'] : never;
29
+ /**
30
+ * A component's own props, plus the attributes of the element `as` names.
31
+ *
32
+ * `Own` wins every collision — a component that declares `color` as a Bulma
33
+ * variant keeps it, rather than inheriting the DOM attribute of the same name.
34
+ * That subtraction is the ONLY one. `color` used to be dropped here as well, to
35
+ * stop the deprecated presentational HTML attribute reaching the three
36
+ * components whose own props do not declare one — but doing it in the shared
37
+ * type also stripped `color` from a CUSTOM target that legitimately has one.
38
+ * Those three declare `color?: never` themselves instead, which lands in
39
+ * `keyof Own` and reaches the same result without a special case here.
40
+ *
41
+ * Distributive over `T` on purpose. `Omit<A | B, K>` keys off `keyof (A | B)`,
42
+ * which is only what A and B share — so a union-typed `as` (a ternary, or a
43
+ * variable typed `'a' | 'button'`) silently lost every prop that belongs to
44
+ * just one member, `href` among them. Distributing produces a union of prop
45
+ * shapes instead, and each member keeps its own.
46
+ *
47
+ * Each component writes this intersection out in its own `*Props` alias rather
48
+ * than referring to this type: the API-docs extractor
49
+ * (`scripts/lib/props-extract.mjs`) walks heritage syntactically, and a generic
50
+ * alias leaves it resolving a type parameter it cannot see through.
51
+ * This type is here for the component's cast target and for consumers writing
52
+ * wrappers.
53
+ */
54
+ export type PolymorphicProps<T extends React.ElementType, Own> = T extends unknown ? Own & Omit<React.ComponentPropsWithoutRef<T>, keyof Own | 'as'> & {
55
+ /** The element or component to render. */
56
+ as?: T;
57
+ } : never;
58
+ /**
59
+ * A component whose props and forwarded ref both follow `as`.
60
+ *
61
+ * `forwardRef` cannot express a generic component, so the implementation is
62
+ * cast to this. `displayName` is part of the type because the library sets it
63
+ * on every `forwardRef` component, and `withSubComponents` constrains its base
64
+ * to `{ displayName?: string }`.
65
+ *
66
+ * The second, non-generic signature exists for type DERIVATION rather than for
67
+ * calls. `React.ComponentProps<typeof Button>` infers from the last overload;
68
+ * with only the generic one it instantiated at the constraint and collapsed to
69
+ * `any`, so a consumer building their own prop type on ours lost every check.
70
+ * Calls still resolve against the generic signature first, so ordering here is
71
+ * load-bearing — swapping the two puts the collapse back.
72
+ *
73
+ * **A wrapping HOC erases the genericity.** `React.memo(Button)`,
74
+ * `React.lazy`, a `styled()` wrapper — anything that infers its props through
75
+ * `ComponentProps<T>` — instantiates the type parameter once and hands back a
76
+ * component with a single prop type. It takes the LAST call signature, which is
77
+ * the derivation overload, so the wrapper is pinned to the DEFAULT element:
78
+ * `React.memo(Button)` rejects `as="div"` outright, and `React.memo(Dropdown.Item)`
79
+ * renders neither a `<div>` nor a `<button>`, though both components accept those
80
+ * directly. Stricter, not looser — the checks do not stop, they collapse onto one
81
+ * element, and a `Dropdown.Item` memoized for a long menu list is the case that
82
+ * meets it. This is inherent to polymorphic components in TypeScript, not
83
+ * something this library can fix. Re-assert the type to get the rest back:
84
+ *
85
+ * ```tsx
86
+ * const MemoButton = React.memo(Button) as typeof Button;
87
+ * ```
88
+ */
89
+ export interface PolymorphicComponent<Own, Default extends React.ElementType> {
90
+ <T extends React.ElementType = Default>(props: PolymorphicProps<T, Own> & {
91
+ ref?: PolymorphicRef<T>;
92
+ }): React.ReactElement | null;
93
+ (props: PolymorphicProps<Default, Own> & {
94
+ ref?: PolymorphicRef<Default>;
95
+ }): React.ReactElement | null;
96
+ displayName?: string;
97
+ }
98
+ /**
99
+ * A component whose props follow `as` but which forwards no ref.
100
+ *
101
+ * For components that own the node they observe — `Reveal` keeps its own ref on
102
+ * the element it watches for scroll intersection, which is not always the
103
+ * element `as` names.
104
+ */
105
+ export interface PolymorphicComponentWithoutRef<Own, Default extends React.ElementType> {
106
+ <T extends React.ElementType = Default>(props: PolymorphicProps<T, Own>): React.ReactElement | null;
107
+ (props: PolymorphicProps<Default, Own>): React.ReactElement | null;
108
+ displayName?: string;
109
+ }
110
+ /**
111
+ * A component whose props follow `as`, where `as` is a closed set of tags.
112
+ *
113
+ * `PolymorphicComponentWithoutRef` lets `as` name anything; this narrows it to
114
+ * `Allowed`. Bulma pins some elements by its own markup contract — a dropdown
115
+ * item is an `<a>`, a `<div>` or a `<button>` and nothing else — and the
116
+ * constraint keeps that promise while still deriving props from whichever of
117
+ * the three a caller picks.
118
+ *
119
+ * Genericity is what makes the derivation exact for a LITERAL `as`, and it is
120
+ * worth the extra type parameter. Typing such a component as `React.FC<Union>`
121
+ * instead — a union of the three prop shapes — reads as equivalent but is not:
122
+ * against a union target, an object literal's excess-property check passes if
123
+ * the property exists in ANY member, so `<Item as="div" href="/x" />` slips
124
+ * through. Inferring `T` from the literal checks against that one member.
125
+ *
126
+ * A UNION-typed `as` — a ternary, or a variable typed as the whole set — infers
127
+ * `T` as the union and lands back in that same permissive check, so
128
+ * `<Item as={tag} href="/x" />` compiles whatever `tag` turns out to be. That is
129
+ * the open `as` behaviour too, and deliberate there: `PolymorphicProps`
130
+ * distributes precisely so a union-typed `as` KEEPS each member's props rather
131
+ * than losing every prop the members do not share. Narrowing it is not a
132
+ * constrained-component question; it would have to change for `Button` first.
133
+ */
134
+ export interface ConstrainedPolymorphicComponentWithoutRef<Own, Allowed extends React.ElementType, Default extends Allowed> {
135
+ <T extends Allowed = Default>(props: PolymorphicProps<T, Own>): React.ReactElement | null;
136
+ (props: PolymorphicProps<Default, Own>): React.ReactElement | null;
137
+ displayName?: string;
138
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Resolves a portal target: an `HTMLElement` is used directly, a non-empty
3
+ * `string` is treated as a `document.querySelector` selector (falling back to
4
+ * `document.body` when it matches nothing), and any falsy value — `undefined`
5
+ * or the empty string — resolves to `document.body`.
6
+ *
7
+ * The empty string is deliberately treated as "no target" rather than passed
8
+ * through: `document.querySelector('')` throws a `SyntaxError`, and callers
9
+ * building a selector from state can easily hand us `''`.
10
+ *
11
+ * @function resolvePortalContainer
12
+ * @param container - The requested portal target, if any.
13
+ * @returns The resolved DOM node to portal into.
14
+ */
15
+ export declare function resolvePortalContainer(container?: string | HTMLElement): HTMLElement;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Locks (and ref-counted-ly unlocks) `document.body` scrolling while `active`
3
+ * is true. Safe to call from multiple components at once — the body scroll
4
+ * is only restored once every active caller has released its lock.
5
+ *
6
+ * @function useScrollLock
7
+ * @param active - Whether this caller wants the body scroll locked.
8
+ */
9
+ export declare function useScrollLock(active: boolean): void;
@@ -0,0 +1,60 @@
1
+ import { type CSSProperties } from 'react';
2
+ import { BulmaDisplayProps, BulmaViewportProps } from './bulmaClassHelpers.js';
3
+ import { BulmaColorProps, BulmaColorPropsWithScheme } from './useColorClasses.js';
4
+ import { BulmaSpacingProps } from './useSpacingClasses.js';
5
+ import { BulmaTypographyProps } from './useTypographyClasses.js';
6
+ import { BulmaVisibilityProps } from './useVisibilityClasses.js';
7
+ import { BulmaFlexboxProps } from './useFlexboxClasses.js';
8
+ import { BulmaOtherProps } from './useOtherClasses.js';
9
+ /**
10
+ * Props for applying Bulma helper classes to components.
11
+ */
12
+ export interface BulmaClassesProps extends BulmaColorProps, BulmaSpacingProps, BulmaTypographyProps, BulmaVisibilityProps, BulmaFlexboxProps, BulmaOtherProps {
13
+ }
14
+ /**
15
+ * {@link BulmaClassesProps} with `backgroundColor` widened to also accept the
16
+ * scheme color names from `validSchemeColors` (see
17
+ * {@link BulmaColorPropsWithScheme}). This is the input type of
18
+ * `useBulmaClasses`; scheme values surface as the `bulmaHelperStyles` return
19
+ * member instead of a class.
20
+ */
21
+ export type BulmaClassesPropsWithScheme = Omit<BulmaClassesProps, keyof BulmaColorProps> & BulmaColorPropsWithScheme;
22
+ /**
23
+ * A hook that generates Bulma helper classes from props and separates unhandled props.
24
+ *
25
+ * Composed from the per-concern mini hooks (useColorClasses, useSpacingClasses,
26
+ * useTypographyClasses, useVisibilityClasses, useFlexboxClasses, and
27
+ * useOtherClasses), which can also be used individually.
28
+ *
29
+ * Scheme background values (`backgroundColor: 'scheme-main-bis'`, …) emit no
30
+ * class; they are returned as `bulmaHelperStyles` — a dark-mode-safe inline
31
+ * `background-color: var(--bulma-scheme-*)` style (`undefined` for all other
32
+ * inputs). Merge it with a user `style` prop via `mergeBulmaStyles`.
33
+ *
34
+ * @function useBulmaClasses
35
+ * @param props - Combination of BulmaClassesPropsWithScheme and additional props.
36
+ * @returns An object containing the Bulma helper classes, optional helper
37
+ * styles, and unhandled props.
38
+ * @example
39
+ * const { bulmaHelperClasses, bulmaHelperStyles, rest } = useBulmaClasses({
40
+ * color: 'primary',
41
+ * backgroundColor: 'scheme-main-bis',
42
+ * className: 'custom-class'
43
+ * });
44
+ * // bulmaHelperClasses: 'has-text-primary'
45
+ * // bulmaHelperStyles: { backgroundColor: 'var(--bulma-scheme-main-bis)' }
46
+ * // rest: { className: 'custom-class' }
47
+ */
48
+ export declare const useBulmaClasses: <T extends object>(props: BulmaClassesPropsWithScheme & T) => {
49
+ bulmaHelperClasses: string;
50
+ bulmaHelperStyles?: CSSProperties;
51
+ rest: Omit<T, keyof BulmaClassesProps>;
52
+ };
53
+ export { validColors, validColorShades, validSchemeColors, validSizes, validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, validDisplays, validVisibilities, validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, validViewports, validFloats, validOverflows, validInteractions, validCursors, validRadii, validShadows, validResponsives, } from './bulmaClassHelpers.js';
54
+ export type { BulmaViewportProps, BulmaDisplayProps };
55
+ export * from './useColorClasses.js';
56
+ export * from './useSpacingClasses.js';
57
+ export * from './useTypographyClasses.js';
58
+ export * from './useVisibilityClasses.js';
59
+ export * from './useFlexboxClasses.js';
60
+ export * from './useOtherClasses.js';
@@ -0,0 +1,69 @@
1
+ import { type CSSProperties } from 'react';
2
+ import { validColors, validColorShades, validSchemeColors } from './bulmaClassHelpers.js';
3
+ /**
4
+ * Props for applying Bulma text and background color helper classes.
5
+ */
6
+ export interface BulmaColorProps {
7
+ /** Text color class (e.g., 'primary', 'info'). */
8
+ color?: (typeof validColors)[number] | 'inherit' | 'current';
9
+ /** Text color shade suffix (e.g., '00', 'invert'). */
10
+ colorShade?: (typeof validColorShades)[number];
11
+ /** Background color class (e.g., 'primary', 'info'). */
12
+ backgroundColor?: (typeof validColors)[number] | 'inherit' | 'current';
13
+ /** Background color shade suffix (e.g., '00', 'invert'). */
14
+ backgroundColorShade?: (typeof validColorShades)[number];
15
+ }
16
+ /**
17
+ * {@link BulmaColorProps} with `backgroundColor` widened to also accept the
18
+ * scheme color names from `validSchemeColors` (e.g., 'scheme-main-bis').
19
+ *
20
+ * Scheme values never emit a `has-background-*` class — pass them through
21
+ * {@link useColorStyles} (or `useBulmaClasses`' `bulmaHelperStyles` return) to
22
+ * get the dark-mode-safe inline `background-color: var(--bulma-scheme-*)`
23
+ * style instead.
24
+ */
25
+ export type BulmaColorPropsWithScheme = Omit<BulmaColorProps, 'backgroundColor'> & {
26
+ /** Background color: a Bulma color class name or a scheme color name. */
27
+ backgroundColor?: BulmaColorProps['backgroundColor'] | (typeof validSchemeColors)[number];
28
+ };
29
+ /**
30
+ * A hook that generates Bulma text and background color helper classes.
31
+ *
32
+ * Scheme background values (`scheme-main`, `scheme-main-bis`, …) are dropped
33
+ * from class emission — Bulma ships no `has-background-scheme-*` classes; use
34
+ * {@link useColorStyles} to render them as an inline style.
35
+ *
36
+ * @function useColorClasses
37
+ * @param props - Color-related Bulma helper props.
38
+ * @returns A space-separated string of color helper classes.
39
+ * @example
40
+ * const colorClasses = useColorClasses({
41
+ * color: 'primary',
42
+ * backgroundColor: 'info',
43
+ * });
44
+ * // colorClasses: 'has-text-primary has-background-info'
45
+ */
46
+ export declare const useColorClasses: (props: BulmaColorPropsWithScheme) => string;
47
+ /**
48
+ * A hook that generates inline styles for scheme-aware color props.
49
+ *
50
+ * When `backgroundColor` is one of the scheme color names in
51
+ * `validSchemeColors`, returns `{ backgroundColor: 'var(--bulma-<value>)' }` —
52
+ * an inline style that tracks Bulma's scheme CSS variables, so it adapts to
53
+ * light/dark mode with no bestax-shipped CSS. For every other input it
54
+ * returns `undefined` (never `{}`), so components that don't use scheme
55
+ * values produce identical DOM to before.
56
+ *
57
+ * `backgroundColorShade` is ignored for scheme values — Bulma defines no
58
+ * shaded scheme variables. Only the background is set: the `scheme-invert*`
59
+ * values do not change text color, so pair them with a contrasting
60
+ * foreground.
61
+ *
62
+ * @function useColorStyles
63
+ * @param props - Color-related Bulma helper props (scheme-aware).
64
+ * @returns An inline style object for scheme backgrounds, or `undefined`.
65
+ * @example
66
+ * const colorStyles = useColorStyles({ backgroundColor: 'scheme-main-bis' });
67
+ * // colorStyles: { backgroundColor: 'var(--bulma-scheme-main-bis)' }
68
+ */
69
+ export declare const useColorStyles: (props: BulmaColorPropsWithScheme) => CSSProperties | undefined;
@@ -0,0 +1,46 @@
1
+ import { validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, BulmaDisplayProps } from './bulmaClassHelpers.js';
2
+ /**
3
+ * Props for applying Bulma flexbox helper classes. The display props are read
4
+ * only to gate the flex container helpers; this hook never emits display
5
+ * classes itself.
6
+ */
7
+ export interface BulmaFlexboxProps extends BulmaDisplayProps {
8
+ /** Flex direction (e.g., 'row', 'column'). */
9
+ flexDirection?: (typeof validFlexDirections)[number];
10
+ /** Flex wrap (e.g., 'wrap', 'nowrap'). */
11
+ flexWrap?: (typeof validFlexWraps)[number];
12
+ /** Justify content (e.g., 'center', 'space-between'). */
13
+ justifyContent?: (typeof validJustifyContents)[number];
14
+ /** Align content (e.g., 'center', 'stretch'). */
15
+ alignContent?: (typeof validAlignContents)[number];
16
+ /** Align items (e.g., 'center', 'flex-start'). */
17
+ alignItems?: (typeof validAlignItems)[number];
18
+ /** Align self (e.g., 'auto', 'center'). */
19
+ alignSelf?: (typeof validAlignSelfs)[number];
20
+ /** Flex grow value (e.g., '0', '1', '2', '3', '4', '5'). */
21
+ flexGrow?: (typeof validFlexGrowShrink)[number];
22
+ /** Flex shrink value (e.g., '0', '1', '2', '3', '4', '5'). */
23
+ flexShrink?: (typeof validFlexGrowShrink)[number];
24
+ }
25
+ /**
26
+ * A hook that generates Bulma flexbox helper classes. Flex container helpers
27
+ * (direction, wrap, justify/align content, align items) are only emitted when
28
+ * one of the display props indicates a flex display; flex item helpers
29
+ * (align self, grow, shrink) are always emitted.
30
+ *
31
+ * Note: this hook reads the display props purely as a gate and never emits
32
+ * display classes — `is-flex` and friends come from useVisibilityClasses (or
33
+ * the useBulmaClasses aggregate).
34
+ *
35
+ * @function useFlexboxClasses
36
+ * @param props - Flexbox-related Bulma helper props.
37
+ * @returns A space-separated string of flexbox helper classes.
38
+ * @example
39
+ * const flexboxClasses = useFlexboxClasses({
40
+ * display: 'flex', // gates the container helpers, but emits no 'is-flex'
41
+ * justifyContent: 'center',
42
+ * });
43
+ * // flexboxClasses: 'is-justify-content-center'
44
+ * // ('is-flex' itself comes from useVisibilityClasses/useBulmaClasses)
45
+ */
46
+ export declare const useFlexboxClasses: (props: BulmaFlexboxProps) => string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Reports whether the component has passed hydration.
3
+ *
4
+ * Returns `false` during server rendering and during the hydrating client
5
+ * render, then `true` from the commit that follows. Use it to defer
6
+ * DOM-only behaviour (such as portalling) past hydration so the first client
7
+ * render matches the server markup instead of tripping hydration recovery.
8
+ *
9
+ * @function useIsHydrated
10
+ * @returns `true` once the hydrating render has completed, otherwise `false`.
11
+ */
12
+ export declare function useIsHydrated(): boolean;
@@ -0,0 +1,43 @@
1
+ import { validCursors, validFloats, validInteractions, validOverflows, validRadii, validResponsives, validShadows } from './bulmaClassHelpers.js';
2
+ /**
3
+ * Props for applying miscellaneous Bulma helper classes.
4
+ */
5
+ export interface BulmaOtherProps {
6
+ /** Float direction (e.g., 'left', 'right'). */
7
+ float?: (typeof validFloats)[number];
8
+ /** Overflow behavior (e.g., 'clipped'). */
9
+ overflow?: (typeof validOverflows)[number];
10
+ /** Applies overlay styling if true. */
11
+ overlay?: boolean;
12
+ /** Interaction behavior (e.g., 'unselectable', 'clickable'). */
13
+ interaction?: (typeof validInteractions)[number];
14
+ /** Cursor style (e.g., 'pointer', 'help'). */
15
+ cursor?: (typeof validCursors)[number];
16
+ /** Border radius style (e.g., 'radiusless'). */
17
+ radius?: (typeof validRadii)[number];
18
+ /** Shadow style (e.g., 'shadowless'). */
19
+ shadow?: (typeof validShadows)[number];
20
+ /** Responsive behavior (e.g., 'mobile', 'narrow'). */
21
+ responsive?: (typeof validResponsives)[number];
22
+ /** Add Bulma skeleton class if true. */
23
+ skeleton?: boolean;
24
+ /** Applies clearfix to fix floating children if true. */
25
+ clearfix?: boolean;
26
+ /** Applies position: relative if true. */
27
+ relative?: boolean;
28
+ /** Applies height: 100% if true. */
29
+ fullHeight?: boolean;
30
+ }
31
+ /**
32
+ * A hook that generates miscellaneous Bulma helper classes (float, overflow,
33
+ * overlay, interaction, cursor, radius, shadow, responsive, skeleton,
34
+ * clearfix, relative, and full height).
35
+ *
36
+ * @function useOtherClasses
37
+ * @param props - Miscellaneous Bulma helper props.
38
+ * @returns A space-separated string of helper classes.
39
+ * @example
40
+ * const otherClasses = useOtherClasses({ float: 'left', skeleton: true });
41
+ * // otherClasses: 'is-pulled-left is-skeleton'
42
+ */
43
+ export declare const useOtherClasses: (props: BulmaOtherProps) => string;
@@ -0,0 +1,45 @@
1
+ import { validSizes } from './bulmaClassHelpers.js';
2
+ /**
3
+ * Props for applying Bulma margin and padding helper classes.
4
+ */
5
+ export interface BulmaSpacingProps {
6
+ /** Margin (e.g., '0', '1'). */
7
+ m?: (typeof validSizes)[number];
8
+ /** Margin top. */
9
+ mt?: (typeof validSizes)[number];
10
+ /** Margin right. */
11
+ mr?: (typeof validSizes)[number];
12
+ /** Margin bottom. */
13
+ mb?: (typeof validSizes)[number];
14
+ /** Margin left. */
15
+ ml?: (typeof validSizes)[number];
16
+ /** Margin horizontal (left and right). */
17
+ mx?: (typeof validSizes)[number];
18
+ /** Margin vertical (top and bottom). */
19
+ my?: (typeof validSizes)[number];
20
+ /** Padding (e.g., '0', '1'). */
21
+ p?: (typeof validSizes)[number];
22
+ /** Padding top. */
23
+ pt?: (typeof validSizes)[number];
24
+ /** Padding right. */
25
+ pr?: (typeof validSizes)[number];
26
+ /** Padding bottom. */
27
+ pb?: (typeof validSizes)[number];
28
+ /** Padding left. */
29
+ pl?: (typeof validSizes)[number];
30
+ /** Padding horizontal (left and right). */
31
+ px?: (typeof validSizes)[number];
32
+ /** Padding vertical (top and bottom). */
33
+ py?: (typeof validSizes)[number];
34
+ }
35
+ /**
36
+ * A hook that generates Bulma margin and padding helper classes.
37
+ *
38
+ * @function useSpacingClasses
39
+ * @param props - Spacing-related Bulma helper props.
40
+ * @returns A space-separated string of spacing helper classes.
41
+ * @example
42
+ * const spacingClasses = useSpacingClasses({ m: '2', px: '4' });
43
+ * // spacingClasses: 'm-2 px-4'
44
+ */
45
+ export declare const useSpacingClasses: (props: BulmaSpacingProps) => string;
@@ -0,0 +1,51 @@
1
+ import { validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, BulmaViewportProps } from './bulmaClassHelpers.js';
2
+ /**
3
+ * Props for applying Bulma typography helper classes.
4
+ */
5
+ export interface BulmaTypographyProps extends BulmaViewportProps {
6
+ /** Text size (e.g., '1', '2'). */
7
+ textSize?: (typeof validTextSizes)[number];
8
+ /** Text alignment (e.g., 'centered', 'left'). */
9
+ textAlign?: (typeof validAlignments)[number];
10
+ /** Text transformation (e.g., 'uppercase', 'italic'). */
11
+ textTransform?: (typeof validTextTransforms)[number];
12
+ /** Text weight (e.g., 'light', 'bold'). */
13
+ textWeight?: (typeof validTextWeights)[number];
14
+ /** Font family (e.g., 'sans-serif', 'code'). */
15
+ fontFamily?: (typeof validFontFamilies)[number];
16
+ /** Text size for mobile viewport (up to 768px). */
17
+ textSizeMobile?: (typeof validTextSizes)[number];
18
+ /** Text size for tablet viewport (769px - 1023px). */
19
+ textSizeTablet?: (typeof validTextSizes)[number];
20
+ /** Text size for desktop viewport (1024px - 1215px). */
21
+ textSizeDesktop?: (typeof validTextSizes)[number];
22
+ /** Text size for widescreen viewport (1216px - 1407px). */
23
+ textSizeWidescreen?: (typeof validTextSizes)[number];
24
+ /** Text size for fullhd viewport (1408px and above). */
25
+ textSizeFullhd?: (typeof validTextSizes)[number];
26
+ /** Text alignment for mobile viewport (up to 768px). */
27
+ textAlignMobile?: (typeof validAlignments)[number];
28
+ /** Text alignment for tablet viewport (769px - 1023px). */
29
+ textAlignTablet?: (typeof validAlignments)[number];
30
+ /** Text alignment for desktop viewport (1024px - 1215px). */
31
+ textAlignDesktop?: (typeof validAlignments)[number];
32
+ /** Text alignment for widescreen viewport (1216px - 1407px). */
33
+ textAlignWidescreen?: (typeof validAlignments)[number];
34
+ /** Text alignment for fullhd viewport (1408px and above). */
35
+ textAlignFullhd?: (typeof validAlignments)[number];
36
+ }
37
+ /**
38
+ * A hook that generates Bulma typography helper classes, including
39
+ * viewport-specific text size and alignment variants.
40
+ *
41
+ * @function useTypographyClasses
42
+ * @param props - Typography-related Bulma helper props.
43
+ * @returns A space-separated string of typography helper classes.
44
+ * @example
45
+ * const typographyClasses = useTypographyClasses({
46
+ * textSize: '3',
47
+ * textWeight: 'bold',
48
+ * });
49
+ * // typographyClasses: 'is-size-3 has-text-weight-bold'
50
+ */
51
+ export declare const useTypographyClasses: (props: BulmaTypographyProps) => string;
@@ -0,0 +1,43 @@
1
+ import { validVisibilities, BulmaViewportProps, BulmaDisplayProps } from './bulmaClassHelpers.js';
2
+ /**
3
+ * Props for applying Bulma visibility and display helper classes.
4
+ */
5
+ export interface BulmaVisibilityProps extends BulmaViewportProps, BulmaDisplayProps {
6
+ /** Visibility (e.g., 'hidden', 'sr-only'). */
7
+ visibility?: (typeof validVisibilities)[number];
8
+ /** Visibility for mobile viewport (up to 768px). */
9
+ visibilityMobile?: (typeof validVisibilities)[number];
10
+ /** Visibility for tablet viewport (769px - 1023px). */
11
+ visibilityTablet?: (typeof validVisibilities)[number];
12
+ /** Visibility for tablet-only viewport (769px - 1023px, excludes desktop+). */
13
+ visibilityTabletOnly?: (typeof validVisibilities)[number];
14
+ /** Visibility for touch viewport (up to 1023px; mobile + tablet). */
15
+ visibilityTouch?: (typeof validVisibilities)[number];
16
+ /** Visibility for desktop viewport (1024px - 1215px). */
17
+ visibilityDesktop?: (typeof validVisibilities)[number];
18
+ /** Visibility for desktop-only viewport (1024px - 1215px, excludes widescreen+). */
19
+ visibilityDesktopOnly?: (typeof validVisibilities)[number];
20
+ /** Visibility for widescreen viewport (1216px - 1407px). */
21
+ visibilityWidescreen?: (typeof validVisibilities)[number];
22
+ /** Visibility for widescreen-only viewport (1216px - 1407px, excludes fullhd). */
23
+ visibilityWidescreenOnly?: (typeof validVisibilities)[number];
24
+ /** Visibility for fullhd viewport (1408px and above). */
25
+ visibilityFullhd?: (typeof validVisibilities)[number];
26
+ }
27
+ /**
28
+ * A hook that generates Bulma visibility and display helper classes. This hook
29
+ * owns all display class emission, including viewport-specific display props,
30
+ * the legacy display/viewport combination, and `display: 'none'` mapping to
31
+ * `is-hidden`.
32
+ *
33
+ * @function useVisibilityClasses
34
+ * @param props - Visibility- and display-related Bulma helper props.
35
+ * @returns A space-separated string of visibility and display helper classes.
36
+ * @example
37
+ * const visibilityClasses = useVisibilityClasses({
38
+ * display: 'flex',
39
+ * visibilityMobile: 'hidden',
40
+ * });
41
+ * // visibilityClasses: 'is-hidden-mobile is-flex'
42
+ */
43
+ export declare const useVisibilityClasses: (props: BulmaVisibilityProps) => string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Attaches compound sub-components as statics on a base component and
3
+ * optionally sets the parent's displayName.
4
+ *
5
+ * Internal helper — it MUST mutate and return the same function object
6
+ * (`Object.assign`), never wrap the base in a new function: identity checks
7
+ * like `child.type === ModalCard` (Modal) and Field's displayName-based
8
+ * child detection rely on the attached component being the same object as
9
+ * the separately exported one.
10
+ *
11
+ * displayName is only ever set on the parent (and only when provided) —
12
+ * sub-components keep whatever displayName they declare themselves.
13
+ */
14
+ export declare function withSubComponents<Base extends {
15
+ displayName?: string;
16
+ }, Subs extends Record<string, unknown>>(base: Base, subs: Subs, displayName?: string): Base & Subs;