@conductor-by-89soone/react 0.1.1 → 0.2.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/dist/action.js CHANGED
@@ -1,2 +1,3 @@
1
- export { Button, IconButton } from './chunk-EA2W7T64.js';
1
+ export { Button, IconButton } from './chunk-VAG2L2VQ.js';
2
+ import './chunk-NF3ZHADJ.js';
2
3
  import './chunk-WEIMKRZV.js';
@@ -1,4 +1,5 @@
1
1
  import { cx } from './chunk-WEIMKRZV.js';
2
+ import { STATUS_ICONS, SEVERITY_ICONS } from '@conductor-by-89soone/tokens';
2
3
  import { forwardRef } from 'react';
3
4
  import { jsxs, jsx } from 'react/jsx-runtime';
4
5
 
@@ -15,14 +16,14 @@ var StatusBadge = forwardRef(function StatusBadge2({ className, icon, label, sta
15
16
  const statusClass = status === "neutralEnd" ? "neutral-end" : status;
16
17
  return /* @__PURE__ */ jsxs("span", { ...props, ref, className: cx("cdt-badge", "cdt-status-badge", `cdt-status-badge--${statusClass}`, className), children: [
17
18
  isMarker ? /* @__PURE__ */ jsx("span", { className: cx("cdt-status-badge__marker", status === "neutralEnd" && "cdt-status-badge__marker--neutral-end"), "aria-hidden": "true" }) : null,
18
- /* @__PURE__ */ jsx("span", { className: "cdt-badge__icon", "aria-hidden": "true", children: icon }),
19
+ /* @__PURE__ */ jsx("span", { className: "cdt-badge__icon", "aria-hidden": "true", "data-cdt-icon": STATUS_ICONS[status], children: icon }),
19
20
  label
20
21
  ] });
21
22
  });
22
23
  StatusBadge.displayName = "StatusBadge";
23
24
  var SeverityTag = forwardRef(function SeverityTag2({ className, icon, label, severity, ...props }, ref) {
24
25
  return /* @__PURE__ */ jsxs("span", { ...props, ref, className: cx("cdt-badge", "cdt-severity-tag", `cdt-severity-tag--${severity}`, className), children: [
25
- /* @__PURE__ */ jsx("span", { className: "cdt-badge__icon", "aria-hidden": "true", children: icon }),
26
+ /* @__PURE__ */ jsx("span", { className: "cdt-badge__icon", "aria-hidden": "true", "data-cdt-icon": SEVERITY_ICONS[severity], children: icon }),
26
27
  label
27
28
  ] });
28
29
  });
@@ -2,7 +2,7 @@ import { cx } from './chunk-WEIMKRZV.js';
2
2
  import * as RadixCheckbox from '@radix-ui/react-checkbox';
3
3
  import * as RadixSelect from '@radix-ui/react-select';
4
4
  import * as RadixSwitch from '@radix-ui/react-switch';
5
- import { createContext, forwardRef, useId, cloneElement, useContext, useEffect } from 'react';
5
+ import { createContext, forwardRef, useId, useContext, useEffect } from 'react';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
 
8
8
  var FieldContext = createContext(null);
@@ -33,7 +33,7 @@ var Field = forwardRef(function Field2({ children, className, description, error
33
33
  required ? /* @__PURE__ */ jsx("span", { className: "cdt-field__required", "aria-hidden": "true", children: "*" }) : null
34
34
  ] }),
35
35
  description === void 0 ? null : /* @__PURE__ */ jsx("div", { id: descriptionId, className: "cdt-field__description", children: description }),
36
- required ? cloneElement(children, { required }) : children,
36
+ children,
37
37
  error === void 0 ? null : /* @__PURE__ */ jsx("div", { id: errorId, className: "cdt-field__error", children: error })
38
38
  ] }) });
39
39
  });
