@emdzej/bimmerz-ui 0.1.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/LICENSE +131 -0
- package/README.md +73 -0
- package/package.json +41 -0
- package/src/Brand.svelte +25 -0
- package/src/MStripe.svelte +32 -0
- package/src/index.ts +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree
|
|
8
|
+
to them as both strict obligations and conditions to all
|
|
9
|
+
your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the
|
|
14
|
+
software to do everything you might do with the software
|
|
15
|
+
that would otherwise infringe the licensor's copyright
|
|
16
|
+
in it for any permitted purpose. However, you may
|
|
17
|
+
only distribute the software according to [Distribution
|
|
18
|
+
License](#distribution-license) and make changes or new works
|
|
19
|
+
based on the software according to [Changes and New Works
|
|
20
|
+
License](#changes-and-new-works-license).
|
|
21
|
+
|
|
22
|
+
## Distribution License
|
|
23
|
+
|
|
24
|
+
The licensor grants you an additional copyright license
|
|
25
|
+
to distribute copies of the software. Your license
|
|
26
|
+
to distribute covers distributing the software with
|
|
27
|
+
changes and new works permitted by [Changes and New Works
|
|
28
|
+
License](#changes-and-new-works-license).
|
|
29
|
+
|
|
30
|
+
## Notices
|
|
31
|
+
|
|
32
|
+
You must ensure that anyone who gets a copy of any part of
|
|
33
|
+
the software from you also gets a copy of these terms or the
|
|
34
|
+
URL for them above, as well as copies of any plain-text lines
|
|
35
|
+
beginning with `Required Notice:` that the licensor provided
|
|
36
|
+
with the software. For example:
|
|
37
|
+
|
|
38
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
39
|
+
|
|
40
|
+
## Changes and New Works License
|
|
41
|
+
|
|
42
|
+
The licensor grants you an additional copyright license to
|
|
43
|
+
make changes and new works based on the software for any
|
|
44
|
+
permitted purpose.
|
|
45
|
+
|
|
46
|
+
## Patent License
|
|
47
|
+
|
|
48
|
+
The licensor grants you a patent license for the software that
|
|
49
|
+
covers patent claims the licensor can license, or becomes able
|
|
50
|
+
to license, that you would infringe by using the software.
|
|
51
|
+
|
|
52
|
+
## Noncommercial Purposes
|
|
53
|
+
|
|
54
|
+
Any noncommercial purpose is a permitted purpose.
|
|
55
|
+
|
|
56
|
+
## Personal Uses
|
|
57
|
+
|
|
58
|
+
Personal use for research, experiment, and testing for
|
|
59
|
+
the benefit of public knowledge, personal study, private
|
|
60
|
+
entertainment, hobby projects, amateur pursuits, or religious
|
|
61
|
+
observance, without any anticipated commercial application,
|
|
62
|
+
is use for a permitted purpose.
|
|
63
|
+
|
|
64
|
+
## Noncommercial Organizations
|
|
65
|
+
|
|
66
|
+
Use by any charitable organization, educational institution,
|
|
67
|
+
public research organization, public safety or health
|
|
68
|
+
organization, environmental protection organization,
|
|
69
|
+
or government institution is use for a permitted purpose
|
|
70
|
+
regardless of the source of funding or obligations resulting
|
|
71
|
+
from the funding.
|
|
72
|
+
|
|
73
|
+
## Fair Use
|
|
74
|
+
|
|
75
|
+
You may have "fair use" rights for the software under the
|
|
76
|
+
law. These terms do not limit them.
|
|
77
|
+
|
|
78
|
+
## No Other Rights
|
|
79
|
+
|
|
80
|
+
These terms do not allow you to sublicense or transfer any of
|
|
81
|
+
your licenses to anyone else, or prevent the licensor from
|
|
82
|
+
granting licenses to anyone else. These terms do not imply
|
|
83
|
+
any other licenses.
|
|
84
|
+
|
|
85
|
+
## Patent Defense
|
|
86
|
+
|
|
87
|
+
If you make any written claim that the software infringes or
|
|
88
|
+
contributes to infringement of any patent, your patent license
|
|
89
|
+
for the software granted under these terms ends immediately. If
|
|
90
|
+
your company makes such a claim, your patent license ends
|
|
91
|
+
immediately for work on behalf of your company.
|
|
92
|
+
|
|
93
|
+
## Violations
|
|
94
|
+
|
|
95
|
+
The first time you are notified in writing that you have
|
|
96
|
+
violated any of these terms, or done anything with the software
|
|
97
|
+
not covered by your licenses, your licenses can nonetheless
|
|
98
|
+
continue if you come into full compliance with these terms,
|
|
99
|
+
and take practical steps to correct past violations, within
|
|
100
|
+
32 days of receiving notice. Otherwise, all your licenses
|
|
101
|
+
end immediately.
|
|
102
|
+
|
|
103
|
+
## No Liability
|
|
104
|
+
|
|
105
|
+
***As far as the law allows, the software comes as is, without
|
|
106
|
+
any warranty or condition, and the licensor will not be liable
|
|
107
|
+
to you for any damages arising out of these terms or the use
|
|
108
|
+
or nature of the software, under any kind of legal claim.***
|
|
109
|
+
|
|
110
|
+
## Definitions
|
|
111
|
+
|
|
112
|
+
The **licensor** is the individual or entity offering these
|
|
113
|
+
terms, and the **software** is the software the licensor makes
|
|
114
|
+
available under these terms.
|
|
115
|
+
|
|
116
|
+
**You** refers to the individual or entity agreeing to these
|
|
117
|
+
terms.
|
|
118
|
+
|
|
119
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
120
|
+
or other kind of organization that you work for, plus all
|
|
121
|
+
organizations that have control over, are under the control of,
|
|
122
|
+
or are under common control with that organization. **Control**
|
|
123
|
+
means ownership of substantially all the assets of an entity,
|
|
124
|
+
or the power to direct its management and policies by vote,
|
|
125
|
+
contract, or otherwise. Control can be direct or indirect.
|
|
126
|
+
|
|
127
|
+
**Your licenses** are all the licenses granted to you for the
|
|
128
|
+
software under these terms.
|
|
129
|
+
|
|
130
|
+
**Use** means anything you do with the software requiring one
|
|
131
|
+
of your licenses.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @emdzej/bimmerz-ui
|
|
2
|
+
|
|
3
|
+
Shared **Svelte 5** components for the bimmerz app family. Source-only —
|
|
4
|
+
consumer apps' Vite + svelte-plugin compiles them. No pre-compiled output.
|
|
5
|
+
|
|
6
|
+
## Convention: source-only Svelte libs
|
|
7
|
+
|
|
8
|
+
Svelte components ship as `.svelte` files, not pre-compiled JS. The
|
|
9
|
+
`package.json` carries:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"svelte": "./src/index.ts",
|
|
14
|
+
"types": "./src/index.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./src/index.ts",
|
|
18
|
+
"svelte": "./src/index.ts",
|
|
19
|
+
"import": "./src/index.ts"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The `svelte` export condition is what the consumer's Vite plugin reads to
|
|
26
|
+
locate the source. The `types` condition lets `svelte-check` resolve them
|
|
27
|
+
the same way without an explicit `.d.ts` step.
|
|
28
|
+
|
|
29
|
+
**Why:** Svelte 5's compiler output depends on the consumer's compiler
|
|
30
|
+
version + rune config. Pre-compiling locks the output to whichever Svelte
|
|
31
|
+
version the lib was built against and breaks tree-shaking + HMR in the
|
|
32
|
+
consuming app. Letting consumers compile means every version, every dev
|
|
33
|
+
mode, every runes setting works.
|
|
34
|
+
|
|
35
|
+
A consumer's `vite.config.ts` should also tell `optimizeDeps` about us so
|
|
36
|
+
the dev server pre-bundles the source:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
optimizeDeps: {
|
|
40
|
+
include: ["@emdzej/bimmerz-ui"],
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Required peer setup
|
|
45
|
+
|
|
46
|
+
Components use semantic colour tokens (`bg-surface`, `text-foreground`,
|
|
47
|
+
`text-accent`, …) from [`@emdzej/bimmerz-theme`](../theme). Wire that
|
|
48
|
+
preset into the consumer app's `tailwind.config.ts` first; the
|
|
49
|
+
components break visually without it.
|
|
50
|
+
|
|
51
|
+
## Components
|
|
52
|
+
|
|
53
|
+
| Name | Purpose |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `<Brand body="EDIABAS" suffix="X" />` | Split-colour wordmark — body in foreground, suffix in accent. |
|
|
56
|
+
|
|
57
|
+
More to come — About dialog, Settings dialog scaffolding, Connect button,
|
|
58
|
+
install picker. The existing app-specific implementations in inpax-web /
|
|
59
|
+
ncsx-web / ediabasx-web are slated for consolidation here once their
|
|
60
|
+
shapes stabilise.
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```svelte
|
|
65
|
+
<script lang="ts">
|
|
66
|
+
import { Brand } from "@emdzej/bimmerz-ui";
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<Brand body="EDIABAS" suffix="X" />
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Pair with `@emdzej/bimmerz-theme` for the colour tokens. Each consumer
|
|
73
|
+
app picks its own `accent` colour via `tailwind.config.ts` extend.
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@emdzej/bimmerz-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Shared Svelte 5 components for the bimmerz app family — About dialog, Settings scaffolding, Connect button, brand wordmark, install picker. Source-only — consumer apps' Vite compiles them.",
|
|
6
|
+
"svelte": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./src/index.ts",
|
|
11
|
+
"svelte": "./src/index.ts",
|
|
12
|
+
"import": "./src/index.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"svelte": "^5.0.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@tsconfig/svelte": "^5.0.4",
|
|
23
|
+
"svelte": "^5.0.0",
|
|
24
|
+
"svelte-check": "^4.0.0",
|
|
25
|
+
"typescript": "^5.6.0"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/emdzej/bimmerz.git",
|
|
33
|
+
"directory": "packages/ui"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "svelte-check --tsconfig ./tsconfig.json",
|
|
37
|
+
"test": "vitest run --passWithNoTests",
|
|
38
|
+
"typecheck": "svelte-check --tsconfig ./tsconfig.json",
|
|
39
|
+
"clean": "rm -rf .turbo *.tsbuildinfo"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/Brand.svelte
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Split-colour wordmark used by every bimmerz app:
|
|
4
|
+
* `INPAX`, `NCSX`, `EDIABASX`, `XBUSX` — the body in the primary
|
|
5
|
+
* text colour, the suffix in the per-app accent. Mirrors the
|
|
6
|
+
* convention each app set independently; centralised here so any
|
|
7
|
+
* future re-skin only touches one file.
|
|
8
|
+
*
|
|
9
|
+
* Pass `body` + `suffix` to render. Default styling is `text-sm
|
|
10
|
+
* font-bold tracking-wide`; override via the `class` prop if a
|
|
11
|
+
* larger size is needed (welcome screen vs. top bar).
|
|
12
|
+
*/
|
|
13
|
+
interface Props {
|
|
14
|
+
body: string;
|
|
15
|
+
suffix: string;
|
|
16
|
+
/** Extra Tailwind classes appended to the default wordmark sizing. */
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { body, suffix, class: extraClass = "" }: Props = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<span class="text-sm font-bold tracking-wide {extraClass}">
|
|
24
|
+
<span class="text-foreground">{body}</span><span class="text-accent">{suffix}</span>
|
|
25
|
+
</span>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* BMW M tricolour stripe — three thin bars in the canonical
|
|
4
|
+
* light-blue / dark-blue / red order, identical to the signature
|
|
5
|
+
* carried on M cars' kidney grilles and side skirts and the visual
|
|
6
|
+
* top-bar bimmerz.app + hub.bimmerz.app both use.
|
|
7
|
+
*
|
|
8
|
+
* Renders a `<div role="presentation">` with the `.m-stripe` /
|
|
9
|
+
* `.m-stripe__band--{light|dark|red}` classes from
|
|
10
|
+
* `@emdzej/bimmerz-theme/tokens.css`. Consumer must have those
|
|
11
|
+
* tokens imported for the colours to resolve.
|
|
12
|
+
*
|
|
13
|
+
* Default height is 4px (the tokens.css default); override via the
|
|
14
|
+
* `class` prop if you want a thicker bar for a hero or a thinner
|
|
15
|
+
* one for a sidebar:
|
|
16
|
+
*
|
|
17
|
+
* <MStripe class="h-1" /> ; 4px (default)
|
|
18
|
+
* <MStripe class="h-2" /> ; 8px
|
|
19
|
+
*/
|
|
20
|
+
interface Props {
|
|
21
|
+
/** Extra Tailwind classes appended to the default `.m-stripe`. */
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const { class: extraClass = "" }: Props = $props();
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class="m-stripe {extraClass}" aria-hidden="true">
|
|
29
|
+
<div class="m-stripe__band m-stripe__band--light"></div>
|
|
30
|
+
<div class="m-stripe__band m-stripe__band--dark"></div>
|
|
31
|
+
<div class="m-stripe__band m-stripe__band--red"></div>
|
|
32
|
+
</div>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface of `@emdzej/bimmerz-ui` — Svelte 5 components +
|
|
3
|
+
* helper types shared across the bimmerz app family.
|
|
4
|
+
*
|
|
5
|
+
* Components are exported as `.svelte` source. The consumer app's
|
|
6
|
+
* Vite + svelte-plugin compiles them — pre-compiling locks the
|
|
7
|
+
* output to a specific Svelte version and breaks tree-shaking, HMR,
|
|
8
|
+
* and rune handling.
|
|
9
|
+
*
|
|
10
|
+
* Tokens (`bg-surface`, `text-foreground`, etc.) come from
|
|
11
|
+
* `@emdzej/bimmerz-theme`'s Tailwind preset; the consumer app must
|
|
12
|
+
* have that preset applied for these components to render correctly.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export { default as Brand } from "./Brand.svelte";
|
|
16
|
+
export { default as MStripe } from "./MStripe.svelte";
|