@viax.io/uxm 4.40.1 → 4.41.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +78 -19
  3. package/dist/studio/index.cjs.map +1 -1
  4. package/dist/studio/index.d.ts +3 -2
  5. package/dist/studio/index.d.ts.map +1 -1
  6. package/dist/studio/index.js.map +1 -1
  7. package/dist/studio/lib/registry/composite/list-item.cjs +22 -5
  8. package/dist/studio/lib/registry/composite/list-item.cjs.map +1 -1
  9. package/dist/studio/lib/registry/composite/list-item.d.ts.map +1 -1
  10. package/dist/studio/lib/registry/composite/list-item.js +22 -5
  11. package/dist/studio/lib/registry/composite/list-item.js.map +1 -1
  12. package/dist/ui/app-sidebar/app-sidebar.css +0 -1
  13. package/dist/ui/app-top-bar/app-top-bar.css +0 -1
  14. package/dist/ui/avatar/avatar.css +0 -1
  15. package/dist/ui/back-link/back-link.css +0 -1
  16. package/dist/ui/badge/badge.css +0 -1
  17. package/dist/ui/banner/banner.css +0 -1
  18. package/dist/ui/breadcrumb/breadcrumb.css +0 -1
  19. package/dist/ui/bulk-action-bar/bulk-action-bar.css +0 -1
  20. package/dist/ui/button/button.css +0 -1
  21. package/dist/ui/button-group/button-group.css +0 -1
  22. package/dist/ui/button-icon/button-icon.css +0 -1
  23. package/dist/ui/button-with-icon/button-with-icon.css +0 -1
  24. package/dist/ui/calendar/calendar.css +0 -1
  25. package/dist/ui/card/card.css +0 -1
  26. package/dist/ui/checkbox/checkbox.css +0 -1
  27. package/dist/ui/chip/chip.css +0 -1
  28. package/dist/ui/cluster/cluster.css +0 -1
  29. package/dist/ui/code-editor/code-editor.css +0 -1
  30. package/dist/ui/color-input/color-input.css +0 -1
  31. package/dist/ui/component-row/component-row.css +0 -1
  32. package/dist/ui/config-component-row/config-component-row.css +0 -1
  33. package/dist/ui/config-segment-item/config-segment-item.css +0 -1
  34. package/dist/ui/currency-input/currency-input.css +0 -1
  35. package/dist/ui/data-table/data-table.css +0 -1
  36. package/dist/ui/date-input/date-input.css +0 -1
  37. package/dist/ui/detail-section/detail-section.css +0 -1
  38. package/dist/ui/dialog/dialog.css +0 -1
  39. package/dist/ui/disclosure/disclosure.css +0 -1
  40. package/dist/ui/divider/divider.css +0 -1
  41. package/dist/ui/editable-cell/editable-cell.css +0 -1
  42. package/dist/ui/empty-state/empty-state.css +0 -1
  43. package/dist/ui/error-page/error-page.css +0 -1
  44. package/dist/ui/explorer-list-item/explorer-list-item.css +0 -1
  45. package/dist/ui/explorer-section/explorer-section.css +0 -1
  46. package/dist/ui/file-upload/file-upload.css +0 -1
  47. package/dist/ui/filter-tabs/filter-tabs.css +0 -1
  48. package/dist/ui/form-field/form-field.css +0 -1
  49. package/dist/ui/icon/icon.css +0 -1
  50. package/dist/ui/icon-button/icon-button.css +0 -1
  51. package/dist/ui/icon-tile/icon-tile.css +0 -1
  52. package/dist/ui/inline-action/inline-action.css +0 -1
  53. package/dist/ui/inline-filter/inline-filter.css +0 -1
  54. package/dist/ui/input/input.css +0 -1
  55. package/dist/ui/input-with-icon/input-with-icon.css +0 -1
  56. package/dist/ui/language-switcher/language-switcher.css +0 -1
  57. package/dist/ui/lifecycle-connector/lifecycle-connector.css +0 -1
  58. package/dist/ui/lifecycle-drop-slot/lifecycle-drop-slot.css +0 -1
  59. package/dist/ui/lifecycle-edge-label/lifecycle-edge-label.css +0 -1
  60. package/dist/ui/lifecycle-group-box/lifecycle-group-box.css +0 -1
  61. package/dist/ui/lifecycle-minimap/lifecycle-minimap.css +0 -1
  62. package/dist/ui/lifecycle-node-card/lifecycle-node-card.css +0 -1
  63. package/dist/ui/lifecycle-terminal/lifecycle-terminal.css +0 -1
  64. package/dist/ui/lifecycle-zoom-control/lifecycle-zoom-control.css +0 -1
  65. package/dist/ui/link/link.css +0 -1
  66. package/dist/ui/list/list-item-preview.cjs +9 -4
  67. package/dist/ui/list/list-item-preview.cjs.map +1 -1
  68. package/dist/ui/list/list-item-preview.d.ts.map +1 -1
  69. package/dist/ui/list/list-item-preview.js +10 -5
  70. package/dist/ui/list/list-item-preview.js.map +1 -1
  71. package/dist/ui/list/list.cjs +9 -1
  72. package/dist/ui/list/list.cjs.map +1 -1
  73. package/dist/ui/list/list.css +39 -1
  74. package/dist/ui/list/list.d.ts +32 -1
  75. package/dist/ui/list/list.d.ts.map +1 -1
  76. package/dist/ui/list/list.js +8 -1
  77. package/dist/ui/list/list.js.map +1 -1
  78. package/dist/ui/listbox/listbox.css +0 -1
  79. package/dist/ui/loader/loader.css +0 -1
  80. package/dist/ui/menu/menu.css +0 -1
  81. package/dist/ui/meta-row/meta-row.css +0 -1
  82. package/dist/ui/modal/modal.css +0 -1
  83. package/dist/ui/number-input/number-input.css +0 -1
  84. package/dist/ui/number-stepper/number-stepper.css +0 -1
  85. package/dist/ui/option-list/option-list.css +0 -1
  86. package/dist/ui/page-header/page-header.css +0 -1
  87. package/dist/ui/page-shell/page-shell.css +0 -1
  88. package/dist/ui/password-input/password-input.css +0 -1
  89. package/dist/ui/phone-input/phone-input.css +0 -1
  90. package/dist/ui/pill-select/pill-select.css +0 -1
  91. package/dist/ui/popover/popover.css +0 -1
  92. package/dist/ui/progress-bar/progress-bar.css +0 -1
  93. package/dist/ui/property-field/property-field.css +0 -1
  94. package/dist/ui/radio-group/radio-group.css +0 -1
  95. package/dist/ui/range-slider/range-slider.css +0 -1
  96. package/dist/ui/responsive-grid/responsive-grid.css +0 -1
  97. package/dist/ui/search-dropdown/search-dropdown.css +0 -1
  98. package/dist/ui/section-header/section-header.css +0 -1
  99. package/dist/ui/segment-card/segment-card.css +0 -1
  100. package/dist/ui/segment-row/segment-row.css +0 -1
  101. package/dist/ui/side-flexpane/side-flexpane.css +0 -1
  102. package/dist/ui/sidebar-nav-item/sidebar-nav-item.css +0 -1
  103. package/dist/ui/sidebar-nav-trigger/sidebar-nav-trigger.css +0 -1
  104. package/dist/ui/slider/slider.css +0 -1
  105. package/dist/ui/stack/stack.css +0 -1
  106. package/dist/ui/stat-card/stat-card.css +0 -1
  107. package/dist/ui/tabs/tabs.css +0 -1
  108. package/dist/ui/tabs-underline/tabs-underline.css +0 -1
  109. package/dist/ui/tag/tag.css +0 -1
  110. package/dist/ui/thumbnail/thumbnail.css +0 -1
  111. package/dist/ui/time-input/time-input.css +0 -1
  112. package/dist/ui/timeline-entry/timeline-entry.css +0 -1
  113. package/dist/ui/toast/toast.css +0 -1
  114. package/dist/ui/toggle-switch/toggle-switch.css +0 -1
  115. package/dist/ui/tooltip/tooltip.css +0 -1
  116. package/dist/ui/type-overview-card/type-overview-card.css +0 -1
  117. package/dist/ui/view-switcher/view-switcher.css +0 -1
  118. package/package.json +3 -1
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── checkbox ── */
3
2
  /* Checkbox / Radio / ToggleSwitch share a label-row layout but each
4
3
  owns its own gap var so editor saves on one don't bleed into others.
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── chip ── */
3
2
  .uxm-chip {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* Cluster — moved from monolithic styles.css */
3
2
  .uxm-cluster {
4
3
  display: flex;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* Code Editor / Code Block — the developer-tooling code surface.
3
2
 
4
3
  Both atoms are a flex row: an optional line-number gutter, then the code.
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── Color Input ──
3
2
  Inline color picker: saturation/brightness area, hue + opacity tracks, a
4
3
  swatch, an eyedropper button, a format select and a per-format value editor
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── component-row ── */
3
2
  .uxm-component-row {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── config-component-row ── */
3
2
  .uxm-config-component-row {
4
3
  /* width: 100% + own border/padding only add up under border-box; ui.css
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── config-segment-item ── */
3
2
  .uxm-config-segment-item {
4
3
  align-items: stretch;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* Currency Input — monetary field with a leading interactive currency
3
2
  picker. Architecturally mirrors PhoneInput: the wrapper IS the
4
3
  visible surface, the leading slot is a `<button>` that opens a
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── Data table ── */
3
2
  /* DataTable — root holds the rounded border container; row/cell visuals
4
3
  live on inner __head, __row, __th, __td elements. All inner elements
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* DateInput — moved from monolithic styles.css */
3
2
  .uxm-date-input {
4
3
  position: relative;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── detail-section ── */
3
2
  /* DetailSection — defaults match the `detail-section` registry entry.
4
3
  `padding` controls the inner box (rail width is added on the left so
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── dialog ─────────────────────────────────────────────────────────────────
3
2
  Dialog (shell — provides mechanics, no visible chrome of its own)
4
3
 
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── disclosure ── */
3
2
  /* Disclosure — header-only collapsible row. Renders as a single button
4
3
  (icon + label + right chevron). The chevron rotates 90° when open.
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── divider ── */
3
2
  .uxm-divider {
4
3
  background-color: var(--uxm-divider-color, var(--color-border));
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── EditableCell ──
3
2
  Inline-editable text/number cell. Display mode is a button styled as
4
3
  text — hover surfaces a subtle background tint as the affordance, so
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── empty-state ── */
3
2
  .uxm-empty-state {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── error-page ── */
3
2
  .uxm-error-page {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── explorer-list-item ── */
3
2
  /* ── ExplorerListItem ──
4
3
  Component-explorer / file-tree row. Active state shows a left rail
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── explorer-section ── */
3
2
  /* ── ExplorerSection ──
4
3
  Disclosure header for grouping rows in a navigation list. Chevron
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── File Upload ──
3
2
  File-upload atom with two interaction modes (click anywhere on the label
4
3
  opens the picker; drop fires onFiles). State is driven by a
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── filter-tabs ── */
3
2
  /* Filter Tabs (label-only segmented filter) */
4
3
  .uxm-filter-tabs {
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── form-field ── */
3
2
  /* FormField — pairs a label with any UXM input. Sole owner of label
4
3
  theming across the form family. Top layout uses margin-bottom on the
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── icon ── */
3
2
  .uxm-icon {
4
3
  display: inline-block;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── icon-button ── */
3
2
  /* IconButton — defaults match the `icon-button` registry: 32×32, radius 6,
4
3
  transparent bg, text-muted icon, surface-alt hover, 0.4 disabled opacity.
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── icon-tile ── */
3
2
  .uxm-icon-tile {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── inline-action ── */
3
2
  /* ── InlineAction ──
4
3
  Tertiary text-with-optional-icon button for dense UI. Muted by
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── inline-filter ── */
3
2
  .uxm-inline-filter {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── Inputs ──
3
2
  Each atom in the family — input-text, textarea, select-dropdown — gets
4
3
  its own per-state rule set so saved theming on one doesn't bleed into
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── input-with-icon ── */
3
2
  /* InputWithIcon — every registry knob (bg, border, radius, paddings,
4
3
  fontSize, color, iconColor, iconSize, iconOffset) maps to a CSS
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── language-switcher ── */
3
2
  /* LanguageSwitcher — globe + current endonym + caret, opening the shared
4
3
  Listbox panel. The panel itself is NOT styled here: it inherits the
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-connector ── */
3
2
  /* Override vars are read under their canonical `--uxm-lifecycle-connector-*`
4
3
  name, with the doubled `--uxm-lifecycle-connector-connector-*` spelling kept
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-drop-slot ── */
3
2
  .uxm-lifecycle-drop-slot {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-edge-label ── */
3
2
  .uxm-lifecycle-edge-label {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-group-box ── */
3
2
  .uxm-lifecycle-group-box {
4
3
  /* Frosted, not solid — see the component doc comment. */
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-minimap ── */
3
2
  .uxm-lifecycle-minimap {
4
3
  background-color: var(--uxm-lifecycle-minimap-bg, var(--color-surface-alt));
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-node-card ── */
3
2
  .uxm-lifecycle-node-card {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-terminal ── */
3
2
  .uxm-lifecycle-terminal {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── lifecycle-zoom-control ── */
3
2
  .uxm-lifecycle-zoom-control {
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* ── link ── */
3
2
  /* Link — generic inline text anchor with underline + external variants.
4
3
  State colours read the studio `--uxm-link-{state}-text` vars (generate-css
@@ -27,6 +27,7 @@ var import_helpers = require("../../helpers/index.cjs");
27
27
  var import_ui = require("../index.cjs");
28
28
  var import_ui2 = require("../index.cjs");
29
29
  var import_ui3 = require("../index.cjs");
30
+ var import_ui4 = require("../index.cjs");
30
31
  var import_list = require("./list.cjs");
31
32
  function buildVars(styles) {
32
33
  return {
@@ -53,9 +54,11 @@ function buildVars(styles) {
53
54
  "--uxm-list-item-icon-color": styles.iconColor,
54
55
  "--uxm-list-item-icon-size": `${styles.iconSize}px`,
55
56
  "--uxm-list-item-icon-radius": `${styles.iconRadius}px`,
57
+ "--uxm-list-item-media-size": `${styles.mediaSize}px`,
56
58
  "--uxm-list-item-chevron-color": styles.chevronColor
57
59
  };
58
60
  }
61
+ const DEMO_MEDIA = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui4.Thumbnail, { alt: "" });
59
62
  function trailingForMode(mode, meta, tagType) {
60
63
  if (mode === "interactive") {
61
64
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { glyph: "chevron-right", size: 16 });
@@ -65,13 +68,14 @@ function trailingForMode(mode, meta, tagType) {
65
68
  function StaticShowcase({
66
69
  mode,
67
70
  state,
68
- showValue
71
+ showValue,
72
+ leading
69
73
  }) {
70
74
  const isInteractive = mode === "interactive";
71
75
  const isActive = isInteractive && state === "active";
72
76
  const isDisabled = state === "disabled";
73
77
  const inner = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
74
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.IconTile, { className: "uxm-list-item__icon", style: import_list.LIST_ITEM_ICON_TILE_STYLE, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { glyph: "square" }) }),
78
+ leading === "media" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "uxm-list-item__media", style: import_list.LIST_ITEM_MEDIA_STYLE, children: DEMO_MEDIA }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.IconTile, { className: "uxm-list-item__icon", style: import_list.LIST_ITEM_ICON_TILE_STYLE, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { glyph: "square" }) }),
75
79
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "uxm-list-item__content", children: [
76
80
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "uxm-list-item__title", children: "Owner" }),
77
81
  showValue && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "uxm-list-item__value", children: "Alex Morgan" })
@@ -116,6 +120,7 @@ function ListItemPreview({ styles, variants }) {
116
120
  const mode = variants.mode ?? "interactive";
117
121
  const state = variants.state ?? "default";
118
122
  const showValue = (variants.value ?? "shown") === "shown";
123
+ const leading = variants.leading ?? "icon";
119
124
  const [activeKey, setActiveKey] = (0, import_react.useState)("plan");
120
125
  const cssVars = buildVars(styles);
121
126
  const sectionLabel = {
@@ -131,7 +136,7 @@ function ListItemPreview({ styles, variants }) {
131
136
  state,
132
137
  " state"
133
138
  ] }),
134
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StaticShowcase, { mode, state, showValue })
139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StaticShowcase, { mode, state, showValue, leading })
135
140
  ] }),
136
141
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { borderTop: "1px solid var(--color-border)", paddingTop: 16 }, children: [
137
142
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: sectionLabel, children: mode === "interactive" ? "Interactive" : "Static" }),
@@ -143,7 +148,7 @@ function ListItemPreview({ styles, variants }) {
143
148
  interactive: isInteractive,
144
149
  active: isInteractive && row.key === activeKey,
145
150
  disabled: state === "disabled" && i === 1,
146
- icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { glyph: "square" }),
151
+ ...leading === "media" ? { media: DEMO_MEDIA } : { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { glyph: "square" }) },
147
152
  value: showValue ? row.value : void 0,
148
153
  trailing: trailingForMode(mode, row.meta, row.tagType),
149
154
  onClick: isInteractive ? () => setActiveKey(row.key) : void 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/list/list-item-preview.tsx"],"sourcesContent":["import { useState, type CSSProperties, type ReactNode } from 'react';\n\nimport { cn } from '@/helpers';\nimport type { PreviewProps } from '@/previews/types';\nimport { Icon, IconTile } from '@/ui';\nimport { List, ListItem } from '@/ui';\nimport { Tag, type TagType } from '@/ui';\n\nimport { LIST_ITEM_ICON_TILE_STYLE } from './list';\n\ntype Styles = PreviewProps['styles'];\ntype Mode = 'static' | 'interactive';\n\n/**\n * Project every registry knob as a `--uxm-list-item-*` custom property\n * on the wrapper. Both the static showcase and the interactive list\n * below read from the same vars; the showcase forces a state via the\n * `--state-*` modifier class while the interactive list exercises the\n * production `:hover` / `:focus-visible` / `:disabled` rules on real\n * pointer + keyboard.\n */\nfunction buildVars(styles: Styles): CSSProperties {\n return {\n '--uxm-list-item-inactive-bg': styles.inactiveBg as string,\n '--uxm-list-item-inactive-text': styles.inactiveText as string,\n '--uxm-list-item-hover-bg': styles.hoverBg as string,\n '--uxm-list-item-hover-text': styles.hoverText as string,\n '--uxm-list-item-focus-text': styles.focusText as string,\n '--uxm-list-item-focus-ring': styles.focusRing as string,\n '--uxm-list-item-active-bg': styles.activeBg as string,\n '--uxm-list-item-active-text': styles.activeText as string,\n '--uxm-list-item-disabled-bg': styles.disabledBg as string,\n '--uxm-list-item-disabled-text': styles.disabledText as string,\n '--uxm-list-item-disabled-opacity':\n styles.disabledOpacity != null ? String(styles.disabledOpacity) : undefined,\n '--uxm-list-item-border-color': styles.borderColor as string,\n '--uxm-list-item-border-radius': `${styles.borderRadius}px`,\n '--uxm-list-item-padding-x': `${styles.paddingX}px`,\n '--uxm-list-item-padding-y': `${styles.paddingY}px`,\n '--uxm-list-item-gap': `${styles.gap}px`,\n '--uxm-list-item-font-size': `${styles.fontSize}px`,\n '--uxm-list-item-value-color': styles.valueColor as string,\n '--uxm-list-item-value-size': `${styles.valueSize}px`,\n '--uxm-list-item-icon-bg': styles.iconBg as string,\n '--uxm-list-item-icon-color': styles.iconColor as string,\n '--uxm-list-item-icon-size': `${styles.iconSize}px`,\n '--uxm-list-item-icon-radius': `${styles.iconRadius}px`,\n '--uxm-list-item-chevron-color': styles.chevronColor as string,\n } as CSSProperties;\n}\n\n/**\n * Pick the canonical trailing element for the given mode. The trailing\n * slot is `ReactNode` on the atom — consumers can pass anything (Tag,\n * Badge, Avatar, custom node). The preview demos the canonical patterns:\n * - interactive → chevron icon (the \"tap to drill in\" affordance)\n * - static → Tag (status indicator for an info row)\n */\nfunction trailingForMode(\n mode: Mode,\n meta: string,\n tagType: TagType,\n): ReactNode {\n if (mode === 'interactive') {\n // Color inherits via `currentColor` from `.uxm-list-item__trailing`,\n // which reads `--uxm-list-item-chevron-color`. Keeps saves working\n // (the var has a single source of truth instead of an inline JS\n // override that would shadow it after save).\n return <Icon glyph=\"chevron-right\" size={16} />;\n }\n return <Tag type={tagType}>{meta}</Tag>;\n}\n\n/**\n * Static showcase — ONE row, rendering matches the `mode` variant.\n * - `interactive` → `<button>` with the forced-state class so all\n * state CSS rules can apply (inert via pointer-events: none and\n * tabIndex={-1}, so the forced state isn't overridden by real\n * input).\n * - `static` → `<div>` with no state class. State CSS rules are\n * scoped to button/anchor element selectors and don't fire on\n * divs, so the static row stays truly static.\n *\n * Hand-rendered because the atom doesn't expose a way to set the\n * showcase-only `--state-*` modifier class.\n */\nfunction StaticShowcase({\n mode,\n state,\n showValue,\n}: {\n mode: Mode;\n state: string;\n showValue: boolean;\n}) {\n const isInteractive = mode === 'interactive';\n const isActive = isInteractive && state === 'active';\n const isDisabled = state === 'disabled';\n const inner = (\n <>\n {/* Mirrors the atom: the icon slot is an IconTile, sized/coloured from\n the same forwarded knob vars (glyph size comes from the tile var). */}\n <IconTile className=\"uxm-list-item__icon\" style={LIST_ITEM_ICON_TILE_STYLE}>\n <Icon glyph=\"square\" />\n </IconTile>\n <span className=\"uxm-list-item__content\">\n <span className=\"uxm-list-item__title\">Owner</span>\n {showValue && <span className=\"uxm-list-item__value\">Alex Morgan</span>}\n </span>\n <span className=\"uxm-list-item__trailing\">\n {trailingForMode(mode, 'Verified', 'success')}\n </span>\n </>\n );\n\n return (\n <List>\n {isInteractive ? (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={isDisabled}\n aria-pressed={isActive}\n className={cn(\n 'uxm-list-item',\n isActive && 'uxm-list-item--active',\n state === 'hover' && 'uxm-list-item--state-hover',\n state === 'focus' && 'uxm-list-item--state-focus',\n )}\n style={{ pointerEvents: 'none' }}\n >\n {inner}\n </button>\n ) : (\n <div\n className=\"uxm-list-item\"\n {...(isDisabled ? { 'aria-disabled': true } : {})}\n >\n {inner}\n </div>\n )}\n </List>\n );\n}\n\nconst ROWS: Array<{\n key: string;\n title: string;\n value: string;\n meta: string;\n tagType: TagType;\n}> = [\n // One row per Tag type, with a label that matches the type's\n // semantic meaning — so two tags never read the same word with\n // different visual treatments.\n { key: 'plan', title: 'Plan', value: 'Enterprise', meta: 'Pro', tagType: 'accent' },\n { key: 'billing', title: 'Billing', value: 'Visa •• 4242', meta: 'Action needed', tagType: 'warning' },\n { key: 'owner', title: 'Owner', value: 'Alex Morgan', meta: 'Verified', tagType: 'success' },\n { key: 'activity', title: 'Last activity', value: '2 hours ago', meta: 'Recent', tagType: 'neutral' },\n];\n\nexport function ListItemPreview({ styles, variants }: PreviewProps) {\n const mode = ((variants.mode as string) ?? 'interactive') as Mode;\n const state = (variants.state as string) ?? 'default';\n const showValue = ((variants.value as string) ?? 'shown') === 'shown';\n const [activeKey, setActiveKey] = useState<string>('plan');\n const cssVars = buildVars(styles);\n\n const sectionLabel = {\n fontSize: 11,\n color: 'var(--color-text-muted)',\n marginBottom: 12,\n letterSpacing: 0.5,\n textTransform: 'uppercase' as const,\n };\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: 32, minWidth: 380, ...cssVars } as CSSProperties}>\n <div>\n <div style={sectionLabel}>{state} state</div>\n <StaticShowcase mode={mode} state={state} showValue={showValue} />\n </div>\n\n {/* List — interactivity is driven by the `mode` variant. Trailing\n slot is set by the preview to the canonical example for each\n mode: chevron for interactive (the \"tap to drill in\" cue),\n Tag for static (status indicator).\n interactive → all rows render as <button>; the State dropdown\n carries through to `disabled` (applied to the second row),\n and real `:hover` / `:focus-visible` exercise the production\n CSS via the projected vars above.\n static → all rows render as <div>; the interactive states\n (hover / focus / active) are filtered out of the State picker\n via the registry's showWhen. `disabled` still applies to divs\n via `[aria-disabled]`. */}\n <div style={{ borderTop: '1px solid var(--color-border)', paddingTop: 16 }}>\n <div style={sectionLabel}>{mode === 'interactive' ? 'Interactive' : 'Static'}</div>\n <List>\n {ROWS.map((row, i) => {\n const isInteractive = mode === 'interactive';\n return (\n <ListItem\n key={row.key}\n interactive={isInteractive}\n active={isInteractive && row.key === activeKey}\n // Disabled is a visual treatment that applies to both\n // interactive rows (CSS `:disabled` / `[aria-disabled]`)\n // and static rows (`[aria-disabled]` on `<div>`).\n disabled={state === 'disabled' && i === 1}\n icon={<Icon glyph=\"square\" />}\n value={showValue ? row.value : undefined}\n trailing={trailingForMode(mode, row.meta, row.tagType)}\n onClick={isInteractive ? () => setActiveKey(row.key) : undefined}\n >\n {row.title}\n </ListItem>\n );\n })}\n </List>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoEW;AApEX,mBAA6D;AAE7D,qBAAmB;AAEnB,gBAA+B;AAC/B,IAAAA,aAA+B;AAC/B,IAAAA,aAAkC;AAElC,kBAA0C;AAa1C,SAAS,UAAU,QAA+B;AA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U,UAAU,MAAM;AAEhC,QAAM,eAAe;AAAA,IACnB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,eAAe;AAAA,EACjB;AAEA,SACE,6CAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,IAAI,UAAU,KAAK,GAAG,QAAQ,GACzF;AAAA,iDAAC,SACC;AAAA,mDAAC,SAAI,OAAO,cAAe;AAAA;AAAA,QAAM;AAAA,SAAM;AAAA,MACvC,4CAAC,kBAAe,MAAY,OAAc,WAAsB;AAAA,OAClE;AAAA,IAcA,6CAAC,SAAI,OAAO,EAAE,WAAW,iCAAiC,YAAY,GAAG,GACvE;AAAA,kDAAC,SAAI,OAAO,cAAe,mBAAS,gBAAgB,gBAAgB,UAAS;AAAA,MAC7E,4CAAC,mBACE,eAAK,IAAI,CAAC,KAAK,MAAM;AACpB,cAAM,gBAAgB,SAAS;AAC/B,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,aAAa;AAAA,YACb,QAAQ,iBAAiB,IAAI,QAAQ;AAAA,YAIrC,UAAU,UAAU,cAAc,MAAM;AAAA,YACxC,MAAM,4CAAC,kBAAK,OAAM,UAAS;AAAA,YAC3B,OAAO,YAAY,IAAI,QAAQ;AAAA,YAC/B,UAAU,gBAAgB,MAAM,IAAI,MAAM,IAAI,OAAO;AAAA,YACrD,SAAS,gBAAgB,MAAM,aAAa,IAAI,GAAG,IAAI;AAAA,YAEtD,cAAI;AAAA;AAAA,UAZA,IAAI;AAAA,QAaX;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":["import_ui"]}
1
+ {"version":3,"sources":["../../../src/ui/list/list-item-preview.tsx"],"sourcesContent":["import { useState, type CSSProperties, type ReactNode } from 'react';\n\nimport { cn } from '@/helpers';\nimport type { PreviewProps } from '@/previews/types';\nimport { Icon, IconTile } from '@/ui';\nimport { List, ListItem } from '@/ui';\nimport { Tag, type TagType } from '@/ui';\nimport { Thumbnail } from '@/ui';\n\nimport { LIST_ITEM_ICON_TILE_STYLE, LIST_ITEM_MEDIA_STYLE } from './list';\n\ntype Styles = PreviewProps['styles'];\ntype Mode = 'static' | 'interactive';\ntype Leading = 'icon' | 'media';\n\n/**\n * Project every registry knob as a `--uxm-list-item-*` custom property\n * on the wrapper. Both the static showcase and the interactive list\n * below read from the same vars; the showcase forces a state via the\n * `--state-*` modifier class while the interactive list exercises the\n * production `:hover` / `:focus-visible` / `:disabled` rules on real\n * pointer + keyboard.\n */\nfunction buildVars(styles: Styles): CSSProperties {\n return {\n '--uxm-list-item-inactive-bg': styles.inactiveBg as string,\n '--uxm-list-item-inactive-text': styles.inactiveText as string,\n '--uxm-list-item-hover-bg': styles.hoverBg as string,\n '--uxm-list-item-hover-text': styles.hoverText as string,\n '--uxm-list-item-focus-text': styles.focusText as string,\n '--uxm-list-item-focus-ring': styles.focusRing as string,\n '--uxm-list-item-active-bg': styles.activeBg as string,\n '--uxm-list-item-active-text': styles.activeText as string,\n '--uxm-list-item-disabled-bg': styles.disabledBg as string,\n '--uxm-list-item-disabled-text': styles.disabledText as string,\n '--uxm-list-item-disabled-opacity':\n styles.disabledOpacity != null ? String(styles.disabledOpacity) : undefined,\n '--uxm-list-item-border-color': styles.borderColor as string,\n '--uxm-list-item-border-radius': `${styles.borderRadius}px`,\n '--uxm-list-item-padding-x': `${styles.paddingX}px`,\n '--uxm-list-item-padding-y': `${styles.paddingY}px`,\n '--uxm-list-item-gap': `${styles.gap}px`,\n '--uxm-list-item-font-size': `${styles.fontSize}px`,\n '--uxm-list-item-value-color': styles.valueColor as string,\n '--uxm-list-item-value-size': `${styles.valueSize}px`,\n '--uxm-list-item-icon-bg': styles.iconBg as string,\n '--uxm-list-item-icon-color': styles.iconColor as string,\n '--uxm-list-item-icon-size': `${styles.iconSize}px`,\n '--uxm-list-item-icon-radius': `${styles.iconRadius}px`,\n '--uxm-list-item-media-size': `${styles.mediaSize}px`,\n '--uxm-list-item-chevron-color': styles.chevronColor as string,\n } as CSSProperties;\n}\n\n/**\n * The demo media node for the `leading: \"media\"` variant — a `Thumbnail`\n * with no `src`, so it renders the atom's own placeholder instead of\n * reaching for a network image the canvas may not be able to load. It\n * tracks the Media Size knob because the slot forwards\n * `--uxm-list-item-media-size` into `--uxm-thumbnail-size`\n * (`LIST_ITEM_MEDIA_STYLE`), so the frame AND its placeholder glyph scale\n * together — the row owns the leading geometry, the media owns its surface.\n * `alt=\"\"` because the row's title is the accessible name; a described\n * image here would be concatenated into it.\n */\nconst DEMO_MEDIA = <Thumbnail alt=\"\" />;\n\n/**\n * Pick the canonical trailing element for the given mode. The trailing\n * slot is `ReactNode` on the atom — consumers can pass anything (Tag,\n * Badge, Avatar, custom node). The preview demos the canonical patterns:\n * - interactive → chevron icon (the \"tap to drill in\" affordance)\n * - static → Tag (status indicator for an info row)\n */\nfunction trailingForMode(\n mode: Mode,\n meta: string,\n tagType: TagType,\n): ReactNode {\n if (mode === 'interactive') {\n // Color inherits via `currentColor` from `.uxm-list-item__trailing`,\n // which reads `--uxm-list-item-chevron-color`. Keeps saves working\n // (the var has a single source of truth instead of an inline JS\n // override that would shadow it after save).\n return <Icon glyph=\"chevron-right\" size={16} />;\n }\n return <Tag type={tagType}>{meta}</Tag>;\n}\n\n/**\n * Static showcase — ONE row, rendering matches the `mode` variant.\n * - `interactive` → `<button>` with the forced-state class so all\n * state CSS rules can apply (inert via pointer-events: none and\n * tabIndex={-1}, so the forced state isn't overridden by real\n * input).\n * - `static` → `<div>` with no state class. State CSS rules are\n * scoped to button/anchor element selectors and don't fire on\n * divs, so the static row stays truly static.\n *\n * Hand-rendered because the atom doesn't expose a way to set the\n * showcase-only `--state-*` modifier class.\n */\nfunction StaticShowcase({\n mode,\n state,\n showValue,\n leading,\n}: {\n mode: Mode;\n state: string;\n showValue: boolean;\n leading: Leading;\n}) {\n const isInteractive = mode === 'interactive';\n const isActive = isInteractive && state === 'active';\n const isDisabled = state === 'disabled';\n const inner = (\n <>\n {/* Mirrors the atom's leading slot: an IconTile sized/coloured from the\n same forwarded knob vars (glyph size comes from the tile var), or the\n un-tiled media span when the Leading variant selects it. */}\n {leading === 'media' ? (\n <span className=\"uxm-list-item__media\" style={LIST_ITEM_MEDIA_STYLE}>\n {DEMO_MEDIA}\n </span>\n ) : (\n <IconTile className=\"uxm-list-item__icon\" style={LIST_ITEM_ICON_TILE_STYLE}>\n <Icon glyph=\"square\" />\n </IconTile>\n )}\n <span className=\"uxm-list-item__content\">\n <span className=\"uxm-list-item__title\">Owner</span>\n {showValue && <span className=\"uxm-list-item__value\">Alex Morgan</span>}\n </span>\n <span className=\"uxm-list-item__trailing\">\n {trailingForMode(mode, 'Verified', 'success')}\n </span>\n </>\n );\n\n return (\n <List>\n {isInteractive ? (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={isDisabled}\n aria-pressed={isActive}\n className={cn(\n 'uxm-list-item',\n isActive && 'uxm-list-item--active',\n state === 'hover' && 'uxm-list-item--state-hover',\n state === 'focus' && 'uxm-list-item--state-focus',\n )}\n style={{ pointerEvents: 'none' }}\n >\n {inner}\n </button>\n ) : (\n <div\n className=\"uxm-list-item\"\n {...(isDisabled ? { 'aria-disabled': true } : {})}\n >\n {inner}\n </div>\n )}\n </List>\n );\n}\n\nconst ROWS: Array<{\n key: string;\n title: string;\n value: string;\n meta: string;\n tagType: TagType;\n}> = [\n // One row per Tag type, with a label that matches the type's\n // semantic meaning — so two tags never read the same word with\n // different visual treatments.\n { key: 'plan', title: 'Plan', value: 'Enterprise', meta: 'Pro', tagType: 'accent' },\n { key: 'billing', title: 'Billing', value: 'Visa •• 4242', meta: 'Action needed', tagType: 'warning' },\n { key: 'owner', title: 'Owner', value: 'Alex Morgan', meta: 'Verified', tagType: 'success' },\n { key: 'activity', title: 'Last activity', value: '2 hours ago', meta: 'Recent', tagType: 'neutral' },\n];\n\nexport function ListItemPreview({ styles, variants }: PreviewProps) {\n const mode = ((variants.mode as string) ?? 'interactive') as Mode;\n const state = (variants.state as string) ?? 'default';\n const showValue = ((variants.value as string) ?? 'shown') === 'shown';\n const leading = ((variants.leading as string) ?? 'icon') as Leading;\n const [activeKey, setActiveKey] = useState<string>('plan');\n const cssVars = buildVars(styles);\n\n const sectionLabel = {\n fontSize: 11,\n color: 'var(--color-text-muted)',\n marginBottom: 12,\n letterSpacing: 0.5,\n textTransform: 'uppercase' as const,\n };\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: 32, minWidth: 380, ...cssVars } as CSSProperties}>\n <div>\n <div style={sectionLabel}>{state} state</div>\n <StaticShowcase mode={mode} state={state} showValue={showValue} leading={leading} />\n </div>\n\n {/* List — interactivity is driven by the `mode` variant. Trailing\n slot is set by the preview to the canonical example for each\n mode: chevron for interactive (the \"tap to drill in\" cue),\n Tag for static (status indicator).\n interactive → all rows render as <button>; the State dropdown\n carries through to `disabled` (applied to the second row),\n and real `:hover` / `:focus-visible` exercise the production\n CSS via the projected vars above.\n static → all rows render as <div>; the interactive states\n (hover / focus / active) are filtered out of the State picker\n via the registry's showWhen. `disabled` still applies to divs\n via `[aria-disabled]`. */}\n <div style={{ borderTop: '1px solid var(--color-border)', paddingTop: 16 }}>\n <div style={sectionLabel}>{mode === 'interactive' ? 'Interactive' : 'Static'}</div>\n <List>\n {ROWS.map((row, i) => {\n const isInteractive = mode === 'interactive';\n return (\n <ListItem\n key={row.key}\n interactive={isInteractive}\n active={isInteractive && row.key === activeKey}\n // Disabled is a visual treatment that applies to both\n // interactive rows (CSS `:disabled` / `[aria-disabled]`)\n // and static rows (`[aria-disabled]` on `<div>`).\n disabled={state === 'disabled' && i === 1}\n {...(leading === 'media'\n ? { media: DEMO_MEDIA }\n : { icon: <Icon glyph=\"square\" /> })}\n value={showValue ? row.value : undefined}\n trailing={trailingForMode(mode, row.meta, row.tagType)}\n onClick={isInteractive ? () => setActiveKey(row.key) : undefined}\n >\n {row.title}\n </ListItem>\n );\n })}\n </List>\n </div>\n </div>\n );\n}\n"],"mapp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AA,YACpC,OAAO,YAAY,IAAI,QAAQ;AAAA,YAC/B,UAAU,gBAAgB,MAAM,IAAI,MAAM,IAAI,OAAO;AAAA,YACrD,SAAS,gBAAgB,MAAM,aAAa,IAAI,GAAG,IAAI;AAAA,YAEtD,cAAI;AAAA;AAAA,UAdA,IAAI;AAAA,QAeX;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":["import_ui"]}
@@ -1 +1 @@
1
- {"version":3,"file":"list-item-preview.d.ts","sourceRoot":"","sources":["../../../src/ui/list/list-item-preview.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA8JrD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY,+BA6DjE"}
1
+ {"version":3,"file":"list-item-preview.d.ts","sourceRoot":"","sources":["../../../src/ui/list/list-item-preview.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAuLrD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY,+BAgEjE"}
@@ -4,7 +4,8 @@ import { cn } from "../../helpers/index.js";
4
4
  import { Icon, IconTile } from "../index.js";
5
5
  import { List, ListItem } from "../index.js";
6
6
  import { Tag } from "../index.js";
7
- import { LIST_ITEM_ICON_TILE_STYLE } from "./list.js";
7
+ import { Thumbnail } from "../index.js";
8
+ import { LIST_ITEM_ICON_TILE_STYLE, LIST_ITEM_MEDIA_STYLE } from "./list.js";
8
9
  function buildVars(styles) {
9
10
  return {
10
11
  "--uxm-list-item-inactive-bg": styles.inactiveBg,
@@ -30,9 +31,11 @@ function buildVars(styles) {
30
31
  "--uxm-list-item-icon-color": styles.iconColor,
31
32
  "--uxm-list-item-icon-size": `${styles.iconSize}px`,
32
33
  "--uxm-list-item-icon-radius": `${styles.iconRadius}px`,
34
+ "--uxm-list-item-media-size": `${styles.mediaSize}px`,
33
35
  "--uxm-list-item-chevron-color": styles.chevronColor
34
36
  };
35
37
  }
38
+ const DEMO_MEDIA = /* @__PURE__ */ jsx(Thumbnail, { alt: "" });
36
39
  function trailingForMode(mode, meta, tagType) {
37
40
  if (mode === "interactive") {
38
41
  return /* @__PURE__ */ jsx(Icon, { glyph: "chevron-right", size: 16 });
@@ -42,13 +45,14 @@ function trailingForMode(mode, meta, tagType) {
42
45
  function StaticShowcase({
43
46
  mode,
44
47
  state,
45
- showValue
48
+ showValue,
49
+ leading
46
50
  }) {
47
51
  const isInteractive = mode === "interactive";
48
52
  const isActive = isInteractive && state === "active";
49
53
  const isDisabled = state === "disabled";
50
54
  const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
51
- /* @__PURE__ */ jsx(IconTile, { className: "uxm-list-item__icon", style: LIST_ITEM_ICON_TILE_STYLE, children: /* @__PURE__ */ jsx(Icon, { glyph: "square" }) }),
55
+ leading === "media" ? /* @__PURE__ */ jsx("span", { className: "uxm-list-item__media", style: LIST_ITEM_MEDIA_STYLE, children: DEMO_MEDIA }) : /* @__PURE__ */ jsx(IconTile, { className: "uxm-list-item__icon", style: LIST_ITEM_ICON_TILE_STYLE, children: /* @__PURE__ */ jsx(Icon, { glyph: "square" }) }),
52
56
  /* @__PURE__ */ jsxs("span", { className: "uxm-list-item__content", children: [
53
57
  /* @__PURE__ */ jsx("span", { className: "uxm-list-item__title", children: "Owner" }),
54
58
  showValue && /* @__PURE__ */ jsx("span", { className: "uxm-list-item__value", children: "Alex Morgan" })
@@ -93,6 +97,7 @@ function ListItemPreview({ styles, variants }) {
93
97
  const mode = variants.mode ?? "interactive";
94
98
  const state = variants.state ?? "default";
95
99
  const showValue = (variants.value ?? "shown") === "shown";
100
+ const leading = variants.leading ?? "icon";
96
101
  const [activeKey, setActiveKey] = useState("plan");
97
102
  const cssVars = buildVars(styles);
98
103
  const sectionLabel = {
@@ -108,7 +113,7 @@ function ListItemPreview({ styles, variants }) {
108
113
  state,
109
114
  " state"
110
115
  ] }),
111
- /* @__PURE__ */ jsx(StaticShowcase, { mode, state, showValue })
116
+ /* @__PURE__ */ jsx(StaticShowcase, { mode, state, showValue, leading })
112
117
  ] }),
113
118
  /* @__PURE__ */ jsxs("div", { style: { borderTop: "1px solid var(--color-border)", paddingTop: 16 }, children: [
114
119
  /* @__PURE__ */ jsx("div", { style: sectionLabel, children: mode === "interactive" ? "Interactive" : "Static" }),
@@ -120,7 +125,7 @@ function ListItemPreview({ styles, variants }) {
120
125
  interactive: isInteractive,
121
126
  active: isInteractive && row.key === activeKey,
122
127
  disabled: state === "disabled" && i === 1,
123
- icon: /* @__PURE__ */ jsx(Icon, { glyph: "square" }),
128
+ ...leading === "media" ? { media: DEMO_MEDIA } : { icon: /* @__PURE__ */ jsx(Icon, { glyph: "square" }) },
124
129
  value: showValue ? row.value : void 0,
125
130
  trailing: trailingForMode(mode, row.meta, row.tagType),
126
131
  onClick: isInteractive ? () => setActiveKey(row.key) : void 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/list/list-item-preview.tsx"],"sourcesContent":["import { useState, type CSSProperties, type ReactNode } from 'react';\n\nimport { cn } from '@/helpers';\nimport type { PreviewProps } from '@/previews/types';\nimport { Icon, IconTile } from '@/ui';\nimport { List, ListItem } from '@/ui';\nimport { Tag, type TagType } from '@/ui';\n\nimport { LIST_ITEM_ICON_TILE_STYLE } from './list';\n\ntype Styles = PreviewProps['styles'];\ntype Mode = 'static' | 'interactive';\n\n/**\n * Project every registry knob as a `--uxm-list-item-*` custom property\n * on the wrapper. Both the static showcase and the interactive list\n * below read from the same vars; the showcase forces a state via the\n * `--state-*` modifier class while the interactive list exercises the\n * production `:hover` / `:focus-visible` / `:disabled` rules on real\n * pointer + keyboard.\n */\nfunction buildVars(styles: Styles): CSSProperties {\n return {\n '--uxm-list-item-inactive-bg': styles.inactiveBg as string,\n '--uxm-list-item-inactive-text': styles.inactiveText as string,\n '--uxm-list-item-hover-bg': styles.hoverBg as string,\n '--uxm-list-item-hover-text': styles.hoverText as string,\n '--uxm-list-item-focus-text': styles.focusText as string,\n '--uxm-list-item-focus-ring': styles.focusRing as string,\n '--uxm-list-item-active-bg': styles.activeBg as string,\n '--uxm-list-item-active-text': styles.activeText as string,\n '--uxm-list-item-disabled-bg': styles.disabledBg as string,\n '--uxm-list-item-disabled-text': styles.disabledText as string,\n '--uxm-list-item-disabled-opacity':\n styles.disabledOpacity != null ? String(styles.disabledOpacity) : undefined,\n '--uxm-list-item-border-color': styles.borderColor as string,\n '--uxm-list-item-border-radius': `${styles.borderRadius}px`,\n '--uxm-list-item-padding-x': `${styles.paddingX}px`,\n '--uxm-list-item-padding-y': `${styles.paddingY}px`,\n '--uxm-list-item-gap': `${styles.gap}px`,\n '--uxm-list-item-font-size': `${styles.fontSize}px`,\n '--uxm-list-item-value-color': styles.valueColor as string,\n '--uxm-list-item-value-size': `${styles.valueSize}px`,\n '--uxm-list-item-icon-bg': styles.iconBg as string,\n '--uxm-list-item-icon-color': styles.iconColor as string,\n '--uxm-list-item-icon-size': `${styles.iconSize}px`,\n '--uxm-list-item-icon-radius': `${styles.iconRadius}px`,\n '--uxm-list-item-chevron-color': styles.chevronColor as string,\n } as CSSProperties;\n}\n\n/**\n * Pick the canonical trailing element for the given mode. The trailing\n * slot is `ReactNode` on the atom — consumers can pass anything (Tag,\n * Badge, Avatar, custom node). The preview demos the canonical patterns:\n * - interactive → chevron icon (the \"tap to drill in\" affordance)\n * - static → Tag (status indicator for an info row)\n */\nfunction trailingForMode(\n mode: Mode,\n meta: string,\n tagType: TagType,\n): ReactNode {\n if (mode === 'interactive') {\n // Color inherits via `currentColor` from `.uxm-list-item__trailing`,\n // which reads `--uxm-list-item-chevron-color`. Keeps saves working\n // (the var has a single source of truth instead of an inline JS\n // override that would shadow it after save).\n return <Icon glyph=\"chevron-right\" size={16} />;\n }\n return <Tag type={tagType}>{meta}</Tag>;\n}\n\n/**\n * Static showcase — ONE row, rendering matches the `mode` variant.\n * - `interactive` → `<button>` with the forced-state class so all\n * state CSS rules can apply (inert via pointer-events: none and\n * tabIndex={-1}, so the forced state isn't overridden by real\n * input).\n * - `static` → `<div>` with no state class. State CSS rules are\n * scoped to button/anchor element selectors and don't fire on\n * divs, so the static row stays truly static.\n *\n * Hand-rendered because the atom doesn't expose a way to set the\n * showcase-only `--state-*` modifier class.\n */\nfunction StaticShowcase({\n mode,\n state,\n showValue,\n}: {\n mode: Mode;\n state: string;\n showValue: boolean;\n}) {\n const isInteractive = mode === 'interactive';\n const isActive = isInteractive && state === 'active';\n const isDisabled = state === 'disabled';\n const inner = (\n <>\n {/* Mirrors the atom: the icon slot is an IconTile, sized/coloured from\n the same forwarded knob vars (glyph size comes from the tile var). */}\n <IconTile className=\"uxm-list-item__icon\" style={LIST_ITEM_ICON_TILE_STYLE}>\n <Icon glyph=\"square\" />\n </IconTile>\n <span className=\"uxm-list-item__content\">\n <span className=\"uxm-list-item__title\">Owner</span>\n {showValue && <span className=\"uxm-list-item__value\">Alex Morgan</span>}\n </span>\n <span className=\"uxm-list-item__trailing\">\n {trailingForMode(mode, 'Verified', 'success')}\n </span>\n </>\n );\n\n return (\n <List>\n {isInteractive ? (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={isDisabled}\n aria-pressed={isActive}\n className={cn(\n 'uxm-list-item',\n isActive && 'uxm-list-item--active',\n state === 'hover' && 'uxm-list-item--state-hover',\n state === 'focus' && 'uxm-list-item--state-focus',\n )}\n style={{ pointerEvents: 'none' }}\n >\n {inner}\n </button>\n ) : (\n <div\n className=\"uxm-list-item\"\n {...(isDisabled ? { 'aria-disabled': true } : {})}\n >\n {inner}\n </div>\n )}\n </List>\n );\n}\n\nconst ROWS: Array<{\n key: string;\n title: string;\n value: string;\n meta: string;\n tagType: TagType;\n}> = [\n // One row per Tag type, with a label that matches the type's\n // semantic meaning — so two tags never read the same word with\n // different visual treatments.\n { key: 'plan', title: 'Plan', value: 'Enterprise', meta: 'Pro', tagType: 'accent' },\n { key: 'billing', title: 'Billing', value: 'Visa •• 4242', meta: 'Action needed', tagType: 'warning' },\n { key: 'owner', title: 'Owner', value: 'Alex Morgan', meta: 'Verified', tagType: 'success' },\n { key: 'activity', title: 'Last activity', value: '2 hours ago', meta: 'Recent', tagType: 'neutral' },\n];\n\nexport function ListItemPreview({ styles, variants }: PreviewProps) {\n const mode = ((variants.mode as string) ?? 'interactive') as Mode;\n const state = (variants.state as string) ?? 'default';\n const showValue = ((variants.value as string) ?? 'shown') === 'shown';\n const [activeKey, setActiveKey] = useState<string>('plan');\n const cssVars = buildVars(styles);\n\n const sectionLabel = {\n fontSize: 11,\n color: 'var(--color-text-muted)',\n marginBottom: 12,\n letterSpacing: 0.5,\n textTransform: 'uppercase' as const,\n };\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: 32, minWidth: 380, ...cssVars } as CSSProperties}>\n <div>\n <div style={sectionLabel}>{state} state</div>\n <StaticShowcase mode={mode} state={state} showValue={showValue} />\n </div>\n\n {/* List — interactivity is driven by the `mode` variant. Trailing\n slot is set by the preview to the canonical example for each\n mode: chevron for interactive (the \"tap to drill in\" cue),\n Tag for static (status indicator).\n interactive → all rows render as <button>; the State dropdown\n carries through to `disabled` (applied to the second row),\n and real `:hover` / `:focus-visible` exercise the production\n CSS via the projected vars above.\n static → all rows render as <div>; the interactive states\n (hover / focus / active) are filtered out of the State picker\n via the registry's showWhen. `disabled` still applies to divs\n via `[aria-disabled]`. */}\n <div style={{ borderTop: '1px solid var(--color-border)', paddingTop: 16 }}>\n <div style={sectionLabel}>{mode === 'interactive' ? 'Interactive' : 'Static'}</div>\n <List>\n {ROWS.map((row, i) => {\n const isInteractive = mode === 'interactive';\n return (\n <ListItem\n key={row.key}\n interactive={isInteractive}\n active={isInteractive && row.key === activeKey}\n // Disabled is a visual treatment that applies to both\n // interactive rows (CSS `:disabled` / `[aria-disabled]`)\n // and static rows (`[aria-disabled]` on `<div>`).\n disabled={state === 'disabled' && i === 1}\n icon={<Icon glyph=\"square\" />}\n value={showValue ? row.value : undefined}\n trailing={trailingForMode(mode, row.meta, row.tagType)}\n onClick={isInteractive ? () => setActiveKey(row.key) : undefined}\n >\n {row.title}\n </ListItem>\n );\n })}\n </List>\n </div>\n </div>\n );\n}\n"],"mappings":"AAoEW,SA+BP,UA/BO,KAqCL,YArCK;AApEX,SAAS,gBAAoD;AAE7D,SAAS,UAAU;AAEnB,SAAS,MAAM,gBAAgB;AAC/B,SAAS,MAAM,gBAAgB;AAC/B,SAAS,WAAyB;AAElC,SAAS,iCAAiC;AAa1C,SAAS,UAAU,QAA+B;AAChD,SAAO;AAAA,IACL,+BAA+B,OAAO;AAAA,IACtC,iCAAiC,OAAO;AAAA,IACxC,4BAA4B,OAAO;AAAA,IACnC,8BAA8B,OAAO;AAAA,IACrC,8BAA8B,OAAO;AAAA,IACrC,8BAA8B,OAAO;AAAA,IACrC,6BAA6B,OAAO;AAAA,IACpC,+BAA+B,OAAO;AAAA,IACtC,+BAA+B,OAAO;AAAA,IACtC,iCAAiC,OAAO;AAAA,IACxC,oCACE,OAAO,mBAAmB,OAAO,OAAO,OAAO,eAAe,IAAI;AAAA,IACpE,gCAAgC,OAAO;AAAA,IACvC,iCAAiC,GAAG,OAAO,YAAY;AAAA,IACvD,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,uBAAuB,GAAG,OAAO,GAAG;AAAA,IACpC,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,+BAA+B,OAAO;AAAA,IACtC,8BAA8B,GAAG,OAAO,SAAS;AAAA,IACjD,2BAA2B,OAAO;AAAA,IAClC,8BAA8B,OAAO;AAAA,IACrC,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,+BAA+B,GAAG,OAAO,UAAU;AAAA,IACnD,iCAAiC,OAAO;AAAA,EAC1C;AACF;AASA,SAAS,gBACP,MACA,MACA,SACW;AACX,MAAI,SAAS,eAAe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AAS,gBAAgB,MAAM,aAAa,IAAI,GAAG,IAAI;AAAA,YAEtD,cAAI;AAAA;AAAA,UAZA,IAAI;AAAA,QAaX;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/ui/list/list-item-preview.tsx"],"sourcesContent":["import { useState, type CSSProperties, type ReactNode } from 'react';\n\nimport { cn } from '@/helpers';\nimport type { PreviewProps } from '@/previews/types';\nimport { Icon, IconTile } from '@/ui';\nimport { List, ListItem } from '@/ui';\nimport { Tag, type TagType } from '@/ui';\nimport { Thumbnail } from '@/ui';\n\nimport { LIST_ITEM_ICON_TILE_STYLE, LIST_ITEM_MEDIA_STYLE } from './list';\n\ntype Styles = PreviewProps['styles'];\ntype Mode = 'static' | 'interactive';\ntype Leading = 'icon' | 'media';\n\n/**\n * Project every registry knob as a `--uxm-list-item-*` custom property\n * on the wrapper. Both the static showcase and the interactive list\n * below read from the same vars; the showcase forces a state via the\n * `--state-*` modifier class while the interactive list exercises the\n * production `:hover` / `:focus-visible` / `:disabled` rules on real\n * pointer + keyboard.\n */\nfunction buildVars(styles: Styles): CSSProperties {\n return {\n '--uxm-list-item-inactive-bg': styles.inactiveBg as string,\n '--uxm-list-item-inactive-text': styles.inactiveText as string,\n '--uxm-list-item-hover-bg': styles.hoverBg as string,\n '--uxm-list-item-hover-text': styles.hoverText as string,\n '--uxm-list-item-focus-text': styles.focusText as string,\n '--uxm-list-item-focus-ring': styles.focusRing as string,\n '--uxm-list-item-active-bg': styles.activeBg as string,\n '--uxm-list-item-active-text': styles.activeText as string,\n '--uxm-list-item-disabled-bg': styles.disabledBg as string,\n '--uxm-list-item-disabled-text': styles.disabledText as string,\n '--uxm-list-item-disabled-opacity':\n styles.disabledOpacity != null ? String(styles.disabledOpacity) : undefined,\n '--uxm-list-item-border-color': styles.borderColor as string,\n '--uxm-list-item-border-radius': `${styles.borderRadius}px`,\n '--uxm-list-item-padding-x': `${styles.paddingX}px`,\n '--uxm-list-item-padding-y': `${styles.paddingY}px`,\n '--uxm-list-item-gap': `${styles.gap}px`,\n '--uxm-list-item-font-size': `${styles.fontSize}px`,\n '--uxm-list-item-value-color': styles.valueColor as string,\n '--uxm-list-item-value-size': `${styles.valueSize}px`,\n '--uxm-list-item-icon-bg': styles.iconBg as string,\n '--uxm-list-item-icon-color': styles.iconColor as string,\n '--uxm-list-item-icon-size': `${styles.iconSize}px`,\n '--uxm-list-item-icon-radius': `${styles.iconRadius}px`,\n '--uxm-list-item-media-size': `${styles.mediaSize}px`,\n '--uxm-list-item-chevron-color': styles.chevronColor as string,\n } as CSSProperties;\n}\n\n/**\n * The demo media node for the `leading: \"media\"` variant — a `Thumbnail`\n * with no `src`, so it renders the atom's own placeholder instead of\n * reaching for a network image the canvas may not be able to load. It\n * tracks the Media Size knob because the slot forwards\n * `--uxm-list-item-media-size` into `--uxm-thumbnail-size`\n * (`LIST_ITEM_MEDIA_STYLE`), so the frame AND its placeholder glyph scale\n * together — the row owns the leading geometry, the media owns its surface.\n * `alt=\"\"` because the row's title is the accessible name; a described\n * image here would be concatenated into it.\n */\nconst DEMO_MEDIA = <Thumbnail alt=\"\" />;\n\n/**\n * Pick the canonical trailing element for the given mode. The trailing\n * slot is `ReactNode` on the atom — consumers can pass anything (Tag,\n * Badge, Avatar, custom node). The preview demos the canonical patterns:\n * - interactive → chevron icon (the \"tap to drill in\" affordance)\n * - static → Tag (status indicator for an info row)\n */\nfunction trailingForMode(\n mode: Mode,\n meta: string,\n tagType: TagType,\n): ReactNode {\n if (mode === 'interactive') {\n // Color inherits via `currentColor` from `.uxm-list-item__trailing`,\n // which reads `--uxm-list-item-chevron-color`. Keeps saves working\n // (the var has a single source of truth instead of an inline JS\n // override that would shadow it after save).\n return <Icon glyph=\"chevron-right\" size={16} />;\n }\n return <Tag type={tagType}>{meta}</Tag>;\n}\n\n/**\n * Static showcase — ONE row, rendering matches the `mode` variant.\n * - `interactive` → `<button>` with the forced-state class so all\n * state CSS rules can apply (inert via pointer-events: none and\n * tabIndex={-1}, so the forced state isn't overridden by real\n * input).\n * - `static` → `<div>` with no state class. State CSS rules are\n * scoped to button/anchor element selectors and don't fire on\n * divs, so the static row stays truly static.\n *\n * Hand-rendered because the atom doesn't expose a way to set the\n * showcase-only `--state-*` modifier class.\n */\nfunction StaticShowcase({\n mode,\n state,\n showValue,\n leading,\n}: {\n mode: Mode;\n state: string;\n showValue: boolean;\n leading: Leading;\n}) {\n const isInteractive = mode === 'interactive';\n const isActive = isInteractive && state === 'active';\n const isDisabled = state === 'disabled';\n const inner = (\n <>\n {/* Mirrors the atom's leading slot: an IconTile sized/coloured from the\n same forwarded knob vars (glyph size comes from the tile var), or the\n un-tiled media span when the Leading variant selects it. */}\n {leading === 'media' ? (\n <span className=\"uxm-list-item__media\" style={LIST_ITEM_MEDIA_STYLE}>\n {DEMO_MEDIA}\n </span>\n ) : (\n <IconTile className=\"uxm-list-item__icon\" style={LIST_ITEM_ICON_TILE_STYLE}>\n <Icon glyph=\"square\" />\n </IconTile>\n )}\n <span className=\"uxm-list-item__content\">\n <span className=\"uxm-list-item__title\">Owner</span>\n {showValue && <span className=\"uxm-list-item__value\">Alex Morgan</span>}\n </span>\n <span className=\"uxm-list-item__trailing\">\n {trailingForMode(mode, 'Verified', 'success')}\n </span>\n </>\n );\n\n return (\n <List>\n {isInteractive ? (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={isDisabled}\n aria-pressed={isActive}\n className={cn(\n 'uxm-list-item',\n isActive && 'uxm-list-item--active',\n state === 'hover' && 'uxm-list-item--state-hover',\n state === 'focus' && 'uxm-list-item--state-focus',\n )}\n style={{ pointerEvents: 'none' }}\n >\n {inner}\n </button>\n ) : (\n <div\n className=\"uxm-list-item\"\n {...(isDisabled ? { 'aria-disabled': true } : {})}\n >\n {inner}\n </div>\n )}\n </List>\n );\n}\n\nconst ROWS: Array<{\n key: string;\n title: string;\n value: string;\n meta: string;\n tagType: TagType;\n}> = [\n // One row per Tag type, with a label that matches the type's\n // semantic meaning — so two tags never read the same word with\n // different visual treatments.\n { key: 'plan', title: 'Plan', value: 'Enterprise', meta: 'Pro', tagType: 'accent' },\n { key: 'billing', title: 'Billing', value: 'Visa •• 4242', meta: 'Action needed', tagType: 'warning' },\n { key: 'owner', title: 'Owner', value: 'Alex Morgan', meta: 'Verified', tagType: 'success' },\n { key: 'activity', title: 'Last activity', value: '2 hours ago', meta: 'Recent', tagType: 'neutral' },\n];\n\nexport function ListItemPreview({ styles, variants }: PreviewProps) {\n const mode = ((variants.mode as string) ?? 'interactive') as Mode;\n const state = (variants.state as string) ?? 'default';\n const showValue = ((variants.value as string) ?? 'shown') === 'shown';\n const leading = ((variants.leading as string) ?? 'icon') as Leading;\n const [activeKey, setActiveKey] = useState<string>('plan');\n const cssVars = buildVars(styles);\n\n const sectionLabel = {\n fontSize: 11,\n color: 'var(--color-text-muted)',\n marginBottom: 12,\n letterSpacing: 0.5,\n textTransform: 'uppercase' as const,\n };\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: 32, minWidth: 380, ...cssVars } as CSSProperties}>\n <div>\n <div style={sectionLabel}>{state} state</div>\n <StaticShowcase mode={mode} state={state} showValue={showValue} leading={leading} />\n </div>\n\n {/* List — interactivity is driven by the `mode` variant. Trailing\n slot is set by the preview to the canonical example for each\n mode: chevron for interactive (the \"tap to drill in\" cue),\n Tag for static (status indicator).\n interactive → all rows render as <button>; the State dropdown\n carries through to `disabled` (applied to the second row),\n and real `:hover` / `:focus-visible` exercise the production\n CSS via the projected vars above.\n static → all rows render as <div>; the interactive states\n (hover / focus / active) are filtered out of the State picker\n via the registry's showWhen. `disabled` still applies to divs\n via `[aria-disabled]`. */}\n <div style={{ borderTop: '1px solid var(--color-border)', paddingTop: 16 }}>\n <div style={sectionLabel}>{mode === 'interactive' ? 'Interactive' : 'Static'}</div>\n <List>\n {ROWS.map((row, i) => {\n const isInteractive = mode === 'interactive';\n return (\n <ListItem\n key={row.key}\n interactive={isInteractive}\n active={isInteractive && row.key === activeKey}\n // Disabled is a visual treatment that applies to both\n // interactive rows (CSS `:disabled` / `[aria-disabled]`)\n // and static rows (`[aria-disabled]` on `<div>`).\n disabled={state === 'disabled' && i === 1}\n {...(leading === 'media'\n ? { media: DEMO_MEDIA }\n : { icon: <Icon glyph=\"square\" /> })}\n value={showValue ? row.value : undefined}\n trailing={trailingForMode(mode, row.meta, row.tagType)}\n onClick={isInteractive ? () => setActiveKey(row.key) : undefined}\n >\n {row.title}\n </ListItem>\n );\n })}\n </List>\n </div>\n </div>\n );\n}\n"],"mappings":"AAiEmB,SAoDf,UApDe,KAiEb,YAjEa;AAjEnB,SAAS,gBAAoD;AAE7D,SAAS,UAAU;AAEnB,SAAS,MAAM,gBAAgB;AAC/B,SAAS,MAAM,gBAAgB;AAC/B,SAAS,WAAyB;AAClC,SAAS,iBAAiB;AAE1B,SAAS,2BAA2B,6BAA6B;AAcjE,SAAS,UAAU,QAA+B;AAChD,SAAO;AAAA,IACL,+BAA+B,OAAO;AAAA,IACtC,iCAAiC,OAAO;AAAA,IACxC,4BAA4B,OAAO;AAAA,IACnC,8BAA8B,OAAO;AAAA,IACrC,8BAA8B,OAAO;AAAA,IACrC,8BAA8B,OAAO;AAAA,IACrC,6BAA6B,OAAO;AAAA,IACpC,+BAA+B,OAAO;AAAA,IACtC,+BAA+B,OAAO;AAAA,IACtC,iCAAiC,OAAO;AAAA,IACxC,oCACE,OAAO,mBAAmB,OAAO,OAAO,OAAO,eAAe,IAAI;AAAA,IACpE,gCAAgC,OAAO;AAAA,IACvC,iCAAiC,GAAG,OAAO,YAAY;AAAA,IACvD,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,uBAAuB,GAAG,OAAO,GAAG;AAAA,IACpC,6BAA6B,GAAG,OAAO,QAAQ;AAAA,IAC/C,+BAA+B,OAAO;AAAA,IACtC,8BAA8B,GAAG,OAAO,SAAS;AAAA,IAC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AAAA,0BAAC,SAAI,OAAO,cAAe,mBAAS,gBAAgB,gBAAgB,UAAS;AAAA,MAC7E,oBAAC,QACE,eAAK,IAAI,CAAC,KAAK,MAAM;AACpB,cAAM,gBAAgB,SAAS;AAC/B,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,aAAa;AAAA,YACb,QAAQ,iBAAiB,IAAI,QAAQ;AAAA,YAIrC,UAAU,UAAU,cAAc,MAAM;AAAA,YACvC,GAAI,YAAY,UACb,EAAE,OAAO,WAAW,IACpB,EAAE,MAAM,oBAAC,QAAK,OAAM,UAAS,EAAG;AAAA,YACpC,OAAO,YAAY,IAAI,QAAQ;AAAA,YAC/B,UAAU,gBAAgB,MAAM,IAAI,MAAM,IAAI,OAAO;AAAA,YACrD,SAAS,gBAAgB,MAAM,aAAa,IAAI,GAAG,IAAI;AAAA,YAEtD,cAAI;AAAA;AAAA,UAdA,IAAI;AAAA,QAeX;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var list_exports = {};
20
20
  __export(list_exports, {
21
21
  LIST_ITEM_ICON_TILE_STYLE: () => LIST_ITEM_ICON_TILE_STYLE,
22
+ LIST_ITEM_MEDIA_STYLE: () => LIST_ITEM_MEDIA_STYLE,
22
23
  List: () => List,
23
24
  ListItem: () => ListItem
24
25
  });
@@ -33,11 +34,17 @@ const LIST_ITEM_ICON_TILE_STYLE = {
33
34
  "--uxm-icon-tile-radius": "var(--uxm-list-item-icon-radius, 6px)",
34
35
  "--uxm-icon-tile-icon-size": "calc(var(--uxm-list-item-icon-size, 24px) * 0.6)"
35
36
  };
37
+ const LIST_ITEM_MEDIA_STYLE = {
38
+ "--uxm-thumbnail-size": "var(--uxm-list-item-media-size, 36px)",
39
+ "--uxm-avatar-size": "var(--uxm-list-item-media-size, 36px)",
40
+ "--uxm-avatar-small-size": "var(--uxm-list-item-media-size, 36px)"
41
+ };
36
42
  function List({ children, className, ...rest }) {
37
43
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_helpers.cn)("uxm-list", className), ...rest, children });
38
44
  }
39
45
  function ListItem({
40
46
  icon,
47
+ media,
41
48
  value,
42
49
  trailing,
43
50
  children,
@@ -55,7 +62,7 @@ function ListItem({
55
62
  );
56
63
  const isInteractive = interactive || href !== void 0;
57
64
  const inner = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
58
- icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { className: "uxm-list-item__icon", style: LIST_ITEM_ICON_TILE_STYLE, children: icon }),
65
+ media ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "uxm-list-item__media", style: LIST_ITEM_MEDIA_STYLE, children: media }) : icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { className: "uxm-list-item__icon", style: LIST_ITEM_ICON_TILE_STYLE, children: icon }),
59
66
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "uxm-list-item__content", children: [
60
67
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "uxm-list-item__title", children }),
61
68
  value !== void 0 && value !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "uxm-list-item__value", children: value })
@@ -100,6 +107,7 @@ function ListItem({
100
107
  // Annotate the CommonJS export names for ESM import in node:
101
108
  0 && (module.exports = {
102
109
  LIST_ITEM_ICON_TILE_STYLE,
110
+ LIST_ITEM_MEDIA_STYLE,
103
111
  List,
104
112
  ListItem
105
113
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/list/list.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport { IconTile } from '../icon-tile';\n\nimport type {\n AnchorHTMLAttributes,\n ButtonHTMLAttributes,\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n} from 'react';\n\n/**\n * Forward the studio icon knobs (projected as `--uxm-list-item-icon-*` on the\n * row) into the `IconTile` atom's own var namespace, so the accent-tile\n * pattern lives in one place — the `IconTile` atom — instead of being\n * re-implemented in `list.scss`. The glyph tracks the tile at 0.6× (the\n * row-icon proportion used across the design system). Kept as a module\n * constant so the studio preview can reuse the exact same forwarding.\n */\nexport const LIST_ITEM_ICON_TILE_STYLE = {\n '--uxm-icon-tile-bg': 'var(--uxm-list-item-icon-bg, var(--color-accent))',\n '--uxm-icon-tile-color': 'var(--uxm-list-item-icon-color, var(--color-card))',\n '--uxm-icon-tile-size': 'var(--uxm-list-item-icon-size, 24px)',\n '--uxm-icon-tile-radius': 'var(--uxm-list-item-icon-radius, 6px)',\n '--uxm-icon-tile-icon-size': 'calc(var(--uxm-list-item-icon-size, 24px) * 0.6)',\n} as CSSProperties;\n\nexport interface ListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport function List({ children, className, ...rest }: ListProps) {\n return (\n <div className={cn('uxm-list', className)} {...rest}>\n {children}\n </div>\n );\n}\n\n/**\n * ListItem renders as one of three element types depending on `interactive`:\n * - `<div>` (default) — display row, no state styling, not focusable\n * - `<button>` — interactive without navigation; emits click events\n * - `<a>` — interactive with navigation; pass `href`\n *\n * The state knobs (hover / focus / active / disabled) in the `list-item`\n * registry only paint when the row renders as button or anchor — the CSS\n * scopes them to element-type selectors so display-only divs stay inert.\n */\nexport interface ListItemProps {\n /** Leading icon — typically <Icon ... /> from @modo/uxm/ui. */\n icon?: ReactNode;\n /** Secondary text shown under the title (e.g. a value). */\n value?: ReactNode;\n /** Trailing content — meta text, chevron icon, or a custom node. */\n trailing?: ReactNode;\n /** Primary label. */\n children: ReactNode;\n /** Render as a clickable element. When false (default), renders as a\n * static `<div>` with no state styling. When true, renders as\n * `<button>` (or `<a>` if `href` is also passed). */\n interactive?: boolean;\n /** Show the selected/active treatment (only meaningful when\n * `interactive` is true). Adds the `--active` modifier class. */\n active?: boolean;\n /** Disable interaction — only meaningful when `interactive`.\n * Forwards to the native `disabled` attribute on `<button>`, or\n * sets `aria-disabled` on `<a>`. */\n disabled?: boolean;\n /** Navigate to this URL on click. Implies `interactive`. */\n href?: string;\n className?: string;\n}\n\ntype AnchorRest = Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ListItemProps\n>;\ntype ButtonRest = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ListItemProps\n>;\ntype DivRest = Omit<HTMLAttributes<HTMLDivElement>, keyof ListItemProps>;\n\nexport function ListItem({\n icon,\n value,\n trailing,\n children,\n interactive,\n active,\n disabled,\n href,\n className,\n ...rest\n}: ListItemProps & (AnchorRest | ButtonRest | DivRest)) {\n const classes = cn(\n 'uxm-list-item',\n active && 'uxm-list-item--active',\n className,\n );\n const isInteractive = interactive || href !== undefined;\n const inner = (\n <>\n {icon && (\n <IconTile className=\"uxm-list-item__icon\" style={LIST_ITEM_ICON_TILE_STYLE}>\n {icon}\n </IconTile>\n )}\n <span className=\"uxm-list-item__content\">\n <span className=\"uxm-list-item__title\">{children}</span>\n {value !== undefined && value !== null && (\n <span className=\"uxm-list-item__value\">{value}</span>\n )}\n </span>\n {trailing && <span className=\"uxm-list-item__trailing\">{trailing}</span>}\n </>\n );\n\n if (href !== undefined) {\n return (\n <a\n href={href}\n className={classes}\n {...(disabled ? { 'aria-disabled': true as const, tabIndex: -1 } : {})}\n {...(rest as AnchorRest)}\n >\n {inner}\n </a>\n );\n }\n if (isInteractive) {\n return (\n <button\n type=\"button\"\n className={classes}\n disabled={disabled}\n aria-pressed={active}\n {...(rest as ButtonRest)}\n >\n {inner}\n </button>\n );\n }\n return (\n <div\n className={classes}\n {...(disabled ? { 'aria-disabled': true as const } : {})}\n {...(rest as DivRest)}\n >\n {inner}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCI;AAlCJ,qBAAmB;AAEn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;AAAA;AAAA,MACC,WAAW;AAAA,MACV,GAAI,WAAW,EAAE,iBAAiB,KAAc,IAAI,CAAC;AAAA,MACrD,GAAI;AAAA,MAEJ;AAAA;AAAA,EACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/ui/list/list.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport { IconTile } from '../icon-tile';\n\nimport type {\n AnchorHTMLAttributes,\n ButtonHTMLAttributes,\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n} from 'react';\n\n/**\n * Forward the studio icon knobs (projected as `--uxm-list-item-icon-*` on the\n * row) into the `IconTile` atom's own var namespace, so the accent-tile\n * pattern lives in one place — the `IconTile` atom — instead of being\n * re-implemented in `list.scss`. The glyph tracks the tile at 0.6× (the\n * row-icon proportion used across the design system). Kept as a module\n * constant so the studio preview can reuse the exact same forwarding.\n */\nexport const LIST_ITEM_ICON_TILE_STYLE = {\n '--uxm-icon-tile-bg': 'var(--uxm-list-item-icon-bg, var(--color-accent))',\n '--uxm-icon-tile-color': 'var(--uxm-list-item-icon-color, var(--color-card))',\n '--uxm-icon-tile-size': 'var(--uxm-list-item-icon-size, 24px)',\n '--uxm-icon-tile-radius': 'var(--uxm-list-item-icon-radius, 6px)',\n '--uxm-icon-tile-icon-size': 'calc(var(--uxm-list-item-icon-size, 24px) * 0.6)',\n} as CSSProperties;\n\n/**\n * Forward the row's media-size knob into the size vars of the atoms that\n * plausibly fill the `media` slot, so each one sizes itself through its OWN\n * machinery — frame, border, radius and inner glyph / initials all scale with\n * it — instead of being stretched from the outside. Mirrors\n * `LIST_ITEM_ICON_TILE_STYLE` above, and is the only order-independent fix:\n * both `Thumbnail` (`.uxm-thumbnail`, 0,1,0 but imported AFTER list in\n * `styles.css`) and `Avatar` (double-class size presets at 0,2,0, deliberately\n * so per its own note) would otherwise win or lose the cascade against a slot\n * rule purely on stylesheet order. The generic `> *` stretch in `list.scss`\n * stays as the fallback for a bare `<img>` / `<svg>` or any atom with no size\n * var of its own; both mechanisms resolve to the same number. Kept as a module\n * constant so the studio preview can reuse the exact same forwarding.\n */\nexport const LIST_ITEM_MEDIA_STYLE = {\n '--uxm-thumbnail-size': 'var(--uxm-list-item-media-size, 36px)',\n '--uxm-avatar-size': 'var(--uxm-list-item-media-size, 36px)',\n '--uxm-avatar-small-size': 'var(--uxm-list-item-media-size, 36px)',\n} as CSSProperties;\n\nexport interface ListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport function List({ children, className, ...rest }: ListProps) {\n return (\n <div className={cn('uxm-list', className)} {...rest}>\n {children}\n </div>\n );\n}\n\n/**\n * ListItem renders as one of three element types depending on `interactive`:\n * - `<div>` (default) — display row, no state styling, not focusable\n * - `<button>` — interactive without navigation; emits click events\n * - `<a>` — interactive with navigation; pass `href`\n *\n * The state knobs (hover / focus / active / disabled) in the `list-item`\n * registry only paint when the row renders as button or anchor — the CSS\n * scopes them to element-type selectors so display-only divs stay inert.\n */\nexport interface ListItemProps {\n /** Leading icon — typically <Icon ... /> from @modo/uxm/ui. */\n icon?: ReactNode;\n /** Leading media rendered as-is (a <Thumbnail>, <img>, avatar…) — NOT\n * wrapped in the accent `IconTile` the `icon` slot uses. Mutually\n * exclusive with `icon`: when both are passed, `media` wins. The slot\n * box is `--uxm-list-item-media-size` (36px) square; a `Thumbnail` or\n * `Avatar` gets that size forwarded into its own size var (see\n * `LIST_ITEM_MEDIA_STYLE`) and anything else is stretched to fill, so\n * rows stay on one leading grid either way.\n *\n * Prefer decorative media in a row whose title already names the thing\n * (`alt=\"\"`): the slot sits INSIDE the row's `<button>`/`<a>`, so a\n * described image is concatenated into the row's accessible name.\n *\n * Note: this shadows the native `media` attribute of `<a>` for the\n * anchor form of the row — pass it through `className`/a wrapper if\n * you genuinely need the HTML attribute. */\n media?: ReactNode;\n /** Secondary text shown under the title (e.g. a value). */\n value?: ReactNode;\n /** Trailing content — meta text, chevron icon, or a custom node. */\n trailing?: ReactNode;\n /** Primary label. */\n children: ReactNode;\n /** Render as a clickable element. When false (default), renders as a\n * static `<div>` with no state styling. When true, renders as\n * `<button>` (or `<a>` if `href` is also passed). */\n interactive?: boolean;\n /** Show the selected/active treatment (only meaningful when\n * `interactive` is true). Adds the `--active` modifier class. */\n active?: boolean;\n /** Disable interaction — only meaningful when `interactive`.\n * Forwards to the native `disabled` attribute on `<button>`, or\n * sets `aria-disabled` on `<a>`. */\n disabled?: boolean;\n /** Navigate to this URL on click. Implies `interactive`. */\n href?: string;\n className?: string;\n}\n\ntype AnchorRest = Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ListItemProps\n>;\ntype ButtonRest = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ListItemProps\n>;\ntype DivRest = Omit<HTMLAttributes<HTMLDivElement>, keyof ListItemProps>;\n\nexport function ListItem({\n icon,\n media,\n value,\n trailing,\n children,\n interactive,\n active,\n disabled,\n href,\n className,\n ...rest\n}: ListItemProps & (AnchorRest | ButtonRest | DivRest)) {\n const classes = cn(\n 'uxm-list-item',\n active && 'uxm-list-item--active',\n className,\n );\n const isInteractive = interactive || href !== undefined;\n const inner = (\n <>\n {/* Leading slot. `media` renders as-is so a product photo / avatar\n keeps its own frame; `icon` keeps the accent IconTile treatment.\n `media` wins when both are passed — a row has one leading grid\n position, and the as-is rendering is the more specific intent. */}\n {media ? (\n <span className=\"uxm-list-item__media\" style={LIST_ITEM_MEDIA_STYLE}>\n {media}\n </span>\n ) : (\n icon && (\n <IconTile className=\"uxm-list-item__icon\" style={LIST_ITEM_ICON_TILE_STYLE}>\n {icon}\n </IconTile>\n )\n )}\n <span className=\"uxm-list-item__content\">\n <span className=\"uxm-list-item__title\">{children}</span>\n {value !== undefined && value !== null && (\n <span className=\"uxm-list-item__value\">{value}</span>\n )}\n </span>\n {trailing && <span className=\"uxm-list-item__trailing\">{trailing}</span>}\n </>\n );\n\n if (href !== undefined) {\n return (\n <a\n href={href}\n className={classes}\n {...(disabled ? { 'aria-disabled': true as const, tabIndex: -1 } : {})}\n {...(rest as AnchorRest)}\n >\n {inner}\n </a>\n );\n }\n if (isInteractive) {\n return (\n <button\n type=\"button\"\n className={classes}\n disabled={disabled}\n aria-pressed={active}\n {...(rest as ButtonRest)}\n >\n {inner}\n </button>\n );\n }\n return (\n <div\n className={classes}\n {...(disabled ? { 'aria-disabled': true as const } : {})}\n {...(rest as DivRest)}\n >\n {inner}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDI;AAtDJ,qBAAmB;AAEnB,uBAAyB;AAkBlB,MAAM,4BAA4B;AAAA,EACvC,sBAAsB;AAAA,EACtB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,6BAA6B;AAC/B;AAgBO,MAAM,wBAAwB;AAAA,EACnC,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,2BAA2B;AAC7B;AAMO,SAAS,KAAK,EAAE,UAAU,WAAW,GAAG,KAAK,GAAc;AAChE,SACE,4CAAC,SAAI,eAAW,mBAAG,YAAY,SAAS,GAAI,GAAG,MAC5C,UACH;AAEJ;AA+DO,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,QAAM,cAAU;AAAA,IACd;AAAA,IACA,UAAU;AAAA,IACV;AAAA,EACF;AACA,QAAM,gBAAgB,eAAe,SAAS;AAC9C,QAAM,QACJ,4EAKG;AAAA,YACC,4CAAC,UAAK,WAAU,wBAAuB,OAAO,uBAC3C,iBACH,IAEA,QACE,4CAAC,6BAAS,WAAU,uBAAsB,OAAO,2BAC9C,gBACH;AAAA,IAGJ,6CAAC,UAAK,WAAU,0BACd;AAAA,kDAAC,UAAK,WAAU,wBAAwB,UAAS;AAAA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