@thebase/ui 0.0.10 → 0.0.11

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 (47) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +3 -3
  3. package/dist/baseui.esm.js +24 -24
  4. package/dist/baseui.icons.esm.js +1 -1
  5. package/dist/baseui.min.css +1 -1
  6. package/dist/baseui.min.js +24 -24
  7. package/dist/baseui.registry.json +8 -8
  8. package/dist/baseui.templates.xml +289 -289
  9. package/dist/runtime/milkdown/milkdown-editor.js +1 -1
  10. package/dist/runtime/milkdown/milkdown-text-editor.js +1 -1
  11. package/dist/themes/baseui-dark.css +1 -1
  12. package/dist/themes/baseui-light.css +1 -1
  13. package/docs/components/accordion.md +4 -4
  14. package/docs/components/avatar.md +1 -1
  15. package/docs/components/block-viewer.md +1 -1
  16. package/docs/components/breadcrumb.md +1 -1
  17. package/docs/components/calendar.md +1 -1
  18. package/docs/components/carousel.md +1 -1
  19. package/docs/components/chart.md +3 -3
  20. package/docs/components/combobox.md +1 -1
  21. package/docs/components/command.md +1 -1
  22. package/docs/components/context-menu.md +1 -1
  23. package/docs/components/data-table.md +3 -3
  24. package/docs/components/date-picker.md +1 -1
  25. package/docs/components/dialog.md +5 -5
  26. package/docs/components/form.md +29 -29
  27. package/docs/components/input-otp.md +1 -1
  28. package/docs/components/input.md +1 -1
  29. package/docs/components/markdown.md +1 -1
  30. package/docs/components/message-scroller.md +1 -1
  31. package/docs/components/message.md +1 -1
  32. package/docs/components/popover.md +1 -1
  33. package/docs/components/pwa.md +1 -1
  34. package/docs/components/questionnaire.md +1 -1
  35. package/docs/components/resizable.md +1 -1
  36. package/docs/components/scroll-area.md +1 -1
  37. package/docs/components/shell.md +2 -2
  38. package/docs/components/sidebar.md +15 -15
  39. package/docs/components/text-editor.md +1 -1
  40. package/docs/components/theme-button.md +2 -2
  41. package/docs/components/toast.md +16 -2
  42. package/docs/components/toggle-group.md +1 -1
  43. package/docs/components/toggle.md +1 -1
  44. package/docs/components/tooltip.md +1 -1
  45. package/docs/runtime-api.md +26 -0
  46. package/docs/theming.md +3 -3
  47. package/package.json +1 -1
@@ -237,16 +237,16 @@ See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for
237
237
  ## Static component
238
238
 
