jb-core 0.4.0 → 0.6.0
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/configs/tsconfig-base.json +4 -1
- package/configs/tsconfig-web-component.json +1 -3
- package/dist/device-detection.d.ts +2 -1
- package/dist/device-detection.d.ts.map +1 -0
- package/dist/events.d.ts +23 -22
- package/dist/events.d.ts.map +1 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/persian-tools.d.ts +4 -3
- package/dist/persian-tools.d.ts.map +1 -0
- package/package.json +2 -1
- package/react/dist/hooks/index.d.ts +3 -3
- package/react/dist/hooks/use-event.d.ts +1 -1
- package/react/dist/hooks/useInstance.d.ts +10 -10
- package/react/dist/hooks/useLazyRef.d.ts +4 -4
- package/react/dist/index.cjs.js.map +1 -1
- package/react/dist/index.d.ts +1 -1
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.umd.js.map +1 -1
- package/react/tsconfig.json +1 -0
- package/styles/colors.scss +4 -1
- package/theme/colors.ts +65 -0
- package/theme/index.ts +1 -0
- package/dist/lib/device-detection.d.ts +0 -1
- package/dist/lib/events.d.ts +0 -22
- package/dist/lib/index.d.ts +0 -3
- package/dist/lib/persian-tools.d.ts +0 -3
- package/dist/web-component/jb-core/lib/device-detection.d.ts +0 -1
- package/dist/web-component/jb-core/lib/events.d.ts +0 -22
- package/dist/web-component/jb-core/lib/index.d.ts +0 -3
- package/dist/web-component/jb-core/lib/persian-helper.d.ts +0 -3
- package/dist/web-component/jb-core/lib/persian-tools.d.ts +0 -3
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
"removeComments": false,
|
|
6
6
|
"sourceMap": true,
|
|
7
7
|
"allowJs": true,
|
|
8
|
-
"composite": true,
|
|
9
8
|
"target": "ES2020",
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap":true,
|
|
11
|
+
"incremental": false
|
|
10
12
|
},
|
|
11
13
|
"exclude": [
|
|
14
|
+
"stories",
|
|
12
15
|
"node_modules",
|
|
13
16
|
"**/*.spec.ts",
|
|
14
17
|
]
|
|
@@ -11,10 +11,8 @@
|
|
|
11
11
|
"allowJs": true,
|
|
12
12
|
"target": "ES2020",
|
|
13
13
|
"typeRoots" : ["../node_modules/@types", "./global.d.ts"],
|
|
14
|
-
"composite": true,
|
|
15
14
|
"declaration": true,
|
|
16
|
-
"
|
|
17
|
-
"declarationMap": false,
|
|
15
|
+
"declarationMap": true,
|
|
18
16
|
},
|
|
19
17
|
"include": [
|
|
20
18
|
"global.d.ts",
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const isMobile: () => boolean;
|
|
1
|
+
export declare const isMobile: () => boolean;
|
|
2
|
+
//# sourceMappingURL=device-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-detection.d.ts","sourceRoot":"","sources":["../lib/device-detection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,eAEpB,CAAC"}
|
package/dist/events.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* add type to event target for easier access to target
|
|
3
|
-
*/
|
|
4
|
-
export type EventTypeWithTarget<TEvent, TTarget> = TEvent & {
|
|
5
|
-
target: TTarget;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* this function will stop event from propagate even in capturing phase and will call handler only if event target is the element
|
|
9
|
-
*/
|
|
10
|
-
export declare function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e: TEvent) => void, options?: AddEventListenerOptions): void;
|
|
11
|
-
/**
|
|
12
|
-
* create a keyboardEvent based on `e` value and replace them with initObj
|
|
13
|
-
*/
|
|
14
|
-
export declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent;
|
|
15
|
-
/**
|
|
16
|
-
* create a InputEvent based on `e` value and replace them with initObj
|
|
17
|
-
*/
|
|
18
|
-
export declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent;
|
|
19
|
-
/**
|
|
20
|
-
* create a InputEvent based on `e` value and replace them with initObj
|
|
21
|
-
*/
|
|
22
|
-
export declare function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit): FocusEvent;
|
|
1
|
+
/**
|
|
2
|
+
* add type to event target for easier access to target
|
|
3
|
+
*/
|
|
4
|
+
export type EventTypeWithTarget<TEvent, TTarget> = TEvent & {
|
|
5
|
+
target: TTarget;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* this function will stop event from propagate even in capturing phase and will call handler only if event target is the element
|
|
9
|
+
*/
|
|
10
|
+
export declare function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e: TEvent) => void, options?: AddEventListenerOptions): void;
|
|
11
|
+
/**
|
|
12
|
+
* create a keyboardEvent based on `e` value and replace them with initObj
|
|
13
|
+
*/
|
|
14
|
+
export declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent;
|
|
15
|
+
/**
|
|
16
|
+
* create a InputEvent based on `e` value and replace them with initObj
|
|
17
|
+
*/
|
|
18
|
+
export declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent;
|
|
19
|
+
/**
|
|
20
|
+
* create a InputEvent based on `e` value and replace them with initObj
|
|
21
|
+
*/
|
|
22
|
+
export declare function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit): FocusEvent;
|
|
23
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../lib/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,EAAE,OAAO,IAAI,MAAM,GAAG;IAC1D,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AACF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,EAAC,MAAM,KAAK,IAAI,EAAE,OAAO,GAAE,uBAA4B,QAQ1K;AACD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,iBAuBlG;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,cAiBzF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,cAazF"}
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts"],"sourcesContent":["","",""],"mappings":"sCAsEM,SAA2B,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,KAAM,EAAE,KACR,MAAO,EAAE,MACT,cAAe,EAAE,iBACd,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,2BAnCK,SAA2B,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,KAAM,EAAE,KACR,MAAO,EAAE,MACT,KAAM,EAAE,KACR,aAAc,EAAE,aAChB,UAAW,EAAE,UACb,aAA4C,mBAAvB,EAAE,kBAAkC,EAAE,kBAAoB,MAC5E,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,8BA5CK,SAA8B,EAAmB,EAAkB,GACvE,MAAM,EAAmC,CACvC,OAAQ,EAAE,OACV,QAAS,EAAE,QACX,WAAY,EAAE,WACd,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,IAAK,EAAE,IACP,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,SAAU,EAAE,SACZ,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,MAAO,EAAE,SACN,GAGL,OADc,IAAI,cAAc,EAAW,EAE5C,uBEhCD,SAAsB,GACpB,MAAqB,iBAAV,GAAsB,MAAM,GAC9B,GAGM,EAAM,WAAW,QADlB,UACiC,SAAU,GACvD,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,GAGF,uBAtBD,SAAsB,GACpB,MAAqB,iBAAV,EACF,GAGM,EAAM,QADP,UACsB,SAAU,GAC5C,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,GAGF,mBDVuB,IACf,QAAQ,KAAK,OAAO,UAAU,wCDQjC,SAA8D,EAAkB,EAAmB,EAA6B,EAAmC,CAAE,GACzK,SAAS,iBAAiB,GAAY,IAChC,EAAE,eAAe,SAAS,KAC5B,EAAE,kBACF,EAAE,2BACF,EAAQ,GACT,GACD,CAAC,SAAQ,KAAQ,GACpB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from "./events.js";
|
|
2
|
-
export * from "./device-detection.js";
|
|
3
|
-
export * from "./persian-tools.js";
|
|
1
|
+
export * from "./events.js";
|
|
2
|
+
export * from "./device-detection.js";
|
|
3
|
+
export * from "./persian-tools.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts"],"sourcesContent":["","",""],"mappings":"AASM,SAAU,EAAoD,EAAkB,EAAmB,EAA6B,EAAmC,CAAE,GACzK,SAAS,iBAAiB,GAAY,IAChC,EAAE,eAAe,SAAS,KAC5B,EAAE,kBACF,EAAE,2BACF,EAAQ,GACT,GACD,CAAC,SAAQ,KAAQ,GACpB,CAIK,SAAU,EAAoB,EAAmB,EAAkB,GACvE,MAAM,EAAmC,CACvC,OAAQ,EAAE,OACV,QAAS,EAAE,QACX,WAAY,EAAE,WACd,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,IAAK,EAAE,IACP,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,SAAU,EAAE,SACZ,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,MAAO,EAAE,SACN,GAGL,OADc,IAAI,cAAc,EAAW,EAE5C,CAIK,SAAU,EAAiB,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,KAAM,EAAE,KACR,MAAO,EAAE,MACT,KAAM,EAAE,KACR,aAAc,EAAE,aAChB,UAAW,EAAE,UACb,aAA4C,mBAAvB,EAAE,kBAAkC,EAAE,kBAAoB,MAC5E,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,CAKK,SAAU,EAAiB,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,KAAM,EAAE,KACR,MAAO,EAAE,MACT,cAAe,EAAE,iBACd,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,OCnFY,EAAW,IACf,QAAQ,KAAK,OAAO,UAAU,WCDvC,SAAS,EAAa,GACpB,GAAqB,iBAAV,EACT,MAAO,GAOT,OAJe,EAAM,QADP,UACsB,SAAU,GAC5C,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,GAGF,CAED,SAAS,EAAa,GACpB,GAAqB,iBAAV,GAAsB,MAAM,GACrC,MAAO,GAOT,OAJe,EAAM,WAAW,QADlB,UACiC,SAAU,GACvD,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,GAGF"}
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts"],"sourcesContent":["","",""],"mappings":"iQAsEM,SAA2B,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,KAAM,EAAE,KACR,MAAO,EAAE,MACT,cAAe,EAAE,iBACd,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,qBAnCK,SAA2B,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,KAAM,EAAE,KACR,MAAO,EAAE,MACT,KAAM,EAAE,KACR,aAAc,EAAE,aAChB,UAAW,EAAE,UACb,aAA4C,mBAAvB,EAAE,kBAAkC,EAAE,kBAAoB,MAC5E,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,wBA5CK,SAA8B,EAAmB,EAAkB,GACvE,MAAM,EAAmC,CACvC,OAAQ,EAAE,OACV,QAAS,EAAE,QACX,WAAY,EAAE,WACd,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,IAAK,EAAE,IACP,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,SAAU,EAAE,SACZ,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,MAAO,EAAE,SACN,GAGL,OADc,IAAI,cAAc,EAAW,EAE5C,iBEhCD,SAAsB,GACpB,MAAqB,iBAAV,GAAsB,MAAM,GAC9B,GAGM,EAAM,WAAW,QADlB,UACiC,SAAU,GACvD,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,GAGF,iBAtBD,SAAsB,GACpB,MAAqB,iBAAV,EACF,GAGM,EAAM,QADP,UACsB,SAAU,GAC5C,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,GAGF,aDVuB,IACf,QAAQ,KAAK,OAAO,UAAU,kCDQjC,SAA8D,EAAkB,EAAmB,EAA6B,EAAmC,CAAE,GACzK,SAAS,iBAAiB,GAAY,IAChC,EAAE,eAAe,SAAS,KAC5B,EAAE,kBACF,EAAE,2BACF,EAAQ,GACT,GACD,CAAC,SAAQ,KAAQ,GACpB"}
|
package/dist/persian-tools.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
declare function faToEnDigits(input: string | number): string;
|
|
2
|
-
declare function enToFaDigits(input: string | number): string;
|
|
3
|
-
export { enToFaDigits, faToEnDigits };
|
|
1
|
+
declare function faToEnDigits(input: string | number): string;
|
|
2
|
+
declare function enToFaDigits(input: string | number): string;
|
|
3
|
+
export { enToFaDigits, faToEnDigits };
|
|
4
|
+
//# sourceMappingURL=persian-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persian-tools.d.ts","sourceRoot":"","sources":["../lib/persian-tools.ts"],"names":[],"mappings":"AAAA,iBAAS,YAAY,CAAC,KAAK,EAAC,MAAM,GAAG,MAAM,GAAE,MAAM,CAUlD;AAED,iBAAS,YAAY,CAAC,KAAK,EAAC,MAAM,GAAG,MAAM,GAAE,MAAM,CAUlD;AACD,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react component",
|
|
15
15
|
"event"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.6.0",
|
|
18
18
|
"bugs": "https://github.com/javadbat/jb-core/issues",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"files": [
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dist/",
|
|
25
25
|
"styles/",
|
|
26
26
|
"configs/",
|
|
27
|
+
"theme/",
|
|
27
28
|
"react/",
|
|
28
29
|
"react/dist/"
|
|
29
30
|
],
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './use-event.js';
|
|
2
|
-
export * from './useInstance.js';
|
|
3
|
-
export * from './useLazyRef.js';
|
|
1
|
+
export * from './use-event.js';
|
|
2
|
+
export * from './useInstance.js';
|
|
3
|
+
export * from './useLazyRef.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useEvent<TRef extends React.MutableRefObject<any | null>, TEvent>(ref: TRef, event: string, handler?: (e: TEvent) => void, passive?: boolean): void;
|
|
1
|
+
export declare function useEvent<TRef extends React.MutableRefObject<any | null>, TEvent>(ref: TRef, event: string, handler?: (e: TEvent) => void, passive?: boolean): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
type BaseConstructableClass<T = any> = new (...args: any[]) => T;
|
|
2
|
-
type Initializers<T extends BaseConstructableClass> = ConstructorParameters<T>;
|
|
3
|
-
/**
|
|
4
|
-
* create a instance of an class with lazy initialization
|
|
5
|
-
* @param Store class to create instance of
|
|
6
|
-
* @param initializers initializers to pass to the class constructor
|
|
7
|
-
* @returns instance of the class
|
|
8
|
-
*/
|
|
9
|
-
export declare const useInstance: <T extends BaseConstructableClass
|
|
10
|
-
export {};
|
|
1
|
+
type BaseConstructableClass<T = any> = new (...args: any[]) => T;
|
|
2
|
+
type Initializers<T extends BaseConstructableClass> = ConstructorParameters<T>;
|
|
3
|
+
/**
|
|
4
|
+
* create a instance of an class with lazy initialization
|
|
5
|
+
* @param Store class to create instance of
|
|
6
|
+
* @param initializers initializers to pass to the class constructor
|
|
7
|
+
* @returns instance of the class
|
|
8
|
+
*/
|
|
9
|
+
export declare const useInstance: <T extends BaseConstructableClass>(Store: T, initializers: Initializers<T>) => InstanceType<T>;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MutableRefObject } from "react";
|
|
2
|
-
type InitFunc<T> = () => T;
|
|
3
|
-
export declare const useLazyRef: <T>(initValFunc: InitFunc<T>) => MutableRefObject<any>;
|
|
4
|
-
export {};
|
|
1
|
+
import { MutableRefObject } from "react";
|
|
2
|
+
type InitFunc<T> = () => T;
|
|
3
|
+
export declare const useLazyRef: <T>(initValFunc: InitFunc<T>) => MutableRefObject<any>;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/hooks/use-event.ts","../lib/hooks/useLazyRef.ts","../lib/hooks/useInstance.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/hooks/use-event.ts","../lib/hooks/useLazyRef.ts","../lib/hooks/useInstance.ts"],"sourcesContent":["","",""],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEM,SAAU,SAA+D,KAAU,OAAc,SAA2B,UAAU,OAAK;CAC/I,MAAM,kBAAkB,uBAAY,CAAC,MAAS;AAC5C,MAAG,IAAI,kBAAkB,WAAW,WAClC,SAAQ,EAAE;CAEb,GAAC,CACF,KACE;sBAEE,MAAA;QACA,MAAI,IAAA;AACN,MAAA,IAEA,KAAO,iBAAgB,OAAA,iBAAA;GAClB;GACD,SAAI;EACN,EAAA;AAGN,SAAA,SAAA,UAAA;;;;;;;;;;;;;;;;MClBa,aAAa,CAAI,gBAAyB;CACrD,MAAM,MAA4B,kBAAO,KAAK;AAC9C,KAAI,IAAI,YAAY,KAClB,KAAI,UAAU,aAAa;AAE7B,QAAO;AACR;;;;;CCMD,MAAO,KAAM,WAAW,MAAsC,IAAQ,MAAE,GAAA,cAAkD;AACxH,QAAM,GAAE"}
|
package/react/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './hooks/index.js';
|
|
1
|
+
export * from './hooks/index.js';
|
package/react/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../lib/hooks/use-event.ts","../lib/hooks/useLazyRef.ts","../lib/hooks/useInstance.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../lib/hooks/use-event.ts","../lib/hooks/useLazyRef.ts","../lib/hooks/useInstance.ts"],"sourcesContent":["","",""],"mappings":";;;AAEM,SAAU,SAA+D,KAAU,OAAc,SAA2B,UAAU,OAAK;CAC/I,MAAM,kBAAkB,YAAY,CAAC,MAAS;AAC5C,MAAG,IAAI,kBAAkB,WAAW,WAClC,SAAQ,EAAE;CAEb,GAAC,CACF,KACE;WAEE,MAAA;QACA,MAAI,IAAA;AACN,MAAA,IAEA,KAAO,iBAAgB,OAAA,iBAAA;GAClB;GACD,SAAI;EACN,EAAA;AAGN,SAAA,SAAA,UAAA;;;;;;;;;;;;;;;;MClBa,aAAa,CAAI,gBAAyB;CACrD,MAAM,MAA4B,OAAO,KAAK;AAC9C,KAAI,IAAI,YAAY,KAClB,KAAI,UAAU,aAAa;AAE7B,QAAO;AACR;;;;;CCMD,MAAO,KAAM,WAAW,MAAsC,IAAQ,MAAE,GAAA,cAAkD;AACxH,QAAM,GAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","names":[],"sources":["../lib/hooks/use-event.ts","../lib/hooks/useLazyRef.ts","../lib/hooks/useInstance.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":[],"sources":["../lib/hooks/use-event.ts","../lib/hooks/useLazyRef.ts","../lib/hooks/useInstance.ts"],"sourcesContent":["","",""],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEM,SAAU,SAA+D,KAAU,OAAc,SAA2B,UAAU,OAAK;CAC/I,MAAM,kBAAkB,uBAAY,CAAC,MAAS;AAC5C,MAAG,IAAI,kBAAkB,WAAW,WAClC,SAAQ,EAAE;CAEb,GAAC,CACF,KACE;sBAEE,MAAA;QACA,MAAI,IAAA;AACN,MAAA,IAEA,KAAO,iBAAgB,OAAA,iBAAA;GAClB;GACD,SAAI;EACN,EAAA;AAGN,SAAA,SAAA,UAAA;;;;;;;;;;;;;;;;MClBa,aAAa,CAAI,gBAAyB;CACrD,MAAM,MAA4B,kBAAO,KAAK;AAC9C,KAAI,IAAI,YAAY,KAClB,KAAI,UAAU,aAAa;AAE7B,QAAO;AACR;;;;;CCMD,MAAO,KAAM,WAAW,MAAsC,IAAQ,MAAE,GAAA,cAAkD;AACxH,QAAM,GAAE"}
|
package/react/tsconfig.json
CHANGED
package/styles/colors.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//this is a schema for colors do not use it in your code base we will remove it later when pallet is ready in theme folder
|
|
1
2
|
root{
|
|
2
3
|
//recommended by teammate
|
|
3
4
|
--primary-c:blue,
|
|
@@ -11,4 +12,6 @@ root{
|
|
|
11
12
|
//and about shade
|
|
12
13
|
--primary-c-100:#44000000;
|
|
13
14
|
// we must have this color but use semantic color name in our code base
|
|
14
|
-
|
|
15
|
+
// we must define contrast text color for success, error, primary, ... most of the are #fff by default but they can be changed in theme
|
|
16
|
+
--success-contrast-text:#fff;
|
|
17
|
+
}
|
package/theme/colors.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export function defineColors() {
|
|
2
|
+
setColorProperty({
|
|
3
|
+
name: "--jb-primary",
|
|
4
|
+
syntax: "<color>",
|
|
5
|
+
inherits: true,
|
|
6
|
+
initialValue: "oklch(0.6 0.26 256)",
|
|
7
|
+
});
|
|
8
|
+
setColorProperty({
|
|
9
|
+
name: "--jb-neutral",
|
|
10
|
+
syntax: "<color>",
|
|
11
|
+
inherits: true,
|
|
12
|
+
initialValue: "oklch(0.18 0.014 258.36)",
|
|
13
|
+
});
|
|
14
|
+
setColorProperty({
|
|
15
|
+
name: "--jb-black",
|
|
16
|
+
syntax: "<color>",
|
|
17
|
+
inherits: true,
|
|
18
|
+
initialValue: "oklch(0.14 0 0)",
|
|
19
|
+
});
|
|
20
|
+
setColorProperty({
|
|
21
|
+
name: "--jb-white",
|
|
22
|
+
syntax: "<color>",
|
|
23
|
+
inherits: true,
|
|
24
|
+
initialValue: "oklch(1 0 0)",
|
|
25
|
+
});
|
|
26
|
+
setColorProperty({
|
|
27
|
+
name: "--jb-green",
|
|
28
|
+
syntax: "<color>",
|
|
29
|
+
inherits: true,
|
|
30
|
+
initialValue: "oklch(0.68 0.1484 162.1)",
|
|
31
|
+
});
|
|
32
|
+
setColorProperty({
|
|
33
|
+
name: "--jb-red",
|
|
34
|
+
syntax: "<color>",
|
|
35
|
+
inherits: true,
|
|
36
|
+
initialValue: "oklch(0.64 0.2485 23.21)",
|
|
37
|
+
});
|
|
38
|
+
setColorProperty({
|
|
39
|
+
name: `--jb-neutral`,
|
|
40
|
+
syntax: "<color>",
|
|
41
|
+
inherits: true,
|
|
42
|
+
initialValue: getNeutralColor(0),
|
|
43
|
+
});
|
|
44
|
+
for(let i=1;i<=10;i++){
|
|
45
|
+
setColorProperty({
|
|
46
|
+
name: `--jb-neutral-${i}`,
|
|
47
|
+
syntax: "<color>",
|
|
48
|
+
inherits: true,
|
|
49
|
+
initialValue: getNeutralColor(i),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function setColorProperty(value: PropertyDefinition) {
|
|
54
|
+
try {
|
|
55
|
+
window.CSS.registerProperty({
|
|
56
|
+
...value
|
|
57
|
+
});
|
|
58
|
+
} catch (e) {
|
|
59
|
+
// if property is already defined
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//
|
|
63
|
+
export function getNeutralColor(index: number) {
|
|
64
|
+
return `oklch(${(6 * (3+index*1.3))*0.01} ${(14+(index*0.09))*0.001} 258.36)`;
|
|
65
|
+
}
|
package/theme/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './colors.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isMobile: () => boolean;
|
package/dist/lib/events.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* add type to event target for easier access to target
|
|
3
|
-
*/
|
|
4
|
-
export type EventTypeWithTarget<TEvent, TTarget> = TEvent & {
|
|
5
|
-
target: TTarget;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* this function will stop event from propagate even in capturing phase and will call handler only if event target is the element
|
|
9
|
-
*/
|
|
10
|
-
export declare function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e: TEvent) => void, options?: AddEventListenerOptions): void;
|
|
11
|
-
/**
|
|
12
|
-
* create a keyboardEvent based on `e` value and replace them with initObj
|
|
13
|
-
*/
|
|
14
|
-
export declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent;
|
|
15
|
-
/**
|
|
16
|
-
* create a InputEvent based on `e` value and replace them with initObj
|
|
17
|
-
*/
|
|
18
|
-
export declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent;
|
|
19
|
-
/**
|
|
20
|
-
* create a InputEvent based on `e` value and replace them with initObj
|
|
21
|
-
*/
|
|
22
|
-
export declare function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit): FocusEvent;
|
package/dist/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isMobile: () => boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* add type to event target for easier access to target
|
|
3
|
-
*/
|
|
4
|
-
export type EventTypeWithTarget<TEvent, TTarget> = TEvent & {
|
|
5
|
-
target: TTarget;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* this function will stop event from propagate even in capturing phase and will call handler only if event target is the element
|
|
9
|
-
*/
|
|
10
|
-
export declare function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e: TEvent) => void, options?: AddEventListenerOptions): void;
|
|
11
|
-
/**
|
|
12
|
-
* create a keyboardEvent based on `e` value and replace them with initObj
|
|
13
|
-
*/
|
|
14
|
-
export declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent;
|
|
15
|
-
/**
|
|
16
|
-
* create a InputEvent based on `e` value and replace them with initObj
|
|
17
|
-
*/
|
|
18
|
-
export declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent;
|
|
19
|
-
/**
|
|
20
|
-
* create a InputEvent based on `e` value and replace them with initObj
|
|
21
|
-
*/
|
|
22
|
-
export declare function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit): FocusEvent;
|