@gbmtech/aurora-ui 0.5.1 → 0.5.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.
@@ -1,2 +1,2 @@
1
1
  'use client'
2
- "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{DateTimePicker:()=>DateTimePicker});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_namespaceObject=require("@phosphor-icons/react"),external_date_fns_namespaceObject=require("date-fns"),external_react_namespaceObject=require("react"),locale_namespaceObject=require("react-day-picker/locale"),external_button_cjs_namespaceObject=require("../button.cjs"),external_popover_cjs_namespaceObject=require("../popover.cjs"),utils_cjs_namespaceObject=require("../../lib/utils.cjs"),external_calendar_cjs_namespaceObject=require("../calendar.cjs"),index_cjs_namespaceObject=require("../time-picker/index.cjs"),DateTimePicker=(0,external_react_namespaceObject.forwardRef)(({locale:e=locale_namespaceObject.ptBR,defaultPopupValue:a=new Date(new Date().setHours(0,0,0,0)),value:t,onChange:r,onMonthChange:c,hourCycle:_=24,yearRange:n=50,disabled:s=!1,displayFormat:i,granularity:o="minute",placeholder:p="",className:l,min:u,max:m,...j},b)=>{let d,[x,O]=(0,external_react_namespaceObject.useState)(t??a),f=(0,external_react_namespaceObject.useRef)(null),[k,h]=(0,external_react_namespaceObject.useState)(t??void 0);(0,external_react_namespaceObject.useEffect)(()=>{h(t)},[t]),(0,external_react_namespaceObject.useImperativeHandle)(b,()=>({...f.current,value:k}),[k]);let w={hour24:i?.hour24??`dd/MM/yyyy HH:mm${!o||"second"===o?":ss":""}`,hour12:i?.hour12??`dd/MM/yyyy hh:mm${!o||"second"===o?":ss":""} b`},y=locale_namespaceObject.ptBR,{options:g,localize:v,formatLong:q}=e;return g&&v&&q&&(y={...locale_namespaceObject.ptBR,options:g,localize:v,formatLong:q}),u&&(d={before:u}),m&&(d={...d,after:m}),(0,jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger,{disabled:s,asChild:!0,children:(0,jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button,{variant:"outline",className:(0,utils_cjs_namespaceObject.cn)("w-full justify-start gap-0 text-left font-normal",!k&&"text-muted-foreground",l),ref:f,children:[(0,jsx_runtime_namespaceObject.jsx)(react_namespaceObject.CalendarBlankIcon,{className:"mr-2 h-4 w-4"}),k?(0,external_date_fns_namespaceObject.format)(k,24===_?w.hour24:w.hour12,{locale:y}):(0,jsx_runtime_namespaceObject.jsx)("span",{children:p})]})}),(0,jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.PopoverContent,{className:"w-auto p-0",children:[(0,jsx_runtime_namespaceObject.jsx)(external_calendar_cjs_namespaceObject.Calendar,{mode:"single",selected:k||void 0,month:x,onSelect:e=>{e&&(e.setHours(x?.getHours()??0,x?.getMinutes()??0,x?.getSeconds()??0),(e=>{e&&(r?.(e),O(e),h(e))})(e))},onMonthChange:e=>{if(!e)return;if(!a){e.setHours(x?.getHours()??0,x?.getMinutes()??0,x?.getSeconds()??0),c?.(e),O(e);return}let t=e.getTime()-a.getTime(),r=(0,external_date_fns_namespaceObject.add)(a,{days:Math.ceil(t/864e5)});r.setHours(x?.getHours()??0,x?.getMinutes()??0,x?.getSeconds()??0),c?.(r),O(r)},yearRange:n,locale:e,disabled:d,...j}),"day"!==o&&(0,jsx_runtime_namespaceObject.jsx)("div",{className:"border-border border-t p-3",children:(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.TimePicker,{onChange:e=>{r?.(e),h(e),e&&O(e)},date:x,hourCycle:_,granularity:o})})]})]})});for(var __webpack_i__ in DateTimePicker.displayName="DateTimePicker",exports.DateTimePicker=__webpack_exports__.DateTimePicker,__webpack_exports__)-1===["DateTimePicker"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{DateTimePicker:()=>DateTimePicker});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_namespaceObject=require("@phosphor-icons/react"),external_date_fns_namespaceObject=require("date-fns"),external_react_namespaceObject=require("react"),locale_namespaceObject=require("react-day-picker/locale"),external_button_cjs_namespaceObject=require("../button.cjs"),external_popover_cjs_namespaceObject=require("../popover.cjs"),utils_cjs_namespaceObject=require("../../lib/utils.cjs"),external_calendar_cjs_namespaceObject=require("../calendar.cjs"),index_cjs_namespaceObject=require("../time-picker/index.cjs"),DateTimePicker=(0,external_react_namespaceObject.forwardRef)(({locale:e=locale_namespaceObject.ptBR,defaultPopupValue:a=new Date(new Date().setHours(0,0,0,0)),value:t,onChange:r,onMonthChange:c,hourCycle:_=24,yearRange:n=50,disabled:s=!1,displayFormat:i,granularity:o="minute",placeholder:p="",className:l,min:u,max:m,triggerProps:j,hasCalendarIcon:b=!0,...d},x)=>{let O,[f,k]=(0,external_react_namespaceObject.useState)(t??a),h=(0,external_react_namespaceObject.useRef)(null),[w,y]=(0,external_react_namespaceObject.useState)(t??void 0);(0,external_react_namespaceObject.useEffect)(()=>{y(t)},[t]),(0,external_react_namespaceObject.useImperativeHandle)(x,()=>({...h.current,value:w}),[w]);let g={hour24:i?.hour24??`dd/MM/yyyy HH:mm${!o||"second"===o?":ss":""}`,hour12:i?.hour12??`dd/MM/yyyy hh:mm${!o||"second"===o?":ss":""} b`},v=locale_namespaceObject.ptBR,{options:q,localize:P,formatLong:T}=e;return q&&P&&T&&(v={...locale_namespaceObject.ptBR,options:q,localize:P,formatLong:T}),u&&(O={before:u}),m&&(O={...O,after:m}),(0,jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger,{disabled:s,asChild:!0,children:(0,jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button,{variant:"outline",className:(0,utils_cjs_namespaceObject.cn)("w-full justify-start gap-0 text-left font-normal",!w&&"text-muted-foreground",l),ref:h,...j,children:[b&&(0,jsx_runtime_namespaceObject.jsx)(react_namespaceObject.CalendarBlankIcon,{className:"mr-2 h-4 w-4"}),w?(0,external_date_fns_namespaceObject.format)(w,24===_?g.hour24:g.hour12,{locale:v}):(0,jsx_runtime_namespaceObject.jsx)("span",{children:p})]})}),(0,jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.PopoverContent,{className:"w-auto p-0",children:[(0,jsx_runtime_namespaceObject.jsx)(external_calendar_cjs_namespaceObject.Calendar,{mode:"single",selected:w||void 0,month:f,onSelect:e=>{e&&(e.setHours(f?.getHours()??0,f?.getMinutes()??0,f?.getSeconds()??0),(e=>{e&&(r?.(e),k(e),y(e))})(e))},onMonthChange:e=>{if(!e)return;if(!a){e.setHours(f?.getHours()??0,f?.getMinutes()??0,f?.getSeconds()??0),c?.(e),k(e);return}let t=e.getTime()-a.getTime(),r=(0,external_date_fns_namespaceObject.add)(a,{days:Math.ceil(t/864e5)});r.setHours(f?.getHours()??0,f?.getMinutes()??0,f?.getSeconds()??0),c?.(r),k(r)},yearRange:n,locale:e,disabled:O,...d}),"day"!==o&&(0,jsx_runtime_namespaceObject.jsx)("div",{className:"border-border border-t p-3",children:(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.TimePicker,{onChange:e=>{r?.(e),y(e),e&&k(e)},date:f,hourCycle:_,granularity:o})})]})]})});for(var __webpack_i__ in DateTimePicker.displayName="DateTimePicker",exports.DateTimePicker=__webpack_exports__.DateTimePicker,__webpack_exports__)-1===["DateTimePicker"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,8 +1,10 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Button } from '../button';
1
3
  import { Granularity } from '../../lib/date-picker';