239
239
  ```base-ui
240
- <div class="baseui-sidebar-demo-frame">
240
+ <div class="bu-sidebar-demo-frame">
241
241
  <aside b-ui="sidebar" b-att-state="open">
242
242
  <div b-sidebar-header>
243
- <a href="#" class="baseui-sidebar-demo-brand">
244
- <span class="baseui-sidebar-demo-brand-mark"><span b-icon="gallery-vertical-end"></span></span>
245
- <span class="baseui-sidebar-demo-meta">
246
- <span class="baseui-sidebar-demo-title">Acme Inc</span>
247
- <span class="baseui-sidebar-demo-email">Enterprise</span>
243
+ <a href="#" class="bu-sidebar-demo-brand">
244
+ <span class="bu-sidebar-demo-brand-mark"><span b-icon="gallery-vertical-end"></span></span>
245
+ <span class="bu-sidebar-demo-meta">
246
+ <span class="bu-sidebar-demo-title">Acme Inc</span>
247
+ <span class="bu-sidebar-demo-email">Enterprise</span>
248
248
  </span>
249
- <span class="baseui-sidebar-demo-chevrons" b-icon="chevrons-up-down"></span>
249
+ <span class="bu-sidebar-demo-chevrons" b-icon="chevrons-up-down"></span>
250
250
  </a>
251
251
  </div>
252
252
 
@@ -285,18 +285,18 @@ See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for
285
285
  </div>
286
286
 
287
287
  <div b-sidebar-footer>
288
- <a href="#" class="baseui-sidebar-demo-user">
289
- <span b-ui="avatar" class="baseui-sidebar-demo-avatar">SC</span>
290
- <span class="baseui-sidebar-demo-meta">
291
- <span class="baseui-sidebar-demo-title">shadcn</span>
292
- <span class="baseui-sidebar-demo-email">m@example.com</span>
288
+ <a href="#" class="bu-sidebar-demo-user">
289
+ <span b-ui="avatar" class="bu-sidebar-demo-avatar">SC</span>
290
+ <span class="bu-sidebar-demo-meta">
291
+ <span class="bu-sidebar-demo-title">shadcn</span>
292
+ <span class="bu-sidebar-demo-email">m@example.com</span>
293
293
  </span>
294
- <span class="baseui-sidebar-demo-chevrons" b-icon="chevrons-up-down"></span>
294
+ <span class="bu-sidebar-demo-chevrons" b-icon="chevrons-up-down"></span>
295
295
  </a>
296
296
  </div>
297
297
  </aside>
298
- <main class="baseui-sidebar-demo-main">
299
- <button class="baseui-sidebar-trigger" type="button" aria-label="Toggle Sidebar">
298
+ <main class="bu-sidebar-demo-main">
299
+ <button class="bu-sidebar-trigger" type="button" aria-label="Toggle Sidebar">
300
300
  <span b-icon="panel-left"></span>
301
301
  </button>
302
302
  </main>
@@ -86,7 +86,7 @@ Or the same session hosted on an external websocket backend instead of peer-to-p
86
86
  - `b-att-placeholder` / `placeholder` — empty-editor hint text.
87
87
  - `b-att-collaborative` / `collaborative` — set to `"true"` to connect through Yjs; off by default.
88
88
  - `b-att-provider` / `provider` — collaboration transport: `"webrtc"` (default, peer-to-peer) or `"websocket"` (connects to an external y-websocket-compatible backend).
89
- - `b-att-room` / `room` — document/room name for collaborative sessions (defaults to `baseui-text-editor`); shared across peers for y-webrtc, or used as the document name on the y-websocket backend.
89
+ - `b-att-room` / `room` — document/room name for collaborative sessions (defaults to `bu-text-editor`); shared across peers for y-webrtc, or used as the document name on the y-websocket backend.
90
90
  - `b-att-url` / `url` — y-websocket server URL (e.g. `wss://your-backend.example.com/mkdn`), required when `provider` is `"websocket"`. Ignored for `"webrtc"`.
91
91
  - `b-att-password` / `password` — optional y-webrtc room password. Ignored for `"websocket"`.
92
92
  - `b-att-signaling` / `signaling` — comma-separated signaling URLs for the static API, or an array prop for Owl. y-webrtc only.
@@ -13,7 +13,7 @@ import { ThemeButton } from "@thebase/ui";
13
13
  ```
14
14
 
15
15
  ```base-ui
16
- <ThemeButton variant="'outline'" storageKey="'baseui-theme'"/>
16
+ <ThemeButton variant="'outline'" storageKey="'bu-theme'"/>
17
17
  ```
18
18
 
19
19
  | Component | Prop | Type | Notes |
@@ -50,7 +50,7 @@ Theme changes dispatch `baseui:theme-change` on `document` with `{ theme }` in `
50
50
 
51
51
  ## CSS variables
52
52
 
53
- The component inherits Button and Icon tokens, including `--baseui-radius-lg`, `--baseui-primary`, `--baseui-border`, and `--baseui-icon-size`.
53
+ The component inherits Button and Icon tokens, including `--b-radius-lg`, `--b-primary`, `--b-border`, and `--b-icon-size`.
54
54
 
55
55
  ## Accessibility behavior
56
56
 
