@vertekum/schema-atlassian 0.1.0 → 0.1.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @vertekum/schema-atlassian
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9c0f093`](https://github.com/moros-oxus/vertekum/commit/9c0f093b5016c6c0ca9cb5b5fd48598718e698d9) Thanks [@tschemmer](https://github.com/tschemmer)! - The space vocabulary is declared with zero-padded scale ranges (`025-100/25 | 150-300/50 | 400-600/100`) instead of a hand-list; granted names are unchanged.
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`c8d9ce6`](https://github.com/moros-oxus/vertekum/commit/c8d9ce6040283afacd343e1d924cf31cff696eda) Thanks [@tschemmer](https://github.com/tschemmer)! - The vocabulary schemas are now built from grammar definition modules shipped beside them (`dfn/` in, `lib/` out); artifacts carry provenance stamps, and every import path is unchanged and flat (`@vertekum/schema-atlassian/color.json`, `…/color.dfn`).
package/README.md CHANGED
@@ -18,24 +18,33 @@ schemas deliberately do not police them.
18
18
 
19
19
  Ten files, one variant each:
20
20
 
21
- | file | names |
22
- | --- | --- |
23
- | `color.json` | 430 |
24
- | `motion.json` | 62 |
25
- | `font.json` · `space.json` | 23 each |
26
- | `elevation.json` | 18 |
27
- | `radius.json` | 8 |
28
- | `border.json` | 3 |
29
- | `opacity.json` | 2 |
30
- | `utility.json` | 1 |
31
- | `atlassian.json` | all 570 |
21
+ | file | shipped names | grants |
22
+ | --- | --- | --- |
23
+ | `color.json` | 430 | the documented grammar (generative) |
24
+ | `motion.json` | 62 | paradigms + component shapes (generative) |
25
+ | `elevation.json` | 18 | layer × kind × state (generative) |
26
+ | `font.json` · `space.json` | 23 each | exactly what ships |
27
+ | `radius.json` | 8 | exactly what ships |
28
+ | `border.json` | 3 | exactly what ships |
29
+ | `opacity.json` | 2 | exactly what ships |
30
+ | `utility.json` | 1 | exactly what ships |
31
+ | `atlassian.json` | all 570 | the union of the nine |
32
+
33
+ **Generative aspects grant the system's grammar, not just its current catalogue.** Color follows
34
+ the documented anatomy — `color.<property>.<role>.<emphasis>.<state>` — so a combination the
35
+ rules permit (say, a background role at an emphasis Atlassian has not yet minted) validates,
36
+ while a name outside the grammar still refuses. The grantable-but-unshipped surplus is pinned by
37
+ test to an exact per-aspect count, so it only ever changes as a reviewed edit.
32
38
 
33
39
  **Aspects seal their branch and leave the root open**, so several can validate the same files
34
40
  together without refusing each other's branches — the cost is that no aspect refuses an unknown
35
41
  *top-level* branch. `atlassian.json` is the wholesale schema that seals the root, for adopting the
36
42
  system entire.
37
43
 
38
- Every file is self-contained: no `$refs`, nothing to resolve.
44
+ Every file is self-contained: any `$ref` is internal (`#/$defs/…`), nothing external to
45
+ resolve. The schemas live in `lib/`, their definition sources in `dfn/` — but specifiers stay
46
+ flat: `@vertekum/schema-atlassian/color.json` and `@vertekum/schema-atlassian/color.dfn` both
47
+ resolve through the package's exports map, no folder in the path.
39
48
 
