@allxsmith/bestax-bulma 5.1.2 → 5.2.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.
@@ -17,7 +17,7 @@ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
17
17
  className?: string;
18
18
  textColor?: (typeof validColors)[number] | 'inherit' | 'current';
19
19
  bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
20
- as?: 'a' | 'button';
20
+ as?: React.ElementType;
21
21
  href?: string;
22
22
  onClick?: React.MouseEventHandler<HTMLButtonElement> | React.MouseEventHandler<HTMLAnchorElement>;
23
23
  target?: string;
@@ -5,6 +5,7 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
5
5
  textColor?: (typeof validColors)[number] | 'inherit' | 'current';
6
6
  bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
7
7
  isActive?: boolean;
8
+ as?: React.ElementType;
8
9
  children?: React.ReactNode;
9
10
  }
10
11
  export declare const Link: React.FC<LinkProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allxsmith/bestax-bulma",
3
- "version": "5.1.2",
3
+ "version": "5.2.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",
@@ -0,0 +1,55 @@
1
+ # scss/ — styles for the bestax "extras"
2
+
3
+ **Only extras get SCSS.** Components that are stock Bulma (Button, Card, Navbar, …) ship no CSS
4
+ of their own — Bulma provides it. A partial exists only for components that extend beyond Bulma
5
+ (Carousel, Collapse, Dialog, the extended form inputs, …) — or that extend a stock component
6
+ (e.g. `_tabs.scss` adds vertical Tabs). The `_index.scss` files are the authoritative inventory.
7
+
8
+ ## Structure
9
+
10
+ - `bestax.scss` — main entrypoint: `@use 'bulma/sass' with ($primary: #1e6b99)` + all the extras
11
+ - `extras.scss` — extras-only entrypoint (builds `dist/extras.css`, for apps bringing their own Bulma)
12
+ - `components/`, `form/`, `elements/`, `helpers/` — one `_foo.scss` partial per extra,
13
+ **registered in that folder's `_index.scss`** (an unregistered partial silently ships nothing)
14
+ - `_variables.scss` — `$extras-*` tokens derived from Bulma's HSL channel vars (`--bulma-primary-h/s/l`)
15
+ - `_mixins.scss` — shared mixins: `extras-transition`, `extras-focus-outline` (a11y), `extras-sr-only`
16
+ - `versions/` — the flavor builds: `bestax-prefixed`, `bestax-no-helpers`, `bestax-no-dark-mode`,
17
+ `bestax-no-helpers-prefixed`. A new partial is included by all of them automatically (they reuse
18
+ the same `_index` imports), but must **work** under each — especially the prefixed build.
19
+
20
+ ## The pattern (every partial follows it — `components/_collapse.scss` is the template)
21
+
22
+ ```scss
23
+ @use 'bulma/sass/utilities/initial-variables' as iv;
24
+ @use 'bulma/sass/utilities/css-variables' as cv;
25
+ @use '../mixins' as *;
26
+
27
+ // 1. SCSS vars, !default, derived from Bulma tokens — never hardcoded hex
28
+ $collapse-border-color: cv.getVar('border') !default;
29
+
30
+ // 2. Register them as --bulma-* CSS vars on the root class
31
+ .#{iv.$class-prefix}collapse {
32
+ @include cv.register-vars(
33
+ (
34
+ 'collapse-border-color': #{$collapse-border-color},
35
+ )
36
+ );
37
+ }
38
+
39
+ // 3. Consume only via cv.getVar(); class names only via the prefix interpolation
40
+ .#{iv.$class-prefix}collapse.#{iv.$class-prefix}is-bordered {
41
+ border: 1px solid cv.getVar('collapse-border-color');
42
+ }
43
+ ```
44
+
45
+ Rules the pattern encodes:
46
+
47
+ - **Never a literal class selector** (`.collapse`) — always `.#{iv.$class-prefix}collapse`,
48
+ or the `bestax-prefixed` flavor breaks silently.
49
+ - **Never a raw color/size value** in declarations — derive from Bulma tokens via `cv.getVar()`
50
+ so the extra is themeable exactly like stock Bulma (`--bulma-collapse-border-color: …`).
51
+ This is the contract the `Theme` component and the `bestax-theming` skill rely on.
52
+ - **Reuse `extras-*` mixins** for transitions, focus outlines, and screen-reader-only content
53
+ instead of re-rolling them (focus style consistency is an a11y requirement).
54
+ - New CSS variables should be documented in
55
+ `skills/bestax-theming/references/css-variables.md` alongside the docs page.