2
4
  import { CalendarProps } from '../calendar';
3
5
  type DateTimePickerProps = {
4
6
  value?: Date | null;
5
- onChange?: (date: Date | undefined) => void;
7
+ onChange?: (date: Date | undefined | null) => void;
6
8
  onMonthChange?: (date: Date | undefined) => void;
7
9
  disabled?: boolean;
8
10
  /** showing `AM/PM` or not. */
@@ -35,13 +37,15 @@ type DateTimePickerProps = {
35
37
  defaultPopupValue?: Date;
36
38
  min?: Date;
37
39
  max?: Date;
40
+ triggerProps?: ComponentProps<typeof Button>;
41
+ hasCalendarIcon?: boolean;
38
42
  } & Pick<CalendarProps, 'locale' | 'weekStartsOn' | 'showWeekNumber' | 'showOutsideDays'>;
39
43
  type DateTimePickerRef = {
40
44
  value?: Date | null;
41
45
  } & Omit<HTMLButtonElement, 'value'>;
42
46
  declare const DateTimePicker: import("react").ForwardRefExoticComponent<{
43
47
  value?: Date | null;
44
- onChange?: (date: Date | undefined) => void;
48
+ onChange?: (date: Date | undefined | null) => void;
45
49
  onMonthChange?: (date: Date | undefined) => void;
46
50
  disabled?: boolean;
47
51
  /** showing `AM/PM` or not. */
@@ -74,6 +78,8 @@ declare const DateTimePicker: import("react").ForwardRefExoticComponent<{
74
78
  defaultPopupValue?: Date;
75
79
  min?: Date;
76
80
  max?: Date;
81
+ triggerProps?: ComponentProps<typeof Button>;
82
+ hasCalendarIcon?: boolean;
77
83
  } & Pick<CalendarProps, "locale" | "showOutsideDays" | "showWeekNumber" | "weekStartsOn"> & import("react").RefAttributes<Partial<DateTimePickerRef>>>;
78
84
  export { DateTimePicker };
79
85
  export type { DateTimePickerProps, DateTimePickerRef, Granularity };
@@ -1 +1 @@
1
- {"version":3,"file":"datetime-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/datetime-picker/datetime-picker.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAY,aAAa,EAAE,MAAM,aAAa,CAAA;AAGrD,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAC3C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;SAKK;IACL,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;QAGI;IACJ,aAAa,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACpD;;;QAGI;IACJ,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;QAEI;IACJ,iBAAiB,CAAC,EAAE,IAAI,CAAA;IACxB,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,GAAG,CAAC,EAAE,IAAI,CAAA;CACX,GAAG,IAAI,CACN,aAAa,EACb,QAAQ,GAAG,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,CACjE,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACpB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;AAEpC,QAAA,MAAM,cAAc;YAxCV,IAAI,GAAG,IAAI;eACR,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI;oBAC3B,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI;eACrC,OAAO;IAClB,8BAA8B;gBAClB,EAAE,GAAG,EAAE;kBACL,MAAM;IACpB;;;;;SAKK;gBACO,MAAM;IAClB;;;QAGI;oBACY;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IACpD;;;QAGI;kBACU,WAAW;gBACb,MAAM;IAClB;;QAEI;wBACgB,IAAI;UAClB,IAAI;UACJ,IAAI;sJA2MX,CAAA;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"datetime-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/datetime-picker/datetime-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EAMf,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,MAAM,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M,cAAc;YA1CV,IAAI,GAAG,IAAI;eACR,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,KAAK,IAAI;oBAClC,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI;eACrC,OAAO;IAClB,8BAA8B;gBAClB,EAAE,GAAG,EAAE;kBACL,MAAM;IACpB;;;;;SAKK;gBACO,MAAM;IAClB;;;QAGI;oBACY;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IACpD;;;QAGI;kBACU,WAAW;gBACb,MAAM;IAClB;;QAEI;wBACgB,IAAI;UAClB,IAAI;UACJ,IAAI;mBACK,cAAc,CAAC,OAAO,MAAM,CAAC;sBAC1B,OAAO;sJA8M1B,CAAA;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAA"}
@@ -1 +1 @@
1
- import*as r from"./nav-sub-item.js";import*as e from"./sidebar-icons.js";export*from"./app-sidebar.js";export*from"./logo.js";export*from"./nav-modules.js";export*from"./nav-user.js";export*from"./sidebar.js";var o={"./nav-sub-item":function(e){e.exports=r},"./sidebar-icons":function(r){r.exports=e}},t={};function n(r){var e=t[r];if(void 0!==e)return e.exports;var a=t[r]={exports:{}};return o[r](a,a.exports,n),a.exports}n.d=(r,e)=>{for(var o in e)n.o(e,o)&&!n.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},n.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),n.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var a={};n.r(a);var i=n("./nav-sub-item"),s={};for(var f in i)"default"!==f&&(s[f]=(function(r){return i[r]}).bind(0,f));n.d(a,s);var p=n("./sidebar-icons"),s={};for(var f in p)"default"!==f&&(s[f]=(function(r){return p[r]}).bind(0,f));n.d(a,s);
1
+ export*from"./app-sidebar.js";export*from"./logo.js";export*from"./nav-modules.js";export*from"./nav-sub-item.js";export*from"./nav-user.js";export*from"./sidebar.js";export*from"./sidebar-icons.js";
@@ -1 +1 @@
1
- import*as t from"./data-table-date-filter.js";import*as a from"./data-table-faceted-filter.js";import*as e from"./data-table-pagination.js";import*as r from"./data-table-slider-filter.js";export*from"./data-table.js";export*from"./data-table-action-bar.js";export*from"./data-table-advanced-toolbar.js";export*from"./data-table-column-header.js";export*from"./data-table-filter-list.js";export*from"./data-table-filter-menu.js";export*from"./data-table-range-filter.js";export*from"./data-table-skeleton.js";export*from"./data-table-sort-list.js";export*from"./data-table-toolbar.js";export*from"./data-table-view-options.js";var o={"@/components/data-table/data-table-date-filter":function(a){a.exports=t},"@/components/data-table/data-table-faceted-filter":function(t){t.exports=a},"@/components/data-table/data-table-pagination":function(t){t.exports=e},"@/components/data-table/data-table-slider-filter":function(t){t.exports=r}},n={};function l(t){var a=n[t];if(void 0!==a)return a.exports;var e=n[t]={exports:{}};return o[t](e,e.exports,l),e.exports}l.d=(t,a)=>{for(var e in a)l.o(a,e)&&!l.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:a[e]})},l.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),l.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var d={};l.r(d);var i=l("@/components/data-table/data-table-date-filter"),f={};for(var b in i)"default"!==b&&(f[b]=(function(t){return i[t]}).bind(0,b));l.d(d,f);var s=l("@/components/data-table/data-table-faceted-filter"),f={};for(var b in s)"default"!==b&&(f[b]=(function(t){return s[t]}).bind(0,b));l.d(d,f);var p=l("@/components/data-table/data-table-pagination"),f={};for(var b in p)"default"!==b&&(f[b]=(function(t){return p[t]}).bind(0,b));l.d(d,f);var m=l("@/components/data-table/data-table-slider-filter"),f={};for(var b in m)"default"!==b&&(f[b]=(function(t){return m[t]}).bind(0,b));l.d(d,f);
1
+ import*as t from"./data-table-date-filter.js";import*as a from"./data-table-faceted-filter.js";import*as e from"./data-table-pagination.js";import*as o from"./data-table-slider-filter.js";import*as r from"./data-table-view-options.js";export*from"./data-table.js";export*from"./data-table-action-bar.js";export*from"./data-table-advanced-toolbar.js";export*from"./data-table-column-header.js";export*from"./data-table-filter-list.js";export*from"./data-table-filter-menu.js";export*from"./data-table-range-filter.js";export*from"./data-table-skeleton.js";export*from"./data-table-sort-list.js";export*from"./data-table-toolbar.js";var n={"@/components/data-table/data-table-date-filter":function(a){a.exports=t},"@/components/data-table/data-table-faceted-filter":function(t){t.exports=a},"@/components/data-table/data-table-pagination":function(t){t.exports=e},"@/components/data-table/data-table-slider-filter":function(t){t.exports=o},"@/components/data-table/data-table-view-options":function(t){t.exports=r}},d={};function l(t){var a=d[t];if(void 0!==a)return a.exports;var e=d[t]={exports:{}};return n[t](e,e.exports,l),e.exports}l.d=(t,a)=>{for(var e in a)l.o(a,e)&&!l.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:a[e]})},l.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),l.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};l.r(i);var f=l("@/components/data-table/data-table-date-filter"),b={};for(var s in f)"default"!==s&&(b[s]=(function(t){return f[t]}).bind(0,s));l.d(i,b);var p=l("@/components/data-table/data-table-faceted-filter"),b={};for(var s in p)"default"!==s&&(b[s]=(function(t){return p[t]}).bind(0,s));l.d(i,b);var m=l("@/components/data-table/data-table-pagination"),b={};for(var s in m)"default"!==s&&(b[s]=(function(t){return m[t]}).bind(0,s));l.d(i,b);var c=l("@/components/data-table/data-table-slider-filter"),b={};for(var s in c)"default"!==s&&(b[s]=(function(t){return c[t]}).bind(0,s));l.d(i,b);var u=l("@/components/data-table/data-table-view-options"),b={};for(var s in u)"default"!==s&&(b[s]=(function(t){return u[t]}).bind(0,s));l.d(i,b);
@@ -1,8 +1,10 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Button } from '../button';
1
3
  import { Granularity } from '../../lib/date-picker';
