@adamosuiteservices/ui 2.19.2 → 2.19.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.
- package/dist/styles.css +1 -1
- package/dist/timeline.cjs +2 -2
- package/dist/timeline.js +20 -20
- package/docs/components/ui/timeline.md +6 -1
- package/package.json +1 -1
package/dist/timeline.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-BB_1_6y_.cjs"),a=require("./index-DoxiiusW.cjs"),R=require("./index-DCsgSkBj.cjs"),E=require("react");function T(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const s=T(E),d=s.createContext({orientation:"vertical",scrollable:!1}),l=s.createContext({status:"pending"}),v=s.createContext(!1);function C({className:t,orientation:e="vertical",responsive:n=!0,children:r,...m}){const o=R.useMediaQuery("(max-width: 639px)"),c=e==="horizontal"&&n&&o?"vertical":e,u=e==="horizontal"&&!n,p=s.Children.toArray(r),f=i.jsxRuntimeExports.jsx("ol",{"data-slot":"timeline","data-orientation":c,className:a.cn("adm:flex",c==="vertical"?"adm:flex-col":"adm:flex-row adm:items-start",t),...m,children:p.map((x,j)=>{if(!s.isValidElement(x))return x;const b=p[j-1],h=s.isValidElement(b)?b.props.status??"pending":"pending";return i.jsxRuntimeExports.jsx(v.Provider,{value:h==="complete",children:x},j)})});return i.jsxRuntimeExports.jsx(d.Provider,{value:{orientation:c,scrollable:u},children:u?i.jsxRuntimeExports.jsx("div",{className:"adm:w-full adm:overflow-x-auto",children:f}):f})}function y({className:t,status:e="pending",...n}){const{orientation:r,scrollable:m}=s.useContext(d);return i.jsxRuntimeExports.jsx(l.Provider,{value:{status:e},children:i.jsxRuntimeExports.jsx("li",{"data-slot":"timeline-item","data-status":e,className:a.cn("adm:group adm:relative",r==="vertical"?"adm:flex adm:gap-4":a.cn("adm:flex adm:flex-1 adm:flex-col adm:items-center",m&&"adm:min-w-28"),t),...n})})}function g(){const{status:t}=s.useContext(l),e=t==="complete",n=t==="active";return i.jsxRuntimeExports.jsxs("div",{"data-slot":"timeline-dot",className:a.cn("adm:relative adm:flex adm:size-5 adm:shrink-0 adm:items-center","adm:justify-center","adm:rounded-full adm:border","adm:transition-[color,box-shadow,background-color,border-color]",e&&"adm:border-primary adm:bg-primary",n&&"adm:border-primary adm:bg-background",!n&&!e&&"adm:border-border adm:bg-background"),children:[n&&i.jsxRuntimeExports.jsx("span",{className:"adm:size-2 adm:rounded-full adm:bg-primary"}),e&&i.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 12 12",className:"adm:size-3",fill:"none","aria-hidden":!0,children:i.jsxRuntimeExports.jsx("path",{d:"M2 6l3 3 5-5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function N({className:t,...e}){const{orientation:n}=s.useContext(d),{status:r}=s.useContext(l),m=s.useContext(v),o=r==="complete";return n==="vertical"?i.jsxRuntimeExports.jsxs("div",{"data-slot":"timeline-indicator",className:a.cn("adm:flex adm:shrink-0 adm:flex-col adm:items-center",t),...e,children:[i.jsxRuntimeExports.jsx(g,{}),i.jsxRuntimeExports.jsx("div",{className:a.cn("adm:my-1 adm:min-h-4 adm:w-px adm:flex-1","adm:group-last:hidden",o?"adm:bg-primary":"adm:bg-border")})]}):i.jsxRuntimeExports.jsxs("div",{"data-slot":"timeline-indicator",className:a.cn("adm:flex adm:w-full adm:items-center",t),...e,children:[i.jsxRuntimeExports.jsx("div",{className:a.cn("adm:h-px adm:flex-1","adm:group-first:invisible",m?"adm:bg-primary":"adm:bg-border")}),i.jsxRuntimeExports.jsx("div",{className:"adm:mx-1",children:i.jsxRuntimeExports.jsx(g,{})}),i.jsxRuntimeExports.jsx("div",{className:a.cn("adm:h-px adm:flex-1","adm:group-last:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-BB_1_6y_.cjs"),a=require("./index-DoxiiusW.cjs"),R=require("./index-DCsgSkBj.cjs"),E=require("react");function T(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const s=T(E),d=s.createContext({orientation:"vertical",scrollable:!1}),l=s.createContext({status:"pending"}),v=s.createContext(!1);function C({className:t,orientation:e="vertical",responsive:n=!0,children:r,...m}){const o=R.useMediaQuery("(max-width: 639px)"),c=e==="horizontal"&&n&&o?"vertical":e,u=e==="horizontal"&&!n,p=s.Children.toArray(r),f=i.jsxRuntimeExports.jsx("ol",{"data-slot":"timeline","data-orientation":c,className:a.cn("adm:flex",c==="vertical"?"adm:flex-col":"adm:flex-row adm:items-start",t),...m,children:p.map((x,j)=>{if(!s.isValidElement(x))return x;const b=p[j-1],h=s.isValidElement(b)?b.props.status??"pending":"pending";return i.jsxRuntimeExports.jsx(v.Provider,{value:h==="complete",children:x},j)})});return i.jsxRuntimeExports.jsx(d.Provider,{value:{orientation:c,scrollable:u},children:u?i.jsxRuntimeExports.jsx("div",{className:"adm:w-full adm:overflow-x-auto",children:f}):f})}function y({className:t,status:e="pending",...n}){const{orientation:r,scrollable:m}=s.useContext(d);return i.jsxRuntimeExports.jsx(l.Provider,{value:{status:e},children:i.jsxRuntimeExports.jsx("li",{"data-slot":"timeline-item","data-status":e,className:a.cn("adm:group adm:relative",r==="vertical"?"adm:flex adm:gap-4":a.cn("adm:flex adm:flex-1 adm:flex-col adm:items-center",m&&"adm:min-w-28"),t),...n})})}function g(){const{status:t}=s.useContext(l),e=t==="complete",n=t==="active";return i.jsxRuntimeExports.jsxs("div",{"data-slot":"timeline-dot",className:a.cn("adm:relative adm:flex adm:size-5 adm:shrink-0 adm:items-center","adm:justify-center","adm:rounded-full adm:border","adm:transition-[color,box-shadow,background-color,border-color]",e&&"adm:border-primary adm:bg-primary",n&&"adm:border-primary adm:bg-background",!n&&!e&&"adm:border-border adm:bg-background"),children:[n&&i.jsxRuntimeExports.jsx("span",{className:"adm:size-2 adm:rounded-full adm:bg-primary"}),e&&i.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 12 12",className:"adm:size-3",fill:"none","aria-hidden":!0,children:i.jsxRuntimeExports.jsx("path",{d:"M2 6l3 3 5-5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function N({className:t,...e}){const{orientation:n}=s.useContext(d),{status:r}=s.useContext(l),m=s.useContext(v),o=r==="complete";return n==="vertical"?i.jsxRuntimeExports.jsxs("div",{"data-slot":"timeline-indicator",className:a.cn("adm:flex adm:shrink-0 adm:flex-col adm:items-center",t),...e,children:[i.jsxRuntimeExports.jsx(g,{}),i.jsxRuntimeExports.jsx("div",{className:a.cn("adm:my-1 adm:min-h-4 adm:w-px adm:flex-1","adm:group-last:hidden",o?"adm:bg-primary":"adm:bg-border")})]}):i.jsxRuntimeExports.jsxs("div",{"data-slot":"timeline-indicator",className:a.cn("adm:flex adm:w-full adm:items-center",t),...e,children:[i.jsxRuntimeExports.jsx("div",{className:a.cn("adm:h-px adm:flex-1","adm:group-first:invisible",m?"adm:bg-primary":"adm:bg-border")}),i.jsxRuntimeExports.jsx("div",{className:"adm:mx-1",children:i.jsxRuntimeExports.jsx(g,{})}),i.jsxRuntimeExports.jsx("div",{className:a.cn("adm:h-px adm:flex-1","adm:group-last:invisible",o?"adm:bg-primary":"adm:bg-border")})]})}function w({className:t,...e}){const{orientation:n}=s.useContext(d),{status:r}=s.useContext(l);return i.jsxRuntimeExports.jsx("div",{"data-slot":"timeline-content",className:a.cn("adm:flex adm:flex-col adm:gap-3",n==="vertical"?`
|
|
2
2
|
adm:min-w-0 adm:flex-1 adm:pb-4
|
|
3
3
|
adm:group-last:pb-0
|
|
4
|
-
`:"adm:items-center adm:pt-3",r==="pending"?"adm:text-disabled-foreground":"adm:text-foreground",t),...e})}function k({className:t,...e}){return i.jsxRuntimeExports.jsx("p",{"data-slot":"timeline-title",className:a.cn("adm:text-sm adm:leading-5 adm:font-semibold",t),...e})}function O({className:t,...e}){return i.jsxRuntimeExports.jsx("p",{"data-slot":"timeline-description",className:a.cn("adm:text-sm adm:leading-5 adm:font-normal",t),...e})}function z({className:t,...e}){return i.jsxRuntimeExports.jsx("time",{"data-slot":"timeline-time",className:a.cn("adm:text-xs adm:leading-4",t),...e})}exports.Timeline=C;exports.TimelineContent=w;exports.TimelineDescription=O;exports.TimelineIndicator=N;exports.TimelineItem=y;exports.TimelineTime=z;exports.TimelineTitle=k;
|
|
4
|
+
`:"adm:items-center adm:pt-3 adm:text-center",r==="pending"?"adm:text-disabled-foreground":"adm:text-foreground",t),...e})}function k({className:t,...e}){return i.jsxRuntimeExports.jsx("p",{"data-slot":"timeline-title",className:a.cn("adm:text-sm adm:leading-5 adm:font-semibold",t),...e})}function O({className:t,...e}){return i.jsxRuntimeExports.jsx("p",{"data-slot":"timeline-description",className:a.cn("adm:text-sm adm:leading-5 adm:font-normal",t),...e})}function z({className:t,...e}){return i.jsxRuntimeExports.jsx("time",{"data-slot":"timeline-time",className:a.cn("adm:text-xs adm:leading-4",t),...e})}exports.Timeline=C;exports.TimelineContent=w;exports.TimelineDescription=O;exports.TimelineIndicator=N;exports.TimelineItem=y;exports.TimelineTime=z;exports.TimelineTitle=k;
|
package/dist/timeline.js
CHANGED
|
@@ -3,9 +3,9 @@ import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
|
3
3
|
import { c as i } from "./index-CRiPKpXj.js";
|
|
4
4
|
import { u as C } from "./index-BBT2EGq8.js";
|
|
5
5
|
import * as n from "react";
|
|
6
|
-
const o = n.createContext({ orientation: "vertical", scrollable: !1 }), l = n.createContext({ status: "pending" }),
|
|
7
|
-
function w({ className: a, orientation: t = "vertical", responsive:
|
|
8
|
-
const s = C("(max-width: 639px)"), c = t === "horizontal" &&
|
|
6
|
+
const o = n.createContext({ orientation: "vertical", scrollable: !1 }), l = n.createContext({ status: "pending" }), j = n.createContext(!1);
|
|
7
|
+
function w({ className: a, orientation: t = "vertical", responsive: m = !0, children: d, ...r }) {
|
|
8
|
+
const s = C("(max-width: 639px)"), c = t === "horizontal" && m && s ? "vertical" : t, u = t === "horizontal" && !m, p = n.Children.toArray(d), f = /* @__PURE__ */ e.jsx(
|
|
9
9
|
"ol",
|
|
10
10
|
{
|
|
11
11
|
"data-slot": "timeline",
|
|
@@ -18,15 +18,15 @@ function w({ className: a, orientation: t = "vertical", responsive: d = !0, chil
|
|
|
18
18
|
...r,
|
|
19
19
|
children: p.map((x, b) => {
|
|
20
20
|
if (!n.isValidElement(x)) return x;
|
|
21
|
-
const v = p[b - 1],
|
|
22
|
-
return /* @__PURE__ */ e.jsx(
|
|
21
|
+
const v = p[b - 1], h = n.isValidElement(v) ? v.props.status ?? "pending" : "pending";
|
|
22
|
+
return /* @__PURE__ */ e.jsx(j.Provider, { value: h === "complete", children: x }, b);
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
return /* @__PURE__ */ e.jsx(o.Provider, { value: { orientation: c, scrollable: u }, children: u ? /* @__PURE__ */ e.jsx("div", { className: "adm:w-full adm:overflow-x-auto", children: f }) : f });
|
|
27
27
|
}
|
|
28
|
-
function k({ className: a, status: t = "pending", ...
|
|
29
|
-
const { orientation:
|
|
28
|
+
function k({ className: a, status: t = "pending", ...m }) {
|
|
29
|
+
const { orientation: d, scrollable: r } = n.useContext(o);
|
|
30
30
|
return /* @__PURE__ */ e.jsx(l.Provider, { value: { status: t }, children: /* @__PURE__ */ e.jsx(
|
|
31
31
|
"li",
|
|
32
32
|
{
|
|
@@ -34,18 +34,18 @@ function k({ className: a, status: t = "pending", ...d }) {
|
|
|
34
34
|
"data-status": t,
|
|
35
35
|
className: i(
|
|
36
36
|
"adm:group adm:relative",
|
|
37
|
-
|
|
37
|
+
d === "vertical" ? "adm:flex adm:gap-4" : i(
|
|
38
38
|
"adm:flex adm:flex-1 adm:flex-col adm:items-center",
|
|
39
39
|
r && "adm:min-w-28"
|
|
40
40
|
),
|
|
41
41
|
a
|
|
42
42
|
),
|
|
43
|
-
...
|
|
43
|
+
...m
|
|
44
44
|
}
|
|
45
45
|
) });
|
|
46
46
|
}
|
|
47
47
|
function g() {
|
|
48
|
-
const { status: a } = n.useContext(l), t = a === "complete",
|
|
48
|
+
const { status: a } = n.useContext(l), t = a === "complete", m = a === "active";
|
|
49
49
|
return /* @__PURE__ */ e.jsxs(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
@@ -56,11 +56,11 @@ function g() {
|
|
|
56
56
|
"adm:rounded-full adm:border",
|
|
57
57
|
"adm:transition-[color,box-shadow,background-color,border-color]",
|
|
58
58
|
t && "adm:border-primary adm:bg-primary",
|
|
59
|
-
|
|
60
|
-
!
|
|
59
|
+
m && "adm:border-primary adm:bg-background",
|
|
60
|
+
!m && !t && "adm:border-border adm:bg-background"
|
|
61
61
|
),
|
|
62
62
|
children: [
|
|
63
|
-
|
|
63
|
+
m && /* @__PURE__ */ e.jsx("span", { className: "adm:size-2 adm:rounded-full adm:bg-primary" }),
|
|
64
64
|
t && /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 12 12", className: "adm:size-3", fill: "none", "aria-hidden": !0, children: /* @__PURE__ */ e.jsx(
|
|
65
65
|
"path",
|
|
66
66
|
{
|
|
@@ -76,8 +76,8 @@ function g() {
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
function z({ className: a, ...t }) {
|
|
79
|
-
const { orientation:
|
|
80
|
-
return
|
|
79
|
+
const { orientation: m } = n.useContext(o), { status: d } = n.useContext(l), r = n.useContext(j), s = d === "complete";
|
|
80
|
+
return m === "vertical" ? /* @__PURE__ */ e.jsxs(
|
|
81
81
|
"div",
|
|
82
82
|
{
|
|
83
83
|
"data-slot": "timeline-indicator",
|
|
@@ -120,7 +120,7 @@ function z({ className: a, ...t }) {
|
|
|
120
120
|
{
|
|
121
121
|
className: i(
|
|
122
122
|
"adm:h-px adm:flex-1",
|
|
123
|
-
"adm:group-last:
|
|
123
|
+
"adm:group-last:invisible",
|
|
124
124
|
s ? "adm:bg-primary" : "adm:bg-border"
|
|
125
125
|
)
|
|
126
126
|
}
|
|
@@ -130,18 +130,18 @@ function z({ className: a, ...t }) {
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
function A({ className: a, ...t }) {
|
|
133
|
-
const { orientation:
|
|
133
|
+
const { orientation: m } = n.useContext(o), { status: d } = n.useContext(l);
|
|
134
134
|
return /* @__PURE__ */ e.jsx(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
137
137
|
"data-slot": "timeline-content",
|
|
138
138
|
className: i(
|
|
139
139
|
"adm:flex adm:flex-col adm:gap-3",
|
|
140
|
-
|
|
140
|
+
m === "vertical" ? `
|
|
141
141
|
adm:min-w-0 adm:flex-1 adm:pb-4
|
|
142
142
|
adm:group-last:pb-0
|
|
143
|
-
` : "adm:items-center adm:pt-3",
|
|
144
|
-
|
|
143
|
+
` : "adm:items-center adm:pt-3 adm:text-center",
|
|
144
|
+
d === "pending" ? "adm:text-disabled-foreground" : "adm:text-foreground",
|
|
145
145
|
a
|
|
146
146
|
),
|
|
147
147
|
...t
|
|
@@ -198,11 +198,16 @@ Renders as a `<time>` element with `text-xs`. Optional — omit when no timestam
|
|
|
198
198
|
|
|
199
199
|
Each connector segment is split in two halves. The connector below a step (vertical) or the right half of a step (horizontal) is colored by whether **that step itself** is `complete`. The left half of a horizontal step is colored by whether the **previous step** was `complete`. This is managed internally via React context — no extra props are needed.
|
|
200
200
|
|
|
201
|
-
### `group-last:hidden
|
|
201
|
+
### `group-last:invisible`, `group-last:hidden`, and `group-first:invisible`
|
|
202
202
|
|
|
203
203
|
- The vertical connector of the last `TimelineItem` is hidden via `group-last:hidden` so no trailing line appears below the final step.
|
|
204
|
+
- The horizontal right spacer of the last item uses `group-last:invisible` (takes space but is transparent) to keep the last dot center-aligned with the rest.
|
|
204
205
|
- The horizontal left spacer of the first item uses `group-first:invisible` (takes space but is transparent) to keep the first dot center-aligned with the rest.
|
|
205
206
|
|
|
207
|
+
### Horizontal text alignment
|
|
208
|
+
|
|
209
|
+
`TimelineContent` applies `text-center` when `orientation="horizontal"` so that titles, descriptions, and timestamps are centered below each dot.
|
|
210
|
+
|
|
206
211
|
## Accessibility
|
|
207
212
|
|
|
208
213
|
- The container renders as a semantic `<ol>` (ordered list), and each step is an `<li>`.
|