@kungal/ui-tokens 2.36.0 → 2.38.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @kungal/ui-tokens
2
2
 
3
+ ## 2.38.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8132bef: Spacing and the type scale are now generated tokens: `KunSpacing` and `KunText` in `kun_ui_tokens`, `spacing` and `text` in `tokens.dtcg.json`
8
+
9
+ Until now the token exports carried colour, radius, motion and elevation, but not the two scales every component is laid out with. The Flutter port felt the gap first: a form label had to hand-type `fontSize: 14, height: 20 / 14`, and a gallery heading borrowed the control-size table because there was no type scale to take.
10
+
11
+ **Where the numbers come from.** KunUI has never declared `--spacing` or `--text-*` — its components are written against Tailwind v4's default theme. So `gen-tokens.mjs` reads both straight out of `tailwindcss/theme.css` rather than restating them: a Tailwind upgrade that changes a default shows up as a diff in the generated files, and the generator refuses to run if KunUI's own `tokens.css` ever starts declaring either. The values describe the scale the components were designed at; a site that overrides `--spacing` or `--text-*` in its own `@theme` renders differently from them.
12
+
13
+ - **Dart.** `KunSpacing.unit` (4) is the step every spacing utility multiplies — `px-4` is `KunSpacing.unit * 4`, which stays a `const` expression. `KunText.xs` … `KunText.xl9` are const `TextStyle`s carrying only `fontSize` and `height` (`2xl`–`9xl` become `xl2`–`xl9`, since a Dart name cannot start with a digit); colour, weight and family stay null and inherit.
14
+ - **Half-leading.** Every `KunText` style sets `leadingDistribution: TextLeadingDistribution.even`, which is what CSS does. Measured with the same font metrics in Chromium and `flutter test`, Flutter's default `proportional` sits the baseline 1.2–2.6 px lower than the browser at `xs`–`4xl`; `even` matches it to within Chromium's pixel rounding.
15
+ - **DTCG.** `spacing.unit` is a `dimension`; each `text.<step>` is a `fontSize` dimension plus a unitless `lineHeight` number. They are not `typography` composites, because the 2025.10 format requires all five of that type's sub-values, and family, weight and letter-spacing are not part of this scale.
16
+
17
+ Nothing changes for web consumers: no CSS changed.
18
+
19
+ ## 2.37.0
20
+
3
21
  ## 2.36.0
4
22
 
5
23
  ## 2.35.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/ui-tokens",
3
- "version": "2.36.0",
3
+ "version": "2.38.0",
4
4
  "description": "KunUI design tokens — framework-agnostic Tailwind v4 theme (semantic colors, radius, z-index, animations).",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -2819,5 +2819,187 @@
2819
2819
  }
2820
2820
  ]
2821
2821
  }