2
4
  import { CalendarProps } from '../calendar';
3
5
  type DateTimePickerProps = {
4
6
  value?: Date | null;
5
- onChange?: (date: Date | undefined) => void;
7
+ onChange?: (date: Date | undefined | null) => void;
6
8
  onMonthChange?: (date: Date | undefined) => void;
7
9
  disabled?: boolean;
8
10
  /** showing `AM/PM` or not. */
@@ -35,13 +37,15 @@ type DateTimePickerProps = {
35
37
  defaultPopupValue?: Date;
36
38
  min?: Date;
37
39
  max?: Date;
40
+ triggerProps?: ComponentProps<typeof Button>;
41
+ hasCalendarIcon?: boolean;
38
42
  } & Pick<CalendarProps, 'locale' | 'weekStartsOn' | 'showWeekNumber' | 'showOutsideDays'>;
39
43
  type DateTimePickerRef = {
40
44
  value?: Date | null;
41
45
  } & Omit<HTMLButtonElement, 'value'>;
42
46
  declare const DateTimePicker: import("react").ForwardRefExoticComponent<{
43
47
  value?: Date | null;
44
- onChange?: (date: Date | undefined) => void;
48
+ onChange?: (date: Date | undefined | null) => void;
45
49
  onMonthChange?: (date: Date | undefined) => void;
46
50
  disabled?: boolean;
47
51
  /** showing `AM/PM` or not. */
@@ -74,6 +78,8 @@ declare const DateTimePicker: import("react").ForwardRefExoticComponent<{
74
78
  defaultPopupValue?: Date;
75
79
  min?: Date;
76
80
  max?: Date;
81
+ triggerProps?: ComponentProps<typeof Button>;
82
+ hasCalendarIcon?: boolean;
77
83
  } & Pick<CalendarProps, "locale" | "showOutsideDays" | "showWeekNumber" | "weekStartsOn"> & import("react").RefAttributes<Partial<DateTimePickerRef>>>;
78
84
  export { DateTimePicker };
79
85
  export type { DateTimePickerProps, DateTimePickerRef, Granularity };
@@ -1 +1 @@
1
- {"version":3,"file":"datetime-picker.d.ts","sourceRoot":"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;oBAC3B,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI;eACrC,OAAO;IAClB,8BAA8B;gBAClB,EAAE,GAAG,EAAE;kBACL,MAAM;IACpB;;;;;SAKK;gBACO,MAAM;IAClB;;;QAGI;oBACY;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IACpD;;;QAGI;kBACU,WAAW;gBACb,MAAM;IAClB;;QAEI;wBACgB,IAAI;UAClB,IAAI;UACJ,IAAI;sJA2MX,CAAA;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"datetime-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/datetime-picker/datetime-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EAMf,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAY,aAAa,EAAE,MAAM,aAAa,CAAA;AAGrD,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,KAAK,IAAI,CAAA;IAClD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;SAKK;IACL,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;QAGI;IACJ,aAAa,CAAC,EAAE;QAAE,MAAM,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 +1,2 @@
1
1
  'use client'
2
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{CalendarBlankIcon as t}from"@phosphor-icons/react";import{add as o,format as s}from"date-fns";import{forwardRef as i,useEffect as a,useImperativeHandle as n,useRef as l,useState as m}from"react";import{ptBR as d}from"react-day-picker/locale";import{Button as u}from"../button.js";import{Popover as c,PopoverContent as h,PopoverTrigger as p}from"../popover.js";import{cn as f}from"../../lib/utils.js";import{Calendar as g}from"../calendar.js";import{TimePicker as y}from"../time-picker/index.js";let b=i(({locale:i=d,defaultPopupValue:b=new Date(new Date().setHours(0,0,0,0)),value:H,onChange:M,onMonthChange:j,hourCycle:v=24,yearRange:w=50,disabled:x=!1,displayFormat:N,granularity:k="minute",placeholder:C="",className:D,min:S,max:T,...P},$)=>{let R,[q,z]=m(H??b),A=l(null),[B,E]=m(H??void 0);a(()=>{E(H)},[H]),n($,()=>({...A.current,value:B}),[B]);let F={hour24:N?.hour24??`dd/MM/yyyy HH:mm${!k||"second"===k?":ss":""}`,hour12:N?.hour12??`dd/MM/yyyy hh:mm${!k||"second"===k?":ss":""} b`},G=d,{options:I,localize:J,formatLong:K}=i;return I&&J&&K&&(G={...d,options:I,localize:J,formatLong:K}),S&&(R={before:S}),T&&(R={...R,after:T}),r(c,{children:[e(p,{disabled:x,asChild:!0,children:r(u,{variant:"outline",className:f("w-full justify-start gap-0 text-left font-normal",!B&&"text-muted-foreground",D),ref:A,children:[e(t,{className:"mr-2 h-4 w-4"}),B?s(B,24===v?F.hour24:F.hour12,{locale:G}):e("span",{children:C})]})}),r(h,{className:"w-auto p-0",children:[e(g,{mode:"single",selected:B||void 0,month:q,onSelect:e=>{e&&(e.setHours(q?.getHours()??0,q?.getMinutes()??0,q?.getSeconds()??0),e&&(M?.(e),z(e),E(e)))},onMonthChange:e=>{if(!e)return;if(!b){e.setHours(q?.getHours()??0,q?.getMinutes()??0,q?.getSeconds()??0),j?.(e),z(e);return}let r=e.getTime()-b.getTime(),t=o(b,{days:Math.ceil(r/864e5)});t.setHours(q?.getHours()??0,q?.getMinutes()??0,q?.getSeconds()??0),j?.(t),z(t)},yearRange:w,locale:i,disabled:R,...P}),"day"!==k&&e("div",{className:"border-border border-t p-3",children:e(y,{onChange:e=>{M?.(e),E(e),e&&z(e)},date:q,hourCycle:v,granularity:k})})]})]})});b.displayName="DateTimePicker";export{b as DateTimePicker};
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{CalendarBlankIcon as t}from"@phosphor-icons/react";import{add as o,format as s}from"date-fns";import{forwardRef as i,useEffect as a,useImperativeHandle as n,useRef as l,useState as m}from"react";import{ptBR as d}from"react-day-picker/locale";import{Button as u}from"../button.js";import{Popover as c,PopoverContent as h,PopoverTrigger as p}from"../popover.js";import{cn as f}from"../../lib/utils.js";import{Calendar as g}from"../calendar.js";import{TimePicker as y}from"../time-picker/index.js";let b=i(({locale:i=d,defaultPopupValue:b=new Date(new Date().setHours(0,0,0,0)),value:H,onChange:M,onMonthChange:j,hourCycle:v=24,yearRange:w=50,disabled:x=!1,displayFormat:N,granularity:k="minute",placeholder:C="",className:D,min:S,max:T,triggerProps:P,hasCalendarIcon:$=!0,...R},q)=>{let z,[A,B]=m(H??b),E=l(null),[F,G]=m(H??void 0);a(()=>{G(H)},[H]),n(q,()=>({...E.current,value:F}),[F]);let I={hour24:N?.hour24??`dd/MM/yyyy HH:mm${!k||"second"===k?":ss":""}`,hour12:N?.hour12??`dd/MM/yyyy hh:mm${!k||"second"===k?":ss":""} b`},J=d,{options:K,localize:L,formatLong:O}=i;return K&&L&&O&&(J={...d,options:K,localize:L,formatLong:O}),S&&(z={before:S}),T&&(z={...z,after:T}),r(c,{children:[e(p,{disabled:x,asChild:!0,children:r(u,{variant:"outline",className:f("w-full justify-start gap-0 text-left font-normal",!F&&"text-muted-foreground",D),ref:E,...P,children:[$&&e(t,{className:"mr-2 h-4 w-4"}),F?s(F,24===v?I.hour24:I.hour12,{locale:J}):e("span",{children:C})]})}),r(h,{className:"w-auto p-0",children:[e(g,{mode:"single",selected:F||void 0,month:A,onSelect:e=>{e&&(e.setHours(A?.getHours()??0,A?.getMinutes()??0,A?.getSeconds()??0),e&&(M?.(e),B(e),G(e)))},onMonthChange:e=>{if(!e)return;if(!b){e.setHours(A?.getHours()??0,A?.getMinutes()??0,A?.getSeconds()??0),j?.(e),B(e);return}let r=e.getTime()-b.getTime(),t=o(b,{days:Math.ceil(r/864e5)});t.setHours(A?.getHours()??0,A?.getMinutes()??0,A?.getSeconds()??0),j?.(t),B(t)},yearRange:w,locale:i,disabled:z,...R}),"day"!==k&&e("div",{className:"border-border border-t p-3",children:e(y,{onChange:e=>{M?.(e),G(e),e&&B(e)},date:A,hourCycle:v,granularity:k})})]})]})});b.displayName="DateTimePicker";export{b as DateTimePicker};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gbmtech/aurora-ui",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "main": "./dist/cjs/index.cjs",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",