@thebase/ui 0.0.11 → 0.0.12

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.
@@ -1,5 +1,11 @@
1
1
  # Tabs
2
2
 
3
+ Matches [shadcn/base's Tabs](https://ui.shadcn.com/docs/components/base/tabs): `TabsList` renders
4
+ as a segmented pill control on a muted background by default, or a transparent underline list via
5
+ `variant="'line'"`. `TabContent`/`b-panel` render as bare panels with no default border or
6
+ background — a bordered/padded look is opt-in via `className` on `TabsContainer` (or the
7
+ consumer's own wrapper), not baked into every panel.
8
+
3
9
  ## Pure Owl component
4
10
 
5
11
  ```js
@@ -21,16 +27,38 @@ import { Tabs, TabContent, TabsContainer, TabsList, TabTrigger } from "@thebase/
21
27
  </div>
22
28
  ```
23
29
 
30
+ The `"line"` variant swaps the segmented pill for a transparent, underline-driven list:
31
+
32
+ ```base-ui
33
+ <div style="max-width: 25rem" class="w-100">
34
+ <Tabs defaultValue="'overview'">
35
+ <TabsList variant="'line'">
36
+ <TabTrigger value="'overview'">Overview</TabTrigger>
37
+ <TabTrigger value="'analytics'">Analytics</TabTrigger>
38
+ </TabsList>
39
+ <TabsContainer>
40
+ <TabContent value="'overview'">View your dashboard metrics.</TabContent>
41
+ <TabContent value="'analytics'">Detailed analytics and insights.</TabContent>
42
+ </TabsContainer>
43
+ </Tabs>
44
+ </div>
45
+ ```
46
+
24
47
  | Component | Prop | Type | Notes |
25
48
  | --- | --- | --- | --- |
26
49
  | `Tabs` | `value` | `String` | controlled active value |
27
50
  | `Tabs` | `defaultValue` | `String` | initial value when uncontrolled |
51
+ | `Tabs` | `orientation` | `String` | `"horizontal"` (default) or `"vertical"` — puts `TabsList` beside `TabsContainer` instead of above it |
28
52
  | `Tabs` | `onChange` | `Function` | called with the newly selected value |
53
+ | `TabsList` | `variant` | `String` | `"default"` (segmented pill, muted background) or `"line"` (transparent, underline indicator) |
29
54
  | `TabTrigger` | `value` | `String` | required, matches a `TabContent value` |
30
55
  | `TabTrigger` | `disabled` | `Boolean` | |
31
56
  | `TabContent` | `value` | `String` | required |
32
57
 
33
- ArrowLeft/ArrowRight move focus and selection between `TabTrigger`s, same as the static API. See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
58
+ ArrowLeft/ArrowRight (or ArrowUp/ArrowDown when vertical) move focus and selection between
59
+ `TabTrigger`s, same as the static API — each trigger's own live `bootstrap.Tab` instance handles
60
+ this natively. See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for how
61
+ to load `@base/owl` and `dist/baseui.templates.xml`.
34
62
 
35
63
  Each `TabTrigger` (`b-tab` button / pure Owl `TabTrigger`'s own root) is driven by a live `bootstrap.Tab` instance: it always carries `role="tab"` plus a `data-bs-target="#<id>"` pointing at its linked pane, and Bootstrap itself manages the pane's `tab-pane fade`/`show`/`active` classes and the trigger's `active`/`aria-selected`/`tabindex` across switches — don't rely on node removal to detect the active panel; every `TabContent`/`b-panel` stays mounted permanently (`role="tabpanel"`, `tab-pane fade` + `show active` on the initially active one).
36
64
 
@@ -45,6 +73,11 @@ Each `TabTrigger` (`b-tab` button / pure Owl `TabTrigger`'s own root) is driven
45
73
  </div>
46
74
  ```
47
75
 
76
+ Add `b-att-variant="line"` on the `[b-ui="tabs"]` host for the transparent underline look instead
77
+ of the default segmented pill. `orientation` is a pure-Owl-only prop — the static markup lays
78
+ `[b-tab]`/`[b-panel]` flat as siblings with no `TabsList`/`TabsContainer`-equivalent grouping
79
+ wrapper to flip into a row/column pair.
80
+
48
81
  Events: `baseui:change` with `{ value }`.
49
82
 
50
83
  Keyboard: Left and Right arrows move between tabs.
@@ -16,11 +16,14 @@ import { Toast } from "@thebase/ui";
16
16
  <span class="fw-medium">Event created</span>
17
17
  <span class="text-body-secondary small">Sunday, December 3 at 9:00 AM</span>
18
18
  </div>
19
+ <t t-set-slot="action">
20
+ <Button variant="'outline'" size="'sm'" onClick="() => state.open = false">Undo</Button>
21
+ </t>
19
22
  </Toast>
20
23
  </div>
21
24
  ```
22
25
 
23
- The toast stays hidden until `open`/`state` becomes truthy (never shows on mount) and auto-hides after `delay` ms once shown.
26
+ The toast stays hidden until `open`/`state` becomes truthy (never shows on mount) and auto-hides after `delay` ms once shown. The default slot (title/description) sits on the leading edge and grows to fill the available width; the optional `action` slot renders grouped tight against the close button on the trailing edge.
24
27
 
25
28
  | Component | Prop | Type | Notes |
26
29
  | --- | --- | --- | --- |
@@ -30,15 +33,20 @@ The toast stays hidden until `open`/`state` becomes truthy (never shows on mount
30
33
  | `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 |
31
34
  | `Toast` | `className` | `String` | optional |
32
35
  | `Toast` | `onOpenChange` | `Function` | optional |
36
+ | `Toast` | `action` slot | — | optional — e.g. a `<Button/>`, rendered grouped next to the close button (`<t t-set-slot="action">...</t>`) |
33
37
 
34
38
  See [Pure Owl Components](/examples/blocks.html#/docs/guide/owl-components) for how to load `@base/owl` and `dist/baseui.templates.xml`.
35
39
 
36
40
  ## Static component
37
41
 
42
+ The toast root is a flex row: wrap message content in `.bu-toast-content` (grows to fill the width) and any action button plus the close button in `.bu-toast-actions` (grouped tight on the trailing edge).
43
+
38
44
  ```base-ui
39
45
  <div b-ui="toast">
40
- <button b-toast-close type="button">Close</button>
41
- Saved successfully.
46
+ <div class="bu-toast-content">Saved successfully.</div>
47
+ <div class="bu-toast-actions">
48
+ <button b-toast-close type="button">Close</button>
49
+ </div>
42
50
  </div>
43
51
  ```
44
52
 
@@ -48,8 +56,14 @@ The toast stays hidden until shown — omit `b-att-state="open"` and call `.show
48
56
  <div class="d-flex flex-column align-items-center gap-3">
49
57
  <button type="button" class="btn bu-button btn-outline-secondary" onclick="document.getElementById('demo-toast').BaseUIToast.show()">Show Toast</button>
50
58
  <div id="demo-toast" b-ui="toast" b-att-delay="3000">
51
- <button b-toast-close type="button">Close</button>
52
- Saved successfully.
59
+ <div class="bu-toast-content">
60
+ <div class="fw-medium">Event created</div>
61
+ <div class="text-body-secondary small">Sunday, December 3 at 9:00 AM</div>
62
+ </div>
63
+ <div class="bu-toast-actions">
64
+ <button type="button" class="btn bu-button btn-outline-secondary btn-sm">Undo</button>
65
+ <button b-toast-close type="button">Close</button>
66
+ </div>
53
67
  </div>
54
68
  </div>
55
69
  ```
@@ -64,8 +78,10 @@ Set `b-att-position` to `top-left`, `top-right`, `bottom-left`, or `bottom-right
64
78
 
65
79
  ```base-ui
66
80
  <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.
81
+ <div class="bu-toast-content">Saved successfully.</div>
82
+ <div class="bu-toast-actions">
83
+ <button b-toast-close type="button">Close</button>
84
+ </div>
69
85
  </div>
70
86
  ```
71
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thebase/ui",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "CDN-installable Owl and Bootstrap 5 UI component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/baseui.min.js",