@@ -63,20 +63,21 @@ var TextArea = forwardRef(function TextArea2({ "aria-describedby": ariaDescribed
63
63
  return /* @__PURE__ */ jsx("textarea", { ...props, ref, id: ownId ?? (field === null ? void 0 : control.id), rows, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": control.describedBy, "aria-invalid": ariaInvalid ?? (control.invalid || void 0), required: required ?? control.required, className: cx("cdt-textarea", variant === "glass" && "cdt-textarea--glass", control.invalid && "cdt-textarea--invalid", className) });
64
64
  });
65
65
  TextArea.displayName = "TextArea";
66
- var SelectTrigger = forwardRef(function SelectTrigger2({ "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, className, id: ownId, invalid, size = "md", ...props }, ref) {
66
+ var SelectTrigger = forwardRef(function SelectTrigger2({ "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, className, id: ownId, invalid, size = "md", ...props }, ref) {
67
67
  const field = useContext(FieldContext);
68
68
  const control = useFieldControl(invalid, ariaDescribedBy);
69
- return /* @__PURE__ */ jsx(RadixSelect.Trigger, { ...props, ref, id: ownId ?? (field === null ? void 0 : control.id), "aria-describedby": control.describedBy, "aria-invalid": ariaInvalid ?? (control.invalid || void 0), className: cx("cdt-select__trigger", size === "sm" && "cdt-select__trigger--sm", control.invalid && "cdt-select__trigger--invalid", className) });
69
+ const requiredAttribute = ariaRequired ?? (control.required ? true : void 0);
70
+ return /* @__PURE__ */ jsx(RadixSelect.Trigger, { ...props, ref, id: ownId ?? (field === null ? void 0 : control.id), "aria-describedby": control.describedBy, "aria-invalid": ariaInvalid ?? (control.invalid || void 0), ...requiredAttribute === void 0 ? {} : { "aria-required": requiredAttribute }, className: cx("cdt-select__trigger", size === "sm" && "cdt-select__trigger--sm", control.invalid && "cdt-select__trigger--invalid", className) });
70
71
  });
71
72
  SelectTrigger.displayName = "Select.Trigger";
72
73
  var SelectContent = forwardRef(function SelectContent2({ children, className, ...props }, ref) {
73
74
  return /* @__PURE__ */ jsx(RadixSelect.Portal, { children: /* @__PURE__ */ jsx(RadixSelect.Content, { ...props, ref, className: cx("cdt-select__content", className), children: /* @__PURE__ */ jsx(RadixSelect.Viewport, { children }) }) });
74
75
  });
75
76
  SelectContent.displayName = "Select.Content";
76
- var SelectItem = forwardRef(function SelectItem2({ children, className, ...props }, ref) {
77
+ var SelectItem = forwardRef(function SelectItem2({ children, className, indicator = "\u2713", ...props }, ref) {
77
78
  return /* @__PURE__ */ jsxs(RadixSelect.Item, { ...props, ref, className: cx("cdt-select__item", className), children: [
78
79
  /* @__PURE__ */ jsx(RadixSelect.ItemText, { children }),
79
- /* @__PURE__ */ jsx(RadixSelect.ItemIndicator, { className: "cdt-select__indicator", "aria-hidden": "true", children: "\u2713" })
80
+ /* @__PURE__ */ jsx(RadixSelect.ItemIndicator, { className: "cdt-select__indicator", "aria-hidden": "true", children: indicator })
80
81
  ] });
81
82
  });
82
83
  SelectItem.displayName = "Select.Item";
@@ -8,6 +8,7 @@ var AppShell = forwardRef(function AppShell2({
8
8
  className,
9
9
  mainId = "cdt-main",
10
10
  nav,
11
+ navCloseLabel = "Close navigation",
11
12
  navOpen,
12
13
  onNavOpenChange,
13
14
  skipLinkLabel,
@@ -36,7 +37,7 @@ var AppShell = forwardRef(function AppShell2({
36
37
  ] })
37
38
  ] }),
38
39
  /* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
39
- /* @__PURE__ */ jsx("div", { className: "cdt-app-shell__overlay", "aria-hidden": "true" }),
40
+ /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx("button", { type: "button", className: "cdt-app-shell__overlay", "aria-label": navCloseLabel }) }),
40
41
  /* @__PURE__ */ jsxs(RadixDialog.Content, { className: "cdt-app-shell__nav", "data-mobile": "", children: [
41
42
  /* @__PURE__ */ jsx(RadixDialog.Title, { className: "cdt-sr-only", children: "Navigation" }),
42
43
  nav
@@ -1,3 +1,4 @@
1
+ import { Spinner } from './chunk-NF3ZHADJ.js';
1
2
  import { cx } from './chunk-WEIMKRZV.js';
2
3
  import { forwardRef } from 'react';
3
4
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -33,7 +34,7 @@ var Button = forwardRef(function Button2({ blockedReason, className, disabled, i
33
34
  onClick?.(event);
34
35
  },
35
36
  children: [
36
- iconStart === void 0 ? null : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: iconStart }),
37
+ loading ? /* @__PURE__ */ jsx(Spinner, { size: "sm", label: "", "aria-hidden": "true" }) : iconStart === void 0 ? null : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: iconStart }),
37
38
  children,
38
39
  iconEnd === void 0 ? null : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: iconEnd })
39
40
  ]
@@ -42,7 +43,7 @@ var Button = forwardRef(function Button2({ blockedReason, className, disabled, i
42
43
  });
43
44
  Button.displayName = "Button";
44
45
  var IconButton = forwardRef(function IconButton2({ icon, size, ...props }, ref) {
45
- return /* @__PURE__ */ jsx(Button, { ...props, ref, size, className: cx("cdt-btn--icon", size === "sm" && "cdt-btn--icon-sm", props.className), children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: icon }) });
46
+ return /* @__PURE__ */ jsx(Button, { ...props, ref, size, className: cx("cdt-btn--icon", props.className), children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: icon }) });
46
47
  });
47
48
  IconButton.displayName = "IconButton";
48
49
 
package/dist/form.d.ts CHANGED
@@ -29,6 +29,10 @@ type SelectTriggerProps = ComponentPropsWithoutRef<typeof RadixSelect.Trigger> &
29
29
  readonly size?: "sm" | "md";
30
30
  readonly invalid?: boolean;
31
31
  };
32
+ /** `indicator` matches `Checkbox`: the check glyph is a text character unless a consumer swaps it. */
33
+ type SelectItemProps = ComponentPropsWithoutRef<typeof RadixSelect.Item> & {
34
+ readonly indicator?: ReactNode;
35
+ };
32
36
  declare const Select: {
33
37
  readonly Root: react.FC<RadixSelect.SelectProps>;
34
38
  readonly Trigger: react.ForwardRefExoticComponent<Omit<RadixSelect.SelectTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
@@ -37,7 +41,9 @@ declare const Select: {
37
41
  } & react.RefAttributes<HTMLButtonElement>>;
38
42
  readonly Value: react.ForwardRefExoticComponent<RadixSelect.SelectValueProps & react.RefAttributes<HTMLSpanElement>>;
39
43
  readonly Content: react.ForwardRefExoticComponent<Omit<RadixSelect.SelectContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
40
- readonly Item: react.ForwardRefExoticComponent<Omit<RadixSelect.SelectItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
44
+ readonly Item: react.ForwardRefExoticComponent<Omit<RadixSelect.SelectItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
45
+ readonly indicator?: ReactNode;
46
+ } & react.RefAttributes<HTMLDivElement>>;
41
47
  readonly Group: react.ForwardRefExoticComponent<RadixSelect.SelectGroupProps & react.RefAttributes<HTMLDivElement>>;
42
48
  readonly Label: react.ForwardRefExoticComponent<RadixSelect.SelectLabelProps & react.RefAttributes<HTMLDivElement>>;
43
49
  };
@@ -50,4 +56,4 @@ declare const Checkbox: react.ForwardRefExoticComponent<Omit<RadixCheckbox.Check
50
56
  readonly indicator?: ReactNode;
51
57
  } & react.RefAttributes<HTMLButtonElement>>;
