@webority/ui-react 0.77.2 → 0.78.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.
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`feed`,`progress`],o=[`vertical`,`horizontal`],s=[`neutral`,`success`,`warning`,`danger`,`info`],c={done:`check`,current:`clock`,"on-hold":`lock`,rejected:`x`,cancelled:`minus`,skipped:`arrow-right`,upcoming:null},l=e=>typeof e==`string`&&(/^https?:[/][/]/i.test(e)||e.startsWith(`/`)&&e[1]!==`/`&&e[1]!==`\\`)&&![...e].some(e=>e.charCodeAt(0)<=32||e.charCodeAt(0)===127);function u(e){if(!(e.byHref==null||e.byHref===``)){if(!l(e.byHref))throw Error(`<AppTimeline> items[].byHref must be a path starting with one '/', or an http:// or https:// address, with no spaces.`);if(!e.by)throw Error(`<AppTimeline> items[].byHref links the by name, so the item needs by.`)}}var d=e=>e.byHref?r(`a`,{className:`timeline-by-link`,href:e.byHref,children:e.by}):e.by;function f({items:l=[],variant:f=`feed`,orientation:p=`vertical`,size:m,className:h=``,style:g,..._}){t(`AppTimeline`,_),e(`AppTimeline`,`variant`,f,a),e(`AppTimeline`,`orientation`,p,o);for(let t of l)e(`AppTimeline`,`items[].tone`,t.tone,s),u(t),f===`progress`&&e(`AppTimeline`,`items[].status`,t.status,Object.keys(c));let v=f===`progress`,y=`timeline${v?` timeline--progress`:``}${p===`horizontal`?` timeline--horizontal`:``}${h?` ${h}`:``}`,b=typeof m==`number`&&m>0?m:void 0,x=b?Math.round(b*.54):v?13:12;return r(`ol`,{className:y,style:b?{...g,"--wui-timeline-dot":`${b}px`}:g,..._,children:l.map((e,t)=>{let a=v?e.status:void 0,o=a?` is-${a}`:``,s=e.tone&&e.tone!==`neutral`?` ${e.tone}`:``,l=v?e.icon??(a?c[a]:void 0):e.icon||`circle`;return i(`li`,{className:`timeline-item${o}${s}`,children:[r(`span`,{className:`timeline-dot`,children:l?r(n,{name:l,size:x}):null}),i(`div`,{className:`timeline-body`,children:[v?i(`div`,{className:`timeline-head`,children:[r(`div`,{className:`timeline-title`,children:e.title}),(e.at||e.time)&&i(`span`,{className:`timeline-when`,children:[e.at&&r(`span`,{className:`timeline-at`,title:e.atTitle||void 0,children:e.at}),e.time&&r(`span`,{className:`timeline-time`,children:e.time})]})]}):r(`div`,{className:`timeline-title`,children:e.title}),e.description&&r(`div`,{className:`timeline-desc`,children:e.description}),!v&&(e.at||e.time||e.by)&&i(`div`,{className:`timeline-meta`,children:[(e.at||e.time)&&i(`span`,{className:`timeline-when`,children:[e.at&&r(`span`,{className:`timeline-at`,title:e.atTitle||void 0,children:e.at}),e.time&&r(`span`,{className:`timeline-time`,children:e.time})]}),e.by&&r(`span`,{className:`timeline-by`,children:d(e)})]}),v&&e.by&&r(`div`,{className:`timeline-meta`,children:r(`span`,{className:`timeline-by`,children:d(e)})}),e.note&&r(`p`,{className:`timeline-note`,children:e.note})]})]},e.key??`${e.at}-${t}`)})})}export{f as default};
1
+ import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`feed`,`progress`,`steps`],o=[`vertical`,`horizontal`],s=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],c=[`neutral`,`success`,`warning`,`danger`,`info`],l=[`sm`,`md`,`lg`],u={done:`check`,current:`clock`,"on-hold":`lock`,rejected:`x`,cancelled:`minus`,skipped:`arrow-right`,upcoming:null},d=e=>typeof e==`string`&&(/^https?:[/][/]/i.test(e)||e.startsWith(`/`)&&e[1]!==`/`&&e[1]!==`\\`)&&![...e].some(e=>e.charCodeAt(0)<=32||e.charCodeAt(0)===127);function f(e){if(!(e.byHref==null||e.byHref===``)){if(!d(e.byHref))throw Error(`<AppTimeline> items[].byHref must be a path starting with one '/', or an http:// or https:// address, with no spaces.`);if(!e.by)throw Error(`<AppTimeline> items[].byHref links the by name, so the item needs by.`)}}var p=e=>e.byHref?r(`a`,{className:`timeline-by-link`,href:e.byHref,children:e.by}):e.by;function m({items:d=[],variant:m=`feed`,orientation:h,iconVariant:g,size:_,className:v=``,style:y,...b}){t(`AppTimeline`,b),e(`AppTimeline`,`variant`,m,a),e(`AppTimeline`,`orientation`,h,o),e(`AppTimeline`,`iconVariant`,g,s),e(`AppTimeline`,`size`,typeof _==`string`?_:null,l);for(let t of d)e(`AppTimeline`,`items[].tone`,t.tone,c),f(t),m===`progress`&&e(`AppTimeline`,`items[].status`,t.status,Object.keys(u));let x=m===`progress`,S=m===`steps`,C=h===`horizontal`,w=g??(S?`bulk`:void 0),T=typeof _==`string`&&l.includes(_)?_:`md`,E=typeof _==`number`&&_>0?_:void 0,D=!E&&T!==`md`?` wui-timeline--${T}`:``,O=`${S?`timeline wui-timeline--steps${h===`vertical`?` wui-timeline--steps-vertical`:``}`:`timeline${x?` timeline--progress`:``}${C?` timeline--horizontal`:``}`}${D}${v?` ${v}`:``}`,k=S?E?Math.round(E*.43):{sm:19,md:24,lg:31}[T]:E?Math.round(E*.54):x?{sm:10,md:13,lg:17}[T]:{sm:10,md:12,lg:17}[T];return r(`ol`,{className:O,style:E?{...y,"--wui-timeline-dot":`${E}px`}:y,...b,children:d.map((e,t)=>{let a=e.tone&&e.tone!==`neutral`?` ${e.tone}`:``;if(S){let o=e.eyebrow??`Step ${t+1}`;return i(`li`,{className:`timeline-item${a}`,children:[r(`span`,{className:`timeline-dot`,children:e.icon?r(n,{name:e.icon,size:k,variant:w}):null}),i(`div`,{className:`timeline-body`,children:[o!==``&&r(`div`,{className:`wui-timeline-eyebrow`,children:o}),r(`div`,{className:`timeline-title`,children:e.title}),e.description&&r(`div`,{className:`timeline-desc`,children:e.description})]})]},e.key??`${e.at}-${t}`)}let o=x?e.status:void 0,s=o?` is-${o}`:``,c=x?e.icon??(o?u[o]:void 0):e.icon||`circle`;return i(`li`,{className:`timeline-item${s}${a}`,children:[r(`span`,{className:`timeline-dot`,children:c?r(n,{name:c,size:k,variant:w}):null}),i(`div`,{className:`timeline-body`,children:[x?i(`div`,{className:`timeline-head`,children:[r(`div`,{className:`timeline-title`,children:e.title}),(e.at||e.time)&&i(`span`,{className:`timeline-when`,children:[e.at&&r(`span`,{className:`timeline-at`,title:e.atTitle||void 0,children:e.at}),e.time&&r(`span`,{className:`timeline-time`,children:e.time})]})]}):r(`div`,{className:`timeline-title`,children:e.title}),e.description&&r(`div`,{className:`timeline-desc`,children:e.description}),!x&&(e.at||e.time||e.by)&&i(`div`,{className:`timeline-meta`,children:[(e.at||e.time)&&i(`span`,{className:`timeline-when`,children:[e.at&&r(`span`,{className:`timeline-at`,title:e.atTitle||void 0,children:e.at}),e.time&&r(`span`,{className:`timeline-time`,children:e.time})]}),e.by&&r(`span`,{className:`timeline-by`,children:p(e)})]}),x&&e.by&&r(`div`,{className:`timeline-meta`,children:r(`span`,{className:`timeline-by`,children:p(e)})}),e.note&&r(`p`,{className:`timeline-note`,children:e.note})]})]},e.key??`${e.at}-${t}`)})})}export{m as default};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A chronological activity feed OR a status-progress tracker.
2
+ * A chronological activity feed, a status-progress tracker, or a numbered process.
3
3
  *