2822
+ },
2823
+ "spacing": {
2824
+ "$description": "The values are Tailwind v4's default theme, which KunUI's components are written against and never redeclare. A site that overrides them in its own @theme renders differently from these; these are what the components were designed at.",
2825
+ "unit": {
2826
+ "$type": "dimension",
2827
+ "$value": {
2828
+ "value": 4,
2829
+ "unit": "px"
2830
+ }
2831
+ }
2832
+ },
2833
+ "text": {
2834
+ "$description": "The values are Tailwind v4's default theme, which KunUI's components are written against and never redeclare. A site that overrides them in its own @theme renders differently from these; these are what the components were designed at.",
2835
+ "xs": {
2836
+ "fontSize": {
2837
+ "$type": "dimension",
2838
+ "$value": {
2839
+ "value": 12,
2840
+ "unit": "px"
2841
+ }
2842
+ },
2843
+ "lineHeight": {
2844
+ "$type": "number",
2845
+ "$value": 1.3333333333333333
2846
+ }
2847
+ },
2848
+ "sm": {
2849
+ "fontSize": {
2850
+ "$type": "dimension",
2851
+ "$value": {
2852
+ "value": 14,
2853
+ "unit": "px"
2854
+ }
2855
+ },
2856
+ "lineHeight": {
2857
+ "$type": "number",
2858
+ "$value": 1.4285714285714286
2859
+ }
2860
+ },
2861
+ "base": {
2862
+ "fontSize": {
2863
+ "$type": "dimension",
2864
+ "$value": {
2865
+ "value": 16,
2866
+ "unit": "px"
2867
+ }
2868
+ },
2869
+ "lineHeight": {
2870
+ "$type": "number",
2871
+ "$value": 1.5
2872
+ }
2873
+ },
2874
+ "lg": {
2875
+ "fontSize": {
2876
+ "$type": "dimension",
2877
+ "$value": {
2878
+ "value": 18,
2879
+ "unit": "px"
2880
+ }
2881
+ },
2882
+ "lineHeight": {
2883
+ "$type": "number",
2884
+ "$value": 1.5555555555555556
2885
+ }
2886
+ },
2887
+ "xl": {
2888
+ "fontSize": {
2889
+ "$type": "dimension",
2890
+ "$value": {
2891
+ "value": 20,
2892
+ "unit": "px"
2893
+ }
2894
+ },
2895
+ "lineHeight": {
2896
+ "$type": "number",
2897
+ "$value": 1.4
2898
+ }
2899
+ },
2900
+ "2xl": {
2901
+ "fontSize": {
2902
+ "$type": "dimension",
2903
+ "$value": {
2904
+ "value": 24,
2905
+ "unit": "px"
2906
+ }
2907
+ },
2908
+ "lineHeight": {
2909
+ "$type": "number",
2910
+ "$value": 1.3333333333333333
2911
+ }
2912
+ },
2913
+ "3xl": {
2914
+ "fontSize": {
2915
+ "$type": "dimension",
2916
+ "$value": {
2917
+ "value": 30,
2918
+ "unit": "px"
2919
+ }
2920
+ },
2921
+ "lineHeight": {
2922
+ "$type": "number",
2923
+ "$value": 1.2
2924
+ }
2925
+ },
2926
+ "4xl": {
2927
+ "fontSize": {
2928
+ "$type": "dimension",
2929
+ "$value": {
2930
+ "value": 36,
2931
+ "unit": "px"
2932
+ }
2933
+ },
2934
+ "lineHeight": {
2935
+ "$type": "number",
2936
+ "$value": 1.1111111111111112
2937
+ }
2938
+ },
2939
+ "5xl": {
2940
+ "fontSize": {
2941
+ "$type": "dimension",
2942
+ "$value": {
2943
+ "value": 48,
2944
+ "unit": "px"
2945
+ }
2946
+ },
2947
+ "lineHeight": {
2948
+ "$type": "number",
2949
+ "$value": 1
2950
+ }
2951
+ },
2952
+ "6xl": {
2953
+ "fontSize": {
2954
+ "$type": "dimension",
2955
+ "$value": {
2956
+ "value": 60,
2957
+ "unit": "px"
2958
+ }
2959
+ },
2960
+ "lineHeight": {
2961
+ "$type": "number",
2962
+ "$value": 1
2963
+ }
2964
+ },
2965
+ "7xl": {
2966
+ "fontSize": {
2967
+ "$type": "dimension",
2968
+ "$value": {
2969
+ "value": 72,
2970
+ "unit": "px"
2971
+ }
2972
+ },
2973
+ "lineHeight": {
2974
+ "$type": "number",
2975
+ "$value": 1
2976
+ }
2977
+ },
2978
+ "8xl": {
2979
+ "fontSize": {
2980
+ "$type": "dimension",
2981
+ "$value": {
2982
+ "value": 96,
2983
+ "unit": "px"
2984
+ }
2985
+ },
2986
+ "lineHeight": {
2987
+ "$type": "number",
2988
+ "$value": 1
2989
+ }
2990
+ },
2991
+ "9xl": {
2992
+ "fontSize": {
2993
+ "$type": "dimension",
2994
+ "$value": {
2995
+ "value": 128,
2996
+ "unit": "px"
2997
+ }
2998
+ },
2999
+ "lineHeight": {
3000
+ "$type": "number",
3001
+ "$value": 1
3002
+ }
3003
+ }
2822
3004
  }
2823
3005
  }