@allxsmith/bestax-bulma 5.15.3 → 5.16.0

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.
@@ -10,12 +10,10 @@ export interface NotificationProps extends React.HTMLAttributes<HTMLDivElement>,
10
10
  * Bulma color modifier for the notification (renders `is-<color>`).
11
11
  *
12
12
  * Only `primary`, `link`, `info`, `success`, `warning`, `danger`, `black`,
13
- * `white`, `light`, and `dark` have shipped CSS for `.notification`. The
14
- * other accepted values (`black-bis`, `black-ter`, `grey-darker`,
15
- * `grey-dark`, `grey`, `grey-light`, `grey-lighter`) emit a class no CSS
16
- * rule matches, so the notification renders unstyled; they log a console
17
- * warning in development and will be removed from this union in the next
18
- * major version.
13
+ * `white`, `light`, and `dark` have shipped CSS for `.notification`. Every
14
+ * other value the union accepts emits a class no CSS rule matches, so the
15
+ * notification renders unstyled; those log a console warning in development
16
+ * and will be removed from this union in the next major version.
19
17
  */
20
18
  color?: (typeof validColors)[number];
21
19
  /** Text color helper. */
@@ -50,12 +48,10 @@ export interface NotificationOptions {
50
48
  * Bulma color modifier for the notification (renders `is-<color>`).
51
49
  *
52
50
  * Only `primary`, `link`, `info`, `success`, `warning`, `danger`, `black`,
53
- * `white`, `light`, and `dark` have shipped CSS for `.notification`. The
54
- * other accepted values (`black-bis`, `black-ter`, `grey-darker`,
55
- * `grey-dark`, `grey`, `grey-light`, `grey-lighter`) emit a class no CSS
56
- * rule matches, so the notification renders unstyled; they log a console
57
- * warning in development and will be removed from this union in the next
58
- * major version.
51
+ * `white`, `light`, and `dark` have shipped CSS for `.notification`. Every
52
+ * other value the union accepts emits a class no CSS rule matches, so the
53
+ * notification renders unstyled; those log a console warning in development
54
+ * and will be removed from this union in the next major version.
59
55
  */
60
56
  color?: (typeof validColors)[number];
61
57
  /** Use the light color variant. */
@@ -10,11 +10,10 @@ export interface ProgressProps extends React.ProgressHTMLAttributes<HTMLProgress
10
10
  * Bulma color modifier for the progress bar (renders `is-<color>`).
11
11
  *
12
12
  * Only `primary`, `link`, `info`, `success`, `warning`, `danger`, `black`,
13
- * `white`, `light`, and `dark` have shipped CSS for `.progress`. The other
14
- * accepted values (`black-bis`, `black-ter`, `grey-darker`, `grey-dark`,
15
- * `grey`, `grey-light`, `grey-lighter`) emit a class no CSS rule matches, so
16
- * the bar renders unstyled; they log a console warning in development and
17
- * will be removed from this union in the next major version.
13
+ * `white`, `light`, and `dark` have shipped CSS for `.progress`. Every
14
+ * other value the union accepts emits a class no CSS rule matches, so the
15
+ * bar renders unstyled; those log a console warning in development and will
16
+ * be removed from this union in the next major version.
18
17
  */
19
18
  color?: (typeof validColors)[number];
20
19
  /** Size modifier for the progress bar. */
@@ -0,0 +1,37 @@
1
+ import type React from 'react';
2
+ /**
3
+ * Exactly what `<a>` adds over the attributes every element has: `href`,
4
+ * `target`, `download`, `hrefLang`, `ping`, `referrerPolicy`, `media`, `type`.
5
+ *
6
+ * Subtracted from React's own types rather than listed. Listing them is how
7
+ * `Level.Item` came to reject `download` at `as="a"` — its list said `href`,
8
+ * `target`, `rel` and stopped (#641). A list gains an entry when someone
9
+ * notices; a subtraction gains it when React does.
10
+ *
11
+ * NOT `rel`: React declares it on `HTMLAttributes`, for every element, so the
12
+ * subtraction removes it. A component that withholds `rel` from a non-anchor is
13
+ * making a compatibility choice rather than stating a fact about anchors, and
14
+ * says so where it makes it.
15
+ */
16
+ export type AnchorOnlyAttributes = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof React.HTMLAttributes<HTMLAnchorElement>>;
17
+ /**
18
+ * The runtime mirror of `AnchorOnlyAttributes`, keyed so the two cannot drift.
19
+ *
20
+ * `Record<keyof …, true>` is what links them: the day React adds an anchor
21
+ * attribute, every component deriving its props from `as` accepts it and this
22
+ * object stops compiling until it is named here. A plain array beside a derived
23
+ * type drifts in the one direction that matters — the type accepts the new
24
+ * attribute and the filter lets it leak onto a `<div>`.
25
+ */
26
+ export declare const ANCHOR_ONLY_ATTRS: Readonly<Record<keyof AnchorOnlyAttributes, true>>;
27
+ /**
28
+ * `props` without the keys named in `strip`.
29
+ *
30
+ * The SET is per component and deliberately not shared, because the right
31
+ * answer differs and the differences are principled: how open the component's
32
+ * `as` is, and which of these attributes its own tags legitimately take. What
33
+ * IS shared is the derived source of truth above and this function. Each caller
34
+ * declares its delta next to the set it passes, which is the only place that
35
+ * stays true when a component's `as` changes.
36
+ */
37
+ export declare function omitAttrs<T extends object, K extends string>(props: T, strip: Readonly<Record<K, true>>): Omit<T, K>;
@@ -2,7 +2,7 @@
2
2
  * Valid Bulma color classes.
3
3
  * @example 'primary', 'link', 'info'
4
4
  */
5
- export declare const validColors: readonly ["primary", "link", "info", "success", "warning", "danger", "black", "black-bis", "black-ter", "grey-darker", "grey-dark", "grey", "grey-light", "grey-lighter", "white", "light", "dark"];
5
+ export declare const validColors: readonly ["primary", "link", "info", "success", "warning", "danger", "black", "black-bis", "black-ter", "grey-darker", "grey-dark", "grey", "grey-light", "grey-lighter", "white", "white-bis", "white-ter", "light", "dark"];
6
6
  /**
7
7
  * Valid Bulma color shade suffixes.
8
8
  * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'
@@ -98,6 +98,54 @@ export declare const validFlexGrowShrink: readonly ["0", "1", "2", "3", "4", "5"
98
98
  * @example 'mobile', 'tablet', 'desktop'
99
99
  */
100
100
  export declare const validViewports: readonly ["mobile", "tablet", "tablet-only", "touch", "desktop", "desktop-only", "widescreen", "widescreen-only", "fullhd"];
101
+ /**
102
+ * Valid Bulma float classes.
103
+ * @example 'left', 'right'
104
+ */
105
+ export declare const validFloats: readonly ["left", "right"];
106
+ /**
107
+ * Valid Bulma overflow classes.
108
+ * @example 'clipped'
109
+ */
110
+ export declare const validOverflows: readonly ["clipped"];
111
+ /**
112
+ * Valid Bulma interaction classes.
113
+ * @example 'unselectable', 'clickable'
114
+ */
115
+ export declare const validInteractions: readonly ["unselectable", "clickable"];
116
+ /**
117
+ * Valid Bulma cursor helper values.
118
+ *
119
+ * These share no class stem: `pointer` renders `is-clickable` and `help`
120
+ * renders `is-cursor-help`, so the class each one emits lives in
121
+ * `cursorClasses` rather than being built from the value.
122
+ * @example 'pointer', 'help'
123
+ */
124
+ export declare const validCursors: readonly ["pointer", "help"];
125
+ /**
126
+ * Cursor helper value to the class it renders.
127
+ *
128
+ * A `Record` over `validCursors` on purpose: TypeScript then rejects a value
129
+ * added to the tuple with no class for it, and a class for a value the tuple
130
+ * does not carry, so the accepted set and the rendered classes cannot drift
131
+ * apart.
132
+ */
133
+ export declare const cursorClasses: Record<(typeof validCursors)[number], string>;
134
+ /**
135
+ * Valid Bulma border-radius helper classes.
136
+ * @example 'radiusless'
137
+ */
138
+ export declare const validRadii: readonly ["radiusless"];
139
+ /**
140
+ * Valid Bulma shadow helper classes.
141
+ * @example 'shadowless'
142
+ */
143
+ export declare const validShadows: readonly ["shadowless"];
144
+ /**
145
+ * Valid Bulma responsive helper classes.
146
+ * @example 'mobile', 'narrow'
147
+ */
148
+ export declare const validResponsives: readonly ["mobile", "narrow"];
101
149
  /**
102
150
  * Props for applying a Bulma viewport modifier to viewport-aware helper classes.
103
151
  */
@@ -4,7 +4,7 @@
4
4
  * `has-background-*` helpers DO cover these values — only the
5
5
  * component-modifier form is dead.
6
6
  */
7
- export declare const UNSTYLED_MODIFIER_COLORS: readonly ["black-bis", "black-ter", "grey-darker", "grey-dark", "grey", "grey-light", "grey-lighter"];
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
8
  /** Test-only: re-arm the warn-once registry. */
9
9
  export declare const resetColorDeprecationWarnings: () => void;
10
10
  /**
@@ -50,7 +50,7 @@ export declare const useBulmaClasses: <T extends object>(props: BulmaClassesProp
50
50
  bulmaHelperStyles?: CSSProperties;
51
51
  rest: Omit<T, keyof BulmaClassesProps>;
52
52
  };
53
- export { validColors, validColorShades, validSchemeColors, validSizes, validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, validDisplays, validVisibilities, validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, validViewports, } from './bulmaClassHelpers';
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';
54
54
  export type { BulmaViewportProps, BulmaDisplayProps };
55
55
  export * from './useColorClasses';
56
56
  export * from './useSpacingClasses';
@@ -1,23 +1,24 @@
1
+ import { validCursors, validFloats, validInteractions, validOverflows, validRadii, validResponsives, validShadows } from './bulmaClassHelpers';
1
2
  /**
2
3
  * Props for applying miscellaneous Bulma helper classes.
3
4
  */
4
5
  export interface BulmaOtherProps {
5
6
  /** Float direction (e.g., 'left', 'right'). */
6
- float?: 'left' | 'right';
7
+ float?: (typeof validFloats)[number];
7
8
  /** Overflow behavior (e.g., 'clipped'). */
8
- overflow?: 'clipped';
9
+ overflow?: (typeof validOverflows)[number];
9
10
  /** Applies overlay styling if true. */
10
11
  overlay?: boolean;
11
12
  /** Interaction behavior (e.g., 'unselectable', 'clickable'). */
12
- interaction?: 'unselectable' | 'clickable';
13
+ interaction?: (typeof validInteractions)[number];
13
14
  /** Cursor style (e.g., 'pointer', 'help'). */
14
- cursor?: 'pointer' | 'help';
15
+ cursor?: (typeof validCursors)[number];
15
16
  /** Border radius style (e.g., 'radiusless'). */
16
- radius?: 'radiusless';
17
+ radius?: (typeof validRadii)[number];
17
18
  /** Shadow style (e.g., 'shadowless'). */
18
- shadow?: 'shadowless';
19
+ shadow?: (typeof validShadows)[number];
19
20
  /** Responsive behavior (e.g., 'mobile', 'narrow'). */
20
- responsive?: 'mobile' | 'narrow';
21
+ responsive?: (typeof validResponsives)[number];
21
22
  /** Add Bulma skeleton class if true. */
22
23
  skeleton?: boolean;
23
24
  /** Applies clearfix to fix floating children if true. */
@@ -14,12 +14,10 @@ export interface HeroProps extends React.HTMLAttributes<HTMLElement>, Omit<Bulma
14
14
  * Bulma color modifier for the hero section (renders `is-<color>`).
15
15
  *
16
16
  * Only `primary`, `link`, `info`, `success`, `warning`, `danger`, `black`,
17
- * `white`, `light`, and `dark` have shipped CSS for `.hero`. The other
18
- * accepted values (`black-bis`, `black-ter`, `grey-darker`, `grey-dark`,
19
- * `grey`, `grey-light`, `grey-lighter`, `inherit`, `current`) emit a class
20
- * no CSS rule matches, so the hero renders unstyled; they log a console
21
- * warning in development and will be removed from this union in the next
22
- * major version.
17
+ * `white`, `light`, and `dark` have shipped CSS for `.hero`. Every other
18
+ * value the union accepts emits a class no CSS rule matches, so the hero
19
+ * renders unstyled; those log a console warning in development and will be
20
+ * removed from this union in the next major version.
23
21
  */
24
22
  color?: (typeof validColors)[number] | 'inherit' | 'current';
25
23
  /** Hero size. */
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { type AnchorOnlyAttributes } from '../helpers/anchorAttrs';
2
3
  import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
3
4
  /**
4
5
  * Props for the Level component.
@@ -64,38 +65,20 @@ export interface LevelRightProps extends React.HTMLAttributes<HTMLDivElement>, O
64
65
  * @returns {JSX.Element} The rendered level right section.
65
66
  */
66
67
  export declare const LevelRight: React.FC<LevelRightProps>;
67
- /**
68
- * Exactly what `<a>` adds over the attributes every element has: `href`,
69
- * `target`, `download`, `hrefLang`, `ping`, `referrerPolicy`, `media`, `type`.
70
- *
71
- * NOT `rel`, which React declares on `HTMLAttributes` for every element and the
72
- * subtraction therefore removes. This component withholds it from a non-anchor
73
- * anyway, because it always has — see `ANCHOR_ONLY` in the implementation,
74
- * where it is named separately for that reason.
75
- *
76
- * Subtracted from React's own types rather than listed. Listing them is how this
77
- * component came to reject `download` at `as="a"` — the list said `href`,
78
- * `target`, `rel` and stopped, and #641 is the report. A list gains an entry only
79
- * when someone notices; a subtraction gains it when React does.
80
- *
81
- * They reach the `<a>` branch and no other: declared at every `as` because
82
- * narrowing them to the anchor is source-breaking (#672, `next-major`), and
83
- * withheld at runtime so the type's permissiveness costs no dead markup.
84
- */
85
- type AnchorOnlyAttributes = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof React.HTMLAttributes<HTMLAnchorElement>>;
86
68
  /**
87
69
  * Props for the LevelItem component.
88
70
  *
89
- * The anchor attributes are enumerated here, at every `as`, and forwarded only
90
- * when the tag is an `<a>` — so `<Level.Item as="p" download>` compiles and
71
+ * The anchor attributes arrive through `AnchorOnlyAttributes`, at every `as`, and
72
+ * are forwarded only when the tag is an `<a>` — so `<Level.Item as="p" download>` compiles and
91
73
  * renders a `<p>` without it. That asymmetry is deliberate for now: deriving
92
74
  * them from `as` instead is what makes the dead pair a type error, and it also
93
75
  * stops `const p: LevelItemProps = { href }` compiling for consumers who write
94
76
  * it today. #672 carries that half, labelled `next-major`.
95
77
  *
96
- * What this list must NOT become is a shorter one. Enumerating only `href`,
78
+ * What that set must NOT become is a hand-written list. Enumerating only `href`,
97
79
  * `target` and `rel` made every other anchor attribute a type error even at
98
- * `as="a"`, which is what #641 reported.
80
+ * `as="a"`, which is what #641 reported; `helpers/anchorAttrs.ts` derives it from
81
+ * React instead, and `ANCHOR_ONLY_ATTRS` there is the guard to protect.
99
82
  */
100
83
  export interface LevelItemProps extends AnchorOnlyAttributes, React.HTMLAttributes<HTMLDivElement | HTMLParagraphElement | HTMLAnchorElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
101
84
  /** Element type to render. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allxsmith/bestax-bulma",
3
- "version": "5.15.3",
3
+ "version": "5.16.0",
4
4
  "description": "A fully-typed React component library for the Bulma CSS framework. Build modern UIs quickly with reusable, accessible, and customizable Bulma-based React components.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -99,12 +99,29 @@
99
99
  "agents",
100
100
  "agent-skills"
101
101
  ],
102
+ "typesVersions": {
103
+ "*": {
104
+ "constants": [
105
+ "./dist/types/helpers/bulmaClassHelpers.d.ts"
106
+ ]
107
+ }
108
+ },
102
109
  "exports": {
103
110
  ".": {
104
111
  "types": "./dist/types/index.d.ts",
105
112
  "import": "./dist/index.esm.js",
106
113
  "require": "./dist/index.cjs.js"
107
114
  },
115
+ "./constants": {
116
+ "import": {
117
+ "types": "./dist/types/helpers/bulmaClassHelpers.d.ts",
118
+ "default": "./dist/constants.esm.js"
119
+ },
120
+ "require": {
121
+ "types": "./dist/constants.d.cts",
122
+ "default": "./dist/constants.cjs"
123
+ }
124
+ },
108
125
  "./dist/extras.css": {
109
126
  "default": "./dist/extras.css"
110
127
  },