@@ -27,6 +27,7 @@ The toast stays hidden until `open`/`state` becomes truthy (never shows on mount
27
27
  | `Toast` | `open` | `Boolean` | optional, default `false` — never shown until set to `true` |
28
28
  | `Toast` | `variant` | `String` | optional |
29
29
  | `Toast` | `delay` | `Number` | optional, default `3000` — auto-hides after this many ms; pass `0` to disable auto-hide |
30
+ | `Toast` | `position` | `String` | optional — `"top-left"`, `"top-right"`, `"bottom-left"`, or `"bottom-right"`; fixes the toast to that screen corner. Omit to render inline where placed |
30
31
  | `Toast` | `className` | `String` | optional |
31
32
  | `Toast` | `onOpenChange` | `Function` | optional |
32
33
 
@@ -45,7 +46,7 @@ The toast stays hidden until shown — omit `b-att-state="open"` and call `.show
45
46
 
46
47
  ```base-ui
47
48
  <div class="d-flex flex-column align-items-center gap-3">
48
- <button type="button" class="btn baseui-button btn-outline-secondary" onclick="document.getElementById('demo-toast').BaseUIToast.show()">Show Toast</button>
49
+ <button type="button" class="btn bu-button btn-outline-secondary" onclick="document.getElementById('demo-toast').BaseUIToast.show()">Show Toast</button>
49
50
  <div id="demo-toast" b-ui="toast" b-att-delay="3000">
50
51
  <button b-toast-close type="button">Close</button>
51
52
  Saved successfully.
@@ -55,4 +56,17 @@ The toast stays hidden until shown — omit `b-att-state="open"` and call `.show
55
56
 
56
57
  Programmatic API: after mount, call `element.BaseUIToast.show()` or `element.BaseUIToast.hide()`. Events: `baseui:open`, `baseui:close`.
57
58
 
58
- Toasts are backed by `bootstrap.Toast`: the root receives Bootstrap's `toast fade` classes, and visibility is driven by Bootstrap's own `show`/`showing` classes (not `hidden`). The close button(s) carry `data-bs-dismiss="toast"` in addition to the `b-toast-close`/`baseui-toast-close` selector, so Bootstrap's own delegated dismiss handler drives them.
59
+ Toasts are backed by `bootstrap.Toast`: the root receives Bootstrap's `toast fade` classes, and visibility is driven by Bootstrap's own `show`/`showing` classes (not `hidden`). The close button(s) carry `data-bs-dismiss="toast"` in addition to the `b-toast-close`/`bu-toast-close` selector, so Bootstrap's own delegated dismiss handler drives them.
60
+
61
+ ### Screen-corner placement
62
+
63
+ Set `b-att-position` to `top-left`, `top-right`, `bottom-left`, or `bottom-right` to fix the toast to that corner of the viewport. The toast element itself gets the Bootstrap `toast-container position-fixed p-3 pe-auto` classes plus the matching edge utility classes (`top-0`/`bottom-0` + `start-0`/`end-0`) merged in — no wrapper element. Omit the attribute to leave the toast inline in the document flow (the previous, default behavior):
64
+
65
+ ```base-ui
66
+ <div id="corner-toast" b-ui="toast" b-att-position="bottom-right" b-att-delay="3000">
67
+ <button b-toast-close type="button">Close</button>
68
+ Saved successfully.
69
+ </div>
70
+ ```
71
+
72
+ The pure Owl `Toast` component takes the same values via its `position` prop.
@@ -62,7 +62,7 @@ Interactive components emit documented `baseui:*` events from their root element
62
62
 
63
63
  ## CSS variables
64
64
 
65
- The component inherits BaseUI semantic tokens such as `--baseui-surface`, `--baseui-border`, `--baseui-primary`, and `--baseui-radius`.
65
+ The component inherits BaseUI semantic tokens such as `--b-surface`, `--b-border`, `--b-primary`, and `--b-radius`.
66
66
 
67
67
  ## Accessibility behavior
68
68
 
@@ -63,7 +63,7 @@ Interactive components emit documented `baseui:*` events from their root element
63
63
 
64
64
  ## CSS variables
65
65
 
66
- The component inherits BaseUI semantic tokens such as `--baseui-surface`, `--baseui-border`, `--baseui-primary`, and `--baseui-radius`.
66
+ The component inherits BaseUI semantic tokens such as `--b-surface`, `--b-border`, `--b-primary`, and `--b-radius`.
67
67
 
68
68
  ## Accessibility behavior
69
69
 
@@ -58,7 +58,7 @@ Interactive components emit documented `baseui:*` events from their root element
58
58
 
59
59
  ## CSS variables
60
60
 
61
- The component inherits BaseUI semantic tokens such as `--baseui-surface`, `--baseui-border`, `--baseui-primary`, and `--baseui-radius`. The popup itself is styled by Bootstrap's own bundled `.tooltip`/`.tooltip-arrow`/`.tooltip-inner` CSS (loaded via `dist/baseui.min.css`), not BaseUI's own classes.
61
+ The component inherits BaseUI semantic tokens such as `--b-surface`, `--b-border`, `--b-primary`, and `--b-radius`. The popup itself is styled by Bootstrap's own bundled `.tooltip`/`.tooltip-arrow`/`.tooltip-inner` CSS (loaded via `dist/baseui.min.css`), not BaseUI's own classes.
62
62
 
63
63
  ## Accessibility behavior
64
64
 
@@ -26,3 +26,29 @@ Mounted components dispatch lifecycle events on their root element:
26
26
  `BaseUI.theme.set(...)` is the low-level setter. For persisted light/dark toggles, button-label synchronization, URL `?theme=` overrides, and iframe preview sync, import `createThemeController` from `@base/theme` in browser import maps or `@thebase/ui` in npm/bundler apps.
27
27
 
28
28
  `BaseUI.mountAll()` is for static `b-ui`/`b-att-*` markers and `b-icon` markers only. It does not register Owl component tags (`<Button/>`, `<Card/>`, ...) and does not know about `@thebase/ui` or `dist/baseui.templates.xml`. To use pure Owl components, import their classes, fetch the templates XML, and list those classes in your own component's `static components`; see [Pure Owl Components](owl-components.md).
29
+
30
+ ## `cn()` class-name helper
31
+
32
+ `cn(...classNames)` joins strings, arrays, and falsy values into one space-separated class string, flattening nested arrays and skipping anything falsy:
33
+
34
+ ```js
35
+ import { cn } from "@thebase/ui";
36
+
37
+ cn("btn", isActive && "active", ["bu-button", className]);
38
+ // "btn active bu-button my-class" (when isActive is truthy and className is "my-class")
39
+ ```
40
+
41
+ It's a standalone named export — `import { cn } from "@thebase/ui"` in npm/bundler apps, or `BaseUIBundle.cn` in the browser IIFE global — not a method on `BaseUI` itself. Use it to build your own components' class lists on top of BaseUI's conventions.
42
+
43
+ ## `mergeStyle()` inline-style helper
44
+
45
+ `mergeStyle(...styles)` combines a component's own computed inline style with a caller-supplied `style` (string or object) into one `;`-joined declaration string, dropping empty/nullish entries. Object keys may be camelCase (converted to kebab-case); later entries win on conflicting properties since they're appended last:
46
+
47
+ ```js
48
+ import { mergeStyle } from "@thebase/ui";
49
+
50
+ mergeStyle("--b-progress-value:50%", { color: "red" }, "opacity:0.5;");
51
+ // "--b-progress-value:50%;color:red;opacity:0.5"
52
+ ```
53
+
54
+ It's a standalone named export — `import { mergeStyle } from "@thebase/ui"` in npm/bundler apps, or `BaseUIBundle.mergeStyle` in the browser IIFE global. Unlike `cn()`, which joins class names with a space, `mergeStyle()` joins CSS declarations with `;` — the two are not interchangeable.
package/docs/theming.md CHANGED
@@ -13,7 +13,7 @@ BaseUI.theme.set("dark");
13
13
  BaseUI.theme.set({ primary: "#0057d8", radius: "0.5rem" });
14
14
  ```
15
15
 
16
- BaseUI maps semantic tokens such as `--baseui-background`, `--baseui-primary`, `--baseui-border`, and `--baseui-radius` into Bootstrap 5 variables. Radius tokens are sourced from the shorter public alias family `--base-radius`, `--base-radius-sm`, `--base-radius-md`, `--base-radius-lg`, `--base-radius-xl`, `--base-radius-2xl`, `--base-radius-3xl`, `--base-radius-4xl`, and `--base-radius-full`, then mirrored to `--baseui-radius*` for component CSS.
16
+ BaseUI maps semantic tokens such as `--b-background`, `--b-primary`, `--b-border`, and `--b-radius` into Bootstrap 5 variables. Radius tokens are sourced from the shorter public alias family `--base-radius`, `--base-radius-sm`, `--base-radius-md`, `--base-radius-lg`, `--base-radius-xl`, `--base-radius-2xl`, `--base-radius-3xl`, `--base-radius-4xl`, and `--base-radius-full`, then mirrored to `--b-radius*` for component CSS.
17
17
 
18
18
  For a reusable theme toggle with persistence, URL override, button-label sync, and iframe preview sync, import the theme helper:
19
19
 
@@ -50,6 +50,6 @@ The documentation and example pages use the same theme infrastructure. Owl examp
50
50
 
51
51
  ## Design tokens
52
52
 
53
- The default light/dark palettes and radius follow the current [shadcn/ui](https://ui.shadcn.com) Base UI neutral theme: black/neutral primary on white in light mode, neutral-900/50 foreground-background inversion in dark mode, neutral `--baseui-secondary`/`--baseui-muted`/`--baseui-accent` surfaces, `--base-radius: var(--radius, 0.625rem)`, and a derived radius scale (`--base-radius-sm|md|lg|xl`, mirrored as `--baseui-radius-sm|md|lg|xl`) and shadow scale (`--baseui-shadow-sm|md|lg`) for consistent elevation across popovers, menus, dialogs, and toasts. BaseUI reads an existing upstream `--radius` value when present, but it does not redefine `--radius` back to `--baseui-radius`; that one-way bridge avoids CSS custom-property cycles. `--baseui-card`/`--baseui-popover` alias `--baseui-surface` for shadcn-token-name parity.
53
+ The default light/dark palettes and radius follow the current [shadcn/ui](https://ui.shadcn.com) Base UI neutral theme: black/neutral primary on white in light mode, neutral-900/50 foreground-background inversion in dark mode, neutral `--b-secondary`/`--b-muted`/`--b-accent` surfaces, `--base-radius: var(--radius, 0.625rem)`, and a derived radius scale (`--base-radius-sm|md|lg|xl`, mirrored as `--b-radius-sm|md|lg|xl`) and shadow scale (`--b-shadow-sm|md|lg`) for consistent elevation across popovers, menus, dialogs, and toasts. BaseUI reads an existing upstream `--radius` value when present, but it does not redefine `--radius` back to `--b-radius`; that one-way bridge avoids CSS custom-property cycles. `--b-card`/`--b-popover` alias `--b-surface` for shadcn-token-name parity.
54
54
 
55
- Because BaseUI ships Bootstrap's stock precompiled CSS, most `.btn-*`/badge colors are not driven by `--bs-*` variables directly — `src/styles/baseui.css` re-points the `.btn-primary`/`.btn-secondary`/`.btn-danger`/`.btn-outline-secondary`/`.btn-light` variants at BaseUI tokens so `BaseUI.theme.set(...)` overrides actually render. Badges use their own `baseui-badge-*` classes (`src/components/badge/badge.css`) instead of Bootstrap's `text-bg-*`, which hardcode non-overridable colors.
55
+ Because BaseUI ships Bootstrap's stock precompiled CSS, most `.btn-*`/badge colors are not driven by `--bs-*` variables directly — `src/styles/baseui.css` re-points the `.btn-primary`/`.btn-secondary`/`.btn-danger`/`.btn-outline-secondary`/`.btn-light` variants at BaseUI tokens so `BaseUI.theme.set(...)` overrides actually render. Badges use their own `bu-badge-*` classes (`src/components/badge/badge.css`) instead of Bootstrap's `text-bg-*`, which hardcode non-overridable colors.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thebase/ui",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "CDN-installable Owl and Bootstrap 5 UI component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/baseui.min.js",