@kungal/ui-core 2.55.0 → 2.56.1

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,46 @@
1
1
  # @kungal/ui-core
2
2
 
3
+ ## 2.56.1
4
+
5
+ ## 2.56.0
6
+
7
+ ### Minor Changes
8
+
9
+ - 570067b: Coloured text and placeholders now clear WCAG AA (4.5:1). A kungal Flutter app's contrast check measured KunUI's own coloured text and placeholders below it, and the web uses the same classes.
10
+
11
+ **New tokens:**
12
+
13
+ - `--color-{color}-text` (Tailwind `text-primary-text`, `text-danger-text`, …), one per semantic colour, `default` included.
14
+ - In Dart: `KunColorScale.text`.
15
+
16
+ **Why a new token.** A fill colour used as text measured 1.75–4.42:1 on the light page for every colour but `default`, and in dark mode primary and danger fell to 3.87:1 and 3.66:1 on cards. `{color}-text` is the ramp step closest to the fill that clears 4.5:1 on:
17
+
18
+ - the page background;
19
+ - cards (`content1`);
20
+ - the colour's own 20% tint over each, which is the hover and keyboard-focus fill of a light item and the fill of a flat chip.
21
+
22
+ The token generator measures all four in both modes and fails the build if one misses. The steps it picks:
23
+
24
+ | Mode | Step 600 | Step 700 |
25
+ | ----- | ----------------------------- | --------------------------------------- |
26
+ | Light | secondary, warning | primary, success, danger, info, default |
27
+ | Dark | every colour except secondary | secondary |
28
+
29
+ **What moved to it:**
30
+
31
+ - The `light`, `bordered` and `flat` variants (buttons, chips, badges, menu items) and `kunTextClasses`, which covers KunLink, selected tabs, active steps and reactions.
32
+ - KunInfo's `bordered` text, and its dark `flat` danger and info.
33
+ - Every form error message and required asterisk.
34
+ - Chat sender names, reply and pinned titles, links, mentions, typing and status text.
35
+
36
+ **What you'll see.** Coloured text is one step darker in light mode and one step lighter in dark mode. Icons, SVG strokes, spinners and text on solid fills keep their colours.
37
+
38
+ **If your own markup uses `text-primary` for readable text**, switch it to `text-primary-text`. `text-primary` stays the fill colour, meant for fills, borders and icons.
39
+
40
+ **Placeholders** now use `foreground-muted`, the secondary-text colour: 5.52:1 light and 4.85:1 dark, where `default-400` measured 2.31–3.58:1. This covers the base-layer `::placeholder` rule (every native input), KunSelect's and KunDatePicker's empty trigger, KunChatComposer and KunCommandPalette. A placeholder is often the only label a field has, such as "全部平台" in a filter. Disabled text, outside-month days and icons keep their lighter steps: WCAG exempts disabled controls, and the others are not text.
41
+
42
+ Measured on the docs site in Chromium: 227 text elements in each mode across the button, chip, tab, link, select, input, info, dropdown, chat bubble, date picker and textarea pages all clear 4.5:1. The lowest are a warning chip (4.77:1 light, 4.87:1 dark) and the dark placeholder (4.85:1).
43
+
3
44
  ## 2.55.0
4
45
 
5
46
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -54,32 +54,35 @@ var TABLE = {
54
54
  danger: "border border-transparent bg-danger text-danger-foreground",
55
55
  info: "border border-transparent bg-info text-info-foreground"
56
56
  },
