@coreify/tarikh 1.0.1 → 1.0.2
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/LICENSE +21 -21
- package/README.md +477 -384
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.d.cts +11 -1
- package/dist/react.d.ts +11 -1
- package/dist/react.js +1 -1
- package/package.json +94 -92
package/dist/react.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{forwardRef as e,createElement as t}from"react";var n=["0","1","2","3","4","5","6","7","8","9"],r=["০","১","২","৩","৪","৫","৬","৭","৮","৯"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],d=["জানুয়ারি","ফেব্রুয়ারি","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর"],s=["জানু","ফেব্রু","মার্চ","এপ্রি","মে","জুন","জুলা","আগ","সেপ্টে","অক্টো","নভে","ডিসে"],l=["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],c=["রবি","সোম","মঙ্গল","বুধ","বৃহস্পতি","শুক্র","শনি"],m=["বৈশাখ","জ্যৈষ্ঠ","আষাঢ়","শ্রাবণ","ভাদ্র","আশ্বিন","কার্তিক","অগ্রহায়ণ","পৌষ","মাঘ","ফাল্গুন","চৈত্র"],g=["Baishakh","Jaishtho","Asharh","Shrabon","Bhadro","Ashshin","Kartik","Agrahayan","Poush","Magh","Falgun","Chaitra"],h=[31,31,31,31,31,30,30,30,30,30,30,30],f={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",week:"week",weeks:"weeks",month:"month",months:"months",year:"year",years:"years",ago:"ago",in:"in",justNow:"just now"},y={second:"সেকেন্ড",seconds:"সেকেন্ড",minute:"মিনিট",minutes:"মিনিট",hour:"ঘণ্টা",hours:"ঘণ্টা",day:"দিন",days:"দিন",week:"সপ্তাহ",weeks:"সপ্তাহ",month:"মাস",months:"মাস",year:"বছর",years:"বছর",ago:"আগে",in:"",justNow:"এইমাত্র"};function b(e){return String(e).replace(/\d/g,e=>r[Number(e)]??e)}function v(e){return String(e).replace(/[০-৯]/g,e=>{const t=r.indexOf(e);return t>=0?n[t]??e:e})}var w={jan:0,"jan.":0,january:0,"january,":0,feb:1,"feb.":1,february:1,"february,":1,mar:2,"mar.":2,march:2,"march,":2,apr:3,"apr.":3,april:3,"april,":3,may:4,"may,":4,jun:5,"jun.":5,june:5,"june,":5,jul:6,"jul.":6,july:6,"july,":6,aug:7,"aug.":7,august:7,"august,":7,sep:8,sept:8,"sep.":8,"sept.":8,september:8,"september,":8,oct:9,"oct.":9,october:9,"october,":9,nov:10,"nov.":10,november:10,"november,":10,dec:11,"dec.":11,december:11,"december,":11,"জানুয়ারি":0,"জানুয়ারি":0,"ফেব্রুয়ারি":1,"ফেব্রুয়ারি":1,"মার্চ":2,"এপ্রিল":3,"মে":4,"জুন":5,"জুলাই":6,"আগস্ট":7,"অগাস্ট":7,"সেপ্টেম্বর":8,"সেপ্টেম্বার":8,"অক্টোবর":9,"নভেম্বর":10,"নভেম্বার":10,"ডিসেম্বর":11,"ডিসেম্বার":11,"জানু":0,"ফেব্রু":1,"এপ্রি":3,"জুলা":6,"আগ":7,"সেপ্টে":8,"অক্টো":9,"নভে":10,"ডিসে":11};function p(e){const t=e.trim(),n=t.toLowerCase(),r=w[n];if(void 0!==r)return r;for(let e=0;e<o.length;e++)if(o[e].toLowerCase()===n)return e;for(let e=0;e<a.length;e++)if(a[e].toLowerCase()===n)return e;for(let e=0;e<d.length;e++)if(d[e]===t)return e;for(let e=0;e<s.length;e++)if(s[e]===t)return e;return-1}function M(e,t,n,r=0,o=0,a=0,i=0){const u=new Date(e,t,n,r,o,a,i);return u.getFullYear()!==e||u.getMonth()!==t||u.getDate()!==n||u.getHours()!==r||u.getMinutes()!==o||u.getSeconds()!==a||u.getMilliseconds()!==i?null:u}function D(e){return function(e){const t=e.trim().match(/^(\d{4})([-/.])(\d{1,2})\2(\d{1,2})$/);return t?M(Number(t[1]),Number(t[3])-1,Number(t[4])):null}(e)??function(e){const t=e.trim().match(/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:?\d{2})?)$/);if(!t)return null;const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]),a=Number(t[4]??0),i=Number(t[5]??0),u=Number(t[6]??0),d=Number((t[7]??"0").padEnd(3,"0").slice(0,3)),s=t[8];if(void 0===s)return M(n,r-1,o,a,i,u,d);const l=s.match(/^([+-])(\d{2}):?(\d{2})$/),c=l?Number(l[2]):null,m=l?Number(l[3]):null,g="Z"===s?0:l&&null!==c&&null!==m&&c<=23&&m<=59?("+"===l[1]?1:-1)*(60*c+m):null;if(null===g)return null;const h=Date.UTC(n,r-1,o,a,i,u,d)-6e4*g,f=new Date(h),y=new Date(h+6e4*g);return y.getUTCFullYear()!==n||y.getUTCMonth()!==r-1||y.getUTCDate()!==o||y.getUTCHours()!==a||y.getUTCMinutes()!==i||y.getUTCSeconds()!==u||y.getUTCMilliseconds()!==d?null:f}(e)??function(e){const t=e.match(/^(\d{1,2})(?:st|nd|rd|th)?(?:\s+|-)(\S+)(?:\s+|-)(\d{2,4})$/);if(!t)return null;const n=Number(t[1]),r=t[2].replace(/,$/,""),o=t[3],a=p(r);if(-1===a)return null;let i=Number(o);return 2===o.length&&(i+=i>=50?1900:2e3),M(i,a,n)}(e)??function(e){const t=e.match(/^(\S+)\s+(\d{1,2})(?:st|nd|rd|th)?(?:,)?\s+(\d{2,4})$/);if(!t)return null;const n=t[1].replace(/,$/,""),r=Number(t[2]),o=t[3],a=p(n);if(-1===a)return null;let i=Number(o);return 2===o.length&&(i+=i>=50?1900:2e3),M(i,a,r)}(e)}function $(e){if(e instanceof Date){const t=e.getTime();if(Number.isNaN(t))throw new Error(`Invalid date input: ${String(e)}`);return new Date(t)}if("number"==typeof e){if(!Number.isFinite(e))throw new Error(`Invalid date input: ${String(e)}`);const t=new Date(e);if(Number.isNaN(t.getTime()))throw new Error(`Invalid date input: ${String(e)}`);return t}const t=D(v(e).trim());if(!t)throw new Error(`Invalid date input: ${String(e)}`);return t}function S(e,t){const n=$(e),r=n.getFullYear(),o=n.getMonth(),a=n.getDate(),i=new Date(r,3,14),u=o<3||3===o&&a<14,d=u?r-594:r-593,s=function(e,t){const n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.floor((r-n)/864e5)}(u?new Date(r-1,3,14):i,n)+1,l=function(e){const t=[...h];return function(e){return(t=e+594)%4==0&&t%100!=0||t%400==0;var t}(e)&&(t[10]=31),t}(d);let c=s,m=0;for(let e=0;e<l.length;e++){const t=l[e];if(c<=t){m=e;break}c-=t}return{day:c,month:g[m],monthIndex:m+1,year:d}}function N(e){const t=b(e);return 1===e?`${t}লা`:2===e||3===e?`${t}রা`:4===e?`${t}ঠা`:e>=19?`${t}শে`:`${t}ই`}function T(e,t){return"spoken"===(t?.format??"ordinal")?function(e,t="pohela"){switch(e){case 1:return"poyla"===t?"পয়লা":"পহেলা";case 2:return"দোসরা";case 3:return"তেসরা";case 4:return"চৌঠা";default:return N(e)}}(e,t?.variant):N(e)}function Y(e,t){return"2-digit"===t?String(e).padStart(2,"0"):String(e)}function k(e,t,n){const r=Y(e,n);return"bn-BD"===t?b(r):r}function F(e,t,n){if(!t.includes(e))throw new TypeError(`Invalid ${n}: ${e}`)}function j(e,t,n){if("bn-BD"===t)return e<12?"পূর্বাহ্ণ":"অপরাহ্ণ";const r=e<12?"AM":"PM";return n?r.toLowerCase():r}function B(e,t){if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("format() expects an options object");if("pattern"in t&&void 0!==t.pattern){if("mode"in t&&void 0!==t.mode)throw new TypeError("Do not pass `mode` when `pattern` is provided. `pattern` formatting does not use mode.");const n="locale"in t&&void 0!==t.locale?t.locale:"en-BD";return function(e,t,n="en-BD"){const r=$(e),m="bn-BD"===n,g=r.getDate(),h=r.getMonth(),f=r.getFullYear(),y=m?d:o,b=m?s:a,v=m?l:i,w=m?c:u,p=r.getHours(),M=p%12||12,D={dddd:v[r.getDay()],ddd:w[r.getDay()],MMMM:y[h],MMM:b[h],MM:k(h+1,n,"2-digit"),M:k(h+1,n,"numeric"),DD:k(g,n,"2-digit"),D:k(g,n,"numeric"),HH:k(p,n,"2-digit"),H:k(p,n,"numeric"),hh:k(M,n,"2-digit"),h:k(M,n,"numeric"),mm:k(r.getMinutes(),n,"2-digit"),m:k(r.getMinutes(),n,"numeric"),ss:k(r.getSeconds(),n,"2-digit"),s:k(r.getSeconds(),n,"numeric"),A:j(p,n,!1),a:j(p,n,!0),YYYY:k(f,n,"numeric"),YY:k(Number(String(f).slice(-2)),n,"2-digit")},S=/dddd|ddd|MMMM|MMM|MM|M|DD|D|YYYY|YY|HH|H|hh|h|mm|m|ss|s|A|a/g,N=e=>e.replace(S,e=>D[e]);let T="",Y=0;for(;Y<t.length;){const e=t.indexOf("[",Y);if(-1===e){T+=N(t.slice(Y));break}T+=N(t.slice(Y,e));const n=t.indexOf("]",e+1);if(-1===n){T+=t.slice(e);break}T+=t.slice(e+1,n),Y=n+1}return T}(e,t.pattern,n)}if(!("mode"in t)||void 0===t.mode)throw new TypeError("format() expects `mode` or `pattern`");const n=t.mode;switch(n){case"standard":return function(e,t){const n=$(e),r=t?.locale??"en-BD",m=t?.month??"short",g=t?.year??"numeric",h=t?.day??"numeric",f=t?.weekday,y=t?.hour,v=t?.minute,w=t?.second,p=void 0!==y||void 0!==v||void 0!==w,M="bn-BD"===r;F(m,["short","long"],"month format for standard mode"),F(g,["numeric","2-digit"],"year format for standard mode"),F(h,["numeric","2-digit"],"day format for standard mode"),void 0!==f&&F(f,["short","long"],"weekday format for standard mode"),void 0!==y&&F(y,["numeric","2-digit"],"hour format for standard mode"),void 0!==v&&F(v,["numeric","2-digit"],"minute format for standard mode"),void 0!==w&&F(w,["numeric","2-digit"],"second format for standard mode");const D=n.getDate(),S=n.getMonth(),N=n.getFullYear(),T=`${"2-digit"===h?String(D).padStart(2,"0"):String(D)} ${(M?"short"===m?s:d:"short"===m?a:o)[S]} ${"2-digit"===g?String(N).slice(-2):String(N)}`,k=void 0!==f?`${(M?"short"===f?c:l:"short"===f?u:i)[n.getDay()]}, `:"";let B="";if(p){const e=t?.hour12??!1,o=n.getHours(),a=v??(void 0!==w?"2-digit":void 0);B=`${Y(e?o%12||12:o,y??"numeric")}${void 0!==a?`:${Y(n.getMinutes(),a)}`:""}${void 0!==w?`:${Y(n.getSeconds(),w)}`:""}${e?` ${j(o,r,!1)}`:""}`}const C=`${k}${T}${B?`, ${B}`:""}`;return M?b(C):C}(e,t);case"bangla":return function(e,t){const n=t?.locale??"en-BD",r=t?.format??"ordinal",o=t?.variant,a=S(e);if("bn-BD"===n){const e=a.monthIndex-1,t={format:r};return void 0!==o&&(t.variant=o),`${T(a.day,t)} ${m[e]} ${b(a.year)}`}return`${a.day} ${a.month} ${a.year}`}(e,t);case"hybrid":return function(e,t){const n=$(e),r=t?.digits??"en",i=t?.month??"bn",u=t?.year??"en",l=t?.day??r,c=t?.monthFormat??"long";F(r,["en","bn"],"digits language for hybrid mode"),F(i,["en","bn"],"month language for hybrid mode"),F(u,["en","bn"],"year language for hybrid mode"),F(l,["en","bn"],"day language for hybrid mode"),F(c,["short","long"],"month format for hybrid mode");const m=n.getDate(),g=n.getMonth(),h=n.getFullYear(),f="bn"===i?"short"===c?s:d:"short"===c?a:o,y="bn"===l?b(m):String(m),v=f[g],w="bn"===u?b(h):String(h);return`${y} ${v} ${w}`}(e,t);default:throw new TypeError(`Invalid format mode: ${String(n)}`)}}var C=1e3,A=36e5,H=24*A,x=[{threshold:7*H,singular:"week",plural:"weeks"},{threshold:H,singular:"day",plural:"days"},{threshold:A,singular:"hour",plural:"hours"},{threshold:6e4,singular:"minute",plural:"minutes"},{threshold:C,singular:"second",plural:"seconds"}];function E(e,t){return new Date(e,t+1,0).getDate()}function U(e,t){let n=e.getFullYear()-t.getFullYear();const r=function(e,t){const n=e.getFullYear()+t,r=e.getMonth(),o=Math.min(e.getDate(),E(n,r));return new Date(n,r,o,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t,n);return r>e&&(n-=1),n}function I(e,t){let n=12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth());const r=function(e,t){const n=e.getFullYear(),r=e.getMonth()+t,o=n+Math.floor(r/12),a=(r%12+12)%12,i=Math.min(e.getDate(),E(o,a));return new Date(o,a,i,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t,n);return r>e&&(n-=1),n}function J(e,t,n,r,o){const a="bn-BD"===o,i=a?b(e):String(e),u=1===e?t:n;return a?r?`${i} ${u} আগে`:`${i} ${u} পরে`:r?`${i} ${u} ago`:`in ${i} ${u}`}function L(e,t,n){return"bn-BD"===n?"day"===e?t?"গতকাল":"আগামীকাল":"week"===e?t?"গত সপ্তাহে":"আগামী সপ্তাহে":"month"===e?t?"গত মাসে":"আগামী মাসে":t?"গত বছর":"আগামী বছর":"day"===e?t?"yesterday":"tomorrow":"week"===e?t?"last week":"next week":"month"===e?t?"last month":"next month":t?"last year":"next year"}function O(e){return"string"==typeof e&&!/(?:T|\s)\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/i.test(e.trim())&&null!==function(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e.getTime());if("number"==typeof e){const t=new Date(e);return Number.isNaN(t.getTime())?null:t}return D(v(e).trim())}(e)}function Z(e,t){return O(e)?function(e){return`${String(e.getFullYear())}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t):t.toISOString()}var P=e(function({value:e,locale:n,month:r,year:o,day:a,weekday:i,hour:u,minute:d,second:s,hour12:l,srLabel:c,"aria-label":m,...g},h){const f=$(e),y=B(f,{mode:"standard",...{...void 0!==n&&{locale:n},...void 0!==r&&{month:r},...void 0!==o&&{year:o},...void 0!==a&&{day:a},...void 0!==i&&{weekday:i},...void 0!==u&&{hour:u},...void 0!==d&&{minute:d},...void 0!==s&&{second:s},...void 0!==l&&{hour12:l}}}),b=Z(e,f);return t("time",{...g,ref:h,dateTime:b,"aria-label":c??m??y},y)});P.displayName="Tarikh";var R=e(function({value:e,locale:n,numeric:r,srLabel:o,"aria-label":a,...i},u){const d=$(e),s={...void 0!==n&&{locale:n},...void 0!==r&&{numeric:r}},l=function(e,t){const n=$(e),r=t?.locale??"en-BD",o=t?.numeric??"always",a="bn-BD"===r?y:f,i=Date.now()-n.getTime(),u=Math.abs(i),d=i>0,s=new Date,l=n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()&&n.getDate()===s.getDate(),c=d?s:n,m=d?n:s;if(u<C)return a.justNow;if("auto"===o&&l)return function(e){return"bn-BD"===e?"আজ":"today"}(r);const g=U(c,m);if(g>=1){if("auto"===o&&1===g){const e=L("year",d,r);if(null!==e)return e}return J(g,a.year,a.years,d,r)}const h=I(c,m);if(h>=1){if("auto"===o&&1===h){const e=L("month",d,r);if(null!==e)return e}return J(h,a.month,a.months,d,r)}for(const e of x)if(u>=e.threshold){const t=Math.floor(u/e.threshold);if("auto"===o&&1===t&&("day"===e.singular||"week"===e.singular)){const t=L(e.singular,d,r);if(null!==t)return t}return J(t,a[e.singular],a[e.plural],d,r)}return a.justNow}(d,Object.keys(s).length>0?s:void 0),c=Z(e,d);return t("time",{...i,ref:u,dateTime:c,"aria-label":o??a??l},l)});R.displayName="RelativeTime";var W=e(function({value:e,locale:n,format:r,variant:o,srLabel:a,"aria-label":i,...u},d){const s=$(e),l=B(s,{mode:"bangla",...{...void 0!==n&&{locale:n},...void 0!==r&&{format:r},...void 0!==o&&{variant:o}}}),c=Z(e,s);return t("time",{...u,ref:d,dateTime:c,"aria-label":a??i??l},l)});W.displayName="BanglaDate",P.Relative=R,P.Bangla=W;export{P as Tarikh};
|
|
2
|
+
import{forwardRef as e,createElement as t}from"react";var n=["0","1","2","3","4","5","6","7","8","9"],r=["০","১","২","৩","৪","৫","৬","৭","৮","৯"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],s=["জানুয়ারি","ফেব্রুয়ারি","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর"],d=["জানু","ফেব্রু","মার্চ","এপ্রি","মে","জুন","জুলা","আগ","সেপ্টে","অক্টো","নভে","ডিসে"],l=["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],c=["রবি","সোম","মঙ্গল","বুধ","বৃহস্পতি","শুক্র","শনি"],m=["বৈশাখ","জ্যৈষ্ঠ","আষাঢ়","শ্রাবণ","ভাদ্র","আশ্বিন","কার্তিক","অগ্রহায়ণ","পৌষ","মাঘ","ফাল্গুন","চৈত্র"],g=["Baishakh","Jaishtho","Asharh","Shrabon","Bhadro","Ashshin","Kartik","Agrahayan","Poush","Magh","Falgun","Chaitra"],h=[31,31,31,31,31,30,30,30,30,30,30,30],f={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",week:"week",weeks:"weeks",month:"month",months:"months",year:"year",years:"years",ago:"ago",in:"in",justNow:"just now"},y={second:"সেকেন্ড",seconds:"সেকেন্ড",minute:"মিনিট",minutes:"মিনিট",hour:"ঘণ্টা",hours:"ঘণ্টা",day:"দিন",days:"দিন",week:"সপ্তাহ",weeks:"সপ্তাহ",month:"মাস",months:"মাস",year:"বছর",years:"বছর",ago:"আগে",in:"",justNow:"এইমাত্র"};function b(e){return String(e).replace(/\d/g,e=>r[Number(e)]??e)}function $(e){return String(e).replace(/[০-৯]/g,e=>{const t=r.indexOf(e);return t>=0?n[t]??e:e})}var w={jan:0,"jan.":0,january:0,"january,":0,feb:1,"feb.":1,february:1,"february,":1,mar:2,"mar.":2,march:2,"march,":2,apr:3,"apr.":3,april:3,"april,":3,may:4,"may,":4,jun:5,"jun.":5,june:5,"june,":5,jul:6,"jul.":6,july:6,"july,":6,aug:7,"aug.":7,august:7,"august,":7,sep:8,sept:8,"sep.":8,"sept.":8,september:8,"september,":8,oct:9,"oct.":9,october:9,"october,":9,nov:10,"nov.":10,november:10,"november,":10,dec:11,"dec.":11,december:11,"december,":11,"জানুয়ারি":0,"জানুয়ারি":0,"ফেব্রুয়ারি":1,"ফেব্রুয়ারি":1,"মার্চ":2,"এপ্রিল":3,"মে":4,"জুন":5,"জুলাই":6,"আগস্ট":7,"অগাস্ট":7,"সেপ্টেম্বর":8,"সেপ্টেম্বার":8,"অক্টোবর":9,"নভেম্বর":10,"নভেম্বার":10,"ডিসেম্বর":11,"ডিসেম্বার":11,"জানু":0,"ফেব্রু":1,"এপ্রি":3,"জুলা":6,"আগ":7,"সেপ্টে":8,"অক্টো":9,"নভে":10,"ডিসে":11};function p(e){const t=e.trim(),n=t.toLowerCase(),r=w[n];if(void 0!==r)return r;for(let e=0;e<o.length;e++)if(o[e].toLowerCase()===n)return e;for(let e=0;e<a.length;e++)if(a[e].toLowerCase()===n)return e;for(let e=0;e<s.length;e++)if(s[e]===t)return e;for(let e=0;e<d.length;e++)if(d[e]===t)return e;return-1}function v(e){return Number.isFinite(e)&&Math.abs(e)<=864e13}function D(e,t,n,r=0,o=0,a=0,i=0){const u=new Date(0);return u.setUTCFullYear(e,t,n),u.setUTCHours(r,o,a,i),u.getUTCFullYear()!==e||u.getUTCMonth()!==t||u.getUTCDate()!==n||u.getUTCHours()!==r||u.getUTCMinutes()!==o||u.getUTCSeconds()!==a||u.getUTCMilliseconds()!==i?null:u}function M(e,t,n,r=0,o=0,a=0,i=0){return function(e,t,n,r=0,o=0,a=0,i=0){const u=new Date(0);return u.setFullYear(e,t,n),u.setHours(r,o,a,i),u.getFullYear()!==e||u.getMonth()!==t||u.getDate()!==n||u.getHours()!==r||u.getMinutes()!==o||u.getSeconds()!==a||u.getMilliseconds()!==i?null:u}(e,t,n,r,o,a,i)??D(e,t,n,r,o,a,i)}function T(e){if(!/^[+-]?\d+$/.test(e))return null;const t=Number(e);return Number.isInteger(t)?t:null}function N(e){return function(e){const t=e.trim().match(/^([+-]\d{6}|\d{4})([-/.])(\d{1,2})\2(\d{1,2})$/);return t?M(Number(t[1]),Number(t[3])-1,Number(t[4])):null}(e)??function(e){const t=e.trim().match(/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:?\d{2})?)$/);if(!t)return null;const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]),a=Number(t[4]??0),i=Number(t[5]??0),u=Number(t[6]??0),s=Number((t[7]??"0").padEnd(3,"0").slice(0,3)),d=t[8];if(void 0===d)return M(n,r-1,o,a,i,u,s);const l=d.match(/^([+-])(\d{2}):?(\d{2})$/),c=l?Number(l[2]):null,m=l?Number(l[3]):null,g="Z"===d?0:l&&null!==c&&null!==m&&c<=23&&m<=59?("+"===l[1]?1:-1)*(60*c+m):null;if(null===g)return null;const h=D(n,r-1,o,a,i,u,s);if(!h)return null;const f=h.getTime()-6e4*g;if(!v(f))return null;const y=new Date(f),b=new Date(f+6e4*g);return b.getUTCFullYear()!==n||b.getUTCMonth()!==r-1||b.getUTCDate()!==o||b.getUTCHours()!==a||b.getUTCMinutes()!==i||b.getUTCSeconds()!==u||b.getUTCMilliseconds()!==s?null:y}(e)??function(e){const t=e.match(/^(\d{1,2})(?:st|nd|rd|th|লা|রা|ঠা|ই|শে)?(?:\s+|-)(\S+)(?:\s+|-)([+-]\d{6}|\d{4}|\d{2})$/);if(!t)return null;const n=Number(t[1]),r=t[2].replace(/,$/,""),o=t[3],a=p(r);if(-1===a)return null;const i=T(o);if(null===i)return null;let u=i;return o.startsWith("+")||o.startsWith("-")||2!==o.length||(u+=u>=50?1900:2e3),M(u,a,n)}(e)??function(e){const t=e.match(/^(\S+)\s+(\d{1,2})(?:st|nd|rd|th|লা|রা|ঠা|ই|শে)?(?:,)?\s+([+-]\d{6}|\d{4}|\d{2})$/);if(!t)return null;const n=t[1].replace(/,$/,""),r=Number(t[2]),o=t[3],a=p(n);if(-1===a)return null;const i=T(o);if(null===i)return null;let u=i;return o.startsWith("+")||o.startsWith("-")||2!==o.length||(u+=u>=50?1900:2e3),M(u,a,r)}(e)}function S(e,t,n){if(!v(e.getTime())){throw new RangeError(`${"Date input"} is outside the supported range: ${String(t)}`)}return e}function Y(e){if(e instanceof Date){const t=e.getTime();if(Number.isNaN(t))throw new Error(`Invalid date input: ${String(e)}`);return S(new Date(t),e)}if("number"==typeof e){if(!Number.isFinite(e))throw new Error(`Invalid date input: ${String(e)}`);const t=new Date(e);if(Number.isNaN(t.getTime())){if(!v(e))throw new RangeError(`Date input is outside the supported range: ${String(e)}`);throw new Error(`Invalid date input: ${String(e)}`)}return S(t,e)}const t=N($(e).trim());if(!t)throw new Error(`Invalid date input: ${String(e)}`);return S(t,e)}function F(e,t){const n=Y(e),r=n.getFullYear(),o=n.getMonth(),a=n.getDate(),i=new Date(r,3,14),u=o<3||3===o&&a<14,s=u?r-594:r-593,d=function(e,t){const n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.floor((r-n)/864e5)}(u?new Date(r-1,3,14):i,n)+1,l=function(e){const t=[...h];return function(e){return(t=e+594)%4==0&&t%100!=0||t%400==0;var t}(e)&&(t[10]=31),t}(s);let c=d,m=0;for(let e=0;e<l.length;e++){const t=l[e];if(c<=t){m=e;break}c-=t}return{day:c,month:g[m],monthIndex:m+1,year:s}}var j=["Asia/Dhaka","UTC"];function k(e,t){const n=e.find(e=>e.type===t);if(void 0===n)throw new Error(`Missing ${t} part while formatting Hijri date.`);return n.value}function C(e,t){const n=t?.locale??"en-BD",r=t?.timeZone??"Asia/Dhaka";!function(e){if(!j.includes(e))throw new RangeError(`Unsupported Hijri time zone: ${e}. Supported values: ${j.join(", ")}`)}(r);const o=function(e,t,n){const r=function(e){return`${e}-u-ca-islamic-umalqura`}(t),o=new Intl.DateTimeFormat(r,{day:"numeric",month:"numeric",year:"numeric",timeZone:n}).formatToParts(e),a=new Intl.DateTimeFormat(r,{day:"numeric",month:"long",year:"numeric",timeZone:n}).formatToParts(e);return{day:k(o,"day"),month:k(a,"month"),monthIndex:Number($(k(o,"month"))),year:k(o,"year")}}(Y(e),n,r);return"bn-BD"===n?{day:b(o.day),month:o.month,monthIndex:o.monthIndex,year:b(o.year)}:{day:Number($(o.day)),month:o.month,monthIndex:o.monthIndex,year:Number($(o.year))}}function B(e){const t=b(e);return 1===e?`${t}লা`:2===e||3===e?`${t}রা`:4===e?`${t}ঠা`:e>=19?`${t}শে`:`${t}ই`}function H(e){const t=e%100;if(t>=11&&t<=13)return`${e}th`;switch(e%10){case 1:return`${e}st`;case 2:return`${e}nd`;case 3:return`${e}rd`;default:return`${e}th`}}function U(e,t){return"spoken"===(t?.format??"ordinal")?function(e,t="pohela"){switch(e){case 1:return"poyla"===t?"পয়লা":"পহেলা";case 2:return"দোসরা";case 3:return"তেসরা";case 4:return"চৌঠা";default:return B(e)}}(e,t?.variant):B(e)}function I(e,t){return"2-digit"===t?String(e).padStart(2,"0"):String(e)}function x(e,t,n){const r=I(e,n);return"bn-BD"===t?b(r):r}function A(e,t,n){if(!t.includes(e))throw new TypeError(`Invalid ${n}: ${e}`)}function E(e,t,n){if("bn-BD"===t)return e<12?"পূর্বাহ্ণ":"অপরাহ্ণ";const r=e<12?"AM":"PM";return n?r.toLowerCase():r}function Z(e,t){if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("format() expects an options object");if("pattern"in t&&void 0!==t.pattern){if("mode"in t&&void 0!==t.mode)throw new TypeError("Do not pass `mode` when `pattern` is provided. `pattern` formatting does not use mode.");const n="locale"in t&&void 0!==t.locale?t.locale:"en-BD";return function(e,t,n="en-BD"){const r=Y(e),m="bn-BD"===n,g=r.getDate(),h=r.getMonth(),f=r.getFullYear(),y=m?s:o,b=m?d:a,$=m?l:i,w=m?c:u,p=r.getHours(),v=p%12||12,D={dddd:$[r.getDay()],ddd:w[r.getDay()],MMMM:y[h],MMM:b[h],MM:x(h+1,n,"2-digit"),M:x(h+1,n,"numeric"),DD:x(g,n,"2-digit"),D:x(g,n,"numeric"),HH:x(p,n,"2-digit"),H:x(p,n,"numeric"),hh:x(v,n,"2-digit"),h:x(v,n,"numeric"),mm:x(r.getMinutes(),n,"2-digit"),m:x(r.getMinutes(),n,"numeric"),ss:x(r.getSeconds(),n,"2-digit"),s:x(r.getSeconds(),n,"numeric"),A:E(p,n,!1),a:E(p,n,!0),YYYY:x(f,n,"numeric"),YY:x(Number(String(f).slice(-2)),n,"2-digit")},M=/dddd|ddd|MMMM|MMM|MM|M|DD|D|YYYY|YY|HH|H|hh|h|mm|m|ss|s|A|a/g,T=e=>e.replace(M,e=>D[e]);let N="",S=0;for(;S<t.length;){const e=t.indexOf("[",S);if(-1===e){N+=T(t.slice(S));break}N+=T(t.slice(S,e));const n=t.indexOf("]",e+1);if(-1===n){N+=t.slice(e);break}N+=t.slice(e+1,n),S=n+1}return N}(e,t.pattern,n)}if(!("mode"in t)||void 0===t.mode)throw new TypeError("format() expects `mode` or `pattern`");const n=t.mode;switch(n){case"standard":return function(e,t){const n=Y(e),r=t?.locale??"en-BD",m=t?.month??"short",g=t?.year??"numeric",h=t?.day??"numeric",f=t?.weekday,y=t?.hour,$=t?.minute,w=t?.second,p=void 0!==y||void 0!==$||void 0!==w,v="bn-BD"===r;A(m,["short","long"],"month format for standard mode"),A(g,["numeric","2-digit"],"year format for standard mode"),A(h,["numeric","2-digit"],"day format for standard mode"),void 0!==f&&A(f,["short","long"],"weekday format for standard mode"),void 0!==y&&A(y,["numeric","2-digit"],"hour format for standard mode"),void 0!==$&&A($,["numeric","2-digit"],"minute format for standard mode"),void 0!==w&&A(w,["numeric","2-digit"],"second format for standard mode");const D=n.getDate(),M=n.getMonth(),T=n.getFullYear(),N=v?" খ্রিস্টাব্দ":"",S=`${"2-digit"===h?String(D).padStart(2,"0"):v?B(D):H(D)} ${(v?"short"===m?d:s:"short"===m?a:o)[M]} ${"2-digit"===g?String(T).slice(-2):String(T)}${N}`,F=void 0!==f?`${(v?"short"===f?c:l:"short"===f?u:i)[n.getDay()]}, `:"";let j="";if(p){const e=t?.hour12??!1,o=n.getHours(),a=$??(void 0!==w?"2-digit":void 0);j=`${I(e?o%12||12:o,y??"numeric")}${void 0!==a?`:${I(n.getMinutes(),a)}`:""}${void 0!==w?`:${I(n.getSeconds(),w)}`:""}${e?` ${E(o,r,!1)}`:""}`}const k=`${F}${S}${j?`, ${j}`:""}`;return v?b(k):k}(e,t);case"bangla":return function(e,t){const n=t?.locale??"en-BD",r=t?.format??"ordinal",o=t?.variant,a=F(e);if("bn-BD"===n){const e=a.monthIndex-1,t={format:r};return void 0!==o&&(t.variant=o),`${U(a.day,t)} ${m[e]} ${b(a.year)} বঙ্গাব্দ`}return`${H(a.day)} ${a.month} ${a.year}`}(e,t);case"hijri":return function(e,t){const n=t?.locale??"en-BD",r=t?.timeZone;if("bn-BD"===n){const t={locale:n};void 0!==r&&(t.timeZone=r);const o=C(e,t),a=b(o.year);return`${function(e){const t=b(e);return 1===e?`${t}লা`:2===e?`${t}রা`:`${t}ই`}(Number($(o.day)))} ${o.month} ${a} হিজরি`}const o={locale:n};void 0!==r&&(o.timeZone=r);const a=C(e,o);return`${H(a.day)} ${a.month} ${a.year} AH`}(e,t);case"hybrid":return function(e,t){const n=Y(e),r=t?.digits??"en",i=t?.month??"bn",u=t?.year??"en",l=t?.day??r,c=t?.monthFormat??"long";A(r,["en","bn"],"digits language for hybrid mode"),A(i,["en","bn"],"month language for hybrid mode"),A(u,["en","bn"],"year language for hybrid mode"),A(l,["en","bn"],"day language for hybrid mode"),A(c,["short","long"],"month format for hybrid mode");const m=n.getDate(),g=n.getMonth(),h=n.getFullYear(),f="bn"===i?"short"===c?d:s:"short"===c?a:o,y="bn"===l?b(m):String(m),$=f[g],w="bn"===u?b(h):String(h);return`${y} ${$} ${w}`}(e,t);default:throw new TypeError(`Invalid format mode: ${String(n)}`)}}var L=1e3,J=36e5,O=24*J,W=[{threshold:7*O,singular:"week",plural:"weeks"},{threshold:O,singular:"day",plural:"days"},{threshold:J,singular:"hour",plural:"hours"},{threshold:6e4,singular:"minute",plural:"minutes"},{threshold:L,singular:"second",plural:"seconds"}];function R(e,t){return new Date(e,t+1,0).getDate()}function P(e,t){let n=e.getFullYear()-t.getFullYear();const r=function(e,t){const n=e.getFullYear()+t,r=e.getMonth(),o=Math.min(e.getDate(),R(n,r));return new Date(n,r,o,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t,n);return r>e&&(n-=1),n}function q(e,t){let n=12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth());const r=function(e,t){const n=e.getFullYear(),r=e.getMonth()+t,o=n+Math.floor(r/12),a=(r%12+12)%12,i=Math.min(e.getDate(),R(o,a));return new Date(o,a,i,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t,n);return r>e&&(n-=1),n}function z(e,t,n,r,o){const a="bn-BD"===o,i=a?b(e):String(e),u=1===e?t:n;return a?r?`${i} ${u} আগে`:`${i} ${u} পরে`:r?`${i} ${u} ago`:`in ${i} ${u}`}function K(e,t,n){return"bn-BD"===n?"day"===e?t?"গতকাল":"আগামীকাল":"week"===e?t?"গত সপ্তাহে":"আগামী সপ্তাহে":"month"===e?t?"গত মাসে":"আগামী মাসে":t?"গত বছর":"আগামী বছর":"day"===e?t?"yesterday":"tomorrow":"week"===e?t?"last week":"next week":"month"===e?t?"last month":"next month":t?"last year":"next year"}function G(e){return"string"==typeof e&&!/(?:T|\s)\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/i.test(e.trim())&&null!==function(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e.getTime());if("number"==typeof e){const t=new Date(e);return Number.isNaN(t.getTime())?null:t}return N($(e).trim())}(e)}function Q(e,t){return G(e)?function(e){return`${String(e.getFullYear())}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t):t.toISOString()}var V=e(function({value:e,locale:n,month:r,year:o,day:a,weekday:i,hour:u,minute:s,second:d,hour12:l,srLabel:c,"aria-label":m,...g},h){const f=Y(e),y=Z(f,{mode:"standard",...{...void 0!==n&&{locale:n},...void 0!==r&&{month:r},...void 0!==o&&{year:o},...void 0!==a&&{day:a},...void 0!==i&&{weekday:i},...void 0!==u&&{hour:u},...void 0!==s&&{minute:s},...void 0!==d&&{second:d},...void 0!==l&&{hour12:l}}}),b=Q(e,f);return t("time",{...g,ref:h,dateTime:b,"aria-label":c??m??y},y)});V.displayName="Tarikh";var X=e(function({value:e,locale:n,numeric:r,srLabel:o,"aria-label":a,...i},u){const s=Y(e),d={...void 0!==n&&{locale:n},...void 0!==r&&{numeric:r}},l=function(e,t){const n=Y(e),r=t?.locale??"en-BD",o=t?.numeric??"always",a="bn-BD"===r?y:f,i=Date.now()-n.getTime(),u=Math.abs(i),s=i>0,d=new Date,l=n.getFullYear()===d.getFullYear()&&n.getMonth()===d.getMonth()&&n.getDate()===d.getDate(),c=s?d:n,m=s?n:d;if(u<L)return a.justNow;if("auto"===o&&l)return function(e){return"bn-BD"===e?"আজ":"today"}(r);const g=P(c,m);if(g>=1){if("auto"===o&&1===g){const e=K("year",s,r);if(null!==e)return e}return z(g,a.year,a.years,s,r)}const h=q(c,m);if(h>=1){if("auto"===o&&1===h){const e=K("month",s,r);if(null!==e)return e}return z(h,a.month,a.months,s,r)}for(const e of W)if(u>=e.threshold){const t=Math.floor(u/e.threshold);if("auto"===o&&1===t&&("day"===e.singular||"week"===e.singular)){const t=K(e.singular,s,r);if(null!==t)return t}return z(t,a[e.singular],a[e.plural],s,r)}return a.justNow}(s,Object.keys(d).length>0?d:void 0),c=Q(e,s);return t("time",{...i,ref:u,dateTime:c,"aria-label":o??a??l},l)});X.displayName="RelativeTime";var _=e(function({value:e,locale:n,format:r,variant:o,srLabel:a,"aria-label":i,...u},s){const d=Y(e),l=Z(d,{mode:"bangla",...{...void 0!==n&&{locale:n},...void 0!==r&&{format:r},...void 0!==o&&{variant:o}}}),c=Q(e,d);return t("time",{...u,ref:s,dateTime:c,"aria-label":a??i??l},l)});_.displayName="BanglaDate";var ee=e(function({value:e,locale:n,timeZone:r,srLabel:o,"aria-label":a,...i},u){const s=Y(e),d=Z(s,{mode:"hijri",...{...void 0!==n&&{locale:n},...void 0!==r&&{timeZone:r}}}),l=Q(e,s);return t("time",{...i,ref:u,dateTime:l,"aria-label":o??a??d},d)});ee.displayName="HijriDate",V.Relative=X,V.Bangla=_,V.Hijri=ee;export{V as Tarikh};
|
package/package.json
CHANGED
|
@@ -1,92 +1,94 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@coreify/tarikh",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "A modern Bangladesh-first date toolkit for formatting, Bangla calendar, and localization in JavaScript, TypeScript, and React apps.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"main": "./dist/index.cjs",
|
|
8
|
-
"module": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
15
|
-
},
|
|
16
|
-
"./react": {
|
|
17
|
-
"types": "./dist/react.d.ts",
|
|
18
|
-
"import": "./dist/react.js",
|
|
19
|
-
"require": "./dist/react.cjs"
|
|
20
|
-
},
|
|
21
|
-
"./package.json": "./package.json"
|
|
22
|
-
},
|
|
23
|
-
"files": [
|
|
24
|
-
"dist",
|
|
25
|
-
"README.md",
|
|
26
|
-
"LICENSE"
|
|
27
|
-
],
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tsup",
|
|
33
|
-
"build:watch": "tsup --watch",
|
|
34
|
-
"typecheck": "tsc --noEmit",
|
|
35
|
-
"lint": "eslint .",
|
|
36
|
-
"ci": "npm run lint && npm run typecheck && npm test",
|
|
37
|
-
"test": "npm run build && vitest run",
|
|
38
|
-
"test:unit": "vitest run",
|
|
39
|
-
"test:watch": "vitest",
|
|
40
|
-
"format": "prettier --write \"**/*.{ts,tsx,js,json,md}\""
|
|
41
|
-
},
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"author": "Coreify",
|
|
44
|
-
"repository": {
|
|
45
|
-
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/coreify/tarikh.git"
|
|
47
|
-
},
|
|
48
|
-
"homepage": "https://tarikh.js.org",
|
|
49
|
-
"bugs": {
|
|
50
|
-
"url": "https://github.com/coreify/tarikh/issues"
|
|
51
|
-
},
|
|
52
|
-
"prepack": "npm run build",
|
|
53
|
-
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"react": ">=18"
|
|
58
|
-
},
|
|
59
|
-
"peerDependenciesMeta": {
|
|
60
|
-
"react": {
|
|
61
|
-
"optional": true
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"@eslint/js": "^10.0.1",
|
|
66
|
-
"@types/node": "^25.5.0",
|
|
67
|
-
"@types/react": "^19.2.14",
|
|
68
|
-
"@types/react-dom": "^19.2.3",
|
|
69
|
-
"eslint": "^10.1.0",
|
|
70
|
-
"globals": "^17.4.0",
|
|
71
|
-
"prettier": "^3.8.1",
|
|
72
|
-
"react": "^19.2.4",
|
|
73
|
-
"react-dom": "^19.2.4",
|
|
74
|
-
"terser": "^5.46.1",
|
|
75
|
-
"tsup": "^8.5.1",
|
|
76
|
-
"typescript": "^5.9.3",
|
|
77
|
-
"typescript-eslint": "^8.58.0",
|
|
78
|
-
"vitest": "^4.1.2"
|
|
79
|
-
},
|
|
80
|
-
"keywords": [
|
|
81
|
-
"tarikh",
|
|
82
|
-
"date",
|
|
83
|
-
"bangla",
|
|
84
|
-
"bengali",
|
|
85
|
-
"bangladesh",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@coreify/tarikh",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "A modern Bangladesh-first date toolkit for formatting, Bangla calendar, Hijri calendar, and localization in JavaScript, TypeScript, and React apps.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./react": {
|
|
17
|
+
"types": "./dist/react.d.ts",
|
|
18
|
+
"import": "./dist/react.js",
|
|
19
|
+
"require": "./dist/react.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsup",
|
|
33
|
+
"build:watch": "tsup --watch",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"lint": "eslint .",
|
|
36
|
+
"ci": "npm run lint && npm run typecheck && npm test",
|
|
37
|
+
"test": "npm run build && vitest run",
|
|
38
|
+
"test:unit": "vitest run",
|
|
39
|
+
"test:watch": "vitest",
|
|
40
|
+
"format": "prettier --write \"**/*.{ts,tsx,js,json,md}\""
|
|
41
|
+
},
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"author": "Coreify",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/coreify/tarikh.git"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://tarikh.js.org",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/coreify/tarikh/issues"
|
|
51
|
+
},
|
|
52
|
+
"prepack": "npm run build",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=18"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"react": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@eslint/js": "^10.0.1",
|
|
66
|
+
"@types/node": "^25.5.0",
|
|
67
|
+
"@types/react": "^19.2.14",
|
|
68
|
+
"@types/react-dom": "^19.2.3",
|
|
69
|
+
"eslint": "^10.1.0",
|
|
70
|
+
"globals": "^17.4.0",
|
|
71
|
+
"prettier": "^3.8.1",
|
|
72
|
+
"react": "^19.2.4",
|
|
73
|
+
"react-dom": "^19.2.4",
|
|
74
|
+
"terser": "^5.46.1",
|
|
75
|
+
"tsup": "^8.5.1",
|
|
76
|
+
"typescript": "^5.9.3",
|
|
77
|
+
"typescript-eslint": "^8.58.0",
|
|
78
|
+
"vitest": "^4.1.2"
|
|
79
|
+
},
|
|
80
|
+
"keywords": [
|
|
81
|
+
"tarikh",
|
|
82
|
+
"date",
|
|
83
|
+
"bangla",
|
|
84
|
+
"bengali",
|
|
85
|
+
"bangladesh",
|
|
86
|
+
"hijri",
|
|
87
|
+
"islamic",
|
|
88
|
+
"calendar",
|
|
89
|
+
"formatting",
|
|
90
|
+
"localization",
|
|
91
|
+
"react",
|
|
92
|
+
"typescript"
|
|
93
|
+
]
|
|
94
|
+
}
|