@dreamtree-org/twreact-ui 1.3.2 → 1.3.3

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 (37) hide show
  1. package/DESIGN.md +2 -2
  2. package/README.md +11 -5
  3. package/ai-skills/dreamtree-ui.md +3 -1
  4. package/bin/cli.mjs +72 -4
  5. package/dist/ai-schema.json +1 -1
  6. package/dist/charts/index.js +75 -47
  7. package/dist/components/charts/CartesianChart.d.ts.map +1 -1
  8. package/dist/components/charts/DonutChart.d.ts.map +1 -1
  9. package/dist/components/charts/Sparkline.d.ts.map +1 -1
  10. package/dist/components/charts/chartTheme.d.ts +13 -3
  11. package/dist/components/charts/chartTheme.d.ts.map +1 -1
  12. package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
  13. package/dist/components/core/Table/MobileFilters.d.ts.map +1 -1
  14. package/dist/components/core/Table/Table.d.ts.map +1 -1
  15. package/dist/components/utility/Stepper.d.ts.map +1 -1
  16. package/dist/esm/components/blocks/StatCard.js +1 -1
  17. package/dist/esm/components/charts/CartesianChart.js +7 -2
  18. package/dist/esm/components/charts/DonutChart.js +4 -1
  19. package/dist/esm/components/charts/Sparkline.js +4 -1
  20. package/dist/esm/components/charts/chartTheme.js +65 -48
  21. package/dist/esm/components/core/Select.js +2 -2
  22. package/dist/esm/components/core/Table/MobileCard.js +5 -2
  23. package/dist/esm/components/core/Table/MobileFilters.js +10 -3
  24. package/dist/esm/components/core/Table/Table.js +10 -7
  25. package/dist/esm/components/utility/Stepper.js +6 -4
  26. package/dist/index.css +1 -1
  27. package/dist/index.esm.css +1 -1
  28. package/dist/index.esm.js +33 -18
  29. package/dist/index.js +33 -18
  30. package/dist/tokens/brands/practicepro.json +1 -0
  31. package/dist/tokens/brands/studio.json +1 -0
  32. package/mcp/catalog.snapshot.json +13 -13
  33. package/package.json +2 -1
  34. package/tokens/brand.schema.json +612 -0
  35. package/tokens/brands/practicepro.json +1 -0
  36. package/tokens/brands/studio.json +1 -0
  37. package/tokens/lib.cjs +131 -7
package/dist/index.js CHANGED
@@ -3656,7 +3656,7 @@ var Select = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
3656
3656
  onMenuItemRender = _ref.onMenuItemRender,
3657
3657
  className = _ref.className,
3658
3658
  _ref$allowClear = _ref.allowClear,
3659
- allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
3659
+ allowClear = _ref$allowClear === void 0 ? false : _ref$allowClear,
3660
3660
  _ref$creatable = _ref.creatable,
3661
3661
  creatable = _ref$creatable === void 0 ? false : _ref$creatable,
3662
3662
  onCreateOption = _ref.onCreateOption,
@@ -4093,7 +4093,7 @@ var Select = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
4093
4093
  }, opt.value);
4094
4094
  })
4095
4095
  }), jsxRuntime.jsxs("div", {
4096
- className: "text-xs text-primary-500",
4096
+ className: "text-xs text-primary-700",
4097
4097
  children: ["+", rest]
4098
4098
  })]
4099
4099
  });
