@sigtes/ui 0.0.6 → 0.0.8
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/components/badge/Badge.d.ts +6 -0
- package/dist/components/badge/badgeVariants.d.ts +3 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/button/Button.d.ts +1 -5
- package/dist/components/button/buttonVariants.d.ts +4 -0
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/calendar/Calendar.d.ts +7 -0
- package/dist/components/calendar/DatePicker.d.ts +6 -0
- package/dist/components/calendar/DateRangePicker.d.ts +9 -0
- package/dist/components/calendar/index.d.ts +4 -0
- package/dist/components/card/Card.d.ts +8 -0
- package/dist/components/card/CardExample.d.ts +1 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +3 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/collapsible/Collapsible.d.ts +4 -0
- package/dist/components/collapsible/index.d.ts +1 -0
- package/dist/components/combobox/Combobox.d.ts +10 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/command/Command.d.ts +17 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/data-table-faceted-filter/data-table-faceted-filter.d.ts +17 -0
- package/dist/components/data-table-faceted-filter/index.d.ts +1 -0
- package/dist/components/dialog/Dialog.d.ts +14 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/form/Form.d.ts +23 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/popover/Popover.d.ts +6 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/separator/Separator.d.ts +3 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/sonner/Sonner.d.ts +2 -0
- package/dist/components/sonner/index.d.ts +3 -0
- package/dist/components/table/DataTable.d.ts +2 -8
- package/dist/components/tabs/Tabs.d.ts +6 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/textarea/Textarea.d.ts +2 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components.cjs.js +756 -0
- package/dist/components.es.js +29483 -0
- package/dist/globals.css +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/useErrors/index.d.ts +1 -0
- package/dist/hooks/useErrors/useErrors.d.ts +13 -0
- package/dist/hooks/useFormState/index.d.ts +1 -0
- package/dist/hooks/useFormState/useFormState.d.ts +19 -0
- package/dist/hooks.cjs.js +1 -0
- package/dist/hooks.es.js +52 -0
- package/dist/index.d.ts +19 -2
- package/dist/locale-provider-CMJmJPPz.js +1111 -0
- package/dist/locale-provider-muU_nRQs.cjs +22 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/locale-provider/index.d.ts +1 -0
- package/dist/providers/locale-provider/locale-provider.d.ts +11 -0
- package/dist/providers/theme-provider/ThemeProvider.d.ts +3 -0
- package/dist/providers/theme-provider/index.d.ts +2 -0
- package/dist/providers/user-provider/UserProvider.d.ts +25 -0
- package/dist/providers/user-provider/index.d.ts +1 -0
- package/dist/providers.cjs.js +1 -0
- package/dist/providers.es.js +128 -0
- package/package.json +28 -7
- package/dist/_virtual/jsx-runtime.cjs.js +0 -1
- package/dist/_virtual/jsx-runtime.cjs2.js +0 -1
- package/dist/_virtual/jsx-runtime.es.js +0 -5
- package/dist/_virtual/jsx-runtime.es2.js +0 -4
- package/dist/_virtual/react-jsx-runtime.development.cjs.js +0 -1
- package/dist/_virtual/react-jsx-runtime.development.es.js +0 -4
- package/dist/_virtual/react-jsx-runtime.production.cjs.js +0 -1
- package/dist/_virtual/react-jsx-runtime.production.es.js +0 -4
- package/dist/dist/_virtual/jsx-runtime.es.cjs.js +0 -1
- package/dist/dist/_virtual/jsx-runtime.es.es.js +0 -5
- package/dist/dist/_virtual/jsx-runtime.es2.cjs.js +0 -1
- package/dist/dist/_virtual/jsx-runtime.es2.es.js +0 -4
- package/dist/dist/_virtual/react-jsx-runtime.development.es.cjs.js +0 -1
- package/dist/dist/_virtual/react-jsx-runtime.development.es.es.js +0 -4
- package/dist/dist/_virtual/react-jsx-runtime.production.es.cjs.js +0 -1
- package/dist/dist/_virtual/react-jsx-runtime.production.es.es.js +0 -4
- package/dist/dist/dist/_virtual/jsx-runtime.es.es.cjs.js +0 -1
- package/dist/dist/dist/_virtual/jsx-runtime.es.es.es.js +0 -2
- package/dist/dist/dist/_virtual/jsx-runtime.es2.es.cjs.js +0 -1
- package/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.js +0 -4
- package/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.cjs.js +0 -1
- package/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.js +0 -4
- package/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.cjs.js +0 -1
- package/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.js +0 -4
- package/dist/dist/dist/dist/_virtual/jsx-runtime.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/_virtual/jsx-runtime.es.es.es.es.js +0 -2
- package/dist/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.es.js +0 -4
- package/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es.es.es.es.es.js +0 -2
- package/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es.es.es.es.es.es.js +0 -2
- package/dist/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/dist/_virtual/jsx-runtime.es2.es.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.es.es.es.js +0 -4
- package/dist/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.es.es.cjs.js +0 -14
- package/dist/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.es.es.es.js +0 -247
- package/dist/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.es.es.cjs.js +0 -9
- package/dist/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.es.es.es.js +0 -35
- package/dist/dist/dist/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.es.es.es.js +0 -10
- package/dist/dist/dist/dist/dist/dist/src/components/button/Button.es.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/dist/src/components/button/Button.es.es.es.es.es.es.js +0 -31
- package/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.es.cjs.js +0 -14
- package/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.es.es.js +0 -247
- package/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.es.cjs.js +0 -9
- package/dist/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.es.es.js +0 -35
- package/dist/dist/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.es.es.js +0 -10
- package/dist/dist/dist/dist/dist/src/components/button/Button.es.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/dist/src/components/button/Button.es.es.es.es.es.js +0 -31
- package/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.cjs.js +0 -14
- package/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.es.js +0 -247
- package/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.cjs.js +0 -9
- package/dist/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.es.js +0 -35
- package/dist/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.es.js +0 -10
- package/dist/dist/dist/dist/src/components/button/Button.es.es.es.cjs.js +0 -1
- package/dist/dist/dist/dist/src/components/button/Button.es.es.es.es.js +0 -31
- package/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.cjs.js +0 -14
- package/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.es.js +0 -247
- package/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.cjs.js +0 -9
- package/dist/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.es.js +0 -35
- package/dist/dist/dist/node_modules/react/jsx-runtime.es.es.cjs.js +0 -1
- package/dist/dist/dist/node_modules/react/jsx-runtime.es.es.es.js +0 -10
- package/dist/dist/dist/src/components/button/Button.es.es.cjs.js +0 -1
- package/dist/dist/dist/src/components/button/Button.es.es.es.js +0 -31
- package/dist/dist/node_modules/clsx/dist/clsx.es.cjs.js +0 -1
- package/dist/dist/node_modules/clsx/dist/clsx.es.es.js +0 -17
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.cjs.js +0 -14
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.es.es.js +0 -247
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.cjs.js +0 -9
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.es.es.js +0 -35
- package/dist/dist/node_modules/react/jsx-runtime.es.cjs.js +0 -1
- package/dist/dist/node_modules/react/jsx-runtime.es.es.js +0 -10
- package/dist/dist/src/components/button/Button.es.cjs.js +0 -1
- package/dist/dist/src/components/button/Button.es.es.js +0 -51
- package/dist/dist/src/utils/utils.es.cjs.js +0 -1
- package/dist/dist/src/utils/utils.es.es.js +0 -8
- package/dist/node_modules/clsx/dist/clsx.cjs.js +0 -1
- package/dist/node_modules/clsx/dist/clsx.es.js +0 -17
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +0 -14
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +0 -247
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.cjs.js +0 -9
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.es.js +0 -35
- package/dist/node_modules/react/jsx-runtime.cjs.js +0 -1
- package/dist/node_modules/react/jsx-runtime.es.js +0 -10
- package/dist/src/components/button/Button.cjs.js +0 -1
- package/dist/src/components/button/Button.es.js +0 -51
- package/dist/src/components/dropdown-menu/Dropdown-Menu.cjs.js +0 -1
- package/dist/src/components/dropdown-menu/Dropdown-Menu.es.js +0 -250
- package/dist/src/components/input/Input.cjs.js +0 -1
- package/dist/src/components/input/Input.es.js +0 -26
- package/dist/src/components/label/Label.cjs.js +0 -1
- package/dist/src/components/label/Label.es.js +0 -24
- package/dist/src/components/select/Select.cjs.js +0 -1
- package/dist/src/components/select/Select.es.js +0 -171
- package/dist/src/components/table/DargableRow.cjs.js +0 -1
- package/dist/src/components/table/DargableRow.es.js +0 -54
- package/dist/src/components/table/DataTable.cjs.js +0 -1
- package/dist/src/components/table/DataTable.es.js +0 -321
- package/dist/src/components/table/DragHandle.cjs.js +0 -1
- package/dist/src/components/table/DragHandle.es.js +0 -45
- package/dist/src/components/table/Table.cjs.js +0 -1
- package/dist/src/components/table/Table.es.js +0 -125
- package/dist/src/index.cjs.js +0 -1
- package/dist/src/index.es.js +0 -52
- package/dist/src/utils/utils.cjs.js +0 -1
- package/dist/src/utils/utils.es.js +0 -8
@@ -0,0 +1,22 @@
|
|
1
|
+
"use client";"use strict";const k=require("react");var _={exports:{}},P={};/**
|
2
|
+
* @license React
|
3
|
+
* react-jsx-runtime.production.js
|
4
|
+
*
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/var z;function de(){if(z)return P;z=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(r,i,u){var d=null;if(u!==void 0&&(d=""+u),i.key!==void 0&&(d=""+i.key),"key"in i){u={};for(var l in i)l!=="key"&&(u[l]=i[l])}else u=i;return i=u.ref,{$$typeof:t,type:r,key:d,ref:i!==void 0?i:null,props:u}}return P.Fragment=n,P.jsx=a,P.jsxs=a,P}var E={};/**
|
10
|
+
* @license React
|
11
|
+
* react-jsx-runtime.development.js
|
12
|
+
*
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
14
|
+
*
|
15
|
+
* This source code is licensed under the MIT license found in the
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
17
|
+
*/var V;function ce(){return V||(V=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case Z:return"Profiler";case G:return"StrictMode";case ae:return"Suspense";case ne:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case ee:return(e.displayName||"Context")+".Provider";case K:return(e._context.displayName||"Context")+".Consumer";case te:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return o=e.displayName||null,o!==null?o:t(e.type)||"Memo";case D:o=e._payload,e=e._init;try{return t(e(o))}catch{}}return null}function n(e){return""+e}function a(e){try{n(e);var o=!1}catch{o=!0}if(o){o=console;var s=o.error,c=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",c),n(e)}}function r(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===D)return"<...>";try{var o=t(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function i(){var e=S.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function d(e){if(N.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function l(e,o){function s(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function M(){var e=t(this.type);return F[e]||(F[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function v(e,o,s,c,g,h,x,A){return s=h.ref,e={$$typeof:C,type:e,key:o,props:h,_owner:g},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:M}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function T(e,o,s,c,g,h,x,A){var m=o.children;if(m!==void 0)if(c)if(se(m)){for(c=0;c<m.length;c++)y(m[c]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(m);if(N.call(o,"key")){m=t(e);var p=Object.keys(o).filter(function(ue){return ue!=="key"});c=0<p.length?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}",Y[m+c]||(p=0<p.length?"{"+p.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
18
|
+
let props = %s;
|
19
|
+
<%s {...props} />
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
21
|
+
let props = %s;
|
22
|
+
<%s key={someKey} {...props} />`,c,m,p,m),Y[m+c]=!0)}if(m=null,s!==void 0&&(a(s),m=""+s),d(o)&&(a(o.key),m=""+o.key),"key"in o){s={};for(var O in o)O!=="key"&&(s[O]=o[O])}else s=o;return m&&l(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),v(e,m,h,g,i(),s,x,A)}function y(e){typeof e=="object"&&e!==null&&e.$$typeof===C&&e._store&&(e._store.validated=1)}var R=k,C=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ie=Symbol.for("react.client.reference"),S=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,se=Array.isArray,W=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var $,F={},q=R.react_stack_bottom_frame.bind(R,u)(),L=W(r(u)),Y={};E.Fragment=j,E.jsx=function(e,o,s,c,g){var h=1e4>S.recentlyCreatedOwnerStacks++;return T(e,o,s,!1,c,g,h?Error("react-stack-top-frame"):q,h?W(r(e)):L)},E.jsxs=function(e,o,s,c,g){var h=1e4>S.recentlyCreatedOwnerStacks++;return T(e,o,s,!0,c,g,h?Error("react-stack-top-frame"):q,h?W(r(e)):L)}})()),E}var X;function me(){return X||(X=1,process.env.NODE_ENV==="production"?_.exports=de():_.exports=ce()),_.exports}var J=me();const le={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},he=(t,n,a)=>{let r;const i=le[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+r:r+" ago":r};function w(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}const fe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},be={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ge={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ve={date:w({formats:fe,defaultWidth:"full"}),time:w({formats:be,defaultWidth:"full"}),dateTime:w({formats:ge,defaultWidth:"full"})},ye={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pe=(t,n,a,r)=>ye[t];function f(t){return(n,a)=>{const r=a?.context?String(a.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const d=t.defaultFormattingWidth||t.defaultWidth,l=a?.width?String(a.width):d;i=t.formattingValues[l]||t.formattingValues[d]}else{const d=t.defaultWidth,l=a?.width?String(a.width):t.defaultWidth;i=t.values[l]||t.values[d]}const u=t.argumentCallback?t.argumentCallback(n):n;return i[u]}}const we={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Pe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ee={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ke={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Me={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Te={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Re=(t,n)=>{const a=Number(t),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},_e={ordinalNumber:Re,era:f({values:we,defaultWidth:"wide"}),quarter:f({values:Pe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:f({values:Ee,defaultWidth:"wide"}),day:f({values:ke,defaultWidth:"wide"}),dayPeriod:f({values:Me,defaultWidth:"wide",formattingValues:Te,defaultFormattingWidth:"wide"})};function b(t){return(n,a={})=>{const r=a.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],u=n.match(i);if(!u)return null;const d=u[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],M=Array.isArray(l)?Se(l,y=>y.test(d)):je(l,y=>y.test(d));let v;v=t.valueCallback?t.valueCallback(M):M,v=a.valueCallback?a.valueCallback(v):v;const T=n.slice(d.length);return{value:v,rest:T}}}function je(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function Se(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function H(t){return(n,a={})=>{const r=n.match(t.matchPattern);if(!r)return null;const i=r[0],u=n.match(t.parsePattern);if(!u)return null;let d=t.valueCallback?t.valueCallback(u[0]):u[0];d=a.valueCallback?a.valueCallback(d):d;const l=n.slice(i.length);return{value:d,rest:l}}}const We=/^(\d+)(th|st|nd|rd)?/i,xe=/\d+/i,Ae={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Oe={any:[/^b/i,/^(a|c)/i]},Ce={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},De={any:[/1/i,/2/i,/3/i,/4/i]},Ne={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},$e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Fe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Le={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ye={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ze={ordinalNumber:H({matchPattern:We,parsePattern:xe,valueCallback:t=>parseInt(t,10)}),era:b({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any"}),quarter:b({matchPatterns:Ce,defaultMatchWidth:"wide",parsePatterns:De,defaultParseWidth:"any",valueCallback:t=>t+1}),month:b({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:$e,defaultParseWidth:"any"}),day:b({matchPatterns:Fe,defaultMatchWidth:"wide",parsePatterns:qe,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:Le,defaultMatchWidth:"any",parsePatterns:Ye,defaultParseWidth:"any"})},U={code:"en-US",formatDistance:he,formatLong:ve,formatRelative:pe,localize:_e,match:ze,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ve={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},Xe=(t,n,a)=>{let r;const i=Ve[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",String(n)),a?.addSuffix?a.comparison&&a.comparison>0?"em "+r:"há "+r:r},Ie={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Je={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},He={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ue={date:w({formats:Ie,defaultWidth:"full"}),time:w({formats:Je,defaultWidth:"full"}),dateTime:w({formats:He,defaultWidth:"full"})},Qe={lastWeek:t=>{const n=t.getDay();return"'"+(n===0||n===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Be=(t,n,a,r)=>{const i=Qe[t];return typeof i=="function"?i(n):i},Ge={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Ze={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Ke={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},et={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},tt={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},at={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},nt=(t,n)=>{const a=Number(t);return n?.unit==="week"?a+"ª":a+"º"},rt={ordinalNumber:nt,era:f({values:Ge,defaultWidth:"wide"}),quarter:f({values:Ze,defaultWidth:"wide",argumentCallback:t=>t-1}),month:f({values:Ke,defaultWidth:"wide"}),day:f({values:et,defaultWidth:"wide"}),dayPeriod:f({values:tt,defaultWidth:"wide",formattingValues:at,defaultFormattingWidth:"wide"})},ot=/^(\d+)[ºªo]?/i,it=/\d+/i,st={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},ut={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},dt={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ct={any:[/1/i,/2/i,/3/i,/4/i]},mt={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},lt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},ht={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},ft={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},bt={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},gt={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},vt={ordinalNumber:H({matchPattern:ot,parsePattern:it,valueCallback:t=>parseInt(t,10)}),era:b({matchPatterns:st,defaultMatchWidth:"wide",parsePatterns:ut,defaultParseWidth:"any"}),quarter:b({matchPatterns:dt,defaultMatchWidth:"wide",parsePatterns:ct,defaultParseWidth:"any",valueCallback:t=>t+1}),month:b({matchPatterns:mt,defaultMatchWidth:"wide",parsePatterns:lt,defaultParseWidth:"any"}),day:b({matchPatterns:ht,defaultMatchWidth:"wide",parsePatterns:ft,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:bt,defaultMatchWidth:"any",parsePatterns:gt,defaultParseWidth:"any"})},yt={code:"pt-BR",formatDistance:Xe,formatLong:Ue,formatRelative:Be,localize:rt,match:vt,options:{weekStartsOn:0,firstWeekContainsDate:1}},I={ptBR:yt,enUS:U},Q=k.createContext({locale:void 0});function pt(){return k.useContext(Q)}function wt({locale:t,children:n}){const[a,r]=k.useState(I[t]);k.useEffect(()=>{r(I[t])},[t]);const i={locale:a};return J.jsx(Q.Provider,{value:i,children:n})}exports.LocaleProvider=wt;exports.enUS=U;exports.jsxRuntimeExports=J;exports.useLocale=pt;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './locale-provider';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from 'react-day-picker/locale';
|
2
|
+
import { PropsWithChildren } from 'react';
|
3
|
+
type SupportedLocalesType = "ptBR" | "enUS";
|
4
|
+
type LocaleContextType = {
|
5
|
+
locale: Locale | undefined;
|
6
|
+
};
|
7
|
+
export declare function useLocale(): LocaleContextType;
|
8
|
+
export declare function LocaleProvider({ locale, children, }: PropsWithChildren<{
|
9
|
+
locale: SupportedLocalesType;
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
11
|
+
export {};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
interface UserProps {
|
3
|
+
id: string;
|
4
|
+
username: string;
|
5
|
+
email: string;
|
6
|
+
created_at: Date | null;
|
7
|
+
updated_at: Date | null;
|
8
|
+
features: Array<string>;
|
9
|
+
}
|
10
|
+
interface IUserContext {
|
11
|
+
user: UserProps;
|
12
|
+
isLoading: boolean;
|
13
|
+
fetchUser: () => Promise<void>;
|
14
|
+
logout: () => Promise<void>;
|
15
|
+
login: (email: string, password: string) => Promise<boolean>;
|
16
|
+
}
|
17
|
+
interface MyComponentProps {
|
18
|
+
sessionEndPoint: string;
|
19
|
+
userEndPoint: string;
|
20
|
+
children?: ReactNode;
|
21
|
+
useMock?: boolean;
|
22
|
+
}
|
23
|
+
export declare function UserProvider({ children, sessionEndPoint, userEndPoint, useMock, }: MyComponentProps): import("react/jsx-runtime").JSX.Element;
|
24
|
+
export declare function useUser(): IUserContext;
|
25
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './UserProvider';
|
@@ -0,0 +1 @@
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./locale-provider-muU_nRQs.cjs"),t=require("react"),y=require("next-themes");function T({children:d,...o}){return i.jsxRuntimeExports.jsx(y.ThemeProvider,{...o,children:d})}const c={id:"",username:"",email:"",created_at:null,updated_at:null,features:[]},u={id:"123456",username:"admin",email:"admin@admin.com",created_at:new Date,updated_at:new Date,features:["features"]},h=t.createContext({user:c,isLoading:!0,fetchUser:async()=>{},logout:async()=>{},login:async()=>!1});function C({children:d,sessionEndPoint:o,userEndPoint:m,useMock:p=!1}){const[f,s]=t.useState(c),[l,g]=t.useState(!0),a=t.useCallback(async()=>{try{const e=await fetch(m),r=await e.json();if(e.status==200){const n=r;s(n),localStorage.setItem("user",JSON.stringify(n))}else s(c),localStorage.removeItem("user")}catch(e){console.log(e)}},[m]);t.useEffect(()=>{const e=localStorage.getItem("user");(async()=>(e&&l&&await a(),g(!1)))()},[a,l]);const S=t.useCallback(async()=>{try{if((await fetch(o,{method:"DELETE",credentials:"include"})).status==200){const r=localStorage.getItem("theme")||"system";localStorage.clear(),localStorage.setItem("theme",r),s(c),g(!1)}}catch(e){console.log(e)}},[o]),U=t.useCallback(async(e,r)=>{try{return(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})})).status===201?(a(),!0):!1}catch(n){return console.log(n),!1}},[a,o]);t.useEffect(()=>{const e=localStorage.getItem("user");e&&s(JSON.parse(e))},[a]);const v={user:f,isLoading:l,fetchUser:a,logout:S,login:U},x={user:f,isLoading:l,fetchUser:async()=>{s(u),console.log(u)},logout:async()=>{s(c),console.log(c)},login:async(e,r)=>(console.log(e,r),s(u),console.log(u),!0)};return i.jsxRuntimeExports.jsx(h.Provider,{value:p?x:v,children:d})}function b(){return t.useContext(h)}exports.LocaleProvider=i.LocaleProvider;exports.useLocale=i.useLocale;Object.defineProperty(exports,"useTheme",{enumerable:!0,get:()=>y.useTheme});exports.ThemeProvider=T;exports.UserProvider=C;exports.useUser=b;
|
@@ -0,0 +1,128 @@
|
|
1
|
+
"use client";
|
2
|
+
import { j as h } from "./locale-provider-CMJmJPPz.js";
|
3
|
+
import { L as b, u as k } from "./locale-provider-CMJmJPPz.js";
|
4
|
+
import { createContext as w, useState as d, useCallback as i, useEffect as p, useContext as C } from "react";
|
5
|
+
import { ThemeProvider as I } from "next-themes";
|
6
|
+
import { useTheme as B } from "next-themes";
|
7
|
+
function _({
|
8
|
+
children: u,
|
9
|
+
...o
|
10
|
+
}) {
|
11
|
+
return /* @__PURE__ */ h.jsx(I, { ...o, children: u });
|
12
|
+
}
|
13
|
+
const a = {
|
14
|
+
id: "",
|
15
|
+
username: "",
|
16
|
+
email: "",
|
17
|
+
created_at: null,
|
18
|
+
updated_at: null,
|
19
|
+
features: []
|
20
|
+
}, l = {
|
21
|
+
id: "123456",
|
22
|
+
username: "admin",
|
23
|
+
email: "admin@admin.com",
|
24
|
+
created_at: /* @__PURE__ */ new Date(),
|
25
|
+
updated_at: /* @__PURE__ */ new Date(),
|
26
|
+
features: ["features"]
|
27
|
+
}, y = w({
|
28
|
+
user: a,
|
29
|
+
isLoading: !0,
|
30
|
+
fetchUser: async () => {
|
31
|
+
},
|
32
|
+
logout: async () => {
|
33
|
+
},
|
34
|
+
login: async () => !1
|
35
|
+
});
|
36
|
+
function D({
|
37
|
+
children: u,
|
38
|
+
sessionEndPoint: o,
|
39
|
+
userEndPoint: m,
|
40
|
+
useMock: x = !1
|
41
|
+
}) {
|
42
|
+
const [f, t] = d(a), [c, g] = d(!0), r = i(async () => {
|
43
|
+
try {
|
44
|
+
const e = await fetch(m), s = await e.json();
|
45
|
+
if (e.status == 200) {
|
46
|
+
const n = s;
|
47
|
+
t(n), localStorage.setItem("user", JSON.stringify(n));
|
48
|
+
} else
|
49
|
+
t(a), localStorage.removeItem("user");
|
50
|
+
} catch (e) {
|
51
|
+
console.log(e);
|
52
|
+
}
|
53
|
+
}, [m]);
|
54
|
+
p(() => {
|
55
|
+
const e = localStorage.getItem("user");
|
56
|
+
(async () => (e && c && await r(), g(!1)))();
|
57
|
+
}, [r, c]);
|
58
|
+
const S = i(async () => {
|
59
|
+
try {
|
60
|
+
if ((await fetch(o, {
|
61
|
+
method: "DELETE",
|
62
|
+
credentials: "include"
|
63
|
+
})).status == 200) {
|
64
|
+
const s = localStorage.getItem("theme") || "system";
|
65
|
+
localStorage.clear(), localStorage.setItem("theme", s), t(a), g(!1);
|
66
|
+
}
|
67
|
+
} catch (e) {
|
68
|
+
console.log(e);
|
69
|
+
}
|
70
|
+
}, [o]), U = i(
|
71
|
+
async (e, s) => {
|
72
|
+
try {
|
73
|
+
return (await fetch(o, {
|
74
|
+
method: "POST",
|
75
|
+
headers: {
|
76
|
+
"Content-Type": "application/json"
|
77
|
+
},
|
78
|
+
body: JSON.stringify({
|
79
|
+
email: e,
|
80
|
+
password: s
|
81
|
+
})
|
82
|
+
})).status === 201 ? (r(), !0) : !1;
|
83
|
+
} catch (n) {
|
84
|
+
return console.log(n), !1;
|
85
|
+
}
|
86
|
+
},
|
87
|
+
[r, o]
|
88
|
+
);
|
89
|
+
p(() => {
|
90
|
+
const e = localStorage.getItem("user");
|
91
|
+
e && t(JSON.parse(e));
|
92
|
+
}, [r]);
|
93
|
+
const v = {
|
94
|
+
user: f,
|
95
|
+
isLoading: c,
|
96
|
+
fetchUser: r,
|
97
|
+
logout: S,
|
98
|
+
login: U
|
99
|
+
}, T = {
|
100
|
+
user: f,
|
101
|
+
isLoading: c,
|
102
|
+
fetchUser: async () => {
|
103
|
+
t(l), console.log(l);
|
104
|
+
},
|
105
|
+
logout: async () => {
|
106
|
+
t(a), console.log(a);
|
107
|
+
},
|
108
|
+
login: async (e, s) => (console.log(e, s), t(l), console.log(l), !0)
|
109
|
+
};
|
110
|
+
return /* @__PURE__ */ h.jsx(
|
111
|
+
y.Provider,
|
112
|
+
{
|
113
|
+
value: x ? T : v,
|
114
|
+
children: u
|
115
|
+
}
|
116
|
+
);
|
117
|
+
}
|
118
|
+
function J() {
|
119
|
+
return C(y);
|
120
|
+
}
|
121
|
+
export {
|
122
|
+
b as LocaleProvider,
|
123
|
+
_ as ThemeProvider,
|
124
|
+
D as UserProvider,
|
125
|
+
k as useLocale,
|
126
|
+
B as useTheme,
|
127
|
+
J as useUser
|
128
|
+
};
|
package/package.json
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sigtes/ui",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.8",
|
4
4
|
"type": "module",
|
5
5
|
"exports": {
|
6
6
|
".": {
|
7
7
|
"types": "./dist/index.d.ts",
|
8
|
-
"import": "./dist/
|
9
|
-
"require": "./dist/
|
8
|
+
"import": "./dist/components.es.js",
|
9
|
+
"require": "./dist/components.cjs.js"
|
10
|
+
},
|
11
|
+
"./providers": {
|
12
|
+
"types": "./dist/providers/index.d.ts",
|
13
|
+
"import": "./dist/providers.es.js",
|
14
|
+
"require": "./dist/providers.cjs.js"
|
15
|
+
},
|
16
|
+
"./hooks": {
|
17
|
+
"types": "./dist/hooks/index.d.ts",
|
18
|
+
"import": "./dist/hooks.es.js",
|
19
|
+
"require": "./dist/hooks.cjs.js"
|
10
20
|
},
|
11
21
|
"./styles.css": "./dist/globals.css"
|
12
22
|
},
|
@@ -14,7 +24,7 @@
|
|
14
24
|
"dist"
|
15
25
|
],
|
16
26
|
"scripts": {
|
17
|
-
"dev": "vite",
|
27
|
+
"dev": "tsc -b tsconfig.build.json && vite build --watch",
|
18
28
|
"build": "tsc -b tsconfig.build.json && vite build",
|
19
29
|
"lint": "eslint .",
|
20
30
|
"preview": "vite preview",
|
@@ -23,22 +33,33 @@
|
|
23
33
|
"prepublishOnly": "npm run build"
|
24
34
|
},
|
25
35
|
"peerDependencies": {
|
26
|
-
"react": "^19.1.0",
|
27
|
-
"react-dom": "^19.1.0",
|
28
36
|
"@dnd-kit/core": "^6.3.1",
|
29
37
|
"@dnd-kit/modifiers": "^9.0.0",
|
30
38
|
"@dnd-kit/sortable": "^10.0.0",
|
31
39
|
"@dnd-kit/utilities": "^3.2.2",
|
40
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
41
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
32
42
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
33
43
|
"@radix-ui/react-label": "^2.1.7",
|
44
|
+
"@radix-ui/react-popover": "^1.1.15",
|
34
45
|
"@radix-ui/react-select": "^2.2.6",
|
46
|
+
"@radix-ui/react-separator": "^1.1.7",
|
35
47
|
"@radix-ui/react-slot": "^1.2.3",
|
36
48
|
"@tabler/icons-react": "^3.35.0",
|
37
49
|
"@tailwindcss/vite": "^4.1.13",
|
38
50
|
"@tanstack/react-table": "^8.21.3",
|
39
51
|
"class-variance-authority": "^0.7.1",
|
52
|
+
"cmdk": "^1.1.1",
|
40
53
|
"lucide-react": "^0.544.0",
|
41
|
-
"
|
54
|
+
"react": "^19.1.0",
|
55
|
+
"react-day-picker": "^9.11.0",
|
56
|
+
"react-dom": "^19.1.0",
|
57
|
+
"react-hook-form": "^7.63.0",
|
58
|
+
"tailwind-merge": "^3.3.1",
|
59
|
+
"@hookform/resolvers": "^5.2.2",
|
60
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
61
|
+
"next-themes": "^0.4.6",
|
62
|
+
"sonner": "^2.0.7"
|
42
63
|
},
|
43
64
|
"devDependencies": {
|
44
65
|
"@chromatic-com/storybook": "^4.1.1",
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../node_modules/react/jsx-runtime.cjs.js");var t=e.__require();exports.jsxRuntimeExports=t;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../node_modules/react/jsx-runtime.es.cjs.js");var r=e.__require();exports.j=r;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";const e=require("../node_modules/react/jsx-runtime.es.es.cjs.js");e.__require();
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";const e=require("../node_modules/react/jsx-runtime.es.es.es.cjs.js");e.__require();
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";const e=require("../node_modules/react/jsx-runtime.es.es.es.es.cjs.js");e.__require();
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";const e=require("../node_modules/react/jsx-runtime.es.es.es.es.es.cjs.js");e.__require();
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
package/dist/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.development.es.es.es.es.es.cjs.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
package/dist/dist/dist/dist/dist/dist/_virtual/react-jsx-runtime.production.es.es.es.es.es.cjs.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../_virtual/react-jsx-runtime.development.es.es.es.es.es.cjs.js"),B=require("react");/**
|
2
|
-
* @license React
|
3
|
-
* react-jsx-runtime.development.js
|
4
|
-
*
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
|
-
*
|
7
|
-
* This source code is licensed under the MIT license found in the
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var E;function H(){return E||(E=1,process.env.NODE_ENV!=="production"&&(function(){function c(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case U:return"Profiler";case I:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case F:return"Portal";case q:return(e.displayName||"Context")+".Provider";case J:return(e._context.displayName||"Context")+".Consumer";case K:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return r=e.displayName||null,r!==null?r:c(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return c(e(r))}catch{}}return null}function g(e){return""+e}function v(e){try{g(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),g(e)}}function f(e){if(e===y)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=c(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function A(){var e=p.A;return e===null?null:e.getOwner()}function S(){return Error("react-stack-top-frame")}function $(e){if(w.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function C(e,r){function t(){x||(x=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function z(){var e=c(this.type);return N[e]||(N[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function D(e,r,t,n,s,a,b,d){return t=a.ref,e={$$typeof:h,type:e,key:r,props:a,_owner:s},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:z}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:b}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:d}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function k(e,r,t,n,s,a,b,d){var o=r.children;if(o!==void 0)if(n)if(Y(o)){for(n=0;n<o.length;n++)j(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(o);if(w.call(r,"key")){o=c(e);var l=Object.keys(r).filter(function(G){return G!=="key"});n=0<l.length?"{key: someKey, "+l.join(": ..., ")+": ...}":"{key: someKey}",P[o+n]||(l=0<l.length?"{"+l.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
10
|
-
let props = %s;
|
11
|
-
<%s {...props} />
|
12
|
-
React keys must be passed directly to JSX without using spread:
|
13
|
-
let props = %s;
|
14
|
-
<%s key={someKey} {...props} />`,n,o,l,o),P[o+n]=!0)}if(o=null,t!==void 0&&(v(t),o=""+t),$(r)&&(v(r.key),o=""+r.key),"key"in r){t={};for(var _ in r)_!=="key"&&(t[_]=r[_])}else t=r;return o&&C(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),D(e,o,a,s,A(),t,b,d)}function j(e){typeof e=="object"&&e!==null&&e.$$typeof===h&&e._store&&(e._store.validated=1)}var u=B,h=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),q=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),p=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=Object.prototype.hasOwnProperty,Y=Array.isArray,m=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(e){return e()}};var x,N={},R=u.react_stack_bottom_frame.bind(u,S)(),T=m(f(S)),P={};i.__exports.Fragment=y,i.__exports.jsx=function(e,r,t,n,s){var a=1e4>p.recentlyCreatedOwnerStacks++;return k(e,r,t,!1,n,s,a?Error("react-stack-top-frame"):R,a?m(f(e)):T)},i.__exports.jsxs=function(e,r,t,n,s){var a=1e4>p.recentlyCreatedOwnerStacks++;return k(e,r,t,!0,n,s,a?Error("react-stack-top-frame"):R,a?m(f(e)):T)}})()),i.__exports}exports.__require=H;
|