@sigtes/ui 0.2.5 → 0.2.7

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.
@@ -0,0 +1,21 @@
1
+ declare function getLocalDate(date: Date): string;
2
+ declare function getUTCtoDateMoreOneDay(date: Date): string;
3
+ declare function getLocalDateTime(date: Date): string;
4
+ declare function getUTCDate(date: Date | undefined): string | undefined;
5
+ declare function now(): string;
6
+ declare function differenceInDays(date1: Date, date2: Date): number;
7
+ declare function addDays(date: Date, days: number): Date;
8
+ declare function format(date: Date, format: string): string;
9
+ declare function toUTCDateString(date: Date): string;
10
+ export declare const date: {
11
+ getLocalDate: typeof getLocalDate;
12
+ getLocalDateTime: typeof getLocalDateTime;
13
+ getUTCDate: typeof getUTCDate;
14
+ getUTCtoDateMoreOneDay: typeof getUTCtoDateMoreOneDay;
15
+ now: typeof now;
16
+ differenceInDays: typeof differenceInDays;
17
+ addDays: typeof addDays;
18
+ format: typeof format;
19
+ toUTCDateString: typeof toUTCDateString;
20
+ };
21
+ export {};
@@ -0,0 +1 @@
1
+ export * from './date';
@@ -0,0 +1 @@
1
+ export * from './date';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("dayjs");function x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h={exports:{}},H=h.exports,S;function j(){return S||(S=1,(function(e,u){(function(f,s){e.exports=s(n)})(H,(function(f){function s(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var _=s(f),Y={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(i){return i+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return _.default.locale(Y,null,!0),Y}))})(h)),h.exports}j();var m={exports:{}},q=m.exports,T;function w(){return T||(T=1,(function(e,u){(function(f,s){e.exports=s()})(q,(function(){var f="minute",s=/[+-]\d\d(?::?\d\d)?/g,_=/([+-]|\d\d)/g;return function(Y,i,l){var r=i.prototype;l.utc=function(t){var o={date:t,utc:!0,args:arguments};return new i(o)},r.utc=function(t){var o=l(this.toDate(),{locale:this.$L,utc:!0});return t?o.add(this.utcOffset(),f):o},r.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var y=r.parse;r.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),y.call(this,t)};var U=r.init;r.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else U.call(this)};var C=r.utcOffset;r.utcOffset=function(t,o){var d=this.$utils().u;if(d(t))return this.$u?0:d(this.$offset)?C.call(this):this.$offset;if(typeof t=="string"&&(t=(function($){$===void 0&&($="");var v=$.match(s);if(!v)return null;var D=(""+v[0]).match(_)||["-",0,0],b=D[0],g=60*+D[1]+ +D[2];return g===0?0:b==="+"?g:-g})(t),t===null))return this;var c=Math.abs(t)<=16?60*t:t;if(c===0)return this.utc(o);var a=this.clone();if(o)return a.$offset=c,a.$u=!1,a;var p=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(a=this.local().add(c+p,f)).$offset=c,a.$x.$localOffset=p,a};var L=r.format;r.format=function(t){var o=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return L.call(this,o)},r.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var O=r.toDate;r.toDate=function(t){return t==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():O.call(this)};var M=r.diff;r.diff=function(t,o,d){if(t&&this.$u===t.$u)return M.call(this,t,o,d);var c=this.local(),a=l(t).local();return M.call(c,a,o,d)}}}))})(m)),m.exports}var z=w();const B=x(z);n.extend(B);n.locale("pt-br");function P(e){return n(String(e)).format("DD/MM/YYYY")}function k(e){return n(e).utc().add(1,"day").format("YYYY-MM-DD")}function F(e){return n(String(e)).format("DD/MM/YYYY hh:mm:ss")}function I(e){if(e)return n(String(e)).utc().format("DD/MM/YYYY")}function E(){return n(new Date).format("YYYY-MM-DD")}function R(e,u){return n(e).diff(n(u),"day")}function W(e,u){return n(e).add(u,"day").toDate()}function Z(e,u){return n(new Date(e)).format(u)}function A(e){return`${e.getUTCDate().toString().padStart(2,"0")}/${e.getUTCMonth().toString().padStart(2,"0")}/${e.getUTCFullYear()}`}const G={getLocalDate:P,getLocalDateTime:F,getUTCDate:I,getUTCtoDateMoreOneDay:k,now:E,differenceInDays:R,addDays:W,format:Z,toUTCDateString:A};exports.date=G;
@@ -0,0 +1,142 @@
1
+ import n from "dayjs";
2
+ function H(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ var d = { exports: {} }, b = d.exports, T;
6
+ function j() {
7
+ return T || (T = 1, (function(e, u) {
8
+ (function(f, s) {
9
+ e.exports = s(n);
10
+ })(b, (function(f) {
11
+ function s(i) {
12
+ return i && typeof i == "object" && "default" in i ? i : { default: i };
13
+ }
14
+ var _ = s(f), Y = { name: "pt-br", weekdays: "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_sáb".split("_"), weekdaysMin: "Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"), months: "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(i) {
15
+ return i + "º";
16
+ }, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [às] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [às] HH:mm" }, relativeTime: { future: "em %s", past: "há %s", s: "poucos segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um mês", MM: "%d meses", y: "um ano", yy: "%d anos" } };
17
+ return _.default.locale(Y, null, !0), Y;
18
+ }));
19
+ })(d)), d.exports;
20
+ }
21
+ j();
22
+ var m = { exports: {} }, q = m.exports, S;
23
+ function w() {
24
+ return S || (S = 1, (function(e, u) {
25
+ (function(f, s) {
26
+ e.exports = s();
27
+ })(q, (function() {
28
+ var f = "minute", s = /[+-]\d\d(?::?\d\d)?/g, _ = /([+-]|\d\d)/g;
29
+ return function(Y, i, l) {
30
+ var r = i.prototype;
31
+ l.utc = function(t) {
32
+ var o = { date: t, utc: !0, args: arguments };
33
+ return new i(o);
34
+ }, r.utc = function(t) {
35
+ var o = l(this.toDate(), { locale: this.$L, utc: !0 });
36
+ return t ? o.add(this.utcOffset(), f) : o;
37
+ }, r.local = function() {
38
+ return l(this.toDate(), { locale: this.$L, utc: !1 });
39
+ };
40
+ var y = r.parse;
41
+ r.parse = function(t) {
42
+ t.utc && (this.$u = !0), this.$utils().u(t.$offset) || (this.$offset = t.$offset), y.call(this, t);
43
+ };
44
+ var U = r.init;
45
+ r.init = function() {
46
+ if (this.$u) {
47
+ var t = this.$d;
48
+ this.$y = t.getUTCFullYear(), this.$M = t.getUTCMonth(), this.$D = t.getUTCDate(), this.$W = t.getUTCDay(), this.$H = t.getUTCHours(), this.$m = t.getUTCMinutes(), this.$s = t.getUTCSeconds(), this.$ms = t.getUTCMilliseconds();
49
+ } else U.call(this);
50
+ };
51
+ var C = r.utcOffset;
52
+ r.utcOffset = function(t, o) {
53
+ var h = this.$utils().u;
54
+ if (h(t)) return this.$u ? 0 : h(this.$offset) ? C.call(this) : this.$offset;
55
+ if (typeof t == "string" && (t = (function($) {
56
+ $ === void 0 && ($ = "");
57
+ var v = $.match(s);
58
+ if (!v) return null;
59
+ var D = ("" + v[0]).match(_) || ["-", 0, 0], O = D[0], M = 60 * +D[1] + +D[2];
60
+ return M === 0 ? 0 : O === "+" ? M : -M;
61
+ })(t), t === null)) return this;
62
+ var c = Math.abs(t) <= 16 ? 60 * t : t;
63
+ if (c === 0) return this.utc(o);
64
+ var a = this.clone();
65
+ if (o) return a.$offset = c, a.$u = !1, a;
66
+ var p = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
67
+ return (a = this.local().add(c + p, f)).$offset = c, a.$x.$localOffset = p, a;
68
+ };
69
+ var x = r.format;
70
+ r.format = function(t) {
71
+ var o = t || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
72
+ return x.call(this, o);
73
+ }, r.valueOf = function() {
74
+ var t = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
75
+ return this.$d.valueOf() - 6e4 * t;
76
+ }, r.isUTC = function() {
77
+ return !!this.$u;
78
+ }, r.toISOString = function() {
79
+ return this.toDate().toISOString();
80
+ }, r.toString = function() {
81
+ return this.toDate().toUTCString();
82
+ };
83
+ var L = r.toDate;
84
+ r.toDate = function(t) {
85
+ return t === "s" && this.$offset ? l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : L.call(this);
86
+ };
87
+ var g = r.diff;
88
+ r.diff = function(t, o, h) {
89
+ if (t && this.$u === t.$u) return g.call(this, t, o, h);
90
+ var c = this.local(), a = l(t).local();
91
+ return g.call(c, a, o, h);
92
+ };
93
+ };
94
+ }));
95
+ })(m)), m.exports;
96
+ }
97
+ var z = w();
98
+ const B = /* @__PURE__ */ H(z);
99
+ n.extend(B);
100
+ n.locale("pt-br");
101
+ function k(e) {
102
+ return n(String(e)).format("DD/MM/YYYY");
103
+ }
104
+ function F(e) {
105
+ return n(e).utc().add(1, "day").format("YYYY-MM-DD");
106
+ }
107
+ function I(e) {
108
+ return n(String(e)).format("DD/MM/YYYY hh:mm:ss");
109
+ }
110
+ function P(e) {
111
+ if (e)
112
+ return n(String(e)).utc().format("DD/MM/YYYY");
113
+ }
114
+ function E() {
115
+ return n(/* @__PURE__ */ new Date()).format("YYYY-MM-DD");
116
+ }
117
+ function R(e, u) {
118
+ return n(e).diff(n(u), "day");
119
+ }
120
+ function W(e, u) {
121
+ return n(e).add(u, "day").toDate();
122
+ }
123
+ function Z(e, u) {
124
+ return n(new Date(e)).format(u);
125
+ }
126
+ function A(e) {
127
+ return `${e.getUTCDate().toString().padStart(2, "0")}/${e.getUTCMonth().toString().padStart(2, "0")}/${e.getUTCFullYear()}`;
128
+ }
129
+ const J = {
130
+ getLocalDate: k,
131
+ getLocalDateTime: I,
132
+ getUTCDate: P,
133
+ getUTCtoDateMoreOneDay: F,
134
+ now: E,
135
+ differenceInDays: R,
136
+ addDays: W,
137
+ format: Z,
138
+ toUTCDateString: A
139
+ };
140
+ export {
141
+ J as date
142
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigtes/ui",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,6 +18,11 @@
18
18
  "import": "./dist/hooks.es.js",
19
19
  "require": "./dist/hooks.cjs.js"
20
20
  },
21
+ "./models": {
22
+ "types": "./dist/models/index.d.ts",
23
+ "import": "./dist/models.es.js",
24
+ "require": "./dist/models.cjs.js"
25
+ },
21
26
  "./pages": {
22
27
  "types": "./dist/pages/index.d.ts",
23
28
  "import": "./dist/pages.es.js",
@@ -59,7 +64,8 @@
59
64
  "@tanstack/react-table": "^8.21.3",
60
65
  "class-variance-authority": "^0.7.1",
61
66
  "cmdk": "^1.1.1",
62
- "lucide-react": "^0.544.0",
67
+ "dayjs": "^1.11.19",
68
+ "lucide-react": "^0.555.0",
63
69
  "next": "^16.0.1",
64
70
  "next-themes": "^0.4.6",
65
71
  "react": "^19.1.0",