@byline/ui 2.5.2 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/components/shimmer/shimmer.d.ts +13 -1
  2. package/dist/components/shimmer/shimmer.js +29 -20
  3. package/dist/components/shimmer/shimmer_module.css +4 -4
  4. package/dist/dnd/draggable-sortable/demo/draggable-list-demo.js +1 -1
  5. package/dist/react.d.ts +18 -54
  6. package/dist/react.js +0 -35
  7. package/dist/styles/styles.css +3 -0
  8. package/dist/uikit.d.ts +1 -0
  9. package/dist/uikit.js +1 -0
  10. package/package.json +2 -8
  11. package/src/components/shimmer/shimmer.module.css +8 -4
  12. package/src/components/shimmer/shimmer.tsx +34 -9
  13. package/src/dnd/draggable-sortable/demo/draggable-list-demo.tsx +1 -1
  14. package/src/react.ts +20 -68
  15. package/src/styles/functional/surfaces.css +13 -1
  16. package/src/uikit.ts +1 -0
  17. package/dist/admin/group.d.ts +0 -27
  18. package/dist/admin/group.js +0 -14
  19. package/dist/admin/group.module.js +0 -6
  20. package/dist/admin/group_module.css +0 -19
  21. package/dist/admin/row.d.ts +0 -25
  22. package/dist/admin/row.js +0 -8
  23. package/dist/admin/row.module.js +0 -5
  24. package/dist/admin/row_module.css +0 -18
  25. package/dist/admin/tabs.d.ts +0 -25
  26. package/dist/admin/tabs.js +0 -35
  27. package/dist/admin/tabs.module.js +0 -10
  28. package/dist/admin/tabs_module.css +0 -68
  29. package/dist/fields/array/array-field.d.ts +0 -14
  30. package/dist/fields/array/array-field.js +0 -176
  31. package/dist/fields/array/array-field.module.js +0 -11
  32. package/dist/fields/array/array-field_module.css +0 -32
  33. package/dist/fields/blocks/blocks-field.d.ts +0 -13
  34. package/dist/fields/blocks/blocks-field.js +0 -244
  35. package/dist/fields/blocks/blocks-field.module.js +0 -26
  36. package/dist/fields/blocks/blocks-field_module.css +0 -107
  37. package/dist/fields/checkbox/checkbox-field.d.ts +0 -16
  38. package/dist/fields/checkbox/checkbox-field.js +0 -28
  39. package/dist/fields/checkbox/checkbox-field.module.js +0 -6
  40. package/dist/fields/checkbox/checkbox-field_module.css +0 -4
  41. package/dist/fields/column-formatter.d.ts +0 -20
  42. package/dist/fields/column-formatter.js +0 -15
  43. package/dist/fields/date-time-formatter.d.ts +0 -16
  44. package/dist/fields/date-time-formatter.js +0 -8
  45. package/dist/fields/datetime/datetime-field.d.ts +0 -16
  46. package/dist/fields/datetime/datetime-field.js +0 -37
  47. package/dist/fields/datetime/datetime-field.module.js +0 -5
  48. package/dist/fields/datetime/datetime-field_module.css +0 -4
  49. package/dist/fields/draggable-context-menu.d.ts +0 -6
  50. package/dist/fields/draggable-context-menu.js +0 -83
  51. package/dist/fields/draggable-context-menu.module.js +0 -15
  52. package/dist/fields/draggable-context-menu_module.css +0 -91
  53. package/dist/fields/field-helpers.d.ts +0 -26
  54. package/dist/fields/field-helpers.js +0 -50
  55. package/dist/fields/field-renderer.d.ts +0 -37
  56. package/dist/fields/field-renderer.js +0 -206
  57. package/dist/fields/field-renderer.module.js +0 -8
  58. package/dist/fields/field-renderer_module.css +0 -11
  59. package/dist/fields/file/file-field.d.ts +0 -19
  60. package/dist/fields/file/file-field.js +0 -226
  61. package/dist/fields/file/file-field.module.js +0 -18
  62. package/dist/fields/file/file-field_module.css +0 -131
  63. package/dist/fields/file/file-upload-field.d.ts +0 -21
  64. package/dist/fields/file/file-upload-field.js +0 -128
  65. package/dist/fields/file/file-upload-field.module.js +0 -15
  66. package/dist/fields/file/file-upload-field_module.css +0 -74
  67. package/dist/fields/group/group-field.d.ts +0 -15
  68. package/dist/fields/group/group-field.js +0 -59
  69. package/dist/fields/group/group-field.module.js +0 -9
  70. package/dist/fields/group/group-field_module.css +0 -27
  71. package/dist/fields/image/image-field.d.ts +0 -19
  72. package/dist/fields/image/image-field.js +0 -242
  73. package/dist/fields/image/image-field.module.js +0 -22
  74. package/dist/fields/image/image-field_module.css +0 -121
  75. package/dist/fields/image/image-upload-field.d.ts +0 -21
  76. package/dist/fields/image/image-upload-field.js +0 -187
  77. package/dist/fields/image/image-upload-field.module.js +0 -19
  78. package/dist/fields/image/image-upload-field_module.css +0 -92
  79. package/dist/fields/local-date-time.d.ts +0 -27
  80. package/dist/fields/local-date-time.js +0 -49
  81. package/dist/fields/locale-badge.d.ts +0 -18
  82. package/dist/fields/locale-badge.js +0 -10
  83. package/dist/fields/locale-badge.module.js +0 -5
  84. package/dist/fields/locale-badge_module.css +0 -27
  85. package/dist/fields/numerical/numerical-field.d.ts +0 -18
  86. package/dist/fields/numerical/numerical-field.js +0 -74
  87. package/dist/fields/relation/relation-display.d.ts +0 -40
  88. package/dist/fields/relation/relation-display.js +0 -58
  89. package/dist/fields/relation/relation-display.module.js +0 -9
  90. package/dist/fields/relation/relation-display_module.css +0 -21
  91. package/dist/fields/relation/relation-field.d.ts +0 -18
  92. package/dist/fields/relation/relation-field.js +0 -146
  93. package/dist/fields/relation/relation-field.module.js +0 -13
  94. package/dist/fields/relation/relation-field_module.css +0 -62
  95. package/dist/fields/relation/relation-picker.d.ts +0 -49
  96. package/dist/fields/relation/relation-picker.js +0 -233
  97. package/dist/fields/relation/relation-picker.module.js +0 -26
  98. package/dist/fields/relation/relation-picker_module.css +0 -124
  99. package/dist/fields/relation/relation-summary.d.ts +0 -31
  100. package/dist/fields/relation/relation-summary.js +0 -50
  101. package/dist/fields/relation/relation-summary.module.js +0 -11
  102. package/dist/fields/relation/relation-summary_module.css +0 -37
  103. package/dist/fields/select/select-field.d.ts +0 -16
  104. package/dist/fields/select/select-field.js +0 -50
  105. package/dist/fields/select/select-field.module.js +0 -5
  106. package/dist/fields/select/select-field_module.css +0 -4
  107. package/dist/fields/sortable-item.d.ts +0 -15
  108. package/dist/fields/sortable-item.js +0 -80
  109. package/dist/fields/sortable-item.module.js +0 -22
  110. package/dist/fields/sortable-item_module.css +0 -124
  111. package/dist/fields/text/text-field.d.ts +0 -20
  112. package/dist/fields/text/text-field.js +0 -104
  113. package/dist/fields/text/text-field.module.js +0 -6
  114. package/dist/fields/text/text-field_module.css +0 -5
  115. package/dist/fields/text-area/text-area-field.d.ts +0 -20
  116. package/dist/fields/text-area/text-area-field.js +0 -105
  117. package/dist/fields/text-area/text-area-field.module.js +0 -6
  118. package/dist/fields/text-area/text-area-field_module.css +0 -5
  119. package/dist/fields/use-field-change-handler.d.ts +0 -23
  120. package/dist/fields/use-field-change-handler.js +0 -52
  121. package/dist/forms/document-actions.d.ts +0 -48
  122. package/dist/forms/document-actions.js +0 -469
  123. package/dist/forms/document-actions.module.js +0 -34
  124. package/dist/forms/document-actions_module.css +0 -118
  125. package/dist/forms/form-context.d.ts +0 -89
  126. package/dist/forms/form-context.js +0 -466
  127. package/dist/forms/form-renderer.d.ts +0 -98
  128. package/dist/forms/form-renderer.js +0 -591
  129. package/dist/forms/form-renderer.module.js +0 -46
  130. package/dist/forms/form-renderer_module.css +0 -245
  131. package/dist/forms/navigation-guard.d.ts +0 -54
  132. package/dist/forms/navigation-guard.js +0 -22
  133. package/dist/forms/path-widget.d.ts +0 -36
  134. package/dist/forms/path-widget.js +0 -107
  135. package/dist/forms/path-widget.module.js +0 -8
  136. package/dist/forms/path-widget_module.css +0 -29
  137. package/dist/forms/upload-executor.d.ts +0 -57
  138. package/dist/forms/upload-executor.js +0 -92
  139. package/dist/services/field-services-context.d.ts +0 -16
  140. package/dist/services/field-services-context.js +0 -13
  141. package/dist/services/field-services-types.d.ts +0 -63
  142. package/dist/services/field-services-types.js +0 -1
  143. package/dist/widgets/diff-viewer/diff-modal.d.ts +0 -22
  144. package/dist/widgets/diff-viewer/diff-modal.js +0 -146
  145. package/dist/widgets/diff-viewer/diff-modal.module.js +0 -14
  146. package/dist/widgets/diff-viewer/diff-modal_module.css +0 -56
  147. package/dist/widgets/status-badge/status-badge.d.ts +0 -25
  148. package/dist/widgets/status-badge/status-badge.js +0 -35
  149. package/dist/widgets/status-badge/status-badge.module.js +0 -7
  150. package/dist/widgets/status-badge/status-badge_module.css +0 -20
  151. package/src/admin/group.module.css +0 -41
  152. package/src/admin/group.tsx +0 -40
  153. package/src/admin/row.module.css +0 -32
  154. package/src/admin/row.tsx +0 -33
  155. package/src/admin/tabs.module.css +0 -107
  156. package/src/admin/tabs.tsx +0 -82
  157. package/src/fields/array/array-field.module.css +0 -48
  158. package/src/fields/array/array-field.tsx +0 -266
  159. package/src/fields/blocks/blocks-field.module.css +0 -148
  160. package/src/fields/blocks/blocks-field.tsx +0 -312
  161. package/src/fields/checkbox/checkbox-field.module.css +0 -4
  162. package/src/fields/checkbox/checkbox-field.tsx +0 -54
  163. package/src/fields/column-formatter.tsx +0 -31
  164. package/src/fields/date-time-formatter.tsx +0 -22
  165. package/src/fields/datetime/datetime-field.module.css +0 -13
  166. package/src/fields/datetime/datetime-field.tsx +0 -54
  167. package/src/fields/draggable-context-menu.module.css +0 -127
  168. package/src/fields/draggable-context-menu.tsx +0 -85
  169. package/src/fields/field-helpers.ts +0 -69
  170. package/src/fields/field-renderer.module.css +0 -22
  171. package/src/fields/field-renderer.tsx +0 -288
  172. package/src/fields/file/file-field.module.css +0 -153
  173. package/src/fields/file/file-field.tsx +0 -271
  174. package/src/fields/file/file-upload-field.module.css +0 -101
  175. package/src/fields/file/file-upload-field.tsx +0 -183
  176. package/src/fields/group/group-field.module.css +0 -43
  177. package/src/fields/group/group-field.tsx +0 -84
  178. package/src/fields/image/image-field.module.css +0 -155
  179. package/src/fields/image/image-field.tsx +0 -291
  180. package/src/fields/image/image-upload-field.module.css +0 -123
  181. package/src/fields/image/image-upload-field.tsx +0 -270
  182. package/src/fields/local-date-time.tsx +0 -88
  183. package/src/fields/locale-badge.module.css +0 -37
  184. package/src/fields/locale-badge.tsx +0 -32
  185. package/src/fields/numerical/numerical-field.tsx +0 -114
  186. package/src/fields/relation/relation-display.module.css +0 -36
  187. package/src/fields/relation/relation-display.tsx +0 -130
  188. package/src/fields/relation/relation-field.module.css +0 -83
  189. package/src/fields/relation/relation-field.tsx +0 -206
  190. package/src/fields/relation/relation-picker.module.css +0 -168
  191. package/src/fields/relation/relation-picker.tsx +0 -325
  192. package/src/fields/relation/relation-summary.module.css +0 -55
  193. package/src/fields/relation/relation-summary.tsx +0 -123
  194. package/src/fields/select/select-field.module.css +0 -13
  195. package/src/fields/select/select-field.tsx +0 -61
  196. package/src/fields/sortable-item.module.css +0 -167
  197. package/src/fields/sortable-item.tsx +0 -101
  198. package/src/fields/text/text-field.module.css +0 -13
  199. package/src/fields/text/text-field.tsx +0 -146
  200. package/src/fields/text-area/text-area-field.module.css +0 -13
  201. package/src/fields/text-area/text-area-field.tsx +0 -147
  202. package/src/fields/use-field-change-handler.ts +0 -112
  203. package/src/forms/document-actions.module.css +0 -160
  204. package/src/forms/document-actions.tsx +0 -487
  205. package/src/forms/form-context.tsx +0 -704
  206. package/src/forms/form-renderer.module.css +0 -321
  207. package/src/forms/form-renderer.tsx +0 -888
  208. package/src/forms/navigation-guard.tsx +0 -98
  209. package/src/forms/path-widget.module.css +0 -41
  210. package/src/forms/path-widget.test.tsx +0 -217
  211. package/src/forms/path-widget.tsx +0 -181
  212. package/src/forms/upload-executor.ts +0 -190
  213. package/src/services/field-services-context.tsx +0 -35
  214. package/src/services/field-services-types.ts +0 -68
  215. package/src/widgets/diff-viewer/diff-modal.module.css +0 -79
  216. package/src/widgets/diff-viewer/diff-modal.tsx +0 -184
  217. package/src/widgets/status-badge/status-badge.module.css +0 -31
  218. package/src/widgets/status-badge/status-badge.tsx +0 -69