52
58
 
53
- export { Checkbox, type CheckboxProps, Field, type FieldProps, Select, type SelectTriggerProps, Switch, type SwitchProps, TextArea, type TextAreaProps, TextField, type TextFieldProps };
59
+ export { Checkbox, type CheckboxProps, Field, type FieldProps, Select, type SelectItemProps, type SelectTriggerProps, Switch, type SwitchProps, TextArea, type TextAreaProps, TextField, type TextFieldProps };
package/dist/form.js CHANGED
@@ -1,2 +1,2 @@
1
- export { Checkbox, Field, Select, Switch, TextArea, TextField } from './chunk-FBQXGRI7.js';
1
+ export { Checkbox, Field, Select, Switch, TextArea, TextField } from './chunk-KXMZ3OVM.js';
2
2
  import './chunk-WEIMKRZV.js';
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { Card, CardGrid, CardGridProps, CardProps, Panel, PanelProps } from './s
5
5
  export { Badge, BadgeProps, Severity, SeverityTag, SeverityTagProps, Status, StatusBadge, StatusBadgeProps } from './status.js';
6
6
  export { CodeBlock, CodeBlockProps, Kbd, KbdProps, Table, TableCellProps, TableHeaderCellProps, TableProps, Timeline, TimelineProps, TimelineStepProps } from './data.js';
7
7
  export { Dialog, DialogContentProps, Drawer, DrawerContentProps, DropdownMenu, DropdownMenuItemProps, Tooltip, TooltipContentProps } from './overlay.js';
8
- export { Checkbox, CheckboxProps, Field, FieldProps, Select, SelectTriggerProps, Switch, SwitchProps, TextArea, TextAreaProps, TextField, TextFieldProps } from './form.js';
8
+ export { Checkbox, CheckboxProps, Field, FieldProps, Select, SelectItemProps, SelectTriggerProps, Switch, SwitchProps, TextArea, TextAreaProps, TextField, TextFieldProps } from './form.js';
9
9
  export { Banner, BannerProps, EmptyState, EmptyStateProps, Meter, MeterProps, ProgressRing, ProgressRingProps, Spinner, SpinnerProps } from './feedback.js';
