naria-ui 0.1.34 → 0.1.36
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/README.md +76 -87
- package/dist/lib/components/Input/Input.d.ts +16 -0
- package/dist/lib/components/Select/Select.d.ts +15 -0
- package/dist/lib/components/Select/index.d.ts +1 -0
- package/dist/{components → lib/components}/index.d.ts +1 -0
- package/dist/lib/utils/navigator.d.ts +3 -0
- package/dist/naria-ui.cjs.js +7 -4
- package/dist/naria-ui.css +1 -0
- package/dist/naria-ui.es.js +331 -142
- package/package.json +7 -4
- package/dist/components/Input/Input.d.ts +0 -6
- /package/dist/{components → lib/components}/Button/Button.d.ts +0 -0
- /package/dist/{components → lib/components}/Button/index.d.ts +0 -0
- /package/dist/{components → lib/components}/Input/index.d.ts +0 -0
- /package/dist/{index.d.ts → lib/index.d.ts} +0 -0
- /package/dist/{utils → lib/utils}/capitalize.d.ts +0 -0
- /package/dist/{utils → lib/utils}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,87 +1,76 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/naria-ui)
|
|
4
|
-
[](https://www.npmjs.com/package/naria-ui)
|
|
5
|
-
[](https://github.com/JanardanPethani/naria-ui)
|
|
6
|
-
|
|
7
|
-
<!-- Add a license badge if you add a LICENSE file, e.g. MIT:
|
|
8
|
-
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
Generate emojis, GIFs, and stickers as per user mood.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ✨ Features
|
|
16
|
-
|
|
17
|
-
- Generate mood-based emojis, memes, and slogans
|
|
18
|
-
- React component for easy integration
|
|
19
|
-
- No configuration required
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 📦 Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install naria-ui
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 🚀 Usage
|
|
32
|
-
|
|
33
|
-
Here's a simple example using the main `Chat` component in your React app:
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import React from "react";
|
|
37
|
-
import { Chat } from "naria-ui";
|
|
38
|
-
|
|
39
|
-
function App() {
|
|
40
|
-
return (
|
|
41
|
-
<div>
|
|
42
|
-
<h1>Genmoji Demo</h1>
|
|
43
|
-
<Chat />
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default App;
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The `Chat` component provides a floating button. Click it, enter your mood, and get relevant emojis, memes, and slogans instantly!
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## 📚 API
|
|
56
|
-
|
|
57
|
-
- **`<Chat />`**
|
|
58
|
-
A ready-to-use React component for mood-based emoji, meme, and slogan generation.
|
|
59
|
-
|
|
60
|
-
- **`generateResponse(input: string): Promise<{ memes: string[], emojis: string[], slogans: string[] }>`**
|
|
61
|
-
Utility function to generate content programmatically.
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## 🛠 Configuration
|
|
66
|
-
|
|
67
|
-
No configuration or environment variables are required.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Feel free to open issues or pull requests!
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## 📄 License
|
|
82
|
-
|
|
83
|
-
_This project currently does not specify a license. To make your project open source, add a LICENSE file and badge!_
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
> _Generated with ❤️ by [Janardan Pethani](https://janardanpethani.in)_
|
|
1
|
+
# Naria UI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/naria-ui)
|
|
4
|
+
[](https://www.npmjs.com/package/naria-ui)
|
|
5
|
+
[](https://github.com/JanardanPethani/naria-ui)
|
|
6
|
+
|
|
7
|
+
<!-- Add a license badge if you add a LICENSE file, e.g. MIT:
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
Generate emojis, GIFs, and stickers as per user mood.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ✨ Features
|
|
16
|
+
|
|
17
|
+
- Generate mood-based emojis, memes, and slogans
|
|
18
|
+
- React component for easy integration
|
|
19
|
+
- No configuration required
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📦 Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install naria-ui
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🚀 Usage
|
|
32
|
+
|
|
33
|
+
Here's a simple example using the main `Chat` component in your React app:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import React from "react";
|
|
37
|
+
import { Chat } from "naria-ui";
|
|
38
|
+
|
|
39
|
+
function App() {
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
<h1>Genmoji Demo</h1>
|
|
43
|
+
<Chat />
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default App;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The `Chat` component provides a floating button. Click it, enter your mood, and get relevant emojis, memes, and slogans instantly!
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 📚 API
|
|
56
|
+
|
|
57
|
+
- **`<Chat />`**
|
|
58
|
+
A ready-to-use React component for mood-based emoji, meme, and slogan generation.
|
|
59
|
+
|
|
60
|
+
- **`generateResponse(input: string): Promise<{ memes: string[], emojis: string[], slogans: string[] }>`**
|
|
61
|
+
Utility function to generate content programmatically.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 🛠 Configuration
|
|
66
|
+
|
|
67
|
+
No configuration or environment variables are required.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 📄 License
|
|
71
|
+
|
|
72
|
+
_This project currently does not specify a license. To make your project open source, add a LICENSE file and badge!_
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
> _Generated with ❤️ by [naria.enenom.com](https://naria.enenom.com)_
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface props {
|
|
3
|
+
type?: "password" | "text";
|
|
4
|
+
wrapperClass?: string;
|
|
5
|
+
labelClass?: string;
|
|
6
|
+
inputClass?: string;
|
|
7
|
+
errorClass?: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
label: string;
|
|
10
|
+
hasError?: string | null;
|
|
11
|
+
register?: any;
|
|
12
|
+
name?: string;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
autocomplete?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const Input: FC<props>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface props {
|
|
3
|
+
list?: any[];
|
|
4
|
+
label?: string;
|
|
5
|
+
title: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
api?: any;
|
|
8
|
+
maxHeight?: string;
|
|
9
|
+
theme?: "secondary";
|
|
10
|
+
hasError?: string | null;
|
|
11
|
+
size?: "md" | "sm";
|
|
12
|
+
onSelectChange?: any;
|
|
13
|
+
selected?: any;
|
|
14
|
+
}
|
|
15
|
+
export declare const Select: FC<props>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from './Select';
|
package/dist/naria-ui.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react");function ne(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const f=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(a,s,f.get?f:{enumerable:!0,get:()=>r[s]})}}return a.default=r,Object.freeze(a)}const $=ne(m);var P={exports:{}},y={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var H;function oe(){if(H)return y;H=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function s(f,l,i){var g=null;if(i!==void 0&&(g=""+i),l.key!==void 0&&(g=""+l.key),"key"in l){i={};for(var p in l)p!=="key"&&(i[p]=l[p])}else i=l;return l=i.ref,{$$typeof:r,type:f,key:g,ref:l!==void 0?l:null,props:i}}return y.Fragment=a,y.jsx=s,y.jsxs=s,y}var C={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Q;function ae(){return Q||(Q=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case T:return"Profiler";case h:return"StrictMode";case Y:return"Suspense";case I:return"SuspenseList";case z: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 L:return"Portal";case A:return(e.displayName||"Context")+".Provider";case S:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case c:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function a(e){return""+e}function s(e){try{a(e);var t=!1}catch{t=!0}if(t){t=console;var o=t.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),a(e)}}function f(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===c)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function l(){var e=D.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function g(e){if(J.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function p(e,t){function o(){B||(B=!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)",t))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function N(){var e=r(this.type);return V[e]||(V[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 R(e,t,o,u,E,v,q,F){return o=v.ref,e={$$typeof:O,type:e,key:t,props:v,_owner:E},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:N}):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:q}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function x(e,t,o,u,E,v,q,F){var d=t.children;if(d!==void 0)if(u)if(te(d)){for(u=0;u<d.length;u++)w(d[u]);Object.freeze&&Object.freeze(d)}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 w(d);if(J.call(t,"key")){d=r(e);var k=Object.keys(t).filter(function(re){return re!=="key"});u=0<k.length?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}",Z[d+u]||(k=0<k.length?"{"+k.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,u,d,k,d),Z[d+u]=!0)}if(d=null,o!==void 0&&(s(o),d=""+o),g(t)&&(s(t.key),d=""+t.key),"key"in t){o={};for(var U in t)U!=="key"&&(o[U]=t[U])}else o=t;return d&&p(o,typeof e=="function"?e.displayName||e.name||"Unknown":e),R(e,d,v,E,l(),o,q,F)}function w(e){typeof e=="object"&&e!==null&&e.$$typeof===O&&e._store&&(e._store.validated=1)}var b=m,O=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),A=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),ee=Symbol.for("react.client.reference"),D=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,te=Array.isArray,M=console.createTask?console.createTask:function(){return null};b={"react-stack-bottom-frame":function(e){return e()}};var B,V={},G=b["react-stack-bottom-frame"].bind(b,i)(),X=M(f(i)),Z={};C.Fragment=j,C.jsx=function(e,t,o,u,E){var v=1e4>D.recentlyCreatedOwnerStacks++;return x(e,t,o,!1,u,E,v?Error("react-stack-top-frame"):G,v?M(f(e)):X)},C.jsxs=function(e,t,o,u,E){var v=1e4>D.recentlyCreatedOwnerStacks++;return x(e,t,o,!0,u,E,v?Error("react-stack-top-frame"):G,v?M(f(e)):X)}}()),C}var K;function se(){return K||(K=1,process.env.NODE_ENV==="production"?P.exports=oe():P.exports=ae()),P.exports}var n=se();const ce=({type:r="button",value:a})=>n.jsx("button",{type:r,children:a}),le=({type:r="text",placeholder:a,wrapperClass:s="",labelClass:f="",inputClass:l="",errorClass:i="",label:g,hasError:p,register:N,name:R,isDisabled:x=!1,autocomplete:w=!1,...b})=>n.jsxs("div",{className:s,children:[n.jsxs("label",{htmlFor:R,className:`${f} ${p&&"error"}`,children:[g,n.jsx("input",{disabled:x,autoComplete:w?"on":"off",id:R,...N,...b,type:r,name:R,className:`${l} ${p&&"error"} ${i}`,placeholder:a})]}),p&&n.jsx("p",{className:i,children:p})]}),ie=r=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",fill:"currentColor",...r},$.createElement("path",{d:"M241 337c-9.4 9.4-24.6 9.4-33.9 0L47 177c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 337z"})),ue=r=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",fill:"currentColor",...r},$.createElement("path",{d:"M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z"})),de=()=>{const[r,a]=m.useState(typeof window<"u"?window.innerWidth:0),s=()=>a(typeof window<"u"?window.innerWidth:0);return m.useEffect(()=>(window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[r]),r},fe=({size:r="w-10 h-10",bgColor:a="text-gray-300",color:s="text-primary-100"})=>n.jsxs("svg",{className:`${r} ${a} animate-spin`,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round",className:s})]}),me=()=>{const r=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",r)},pe=r=>{window.location.hash=r},be=({list:r,label:a,hasError:s,title:f,value:l,api:i,maxHeight:g="max-h-64",theme:p="secondary",size:N="md",onSelectChange:R,selected:x})=>{const w=de(),[b,O]=m.useState(!1),[L,j]=m.useState(!0),[h,T]=m.useState(null),[S,A]=m.useState(null);m.useEffect(()=>{i&&(j(!0),i().then(c=>{j(!1),A(c?.data?.message?[]:c.data)}))},[i]),m.useEffect(()=>{w<1024&&(b?(pe("select"),document.body.style.overflow="hidden"):(window.location.hash&&!document.referrer.includes("#")&&me(),document.body.style.overflow="auto"))},[b]),m.useEffect(()=>{a?.length?T(S?.find(c=>c[a]===x)):T(x)},[x,S]),m.useEffect(()=>{r?.length&&A(r)},[r]);const _=()=>{O(c=>!c)},Y=c=>{c?.target?.className.toString()?.includes("backdrop-select")&&_()},I=c=>{T(c),_(),R(c)},W=c=>{if(!h)return"";if(a?.length&&c[a]===h[a]||c===h)return"bg-grey-100"};return n.jsxs("div",{className:"naria-select",children:[n.jsxs("label",{className:`cursor-pointer
|
|
23
|
+
${s&&"!text-danger-100"}`,children:[n.jsx("span",{className:"",children:f}),n.jsxs("button",{type:"button",className:`relative z-20 flex items-center mt-1 text-base justify-between gap-2 w-full
|
|
24
|
+
${h?"text-dark-100":"text-grey-300"}
|
|
25
|
+
${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,onClick:_,children:[h?l?.length?h[l]:h:"انتخاب"," ",n.jsx(ie,{className:`w-4 h-4 transition ease duration-200 ${b?"rotate-180":"rotate-0"}`})]})]}),b?n.jsxs("div",{className:`wrapper ${w<1024?"mobile":""}`,children:[n.jsx("div",{className:`list ${w<1024?"mobile":`desktop ${g}`}`,children:i&&L?n.jsx("div",{className:"py-10 flex justify-center",children:n.jsx(fe,{size:"w-7 h-7"})}):n.jsxs(n.Fragment,{children:[w<1024?n.jsx("div",{className:"sticky top-0 text-left",children:n.jsx("button",{className:"p-3",onClick:_,children:n.jsx(ue,{className:"w-6"})})}):void 0,S?.map((c,z)=>n.jsx("button",{type:"button",onClick:()=>I(c),className:`text-right py-2.5 px-4 text-base hover:bg-grey-100 rounded-lg ${W(c)}`,children:l?.length?c[l]:c},z.toString()))]})}),n.jsx("div",{className:"backdrop-select",onClick:Y})]}):void 0,s&&n.jsx("p",{className:"text-xs mt-1 text-danger-100",children:s})]})};function ve(r){return r.charAt(0).toUpperCase()+r.slice(1)}exports.Button=ce;exports.Input=le;exports.Select=be;exports.capitalize=ve;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.naria-select{position:relative}.naria-select .wrapper{overflow:hidden}.naria-select .wrapper.mobile{position:fixed;top:0;right:0;height:100%;width:100%;z-index:97}.naria-select .list{display:flex;flex-direction:column;width:100%;z-index:99}.naria-select .list.mobile{position:relative;height:100%}.naria-select .list.desktop{overflow:auto;position:absolute;animation:fadeInTranslateY .3s ease-out forwards}.naria-select .backdrop-select{position:fixed;top:0;left:0;bottom:0;width:100%;height:100%;z-index:98;background-color:#0003}@keyframes fadeInTranslateY{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
|
package/dist/naria-ui.es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as $ from "react";
|
|
2
|
+
import oe, { useState as y, useEffect as S } from "react";
|
|
3
|
+
var L = { exports: {} }, C = {};
|
|
3
4
|
/**
|
|
4
5
|
* @license React
|
|
5
6
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +10,29 @@ var p = { exports: {} }, b = {};
|
|
|
9
10
|
* This source code is licensed under the MIT license found in the
|
|
10
11
|
* LICENSE file in the root directory of this source tree.
|
|
11
12
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
26
|
-
type:
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
13
|
+
var Q;
|
|
14
|
+
function ae() {
|
|
15
|
+
if (Q) return C;
|
|
16
|
+
Q = 1;
|
|
17
|
+
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
18
|
+
function i(v, c, l) {
|
|
19
|
+
var w = null;
|
|
20
|
+
if (l !== void 0 && (w = "" + l), c.key !== void 0 && (w = "" + c.key), "key" in c) {
|
|
21
|
+
l = {};
|
|
22
|
+
for (var f in c)
|
|
23
|
+
f !== "key" && (l[f] = c[f]);
|
|
24
|
+
} else l = c;
|
|
25
|
+
return c = l.ref, {
|
|
26
|
+
$$typeof: t,
|
|
27
|
+
type: v,
|
|
28
|
+
key: w,
|
|
29
|
+
ref: c !== void 0 ? c : null,
|
|
30
|
+
props: l
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return C.Fragment = s, C.jsx = i, C.jsxs = i, C;
|
|
33
34
|
}
|
|
34
|
-
var
|
|
35
|
+
var N = {};
|
|
35
36
|
/**
|
|
36
37
|
* @license React
|
|
37
38
|
* react-jsx-runtime.development.js
|
|
@@ -41,125 +42,125 @@ var _ = {};
|
|
|
41
42
|
* This source code is licensed under the MIT license found in the
|
|
42
43
|
* LICENSE file in the root directory of this source tree.
|
|
43
44
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
function
|
|
45
|
+
var K;
|
|
46
|
+
function se() {
|
|
47
|
+
return K || (K = 1, process.env.NODE_ENV !== "production" && function() {
|
|
48
|
+
function t(e) {
|
|
48
49
|
if (e == null) return null;
|
|
49
50
|
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof ===
|
|
51
|
+
return e.$$typeof === re ? null : e.displayName || e.name || null;
|
|
51
52
|
if (typeof e == "string") return e;
|
|
52
53
|
switch (e) {
|
|
53
|
-
case
|
|
54
|
+
case R:
|
|
54
55
|
return "Fragment";
|
|
55
|
-
case
|
|
56
|
+
case k:
|
|
56
57
|
return "Profiler";
|
|
57
|
-
case
|
|
58
|
+
case h:
|
|
58
59
|
return "StrictMode";
|
|
59
|
-
case
|
|
60
|
+
case I:
|
|
60
61
|
return "Suspense";
|
|
61
|
-
case
|
|
62
|
+
case W:
|
|
62
63
|
return "SuspenseList";
|
|
63
|
-
case
|
|
64
|
+
case q:
|
|
64
65
|
return "Activity";
|
|
65
66
|
}
|
|
66
67
|
if (typeof e == "object")
|
|
67
68
|
switch (typeof e.tag == "number" && console.error(
|
|
68
69
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
70
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
71
|
+
case Y:
|
|
71
72
|
return "Portal";
|
|
72
|
-
case
|
|
73
|
+
case P:
|
|
73
74
|
return (e.displayName || "Context") + ".Provider";
|
|
74
|
-
case
|
|
75
|
+
case T:
|
|
75
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
77
|
+
case _:
|
|
77
78
|
var r = e.render;
|
|
78
79
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case
|
|
80
|
-
return r = e.displayName || null, r !== null ? r :
|
|
81
|
-
case
|
|
80
|
+
case F:
|
|
81
|
+
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
82
|
+
case a:
|
|
82
83
|
r = e._payload, e = e._init;
|
|
83
84
|
try {
|
|
84
|
-
return
|
|
85
|
+
return t(e(r));
|
|
85
86
|
} catch {
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
return null;
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function s(e) {
|
|
91
92
|
return "" + e;
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
+
function i(e) {
|
|
94
95
|
try {
|
|
95
|
-
|
|
96
|
+
s(e);
|
|
96
97
|
var r = !1;
|
|
97
98
|
} catch {
|
|
98
99
|
r = !0;
|
|
99
100
|
}
|
|
100
101
|
if (r) {
|
|
101
102
|
r = console;
|
|
102
|
-
var
|
|
103
|
-
return
|
|
103
|
+
var o = r.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
104
|
+
return o.call(
|
|
104
105
|
r,
|
|
105
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
107
|
-
),
|
|
107
|
+
u
|
|
108
|
+
), s(e);
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
if (e ===
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
111
|
+
function v(e) {
|
|
112
|
+
if (e === R) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === a)
|
|
113
114
|
return "<...>";
|
|
114
115
|
try {
|
|
115
|
-
var r =
|
|
116
|
+
var r = t(e);
|
|
116
117
|
return r ? "<" + r + ">" : "<...>";
|
|
117
118
|
} catch {
|
|
118
119
|
return "<...>";
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
var e =
|
|
122
|
+
function c() {
|
|
123
|
+
var e = z.A;
|
|
123
124
|
return e === null ? null : e.getOwner();
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function l() {
|
|
126
127
|
return Error("react-stack-top-frame");
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
129
|
+
function w(e) {
|
|
130
|
+
if (V.call(e, "key")) {
|
|
130
131
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
132
|
if (r && r.isReactWarning) return !1;
|
|
132
133
|
}
|
|
133
134
|
return e.key !== void 0;
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
136
|
+
function f(e, r) {
|
|
137
|
+
function o() {
|
|
138
|
+
B || (B = !0, console.error(
|
|
138
139
|
"%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)",
|
|
139
140
|
r
|
|
140
141
|
));
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
143
|
+
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
+
get: o,
|
|
144
145
|
configurable: !0
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
var e =
|
|
149
|
-
return
|
|
148
|
+
function A() {
|
|
149
|
+
var e = t(this.type);
|
|
150
|
+
return G[e] || (G[e] = !0, console.error(
|
|
150
151
|
"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."
|
|
151
152
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
155
|
-
$$typeof:
|
|
154
|
+
function E(e, r, o, u, x, p, M, U) {
|
|
155
|
+
return o = p.ref, e = {
|
|
156
|
+
$$typeof: O,
|
|
156
157
|
type: e,
|
|
157
158
|
key: r,
|
|
158
|
-
props:
|
|
159
|
-
_owner:
|
|
160
|
-
}, (
|
|
159
|
+
props: p,
|
|
160
|
+
_owner: x
|
|
161
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
162
|
enumerable: !1,
|
|
162
|
-
get:
|
|
163
|
+
get: A
|
|
163
164
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
165
|
configurable: !1,
|
|
165
166
|
enumerable: !1,
|
|
@@ -174,117 +175,305 @@ function ne() {
|
|
|
174
175
|
configurable: !1,
|
|
175
176
|
enumerable: !1,
|
|
176
177
|
writable: !0,
|
|
177
|
-
value:
|
|
178
|
+
value: M
|
|
178
179
|
}), Object.defineProperty(e, "_debugTask", {
|
|
179
180
|
configurable: !1,
|
|
180
181
|
enumerable: !1,
|
|
181
182
|
writable: !0,
|
|
182
|
-
value:
|
|
183
|
+
value: U
|
|
183
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
for (
|
|
191
|
-
|
|
192
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function g(e, r, o, u, x, p, M, U) {
|
|
187
|
+
var d = r.children;
|
|
188
|
+
if (d !== void 0)
|
|
189
|
+
if (u)
|
|
190
|
+
if (te(d)) {
|
|
191
|
+
for (u = 0; u < d.length; u++)
|
|
192
|
+
b(d[u]);
|
|
193
|
+
Object.freeze && Object.freeze(d);
|
|
193
194
|
} else
|
|
194
195
|
console.error(
|
|
195
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
197
|
);
|
|
197
|
-
else
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
var
|
|
201
|
-
return
|
|
198
|
+
else b(d);
|
|
199
|
+
if (V.call(r, "key")) {
|
|
200
|
+
d = t(e);
|
|
201
|
+
var j = Object.keys(r).filter(function(ne) {
|
|
202
|
+
return ne !== "key";
|
|
202
203
|
});
|
|
203
|
-
|
|
204
|
+
u = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", H[d + u] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
205
206
|
let props = %s;
|
|
206
207
|
<%s {...props} />
|
|
207
208
|
React keys must be passed directly to JSX without using spread:
|
|
208
209
|
let props = %s;
|
|
209
210
|
<%s key={someKey} {...props} />`,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
),
|
|
211
|
+
u,
|
|
212
|
+
d,
|
|
213
|
+
j,
|
|
214
|
+
d
|
|
215
|
+
), H[d + u] = !0);
|
|
215
216
|
}
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
for (var
|
|
219
|
-
|
|
220
|
-
} else
|
|
221
|
-
return
|
|
222
|
-
|
|
217
|
+
if (d = null, o !== void 0 && (i(o), d = "" + o), w(r) && (i(r.key), d = "" + r.key), "key" in r) {
|
|
218
|
+
o = {};
|
|
219
|
+
for (var J in r)
|
|
220
|
+
J !== "key" && (o[J] = r[J]);
|
|
221
|
+
} else o = r;
|
|
222
|
+
return d && f(
|
|
223
|
+
o,
|
|
223
224
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
-
),
|
|
225
|
+
), E(
|
|
225
226
|
e,
|
|
227
|
+
d,
|
|
228
|
+
p,
|
|
229
|
+
x,
|
|
230
|
+
c(),
|
|
226
231
|
o,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
s(),
|
|
230
|
-
t,
|
|
231
|
-
A,
|
|
232
|
-
S
|
|
232
|
+
M,
|
|
233
|
+
U
|
|
233
234
|
);
|
|
234
235
|
}
|
|
235
|
-
function
|
|
236
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
236
|
+
function b(e) {
|
|
237
|
+
typeof e == "object" && e !== null && e.$$typeof === O && e._store && (e._store.validated = 1);
|
|
237
238
|
}
|
|
238
|
-
var
|
|
239
|
+
var m = oe, O = Symbol.for("react.transitional.element"), Y = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), P = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), a = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), z = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, te = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
239
240
|
return null;
|
|
240
241
|
};
|
|
241
|
-
|
|
242
|
+
m = {
|
|
242
243
|
"react-stack-bottom-frame": function(e) {
|
|
243
244
|
return e();
|
|
244
245
|
}
|
|
245
246
|
};
|
|
246
|
-
var
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
)(),
|
|
250
|
-
|
|
251
|
-
var
|
|
252
|
-
return
|
|
247
|
+
var B, G = {}, X = m["react-stack-bottom-frame"].bind(
|
|
248
|
+
m,
|
|
249
|
+
l
|
|
250
|
+
)(), Z = D(v(l)), H = {};
|
|
251
|
+
N.Fragment = R, N.jsx = function(e, r, o, u, x) {
|
|
252
|
+
var p = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
253
|
+
return g(
|
|
253
254
|
e,
|
|
254
255
|
r,
|
|
255
|
-
|
|
256
|
+
o,
|
|
256
257
|
!1,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
u,
|
|
259
|
+
x,
|
|
260
|
+
p ? Error("react-stack-top-frame") : X,
|
|
261
|
+
p ? D(v(e)) : Z
|
|
261
262
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
263
|
+
}, N.jsxs = function(e, r, o, u, x) {
|
|
264
|
+
var p = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return g(
|
|
265
266
|
e,
|
|
266
267
|
r,
|
|
267
|
-
|
|
268
|
+
o,
|
|
268
269
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
u,
|
|
271
|
+
x,
|
|
272
|
+
p ? Error("react-stack-top-frame") : X,
|
|
273
|
+
p ? D(v(e)) : Z
|
|
273
274
|
);
|
|
274
275
|
};
|
|
275
|
-
}()),
|
|
276
|
+
}()), N;
|
|
276
277
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return
|
|
278
|
+
var ee;
|
|
279
|
+
function ce() {
|
|
280
|
+
return ee || (ee = 1, process.env.NODE_ENV === "production" ? L.exports = ae() : L.exports = se()), L.exports;
|
|
280
281
|
}
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
var n = ce();
|
|
283
|
+
const ve = ({ type: t = "button", value: s }) => /* @__PURE__ */ n.jsx("button", { type: t, children: s }), we = ({
|
|
284
|
+
type: t = "text",
|
|
285
|
+
placeholder: s,
|
|
286
|
+
wrapperClass: i = "",
|
|
287
|
+
labelClass: v = "",
|
|
288
|
+
inputClass: c = "",
|
|
289
|
+
errorClass: l = "",
|
|
290
|
+
label: w,
|
|
291
|
+
hasError: f,
|
|
292
|
+
register: A,
|
|
293
|
+
name: E,
|
|
294
|
+
isDisabled: g = !1,
|
|
295
|
+
autocomplete: b = !1,
|
|
296
|
+
...m
|
|
297
|
+
}) => /* @__PURE__ */ n.jsxs("div", { className: i, children: [
|
|
298
|
+
/* @__PURE__ */ n.jsxs(
|
|
299
|
+
"label",
|
|
300
|
+
{
|
|
301
|
+
htmlFor: E,
|
|
302
|
+
className: `${v} ${f && "error"}`,
|
|
303
|
+
children: [
|
|
304
|
+
w,
|
|
305
|
+
/* @__PURE__ */ n.jsx(
|
|
306
|
+
"input",
|
|
307
|
+
{
|
|
308
|
+
disabled: g,
|
|
309
|
+
autoComplete: b ? "on" : "off",
|
|
310
|
+
id: E,
|
|
311
|
+
...A,
|
|
312
|
+
...m,
|
|
313
|
+
type: t,
|
|
314
|
+
name: E,
|
|
315
|
+
className: `${c} ${f && "error"} ${l}`,
|
|
316
|
+
placeholder: s
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
f && /* @__PURE__ */ n.jsx("p", { className: l, children: f })
|
|
323
|
+
] }), le = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { d: "M241 337c-9.4 9.4-24.6 9.4-33.9 0L47 177c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 337z" })), ie = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { d: "M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z" })), ue = () => {
|
|
324
|
+
const [t, s] = y(typeof window < "u" ? window.innerWidth : 0), i = () => s(typeof window < "u" ? window.innerWidth : 0);
|
|
325
|
+
return S(() => (window.addEventListener("resize", i), () => window.removeEventListener("resize", i)), [t]), t;
|
|
326
|
+
}, de = ({
|
|
327
|
+
size: t = "w-10 h-10",
|
|
328
|
+
bgColor: s = "text-gray-300",
|
|
329
|
+
color: i = "text-primary-100"
|
|
330
|
+
}) => /* @__PURE__ */ n.jsxs(
|
|
331
|
+
"svg",
|
|
332
|
+
{
|
|
333
|
+
className: `${t} ${s} animate-spin`,
|
|
334
|
+
viewBox: "0 0 64 64",
|
|
335
|
+
fill: "none",
|
|
336
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ n.jsx(
|
|
339
|
+
"path",
|
|
340
|
+
{
|
|
341
|
+
d: "M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",
|
|
342
|
+
stroke: "currentColor",
|
|
343
|
+
strokeWidth: "6",
|
|
344
|
+
strokeLinecap: "round",
|
|
345
|
+
strokeLinejoin: "round"
|
|
346
|
+
}
|
|
347
|
+
),
|
|
348
|
+
/* @__PURE__ */ n.jsx(
|
|
349
|
+
"path",
|
|
350
|
+
{
|
|
351
|
+
d: "M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",
|
|
352
|
+
stroke: "currentColor",
|
|
353
|
+
strokeWidth: "6",
|
|
354
|
+
strokeLinecap: "round",
|
|
355
|
+
strokeLinejoin: "round",
|
|
356
|
+
className: i
|
|
357
|
+
}
|
|
358
|
+
)
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
), fe = () => {
|
|
362
|
+
const t = `${window.location.pathname}${window.location.search}`;
|
|
363
|
+
window.history.replaceState(null, "", t);
|
|
364
|
+
}, me = (t) => {
|
|
365
|
+
window.location.hash = t;
|
|
366
|
+
}, be = ({
|
|
367
|
+
list: t,
|
|
368
|
+
label: s,
|
|
369
|
+
hasError: i,
|
|
370
|
+
title: v,
|
|
371
|
+
value: c,
|
|
372
|
+
api: l,
|
|
373
|
+
maxHeight: w = "max-h-64",
|
|
374
|
+
theme: f = "secondary",
|
|
375
|
+
size: A = "md",
|
|
376
|
+
onSelectChange: E,
|
|
377
|
+
selected: g
|
|
378
|
+
}) => {
|
|
379
|
+
const b = ue(), [m, O] = y(!1), [Y, R] = y(!0), [h, k] = y(null), [T, P] = y(null);
|
|
380
|
+
S(() => {
|
|
381
|
+
l && (R(!0), l().then((a) => {
|
|
382
|
+
R(!1), P(a?.data?.message ? [] : a.data);
|
|
383
|
+
}));
|
|
384
|
+
}, [l]), S(() => {
|
|
385
|
+
b < 1024 && (m ? (me("select"), document.body.style.overflow = "hidden") : (window.location.hash && !document.referrer.includes("#") && fe(), document.body.style.overflow = "auto"));
|
|
386
|
+
}, [m]), S(() => {
|
|
387
|
+
s?.length ? k(T?.find((a) => a[s] === g)) : k(g);
|
|
388
|
+
}, [g, T]), S(() => {
|
|
389
|
+
t?.length && P(t);
|
|
390
|
+
}, [t]);
|
|
391
|
+
const _ = () => {
|
|
392
|
+
O((a) => !a);
|
|
393
|
+
}, I = (a) => {
|
|
394
|
+
a?.target?.className.toString()?.includes("backdrop-select") && _();
|
|
395
|
+
}, W = (a) => {
|
|
396
|
+
k(a), _(), E(a);
|
|
397
|
+
}, F = (a) => {
|
|
398
|
+
if (!h)
|
|
399
|
+
return "";
|
|
400
|
+
if (s?.length && a[s] === h[s] || a === h)
|
|
401
|
+
return "bg-grey-100";
|
|
402
|
+
};
|
|
403
|
+
return /* @__PURE__ */ n.jsxs("div", { className: "naria-select", children: [
|
|
404
|
+
/* @__PURE__ */ n.jsxs(
|
|
405
|
+
"label",
|
|
406
|
+
{
|
|
407
|
+
className: `cursor-pointer
|
|
408
|
+
${i && "!text-danger-100"}`,
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ n.jsx("span", { className: "", children: v }),
|
|
411
|
+
/* @__PURE__ */ n.jsxs(
|
|
412
|
+
"button",
|
|
413
|
+
{
|
|
414
|
+
type: "button",
|
|
415
|
+
className: `relative z-20 flex items-center mt-1 text-base justify-between gap-2 w-full
|
|
416
|
+
${h ? "text-dark-100" : "text-grey-300"}
|
|
417
|
+
${i && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
|
|
418
|
+
onClick: _,
|
|
419
|
+
children: [
|
|
420
|
+
h ? c?.length ? h[c] : h : "انتخاب",
|
|
421
|
+
" ",
|
|
422
|
+
/* @__PURE__ */ n.jsx(
|
|
423
|
+
le,
|
|
424
|
+
{
|
|
425
|
+
className: `w-4 h-4 transition ease duration-200 ${m ? "rotate-180" : "rotate-0"}`
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
m ? /* @__PURE__ */ n.jsxs(
|
|
435
|
+
"div",
|
|
436
|
+
{
|
|
437
|
+
className: `wrapper ${b < 1024 ? "mobile" : ""}`,
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ n.jsx(
|
|
440
|
+
"div",
|
|
441
|
+
{
|
|
442
|
+
className: `list ${b < 1024 ? "mobile" : `desktop ${w}`}`,
|
|
443
|
+
children: l && Y ? /* @__PURE__ */ n.jsx("div", { className: "py-10 flex justify-center", children: /* @__PURE__ */ n.jsx(de, { size: "w-7 h-7" }) }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
444
|
+
b < 1024 ? /* @__PURE__ */ n.jsx("div", { className: "sticky top-0 text-left", children: /* @__PURE__ */ n.jsx("button", { className: "p-3", onClick: _, children: /* @__PURE__ */ n.jsx(ie, { className: "w-6" }) }) }) : void 0,
|
|
445
|
+
T?.map((a, q) => /* @__PURE__ */ n.jsx(
|
|
446
|
+
"button",
|
|
447
|
+
{
|
|
448
|
+
type: "button",
|
|
449
|
+
onClick: () => W(a),
|
|
450
|
+
className: `text-right py-2.5 px-4 text-base hover:bg-grey-100 rounded-lg ${F(a)}`,
|
|
451
|
+
children: c?.length ? a[c] : a
|
|
452
|
+
},
|
|
453
|
+
q.toString()
|
|
454
|
+
))
|
|
455
|
+
] })
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ n.jsx(
|
|
459
|
+
"div",
|
|
460
|
+
{
|
|
461
|
+
className: "backdrop-select",
|
|
462
|
+
onClick: I
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
) : void 0,
|
|
468
|
+
i && /* @__PURE__ */ n.jsx("p", { className: "text-xs mt-1 text-danger-100", children: i })
|
|
469
|
+
] });
|
|
470
|
+
};
|
|
471
|
+
function he(t) {
|
|
472
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
285
473
|
}
|
|
286
474
|
export {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
475
|
+
ve as Button,
|
|
476
|
+
we as Input,
|
|
477
|
+
be as Select,
|
|
478
|
+
he as capitalize
|
|
290
479
|
};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Mohammad Mehdi Mohammadi",
|
|
6
6
|
"url": ""
|
|
7
7
|
},
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.36",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/naria-ui.cjs.js",
|
|
11
11
|
"module": "dist/naria-ui.es.js",
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"dev": "vite",
|
|
28
|
-
"build": "
|
|
28
|
+
"build": "vite build",
|
|
29
|
+
"tsc": "tsc -p tsconfig.build.json",
|
|
29
30
|
"lint": "eslint .",
|
|
30
31
|
"preview": "vite preview"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
34
|
+
"vite-plugin-svgr": "^4.5.0"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
37
|
"react": "^19.1.0",
|
|
@@ -47,10 +49,11 @@
|
|
|
47
49
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
48
50
|
"globals": "^16.4.0",
|
|
49
51
|
"playwright": "^1.56.1",
|
|
52
|
+
"sass": "^1.93.2",
|
|
50
53
|
"typescript": "~5.9.3",
|
|
51
54
|
"typescript-eslint": "^8.46.1",
|
|
52
55
|
"vite": "^7.1.10",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
56
|
+
"vite-plugin-dts": "^4.5.4",
|
|
57
|
+
"vitest": "^3.2.4"
|
|
55
58
|
}
|
|
56
59
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|