@@ -5166,6 +5166,7 @@ function MobileFilters(_ref) {
5166
5166
  visibleColumns = _ref.visibleColumns,
5167
5167
  filters = _ref.filters,
5168
5168
  handleFilter = _ref.handleFilter;
5169
+ var idPrefix = React.useId();
5169
5170
  return jsxRuntime.jsxs("div", {
5170
5171
  className: "mb-4 p-3 bg-gray-50 rounded-lg",
5171
5172
  children: [jsxRuntime.jsxs("div", {
@@ -5174,12 +5175,14 @@ function MobileFilters(_ref) {
5174
5175
  className: "text-sm font-medium",
5175
5176
  children: "Filters"
5176
5177
  }), jsxRuntime.jsx("button", {
5178
+ type: "button",
5177
5179
  onClick: function onClick() {
5178
5180
  return setShowMobileFilters(function (s) {
5179
5181
  return !s;
5180
5182
  });
5181
5183
  },
5182
- className: "text-xs text-primary-500",
5184
+ "aria-expanded": !!showMobileFilters,
5185
+ className: "text-xs font-medium text-primary-700",
5183
5186
  children: showMobileFilters ? "Hide" : "Show"
5184
5187
  })]
5185
5188
  }), showMobileFilters && jsxRuntime.jsxs("div", {
@@ -5189,6 +5192,7 @@ function MobileFilters(_ref) {
5189
5192
  children: [jsxRuntime.jsx("input", {
5190
5193
  type: "text",
5191
5194
  placeholder: "Search...",
5195
+ "aria-label": "Search",
5192
5196
  className: "w-full rounded-md border border-gray-300 px-4 py-2 text-sm",
5193
5197
  value: searchInput,
5194
5198
  onChange: function onChange(e) {
@@ -5196,14 +5200,17 @@ function MobileFilters(_ref) {
5196
5200
  },
5197
5201
  onKeyDown: onGlobalKeyDown
5198
5202
  }), jsxRuntime.jsx(Search, {
5199
- className: "absolute right-3 top-2.5 h-4 w-4 text-primary-400"
5203
+ className: "absolute right-3 top-2.5 h-4 w-4 text-primary-400",
5204
+ "aria-hidden": "true"
5200
5205
  })]
5201
5206
  }), filterable && visibleColumns.map(function (column) {
5202
5207
  return jsxRuntime.jsxs("div", {
5203
5208
  children: [jsxRuntime.jsx("label", {
5209
+ htmlFor: "".concat(idPrefix, "-filter-").concat(column.key),
5204
5210
  className: "block text-xs font-medium mb-1",
5205
5211
  children: column.label
5206
5212
  }), jsxRuntime.jsx("input", {
5213
+ id: "".concat(idPrefix, "-filter-").concat(column.key),
5207
5214
  type: "text",
5208
5215
  placeholder: "Filter ".concat(column.label),
5209
5216
  className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm",
@@ -5828,6 +5835,7 @@ function MobileCard(_ref) {
5828
5835
  }), menuActions.length > 0 && jsxRuntime.jsxs("div", {
5829
5836
  className: "relative",
5830
5837
  children: [jsxRuntime.jsx("button", {
5838
+ type: "button",
5831
5839
  ref: function ref(el) {
5832
5840
  return registerActionButton === null || registerActionButton === void 0 ? void 0 : registerActionButton(actionCellKey, el);
5833
5841
  },
@@ -5837,8 +5845,10 @@ function MobileCard(_ref) {
5837
5845
  "aria-expanded": activeActionRowKey === actionCellKey,
5838
5846
  className: "p-1.5 rounded hover:bg-gray-200",
5839
5847
  title: "Actions",
5848
+ "aria-label": "Actions",
5840
5849
  children: jsxRuntime.jsx(MoreVertical, {
5841
- className: "h-4 w-4"
5850
+ className: "h-4 w-4",
5851
+ "aria-hidden": "true"
5842
5852
  })
5843
5853
  }), activeActionRowKey === actionCellKey && jsxRuntime.jsx(ActionMenu, {
5844
5854
  actions: menuActions,
@@ -5866,7 +5876,7 @@ function MobileCard(_ref) {
5866
5876
  return jsxRuntime.jsxs("div", {
5867
5877
  className: cn$1("flex justify-between items-center flex-row py-2 border-b last:border-b-0", safeExtraCellClass),
5868
5878
  children: [jsxRuntime.jsx("div", {
5869
- className: "text-xs font-medium text-primary-500 uppercase tracking-wide mb-1 sm:mb-0 sm:w-1/3 sm:pr-2",
5879
+ className: "text-xs font-medium text-primary-700 uppercase tracking-wide mb-1 sm:mb-0 sm:w-1/3 sm:pr-2",
5870
5880
  children: column.label
5871
5881
  }), jsxRuntime.jsx("div", {
5872
5882
  className: "text-sm text-primary-900 sm:w-2/3 sm:pl-2 break-words",
@@ -7200,10 +7210,13 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7200
7210
  children: [showReloadButton && jsxRuntime.jsx(jsxRuntime.Fragment, {
7201
7211
  children: renderReloadButton ? typeof renderReloadButton === "function" ? renderReloadButton() : renderReloadButton : jsxRuntime.jsxs("button", {
7202
7212
  type: "button",
7213
+ "aria-label": "Reload",
7214
+ title: "Reload",
7203
7215
  className: "px-4 py-2 bg-primary-100 flex items-center gap-2 rounded-lg md:rounded text-primary-700 hover:bg-primary-200 transition-colors",
7204
7216
  onClick: onReload,
7205
7217
  children: [jsxRuntime.jsx(RefreshCcw, {
7206
- className: "size-4"
7218
+ className: "size-4",
7219
+ "aria-hidden": "true"
7207
7220
  }), jsxRuntime.jsx("span", {
7208
7221
  className: "hidden sm:inline",
7209
7222
  children: "Reload"
@@ -7344,7 +7357,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7344
7357
  children: [hasDetailsColumn && jsxRuntime.jsx("th", {
7345
7358
  className: "w-8 px-4 py-3"
7346
7359
  }), showSerial && jsxRuntime.jsx("th", {
7347
- className: "w-8 px-4 py-3 text-left text-xs font-medium text-primary-500 uppercase tracking-wider",
7360
+ className: "w-8 px-4 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider",
7348
7361
  children: "#"
7349
7362
  }), selectable && jsxRuntime.jsx("th", {
7350
7363
  className: "w-12 px-6 py-3",
@@ -7357,7 +7370,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7357
7370
  }), visibleColumns.map(function (column) {
7358
7371
  var _column$rules;
7359
7372
  return jsxRuntime.jsx("th", {
7360
- className: cn$1("px-6 py-3 text-left text-xs font-medium text-primary-500 uppercase tracking-wider", {
7373
+ className: cn$1("px-6 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider", {
7361
7374
  "cursor-pointer hover:bg-gray-100": sortable && column.sortable !== false
7362
7375
  }),
7363
7376
  onClick: function onClick() {
@@ -7448,7 +7461,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7448
7461
  children: [jsxRuntime.jsx("div", {
7449
7462
  className: "h-6 w-6 animate-spin rounded-full border-2 border-primary-600 border-t-transparent"
7450
7463
  }), jsxRuntime.jsx("span", {
7451
- className: "text-sm text-primary-500",
7464
+ className: "text-sm text-muted",
7452
7465
  children: "Loading..."
7453
7466
  })]
7454
7467
  })
@@ -7466,7 +7479,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7466
7479
  className: "h-8 w-8"
7467
7480
  })
7468
7481
  }), jsxRuntime.jsx("span", {
7469
- className: "text-sm text-primary-500",
7482
+ className: "text-sm text-muted",
7470
7483
  children: "No results found."
7471
7484
  })]
7472
7485
  })
@@ -7511,7 +7524,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7511
7524
  children: [jsxRuntime.jsx("div", {
7512
7525
  className: "h-6 w-6 animate-spin rounded-full border-2 border-primary-600 border-t-transparent"
7513
7526
  }), jsxRuntime.jsx("span", {
7514
- className: "text-sm text-primary-500",
7527
+ className: "text-sm text-muted",
7515
7528
  children: "Loading..."
7516
7529
  })]
7517
7530
  })
@@ -7525,7 +7538,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
7525
7538
  className: "h-8 w-8"
7526
7539
  })
7527
7540
  }), jsxRuntime.jsx("span", {
7528
- className: "text-sm text-primary-500",
7541
+ className: "text-sm text-muted",
7529
7542
  children: "No results found."
7530
7543
  })]
7531
7544
  })
@@ -22380,9 +22393,9 @@ var Stepper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22380
22393
  text: 'text-primary-600'
22381
22394
  },
22382
22395
  upcoming: {
22383
- circle: 'bg-gray-300 text-primary-500',
22396
+ circle: 'bg-gray-300 text-gray-700',
22384
22397
  line: 'bg-gray-300',
22385
- text: 'text-primary-500'
22398
+ text: 'text-muted'
22386
22399
  }
22387
22400
  };
22388
22401
  return jsxRuntime.jsx("nav", _objectSpread$e(_objectSpread$e({
@@ -22416,8 +22429,10 @@ var Stepper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22416
22429
  },
22417
22430
  disabled: !onStepClick || stepIndex > currentStep,
22418
22431
  "aria-current": status === 'current' ? 'step' : undefined,
22432
+ "aria-label": "Step ".concat(stepIndex + 1).concat(step.title ? ": ".concat(step.title) : '').concat(status === 'completed' ? ' (completed)' : ''),
22419
22433
  children: status === 'completed' ? jsxRuntime.jsx(Check, {
22420
- className: "h-4 w-4"
22434
+ className: "h-4 w-4",
22435
+ "aria-hidden": "true"
22421
22436
  }) : stepIndex + 1
22422
22437
  }), !isLast && jsxRuntime.jsx("div", {
22423
22438
  className: cn$1('bg-gray-300', {
@@ -22434,7 +22449,7 @@ var Stepper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22434
22449
  className: cn$1('text-sm font-medium', colors.text),
22435
22450
  children: step.title
22436
22451
  }), step.description && jsxRuntime.jsx("span", {
22437
- className: "text-xs text-primary-500",
22452
+ className: "text-xs text-muted",
22438
22453
  children: step.description
22439
22454
  })]
22440
22455
  })]
@@ -23506,7 +23521,7 @@ var StatCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23506
23521
  }), change && !loading && jsxRuntime.jsxs("p", {
23507
23522
  className: "mt-1 flex items-center gap-1 text-xs text-muted",
23508
23523
  children: [jsxRuntime.jsxs("span", {
23509
- className: cn$1('inline-flex items-center gap-0.5 font-semibold', good ? 'text-success-600' : 'text-error-600'),
23524
+ className: cn$1('inline-flex items-center gap-0.5 font-semibold', good ? 'text-success-700 dark:text-success-400' : 'text-error-700 dark:text-error-400'),
23510
23525
  children: [up ? jsxRuntime.jsx(ArrowUp, {
23511
23526
  className: "h-3.5 w-3.5",
23512
23527
  "aria-hidden": "true"
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "practicepro",
3
3
  "label": "PracticePro",
4
+ "$deprecated": "Moved to the PracticePro repo's dreamtree.brand.json. Shipped here until 1.5.0; build your own with `npx @dreamtree-org/twreact-ui brand build`.",
4
5
  "$description": "Teal primary and navy shell, taken from PracticePro/app/globals.css (brand-50/100/500/600/700, shell, shell-active). Steps PracticePro does not define are interpolated on the same hue. PracticePro's own muted grey (#64748b) is not carried over: on the #f6f8fb background it is about 4.4:1, below WCAG AA, so the shared muted token (#475569, 7.5:1) is used.",
5
6
  "color": {
6
7
  "primary": {
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "studio",
3
3
  "label": "Dreamtree Studio",
4
+ "$deprecated": "Moved to the ProtoPro repo's dreamtree.brand.json (formerly Dreamtree Studio). Shipped here until 1.5.0; build your own with `npx @dreamtree-org/twreact-ui brand build`.",
4
5
  "$description": "Indigo primary for Dreamtree Studio, the MCP prototyping harness (its own app pages, not the prototypes it renders). The shell, background and text roles are the shared slate defaults, so only the primary scale changes. Indigo 600 (#4f46e5) is 6.3:1 on white and 600/700 pass WCAG AA for text on white.",
5
6
  "color": {
6
7
  "primary": {