57
+ // `{c}-text`, not the fill: a fill used as text measured 1.75–4.42:1 on the
58
+ // light page. The generator holds `{c}-text` at 4.5:1 on the page, on cards
59
+ // and on the hue's 20% tint, so the hover fill and a flat chip stay readable.
57
60
  bordered: {
58
61
  default: "border border-default bg-transparent",
59
- primary: "border border-primary bg-transparent text-primary",
60
- secondary: "border border-secondary bg-transparent text-secondary",
61
- success: "border border-success bg-transparent text-success",
62
- warning: "border border-warning bg-transparent text-warning",
63
- danger: "border border-danger bg-transparent text-danger",
64
- info: "border border-info bg-transparent text-info"
62
+ primary: "border border-primary bg-transparent text-primary-text",
63
+ secondary: "border border-secondary bg-transparent text-secondary-text",
64
+ success: "border border-success bg-transparent text-success-text",
65
+ warning: "border border-warning bg-transparent text-warning-text",
66
+ danger: "border border-danger bg-transparent text-danger-text",
67
+ info: "border border-info bg-transparent text-info-text"
65
68
  },
66
69
  light: {
67
70
  default: "border border-transparent bg-transparent hover:bg-default/20",
68
- primary: "border border-transparent bg-transparent text-primary hover:bg-primary/20",
69
- secondary: "border border-transparent bg-transparent text-secondary hover:bg-secondary/20",
70
- success: "border border-transparent bg-transparent text-success hover:bg-success/20",
71
- warning: "border border-transparent bg-transparent text-warning hover:bg-warning/20",
72
- danger: "border border-transparent bg-transparent text-danger hover:bg-danger/20",
73
- info: "border border-transparent bg-transparent text-info hover:bg-info/20"
71
+ primary: "border border-transparent bg-transparent text-primary-text hover:bg-primary/20",
72
+ secondary: "border border-transparent bg-transparent text-secondary-text hover:bg-secondary/20",
73
+ success: "border border-transparent bg-transparent text-success-text hover:bg-success/20",
74
+ warning: "border border-transparent bg-transparent text-warning-text hover:bg-warning/20",
75
+ danger: "border border-transparent bg-transparent text-danger-text hover:bg-danger/20",
76
+ info: "border border-transparent bg-transparent text-info-text hover:bg-info/20"
74
77
  },
75
78
  flat: {
76
- default: "border border-transparent bg-default/20 text-default-700",
77
- primary: "border border-transparent bg-primary/20 text-primary-600",
78
- secondary: "border border-transparent bg-secondary/20 text-secondary-600",
79
- success: "border border-transparent bg-success/20 text-success-700 dark:text-success",
80
- warning: "border border-transparent bg-warning/20 text-warning-700 dark:text-warning",
81
- danger: "border border-transparent bg-danger/20 text-danger-600 dark:text-danger-500",
82
- info: "border border-transparent bg-info/20 text-info-700 dark:text-info-500"
79
+ default: "border border-transparent bg-default/20 text-default-text",
80
+ primary: "border border-transparent bg-primary/20 text-primary-text",
81
+ secondary: "border border-transparent bg-secondary/20 text-secondary-text",
82
+ success: "border border-transparent bg-success/20 text-success-text",
83
+ warning: "border border-transparent bg-warning/20 text-warning-text",
84
+ danger: "border border-transparent bg-danger/20 text-danger-text",
85
+ info: "border border-transparent bg-info/20 text-info-text"
83
86
  },
84
87
  // Same fill logic as `solid` (see note above) plus a COLORED glow. The glow
85
88
  // needs both a size (`shadow-lg` — the geometry) AND a tint (`shadow-{color}/40`
@@ -135,12 +138,12 @@ var kunSolidClasses = {
135
138
  };
136
139
  var kunTextClasses = {
137
140
  default: "text-foreground",
138
- primary: "text-primary",
139
- secondary: "text-secondary",
140
- success: "text-success",
141
- warning: "text-warning",
142
- danger: "text-danger",
143
- info: "text-info"
141
+ primary: "text-primary-text",
142
+ secondary: "text-secondary-text",
143
+ success: "text-success-text",
144
+ warning: "text-warning-text",
145
+ danger: "text-danger-text",
146
+ info: "text-info-text"
144
147
  };
145
148
  var kunBorderClasses = {
146
149
  default: "border-default",