@m1kapp/kit 0.0.42 → 0.0.43

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/meta.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "0.0.42",
3
- "generatedAt": "2026-09-03T11:09:14.697Z",
4
- "totalCodeLines": 4360,
2
+ "version": "0.0.43",
3
+ "generatedAt": "2026-09-03T11:26:23.811Z",
4
+ "totalCodeLines": 4432,
5
5
  "features": {
6
6
  "Button": {
7
7
  "loc": 61,
@@ -490,7 +490,7 @@
490
490
  "isPrimary": false
491
491
  },
492
492
  "relativeTime": {
493
- "loc": 167,
493
+ "loc": 239,
494
494
  "category": "util",
495
495
  "source": "utils/index.ts",
496
496
  "isPrimary": true
@@ -555,6 +555,42 @@
555
555
  "source": "utils/index.ts",
556
556
  "isPrimary": false
557
557
  },
558
+ "particle": {
559
+ "loc": 0,
560
+ "category": "util",
561
+ "source": "utils/index.ts",
562
+ "isPrimary": false
563
+ },
564
+ "withParticle": {
565
+ "loc": 0,
566
+ "category": "util",
567
+ "source": "utils/index.ts",
568
+ "isPrimary": false
569
+ },
570
+ "formatWon": {
571
+ "loc": 0,
572
+ "category": "util",
573
+ "source": "utils/index.ts",
574
+ "isPrimary": false
575
+ },
576
+ "formatWonTight": {
577
+ "loc": 0,
578
+ "category": "util",
579
+ "source": "utils/index.ts",
580
+ "isPrimary": false
581
+ },
582
+ "formatDollarEok": {
583
+ "loc": 0,
584
+ "category": "util",
585
+ "source": "utils/index.ts",
586
+ "isPrimary": false
587
+ },
588
+ "watermarkTint": {
589
+ "loc": 0,
590
+ "category": "util",
591
+ "source": "utils/index.ts",
592
+ "isPrimary": false
593
+ },
558
594
  "createMetadata": {
559
595
  "loc": 76,
560
596
  "category": "util",
package/dist/utils.d.mts CHANGED
@@ -48,5 +48,31 @@ interface IsoDuration {
48
48
  declare function parseIsoDuration(duration: string): IsoDuration;
49
49
  /** "PT1H2M3S" → 3723 (초) */
50
50
  declare function isoDurationToSec(duration: string): number;
51
+ /**
52
+ * 뒤에 오는 말에 맞는 조사를 고른다.
53
+ *
54
+ * particle("하이브", "은", "는") // "는"
55
+ * particle("서울", "으로", "로") // "로" (ㄹ 받침 특례)
56
+ */
57
+ declare function particle(word: string, withFinal: string, withoutFinal: string): string;
58
+ /** 낱말에 조사를 붙여 돌려준다. withParticle("Anysphere", "을", "를") → "Anysphere를" */
59
+ declare const withParticle: (word: string, withFinal: string, withoutFinal: string) => string;
60
+ /** 원화를 조/억으로. 1조 이상은 조(소수 1자리), 천조 이상은 쉼표 정수 조, 그 아래는 억. */
61
+ declare function formatWon(n: number): string;
62
+ /** formatWon 에서 " 원" 을 뗀 꼴. 좁은 칸·문장 속에 쓴다 — "6.0조", "8,508억". */
63
+ declare function formatWonTight(n: number): string;
64
+ /** 달러를 억 단위로 — "$190억", "$3.5억". 빼기표는 $ 앞에 둔다("-$49억"). */
65
+ declare function formatDollarEok(n: number): string;
66
+ /**
67
+ * 액센트를 그대로 <Watermark color> 에 쓰면 배경이 앱보다 시끄럽다(쨍한 파랑 위
68
+ * 워터마크 글자가 화면을 덮는다). 색조는 남기고 채도·명도를 눌러, nlnn 의
69
+ * 어두운 올리브(#3d4230)처럼 앱이 도드라지는 배경을 만든다.
70
+ *
71
+ * <Watermark color={watermarkTint("#2563eb")} …> // 어두운 남색 슬레이트
72
+ */
73
+ declare function watermarkTint(accentHex: string, { saturation, lightness }?: {
74
+ saturation?: number | undefined;
75
+ lightness?: number | undefined;
76
+ }): string;
51
77
 
52
- export { type DateCount, type DayGroup, type IsoDuration, cn, fillDateSeries, formatDayLabel, formatDuration, formatKoreanNumber, formatNumber, formatPrice, groupByDay, isoDurationToSec, parseIsoDuration, relativeTime };
78
+ export { type DateCount, type DayGroup, type IsoDuration, cn, fillDateSeries, formatDayLabel, formatDollarEok, formatDuration, formatKoreanNumber, formatNumber, formatPrice, formatWon, formatWonTight, groupByDay, isoDurationToSec, parseIsoDuration, particle, relativeTime, watermarkTint, withParticle };
package/dist/utils.d.ts CHANGED
@@ -48,5 +48,31 @@ interface IsoDuration {
48
48
  declare function parseIsoDuration(duration: string): IsoDuration;
49
49
  /** "PT1H2M3S" → 3723 (초) */
50
50
  declare function isoDurationToSec(duration: string): number;
51
+ /**
52
+ * 뒤에 오는 말에 맞는 조사를 고른다.
53
+ *
54
+ * particle("하이브", "은", "는") // "는"
55
+ * particle("서울", "으로", "로") // "로" (ㄹ 받침 특례)
56
+ */
57
+ declare function particle(word: string, withFinal: string, withoutFinal: string): string;
58
+ /** 낱말에 조사를 붙여 돌려준다. withParticle("Anysphere", "을", "를") → "Anysphere를" */
59
+ declare const withParticle: (word: string, withFinal: string, withoutFinal: string) => string;
60
+ /** 원화를 조/억으로. 1조 이상은 조(소수 1자리), 천조 이상은 쉼표 정수 조, 그 아래는 억. */
61
+ declare function formatWon(n: number): string;
62
+ /** formatWon 에서 " 원" 을 뗀 꼴. 좁은 칸·문장 속에 쓴다 — "6.0조", "8,508억". */
63
+ declare function formatWonTight(n: number): string;
64
+ /** 달러를 억 단위로 — "$190억", "$3.5억". 빼기표는 $ 앞에 둔다("-$49억"). */
65
+ declare function formatDollarEok(n: number): string;
66
+ /**
67
+ * 액센트를 그대로 <Watermark color> 에 쓰면 배경이 앱보다 시끄럽다(쨍한 파랑 위
68
+ * 워터마크 글자가 화면을 덮는다). 색조는 남기고 채도·명도를 눌러, nlnn 의
69
+ * 어두운 올리브(#3d4230)처럼 앱이 도드라지는 배경을 만든다.
70
+ *
71
+ * <Watermark color={watermarkTint("#2563eb")} …> // 어두운 남색 슬레이트
72
+ */
73
+ declare function watermarkTint(accentHex: string, { saturation, lightness }?: {
74
+ saturation?: number | undefined;
75
+ lightness?: number | undefined;
76
+ }): string;
51
77
 
52
- export { type DateCount, type DayGroup, type IsoDuration, cn, fillDateSeries, formatDayLabel, formatDuration, formatKoreanNumber, formatNumber, formatPrice, groupByDay, isoDurationToSec, parseIsoDuration, relativeTime };
78
+ export { type DateCount, type DayGroup, type IsoDuration, cn, fillDateSeries, formatDayLabel, formatDollarEok, formatDuration, formatKoreanNumber, formatNumber, formatPrice, formatWon, formatWonTight, groupByDay, isoDurationToSec, parseIsoDuration, particle, relativeTime, watermarkTint, withParticle };
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var h=(r,t)=>{for(var n in t)f(r,n,{get:t[n],enumerable:!0})},d=(r,t,n,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $(t))!_.call(r,o)&&o!==n&&f(r,o,{get:()=>t[o],enumerable:!(e=D(t,o))||e.enumerable});return r};var b=r=>d(f({},"__esModule",{value:!0}),r);var L={};h(L,{cn:()=>M,fillDateSeries:()=>K,formatDayLabel:()=>l,formatDuration:()=>w,formatKoreanNumber:()=>F,formatNumber:()=>x,formatPrice:()=>y,groupByDay:()=>I,isoDurationToSec:()=>C,parseIsoDuration:()=>p,relativeTime:()=>S});module.exports=b(L);var m=require("clsx"),g=require("tailwind-merge");function S(r){let t=new Date(r),n=Date.now()-t.getTime(),e=Math.floor(n/1e3);return e<60?"\uBC29\uAE08 \uC804":e<3600?`${Math.floor(e/60)}\uBD84 \uC804`:e<86400?`${Math.floor(e/3600)}\uC2DC\uAC04 \uC804`:e<86400*2?"\uC5B4\uC81C":e<86400*7?`${Math.floor(e/86400)}\uC77C \uC804`:e<86400*30?`${Math.floor(e/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function x(r){let t=Math.abs(r),n=r<0?"-":"";return t>=1e8?`${n}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${n}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${n}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:r.toLocaleString("ko-KR")}function y(r,t="KRW",n="ko-KR"){return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(r)}function M(...r){return(0,g.twMerge)((0,m.clsx)(r))}function w(r,t={}){let{style:n="short"}=t,e=Math.max(0,Math.floor(r/1e3)),o=Math.floor(e/3600),a=Math.floor(e%3600/60),u=e%60;return n==="clock"?o>0?`${o}:${String(a).padStart(2,"0")}:${String(u).padStart(2,"0")}`:`${a}:${String(u).padStart(2,"0")}`:o>0?a>0?`${o}\uC2DC\uAC04 ${a}\uBD84`:`${o}\uC2DC\uAC04`:a>0?u>0?`${a}\uBD84 ${u}\uCD08`:`${a}\uBD84`:`${u}\uCD08`}var T=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function c(r){return`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}function l(r){let t=new Date(r),n=c(t);return n===c(new Date)?"\uC624\uB298":n===c(new Date(Date.now()-864e5))?"\uC5B4\uC81C":`${t.getMonth()+1}\uC6D4 ${t.getDate()}\uC77C (${T[t.getDay()]})`}function I(r,t){let n=[],e=new Map;for(let o of r){let a=t(o),u=new Date(a),i=c(u),s=e.get(i);s||(s={date:i,label:l(a),items:[]},e.set(i,s),n.push(i)),s.items.push(o)}return n.map(o=>e.get(o))}function K(r,t,n="Asia/Seoul"){let e=new Map(r.map(i=>[i.date,Number(i.count)])),o=[],a=Date.now(),u=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"});for(let i=t-1;i>=0;i--){let s=u.format(new Date(a-i*864e5));o.push({date:s,count:e.get(s)??0})}return o}function F(r){let t=typeof r=="string"?parseInt(r,10):r;return Number.isFinite(t)?t>=1e8?`${Math.floor(t/1e8).toLocaleString()}\uC5B5`:t>=1e4?`${Math.floor(t/1e4).toLocaleString()}\uB9CC`:t>=1e3?`${Math.floor(t/1e3).toLocaleString()}\uCC9C`:t.toLocaleString():"0"}function p(r){let t=r.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return{hours:parseInt(t?.[1]??"0")||0,minutes:parseInt(t?.[2]??"0")||0,seconds:parseInt(t?.[3]??"0")||0}}function C(r){let{hours:t,minutes:n,seconds:e}=p(r);return t*3600+n*60+e}0&&(module.exports={cn,fillDateSeries,formatDayLabel,formatDuration,formatKoreanNumber,formatNumber,formatPrice,groupByDay,isoDurationToSec,parseIsoDuration,relativeTime});
1
+ "use strict";var $=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var R=(r,t)=>{for(var n in t)$(r,n,{get:t[n],enumerable:!0})},W=(r,t,n,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!L.call(r,o)&&o!==n&&$(r,o,{get:()=>t[o],enumerable:!(e=F(t,o))||e.enumerable});return r};var A=r=>W($({},"__esModule",{value:!0}),r);var X={};R(X,{cn:()=>P,fillDateSeries:()=>V,formatDayLabel:()=>D,formatDollarEok:()=>Q,formatDuration:()=>j,formatKoreanNumber:()=>Y,formatNumber:()=>E,formatPrice:()=>G,formatWon:()=>J,formatWonTight:()=>S,groupByDay:()=>z,isoDurationToSec:()=>B,parseIsoDuration:()=>M,particle:()=>_,relativeTime:()=>N,watermarkTint:()=>U,withParticle:()=>q});module.exports=A(X);var x=require("clsx"),b=require("tailwind-merge");function N(r){let t=new Date(r),n=Date.now()-t.getTime(),e=Math.floor(n/1e3);return e<60?"\uBC29\uAE08 \uC804":e<3600?`${Math.floor(e/60)}\uBD84 \uC804`:e<86400?`${Math.floor(e/3600)}\uC2DC\uAC04 \uC804`:e<86400*2?"\uC5B4\uC81C":e<86400*7?`${Math.floor(e/86400)}\uC77C \uC804`:e<86400*30?`${Math.floor(e/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function E(r){let t=Math.abs(r),n=r<0?"-":"";return t>=1e8?`${n}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${n}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${n}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:r.toLocaleString("ko-KR")}function G(r,t="KRW",n="ko-KR"){return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(r)}function P(...r){return(0,b.twMerge)((0,x.clsx)(r))}function j(r,t={}){let{style:n="short"}=t,e=Math.max(0,Math.floor(r/1e3)),o=Math.floor(e/3600),i=Math.floor(e%3600/60),s=e%60;return n==="clock"?o>0?`${o}:${String(i).padStart(2,"0")}:${String(s).padStart(2,"0")}`:`${i}:${String(s).padStart(2,"0")}`:o>0?i>0?`${o}\uC2DC\uAC04 ${i}\uBD84`:`${o}\uC2DC\uAC04`:i>0?s>0?`${i}\uBD84 ${s}\uCD08`:`${i}\uBD84`:`${s}\uCD08`}var v=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function p(r){return`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}function D(r){let t=new Date(r),n=p(t);return n===p(new Date)?"\uC624\uB298":n===p(new Date(Date.now()-864e5))?"\uC5B4\uC81C":`${t.getMonth()+1}\uC6D4 ${t.getDate()}\uC77C (${v[t.getDay()]})`}function z(r,t){let n=[],e=new Map;for(let o of r){let i=t(o),s=new Date(i),a=p(s),u=e.get(a);u||(u={date:a,label:D(i),items:[]},e.set(a,u),n.push(a)),u.items.push(o)}return n.map(o=>e.get(o))}function V(r,t,n="Asia/Seoul"){let e=new Map(r.map(a=>[a.date,Number(a.count)])),o=[],i=Date.now(),s=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"});for(let a=t-1;a>=0;a--){let u=s.format(new Date(i-a*864e5));o.push({date:u,count:e.get(u)??0})}return o}function Y(r){let t=typeof r=="string"?parseInt(r,10):r;return Number.isFinite(t)?t>=1e8?`${Math.floor(t/1e8).toLocaleString()}\uC5B5`:t>=1e4?`${Math.floor(t/1e4).toLocaleString()}\uB9CC`:t>=1e3?`${Math.floor(t/1e3).toLocaleString()}\uCC9C`:t.toLocaleString():"0"}function M(r){let t=r.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return{hours:parseInt(t?.[1]??"0")||0,minutes:parseInt(t?.[2]??"0")||0,seconds:parseInt(t?.[3]??"0")||0}}function B(r){let{hours:t,minutes:n,seconds:e}=M(r);return t*3600+n*60+e}function H(r){let t=r.trim().slice(-1),n=t.charCodeAt(0);return n>=44032&&n<=55203?(n-44032)%28!==0:/[0-9]/.test(t)?/[013678]/.test(t):/[bcdfgklmnptvz]/i.test(t)}function O(r){let t=r.trim().slice(-1).charCodeAt(0);return t<44032||t>55203?/l$/i.test(r.trim()):(t-44032)%28===8}function _(r,t,n){return t==="\uC73C\uB85C"&&O(r)?"\uB85C":H(r)?t:n}var q=(r,t,n)=>`${r}${_(r,t,n)}`;function J(r){return`${S(r)} \uC6D0`}function S(r){let t=r/1e12;return Math.abs(t)>=1e3?`${Math.round(t).toLocaleString("ko-KR")}\uC870`:Math.abs(t)>=1?`${t.toFixed(1)}\uC870`:`${Math.round(r/1e8).toLocaleString("ko-KR")}\uC5B5`}function Q(r){let t=r/1e8,n=Math.abs(t),e=n>=1e3?Math.round(n).toLocaleString("ko-KR"):n>=10?n.toFixed(0):n.toFixed(1);return`${r<0?"-":""}$${e}\uC5B5`}function U(r,{saturation:t=.22,lightness:n=.16}={}){let e=r.replace("#",""),o=e.length===3?e.split("").map(l=>l+l).join(""):e,i=parseInt(o.slice(0,2),16)/255,s=parseInt(o.slice(2,4),16)/255,a=parseInt(o.slice(4,6),16)/255,u=Math.max(i,s,a),y=Math.min(i,s,a),g=u-y,c=0;g!==0&&(u===i?c=((s-a)/g+(s<a?6:0))/6:u===s?c=((a-i)/g+2)/6:c=((i-s)/g+4)/6);let T=g===0?0:t,d=n,f=(1-Math.abs(2*d-1))*T,m=f*(1-Math.abs(c*6%2-1)),k=d-f/2,[w,I,K]=c<1/6?[f,m,0]:c<2/6?[m,f,0]:c<3/6?[0,f,m]:c<4/6?[0,m,f]:c<5/6?[m,0,f]:[f,0,m],h=l=>Math.round((l+k)*255).toString(16).padStart(2,"0");return`#${h(w)}${h(I)}${h(K)}`}0&&(module.exports={cn,fillDateSeries,formatDayLabel,formatDollarEok,formatDuration,formatKoreanNumber,formatNumber,formatPrice,formatWon,formatWonTight,groupByDay,isoDurationToSec,parseIsoDuration,particle,relativeTime,watermarkTint,withParticle});
package/dist/utils.mjs CHANGED
@@ -1 +1 @@
1
- import{clsx as f}from"clsx";import{twMerge as m}from"tailwind-merge";function D(r){let t=new Date(r),n=Date.now()-t.getTime(),e=Math.floor(n/1e3);return e<60?"\uBC29\uAE08 \uC804":e<3600?`${Math.floor(e/60)}\uBD84 \uC804`:e<86400?`${Math.floor(e/3600)}\uC2DC\uAC04 \uC804`:e<86400*2?"\uC5B4\uC81C":e<86400*7?`${Math.floor(e/86400)}\uC77C \uC804`:e<86400*30?`${Math.floor(e/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function $(r){let t=Math.abs(r),n=r<0?"-":"";return t>=1e8?`${n}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${n}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${n}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:r.toLocaleString("ko-KR")}function _(r,t="KRW",n="ko-KR"){return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(r)}function b(...r){return m(f(r))}function S(r,t={}){let{style:n="short"}=t,e=Math.max(0,Math.floor(r/1e3)),o=Math.floor(e/3600),a=Math.floor(e%3600/60),u=e%60;return n==="clock"?o>0?`${o}:${String(a).padStart(2,"0")}:${String(u).padStart(2,"0")}`:`${a}:${String(u).padStart(2,"0")}`:o>0?a>0?`${o}\uC2DC\uAC04 ${a}\uBD84`:`${o}\uC2DC\uAC04`:a>0?u>0?`${a}\uBD84 ${u}\uCD08`:`${a}\uBD84`:`${u}\uCD08`}var g=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function c(r){return`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}function l(r){let t=new Date(r),n=c(t);return n===c(new Date)?"\uC624\uB298":n===c(new Date(Date.now()-864e5))?"\uC5B4\uC81C":`${t.getMonth()+1}\uC6D4 ${t.getDate()}\uC77C (${g[t.getDay()]})`}function x(r,t){let n=[],e=new Map;for(let o of r){let a=t(o),u=new Date(a),i=c(u),s=e.get(i);s||(s={date:i,label:l(a),items:[]},e.set(i,s),n.push(i)),s.items.push(o)}return n.map(o=>e.get(o))}function y(r,t,n="Asia/Seoul"){let e=new Map(r.map(i=>[i.date,Number(i.count)])),o=[],a=Date.now(),u=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"});for(let i=t-1;i>=0;i--){let s=u.format(new Date(a-i*864e5));o.push({date:s,count:e.get(s)??0})}return o}function M(r){let t=typeof r=="string"?parseInt(r,10):r;return Number.isFinite(t)?t>=1e8?`${Math.floor(t/1e8).toLocaleString()}\uC5B5`:t>=1e4?`${Math.floor(t/1e4).toLocaleString()}\uB9CC`:t>=1e3?`${Math.floor(t/1e3).toLocaleString()}\uCC9C`:t.toLocaleString():"0"}function p(r){let t=r.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return{hours:parseInt(t?.[1]??"0")||0,minutes:parseInt(t?.[2]??"0")||0,seconds:parseInt(t?.[3]??"0")||0}}function w(r){let{hours:t,minutes:n,seconds:e}=p(r);return t*3600+n*60+e}export{b as cn,y as fillDateSeries,l as formatDayLabel,S as formatDuration,M as formatKoreanNumber,$ as formatNumber,_ as formatPrice,x as groupByDay,w as isoDurationToSec,p as parseIsoDuration,D as relativeTime};
1
+ import{clsx as S}from"clsx";import{twMerge as y}from"tailwind-merge";function L(r){let t=new Date(r),n=Date.now()-t.getTime(),e=Math.floor(n/1e3);return e<60?"\uBC29\uAE08 \uC804":e<3600?`${Math.floor(e/60)}\uBD84 \uC804`:e<86400?`${Math.floor(e/3600)}\uC2DC\uAC04 \uC804`:e<86400*2?"\uC5B4\uC81C":e<86400*7?`${Math.floor(e/86400)}\uC77C \uC804`:e<86400*30?`${Math.floor(e/(86400*7))}\uC8FC \uC804`:t.toLocaleDateString("ko-KR",{year:"numeric",month:"long",day:"numeric"})}function R(r){let t=Math.abs(r),n=r<0?"-":"";return t>=1e8?`${n}${(t/1e8).toFixed(1).replace(/\.0$/,"")}\uC5B5`:t>=1e4?`${n}${(t/1e4).toFixed(1).replace(/\.0$/,"")}\uB9CC`:t>=1e3?`${n}${(t/1e3).toFixed(1).replace(/\.0$/,"")}\uCC9C`:r.toLocaleString("ko-KR")}function W(r,t="KRW",n="ko-KR"){return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2}).format(r)}function E(...r){return y(S(r))}function G(r,t={}){let{style:n="short"}=t,e=Math.max(0,Math.floor(r/1e3)),i=Math.floor(e/3600),o=Math.floor(e%3600/60),s=e%60;return n==="clock"?i>0?`${i}:${String(o).padStart(2,"0")}:${String(s).padStart(2,"0")}`:`${o}:${String(s).padStart(2,"0")}`:i>0?o>0?`${i}\uC2DC\uAC04 ${o}\uBD84`:`${i}\uC2DC\uAC04`:o>0?s>0?`${o}\uBD84 ${s}\uCD08`:`${o}\uBD84`:`${s}\uCD08`}var T=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function p(r){return`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}function k(r){let t=new Date(r),n=p(t);return n===p(new Date)?"\uC624\uB298":n===p(new Date(Date.now()-864e5))?"\uC5B4\uC81C":`${t.getMonth()+1}\uC6D4 ${t.getDate()}\uC77C (${T[t.getDay()]})`}function P(r,t){let n=[],e=new Map;for(let i of r){let o=t(i),s=new Date(o),a=p(s),u=e.get(a);u||(u={date:a,label:k(o),items:[]},e.set(a,u),n.push(a)),u.items.push(i)}return n.map(i=>e.get(i))}function j(r,t,n="Asia/Seoul"){let e=new Map(r.map(a=>[a.date,Number(a.count)])),i=[],o=Date.now(),s=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"});for(let a=t-1;a>=0;a--){let u=s.format(new Date(o-a*864e5));i.push({date:u,count:e.get(u)??0})}return i}function v(r){let t=typeof r=="string"?parseInt(r,10):r;return Number.isFinite(t)?t>=1e8?`${Math.floor(t/1e8).toLocaleString()}\uC5B5`:t>=1e4?`${Math.floor(t/1e4).toLocaleString()}\uB9CC`:t>=1e3?`${Math.floor(t/1e3).toLocaleString()}\uCC9C`:t.toLocaleString():"0"}function w(r){let t=r.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return{hours:parseInt(t?.[1]??"0")||0,minutes:parseInt(t?.[2]??"0")||0,seconds:parseInt(t?.[3]??"0")||0}}function z(r){let{hours:t,minutes:n,seconds:e}=w(r);return t*3600+n*60+e}function I(r){let t=r.trim().slice(-1),n=t.charCodeAt(0);return n>=44032&&n<=55203?(n-44032)%28!==0:/[0-9]/.test(t)?/[013678]/.test(t):/[bcdfgklmnptvz]/i.test(t)}function K(r){let t=r.trim().slice(-1).charCodeAt(0);return t<44032||t>55203?/l$/i.test(r.trim()):(t-44032)%28===8}function F(r,t,n){return t==="\uC73C\uB85C"&&K(r)?"\uB85C":I(r)?t:n}var V=(r,t,n)=>`${r}${F(r,t,n)}`;function Y(r){return`${C(r)} \uC6D0`}function C(r){let t=r/1e12;return Math.abs(t)>=1e3?`${Math.round(t).toLocaleString("ko-KR")}\uC870`:Math.abs(t)>=1?`${t.toFixed(1)}\uC870`:`${Math.round(r/1e8).toLocaleString("ko-KR")}\uC5B5`}function B(r){let t=r/1e8,n=Math.abs(t),e=n>=1e3?Math.round(n).toLocaleString("ko-KR"):n>=10?n.toFixed(0):n.toFixed(1);return`${r<0?"-":""}$${e}\uC5B5`}function H(r,{saturation:t=.22,lightness:n=.16}={}){let e=r.replace("#",""),i=e.length===3?e.split("").map(l=>l+l).join(""):e,o=parseInt(i.slice(0,2),16)/255,s=parseInt(i.slice(2,4),16)/255,a=parseInt(i.slice(4,6),16)/255,u=Math.max(o,s,a),d=Math.min(o,s,a),g=u-d,c=0;g!==0&&(u===o?c=((s-a)/g+(s<a?6:0))/6:u===s?c=((a-o)/g+2)/6:c=((o-s)/g+4)/6);let x=g===0?0:t,$=n,f=(1-Math.abs(2*$-1))*x,m=f*(1-Math.abs(c*6%2-1)),b=$-f/2,[D,M,_]=c<1/6?[f,m,0]:c<2/6?[m,f,0]:c<3/6?[0,f,m]:c<4/6?[0,m,f]:c<5/6?[m,0,f]:[f,0,m],h=l=>Math.round((l+b)*255).toString(16).padStart(2,"0");return`#${h(D)}${h(M)}${h(_)}`}export{E as cn,j as fillDateSeries,k as formatDayLabel,B as formatDollarEok,G as formatDuration,v as formatKoreanNumber,R as formatNumber,W as formatPrice,Y as formatWon,C as formatWonTight,P as groupByDay,z as isoDurationToSec,w as parseIsoDuration,F as particle,L as relativeTime,H as watermarkTint,V as withParticle};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kapp/kit",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "UI, SEO, and PWA utilities for side projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",