@@ -2,11 +2,23 @@ import type React from 'react';
2
2
  interface ShimmerProps {
3
3
  className?: string;
4
4
  width?: string | number;
5
+ /**
6
+ * Height of the bar. For the single-bar variants (`rectangular`,
7
+ * `circular`, and single-line `text`) this sizes the bar itself. For the
8
+ * multi-line text variant (`variant="text"` with `lines > 1`) it sizes the
9
+ * container that holds the lines — use `lineHeight` to size each line.
10
+ */
5
11
  height?: string | number;
12
+ /**
13
+ * Height of each line in the multi-line text variant (`variant="text"`
14
+ * with `lines > 1`). Falls back to the `.text` class height (1rem) when
15
+ * omitted. Ignored by the single-bar variants — use `height` there.
16
+ */
17
+ lineHeight?: string | number;
6
18
  borderRadius?: string;
7
19
  variant?: 'text' | 'rectangular' | 'circular';
8
20
  lines?: number;
9
21
  children?: React.ReactNode;
10
22
  }
11
- export declare function Shimmer({ className, width, height, borderRadius, variant, lines, children, ...other }: ShimmerProps): React.JSX.Element;
23
+ export declare function Shimmer({ className, width, height, lineHeight, borderRadius, variant, lines, children, ...other }: ShimmerProps): React.JSX.Element;
12
24
  export {};
