@trebired/configs 0.5.0 → 0.7.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/.trebired/code-discipline/{config.ts → preset_01/config.ts} +1 -1
- package/.trebired/frontend/{button.ts → preset_01/button.ts} +14 -42
- package/.trebired/frontend/{choice.ts → preset_01/choice.ts} +2 -2
- package/.trebired/frontend/{config.ts → preset_01/config.ts} +1 -1
- package/.trebired/frontend/{palette.ts → preset_01/palette.ts} +1 -1
- package/.trebired/frontend/{theme.ts → preset_01/theme.ts} +2 -0
- package/CHANGELOG.md +15 -0
- package/README.md +20 -13
- package/package.json +6 -14
- /package/.trebired/frontend/{action_control.ts → preset_01/action_control.ts} +0 -0
- /package/.trebired/frontend/{components.ts → preset_01/components.ts} +0 -0
- /package/.trebired/frontend/{data.ts → preset_01/data.ts} +0 -0
- /package/.trebired/frontend/{disclosure.ts → preset_01/disclosure.ts} +0 -0
- /package/.trebired/frontend/{dot.ts → preset_01/dot.ts} +0 -0
- /package/.trebired/frontend/{dropdown.ts → preset_01/dropdown.ts} +0 -0
- /package/.trebired/frontend/{feedback.ts → preset_01/feedback.ts} +0 -0
- /package/.trebired/frontend/{input.ts → preset_01/input.ts} +0 -0
- /package/.trebired/frontend/{loader.ts → preset_01/loader.ts} +0 -0
- /package/.trebired/frontend/{marquee.ts → preset_01/marquee.ts} +0 -0
- /package/.trebired/frontend/{media.ts → preset_01/media.ts} +0 -0
- /package/.trebired/frontend/{overlays.ts → preset_01/overlays.ts} +0 -0
- /package/.trebired/frontend/{pill.ts → preset_01/pill.ts} +0 -0
- /package/.trebired/frontend/{primitives.ts → preset_01/primitives.ts} +0 -0
- /package/.trebired/frontend/{progress.ts → preset_01/progress.ts} +0 -0
- /package/.trebired/frontend/{quote.ts → preset_01/quote.ts} +0 -0
- /package/.trebired/frontend/{shell.ts → preset_01/shell.ts} +0 -0
- /package/.trebired/frontend/{steps.ts → preset_01/steps.ts} +0 -0
- /package/.trebired/frontend/{surfaces.ts → preset_01/surfaces.ts} +0 -0
- /package/.trebired/frontend/{systems.ts → preset_01/systems.ts} +0 -0
- /package/.trebired/frontend/{tabs.ts → preset_01/tabs.ts} +0 -0
- /package/.trebired/frontend/{text_link.ts → preset_01/text_link.ts} +0 -0
- /package/.trebired/frontend/{toggle.ts → preset_01/toggle.ts} +0 -0
- /package/.trebired/frontend/{tokens.ts → preset_01/tokens.ts} +0 -0
- /package/.trebired/frontend/{typography.ts → preset_01/typography.ts} +0 -0
- /package/.trebired/frontend/{upload.ts → preset_01/upload.ts} +0 -0
- /package/.trebired/frontend/{wizard.ts → preset_01/wizard.ts} +0 -0
|
@@ -143,58 +143,30 @@ export const primitiveButton = {
|
|
|
143
143
|
},
|
|
144
144
|
},
|
|
145
145
|
},
|
|
146
|
-
danger: {
|
|
147
|
-
background: "transparent",
|
|
148
|
-
border: "currentColor",
|
|
149
|
-
color: "var(--tbf-tone-red, var(--tbf-tone-error, currentColor))",
|
|
150
|
-
icon: "currentColor",
|
|
151
|
-
states: {
|
|
152
|
-
hover: {
|
|
153
|
-
background: "color-mix(in srgb, var(--tbf-tone-red, var(--tbf-tone-error, currentColor)) 12%, transparent)",
|
|
154
|
-
border: "currentColor",
|
|
155
|
-
color: "currentColor",
|
|
156
|
-
icon: "currentColor",
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
ghost: {
|
|
161
|
-
background: "transparent",
|
|
162
|
-
border: "transparent",
|
|
163
|
-
color: "var(--tbf-text, currentColor)",
|
|
164
|
-
icon: "currentColor",
|
|
165
|
-
states: {
|
|
166
|
-
hover: {
|
|
167
|
-
background: "color-mix(in srgb, currentColor 8%, transparent)",
|
|
168
|
-
border: "transparent",
|
|
169
|
-
color: "currentColor",
|
|
170
|
-
icon: "currentColor",
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
146
|
primary: {
|
|
175
|
-
background: "
|
|
176
|
-
border:
|
|
177
|
-
color:
|
|
178
|
-
icon: "
|
|
147
|
+
background: token.color("gray", 900),
|
|
148
|
+
border: semantic.borderSurface2,
|
|
149
|
+
color: semantic.textColor,
|
|
150
|
+
icon: token.color("gray", 300),
|
|
179
151
|
states: {
|
|
180
152
|
hover: {
|
|
181
|
-
background:
|
|
182
|
-
border: "
|
|
183
|
-
color: "
|
|
153
|
+
background: token.color("gray", 800),
|
|
154
|
+
border: token.color("gray", 700),
|
|
155
|
+
color: token.color("gray", 200),
|
|
184
156
|
icon: "currentColor",
|
|
185
157
|
},
|
|
186
158
|
},
|
|
187
159
|
},
|
|
188
160
|
secondary: {
|
|
189
|
-
background: "
|
|
190
|
-
border:
|
|
191
|
-
color:
|
|
192
|
-
icon: "
|
|
161
|
+
background: "transparent",
|
|
162
|
+
border: semantic.borderSurface1,
|
|
163
|
+
color: semantic.textColor,
|
|
164
|
+
icon: token.color("gray", 300),
|
|
193
165
|
states: {
|
|
194
166
|
hover: {
|
|
195
|
-
background: "
|
|
196
|
-
border:
|
|
197
|
-
color: "
|
|
167
|
+
background: token.color("gray", 900),
|
|
168
|
+
border: semantic.borderSurface2,
|
|
169
|
+
color: token.color("gray", 200),
|
|
198
170
|
icon: "currentColor",
|
|
199
171
|
},
|
|
200
172
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { token } from "./tokens";
|
|
1
|
+
import { semantic, token } from "./tokens";
|
|
2
2
|
|
|
3
3
|
export const primitiveChoice = {
|
|
4
4
|
checked: {
|
|
5
5
|
background: token.color("gray", 900),
|
|
6
|
-
border:
|
|
6
|
+
border: semantic.borderSurface2,
|
|
7
7
|
},
|
|
8
8
|
control: {
|
|
9
9
|
activeIconColor: token.color("gray", 600),
|
|
@@ -99,7 +99,7 @@ export const palette = {
|
|
|
99
99
|
"canvas-ansi-13": { family: "ruby", step: "500" },
|
|
100
100
|
"canvas-ansi-14": { family: "cyan", step: "500" },
|
|
101
101
|
"canvas-ansi-15": { family: "gray", step: "200" },
|
|
102
|
-
"focus-color": { family: "
|
|
102
|
+
"focus-color": { family: "gray", step: "400" },
|
|
103
103
|
"scroll-thumb": { family: "gray", step: "400" },
|
|
104
104
|
"scroll-thumb-hover": { family: "gray", step: "350" },
|
|
105
105
|
"scroll-track": { family: "gray", step: "600" },
|
|
@@ -23,6 +23,7 @@ export const semantics = {
|
|
|
23
23
|
gray: token.color("gray", 600),
|
|
24
24
|
green: token.color("green", 600),
|
|
25
25
|
info: token.color("blue", 600),
|
|
26
|
+
ink: token.color("gray", 0),
|
|
26
27
|
muted: token.color("gray", 600),
|
|
27
28
|
purple: token.color("ruby", 600),
|
|
28
29
|
red: token.color("red", 600),
|
|
@@ -30,6 +31,7 @@ export const semantics = {
|
|
|
30
31
|
warning: token.color("yellow", 600),
|
|
31
32
|
yellow: token.color("yellow", 600),
|
|
32
33
|
},
|
|
34
|
+
targetMin: "1.5rem",
|
|
33
35
|
} satisfies NonNullable<FrontendDesignConfig["semantics"]>;
|
|
34
36
|
|
|
35
37
|
export const theme = {
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All notable changes to `@trebired/configs` will be documented here.
|
|
|
4
4
|
|
|
5
5
|
This project follows semantic versioning once published.
|
|
6
6
|
|
|
7
|
+
## 0.7.0
|
|
8
|
+
|
|
9
|
+
- Breaking: the frontend `preset_01` targets `@trebired/frontend` 30.0.0 and the peer range is `^30.0.0`.
|
|
10
|
+
- The frontend `preset_01` sets the `ink` tone to gray 0, white on the dark theme and near black on the light one.
|
|
11
|
+
- The frontend `preset_01` focus colour is gray 400 instead of blue 500. Nothing else in the preset's interface is blue, so focus rings, checked boxes and drop zones no longer stand out in a colour the theme does not use.
|
|
12
|
+
- The frontend `preset_01` is the one definition of buttons for its apps. `primary`, the default in `@trebired/frontend` 30.0.0, is the standard button: gray 900 with a `border-surface-2` hairline. `secondary` is the quiet one: transparent with a `border-surface-1` hairline. The `red`, `yellow` and `green` tones colour the side borders of either, and icon buttons are square in sizes `xs2` to `lg`. The `danger` and `ghost` variants are gone; a destructive action is a button with the `red` tone.
|
|
13
|
+
- The frontend `preset_01` draws a ticked choice row's border in `border-surface-2`, the hairline tone buttons use, instead of `currentColor`. A ticked row no longer gets a full-contrast white or black outline.
|
|
14
|
+
|
|
15
|
+
## 0.6.0
|
|
16
|
+
|
|
17
|
+
- Breaking: every preset has a name under its tool. The Code Discipline baseline moved to `.trebired/code-discipline/preset_01/config.ts`, named `@trebired/configs/code-discipline/preset_01`, and the frontend preset to `.trebired/frontend/preset_01/config.ts`, named `@trebired/configs/frontend/preset_01`. The bare `@trebired/configs` and the package's root export are gone; tools resolve the names through `@trebired/utils`.
|
|
18
|
+
- Retargeted the Code Discipline preset at `@trebired/code-discipline` 8.0, the first line that reads named presets. 8.0.1 is its first published release.
|
|
19
|
+
- Set the touch-target floor in the frontend `preset_01` to the dense 1.5rem, so text inputs, dropdowns and buttons keep the preset's control heights.
|
|
20
|
+
- Retargeted the frontend `preset_01` at `@trebired/frontend` 29.11.0 and raised the peer range to `^29.11.0`.
|
|
21
|
+
|
|
7
22
|
## 0.5.0
|
|
8
23
|
|
|
9
24
|
- Added the `@trebired/frontend` preset at `.trebired/frontend/config.ts`. An application loads it with `presets: { use: ["@trebired/configs"] }`, the same shape as the Code Discipline preset. It sets fonts, icon packs, palette, semantic tokens, theme, runtime options, systems and every component token, motion included.
|
package/README.md
CHANGED
|
@@ -14,29 +14,38 @@ bun i @trebired/configs
|
|
|
14
14
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Name a preset as `<package>/<tool>/<preset>` in that tool's config:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
import { defineConfig } from "@trebired/code-discipline";
|
|
21
21
|
|
|
22
22
|
export default defineConfig({
|
|
23
23
|
presets: {
|
|
24
|
-
use: ["@trebired/configs"],
|
|
24
|
+
use: ["@trebired/configs/code-discipline/preset_01"],
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Configuration
|
|
30
30
|
|
|
31
|
-
###
|
|
31
|
+
### Presets per tool
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Each tool's presets live in that tool's folder, one folder per named preset:
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
| Preset | File | Name in `presets.use` |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| Code Discipline `preset_01` | `.trebired/code-discipline/preset_01/config.ts` | `@trebired/configs/code-discipline/preset_01` |
|
|
38
|
+
| Frontend `preset_01` | `.trebired/frontend/preset_01/config.ts` | `@trebired/configs/frontend/preset_01` |
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
Every tool resolves these names through `applyPresets` in `@trebired/utils`. A name always carries the package, the tool and the preset, and a tool refuses a preset written for another tool. Each preset declares the tool version it targets through `forVersion`.
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
### Code Discipline preset_01
|
|
43
|
+
|
|
44
|
+
`preset_01` is the Trebired baseline: comment removal, aliases, formatting, structural blank lines, 350-line files, 50-line functions, 150-character lines, the duplicate check and the banned spec files. Repositories add only their own overrides.
|
|
45
|
+
|
|
46
|
+
### Frontend preset_01
|
|
47
|
+
|
|
48
|
+
`preset_01` is a complete `@trebired/frontend` config: fonts, icon packs, the palette with its dark and light modes, semantic tokens, the touch-target floor, the theme, runtime options, systems, and every token of every package component, motion included. An application adds only its own containers:
|
|
40
49
|
|
|
41
50
|
```ts
|
|
42
51
|
import { defineConfig } from "@trebired/frontend/config";
|
|
@@ -44,30 +53,28 @@ import { defineConfig } from "@trebired/frontend/config";
|
|
|
44
53
|
import { containers } from "./containers";
|
|
45
54
|
|
|
46
55
|
export default defineConfig({
|
|
47
|
-
forVersion: "
|
|
56
|
+
forVersion: "30.0.0",
|
|
48
57
|
presets: {
|
|
49
|
-
use: ["@trebired/configs"],
|
|
58
|
+
use: ["@trebired/configs/frontend/preset_01"],
|
|
50
59
|
},
|
|
51
60
|
containers,
|
|
52
61
|
});
|
|
53
62
|
```
|
|
54
63
|
|
|
55
|
-
`@trebired/frontend` reads the preset from this package's `.trebired/frontend/config.ts` and merges the application's own config over it. The preset declares the `@trebired/frontend` version it targets through `forVersion`.
|
|
56
|
-
|
|
57
64
|
The application installs the packages the preset names: `@fontsource/inter`, `remixicon`, `simple-icons` and `material-icon-theme`. A missing icon pack renders no icons from that pack.
|
|
58
65
|
|
|
59
66
|
`@trebired/frontend` is an optional peer dependency. A repository that loads only the Code Discipline preset does not install it.
|
|
60
67
|
|
|
61
68
|
## Public API
|
|
62
69
|
|
|
63
|
-
The package
|
|
70
|
+
The package has no import entry. Tools read its presets from the `.trebired/<tool>/<preset>/` folders through `@trebired/utils`. The package exports no helper functions.
|
|
64
71
|
|
|
65
72
|
## What It Does Not Do
|
|
66
73
|
|
|
67
74
|
This package does not:
|
|
68
75
|
|
|
69
76
|
- Own application-specific banned patterns.
|
|
70
|
-
- Own an application's frontend containers.
|
|
77
|
+
- Own an application's frontend containers. A frontend preset styles the package's components; each application declares its own boxes.
|
|
71
78
|
- Set `forVersion` for an application's frontend config. The application states the `@trebired/frontend` version it targets.
|
|
72
79
|
- Wrap or replace `@trebired/code-discipline`.
|
|
73
80
|
- Ship generated alias maps for consuming repositories.
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"name": "@trebired/configs",
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.7.0",
|
|
12
12
|
"description": "Shared Trebired configuration presets for Code Discipline and @trebired/frontend.",
|
|
13
13
|
"type": "module",
|
|
14
14
|
"private": false,
|
|
@@ -17,17 +17,9 @@
|
|
|
17
17
|
"engines": {
|
|
18
18
|
"bun": ">=1.0.0"
|
|
19
19
|
},
|
|
20
|
-
"main": "./.trebired/code-discipline/config.ts",
|
|
21
|
-
"types": "./.trebired/code-discipline/config.ts",
|
|
22
|
-
"exports": {
|
|
23
|
-
".": {
|
|
24
|
-
"import": "./.trebired/code-discipline/config.ts",
|
|
25
|
-
"types": "./.trebired/code-discipline/config.ts"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
20
|
"files": [
|
|
29
|
-
".trebired/code-discipline/
|
|
30
|
-
".trebired/frontend",
|
|
21
|
+
".trebired/code-discipline/preset_01",
|
|
22
|
+
".trebired/frontend/preset_01",
|
|
31
23
|
"CHANGELOG.md",
|
|
32
24
|
"LICENSE",
|
|
33
25
|
"README.md"
|
|
@@ -36,7 +28,7 @@
|
|
|
36
28
|
"typecheck": "tsc --noEmit"
|
|
37
29
|
},
|
|
38
30
|
"peerDependencies": {
|
|
39
|
-
"@trebired/frontend": "^
|
|
31
|
+
"@trebired/frontend": "^30.0.0"
|
|
40
32
|
},
|
|
41
33
|
"peerDependenciesMeta": {
|
|
42
34
|
"@trebired/frontend": {
|
|
@@ -44,8 +36,8 @@
|
|
|
44
36
|
}
|
|
45
37
|
},
|
|
46
38
|
"devDependencies": {
|
|
47
|
-
"@trebired/code-discipline": "
|
|
48
|
-
"@trebired/frontend": "^
|
|
39
|
+
"@trebired/code-discipline": "^8.0.1",
|
|
40
|
+
"@trebired/frontend": "^30.0.0",
|
|
49
41
|
"typescript": "^6.0.3"
|
|
50
42
|
},
|
|
51
43
|
"repository": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|