@timebraid/vue 1.3.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.
- package/README.md +77 -0
- package/dist/index.d.ts +840 -0
- package/dist/style.css +1 -0
- package/dist/timebraid-vue.js +1628 -0
- package/dist/timebraid-vue.umd.cjs +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# @timebraid/vue
|
|
2
|
+
|
|
3
|
+
Vue 3 components for Timebraid, built only on `@timebraid/tokens` variables.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @timebraid/vue @timebraid/tokens vue
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { TBtn, TPill, TIcon } from '@timebraid/vue'
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<TBtn size="xl" icon="download">Download for macOS</TBtn>
|
|
16
|
+
<TPill :running="[{ id: '1', task: 'Logo exploration', project: 'Acme rebrand', color: 'var(--chart-1)', since: '9:12', seconds: 8047 }]" />
|
|
17
|
+
<TIcon name="play" :size="16" />
|
|
18
|
+
</template>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Import `@timebraid/tokens/styles.css` once in `main.ts` (or `@timebraid/vue/style.css`, which bundles the same tokens). Light is `:root`, dark is `[data-theme="dark"]`, set by `watchTheme`. `watchTheme(() => pref.value, root)` returns `{ refresh, stop }`; call `refresh()` whenever the preference changes and `stop()` on teardown.
|
|
22
|
+
|
|
23
|
+
## Components
|
|
24
|
+
|
|
25
|
+
| | Purpose |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `TGroup` | Grouped inset section: uppercase header, optional footer, card background |
|
|
28
|
+
| `TRow` | Inset list row: icon, title, subtitle, value, chevron |
|
|
29
|
+
| `TSeg` | Segmented control with an animated thumb |
|
|
30
|
+
| `TBtn` | Button: primary, tinted, gray, plain, danger, white; four sizes |
|
|
31
|
+
| `TIconBtn` | Round icon-only button |
|
|
32
|
+
| `TToggle` | Switch control |
|
|
33
|
+
| `TField` | Filled text field |
|
|
34
|
+
| `TSelect` | Trailing-value select with `chevrons-up-down`, used inside `TRow`; name the control with `label` (rendered visually hidden) or `ariaLabel` |
|
|
35
|
+
| `TBadge` | Status pill: neutral, running, green, red, soon |
|
|
36
|
+
| `TBar` | Animated value bar |
|
|
37
|
+
| `TAvatar` | Initials avatar |
|
|
38
|
+
| `TLargeTitle` | Large collapsing page title |
|
|
39
|
+
| `TSheet` | Centred sheet on desktop, bottom sheet on phones |
|
|
40
|
+
| `TDot` | Status dot with a pulsing ring when running |
|
|
41
|
+
| `TDur` | Duration readout, mono and tabular |
|
|
42
|
+
| `TWaterfall` | Parallel-time waterfall timeline for reports |
|
|
43
|
+
| `TPill` | The floating always-visible timer pill; the `popover` slot (scoped with `running`) replaces the popover body, and `open` is consumer-owned through `update:open` |
|
|
44
|
+
| `TWorkspaceSwitcher` | Workspace picker popover |
|
|
45
|
+
| `TTimerBar` | Phone bottom timer bar |
|
|
46
|
+
| `TStrokes` | Oversized faded tally strokes behind sign-in and empty states |
|
|
47
|
+
| `TIOSNav` | iOS large-title nav bar that collapses on scroll |
|
|
48
|
+
| `TIOSTabBar` | iOS tab bar |
|
|
49
|
+
| `TAndroidTop` | Android top app bar |
|
|
50
|
+
| `TAndroidNavBar` | Android bottom navigation bar |
|
|
51
|
+
| `TIcon` | Lucide glyph via CSS mask, follows `currentColor` |
|
|
52
|
+
| `TLogo` | The mark, correct artwork per size |
|
|
53
|
+
| `TCodeInput` | 6-digit code entry |
|
|
54
|
+
| `TAuthCard` | Sign-in layout card |
|
|
55
|
+
| `TCheckbox` | Checkbox control |
|
|
56
|
+
| `TTooltip` | Hover tooltip |
|
|
57
|
+
|
|
58
|
+
Also exported: `formatDuration(seconds, 'clock' | 'short' | 'compact')`, `PROJECT_COLORS`, `TIMEBRAID_ICON_BASE`, `DEFAULT_ICON_BASE`, `resolveTheme`, `applyTheme`, `watchTheme`, `THEME_PREFERENCES`.
|
|
59
|
+
|
|
60
|
+
`TIcon` masks its glyph from `https://unpkg.com/lucide-static@latest/icons/`. Self-host the glyphs and point every icon at them in one line. An iOS WebView under `tauri://localhost` needs this, because it cannot paint a cross-origin mask:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import { TIMEBRAID_ICON_BASE } from '@timebraid/vue'
|
|
64
|
+
app.provide(TIMEBRAID_ICON_BASE, '/icons/')
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
A `base` prop on a single `TIcon` still wins over the provided value.
|
|
68
|
+
|
|
69
|
+
## Rules
|
|
70
|
+
|
|
71
|
+
- `TBadge tone="soon"` with the words "Coming soon" on every roadmap item.
|
|
72
|
+
- Indigo (`--accent`) is the accent and the running colour. Amber lives in the app icon only.
|
|
73
|
+
- Project colours come from `PROJECT_COLORS` (Okabe-Ito). Nothing else.
|
|
74
|
+
|
|
75
|
+
## Develop
|
|
76
|
+
|
|
77
|
+
`pnpm dev` opens the playground with every component and state, and a dark/light switch.
|