4
4
  * - `variant="feed"` (default) — an audit trail / sign-off history / status log.
5
5
  * Each entry is a toned dot on a continuous vertical rail, with a title, a
@@ -10,39 +10,43 @@
10
10
  * or a hollow ring (upcoming); the rail is drawn per segment so the path
11
11
  * between two completed steps reads as filled. The timestamp is pinned to the
12
12
  * top-right of the step.
13
+ * - `variant="steps"` — a numbered process: large tinted icon discs joined by a dashed line, each with an eyebrow, title and description. A row from md up, a column on phones.
13
14
  *
14
15
  * The rail is drawn so it cannot break into disconnected segments when an entry
15
16
  * wraps to two lines — the failure that makes most hand-rolled timelines look
16
17
  * broken with real data.
17
18
  *
18
19
  * @param {object} props
19
- * @param {{ key?: string, icon?: string,
20
+ * @param {{ key?: string, icon?: string, eyebrow?: import('react').ReactNode,
20
21
  * tone?: 'neutral'|'success'|'warning'|'danger'|'info',
21
22
  * status?: 'upcoming'|'current'|'done'|'on-hold'|'rejected'|'cancelled'|'skipped',
22
23
  * title: import('react').ReactNode, description?: import('react').ReactNode,
23
24
  * at?: string, atTitle?: string, time?: string, by?: string, byHref?: string, note?: string }[]} props.items
24
- * Feed variant: newest first. Progress variant: first stage first.
25
+ * Feed variant: newest first. Progress variant: first stage first. Steps variant: first step first.
25
26
  * `status` drives the dot + rail in the progress variant; `description` is a
26
27
  * plain inline subtext under the title (distinct from the boxed `note`).
28
+ * Steps variant: the label above the title; omitted it reads `Step 1`, `Step 2`…, an empty string hides it.
27
29
  * `at` is the date and `time` an optional time-of-day shown beside it — both are
28
30
  * pre-formatted strings the caller owns (IST, DD-MMM-YYYY / HH:mm); pass either or both.
29
31
  * `atTitle` is the full date and time shown on hover over `at`, such as `14 Oct 2026, 4:05 pm`; omit it for no tooltip.
30
32
  * `byHref` links the `by` name (a path starting with one `/`, or an `http://` / `https://` address);
31
33
  * any other value, or `byHref` without `by`, throws.
32
- * @param {'feed'|'progress'} [props.variant] Layout mode. Defaults to `feed`.
33
- * @param {'vertical'|'horizontal'} [props.orientation] Rail direction — vertical (default) stacks
34
- * items top-to-bottom; horizontal lays dots in a row with the body beneath each. Orthogonal to
35
- * `variant`, so both feed and progress can run horizontally.
36
- * @param {number} [props.size] Dot diameter in px (default 24). The rail, halo
37
- * and glyph scale from it, so the whole timeline grows/shrinks in proportion.
34
+ * @param {'feed'|'progress'|'steps'} [props.variant] Layout mode. Defaults to `feed`.
35
+ * `steps`: a numbered process: large tinted icon discs joined by a dashed line, each with an eyebrow, title and description. A row from md up, a column on phones.
36
+ * @param {'vertical'|'horizontal'} [props.orientation] Feed and progress: vertical (default) or horizontal.
37
+ * Steps: a row from md up and a column below; `vertical` keeps the column at every width.
38
+ * Horizontal lays dots in a row with the body beneath each. Orthogonal to `variant` for feed and progress.
39
+ * @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant] The iconsax style of the dot icons. Defaults to bulk for steps and linear otherwise.
40
+ * @param {'sm'|'md'|'lg'|number} [props.size] A preset, or the dot diameter in px. sm, md (default) and lg set the dot (feed and progress 18, 24 and 32px; steps 44, 56 and 72px) and scale the text and spacing to match. A px number sets only the dot, and the glyph follows it.
38
41
  * @param {string} [props.className]
39
42
  * @param {import('react').CSSProperties} [props.style] Inline style on the list;
40
43
  * the `size` var is merged into it.
41
44
  */
42
- export default function AppTimeline({ items, variant, orientation, size, className, style, ...rest }: {
45
+ export default function AppTimeline({ items, variant, orientation, iconVariant, size, className, style, ...rest }: {
43
46
  items: {
44
47
  key?: string;
45
48
  icon?: string;
49
+ eyebrow?: import('react').ReactNode;
46
50
  tone?: 'neutral' | 'success' | 'warning' | 'danger' | 'info';
47
51
  status?: 'upcoming' | 'current' | 'done' | 'on-hold' | 'rejected' | 'cancelled' | 'skipped';
48
52
  title: import('react').ReactNode;
@@ -54,9 +58,10 @@ export default function AppTimeline({ items, variant, orientation, size, classNa
54
58
  byHref?: string;
55
59
  note?: string;
56
60
  }[];
57
- variant?: 'feed' | 'progress';
61
+ variant?: 'feed' | 'progress' | 'steps';
58
62
  orientation?: 'vertical' | 'horizontal';
59
- size?: number;
63
+ iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
64
+ size?: 'sm' | 'md' | 'lg' | number;
60
65
  className?: string;
61
66
  style?: import('react').CSSProperties;
62
67
  }): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.77.2",
3
+ "version": "0.78.0",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@webority/theme": "0.77.2",
31
- "@webority/ui-elements": "0.77.2"
30
+ "@webority/theme": "0.78.0",
31
+ "@webority/ui-elements": "0.78.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@webority/analytics": "^0.23.0",