10
10
  export { AppShell, AppShellProps, NavItem, NavLinkRenderProps, NavList, NavListProps, TopBar, TopBarProps } from './shell.js';
11
11
  import 'react';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- export { Badge, SeverityTag, StatusBadge } from './chunk-PXSSKHWF.js';
1
+ export { Badge, SeverityTag, StatusBadge } from './chunk-535YGQAR.js';
2
2
  export { Card, CardGrid, Panel } from './chunk-TUHWL5JC.js';
3
- export { Button, IconButton } from './chunk-EA2W7T64.js';
3
+ export { Button, IconButton } from './chunk-VAG2L2VQ.js';
4
4
  export { CodeBlock, Kbd, Table, Timeline } from './chunk-RBD5Z2LR.js';
5
5
  export { Banner, EmptyState, Meter, ProgressRing, Spinner } from './chunk-NF3ZHADJ.js';
6
- export { Checkbox, Field, Select, Switch, TextArea, TextField } from './chunk-FBQXGRI7.js';
6
+ export { Checkbox, Field, Select, Switch, TextArea, TextField } from './chunk-KXMZ3OVM.js';
7
7
  export { Dialog, Drawer, DropdownMenu, Tooltip } from './chunk-MR7FIZKV.js';
8
- export { AppShell, NavList, TopBar } from './chunk-VLBBY4MW.js';
8
+ export { AppShell, NavList, TopBar } from './chunk-R5BLKHR2.js';
9
9
  export { cx } from './chunk-WEIMKRZV.js';
10
10
  import { PACKAGE_NAME as PACKAGE_NAME$1, CDT_PREFIX } from '@conductor-by-89soone/tokens';
11
11
 
package/dist/shell.d.ts CHANGED
@@ -7,6 +7,8 @@ interface AppShellProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">
7
7
  readonly navOpen?: boolean;
8
8
  readonly onNavOpenChange?: (open: boolean) => void;
9
9
  readonly skipLinkLabel: string;
10
+ /** Accessible name of the mobile navigation scrim, which closes the drawer. */
11
+ readonly navCloseLabel?: string;
10
12
  readonly mainId?: string;
11
13
  readonly children: ReactNode;
12
14
  }
package/dist/shell.js CHANGED
@@ -1,2 +1,2 @@
1
- export { AppShell, NavList, TopBar } from './chunk-VLBBY4MW.js';
1
+ export { AppShell, NavList, TopBar } from './chunk-R5BLKHR2.js';
2
2
  import './chunk-WEIMKRZV.js';
package/dist/status.d.ts CHANGED
@@ -11,6 +11,12 @@ declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttri
11
11
  type Status = "queued" | "running" | "waiting" | "success" | "partial" | "danger" | "neutralEnd";
12
12
  interface StatusBadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
13
13
  readonly status: Status;
14
+ /**
15
+ * The status icon. Required: FR-CMP-004 AC-1 renders colour, icon and text as three channels,
16
+ * and Conductor bundles no icon set. `STATUS_ICONS[status]` from
17
+ * `@conductor-by-89soone/tokens` names the icon to pass; the rendered element repeats that name
18
+ * as `data-cdt-icon` so the choice is checkable from the DOM.
19
+ */
14
20
  readonly icon: ReactNode;
15
21
  readonly label: string;
16
22
  }
@@ -18,6 +24,7 @@ declare const StatusBadge: react.ForwardRefExoticComponent<StatusBadgeProps & re
18
24
  type Severity = "read" | "write" | "destructive" | "blocked";
19
25
  interface SeverityTagProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
20
26
  readonly severity: Severity;
27
+ /** The severity icon. `SEVERITY_ICONS[severity]` names it; see `StatusBadgeProps.icon`. */
21
28
  readonly icon: ReactNode;
22
29
  readonly label: string;
23
30
  }
package/dist/status.js CHANGED
@@ -1,2 +1,2 @@
1
- export { Badge, SeverityTag, StatusBadge } from './chunk-PXSSKHWF.js';
1
+ export { Badge, SeverityTag, StatusBadge } from './chunk-535YGQAR.js';
2
2
  import './chunk-WEIMKRZV.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conductor-by-89soone/react",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Accessible React primitives for Conductor.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://89sooner.github.io/design-system/",
@@ -34,8 +34,8 @@
34
34
  "@radix-ui/react-select": "2.2.5",
35
35
  "@radix-ui/react-switch": "1.2.5",
36
36
  "@radix-ui/react-tooltip": "1.2.12",
37
- "@conductor-by-89soone/css": "0.1.0",
38
- "@conductor-by-89soone/tokens": "0.1.0"
37
+ "@conductor-by-89soone/tokens": "0.2.0",
38
+ "@conductor-by-89soone/css": "0.2.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "lucide-react": ">=0.400.0 <2",