naria-ui 0.1.52 → 0.1.54
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/assets/icons/angle-down.svg +1 -0
- package/assets/icons/angle-left.svg +1 -0
- package/assets/icons/angle-right.svg +1 -0
- package/assets/icons/angle-up.svg +1 -0
- package/assets/icons/close.svg +1 -0
- package/assets/icons/search.svg +1 -0
- package/eslint.config.js +28 -0
- package/hooks/click-outside.ts +17 -0
- package/hooks/is-first-render.ts +7 -0
- package/hooks/use-width.ts +11 -0
- package/index.html +13 -0
- package/lib/components/Button/Button.tsx +47 -0
- package/lib/components/Button/button.scss +9 -0
- package/lib/components/Button/index.ts +1 -0
- package/lib/components/Input/Input.tsx +66 -0
- package/lib/components/Input/index.ts +1 -0
- package/lib/components/Select/Select.tsx +414 -0
- package/lib/components/Select/index.ts +1 -0
- package/lib/components/Select/select.scss +138 -0
- package/lib/components/index.ts +3 -0
- package/lib/index.ts +1 -0
- package/package.json +2 -6
- package/shared/loading/Loading.tsx +35 -0
- package/shared/loading/loading.scss +9 -0
- package/src/App.css +0 -0
- package/src/App.tsx +81 -0
- package/src/index.css +0 -0
- package/src/main.tsx +7 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.app.json +34 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +24 -0
- package/utils/navigator.ts +29 -0
- package/vite.config.ts +50 -0
- package/dist/lib/components/Button/Button.d.ts +0 -16
- package/dist/lib/components/Button/index.d.ts +0 -1
- package/dist/lib/components/Input/Input.d.ts +0 -18
- package/dist/lib/components/Input/index.d.ts +0 -1
- package/dist/lib/components/Select/Select.d.ts +0 -36
- package/dist/lib/components/Select/index.d.ts +0 -1
- package/dist/lib/components/index.d.ts +0 -3
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/utils/capitalize.d.ts +0 -1
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/navigator.d.ts +0 -3
- package/dist/naria-ui.cjs.js +0 -26
- package/dist/naria-ui.css +0 -1
- package/dist/naria-ui.es.js +0 -671
- /package/{dist → public}/light.css +0 -0
- /package/{dist → public}/light.scss +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
|
|
2
|
+
.nariaSelect {
|
|
3
|
+
position: relative;
|
|
4
|
+
|
|
5
|
+
.nariaListWrapper {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
|
|
8
|
+
&.nariaListWrapper-mobile {
|
|
9
|
+
position: fixed;
|
|
10
|
+
top: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
z-index: 97;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.nariaList {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
width: 100%;
|
|
22
|
+
z-index: 99;
|
|
23
|
+
position: relative;
|
|
24
|
+
overflow: auto;
|
|
25
|
+
|
|
26
|
+
&.nariaList-mobile {
|
|
27
|
+
position: relative;
|
|
28
|
+
height: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.nariaList-desktop {
|
|
32
|
+
position: absolute;
|
|
33
|
+
animation: fadeInTranslateY 0.3s ease-out forwards;
|
|
34
|
+
max-height: 150px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.nariaLoadingWrapper {
|
|
38
|
+
padding: 24px 0;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.nariaLoadingMoreWrapper {
|
|
45
|
+
position: sticky;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
text-align: center;
|
|
48
|
+
width: 100%;
|
|
49
|
+
|
|
50
|
+
.nariaLoading {
|
|
51
|
+
width: 20px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
.nariaSelectMobileHeader {
|
|
55
|
+
position: sticky;
|
|
56
|
+
top: 0;
|
|
57
|
+
justify-content: end;
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 8px;
|
|
60
|
+
.nariaSearchInput {
|
|
61
|
+
flex-grow: 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.nariaSearchInput {
|
|
67
|
+
position: relative;
|
|
68
|
+
display: flex;
|
|
69
|
+
|
|
70
|
+
input {
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.nariaArrowIcon, .nariaSearchIcon {
|
|
75
|
+
position: absolute;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
margin-top: auto;
|
|
78
|
+
margin-bottom: auto;
|
|
79
|
+
top: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
width: 12px;
|
|
82
|
+
height: 12px;
|
|
83
|
+
z-index: 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.nariaHandler {
|
|
89
|
+
position: relative;
|
|
90
|
+
display: flex;
|
|
91
|
+
gap: 4px;
|
|
92
|
+
width: 100%;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: space-between;
|
|
95
|
+
|
|
96
|
+
.nariaArrowIcon {
|
|
97
|
+
width: 12px;
|
|
98
|
+
height: 12px;
|
|
99
|
+
transition: transform 0.4s;
|
|
100
|
+
|
|
101
|
+
-webkit-transform: rotate(0deg);
|
|
102
|
+
-moz-transform: rotate(0deg);
|
|
103
|
+
-o-transform: rotate(0deg);
|
|
104
|
+
-ms-transform: rotate(0deg);
|
|
105
|
+
transform: rotate(0deg);
|
|
106
|
+
|
|
107
|
+
&.nariaArrowIcon-rotate-180 {
|
|
108
|
+
-webkit-transform: rotate(180deg);
|
|
109
|
+
-moz-transform: rotate(180deg);
|
|
110
|
+
-o-transform: rotate(180deg);
|
|
111
|
+
-ms-transform: rotate(180deg);
|
|
112
|
+
transform: rotate(180deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
html[dir="rtl"] {
|
|
119
|
+
.nariaSelect {
|
|
120
|
+
.nariaSearchInput {
|
|
121
|
+
.nariaArrowIcon, .nariaSearchIcon {
|
|
122
|
+
left: 0;
|
|
123
|
+
right: auto;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@keyframes fadeInTranslateY {
|
|
130
|
+
from {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
transform: translateY(10px);
|
|
133
|
+
}
|
|
134
|
+
to {
|
|
135
|
+
opacity: 1;
|
|
136
|
+
transform: translateY(0);
|
|
137
|
+
}
|
|
138
|
+
}
|
package/lib/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
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.54",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/naria-ui.cjs.js",
|
|
11
11
|
"module": "./dist/naria-ui.es.js",
|
|
@@ -15,12 +15,8 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/naria-ui.es.js",
|
|
17
17
|
"require": "./dist/naria-ui.cjs.js"
|
|
18
|
-
}
|
|
19
|
-
"./*": "./*"
|
|
18
|
+
}
|
|
20
19
|
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist"
|
|
23
|
-
],
|
|
24
20
|
"publishConfig": {
|
|
25
21
|
"access": "public"
|
|
26
22
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {FC} from "react";
|
|
2
|
+
import './loading.scss';
|
|
3
|
+
export interface props {
|
|
4
|
+
classNames?: {
|
|
5
|
+
wrapper: string;
|
|
6
|
+
color: string;
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Loading: FC<props> = ({
|
|
12
|
+
classNames = {
|
|
13
|
+
wrapper: "",
|
|
14
|
+
color: ""
|
|
15
|
+
},
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<svg className={`nariaLoading ${classNames.wrapper}`} data-prop = "wrapper" viewBox="0 0 64 64" fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
20
|
+
<path
|
|
21
|
+
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"
|
|
22
|
+
stroke="currentColor" strokeWidth="6" strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"></path>
|
|
24
|
+
<path
|
|
25
|
+
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"
|
|
26
|
+
stroke="currentColor" strokeWidth="6" strokeLinecap="round" strokeLinejoin="round"
|
|
27
|
+
className={classNames.color} data-prop = "color">
|
|
28
|
+
</path>
|
|
29
|
+
</svg>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default Loading;
|
package/src/App.css
ADDED
|
File without changes
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import './App.css'
|
|
2
|
+
import {Button, Input, Select} from "../lib";
|
|
3
|
+
function App() {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<h1>Button</h1>
|
|
7
|
+
<p>Default</p>
|
|
8
|
+
<Button value="Default"/>
|
|
9
|
+
<p>Loading</p>
|
|
10
|
+
<Button value="Loading" isLoading = {true}/>
|
|
11
|
+
<p>Disabled</p>
|
|
12
|
+
<Button value="Disabled" isDisabled = {true}/>
|
|
13
|
+
<p>Loading | Disabled</p>
|
|
14
|
+
<Button value="Loading | Disabled" isDisabled = {true} isLoading = {true}/>
|
|
15
|
+
<hr/>
|
|
16
|
+
<h1>Input</h1>
|
|
17
|
+
<p>Default</p>
|
|
18
|
+
<Input title="Default"/>
|
|
19
|
+
<p>Placeholder</p>
|
|
20
|
+
<Input placeholder = "Placeholder" title="Placeholder"/>
|
|
21
|
+
<p>Disabled</p>
|
|
22
|
+
<Input disabled = {true} placeholder = "Placeholder" title="Disabled"/>
|
|
23
|
+
<hr/>
|
|
24
|
+
<h1>Select</h1>
|
|
25
|
+
<p>Primitive list</p>
|
|
26
|
+
<Select options={["Yellow", "Red", "Blue"]} classNames = {
|
|
27
|
+
{
|
|
28
|
+
input: "input input-bordered w-full",
|
|
29
|
+
title: "text-[var(--primary-800)] font-bold text-xs mr-2 mb-1.5",
|
|
30
|
+
}
|
|
31
|
+
}/>
|
|
32
|
+
<p>Non-primitive list</p>
|
|
33
|
+
<Select options={[{id: 1, name: "Yellow"}, {id: 2, name: "Red"}, {id: 3, name: "Blue"}]} label="id"
|
|
34
|
+
value="name"/>
|
|
35
|
+
<p>Disabled</p>
|
|
36
|
+
<Select disabled={true} options={["Yellow", "Red", "Blue"]}/>
|
|
37
|
+
<p>Placeholder</p>
|
|
38
|
+
<Select options={["Yellow", "Red", "Blue"]} placeholder="Custom placeholder"/>
|
|
39
|
+
<p>Selected | Primitive</p>
|
|
40
|
+
<Select options={["Yellow", "Red", "Blue"]} selected="Yellow"/>
|
|
41
|
+
<p>Selected | Non-primitive list</p>
|
|
42
|
+
<Select options={[{id: 1, name: "Yellow"}, {id: 2, name: "Red"}, {id: 3, name: "Blue"}]} label="id"
|
|
43
|
+
value="name" selected={3}/>
|
|
44
|
+
<p>Search with search field | Primitive</p>
|
|
45
|
+
<Select options={["Yellow", "Red", "Blue"]} hasSearch={true}/>
|
|
46
|
+
<p>Search with search field | Non-primitive</p>
|
|
47
|
+
<Select options={[{id: 1, name: "Yellow"}, {id: 2, name: "Red"}, {id: 3, name: "Blue"}]} label="id"
|
|
48
|
+
value="name" hasSearch={true}/>
|
|
49
|
+
<p>Search with search field | Non-primitive | Custom filter prop</p>
|
|
50
|
+
<Select options={[{id: 1, name: "Yellow"}, {id: 2, name: "Red"}, {id: 3, name: "Blue"}]} label="id"
|
|
51
|
+
value="name" hasSearch={true} optionFilterLabel = "name"/>
|
|
52
|
+
<p>Search with search field | primitive | Selected</p>
|
|
53
|
+
<Select options={["Yellow", "Red", "Blue"]} selected={"Red"} hasSearch={true}/>
|
|
54
|
+
<p>Search with search field | Non-primitive | Selected</p>
|
|
55
|
+
<Select options={[{id: 1, name: "Yellow"}, {id: 2, name: "Red"}, {id: 3, name: "Blue"}]}
|
|
56
|
+
label="id" value="name"
|
|
57
|
+
hasSearch={true}
|
|
58
|
+
selected={2}/>
|
|
59
|
+
<h1>Call api</h1>
|
|
60
|
+
<p>Basic usage</p>
|
|
61
|
+
<Select api={"https://jsonplaceholder.typicode.com/users"} label="id" value="name"/>
|
|
62
|
+
<p>Pagination</p>
|
|
63
|
+
<Select api={"https://api.escuelajs.co/api/v1/products?offset=1&limit=3"} label="id" value="title"
|
|
64
|
+
pagination={{
|
|
65
|
+
pageLabel: 'offset',
|
|
66
|
+
sizeLabel: 'limit'
|
|
67
|
+
}}/>
|
|
68
|
+
<p>Pagination | Custom page and size</p>
|
|
69
|
+
<Select api={"https://api.escuelajs.co/api/v1/products?offset=1&limit=20"} label="id" value="title"
|
|
70
|
+
pagination={{
|
|
71
|
+
page: 5,
|
|
72
|
+
pageLabel: 'offset',
|
|
73
|
+
size: 10,
|
|
74
|
+
sizeLabel: 'limit'
|
|
75
|
+
}}/>
|
|
76
|
+
|
|
77
|
+
</>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default App
|
package/src/index.css
ADDED
|
File without changes
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2020",
|
|
8
|
+
"DOM",
|
|
9
|
+
"DOM.Iterable"
|
|
10
|
+
],
|
|
11
|
+
"module": "ESNext",
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"allowImportingTsExtensions": true,
|
|
15
|
+
"verbatimModuleSyntax": false,
|
|
16
|
+
"moduleDetection": "force",
|
|
17
|
+
"noEmit": true,
|
|
18
|
+
"declarationDir": "./",
|
|
19
|
+
"baseUrl": "./",
|
|
20
|
+
"jsx": "react-jsx",
|
|
21
|
+
"strict": false,
|
|
22
|
+
"noUnusedLocals": false,
|
|
23
|
+
"noUnusedParameters": false,
|
|
24
|
+
"noFallthroughCasesInSwitch": true,
|
|
25
|
+
"noUncheckedSideEffectImports": false,
|
|
26
|
+
"types": [
|
|
27
|
+
"vite-plugin-svgr/client"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"exclude": [
|
|
31
|
+
"dist",
|
|
32
|
+
"node_modules"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"verbatimModuleSyntax": false,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedSideEffectImports": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["vite.config.ts"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {useEffect, useState} from "react";
|
|
2
|
+
|
|
3
|
+
export const removeNavigation = () => {
|
|
4
|
+
const newUrl = `${window.location.pathname}${window.location.search}`;
|
|
5
|
+
window.history.replaceState(null, '', newUrl);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const addNavigation = (state: string) => {
|
|
9
|
+
window.location.hash = state;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const onHashChanges = (state: string) => {
|
|
14
|
+
const [isHashChanged, setIsHashChanged] = useState(false)
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const handleHashChange = (e) => {
|
|
17
|
+
if(window.location.hash !== state) {
|
|
18
|
+
setIsHashChanged(true);
|
|
19
|
+
} else {
|
|
20
|
+
setIsHashChanged(false);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
window.addEventListener('hashchange', handleHashChange);
|
|
24
|
+
return () => {
|
|
25
|
+
window.removeEventListener('hashchange', handleHashChange);
|
|
26
|
+
};
|
|
27
|
+
}, [])
|
|
28
|
+
return isHashChanged
|
|
29
|
+
};
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import dts from "vite-plugin-dts";
|
|
4
|
+
import svgr from "vite-plugin-svgr";
|
|
5
|
+
|
|
6
|
+
// https://vite.dev/config/
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
// Configure plugins for Vite
|
|
9
|
+
plugins: [
|
|
10
|
+
// React plugin for Vite
|
|
11
|
+
react(),
|
|
12
|
+
// Plugin to generate TypeScript declaration files (d.ts)
|
|
13
|
+
dts({
|
|
14
|
+
// Specify the path to the build-specific tsconfig file
|
|
15
|
+
tsconfigPath: "./tsconfig.build.json",
|
|
16
|
+
}),
|
|
17
|
+
svgr()
|
|
18
|
+
],
|
|
19
|
+
// Build configuration options
|
|
20
|
+
build: {
|
|
21
|
+
// Library build options
|
|
22
|
+
lib: {
|
|
23
|
+
// Entry point for the library build
|
|
24
|
+
entry: "lib/index.ts",
|
|
25
|
+
// Function to determine the output file name based on the format
|
|
26
|
+
fileName: (format) => `naria-ui.${format}.js`,
|
|
27
|
+
// Output formats for the library
|
|
28
|
+
formats: ["es", "cjs"],
|
|
29
|
+
},
|
|
30
|
+
// Rollup specific options (used under the hood by Vite)
|
|
31
|
+
rollupOptions: {
|
|
32
|
+
// Specify dependencies that should not be bundled into the library
|
|
33
|
+
external: ["react", "react-dom"],
|
|
34
|
+
// Output options for Rollup
|
|
35
|
+
output: {
|
|
36
|
+
// Configure global variables for external dependencies
|
|
37
|
+
globals: {
|
|
38
|
+
react: "React",
|
|
39
|
+
"react-dom": "ReactDOM",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
// Empty the output directory before building
|
|
44
|
+
emptyOutDir: true,
|
|
45
|
+
// copy the public directory to the output directory
|
|
46
|
+
copyPublicDir: true,
|
|
47
|
+
// Minify the output code
|
|
48
|
+
minify: true,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React, FC, ReactNode } from 'react';
|
|
2
|
-
export interface props extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
3
|
-
type?: "button" | "submit";
|
|
4
|
-
classNames?: {
|
|
5
|
-
button: string;
|
|
6
|
-
loading: {
|
|
7
|
-
wrapper: string;
|
|
8
|
-
color: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
value: string;
|
|
12
|
-
isLoading?: boolean;
|
|
13
|
-
isDisabled?: boolean;
|
|
14
|
-
icon?: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
export declare const Button: FC<props>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button } from './Button';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
export interface props {
|
|
3
|
-
type?: "password" | "text";
|
|
4
|
-
classNames?: {
|
|
5
|
-
wrapper?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
input?: string;
|
|
8
|
-
errorText?: string;
|
|
9
|
-
};
|
|
10
|
-
placeholder: string;
|
|
11
|
-
label: string;
|
|
12
|
-
hasError?: string | null;
|
|
13
|
-
register?: any;
|
|
14
|
-
name?: string;
|
|
15
|
-
isDisabled?: boolean;
|
|
16
|
-
autocomplete?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare const Input: FC<props>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Input } from './Input';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
interface Pagination {
|
|
3
|
-
page?: number;
|
|
4
|
-
pageLabel?: string;
|
|
5
|
-
size?: number;
|
|
6
|
-
sizeLabel?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface props {
|
|
9
|
-
options?: any[];
|
|
10
|
-
label?: string;
|
|
11
|
-
title: string;
|
|
12
|
-
value?: string;
|
|
13
|
-
api?: string;
|
|
14
|
-
hasError?: string | null;
|
|
15
|
-
selected?: any;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
pagination?: Pagination;
|
|
19
|
-
optionFilterLabel?: string;
|
|
20
|
-
hasSearch?: boolean;
|
|
21
|
-
classNames?: {
|
|
22
|
-
wrapper: string;
|
|
23
|
-
label?: string;
|
|
24
|
-
title?: string;
|
|
25
|
-
button?: string;
|
|
26
|
-
input?: string;
|
|
27
|
-
listWrapper?: string;
|
|
28
|
-
list?: string;
|
|
29
|
-
option?: string;
|
|
30
|
-
optionActive?: string;
|
|
31
|
-
mobileHeader?: string;
|
|
32
|
-
};
|
|
33
|
-
onSelectChange?: any;
|
|
34
|
-
}
|
|
35
|
-
export declare const Select: FC<props>;
|
|
36
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Select } from './Select';
|
package/dist/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function capitalize(str: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './capitalize';
|
package/dist/naria-ui.cjs.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function se(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const d=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(i,o,d.get?d:{enumerable:!0,get:()=>t[o]})}}return i.default=t,Object.freeze(i)}const P=se(l);var V={exports:{}},H={};/**
|
|
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 ee;function ie(){if(ee)return H;ee=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function o(d,s,u){var p=null;if(u!==void 0&&(p=""+u),s.key!==void 0&&(p=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:t,type:d,key:p,ref:s!==void 0?s:null,props:u}}return H.Fragment=i,H.jsx=o,H.jsxs=o,H}var U={};/**
|
|
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 re;function ce(){return re||(re=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===T?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case R:return"Profiler";case B:return"StrictMode";case f:return"Suspense";case M:return"SuspenseList";case q: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 W:return"Portal";case G:return(e.displayName||"Context")+".Provider";case O:return(e._context.displayName||"Context")+".Consumer";case z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case C:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function i(e){return""+e}function o(e){try{i(e);var n=!1}catch{n=!0}if(n){n=console;var c=n.error,r=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",r),i(e)}}function d(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function s(){var e=v.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function p(e){if(Y.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function h(e,n){function c(){L||(L=!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)",n))}c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}function E(){var e=t(this.type);return D[e]||(D[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 x(e,n,c,r,b,w,X,Z){return c=w.ref,e={$$typeof:I,type:e,key:n,props:w,_owner:b},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:E}):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:Z}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,n,c,r,b,w,X,Z){var m=n.children;if(m!==void 0)if(r)if(j(m)){for(r=0;r<m.length;r++)S(m[r]);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 S(m);if(Y.call(n,"key")){m=t(e);var $=Object.keys(n).filter(function(oe){return oe!=="key"});r=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",J[m+r]||($=0<$.length?"{"+$.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} />`,r,m,$,m),J[m+r]=!0)}if(m=null,c!==void 0&&(o(c),m=""+c),p(n)&&(o(n.key),m=""+n.key),"key"in n){c={};for(var Q in n)Q!=="key"&&(c[Q]=n[Q])}else c=n;return m&&h(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),x(e,m,w,b,s(),c,X,Z)}function S(e){typeof e=="object"&&e!==null&&e.$$typeof===I&&e._store&&(e._store.validated=1)}var g=l,I=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),G=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),v=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,j=Array.isArray,y=console.createTask?console.createTask:function(){return null};g={"react-stack-bottom-frame":function(e){return e()}};var L,D={},A=g["react-stack-bottom-frame"].bind(g,u)(),F=y(d(u)),J={};U.Fragment=k,U.jsx=function(e,n,c,r,b){var w=1e4>v.recentlyCreatedOwnerStacks++;return N(e,n,c,!1,r,b,w?Error("react-stack-top-frame"):A,w?y(d(e)):F)},U.jsxs=function(e,n,c,r,b){var w=1e4>v.recentlyCreatedOwnerStacks++;return N(e,n,c,!0,r,b,w?Error("react-stack-top-frame"):A,w?y(d(e)):F)}}()),U}var te;function le(){return te||(te=1,process.env.NODE_ENV==="production"?V.exports=ie():V.exports=ce()),V.exports}var a=le();const K=({classNames:t={wrapper:"",color:""}})=>a.jsxs("svg",{className:`nariaLoading ${t.wrapper}`,"data-prop":"wrapper",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.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"}),a.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:t.color,"data-prop":"color"})]}),ue=({type:t="button",classNames:i={button:"",loading:{wrapper:"",color:""}},value:o,icon:d=null,isLoading:s=!1,isDisabled:u=!1,...p})=>a.jsxs("button",{type:t,disabled:u,...p,className:`nariaButton ${u?"nariaButton-disabled":""} ${i?.button}`,"data-prop":"button",children:[s?a.jsx(K,{classNames:{wrapper:i.loading.wrapper,color:i.loading.color},"data-prop-wrapper":"wrapper","data-prop-color":"color"}):d,o]}),de=({type:t="text",placeholder:i,classNames:o={wrapper:"",label:"",input:"",errorText:""},label:d,hasError:s,register:u,name:p,isDisabled:h=!1,autocomplete:E=!1,...x})=>a.jsxs("div",{className:`nariaInputWrapper ${o.wrapper}`,"data-prop":"wrapper",children:[a.jsxs("label",{htmlFor:p,className:`${o.label} ${s&&"nariaInputLabel-error"}`,"data-prop":"label",children:[d,a.jsx("input",{disabled:h,autoComplete:E?"on":"off",id:p,...u,...x,type:t,name:p,className:`${o.input} ${s&&"nariaInput-error"}`,placeholder:i,"data-prop":"input"})]}),s&&a.jsx("p",{className:`nariaInputErrorText ${o?.errorText}`,"data-prop":"errorText",children:s})]}),ne=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z"})),fe=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z"})),ae=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})),pe=()=>{const[t,i]=l.useState(typeof window<"u"?window.innerWidth:0),o=()=>i(typeof window<"u"?window.innerWidth:0);return l.useEffect(()=>(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[t]),t},ge=()=>{const t=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",t)},me=t=>{window.location.hash=t},he=t=>{const[i,o]=l.useState(!1);return l.useEffect(()=>{const d=s=>{window.location.hash!==t?o(!0):o(!1)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d)}},[]),i},we=(t,i,o)=>{l.useEffect(()=>{function d(s){i.current&&!i.current.contains(s.target)&&t?.current&&!t?.current.contains(s.target)&&o()}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[t,o])},ve=({options:t,label:i,hasError:o,title:d,value:s,api:u,selected:p,placeholder:h,disabled:E=!1,pagination:x,optionFilterLabel:N,hasSearch:S=!1,classNames:g={wrapper:"",label:"",title:"",button:"",input:"",listWrapper:"",list:"",option:"",optionActive:"",mobileHeader:""},onSelectChange:I})=>{let W=!0;const k=pe(),B=he("#select"),[R,O]=l.useState(!1),[G,z]=l.useState(!0),[f,M]=l.useState(null),[_,C]=l.useState(null),[q,T]=l.useState(""),[v,Y]=l.useState({page:1,pageLabel:"page",size:20,sizeLabel:"size",isLoading:!1}),j=l.useRef(void 0),y=l.useRef(void 0),L=l.useRef(void 0),D=async()=>{if(j?.current)try{const r=await fetch(j?.current);if(!r.ok)throw new Error(`Response status: ${r.status}`);return await r.json()}catch(r){console.error(r.message)}};l.useEffect(()=>()=>{W=!1},[]),l.useEffect(()=>{if(u?.length){if(j.current=u,j.current.includes(x?.pageLabel||"page")){const r=new URL(u);r.searchParams.set(x?.pageLabel||"page",(x?.page||v.page).toString()),r.searchParams.set(x?.sizeLabel||"size",(x?.size||v.size).toString()),j.current=r.href}z(!0),D().then(r=>{W&&(z(!1),C(r))})}},[u,x]),l.useEffect(()=>{if(v.isLoading){if(j.current.includes(x?.pageLabel||"page")){const r=new URL(j.current);r.searchParams.set(x?.pageLabel||"page",v.page.toString()),j.current=r.href}D().then(r=>{W&&(z(!1),Y({...v,isLoading:!1}),C([..._,...r]))})}},[v]),l.useEffect(()=>{k<768&&(R?(me("select"),document.body.style.overflow="hidden",L.current?.focus()):(window.location.hash&&!document.referrer.includes("#")&&ge(),document.body.style.overflow="auto"))},[R]),l.useEffect(()=>{p&&t?.length&&(t?.find(r=>r[i]===p)?M(t?.find(r=>r[i]===p)):M(p))},[p]),l.useEffect(()=>{f&&S&&(s?.length&&_?.find(r=>r[i]===f[i])?T(_?.find(r=>r[i]===f[i])[s]||""):T(f))},[f]),l.useEffect(()=>{B&&O(!1)},[B]),l.useEffect(()=>{t?.length&&C(t)},[t]);const A=()=>{S&&C(t),O(r=>!r)},F=()=>{S&&(C(t),T(typeof f=="string"?f:f?f[s]:"")),O(!1)},J=r=>{S&&(s?.length?T(r[s]):T(r)),M(r),A(),I&&I(r)},e=r=>{if(!f)return"";if(i?.length&&r[i]===f[i])return`nariaSelectOption-active ${g?.optionActive}`;if(r===f)return`nariaSelectOption-active ${g?.optionActive}`},n=r=>{u?.length&&_?.length&&!v.isLoading&&r.target.offsetHeight+r.target.scrollTop>=r.target.scrollHeight-100&&Y({page:v.page+1,isLoading:!0})},c=r=>{const b=r?.target?.value?.length?t.filter(w=>typeof w=="object"?w[N?.length?N:s].includes(r?.target?.value):w.includes(r?.target?.value)):t;C(b),T(r?.target?.value),R||O(!0)};return we(y,L,F),a.jsxs("div",{className:`nariaSelect ${E?"nariaSelect-disabled":""} ${g?.wrapper}`,"data-prop":"wrapper",children:[a.jsxs("label",{className:`${o&&"!text-danger-100"}
|
|
23
|
-
${g?.label}`,"data-prop":"label",children:[a.jsx("span",{className:g?.title,"data-prop":"title",children:d}),S?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:L,placeholder:h?.length?h:"Select",className:`${f?"text-dark-100":"text-grey-300"}
|
|
24
|
-
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,value:q,disabled:E,type:"text",onClick:A,onChange:c,"data-prop":"input"}),R?a.jsx(ae,{className:"nariaSearchIcon"}):a.jsx(ne,{className:`nariaArrowIcon ${R?"nariaArrowIcon-rotate-180":""}`})]}):a.jsxs("button",{type:"button",ref:L,disabled:E,className:`nariaHandler ${f?"text-dark-100":"text-grey-300"}
|
|
25
|
-
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.button}`,"data-prop":"button",onClick:A,children:[f?s?.length?f[s]:f:h?.length?h:"Select"," ",a.jsx(ne,{className:`nariaArrowIcon ${R?"nariaArrowIcon-rotate-180":""}`})]})]}),R?a.jsx("div",{className:`nariaListWrapper ${k<768?"nariaListWrapper-mobile":""} ${g?.listWrapper}`,"data-prop":"listWrapper",ref:y,children:a.jsx("div",{className:`nariaList ${k<768?"nariaList-mobile":"nariaList-desktop"} ${g?.list}`,"data-prop":"input",onScroll:n,children:u&&G?a.jsx("div",{className:"nariaLoadingWrapper",children:a.jsx(K,{})}):a.jsxs(a.Fragment,{children:[k<768?a.jsxs("div",{className:`nariaSelectMobileHeader ${g?.mobileHeader}`,"data-prop":"mobileHeader",children:[S?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:L,placeholder:h?.length?h:"Select",className:`${f?"text-dark-100":"text-grey-300"}
|
|
26
|
-
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,"data-prop":"input",value:q,disabled:E,type:"text",onChange:c}),a.jsx(ae,{className:"nariaSearchIcon"})]}):void 0,a.jsx("button",{className:"p-3",onClick:F,disabled:E,children:a.jsx(fe,{className:"w-6"})})]}):void 0,_?.length?a.jsx(a.Fragment,{children:_?.map((r,b)=>a.jsx("button",{type:"button",onClick:()=>J(r),disabled:E,className:`nariaSelectOption ${g?.option} ${e(r)}`,"data-prop":"option","data-prop-active":"optionActive",children:s?.length?r[s]:r},b.toString()))}):a.jsx("div",{children:"No Data"}),v.isLoading?a.jsx("div",{className:"nariaLoadingMoreWrapper",children:a.jsx(K,{})}):void 0]})})}):void 0,o&&a.jsx("p",{className:"text-xs mt-1 text-danger-100",children:o})]})};function be(t){return t.charAt(0).toUpperCase()+t.slice(1)}exports.Button=ue;exports.Input=de;exports.Select=ve;exports.capitalize=be;
|
package/dist/naria-ui.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.nariaButton{display:flex;align-items:center;width:100%}.nariaButton .nariaLoading{width:14px;height:14px}.nariaLoading{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nariaSelect{position:relative}.nariaSelect .nariaListWrapper{overflow:hidden}.nariaSelect .nariaListWrapper.nariaListWrapper-mobile{position:fixed;top:0;right:0;height:100%;width:100%;z-index:97}.nariaSelect .nariaList{display:flex;flex-direction:column;width:100%;z-index:99;position:relative;overflow:auto}.nariaSelect .nariaList.nariaList-mobile{position:relative;height:100%}.nariaSelect .nariaList.nariaList-desktop{position:absolute;animation:fadeInTranslateY .3s ease-out forwards;max-height:150px}.nariaSelect .nariaList .nariaLoadingWrapper{padding:24px 0;display:flex;justify-content:center}.nariaSelect .nariaList .nariaLoadingMoreWrapper{position:sticky;bottom:0;text-align:center;width:100%}.nariaSelect .nariaList .nariaLoadingMoreWrapper .nariaLoading{width:20px}.nariaSelect .nariaList .nariaSelectMobileHeader{position:sticky;top:0;justify-content:end;display:flex;gap:8px}.nariaSelect .nariaList .nariaSelectMobileHeader .nariaSearchInput{flex-grow:1}.nariaSelect .nariaSearchInput{position:relative;display:flex}.nariaSelect .nariaSearchInput input{width:100%}.nariaSelect .nariaSearchInput .nariaArrowIcon,.nariaSelect .nariaSearchInput .nariaSearchIcon{position:absolute;bottom:0;margin-top:auto;margin-bottom:auto;top:0;right:0;width:12px;height:12px;z-index:1}.nariaSelect .nariaHandler{position:relative;display:flex;gap:4px;width:100%;align-items:center;justify-content:space-between}.nariaSelect .nariaHandler .nariaArrowIcon{width:12px;height:12px;transition:transform .4s;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}.nariaSelect .nariaHandler .nariaArrowIcon.nariaArrowIcon-rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}html[dir=rtl] .nariaSelect .nariaSearchInput .nariaArrowIcon,html[dir=rtl] .nariaSelect .nariaSearchInput .nariaSearchIcon{left:0;right:auto}@keyframes fadeInTranslateY{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
|