@xenosystem/components 0.11.0 → 0.11.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/dist/catalog.json CHANGED
@@ -549,11 +549,17 @@
549
549
  "optional": true,
550
550
  "doc": "Stretch segments to fill the available width."
551
551
  },
552
+ {
553
+ "name": "disabled",
554
+ "type": "boolean",
555
+ "optional": true,
556
+ "doc": "Extra classes."
557
+ },
552
558
  {
553
559
  "name": "className",
554
560
  "type": "string",
555
561
  "optional": true,
556
- "doc": "Extra classes."
562
+ "doc": ""
557
563
  }
558
564
  ]
559
565
  },
@@ -582,11 +588,17 @@
582
588
  "doc": "Accessible name. Required — a bare switch has no visible label."
583
589
  },
584
590
  {
585
- "name": "disabled",
591
+ "name": "mixed",
586
592
  "type": "boolean",
587
593
  "optional": true,
588
594
  "doc": "Disabled treatment."
589
595
  },
596
+ {
597
+ "name": "disabled",
598
+ "type": "boolean",
599
+ "optional": true,
600
+ "doc": ""
601
+ },
590
602
  {
591
603
  "name": "size",
592
604
  "type": "'sm' | 'md'",
@@ -603,6 +603,8 @@ interface SegmentedControlProps<T extends string> {
603
603
  /** Stretch segments to fill the available width. */
604
604
  stretch?: boolean;
605
605
  /** Extra classes. */
606
+ /** Disable the whole control (every segment). */
607
+ disabled?: boolean;
606
608
  className?: string;
607
609
  }
608
610
  /**
@@ -634,7 +636,7 @@ interface SegmentedControlProps<T extends string> {
634
636
  * @returns The next value, or `value` if the move is a no-op.
635
637
  */
636
638
  declare function nextSegmentValue<T extends string>(options: ReadonlyArray<SegmentOption<T>>, value: T, delta: number): T;
637
- declare function SegmentedControl<T extends string>({ options, value, onChange, label, size, stretch, className, }: SegmentedControlProps<T>): ReactNode;
639
+ declare function SegmentedControl<T extends string>({ options, value, onChange, label, size, stretch, className, disabled, }: SegmentedControlProps<T>): ReactNode;
638
640
  /** Props for {@link Toggle}. */
639
641
  interface ToggleProps {
640
642
  /** On/off state. */
@@ -644,6 +646,8 @@ interface ToggleProps {
644
646
  /** Accessible name. Required — a bare switch has no visible label. */
645
647
  label: string;
646
648
  /** Disabled treatment. */
649
+ /** The value differs across a multi-selection: `aria-checked="mixed"`, the knob at half weight. */
650
+ mixed?: boolean;
647
651
  disabled?: boolean;
648
652
  /** `sm` = 16px track height, `md` = 18px (default). */
649
653
  size?: 'sm' | 'md';
@@ -654,7 +658,7 @@ interface ToggleProps {
654
658
  * The signature XENO toggle: a rectangular track with a SQUARE knob whose corner radius softens
655
659
  * when it moves to the ON position (DESIGN_SYSTEM §3 "The Toggle Switch"). Never a pill.
656
660
  */
657
- declare function Toggle({ checked, onChange, label, disabled, size, className, }: ToggleProps): ReactNode;
661
+ declare function Toggle({ checked, onChange, label, disabled, mixed, size, className, }: ToggleProps): ReactNode;
658
662
  /** Props for {@link FieldGroup}. */
659
663
  interface FieldGroupProps {
660
664
  /** {@link Field} children. */
@@ -682,6 +682,10 @@ div.xc-section-trigger {
682
682
  .xc-stack--pad-gutter { padding: ${PANEL_METRICS.gutter}px; }
683
683
  .xc-stack--pad-inset { padding: 0 ${PANEL_METRICS.gutter}px ${PANEL_METRICS.gutter}px; }
684
684
  .xc-stack--pad-none { padding: 0; }
685
+ /* inside a row, a field shares the line instead of claiming it \u2014 the inspector's X / Y cells */
686
+ .xc-stack--row > .xc-input,
687
+ .xc-stack--row > .xc-number,
688
+ .xc-stack--row > .xc-swatch { flex: 1 1 0; width: auto; min-width: 0; }
685
689
 
686
690
  /* \u2500\u2500 Text \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
687
691
  .xc-text {
@@ -1098,6 +1102,9 @@ div.xc-section-trigger {
1098
1102
  }
1099
1103
  /* Both layers, per DESIGN_SYSTEM \xA73.1 "Cursors \u2014 two layers, both required": the modifier class
1100
1104
  for callers that style a wrapper, and the attribute selector for the real disabled control. */
1105
+ .xc-toggle--mixed .xc-toggle-knob {
1106
+ opacity: 0.4;
1107
+ }
1101
1108
  .xc-toggle--disabled,
1102
1109
  .xc-toggle[disabled] {
1103
1110
  opacity: ${PANEL_DISABLED_OPACITY};
@@ -1612,7 +1619,8 @@ function SegmentedControl({
1612
1619
  label,
1613
1620
  size = "md",
1614
1621
  stretch,
1615
- className
1622
+ className,
1623
+ disabled
1616
1624
  }) {
1617
1625
  usePanelPrimitives();
1618
1626
  const move = (delta) => {
@@ -1649,7 +1657,7 @@ function SegmentedControl({
1649
1657
  "aria-checked": checked,
1650
1658
  title: o.title,
1651
1659
  "aria-label": o.title,
1652
- disabled: o.disabled,
1660
+ disabled: disabled || o.disabled,
1653
1661
  tabIndex: checked ? 0 : -1,
1654
1662
  className: cx(CLS_SEGMENT, checked && `${CLS_SEGMENT}--checked`),
1655
1663
  onClick: () => {
@@ -1668,6 +1676,7 @@ function Toggle({
1668
1676
  onChange,
1669
1677
  label,
1670
1678
  disabled,
1679
+ mixed,
1671
1680
  size = "md",
1672
1681
  className
1673
1682
  }) {
@@ -1677,7 +1686,7 @@ function Toggle({
1677
1686
  {
1678
1687
  type: "button",
1679
1688
  role: "switch",
1680
- "aria-checked": checked,
1689
+ "aria-checked": mixed ? "mixed" : checked,
1681
1690
  "aria-label": label,
1682
1691
  title: label,
1683
1692
  disabled,
@@ -1687,6 +1696,7 @@ function Toggle({
1687
1696
  `${CLS_TOGGLE}--${size}`,
1688
1697
  checked && `${CLS_TOGGLE}--on`,
1689
1698
  disabled && `${CLS_TOGGLE}--disabled`,
1699
+ mixed && `${CLS_TOGGLE}--mixed`,
1690
1700
  className
1691
1701
  ),
1692
1702
  children: /* @__PURE__ */ jsx2("span", { className: CLS_TOGGLE_KNOB })
@@ -2303,6 +2313,7 @@ function gallery() {
2303
2313
  form("SegmentedControl", "last", () => /* @__PURE__ */ jsx7(SegmentedControl, { options: SEGMENTS, value: "warnings", onChange: noop, label: "Level" }));
2304
2314
  form("Toggle", "off", () => /* @__PURE__ */ jsx7(Toggle, { checked: false, onChange: noop, label: "Follow output" }));
2305
2315
  form("Toggle", "on", () => /* @__PURE__ */ jsx7(Toggle, { checked: true, onChange: noop, label: "Follow output" }));
2316
+ form("Toggle", "mixed", () => /* @__PURE__ */ jsx7(Toggle, { checked: false, mixed: true, onChange: noop, label: "Visible" }));
2306
2317
  form("Toggle", "disabled-on", () => /* @__PURE__ */ jsx7(Toggle, { checked: true, onChange: noop, label: "Follow output", disabled: true }));
2307
2318
  form("Field", "default", () => /* @__PURE__ */ jsx7(Field, { label: "Name", htmlFor: "chrome-field-name", children: /* @__PURE__ */ jsx7("input", { id: "chrome-field-name", defaultValue: "Untitled" }) }));
2308
2319
  form("Field", "hint", () => /* @__PURE__ */ jsx7(Field, { label: "Timeout", hint: "Milliseconds; 0 never times out.", htmlFor: "chrome-field-timeout", children: /* @__PURE__ */ jsx7("input", { id: "chrome-field-timeout", defaultValue: "30000" }) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/components",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "XENO Components \u2014 rung 2 of the front ladder: molecules composed from @xenosystem/elements, with no host contract. Families as subpaths: /auth, /navigation, /feedback, /data.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",