@cahyo-dimas/freeday 1.11.1 → 1.12.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
@@ -3,6 +3,35 @@
3
3
  Semua perubahan penting dicatat di sini. Format longgar mengikuti
4
4
  [Keep a Changelog](https://keepachangelog.com/); tiap versi = git tag.
5
5
 
6
+ ## [1.12.0] — 2026-07-29
7
+ ### Added
8
+ - **Chart colour overrides can now name a categorical palette slot (#36).** `data-fdy-colors` (and the
9
+ `<FdyChart colors>` prop) previously resolved every name through the semantic tier
10
+ (`var(--color-<name>)`), so an override could only reach `primary`/`info`/`accent`/… — never the
11
+ validated categorical palette `--chart-1..8`. An app that needs stable *per-category* colours (rather
12
+ than per-array-index) had to override, and overriding then dropped each series onto the nearest
13
+ semantic hue — e.g. a three-way split landing on three neighbouring blues: contrast-passing but
14
+ unreadable as a comparison. `colorVar` now maps a name of the form `chart-1`..`chart-8` to
15
+ `var(--chart-N)`, so an override can pin a series to the validated palette
16
+ (`colors={['chart-1','chart-2','chart-3']}`). Backward compatible — no semantic token name starts
17
+ with `chart-`, so semantic overrides are unchanged; the single-series `data-fdy-color` / `color`
18
+ accepts the `chart-N` form too. Verified in-browser: explicit `chart-1..3` now render the exact
19
+ fixed-order palette (blue/orange/green) and equal the default, while `success,warning,danger` still
20
+ resolve to their semantic tokens. (`--chart-1..8` are public tokens in `dist/freeday.tokens.css`, so
21
+ matching swatches/bars elsewhere can reference `var(--chart-N)` directly — no adapter export needed.)
22
+
23
+ ## [1.11.2] — 2026-07-28
24
+ ### Fixed
25
+ - **A filter bar docked in a table toolbar no longer loses its alignment (#35).** `.fdy-filterbar`
26
+ (`align-items:flex-end`, for labelled fields) and `.fdy-table-toolbar` (`align-items:center`, for
27
+ bare buttons) are both single-class rules of equal specificity, so composing them on one element
28
+ (`<div class="fdy-table-toolbar fdy-filterbar">`) let whichever came later in the bundle win — the
29
+ toolbar — centring every control and floating the trailing actions ~13px above the inputs beside
30
+ them. Added a `.fdy-table-toolbar.fdy-filterbar` rule (specificity 0,2,0) that settles it toward the
31
+ filterbar's `flex-end`. Additive — only affects elements carrying both classes; standalone toolbars
32
+ and filterbars are untouched. Verified in-browser: the composed bar's controls now share one
33
+ baseline (computed `align-items: flex-end`).
34
+
6
35
  ## [1.11.1] — 2026-07-28
7
36
  ### Fixed
8
37
  - **Tall modals now scroll their body instead of clipping the footer (#34).** `.fdy-modal` had a
package/README.id.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > **Lebih banyak _free day_ buat dev — UI kit-nya sudah siap pakai.**
6
6
 
7
7
  [![Live docs](https://img.shields.io/badge/docs-live-2050d8?style=flat-square)](https://cahyo-dimas.github.io/freeday-ui-kit/)
8
- [![Release](https://img.shields.io/badge/release-v1.11.1-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.11.1)
8
+ [![Release](https://img.shields.io/badge/release-v1.12.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.12.0)
9
9
 
10
10
  UI KIT yang token-driven & framework-agnostic — satu sumber kebenaran untuk warna, tipografi,
11
11
  spasi, dan komponen. Blueprint: `docs/superpowers/specs/2026-07-21-freeday-ui-kit-design.md`.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > **More free days for devs — the UI kit is ready to use.**
6
6
 
7
7
  [![Live docs](https://img.shields.io/badge/docs-live-2050d8?style=flat-square)](https://cahyo-dimas.github.io/freeday-ui-kit/)
8
- [![Release](https://img.shields.io/badge/release-v1.11.1-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.11.1)
8
+ [![Release](https://img.shields.io/badge/release-v1.12.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.12.0)
9
9
 
10
10
  A token-driven, framework-agnostic UI kit — one source of truth for color, typography,
11
11
  spacing, and components. Blueprint: `docs/superpowers/specs/2026-07-21-freeday-ui-kit-design.md`.
@@ -14,6 +14,11 @@ export interface FdyChartProps {
14
14
  format?: 'number' | 'percent' | 'currency';
15
15
  stacked?: boolean;
16
16
  legend?: 'auto' | 'always' | 'none';
17
+ /**
18
+ * Per-series colour override. Each entry is a semantic token name (primary/accent/success/
19
+ * warning/danger/info) OR a categorical slot 'chart-1'..'chart-8' to pin a series to the
20
+ * validated palette. Omit to use the default fixed-order chart palette.
21
+ */
17
22
  colors?: ReadonlyArray<string>;
18
23
  color?: string;
19
24
  center?: string | number;
@@ -26,6 +26,11 @@ const props = defineProps<{
26
26
  format?: 'number' | 'percent' | 'currency';
27
27
  stacked?: boolean;
28
28
  legend?: 'auto' | 'always' | 'none';
29
+ /**
30
+ * Per-series colour override. Each entry is a semantic token name (primary/accent/success/
31
+ * warning/danger/info) OR a categorical slot 'chart-1'..'chart-8' to pin a series to the
32
+ * validated palette. Omit to use the default fixed-order chart palette.
33
+ */
29
34
  colors?: ReadonlyArray<string>;
30
35
  color?: string;
31
36
  center?: string | number;
@@ -6,7 +6,9 @@
6
6
  * Single-series colour (sparkline / simple bar / single line) via data-fdy-color references a
7
7
  * semantic token by name (primary, accent, success, warning, danger, info). Multi-series
8
8
  * defaults draw from the validated categorical --chart-1..8 palette in fixed order (never
9
- * cycled, 8-series cap); pass data-fdy-colors to override with semantic names instead.
9
+ * cycled, 8-series cap); pass data-fdy-colors to override a name is a semantic token
10
+ * (var(--color-<name>)) OR a slot "chart-1".."chart-8" (var(--chart-N)) to pin a series to the
11
+ * validated palette. Both data-fdy-color and data-fdy-colors accept the chart-N form.
10
12
  * Cartesian charts (line/area, multi-series/stacked bar) draw themed axes from --chart-grid /
11
13
  * --chart-tick and format ticks + tooltips via data-fdy-format (number|percent|currency).
12
14
  * Charts are an enhancement — put a table/text fallback inside the element and it will be
@@ -28,7 +30,14 @@
28
30
  // Categorical chart palette: 8 validated fixed-order slots (--chart-1..8). Series index i
29
31
  // (0-based) -> slot i+1; series beyond the 8-slot cap reuse --chart-8 (never cycled).
30
32
  function chartSlotVar(i) { return 'var(--chart-' + (i < 8 ? i + 1 : 8) + ')'; }
31
- function colorVar(name) { return 'var(--color-' + (name || 'primary') + ')'; }
33
+ // Resolve a colour name to a CSS var(). A semantic name (primary/accent/success/warning/
34
+ // danger/info) reaches --color-<name>; a slot name "chart-1".."chart-8" reaches the validated
35
+ // categorical token --chart-N instead, so a data-fdy-colors override can pin a series to the
36
+ // palette (stable per category) rather than being forced onto the nearest semantic hue.
37
+ function colorVar(name) {
38
+ name = name || 'primary';
39
+ return name.indexOf('chart-') === 0 ? 'var(--' + name + ')' : 'var(--color-' + name + ')';
40
+ }
32
41
 
33
42
  function nums(el, attr) {
34
43
  var v = el.getAttribute(attr);
@@ -971,6 +971,11 @@ a { color: var(--color-primary); }
971
971
  * --w-grow to absorb the slack; trailing actions align to the controls. Fields are
972
972
  * the standard .fdy-field (label above control); wraps gracefully on narrow screens. */
973
973
  .fdy-filterbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--space-3) var(--space-4);}
974
+ /* Composed with a table toolbar (one element, both classes): the fields decide the alignment.
975
+ * `.fdy-table-toolbar` sets align-items:center (right for bare buttons) at equal specificity, and
976
+ * being later in the bundle it would otherwise win — floating labelled fields' neighbours out of line.
977
+ * This 2-class selector (0,2,0) settles it toward the filterbar's flex-end regardless of source order. */
978
+ .fdy-table-toolbar.fdy-filterbar{align-items:flex-end;}
974
979
  /* Fields are direct children. Drop the standalone field's 22rem cap; default to the
975
980
  * medium column width with no unbounded growth (that's what caused the raggedness). */
976
981
  .fdy-filterbar>.fdy-field{max-width:none;flex:0 0 auto;width:12rem;}
package/dist/freeday.css CHANGED
@@ -626,6 +626,11 @@ a { color: var(--color-primary); }
626
626
  * --w-grow to absorb the slack; trailing actions align to the controls. Fields are
627
627
  * the standard .fdy-field (label above control); wraps gracefully on narrow screens. */
628
628
  .fdy-filterbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--space-3) var(--space-4);}
629
+ /* Composed with a table toolbar (one element, both classes): the fields decide the alignment.
630
+ * `.fdy-table-toolbar` sets align-items:center (right for bare buttons) at equal specificity, and
631
+ * being later in the bundle it would otherwise win — floating labelled fields' neighbours out of line.
632
+ * This 2-class selector (0,2,0) settles it toward the filterbar's flex-end regardless of source order. */
633
+ .fdy-table-toolbar.fdy-filterbar{align-items:flex-end;}
629
634
  /* Fields are direct children. Drop the standalone field's 22rem cap; default to the
630
635
  * medium column width with no unbounded growth (that's what caused the raggedness). */
631
636
  .fdy-filterbar>.fdy-field{max-width:none;flex:0 0 auto;width:12rem;}
package/dist/freeday.js CHANGED
@@ -779,7 +779,9 @@
779
779
  * Single-series colour (sparkline / simple bar / single line) via data-fdy-color references a
780
780
  * semantic token by name (primary, accent, success, warning, danger, info). Multi-series
781
781
  * defaults draw from the validated categorical --chart-1..8 palette in fixed order (never
782
- * cycled, 8-series cap); pass data-fdy-colors to override with semantic names instead.
782
+ * cycled, 8-series cap); pass data-fdy-colors to override a name is a semantic token
783
+ * (var(--color-<name>)) OR a slot "chart-1".."chart-8" (var(--chart-N)) to pin a series to the
784
+ * validated palette. Both data-fdy-color and data-fdy-colors accept the chart-N form.
783
785
  * Cartesian charts (line/area, multi-series/stacked bar) draw themed axes from --chart-grid /
784
786
  * --chart-tick and format ticks + tooltips via data-fdy-format (number|percent|currency).
785
787
  * Charts are an enhancement — put a table/text fallback inside the element and it will be
@@ -801,7 +803,14 @@
801
803
  // Categorical chart palette: 8 validated fixed-order slots (--chart-1..8). Series index i
802
804
  // (0-based) -> slot i+1; series beyond the 8-slot cap reuse --chart-8 (never cycled).
803
805
  function chartSlotVar(i) { return 'var(--chart-' + (i < 8 ? i + 1 : 8) + ')'; }
804
- function colorVar(name) { return 'var(--color-' + (name || 'primary') + ')'; }
806
+ // Resolve a colour name to a CSS var(). A semantic name (primary/accent/success/warning/
807
+ // danger/info) reaches --color-<name>; a slot name "chart-1".."chart-8" reaches the validated
808
+ // categorical token --chart-N instead, so a data-fdy-colors override can pin a series to the
809
+ // palette (stable per category) rather than being forced onto the nearest semantic hue.
810
+ function colorVar(name) {
811
+ name = name || 'primary';
812
+ return name.indexOf('chart-') === 0 ? 'var(--' + name + ')' : 'var(--color-' + name + ')';
813
+ }
805
814
 
806
815
  function nums(el, attr) {
807
816
  var v = el.getAttribute(attr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cahyo-dimas/freeday",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "Freeday — token-driven, framework-agnostic UI KIT (design source-of-truth).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -5,6 +5,11 @@
5
5
  * --w-grow to absorb the slack; trailing actions align to the controls. Fields are
6
6
  * the standard .fdy-field (label above control); wraps gracefully on narrow screens. */
7
7
  .fdy-filterbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--space-3) var(--space-4);}
8
+ /* Composed with a table toolbar (one element, both classes): the fields decide the alignment.
9
+ * `.fdy-table-toolbar` sets align-items:center (right for bare buttons) at equal specificity, and
10
+ * being later in the bundle it would otherwise win — floating labelled fields' neighbours out of line.
11
+ * This 2-class selector (0,2,0) settles it toward the filterbar's flex-end regardless of source order. */
12
+ .fdy-table-toolbar.fdy-filterbar{align-items:flex-end;}
8
13
  /* Fields are direct children. Drop the standalone field's 22rem cap; default to the
9
14
  * medium column width with no unbounded growth (that's what caused the raggedness). */
10
15
  .fdy-filterbar>.fdy-field{max-width:none;flex:0 0 auto;width:12rem;}
@@ -6,7 +6,9 @@
6
6
  * Single-series colour (sparkline / simple bar / single line) via data-fdy-color references a
7
7
  * semantic token by name (primary, accent, success, warning, danger, info). Multi-series
8
8
  * defaults draw from the validated categorical --chart-1..8 palette in fixed order (never
9
- * cycled, 8-series cap); pass data-fdy-colors to override with semantic names instead.
9
+ * cycled, 8-series cap); pass data-fdy-colors to override a name is a semantic token
10
+ * (var(--color-<name>)) OR a slot "chart-1".."chart-8" (var(--chart-N)) to pin a series to the
11
+ * validated palette. Both data-fdy-color and data-fdy-colors accept the chart-N form.
10
12
  * Cartesian charts (line/area, multi-series/stacked bar) draw themed axes from --chart-grid /
11
13
  * --chart-tick and format ticks + tooltips via data-fdy-format (number|percent|currency).
12
14
  * Charts are an enhancement — put a table/text fallback inside the element and it will be
@@ -28,7 +30,14 @@
28
30
  // Categorical chart palette: 8 validated fixed-order slots (--chart-1..8). Series index i
29
31
  // (0-based) -> slot i+1; series beyond the 8-slot cap reuse --chart-8 (never cycled).
30
32
  function chartSlotVar(i) { return 'var(--chart-' + (i < 8 ? i + 1 : 8) + ')'; }
31
- function colorVar(name) { return 'var(--color-' + (name || 'primary') + ')'; }
33
+ // Resolve a colour name to a CSS var(). A semantic name (primary/accent/success/warning/
34
+ // danger/info) reaches --color-<name>; a slot name "chart-1".."chart-8" reaches the validated
35
+ // categorical token --chart-N instead, so a data-fdy-colors override can pin a series to the
36
+ // palette (stable per category) rather than being forced onto the nearest semantic hue.
37
+ function colorVar(name) {
38
+ name = name || 'primary';
39
+ return name.indexOf('chart-') === 0 ? 'var(--' + name + ')' : 'var(--color-' + name + ')';
40
+ }
32
41
 
33
42
  function nums(el, attr) {
34
43
  var v = el.getAttribute(attr);