@tedi-design-system/react 19.0.0-rc.15 → 19.0.0-rc.17
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/bundle-stats.html +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +4 -3
- package/src/tedi/components/form/time-picker/time-picker.cjs.js +1 -1
- package/src/tedi/components/form/time-picker/time-picker.es.js +1 -1
- package/src/tedi/components/misc/timeline/timeline.cjs.js +1 -1
- package/src/tedi/components/misc/timeline/timeline.es.js +24 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.0.0-rc.
|
|
3
|
+
"version": "19.0.0-rc.17",
|
|
4
4
|
"description": "TEDI Design System React component library — accessible, reusable UI components. Docs & live examples: https://storybook.tedi.ee/react/rc/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
117
117
|
"eslint-plugin-prettier": "^4.2.1",
|
|
118
118
|
"eslint-plugin-react": "^7.32.2",
|
|
119
|
-
"eslint-plugin-react-hooks": "^
|
|
119
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
120
120
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
121
121
|
"eslint-plugin-storybook": "^10.4.6",
|
|
122
122
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
@@ -186,6 +186,7 @@
|
|
|
186
186
|
"access": "public"
|
|
187
187
|
},
|
|
188
188
|
"overrides": {
|
|
189
|
-
"dayjs": "$dayjs"
|
|
189
|
+
"dayjs": "$dayjs",
|
|
190
|
+
"eslint-plugin-react-hooks": "$eslint-plugin-react-hooks"
|
|
190
191
|
}
|
|
191
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),n=require("react"),t=require("../time-field/time-field-helpers.cjs.js"),H=require("./components/time-grid/time-grid.cjs.js"),x=require("./components/time-wheel/time-wheel.cjs.js"),T=({value:s,defaultValue:f="",onChange:r,stepMinutes:o=1,availableTimes:i,gridVariant:h="button",className:u,bordered:c=!0})=>{const[j,P]=n.useState(f),l=s!==void 0,m=l?s:j,d=e=>{l||P(e),r==null||r(e)},a=n.useMemo(t.generateHours,[]),q=n.useMemo(()=>t.generateMinutes(o),[o]),{hour:y,minute:S}=t.parseTime(m||"12:00"),g=a.includes(y)?y:"12",k=t.findClosestMinute(S,q);return Array.isArray(i)&&i.length>0?M.jsx(H.TimeGrid,{times:i,value:m,variant:h,onSelect:d,className:u,bordered:c}):M.jsx(x.TimeWheel,{hours:a,minutes:q,selectedHour:g,selectedMinute:k,onChange:(e,p)=>d(`${e}:${p}`),className:u,bordered:c})};T.displayName="TimePicker";exports.TimePicker=T;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),n=require("react"),t=require("../time-field/time-field-helpers.cjs.js"),H=require("./components/time-grid/time-grid.cjs.js"),x=require("./components/time-wheel/time-wheel.cjs.js"),T=({value:s,defaultValue:f="",onChange:r,stepMinutes:o=1,availableTimes:i,gridVariant:h="button",className:u,bordered:c=!0})=>{const[j,P]=n.useState(f),l=s!==void 0,m=l?s:j,d=e=>{l||P(e),r==null||r(e)},a=n.useMemo(()=>t.generateHours(),[]),q=n.useMemo(()=>t.generateMinutes(o),[o]),{hour:y,minute:S}=t.parseTime(m||"12:00"),g=a.includes(y)?y:"12",k=t.findClosestMinute(S,q);return Array.isArray(i)&&i.length>0?M.jsx(H.TimeGrid,{times:i,value:m,variant:h,onSelect:d,className:u,bordered:c}):M.jsx(x.TimeWheel,{hours:a,minutes:q,selectedHour:g,selectedMinute:k,onChange:(e,p)=>d(`${e}:${p}`),className:u,bordered:c})};T.displayName="TimePicker";exports.TimePicker=T;
|
|
@@ -15,7 +15,7 @@ const I = ({
|
|
|
15
15
|
}) => {
|
|
16
16
|
const [M, T] = S.useState(h), c = o !== void 0, m = c ? o : M, u = (t) => {
|
|
17
17
|
c || T(t), e == null || e(t);
|
|
18
|
-
}, f = a(_, []), l = a(() => $(n), [n]), { hour: d, minute: k } = g(m || "12:00"), A = f.includes(d) ? d : "12", H = j(k, l);
|
|
18
|
+
}, f = a(() => _(), []), l = a(() => $(n), [n]), { hour: d, minute: k } = g(m || "12:00"), A = f.includes(d) ? d : "12", H = j(k, l);
|
|
19
19
|
return Array.isArray(r) && r.length > 0 ? /* @__PURE__ */ p(
|
|
20
20
|
x,
|
|
21
21
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),v=require("../../../../../external/classnames/index.cjs.js"),s=require("react"),D=require("./components/timeline-description/timeline-description.cjs.js"),p=require("./components/timeline-item/timeline-item.cjs.js"),E=require("./components/timeline-title/timeline-title.cjs.js"),a=require("./timeline.module.scss.cjs.js"),d=e=>s.isValidElement(e)&&e.type===p.TimelineItem,I=(e,i)=>i===void 0?"future":e===i?"current":e<i?"past":"future",r=({children:e,activeIndex:i,variant:l="default",cardPadding:o,className:f})=>{const m=s.Children.toArray(e),u=m.flatMap((t,n)=>d(t)?[n]:[]),T=u.length,y=new Map(u.map((t,n)=>[t,n])),q=m.map((t,n)=>{if(!d(t))return t;const c=y.get(n)??0;return s.cloneElement(t,{state:I(c,i),isLast:c===T-1})}),g=l==="card"&&o!==void 0?{"--tedi-timeline-card-padding":`${o}rem`}:void 0;return j.jsx("div",{className:v.default(a.default["tedi-timeline"],{[a.default["tedi-timeline--card"]]:l==="card"},f),style:g,children:q})};r.displayName="Timeline";r.Item=p.TimelineItem;r.Title=E.TimelineTitle;r.Description=D.TimelineDescription;exports.Timeline=r;
|
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Children as
|
|
4
|
-
import { TimelineDescription as
|
|
5
|
-
import { TimelineItem as
|
|
6
|
-
import { TimelineTitle as
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
|
+
import g from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { Children as v, cloneElement as A, isValidElement as C } from "react";
|
|
4
|
+
import { TimelineDescription as D } from "./components/timeline-description/timeline-description.es.js";
|
|
5
|
+
import { TimelineItem as f } from "./components/timeline-item/timeline-item.es.js";
|
|
6
|
+
import { TimelineTitle as M } from "./components/timeline-title/timeline-title.es.js";
|
|
7
7
|
import p from "./timeline.module.scss.es.js";
|
|
8
|
-
const
|
|
9
|
-
children:
|
|
10
|
-
activeIndex:
|
|
8
|
+
const c = (t) => C(t) && t.type === f, h = (t, i) => i === void 0 ? "future" : t === i ? "current" : t < i ? "past" : "future", o = ({
|
|
9
|
+
children: t,
|
|
10
|
+
activeIndex: i,
|
|
11
11
|
variant: m = "default",
|
|
12
|
-
cardPadding:
|
|
12
|
+
cardPadding: n,
|
|
13
13
|
className: u
|
|
14
14
|
}) => {
|
|
15
|
-
const c = l.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return N(r, { state: I(s, t), isLast: s === c - 1 });
|
|
22
|
-
}), T = m === "card" && o !== void 0 ? { "--tedi-timeline-card-padding": `${o}rem` } : void 0;
|
|
23
|
-
return /* @__PURE__ */ y(
|
|
15
|
+
const s = v.toArray(t), l = s.flatMap((e, r) => c(e) ? [r] : []), d = l.length, y = new Map(l.map((e, r) => [e, r])), T = s.map((e, r) => {
|
|
16
|
+
if (!c(e)) return e;
|
|
17
|
+
const a = y.get(r) ?? 0;
|
|
18
|
+
return A(e, { state: h(a, i), isLast: a === d - 1 });
|
|
19
|
+
}), E = m === "card" && n !== void 0 ? { "--tedi-timeline-card-padding": `${n}rem` } : void 0;
|
|
20
|
+
return /* @__PURE__ */ N(
|
|
24
21
|
"div",
|
|
25
22
|
{
|
|
26
|
-
className:
|
|
27
|
-
style:
|
|
28
|
-
children:
|
|
23
|
+
className: g(p["tedi-timeline"], { [p["tedi-timeline--card"]]: m === "card" }, u),
|
|
24
|
+
style: E,
|
|
25
|
+
children: T
|
|
29
26
|
}
|
|
30
27
|
);
|
|
31
28
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
o.displayName = "Timeline";
|
|
30
|
+
o.Item = f;
|
|
31
|
+
o.Title = M;
|
|
32
|
+
o.Description = D;
|
|
36
33
|
export {
|
|
37
|
-
|
|
34
|
+
o as Timeline
|
|
38
35
|
};
|