naria-ui 0.1.54 → 0.1.56

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.
Files changed (48) hide show
  1. package/dist/lib/components/Button/Button.d.ts +16 -0
  2. package/dist/lib/components/Button/index.d.ts +1 -0
  3. package/dist/lib/components/Input/Input.d.ts +19 -0
  4. package/dist/lib/components/Input/index.d.ts +1 -0
  5. package/dist/lib/components/Select/Select.d.ts +37 -0
  6. package/dist/lib/components/Select/index.d.ts +1 -0
  7. package/dist/lib/components/index.d.ts +3 -0
  8. package/dist/lib/index.d.ts +1 -0
  9. package/dist/naria-ui.cjs.js +26 -0
  10. package/dist/naria-ui.css +1 -0
  11. package/dist/naria-ui.es.js +669 -0
  12. package/package.json +4 -1
  13. package/assets/icons/angle-down.svg +0 -1
  14. package/assets/icons/angle-left.svg +0 -1
  15. package/assets/icons/angle-right.svg +0 -1
  16. package/assets/icons/angle-up.svg +0 -1
  17. package/assets/icons/close.svg +0 -1
  18. package/assets/icons/search.svg +0 -1
  19. package/eslint.config.js +0 -28
  20. package/hooks/click-outside.ts +0 -17
  21. package/hooks/is-first-render.ts +0 -7
  22. package/hooks/use-width.ts +0 -11
  23. package/index.html +0 -13
  24. package/lib/components/Button/Button.tsx +0 -47
  25. package/lib/components/Button/button.scss +0 -9
  26. package/lib/components/Button/index.ts +0 -1
  27. package/lib/components/Input/Input.tsx +0 -66
  28. package/lib/components/Input/index.ts +0 -1
  29. package/lib/components/Select/Select.tsx +0 -414
  30. package/lib/components/Select/index.ts +0 -1
  31. package/lib/components/Select/select.scss +0 -138
  32. package/lib/components/index.ts +0 -3
  33. package/lib/index.ts +0 -1
  34. package/shared/loading/Loading.tsx +0 -35
  35. package/shared/loading/loading.scss +0 -9
  36. package/src/App.css +0 -0
  37. package/src/App.tsx +0 -81
  38. package/src/index.css +0 -0
  39. package/src/main.tsx +0 -7
  40. package/src/vite-env.d.ts +0 -1
  41. package/tsconfig.app.json +0 -34
  42. package/tsconfig.build.json +0 -11
  43. package/tsconfig.json +0 -7
  44. package/tsconfig.node.json +0 -24
  45. package/utils/navigator.ts +0 -29
  46. package/vite.config.ts +0 -50
  47. /package/{public → dist}/light.css +0 -0
  48. /package/{public → dist}/light.scss +0 -0
@@ -1,138 +0,0 @@
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
- }
@@ -1,3 +0,0 @@
1
- export * from './Button'
2
- export * from './Input'
3
- export * from './Select'
package/lib/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components';
@@ -1,35 +0,0 @@
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;
@@ -1,9 +0,0 @@
1
- .nariaLoading {
2
- animation: spin 1s linear infinite;
3
- }
4
-
5
- @keyframes spin {
6
- to {
7
- transform: rotate(360deg);
8
- }
9
- }
package/src/App.css DELETED
File without changes
package/src/App.tsx DELETED
@@ -1,81 +0,0 @@
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 DELETED
File without changes
package/src/main.tsx DELETED
@@ -1,7 +0,0 @@
1
- import { createRoot } from 'react-dom/client'
2
- import './index.css'
3
- import App from './App.tsx'
4
-
5
- createRoot(document.getElementById('root')!).render(
6
- <App />,
7
- )
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/tsconfig.app.json DELETED
@@ -1,34 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "./tsconfig.app.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "emitDeclarationOnly": true,
6
- "outDir": "./dist",
7
- "declarationMap": false,
8
- "noEmit": false
9
- },
10
- "include": ["lib/**/*"]
11
- }
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- { "path": "./tsconfig.app.json" },
5
- { "path": "./tsconfig.node.json" }
6
- ]
7
- }
@@ -1,24 +0,0 @@
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
- }
@@ -1,29 +0,0 @@
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 DELETED
@@ -1,50 +0,0 @@
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
- });
File without changes
File without changes