@toteat-eng/ds-react 2026.7.23 → 2026.8.1-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.
@@ -21,7 +21,29 @@ export interface ConfigRowProps {
21
21
  dimmed?: boolean;
22
22
  /** Bottom border separator. Defaults to `true`. */
23
23
  divider?: boolean;
24
+ /**
25
+ * Percentage of the row's available width given to the label column.
26
+ * Override only when a row genuinely needs a different measure (e.g. a very
27
+ * wide control), not to nudge one row.
28
+ *
29
+ * Sensible values are 1–99, but this is **not validated or clamped** — that
30
+ * is deliberate. An out-of-range literal like `150` renders a visibly
31
+ * degenerate row at author time, which is a louder and more useful failure
32
+ * than silently substituting a "reasonable" value the caller did not write.
33
+ * One exception worth knowing: `NaN` degrades *quietly* to content-sized
34
+ * columns rather than breaking visibly, because `NaN%` invalidates the whole
35
+ * `flex` shorthand.
36
+ *
37
+ * The control column always takes the remainder, so the two cannot drift
38
+ * out of sync. "Available width" is the row minus its column gap.
39
+ *
40
+ * **Defaults to 60 (a 60/40 split).** That default is NOT expressed here —
41
+ * omitting this prop emits no inline style at all, and the fallbacks in
42
+ * `ConfigRow.module.css` (`var(--ds-config-row-label-basis, 60%)` and its
43
+ * 40% control counterpart) are its single source of truth. Change it there.
44
+ */
45
+ labelRatio?: number;
24
46
  className?: string;
25
47
  "data-testid"?: string;
26
48
  }
27
- export declare function ConfigRow({ label, description, children, htmlFor, dimmed, divider, className, "data-testid": testId, }: ConfigRowProps): React.ReactElement;
49
+ export declare function ConfigRow({ label, description, children, htmlFor, dimmed, divider, labelRatio, className, "data-testid": testId, }: ConfigRowProps): React.ReactElement;
@@ -10,4 +10,24 @@ export declare const HtmlForLinked: Story;
10
10
  export declare const Dimmed: Story;
11
11
  export declare const NoDivider: Story;
12
12
  export declare const MultipleRowsWithDividers: Story;
13
+ /**
14
+ * The 60/40 column split, shown across MIXED control types — the case
15
+ * `MultipleRowsWithDividers` cannot show, because three Toggles are all the same
16
+ * width and align trivially.
17
+ *
18
+ * What to look for: the control column's LEFT edge is common to every row
19
+ * regardless of what the control is, and the long label wraps inside its 60%
20
+ * instead of squeezing the Select. Before the 60/40 split the control column was
21
+ * content-sized, so each row's boundary landed somewhere different.
22
+ */
23
+ export declare const ColumnProportions: Story;
24
+ /**
25
+ * `labelRatio` overrides the 60/40 default per row. The control column always
26
+ * takes the remainder, so the two halves cannot drift out of sync.
27
+ *
28
+ * Use this only when a row genuinely needs a different measure — a very wide
29
+ * control, or a label short enough that 60% is wasted. Nudging one row for taste
30
+ * breaks the vertical alignment the default exists to guarantee.
31
+ */
32
+ export declare const CustomRatio: Story;
13
33
  export declare const BothThemes: Story;
package/dist/index.es.js CHANGED
@@ -696,24 +696,28 @@ function Zn({ message: e, icon: t = "lock-password-1-outline", className: n, "da
696
696
  });
697
697
  }
698
698
  var Qn = {
699
- row: "_row_1ubkn_2",
700
- labelCol: "_labelCol_1ubkn_31",
701
- label: "_label_1ubkn_31",
702
- description: "_description_1ubkn_46",
703
- controlCol: "_controlCol_1ubkn_52"
699
+ row: "_row_1qgbi_14",
700
+ labelCol: "_labelCol_1qgbi_63",
701
+ label: "_label_1qgbi_63",
702
+ description: "_description_1qgbi_81",
703
+ controlCol: "_controlCol_1qgbi_87"
704
704
  };
705
705
  //#endregion
706
706
  //#region src/components/ConfigRow/ConfigRow.tsx
707
- function $n({ label: e, description: t, children: n, htmlFor: r, dimmed: i = !1, divider: a = !0, className: o, "data-testid": s }) {
708
- let c = r ? "label" : "span";
707
+ function $n({ label: e, description: t, children: n, htmlFor: r, dimmed: i = !1, divider: a = !0, labelRatio: o, className: s, "data-testid": c }) {
708
+ let l = r ? "label" : "span", u = o === void 0 ? void 0 : {
709
+ "--ds-config-row-label-basis": `${o}%`,
710
+ "--ds-config-row-control-basis": `${100 - o}%`
711
+ };
709
712
  return /* @__PURE__ */ p("div", {
710
- className: [Qn.row, o].filter(Boolean).join(" "),
713
+ className: [Qn.row, s].filter(Boolean).join(" "),
714
+ style: u,
711
715
  "data-dimmed": i || void 0,
712
716
  "data-divider": a || void 0,
713
- "data-testid": s,
717
+ "data-testid": c,
714
718
  children: [/* @__PURE__ */ p("div", {
715
719
  className: Qn.labelCol,
716
- children: [/* @__PURE__ */ f(c, {
720
+ children: [/* @__PURE__ */ f(l, {
717
721
  htmlFor: r,
718
722
  className: Qn.label,
719
723
  children: e