@@ -1,12 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
3
  import shimmer_module from "./shimmer.module.js";
4
- function Shimmer({ className, width = '100%', height = '1rem', borderRadius, variant = 'rectangular', lines = 1, children, ...other }) {
5
- const shimmerStyle = {
6
- width: 'number' == typeof width ? `${width}px` : width,
7
- height: 'number' == typeof height ? `${height}px` : height,
8
- borderRadius: borderRadius
9
- };
4
+ const toCssSize = (value)=>'number' == typeof value ? `${value}px` : value;
5
+ function Shimmer({ className, width = '100%', height, lineHeight, borderRadius, variant = 'rectangular', lines = 1, children, ...other }) {
10
6
  const getVariantClass = ()=>{
11
7
  switch(variant){
12
8
  case 'text':
@@ -17,20 +13,33 @@ function Shimmer({ className, width = '100%', height = '1rem', borderRadius, var
17
13
  return shimmer_module.rectangular;
18
14
  }
19
15
  };
20
- if ('text' === variant && lines > 1) return /*#__PURE__*/ jsx("div", {
21
- className: classnames(shimmer_module.shimmerContainer, className),
22
- ...other,
23
- children: Array.from({
24
- length: lines
25
- }, (_, index)=>/*#__PURE__*/ jsx("div", {
26
- className: classnames(shimmer_module.shimmer, shimmer_module.text),
27
- style: {
28
- ...shimmerStyle,
29
- width: index === lines - 1 ? '75%' : '100%',
30
- marginBottom: index === lines - 1 ? 0 : '0.5rem'
31
- }
32
- }, `shimmer-line-${index}`))
33
- });
16
+ if ('text' === variant && lines > 1) {
17
+ const resolvedLineHeight = toCssSize(lineHeight);
18
+ return /*#__PURE__*/ jsx("div", {
19
+ className: classnames(shimmer_module.shimmerContainer, className),
20
+ style: {
21
+ width: toCssSize(width),
22
+ height: toCssSize(height)
23
+ },
24
+ ...other,
25
+ children: Array.from({
26
+ length: lines
27
+ }, (_, index)=>/*#__PURE__*/ jsx("div", {
28
+ className: classnames(shimmer_module.shimmer, shimmer_module.text),
29
+ style: {
30
+ width: index === lines - 1 ? '75%' : '100%',
31
+ height: resolvedLineHeight,
32
+ borderRadius,
33
+ marginBottom: index === lines - 1 ? 0 : '0.5rem'
34
+ }
35
+ }, `shimmer-line-${index}`))
36
+ });
37
+ }
38
+ const shimmerStyle = {
39
+ width: toCssSize(width),
40
+ height: toCssSize(height) ?? '1rem',
41
+ borderRadius
42
+ };
34
43
  return /*#__PURE__*/ jsx("div", {
35
44
  className: classnames(shimmer_module.shimmer, getVariantClass(), className),
36
45
  style: shimmerStyle,
@@ -2,8 +2,8 @@
2
2
 
3
3
  @layer byline-components {
4
4
  :is(.shimmer-hQj5gn, .byline-shimmer) {
5
- background-color: #f0f0f0;
6
- background-image: linear-gradient(90deg, #0000, #fff9, #0000);
5
+ background-color: var(--surface-shimmer);
6
+ background-image: linear-gradient(90deg, #0000, #ffffffb3, #0000);
7
7
  background-size: 200% 100%;
8
8
  animation: 1.5s infinite shimmer-hQj5gn;
9
9
  position: relative;
@@ -11,13 +11,13 @@
11
11
  }
12
12
 
13
13
  :is(:is(.dark, [data-theme="dark"]) .shimmer-hQj5gn, :is(.dark, [data-theme="dark"]) .byline-shimmer) {
14
- background-color: #141414;
15
- background-image: linear-gradient(90deg, #0000, #ffffff03, #0000);
14
+ background-image: linear-gradient(90deg, #0000, #ffffff0a, #0000);
16
15
  }
17
16
 
18
17
  :is(.shimmerContainer-YqBAXa, .byline-shimmer-container) {
19
18
  flex-direction: column;
20
19
  display: flex;
20
+ overflow: hidden;
21
21
  }
22
22
 
23
23
  :is(.rectangular-qx6oTl, .byline-shimmer-rectangular) {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
+ import { Card, GripperVerticalIcon } from "@byline/ui/react";
4
5
  import classnames from "classnames";
5
- import { Card, GripperVerticalIcon } from "../../../uikit.js";
6
6
  import { DraggableSortable, moveItem, useSortable } from "../index.js";
7
7
  import draggable_list_demo_module from "./draggable-list-demo.module.js";
8
8
  const sourceItems = [
package/dist/react.d.ts CHANGED
@@ -2,62 +2,26 @@
2
2
  * NOTE: We put a .js ending on imports here to satisfy
3
3
  * TS / dist output.
4
4
  *
5
- * Single unified entry point for `@byline/ui`. Everything React-side
6
- * exports through this barrel — uikit foundations, drag-and-drop
7
- * helpers, presentational admin layout primitives, field widgets, form
8
- * runtime, and the field-side service contracts.
5
+ * Single unified entry point for `@byline/ui`.
9
6
  *
10
- * Why one barrel: previous releases split this into per-area subpath
11
- * exports (`./react/admin`, `./react/fields`, `./react/forms`,
12
- * `./react/services`). Bundlers that pre-bundle subpaths individually
13
- * (e.g. Vite's `optimizeDeps.include`) would inline a private copy of
14
- * the React Contexts in `services/*` per subpath — provider mounted on
15
- * one Context identity, hooks reading another. Collapsing to a single
16
- * specifier eliminates the trap structurally. Tree-shaking inside the
17
- * single ESM bundle handles unused exports for public-site consumers
18
- * (sideEffects is set to CSS only).
7
+ * Scope: framework-agnostic React primitives uikit foundations
8
+ * (Button, Input, Modal, Drawer, Alert, Table, icons, …) plus the
9
+ * widgets that remained generic after the admin extraction (datepicker,
10
+ * search, timeline, image-lightbox). No CMS concepts, no admin-specific
11
+ * Contexts.
19
12
  *
20
- * Admin-domain components (admin users, roles, permissions, account
21
- * self-service, sign-in form, admin services context) live in
22
- * `@byline/admin` under per-vertical subpaths they are no longer
23
- * exported from here. This package is the kit + form runtime +
24
- * collection-editor-shared widgets.
13
+ * Admin-domain React surface forms, fields, presentational form
14
+ * layout (tabs/rows/groups), drag-and-drop helpers used by sortable
15
+ * fields, the field-side services Context, and the editor-shared
16
+ * widgets (status-badge, diff-viewer) lives in `@byline/admin/react`.
17
+ * Server-only admin modules (admin-users, admin-roles, etc.) stay on
18
+ * their own per-vertical subpaths inside `@byline/admin`.
19
+ *
20
+ * One barrel rather than per-area subpath exports: bundlers that
21
+ * pre-bundle subpaths individually (e.g. Vite's `optimizeDeps.include`)
22
+ * would inline a private copy of any React Context per subpath —
23
+ * provider mounted on one identity, hooks reading another. Collapsing
24
+ * to a single specifier eliminates the trap structurally.
25
25
  */
26
- export * from './admin/group.js';
27
- export * from './admin/row.js';
28
- export * from './admin/tabs.js';
29
26
  export * from './dnd/draggable-sortable/index.js';
30
- export * from './fields/array/array-field.js';
31
- export * from './fields/blocks/blocks-field.js';
32
- export * from './fields/checkbox/checkbox-field.js';
33
- export * from './fields/column-formatter.js';
34
- export * from './fields/date-time-formatter.js';
35
- export * from './fields/datetime/datetime-field.js';
36
- export * from './fields/draggable-context-menu.js';
37
- export * from './fields/field-helpers.js';
38
- export * from './fields/field-renderer.js';
39
- export * from './fields/file/file-field.js';
40
- export * from './fields/file/file-upload-field.js';
41
- export * from './fields/group/group-field.js';
42
- export * from './fields/image/image-field.js';
43
- export * from './fields/image/image-upload-field.js';
44
- export * from './fields/local-date-time.js';
45
- export * from './fields/locale-badge.js';
46
- export * from './fields/numerical/numerical-field.js';
47
- export * from './fields/relation/relation-field.js';
48
- export * from './fields/relation/relation-picker.js';
49
- export * from './fields/select/select-field.js';
50
- export * from './fields/sortable-item.js';
51
- export * from './fields/text/text-field.js';
52
- export * from './fields/text-area/text-area-field.js';
53
- export * from './fields/use-field-change-handler.js';
54
- export * from './forms/document-actions.js';
55
- export * from './forms/form-context.js';
56
- export * from './forms/form-renderer.js';
57
- export * from './forms/navigation-guard.js';
58
- export * from './forms/path-widget.js';
59
- export * from './services/field-services-context.js';
60
27
  export * from './uikit.js';
61
- export * from './widgets/diff-viewer/diff-modal.js';
62
- export * from './widgets/status-badge/status-badge.js';
63
- export type { BylineFieldServices, CollectionListDoc, CollectionListParams, CollectionListResponse, GetCollectionDocumentsFn, UploadedFileResult, UploadFieldFn, } from './services/field-services-types.js';
package/dist/react.js CHANGED
@@ -1,37 +1,2 @@
1
- export * from "./admin/group.js";
2
- export * from "./admin/row.js";
3
- export * from "./admin/tabs.js";
4
1
  export * from "./dnd/draggable-sortable/index.js";
5
- export * from "./fields/array/array-field.js";
6
- export * from "./fields/blocks/blocks-field.js";
7
- export * from "./fields/checkbox/checkbox-field.js";
8
- export * from "./fields/column-formatter.js";
9
- export * from "./fields/date-time-formatter.js";
10
- export * from "./fields/datetime/datetime-field.js";
11
- export * from "./fields/draggable-context-menu.js";
12
- export * from "./fields/field-helpers.js";
13
- export * from "./fields/field-renderer.js";
14
- export * from "./fields/file/file-field.js";
15
- export * from "./fields/file/file-upload-field.js";
16
- export * from "./fields/group/group-field.js";
17
- export * from "./fields/image/image-field.js";
18
- export * from "./fields/image/image-upload-field.js";
19
- export * from "./fields/local-date-time.js";
20
- export * from "./fields/locale-badge.js";
21
- export * from "./fields/numerical/numerical-field.js";
22
- export * from "./fields/relation/relation-field.js";
23
- export * from "./fields/relation/relation-picker.js";
24
- export * from "./fields/select/select-field.js";
25
- export * from "./fields/sortable-item.js";
26
- export * from "./fields/text/text-field.js";
27
- export * from "./fields/text-area/text-area-field.js";
28
- export * from "./fields/use-field-change-handler.js";
29
- export * from "./forms/document-actions.js";
30
- export * from "./forms/form-context.js";
31
- export * from "./forms/form-renderer.js";
32
- export * from "./forms/navigation-guard.js";
33
- export * from "./forms/path-widget.js";
34
- export * from "./services/field-services-context.js";
35
2
  export * from "./uikit.js";
36
- export * from "./widgets/diff-viewer/diff-modal.js";
37
- export * from "./widgets/status-badge/status-badge.js";
@@ -1314,6 +1314,7 @@
1314
1314
  --surface-subtle: var(--canvas-50);
1315
1315
  --surface-subtle-hover: var(--canvas-100);
1316
1316
  --surface-subtle-active: var(--canvas-200);
1317
+ --surface-shimmer: var(--canvas-100);
1317
1318
  --surface-panel-scrollbar: var(--gray-50);
1318
1319
  --surface-panel-scrollbar-thumb: var(--primary-100);
1319
1320
  }
@@ -1336,6 +1337,7 @@
1336
1337
  --surface-subtle: var(--canvas-800);
1337
1338
  --surface-subtle-hover: var(--canvas-700);
1338
1339
  --surface-subtle-active: var(--canvas-600);
1340
+ --surface-shimmer: oklch(from var(--canvas-base) calc(l * .45) c h);
1339
1341
  --surface-panel-scrollbar: var(--canvas-700);
1340
1342
  --surface-panel-scrollbar-thumb: var(--primary-400);
1341
1343
  }
@@ -1358,6 +1360,7 @@
1358
1360
  --surface-subtle: var(--canvas-50);
1359
1361
  --surface-subtle-hover: var(--canvas-100);
1360
1362
  --surface-subtle-active: var(--canvas-200);
1363
+ --surface-shimmer: var(--canvas-100);
1361
1364
  --surface-panel-scrollbar: var(--gray-50);
1362
1365
  --surface-panel-scrollbar-thumb: var(--primary-100);
1363
1366
  }
package/dist/uikit.d.ts CHANGED
@@ -95,6 +95,7 @@ export * from './icons/stopwatch-icon.js';
95
95
  export * from './icons/success-icon.js';
96
96
  export * from './icons/user-icon.js';
97
97
  export * from './icons/users-icon.js';
98
+ export * from './icons/video-icon.js';
98
99
  export * from './icons/wallet-icon.js';
99
100
  export * from './icons/warning-icon.js';
100
101
  export * from './icons/x-icon.js';
package/dist/uikit.js CHANGED
@@ -90,6 +90,7 @@ export * from "./icons/stopwatch-icon.js";
90
90
  export * from "./icons/success-icon.js";
91
91
  export * from "./icons/user-icon.js";
92
92
  export * from "./icons/users-icon.js";
93
+ export * from "./icons/video-icon.js";
93
94
  export * from "./icons/wallet-icon.js";
94
95
  export * from "./icons/warning-icon.js";
95
96
  export * from "./icons/x-icon.js";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "2.5.2",
6
+ "version": "2.6.1",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -56,17 +56,13 @@
56
56
  "@dnd-kit/modifiers": "^9.0.0",
57
57
  "@dnd-kit/sortable": "^10.0.0",
58
58
  "@dnd-kit/utilities": "^3.2.2",
59
- "@tanstack/react-form-start": "^1.32.0",
60
59
  "classnames": "^2.5.1",
61
60
  "date-fns": "^4.2.1",
62
- "lodash-es": "^4.18.1",
63
61
  "motion": "^12.40.0",
64
62
  "npm-run-all": "^4.1.5",
65
63
  "react-day-picker": "^10.0.1",
66
- "react-diff-viewer-continued": "^4.2.2",
67
64
  "zod": "^4.4.3",
68
- "zod-form-data": "^3.0.1",
69
- "@byline/core": "2.5.2"
65
+ "@byline/core": "2.6.1"
70
66
  },
71
67
  "peerDependencies": {
72
68
  "react": "^19.0.0",
@@ -76,8 +72,6 @@
76
72
  "@biomejs/biome": "2.4.15",
77
73
  "@rsbuild/plugin-react": "^2.0.0",
78
74
  "@rslib/core": "^0.21.5",
79
- "@types/lodash": "^4.17.24",
80
- "@types/lodash-es": "^4.17.12",
81
75
  "@types/node": "^25.9.1",
82
76
  "@types/react": "19.2.15",
83
77
  "@types/react-dom": "19.2.3",
@@ -15,8 +15,8 @@
15
15
  :global(.byline-shimmer) {
16
16
  position: relative;
17
17
  overflow: hidden;
18
- background-color: #f0f0f0;
19
- background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
18
+ background-color: var(--surface-shimmer);
19
+ background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
20
20
  background-size: 200% 100%;
21
21
  animation: shimmer 1.5s infinite;
22
22
  }
@@ -25,8 +25,9 @@
25
25
  :global([data-theme="dark"]) {
26
26
  .shimmer,
27
27
  :global(.byline-shimmer) {
28
- background-color: #141414;
29
- background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.01), transparent);
28
+ /* base colour comes from --surface-shimmer; only the white sheen is
29
+ toned down here so it doesn't glare against the dark bar */
30
+ background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
30
31
  }
31
32
  }
32
33
 
@@ -34,6 +35,9 @@
34
35
  :global(.byline-shimmer-container) {
35
36
  display: flex;
36
37
  flex-direction: column;
38
+ /* When a container `height` is set, crop overflowing lines cleanly
39
+ rather than letting them spill past the skeleton's bounds. */
40
+ overflow: hidden;
37
41
  }
38
42
 
39
43
  .rectangular,
@@ -7,29 +7,39 @@ import styles from './shimmer.module.css'
7
7
  interface ShimmerProps {
8
8
  className?: string
9
9
  width?: string | number
10
+ /**
11
+ * Height of the bar. For the single-bar variants (`rectangular`,
12
+ * `circular`, and single-line `text`) this sizes the bar itself. For the
13
+ * multi-line text variant (`variant="text"` with `lines > 1`) it sizes the
14
+ * container that holds the lines — use `lineHeight` to size each line.
15
+ */
10
16
  height?: string | number
17
+ /**
18
+ * Height of each line in the multi-line text variant (`variant="text"`
19
+ * with `lines > 1`). Falls back to the `.text` class height (1rem) when
20
+ * omitted. Ignored by the single-bar variants — use `height` there.
21
+ */
22
+ lineHeight?: string | number
11
23
  borderRadius?: string
12
24
  variant?: 'text' | 'rectangular' | 'circular'
13
25
  lines?: number
14
26
  children?: React.ReactNode
15
27
  }
16
28
 
29
+ const toCssSize = (value: string | number | undefined): string | undefined =>
30
+ typeof value === 'number' ? `${value}px` : value
31
+
17
32
  export function Shimmer({
18
33
  className,
19
34
  width = '100%',
20
- height = '1rem',
35
+ height,
36
+ lineHeight,
21
37
  borderRadius,
22
38
  variant = 'rectangular',
23
39
  lines = 1,
24
40
  children,
25
41
  ...other
26
42
  }: ShimmerProps): React.JSX.Element {
27
- const shimmerStyle = {
28
- width: typeof width === 'number' ? `${width}px` : width,
29
- height: typeof height === 'number' ? `${height}px` : height,
30
- borderRadius: borderRadius,
31
- }
32
-
33
43
  const getVariantClass = () => {
34
44
  switch (variant) {
35
45
  case 'text':
@@ -42,15 +52,24 @@ export function Shimmer({
42
52
  }
43
53
 
44
54
  if (variant === 'text' && lines > 1) {
55
+ // `height` sizes the container; each line is sized by `lineHeight`
56
+ // (undefined falls through to the `.text` class height). `height` is
57
+ // deliberately not spread onto the lines so it can't distort them.
58
+ const resolvedLineHeight = toCssSize(lineHeight)
45
59
  return (
46
- <div className={cx(styles.shimmerContainer, className)} {...other}>
60
+ <div
61
+ className={cx(styles.shimmerContainer, className)}
62
+ style={{ width: toCssSize(width), height: toCssSize(height) }}
63
+ {...other}
64
+ >
47
65
  {Array.from({ length: lines }, (_, index) => (
48
66
  <div
49
67
  key={`shimmer-line-${index}`}
50
68
  className={cx(styles.shimmer, styles.text)}
51
69
  style={{
52
- ...shimmerStyle,
53
70
  width: index === lines - 1 ? '75%' : '100%',
71
+ height: resolvedLineHeight,
72
+ borderRadius,
54
73
  marginBottom: index === lines - 1 ? 0 : '0.5rem',
55
74
  }}
56
75
  />
@@ -59,6 +78,12 @@ export function Shimmer({
59
78
  )
60
79
  }
61
80
 
81
+ const shimmerStyle = {
82
+ width: toCssSize(width),
83
+ height: toCssSize(height) ?? '1rem',
84
+ borderRadius,
85
+ }
86
+
62
87
  return (
63
88
  <div
64
89
  className={cx(styles.shimmer, getVariantClass(), className)}
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { useState } from 'react'
4
4
 
5
+ import { Card, GripperVerticalIcon } from '@byline/ui/react'
5
6
  import cx from 'classnames'
6
7
 
7
- import { Card, GripperVerticalIcon } from '../../../uikit.js'
8
8
  import { DraggableSortable, moveItem, useSortable } from '..'
9
9
  import styles from './draggable-list-demo.module.css'
10
10
 
package/src/react.ts CHANGED
@@ -2,79 +2,31 @@
2
2
  * NOTE: We put a .js ending on imports here to satisfy
3
3
  * TS / dist output.
4
4
  *
5
- * Single unified entry point for `@byline/ui`. Everything React-side
6
- * exports through this barrel — uikit foundations, drag-and-drop
7
- * helpers, presentational admin layout primitives, field widgets, form
8
- * runtime, and the field-side service contracts.
5
+ * Single unified entry point for `@byline/ui`.
9
6
  *
10
- * Why one barrel: previous releases split this into per-area subpath
11
- * exports (`./react/admin`, `./react/fields`, `./react/forms`,
12
- * `./react/services`). Bundlers that pre-bundle subpaths individually
13
- * (e.g. Vite's `optimizeDeps.include`) would inline a private copy of
14
- * the React Contexts in `services/*` per subpath — provider mounted on
15
- * one Context identity, hooks reading another. Collapsing to a single
16
- * specifier eliminates the trap structurally. Tree-shaking inside the
17
- * single ESM bundle handles unused exports for public-site consumers
18
- * (sideEffects is set to CSS only).
7
+ * Scope: framework-agnostic React primitives uikit foundations
8
+ * (Button, Input, Modal, Drawer, Alert, Table, icons, …) plus the
9
+ * widgets that remained generic after the admin extraction (datepicker,
10
+ * search, timeline, image-lightbox). No CMS concepts, no admin-specific
11
+ * Contexts.
19
12
  *
20
- * Admin-domain components (admin users, roles, permissions, account
21
- * self-service, sign-in form, admin services context) live in
22
- * `@byline/admin` under per-vertical subpaths they are no longer
23
- * exported from here. This package is the kit + form runtime +
24
- * collection-editor-shared widgets.
13
+ * Admin-domain React surface forms, fields, presentational form
14
+ * layout (tabs/rows/groups), drag-and-drop helpers used by sortable
15
+ * fields, the field-side services Context, and the editor-shared
16
+ * widgets (status-badge, diff-viewer) lives in `@byline/admin/react`.
17
+ * Server-only admin modules (admin-users, admin-roles, etc.) stay on
18
+ * their own per-vertical subpaths inside `@byline/admin`.
19
+ *
20
+ * One barrel rather than per-area subpath exports: bundlers that
21
+ * pre-bundle subpaths individually (e.g. Vite's `optimizeDeps.include`)
22
+ * would inline a private copy of any React Context per subpath —
23
+ * provider mounted on one identity, hooks reading another. Collapsing
24
+ * to a single specifier eliminates the trap structurally.
25
25
  */
26
26
 
27
- // Presentational admin layout primitives.
28
- export * from './admin/group.js'
29
- export * from './admin/row.js'
30
- export * from './admin/tabs.js'
31
- // Drag-and-drop helpers.
27
+ // Generic vertical-list sortable helpers over @dnd-kit/sortable. No
28
+ // CMS concepts in the API — callers pass ids + an onDragEnd callback.
32
29
  export * from './dnd/draggable-sortable/index.js'
33
- // Field widgets.
34
- export * from './fields/array/array-field.js'
35
- export * from './fields/blocks/blocks-field.js'
36
- export * from './fields/checkbox/checkbox-field.js'
37
- export * from './fields/column-formatter.js'
38
- export * from './fields/date-time-formatter.js'
39
- export * from './fields/datetime/datetime-field.js'
40
- export * from './fields/draggable-context-menu.js'
41
- export * from './fields/field-helpers.js'
42
- export * from './fields/field-renderer.js'
43
- export * from './fields/file/file-field.js'
44
- export * from './fields/file/file-upload-field.js'
45
- export * from './fields/group/group-field.js'
46
- export * from './fields/image/image-field.js'
47
- export * from './fields/image/image-upload-field.js'
48
- export * from './fields/local-date-time.js'
49
- export * from './fields/locale-badge.js'
50
- export * from './fields/numerical/numerical-field.js'
51
- export * from './fields/relation/relation-field.js'
52
- export * from './fields/relation/relation-picker.js'
53
- export * from './fields/select/select-field.js'
54
- export * from './fields/sortable-item.js'
55
- export * from './fields/text/text-field.js'
56
- export * from './fields/text-area/text-area-field.js'
57
- export * from './fields/use-field-change-handler.js'
58
- // Form runtime.
59
- export * from './forms/document-actions.js'
60
- export * from './forms/form-context.js'
61
- export * from './forms/form-renderer.js'
62
- export * from './forms/navigation-guard.js'
63
- export * from './forms/path-widget.js'
64
- // Field-side service contract types + Context provider/hook.
65
- export * from './services/field-services-context.js'
66
30
  // Foundational surface — synced from @infonomic/uikit. See
67
31
  // scripts/sync-from-uikit.sh and src/.uikit-sync.json.
68
32
  export * from './uikit.js'
69
- // Collection-editor-shared widgets.
70
- export * from './widgets/diff-viewer/diff-modal.js'
71
- export * from './widgets/status-badge/status-badge.js'
72
- export type {
73
- BylineFieldServices,
74
- CollectionListDoc,
75
- CollectionListParams,
76
- CollectionListResponse,
77
- GetCollectionDocumentsFn,
78
- UploadedFileResult,
79
- UploadFieldFn,
80
- } from './services/field-services-types.js'
@@ -39,12 +39,16 @@
39
39
  --surface-subtle-hover: var(--canvas-100);
40
40
  --surface-subtle-active: var(--canvas-200);
41
41
 
42
+ /* Shimmer / skeleton placeholder bar — sits a step darker than the
43
+ panel so loading lines read clearly on a light surface. */
44
+ --surface-shimmer: var(--canvas-100);
45
+
42
46
  /* Panel scrollers */
43
47
  --surface-panel-scrollbar: var(--gray-50);
44
48
  --surface-panel-scrollbar-thumb: var(--primary-100);
45
49
  }
46
50
 
47
- /* 🌙 Dark via `.dark` class or [data-theme="dark"] attribute.
51
+ /* 🌙 Dark via `.dark` class or [data-theme="dark"] attribute.
48
52
  * We rely on the consuming application to detect a user's
49
53
  * preferred color scheme - either by header or cookie, and to set
50
54
  * a root html class accordingly (for now), which unfortunately means
@@ -83,6 +87,11 @@
83
87
  --surface-subtle-hover: var(--canvas-700);
84
88
  --surface-subtle-active: var(--canvas-600);
85
89
 
90
+ /* Shimmer / skeleton placeholder bar — lifted just above the panel so
91
+ loading lines are visible without glaring on a dark surface. Sits
92
+ between canvas-800 (panel) and canvas-700 (hover). */
93
+ --surface-shimmer: oklch(from var(--canvas-base) calc(l * 0.45) c h);
94
+
86
95
  /* Panel scrollers */
87
96
  --surface-panel-scrollbar: var(--canvas-700);
88
97
  --surface-panel-scrollbar-thumb: var(--primary-400);
@@ -125,6 +134,9 @@
125
134
  --surface-subtle-hover: var(--canvas-100);
126
135
  --surface-subtle-active: var(--canvas-200);
127
136
 
137
+ /* Shimmer / skeleton placeholder bar */
138
+ --surface-shimmer: var(--canvas-100);
139
+
128
140
  /* Panel scrollers */
129
141
  --surface-panel-scrollbar: var(--gray-50);
130
142
  --surface-panel-scrollbar-thumb: var(--primary-100);
package/src/uikit.ts CHANGED
@@ -103,6 +103,7 @@ export * from './icons/stopwatch-icon.js'
103
103
  export * from './icons/success-icon.js'
104
104
  export * from './icons/user-icon.js'
105
105
  export * from './icons/users-icon.js'
106
+ export * from './icons/video-icon.js'
106
107
  export * from './icons/wallet-icon.js'
107
108
  export * from './icons/warning-icon.js'
108
109
  export * from './icons/x-icon.js'
@@ -1,27 +0,0 @@
1
- /**
2
- * This Source Code is subject to the terms of the Mozilla Public
3
- * License, v. 2.0. If a copy of the MPL was not distributed with this
4
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
- *
6
- * Copyright (c) Infonomic Company Limited
7
- */
8
- import type { ReactNode } from 'react';
9
- interface AdminGroupProps {
10
- /** Optional heading rendered as a `<legend>` above the cluster. */
11
- label?: string;
12
- children: ReactNode;
13
- className?: string;
14
- }
15
- /**
16
- * Labelled fieldset clustering related fields together.
17
- *
18
- * Used by `FormRenderer` when a `CollectionAdminConfig` declares a `groups`
19
- * primitive. Renders a bordered, padded `<fieldset>` with an optional
20
- * `<legend>` for the label.
21
- *
22
- * Stable override handles: `.byline-admin-group` on the fieldset and
23
- * `.byline-admin-group-legend` on the legend (alongside the hashed
24
- * CSS-modules locals).
25
- */
26
- export declare const AdminGroup: ({ label, children, className }: AdminGroupProps) => import("react").JSX.Element;
27
- export {};