ehscan-react-components 0.1.3 → 0.1.5
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/LICENSE.md +21 -0
- package/README.md +98 -2
- package/dist/Components.d.ts +2 -0
- package/dist/Components.js +6 -0
- package/dist/ExtButton.d.ts +13 -0
- package/dist/ExtButton.js +19 -0
- package/dist/tools/useRipple.d.ts +3 -0
- package/dist/tools/useRipple.js +21 -0
- package/package.json +25 -18
- package/dist/ehscan-react-components.cjs.js +0 -22
- package/dist/ehscan-react-components.d.ts +0 -1
- package/dist/ehscan-react-components.es.js +0 -318
- package/dist/style.css +0 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 beeplaced
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,2 +1,98 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# mgsmu-react - Minimal Global State Management Utility
|
|
2
|
+
|
|
3
|
+
- mgsmu-react is a lightweight global state management utility for React.
|
|
4
|
+
- It provides a simple **publish-subscribe (pub-sub)** mechanism to manage global state without external libraries like Redux or Zustand.
|
|
5
|
+
- Components can subscribe to specific keys and automatically re-render when those keys change.
|
|
6
|
+
|
|
7
|
+
## install
|
|
8
|
+
```
|
|
9
|
+
npm install --save mgsmu-react
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Import in any component
|
|
13
|
+
|
|
14
|
+
```jsx
|
|
15
|
+
import { useStateStore } from 'mgsmu-react';
|
|
16
|
+
```
|
|
17
|
+
- useStateStore() – React hook to access the global state and subscribe to changes.
|
|
18
|
+
|
|
19
|
+
## Invoke state
|
|
20
|
+
```jsx
|
|
21
|
+
const key = "data";
|
|
22
|
+
const [data, setData, removeData] = useStateStore(key);
|
|
23
|
+
```
|
|
24
|
+
- Parameter names are flexible (data, setData and removeData are just examples).
|
|
25
|
+
- keys can be used as you like. You can create as many keys as you like for different scenarios
|
|
26
|
+
|
|
27
|
+
## Set data and key
|
|
28
|
+
|
|
29
|
+
```jsx
|
|
30
|
+
const data = { specifics: "data", state: true, what: "next" };
|
|
31
|
+
setData(data)
|
|
32
|
+
|
|
33
|
+
// Functional Update 1.0.5
|
|
34
|
+
setData(prev => ({ ...prev, added: "new" }));
|
|
35
|
+
```
|
|
36
|
+
- Key: any string can be used ("data", "users", "messages", etc.)
|
|
37
|
+
- Data: any object or array can be stored under that key.
|
|
38
|
+
- Allows management of multiple independent keys in your global state
|
|
39
|
+
|
|
40
|
+
## Listen and catch changes
|
|
41
|
+
|
|
42
|
+
```jsx
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!data) return;
|
|
45
|
+
console.log(data); //use Data
|
|
46
|
+
},[data])
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
logs: {
|
|
51
|
+
"specifics": "data",
|
|
52
|
+
"state": true,
|
|
53
|
+
"what": "next",
|
|
54
|
+
"updatedAt": 1757423800721
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
- useEffect triggers whenever the specified key (data in this example) changes.
|
|
58
|
+
- Supports multiple keys — you can set up multiple useEffect hooks to listen to different keys individually.
|
|
59
|
+
- Ensures components only re-render when the relevant slice of state updates.
|
|
60
|
+
|
|
61
|
+
## Remove keys
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
removeData("data");
|
|
65
|
+
```
|
|
66
|
+
- Deletes a key from the global state.
|
|
67
|
+
- Make sure component is clean if rendered again
|
|
68
|
+
- Note: Triggers re-render for components subscribed to that key.
|
|
69
|
+
|
|
70
|
+
----
|
|
71
|
+
**Notes**
|
|
72
|
+
|
|
73
|
+
- Every state update includes an updatedAt timestamp.
|
|
74
|
+
- The store works with any object structure, making it flexible for various use cases.
|
|
75
|
+
- Lightweight and minimal — no context providers or extra boilerplate required.
|
|
76
|
+
- Ideal for managing small to medium app state where a full state library would be overkill.
|
|
77
|
+
|
|
78
|
+
----
|
|
79
|
+
# Changelog
|
|
80
|
+
|
|
81
|
+
All notable changes to this project will be documented in this file.
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## [1.0.5] - 2027-11-11
|
|
86
|
+
### Fixed
|
|
87
|
+
- Setter now supports functional update (like React’s setState)
|
|
88
|
+
|
|
89
|
+
## [1.0.4] - 2027-10-22
|
|
90
|
+
### Added
|
|
91
|
+
- Added UseClickSetter
|
|
92
|
+
- Only Clicking purpose
|
|
93
|
+
|
|
94
|
+
## [1.0.3] - 2025-10-22
|
|
95
|
+
### Fixed
|
|
96
|
+
- Optimized listener notifications:
|
|
97
|
+
- Only listeners subscribed to a changed or removed key are notified.
|
|
98
|
+
- Previously, all listeners were notified on every state change.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
index?: string | number;
|
|
4
|
+
text?: string;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
addClass?: string;
|
|
7
|
+
notimeout?: boolean;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
click?: (args?: any) => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const ExtButton: React.FC<Props>;
|
|
13
|
+
export default ExtButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback } from "react";
|
|
3
|
+
import useRipple from "./tools/useRipple";
|
|
4
|
+
const ExtButton = ({ index, text, selected, addClass, notimeout, size = 'md', click, children }) => {
|
|
5
|
+
const buttonRef = useRef(null);
|
|
6
|
+
const handleRipple = useRipple();
|
|
7
|
+
const handleButtonClick = useCallback((event) => {
|
|
8
|
+
handleRipple(event, buttonRef);
|
|
9
|
+
if (notimeout) {
|
|
10
|
+
click === null || click === void 0 ? void 0 : click(event);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
click === null || click === void 0 ? void 0 : click(event);
|
|
15
|
+
}, 200);
|
|
16
|
+
}, [notimeout, click, handleRipple]);
|
|
17
|
+
return (_jsx(_Fragment, { children: _jsxs("button", { type: "button", ref: buttonRef, onClick: handleButtonClick, className: `ext-btn ext-btn--primary ext-btn--${size} _ripple ${addClass !== null && addClass !== void 0 ? addClass : ''}`, "aria-pressed": selected, children: [children, text && _jsx("div", { className: "ext-btn-label", children: text })] }, index) }));
|
|
18
|
+
};
|
|
19
|
+
export default ExtButton;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
const useRipple = () => {
|
|
3
|
+
const handleRipple = useCallback((event, buttonRef) => {
|
|
4
|
+
const button = buttonRef.current;
|
|
5
|
+
if (!button)
|
|
6
|
+
return;
|
|
7
|
+
const rect = button.getBoundingClientRect();
|
|
8
|
+
const size = Math.max(rect.width, rect.height);
|
|
9
|
+
const x = event.clientX - rect.left - size / 2;
|
|
10
|
+
const y = event.clientY - rect.top - size / 2;
|
|
11
|
+
const ripple = document.createElement('span');
|
|
12
|
+
ripple.style.width = ripple.style.height = `${size}px`;
|
|
13
|
+
ripple.style.left = `${x}px`;
|
|
14
|
+
ripple.style.top = `${y}px`;
|
|
15
|
+
ripple.className = 'ripple';
|
|
16
|
+
button.appendChild(ripple);
|
|
17
|
+
setTimeout(() => ripple.remove(), 600);
|
|
18
|
+
}, []);
|
|
19
|
+
return handleRipple;
|
|
20
|
+
};
|
|
21
|
+
export default useRipple;
|
package/package.json
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ehscan-react-components",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"
|
|
7
|
-
"types": "dist/ehscan-react-components.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "components",
|
|
5
|
+
"main": "dist/Components.js",
|
|
6
|
+
"types": "dist/Components.d.ts",
|
|
11
7
|
"scripts": {
|
|
12
|
-
"build": "
|
|
13
|
-
"
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"prepublishOnly": "npm run build"
|
|
14
10
|
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"react",
|
|
13
|
+
"state",
|
|
14
|
+
"global-state",
|
|
15
|
+
"store",
|
|
16
|
+
"minimal"
|
|
17
|
+
],
|
|
18
|
+
"author": "Your Name",
|
|
19
|
+
"license": "MIT",
|
|
15
20
|
"peerDependencies": {
|
|
16
|
-
"react": "^18.
|
|
17
|
-
"react-dom": "^18.0.0"
|
|
21
|
+
"react": "^18.3.1"
|
|
18
22
|
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
19
26
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
27
|
+
"@types/glob": "8",
|
|
28
|
+
"@types/react": "^19.1.12",
|
|
29
|
+
"@types/react-dom": "^19.1.9",
|
|
30
|
+
"glob": "8",
|
|
31
|
+
"minimatch": "5",
|
|
32
|
+
"typescript": "^5.6.3"
|
|
26
33
|
}
|
|
27
34
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react");var j={exports:{}},E={};/**
|
|
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 M;function ee(){if(M)return E;M=1;var f=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function c(i,n,s){var l=null;if(s!==void 0&&(l=""+s),n.key!==void 0&&(l=""+n.key),"key"in n){s={};for(var m in n)m!=="key"&&(s[m]=n[m])}else s=n;return n=s.ref,{$$typeof:f,type:i,key:l,ref:n!==void 0?n:null,props:s}}return E.Fragment=d,E.jsx=c,E.jsxs=c,E}var b={};/**
|
|
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 L;function re(){return L||(L=1,process.env.NODE_ENV!=="production"&&function(){function f(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case z:return"Profiler";case U:return"StrictMode";case G:return"Suspense";case J:return"SuspenseList";case H: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 q:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case B:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return r=e.displayName||null,r!==null?r:f(e.type)||"Memo";case S:r=e._payload,e=e._init;try{return f(e(r))}catch{}}return null}function d(e){return""+e}function c(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),d(e)}}function i(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===S)return"<...>";try{var r=f(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function n(){var e=g.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function l(e){if(C.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function m(e,r){function t(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function u(){var e=f(this.type);return Y[e]||(Y[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,r,t,a,h,A){var o=t.ref;return e={$$typeof:N,type:e,key:r,props:t,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:u}):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:h}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function v(e,r,t,a,h,A){var o=r.children;if(o!==void 0)if(a)if(Q(o)){for(a=0;a<o.length;a++)p(o[a]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(o);if(C.call(r,"key")){o=f(e);var _=Object.keys(r).filter(function(K){return K!=="key"});a=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",D[o+a]||(_=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} />`,a,o,_,o),D[o+a]=!0)}if(o=null,t!==void 0&&(c(t),o=""+t),l(r)&&(c(r.key),o=""+r.key),"key"in r){t={};for(var P in r)P!=="key"&&(t[P]=r[P])}else t=r;return o&&m(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),R(e,o,t,n(),h,A)}function p(e){w(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===S&&(e._payload.status==="fulfilled"?w(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function w(e){return typeof e=="object"&&e!==null&&e.$$typeof===N}var T=x,N=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),q=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),g=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Object.prototype.hasOwnProperty,Q=Array.isArray,k=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var $,Y={},F=T.react_stack_bottom_frame.bind(T,s)(),I=k(i(s)),D={};b.Fragment=O,b.jsx=function(e,r,t){var a=1e4>g.recentlyCreatedOwnerStacks++;return v(e,r,t,!1,a?Error("react-stack-top-frame"):F,a?k(i(e)):I)},b.jsxs=function(e,r,t){var a=1e4>g.recentlyCreatedOwnerStacks++;return v(e,r,t,!0,a?Error("react-stack-top-frame"):F,a?k(i(e)):I)}}()),b}process.env.NODE_ENV==="production"?j.exports=ee():j.exports=re();var y=j.exports;const te=()=>x.useCallback((d,c)=>{const i=c==null?void 0:c.current;if(!i)return;const n=i.getBoundingClientRect(),s=Math.max(n.width,n.height),l=d.clientX-n.left-s/2,m=d.clientY-n.top-s/2,u=document.createElement("span");u.style.width=u.style.height=`${s}px`,u.style.left=`${l}px`,u.style.top=`${m}px`,u.className="ripple",i.appendChild(u),setTimeout(()=>u.remove(),600)},[]),ne=({index:f,text:d,selected:c,addClass:i,notimeout:n,size:s="md",click:l,children:m})=>{const u=x.useRef(null),R=te(),v=x.useCallback(p=>{if(u!=null&&u.current){if(R(p,u),n){l==null||l(p);return}setTimeout(()=>{l==null||l(p)},200)}},[n,l,R]);return y.jsx(y.Fragment,{children:y.jsxs("button",{type:"button",ref:u,onClick:v,className:`ext-btn ext-btn--primary ext-btn--${s} _ripple ${i??""}`,"aria-pressed":c,children:[m,d&&y.jsx("div",{className:"ext-btn-label",children:d})]},f)})};exports.Ext_Button=ne;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import ee, { useCallback as L, useRef as re } from "react";
|
|
2
|
-
var w = { exports: {} }, E = {};
|
|
3
|
-
/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var D;
|
|
13
|
-
function te() {
|
|
14
|
-
if (D) return E;
|
|
15
|
-
D = 1;
|
|
16
|
-
var f = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
|
|
17
|
-
function c(i, n, s) {
|
|
18
|
-
var l = null;
|
|
19
|
-
if (s !== void 0 && (l = "" + s), n.key !== void 0 && (l = "" + n.key), "key" in n) {
|
|
20
|
-
s = {};
|
|
21
|
-
for (var m in n)
|
|
22
|
-
m !== "key" && (s[m] = n[m]);
|
|
23
|
-
} else s = n;
|
|
24
|
-
return n = s.ref, {
|
|
25
|
-
$$typeof: f,
|
|
26
|
-
type: i,
|
|
27
|
-
key: l,
|
|
28
|
-
ref: n !== void 0 ? n : null,
|
|
29
|
-
props: s
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return E.Fragment = d, E.jsx = c, E.jsxs = c, E;
|
|
33
|
-
}
|
|
34
|
-
var b = {};
|
|
35
|
-
/**
|
|
36
|
-
* @license React
|
|
37
|
-
* react-jsx-runtime.development.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
var M;
|
|
45
|
-
function ne() {
|
|
46
|
-
return M || (M = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
function f(e) {
|
|
48
|
-
if (e == null) return null;
|
|
49
|
-
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
51
|
-
if (typeof e == "string") return e;
|
|
52
|
-
switch (e) {
|
|
53
|
-
case y:
|
|
54
|
-
return "Fragment";
|
|
55
|
-
case z:
|
|
56
|
-
return "Profiler";
|
|
57
|
-
case U:
|
|
58
|
-
return "StrictMode";
|
|
59
|
-
case G:
|
|
60
|
-
return "Suspense";
|
|
61
|
-
case J:
|
|
62
|
-
return "SuspenseList";
|
|
63
|
-
case H:
|
|
64
|
-
return "Activity";
|
|
65
|
-
}
|
|
66
|
-
if (typeof e == "object")
|
|
67
|
-
switch (typeof e.tag == "number" && console.error(
|
|
68
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
), e.$$typeof) {
|
|
70
|
-
case W:
|
|
71
|
-
return "Portal";
|
|
72
|
-
case q:
|
|
73
|
-
return e.displayName || "Context";
|
|
74
|
-
case V:
|
|
75
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case B:
|
|
77
|
-
var r = e.render;
|
|
78
|
-
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case X:
|
|
80
|
-
return r = e.displayName || null, r !== null ? r : f(e.type) || "Memo";
|
|
81
|
-
case O:
|
|
82
|
-
r = e._payload, e = e._init;
|
|
83
|
-
try {
|
|
84
|
-
return f(e(r));
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
function d(e) {
|
|
91
|
-
return "" + e;
|
|
92
|
-
}
|
|
93
|
-
function c(e) {
|
|
94
|
-
try {
|
|
95
|
-
d(e);
|
|
96
|
-
var r = !1;
|
|
97
|
-
} catch {
|
|
98
|
-
r = !0;
|
|
99
|
-
}
|
|
100
|
-
if (r) {
|
|
101
|
-
r = console;
|
|
102
|
-
var t = r.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
-
return t.call(
|
|
104
|
-
r,
|
|
105
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
a
|
|
107
|
-
), d(e);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function i(e) {
|
|
111
|
-
if (e === y) return "<>";
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof === O)
|
|
113
|
-
return "<...>";
|
|
114
|
-
try {
|
|
115
|
-
var r = f(e);
|
|
116
|
-
return r ? "<" + r + ">" : "<...>";
|
|
117
|
-
} catch {
|
|
118
|
-
return "<...>";
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function n() {
|
|
122
|
-
var e = A.A;
|
|
123
|
-
return e === null ? null : e.getOwner();
|
|
124
|
-
}
|
|
125
|
-
function s() {
|
|
126
|
-
return Error("react-stack-top-frame");
|
|
127
|
-
}
|
|
128
|
-
function l(e) {
|
|
129
|
-
if (N.call(e, "key")) {
|
|
130
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
-
if (r && r.isReactWarning) return !1;
|
|
132
|
-
}
|
|
133
|
-
return e.key !== void 0;
|
|
134
|
-
}
|
|
135
|
-
function m(e, r) {
|
|
136
|
-
function t() {
|
|
137
|
-
C || (C = !0, console.error(
|
|
138
|
-
"%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
|
-
r
|
|
140
|
-
));
|
|
141
|
-
}
|
|
142
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
-
get: t,
|
|
144
|
-
configurable: !0
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
function u() {
|
|
148
|
-
var e = f(this.type);
|
|
149
|
-
return $[e] || ($[e] = !0, console.error(
|
|
150
|
-
"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
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
-
}
|
|
153
|
-
function R(e, r, t, a, h, S) {
|
|
154
|
-
var o = t.ref;
|
|
155
|
-
return e = {
|
|
156
|
-
$$typeof: j,
|
|
157
|
-
type: e,
|
|
158
|
-
key: r,
|
|
159
|
-
props: t,
|
|
160
|
-
_owner: a
|
|
161
|
-
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
|
-
enumerable: !1,
|
|
163
|
-
get: u
|
|
164
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
|
-
configurable: !1,
|
|
166
|
-
enumerable: !1,
|
|
167
|
-
writable: !0,
|
|
168
|
-
value: 0
|
|
169
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
170
|
-
configurable: !1,
|
|
171
|
-
enumerable: !1,
|
|
172
|
-
writable: !0,
|
|
173
|
-
value: null
|
|
174
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
175
|
-
configurable: !1,
|
|
176
|
-
enumerable: !1,
|
|
177
|
-
writable: !0,
|
|
178
|
-
value: h
|
|
179
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
180
|
-
configurable: !1,
|
|
181
|
-
enumerable: !1,
|
|
182
|
-
writable: !0,
|
|
183
|
-
value: S
|
|
184
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
|
-
}
|
|
186
|
-
function v(e, r, t, a, h, S) {
|
|
187
|
-
var o = r.children;
|
|
188
|
-
if (o !== void 0)
|
|
189
|
-
if (a)
|
|
190
|
-
if (Q(o)) {
|
|
191
|
-
for (a = 0; a < o.length; a++)
|
|
192
|
-
p(o[a]);
|
|
193
|
-
Object.freeze && Object.freeze(o);
|
|
194
|
-
} else
|
|
195
|
-
console.error(
|
|
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."
|
|
197
|
-
);
|
|
198
|
-
else p(o);
|
|
199
|
-
if (N.call(r, "key")) {
|
|
200
|
-
o = f(e);
|
|
201
|
-
var _ = Object.keys(r).filter(function(K) {
|
|
202
|
-
return K !== "key";
|
|
203
|
-
});
|
|
204
|
-
a = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", I[o + a] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
-
let props = %s;
|
|
207
|
-
<%s {...props} />
|
|
208
|
-
React keys must be passed directly to JSX without using spread:
|
|
209
|
-
let props = %s;
|
|
210
|
-
<%s key={someKey} {...props} />`,
|
|
211
|
-
a,
|
|
212
|
-
o,
|
|
213
|
-
_,
|
|
214
|
-
o
|
|
215
|
-
), I[o + a] = !0);
|
|
216
|
-
}
|
|
217
|
-
if (o = null, t !== void 0 && (c(t), o = "" + t), l(r) && (c(r.key), o = "" + r.key), "key" in r) {
|
|
218
|
-
t = {};
|
|
219
|
-
for (var g in r)
|
|
220
|
-
g !== "key" && (t[g] = r[g]);
|
|
221
|
-
} else t = r;
|
|
222
|
-
return o && m(
|
|
223
|
-
t,
|
|
224
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
), R(
|
|
226
|
-
e,
|
|
227
|
-
o,
|
|
228
|
-
t,
|
|
229
|
-
n(),
|
|
230
|
-
h,
|
|
231
|
-
S
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
function p(e) {
|
|
235
|
-
P(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === O && (e._payload.status === "fulfilled" ? P(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
|
-
}
|
|
237
|
-
function P(e) {
|
|
238
|
-
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
239
|
-
}
|
|
240
|
-
var T = ee, j = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), q = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), A = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, Q = Array.isArray, k = console.createTask ? console.createTask : function() {
|
|
241
|
-
return null;
|
|
242
|
-
};
|
|
243
|
-
T = {
|
|
244
|
-
react_stack_bottom_frame: function(e) {
|
|
245
|
-
return e();
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var C, $ = {}, Y = T.react_stack_bottom_frame.bind(
|
|
249
|
-
T,
|
|
250
|
-
s
|
|
251
|
-
)(), F = k(i(s)), I = {};
|
|
252
|
-
b.Fragment = y, b.jsx = function(e, r, t) {
|
|
253
|
-
var a = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
254
|
-
return v(
|
|
255
|
-
e,
|
|
256
|
-
r,
|
|
257
|
-
t,
|
|
258
|
-
!1,
|
|
259
|
-
a ? Error("react-stack-top-frame") : Y,
|
|
260
|
-
a ? k(i(e)) : F
|
|
261
|
-
);
|
|
262
|
-
}, b.jsxs = function(e, r, t) {
|
|
263
|
-
var a = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
264
|
-
return v(
|
|
265
|
-
e,
|
|
266
|
-
r,
|
|
267
|
-
t,
|
|
268
|
-
!0,
|
|
269
|
-
a ? Error("react-stack-top-frame") : Y,
|
|
270
|
-
a ? k(i(e)) : F
|
|
271
|
-
);
|
|
272
|
-
};
|
|
273
|
-
}()), b;
|
|
274
|
-
}
|
|
275
|
-
process.env.NODE_ENV === "production" ? w.exports = te() : w.exports = ne();
|
|
276
|
-
var x = w.exports;
|
|
277
|
-
const ae = () => L(
|
|
278
|
-
(d, c) => {
|
|
279
|
-
const i = c == null ? void 0 : c.current;
|
|
280
|
-
if (!i) return;
|
|
281
|
-
const n = i.getBoundingClientRect(), s = Math.max(n.width, n.height), l = d.clientX - n.left - s / 2, m = d.clientY - n.top - s / 2, u = document.createElement("span");
|
|
282
|
-
u.style.width = u.style.height = `${s}px`, u.style.left = `${l}px`, u.style.top = `${m}px`, u.className = "ripple", i.appendChild(u), setTimeout(() => u.remove(), 600);
|
|
283
|
-
},
|
|
284
|
-
[]
|
|
285
|
-
), se = ({ index: f, text: d, selected: c, addClass: i, notimeout: n, size: s = "md", click: l, children: m }) => {
|
|
286
|
-
const u = re(null), R = ae(), v = L(
|
|
287
|
-
(p) => {
|
|
288
|
-
if (u != null && u.current) {
|
|
289
|
-
if (R(p, u), n) {
|
|
290
|
-
l == null || l(p);
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
setTimeout(() => {
|
|
294
|
-
l == null || l(p);
|
|
295
|
-
}, 200);
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
[n, l, R]
|
|
299
|
-
);
|
|
300
|
-
return /* @__PURE__ */ x.jsx(x.Fragment, { children: /* @__PURE__ */ x.jsxs(
|
|
301
|
-
"button",
|
|
302
|
-
{
|
|
303
|
-
type: "button",
|
|
304
|
-
ref: u,
|
|
305
|
-
onClick: v,
|
|
306
|
-
className: `ext-btn ext-btn--primary ext-btn--${s} _ripple ${i ?? ""}`,
|
|
307
|
-
"aria-pressed": c,
|
|
308
|
-
children: [
|
|
309
|
-
m,
|
|
310
|
-
d && /* @__PURE__ */ x.jsx("div", { className: "ext-btn-label", children: d })
|
|
311
|
-
]
|
|
312
|
-
},
|
|
313
|
-
f
|
|
314
|
-
) });
|
|
315
|
-
};
|
|
316
|
-
export {
|
|
317
|
-
se as Ext_Button
|
|
318
|
-
};
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
button{--btn-bg: #007aff;--btn-color: #fff;--btn-radius: 18px;--btn-padding-y: .5rem;--btn-padding-x: 1rem;--btn-width: fit-content;--btn-height: auto;--btn-font-size: 1rem;--btn-font-weight: 500;--btn-transition: all .2s ease;--btn-line-height: 1.5;--ripple-box-shadow: rgb(100 100 111 / 20%) 0px 7px 29px 0px;--ripple-effect-bck: rgb(0 0 0 / 15%)}.ext-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;font-family:inherit;font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-color);background-color:var(--btn-bg);border:none;border-radius:var(--btn-radius);padding:var(--btn-padding-y) var(--btn-padding-x);width:var(--btn-width);height:var(--btn-height);cursor:pointer;transition:var(--btn-transition);text-align:center;text-decoration:none;-webkit-user-select:none;user-select:none}._ripple{line-height:var(--btn-line-height);font-weight:var(--btn-font-weight);box-shadow:var(--ripple-box-shadow);position:relative;overflow:hidden;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ext-btn:focus-visible{outline:2px solid #007aff;outline-offset:2px}.ext-btn:disabled,.ext-btn[aria-disabled=true]{opacity:.6;cursor:not-allowed}.ext-btn:hover:not(:disabled):not([aria-disabled=true]){filter:brightness(.9)}.ext-btn:active:not(:disabled):not([aria-disabled=true]){transform:scale(.97)}.ext-btn--sm{--btn-padding-y: .25rem;--btn-padding-x: .75rem;--btn-font-size: .85rem}.ext-btn--md{--btn-padding-y: .5rem;--btn-padding-x: 1rem;--btn-font-size: 1rem}.ext-btn--lg{--btn-padding-y: .75rem;--btn-padding-x: 1.5rem;--btn-font-size: 1.1rem}.ext-btn--primary{--btn-bg: #007aff;--btn-color: #fff}.ext-btn--secondary{--btn-bg: #e5e5ea;--btn-color: #111}.ext-btn--outline,.ext-btn--ghost{--btn-bg: transparent;--btn-color: #007aff}.ext-btn--danger{--btn-bg: #ff3b30;--btn-color: #fff}.ext-btn--loading{pointer-events:none;opacity:.8}.ext-btn-icon{display:flex;align-items:center;justify-content:center;font-size:1.1em}.ext-btn-label{display:inline-block;white-space:nowrap}.ripple{background:var(--ripple-effect-bck);position:absolute;border-radius:50%;transform:scale(0);animation:ripple-animation .6s linear;pointer-events:none;transform-origin:center center;will-change:transform,opacity}@media (hover: hover) and (pointer: fine){._ripple{cursor:pointer}}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}.lds-ripple,.lds-ripple div{box-sizing:border-box}.lds-ripple{--image-sync-wh: 100%;--bw: 5px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:var(--image-sync-wh);width:var(--image-sync-wh);z-index:9999}.lds-ripple div{position:absolute;border:var(--bw) solid white;opacity:1;border-radius:50%;animation:lds-ripple 1s cubic-bezier(0,.4,.8,1) infinite}.lds-ripple div:nth-child(2){animation-delay:-.5s;border:var(--bw) solid whitesmoke}@keyframes lds-ripple{0%{top:50%;left:50%;width:8%;height:8%;opacity:.2;transform:translate(-50%,-50%)}5%{top:50%;left:50%;width:8%;height:8%;opacity:1;transform:translate(-50%,-50%)}to{top:50%;left:50%;width:var(--image-sync-wh);height:var(--image-sync-wh);opacity:.2;transform:translate(-50%,-50%)}}.closeBtn{--btn-width: 35px;--btn-height: 35px;padding:0;--btn-bg: lightgray}.saveBtn{--btn-height: 35px;--btn-padding-x: 30px;--btn-bg: #007aff}.trashBtn{--btn-height: 35px;--btn-padding-x: 10px;--btn-radius: 4px;--btn-bg: lightgray}
|