40
49
  ```
41
50
  $ my-validator tokens.json --schema color.json
@@ -67,8 +76,36 @@ and re-apply the edit.
67
76
 
68
77
  ## Derivation
69
78
 
70
- The vocabulary is derived, not hand-written. `src/vocabulary.json` holds the sorted name list —
71
- the reviewed artifact; the ten schemas are mechanical projections of it.
79
+ The vocabulary is derived, then curated. Three layers:
80
+
81
+ - `src/vocabulary.json` — the sorted name list transcribed from `@atlaskit/tokens`: the review
82
+ artifact for upstream changes.
83
+ - `dfn/*.dfn` — the **source**: each aspect declared as a grammar module
84
+ (built with `@vertekum/schema-builder`, a devDependency). One expression states names and
85
+ order; shared name-sets are named denotations:
86
+
87
+ ```dfn
88
+ property = background | text | icon | border
89
+ color-role = brand | danger | discovery | information | neutral | success | warning
90
+ emphasis = subtlest | subtler | subtle | bold | bolder | boldest
91
+ interaction = hovered | pressed
92
+
93
+ root = color.[
94
+ <property>.<role>?.<emphasis>?.<interaction>?
95
+ | <code>
96
+ | …
97
+ ]
98
+ ```
99
+
100
+ The root reads as the syntagm; `?` collapses an unused slot (`neutral.hovered` skips
101
+ emphasis); forks are their own named productions. Set modifiers derive narrowed sets in
102
+ place: `<emphasis [bold, bolder, boldest]>` picks members, `<direction ![left]>` omits one.
103
+
104
+ A definition module is importable too: `use "@vertekum/schema-atlassian/color.dfn"` exposes
105
+ its denotations, and `<@interaction>` pulls just the one you reference.
106
+ - `lib/*.json` — the built schemas (`npm run build`). Each carries a `$comment` stamp naming its
107
+ module; the artifacts are regenerated, never hand-edited, and the test suite fails when they
108
+ are stale.
72
109
 
73
110
  570 of Atlassian's 585 names ship. Omitted, with reasons recorded in `scripts/derive.ts`:
74
111
 
@@ -82,9 +119,11 @@ Also deliberately absent: `$type` per branch — a judgement the source artifact
82
119
  From this package's directory:
83
120
 
84
121
  ```bash
85
- npm run derive # re-derive from @atlaskit/tokens (a devDependency)
122
+ npm run derive # re-derive from @atlaskit/tokens (a devDependency)
86
123
  git diff src/vocabulary.json # the review artifact: added and removed names
87
- npm test # the schemas must still enforce what they claim
124
+ # apply the additions/removals to the dfn/ modules a reviewed grammar edit
125
+ npm run build # regenerate lib/ from dfn/
126
+ npm test # parity: built schemas grant exactly the vocabulary
88
127
  ```
89
128
 
90
129
  Read the diff before committing: removing a name starts refusing tokens a consuming project may
@@ -0,0 +1,15 @@
1
+ id "vertekum://schema-atlassian/atlassian.json"
2
+ title "Atlassian Design System — all branches"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+
5
+ use "./border.dfn"
6
+ use "./color.dfn"
7
+ use "./elevation.dfn"
8
+ use "./font.dfn"
9
+ use "./motion.dfn"
10
+ use "./opacity.dfn"
11
+ use "./radius.dfn"
12
+ use "./space.dfn"
13
+ use "./utility.dfn"
14
+
15
+ root = [<@border> | <@color> | <@elevation> | <@font> | <@motion> | <@opacity> | <@radius> | <@space> | <@utility>]
package/dfn/border.dfn ADDED
@@ -0,0 +1,6 @@
1
+ id "vertekum://schema-atlassian/border.json"
2
+ title "Atlassian Design System — border"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ root = border.width.[focused | selected]
package/dfn/color.dfn ADDED
@@ -0,0 +1,42 @@
1
+ id "vertekum://schema-atlassian/color.json"
2
+ title "Atlassian Design System — color"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ # The documented syntagm (atlassian.design/foundations/color): color.<property>.<role>.<emphasis>.<state>.
7
+ # The root reads as that syntagm; a slot collapses when unused (`?`). Co-meronyms that fork from it
8
+ # (code sub-vocabularies, chart, link, …) are their own named productions, kept as simple as possible.
9
+ # The schema grants the GRAMMAR — combinations the system's rules permit — not merely today's catalogue.
10
+
11
+ property = background | text | icon | border
12
+ color-role = brand | danger | discovery | information | neutral | success | warning
13
+ special-role = disabled | input | inverse | selected
14
+ accent-color = blue | gray | green | lime | magenta | orange | purple | red | teal | yellow
15
+ emphasis = subtlest | subtler | subtle | bold | bolder | boldest
16
+ interaction = hovered | pressed
17
+
18
+ role = [<color-role> | <special-role> | accent.<accent-color>]
19
+
20
+ root = color.[
21
+ <property>.<role>?.<emphasis>?.<interaction>?
22
+ | <code>
23
+ | <chart>
24
+ | <inverse-on>
25
+ | border.[bold | code | focused]
26
+ | blanket.[danger | selected]
27
+ | interaction.<interaction>
28
+ | link.visited?.pressed?
29
+ | skeleton.subtle?
30
+ ]
31
+
32
+ # Atlassian's own enumerative sub-vocabularies for code blocks.
33
+ code = [
34
+ background.code.[[added | removed].[highlight | line] | default | gutter | highlight]
35
+ | text.code.[accent.[1 | 2] | comments | default | functions | gutter | keywords | numbers | operators | strings | tags]
36
+ ]
37
+
38
+ chart-emphasis = <emphasis [bold, bolder, boldest]>
39
+ chart = chart.[[<accent-color> | <color-role>].<chart-emphasis>?.hovered? | categorical.1-8/1.hovered?]
40
+
41
+ # warning content on inverse (bold) surfaces — the one role that takes an inverse marker.
42
+ inverse-on = [text | icon].warning.inverse
@@ -0,0 +1,14 @@
1
+ id "vertekum://schema-atlassian/elevation.json"
2
+ title "Atlassian Design System — elevation"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ # Syntagm: elevation.<layer>.<kind>.<state> — surfaces take interaction states; shadows do not.
7
+
8
+ interaction = hovered | pressed
9
+ surface-kind = container | overlay | raised | sunken
10
+
11
+ root = elevation.[<surface> | <shadow>]
12
+
13
+ surface = surface.<surface-kind>?.<interaction>?
14
+ shadow = shadow.[overlay | raised | overflow.[perimeter | spread]?]
package/dfn/font.dfn ADDED
@@ -0,0 +1,13 @@
1
+ id "vertekum://schema-atlassian/font.json"
2
+ title "Atlassian Design System — font"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ root = font.[
7
+ body.[large | small]
8
+ | code
9
+ | family.[[body | code | heading] | brand.[body | heading]]
10
+ | heading.[large | medium | small | xlarge | xsmall | xxlarge | xxsmall]
11
+ | metric.[large | medium | small]
12
+ | weight.[bold | medium | regular | semibold]
13
+ ]
package/dfn/motion.dfn ADDED
@@ -0,0 +1,32 @@
1
+ id "vertekum://schema-atlassian/motion.json"
2
+ title "Atlassian Design System — motion"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ # Paradigms: components animate through <transition> (enter/exit); directional components add a
7
+ # <direction>; keyframes run <io> (in/out). Durations and easings are the system's own scales.
8
+
9
+ transition = enter | exit
10
+ direction = bottom | left | right | top
11
+ io = in | out
12
+ interaction = hovered | pressed
13
+ component = avatar | blanket | flag | label | modal | panel | spotlight
14
+ duration = instant | xxshort | xshort | short | medium | long | xlong | xxlong
15
+
16
+ root = motion.[
17
+ <component>.<transition>
18
+ | avatar.hovered
19
+ | flag.reposition
20
+ | button.<interaction>
21
+ | listitem.[<interaction> | selected]
22
+ | popup.<transition>.<direction>
23
+ | sidenav.<transition>.<direction [left, right]>
24
+ | duration.<duration>
25
+ | <easing>
26
+ | <keyframe>
27
+ ]
28
+
29
+ easing = easing.[[in | out].[bold | practical] | inout.bold | spring]
30
+
31
+ keyframe = keyframe.[fade.<io> | scale.<io>.[medium | small] | slide.<io>.<slide-direction>]
32
+ slide-direction = [<direction ![left]>.short | left.[half | short]]
@@ -0,0 +1,6 @@
1
+ id "vertekum://schema-atlassian/opacity.json"
2
+ title "Atlassian Design System — opacity"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ root = opacity.[disabled | loading]
package/dfn/radius.dfn ADDED
@@ -0,0 +1,6 @@
1
+ id "vertekum://schema-atlassian/radius.json"
2
+ title "Atlassian Design System — radius"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ root = radius.[full | large | medium | small | tile | xlarge | xsmall | xxlarge]
package/dfn/space.dfn ADDED
@@ -0,0 +1,9 @@
1
+ id "vertekum://schema-atlassian/space.json"
2
+ title "Atlassian Design System — space"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ # The spacing scale, as scale expressions: a leading zero pads the emitted names.
7
+ scale = 0 | 025-100/25 | 150-300/50 | 400-600/100 | 800 | 1000
8
+
9
+ root = space.[<scale> | negative.<scale ![0, 500, 600, 800, 1000]>]
@@ -0,0 +1,6 @@
1
+ id "vertekum://schema-atlassian/utility.json"
2
+ title "Atlassian Design System — utility"
3
+ description "Token path vocabulary: which names may appear, in what order, and where the order ends. What a granted name IS — group, token, base value — belongs to the token author and the DTCG format schema."
4
+ scope "branch"
5
+
6
+ root = utility.elevation.surface.current