ncore-ui-kit 1.0.0-alpha.0 → 1.0.0-alpha.1
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/lib/module/components/localeSwitcher/index.js +11 -1
- package/lib/module/components/localeSwitcher/index.js.map +1 -1
- package/lib/module/components/paletteSwitcher/index.js +12 -2
- package/lib/module/components/paletteSwitcher/index.js.map +1 -1
- package/lib/module/components/themeSwitcher/index.js +11 -1
- package/lib/module/components/themeSwitcher/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/utils/index.js +3 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/components/localeSwitcher/index.js +19 -7
- package/lib/src/components/paletteSwitcher/index.js +20 -8
- package/lib/src/components/themeSwitcher/index.js +19 -7
- package/lib/src/index.js +1 -0
- package/lib/src/utils/index.js +3 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/typescript/package.json +1 -1
- package/lib/typescript/src/components/header/stylesheet.d.ts +312 -8
- package/lib/typescript/src/components/header/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/components/localeSwitcher/index.d.ts.map +1 -1
- package/lib/typescript/src/components/localeSwitcher/type.d.ts +1 -0
- package/lib/typescript/src/components/localeSwitcher/type.d.ts.map +1 -1
- package/lib/typescript/src/components/paletteSwitcher/index.d.ts.map +1 -1
- package/lib/typescript/src/components/paletteSwitcher/type.d.ts +1 -0
- package/lib/typescript/src/components/paletteSwitcher/type.d.ts.map +1 -1
- package/lib/typescript/src/components/themeSwitcher/index.d.ts.map +1 -1
- package/lib/typescript/src/components/themeSwitcher/type.d.ts +1 -0
- package/lib/typescript/src/components/themeSwitcher/type.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +9 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +3 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/localeSwitcher/index.tsx +27 -14
- package/src/components/localeSwitcher/type.ts +1 -0
- package/src/components/paletteSwitcher/index.tsx +28 -15
- package/src/components/paletteSwitcher/type.ts +1 -0
- package/src/components/themeSwitcher/index.tsx +27 -14
- package/src/components/themeSwitcher/type.ts +1 -0
- package/src/index.tsx +11 -0
- package/src/types/index.ts +17 -1
- package/src/utils/index.ts +7 -1
|
@@ -4,9 +4,11 @@ import { useEffect, useState } from "react";
|
|
|
4
4
|
import { NCoreUIKitLocalize } from "../../core/hooks.js";
|
|
5
5
|
import Button from "../button/index.js";
|
|
6
6
|
import { EnUsIcon, TRTRIcon } from "../../assets/svg/index.js";
|
|
7
|
+
import HighlightButton from "../highlightButton/index.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
const PaletteSwitcher = ({
|
|
9
10
|
variants: variantsProps = [],
|
|
11
|
+
isWorkWithHighlightButton,
|
|
10
12
|
isWorkWithNextShowSystem,
|
|
11
13
|
customLocalize,
|
|
12
14
|
color,
|
|
@@ -68,7 +70,7 @@ const PaletteSwitcher = ({
|
|
|
68
70
|
const nextVariantIndex = currentVariantIndex + 1;
|
|
69
71
|
const viewVariantIndex = nextVariantIndex > variants.length - 1 ? 0 : nextVariantIndex;
|
|
70
72
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
71
|
-
|
|
73
|
+
const allProps = {
|
|
72
74
|
...props,
|
|
73
75
|
customBorderColor: currentVariant && currentVariant.borderColor ? currentVariant.borderColor : color,
|
|
74
76
|
customColor: currentVariant && currentVariant.backgroundColor ? currentVariant.backgroundColor : color,
|
|
@@ -89,6 +91,14 @@ const PaletteSwitcher = ({
|
|
|
89
91
|
});
|
|
90
92
|
},
|
|
91
93
|
style: [style]
|
|
94
|
+
};
|
|
95
|
+
if (isWorkWithHighlightButton) {
|
|
96
|
+
return /*#__PURE__*/_jsx(HighlightButton, {
|
|
97
|
+
...allProps
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
101
|
+
...allProps
|
|
92
102
|
});
|
|
93
103
|
};
|
|
94
104
|
export default PaletteSwitcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","NCoreUIKitLocalize","Button","EnUsIcon","TRTRIcon","jsx","_jsx","PaletteSwitcher","variants","variantsProps","isWorkWithNextShowSystem","customLocalize","color","style","props","activeLocale","localeKeys","useContext","currentIndex","setCurrentIndex","findIndex","t","cI","tI","nextCI","length","variantsPre","isHaveNCTRTR","iV","localeKey","isHaveNCENUS","unshift","borderColor","backgroundColor","iconColor","icon","size","sort","a","b","indexOf","currentVariantIndex","e","nextVariantIndex","viewVariantIndex","currentVariant","customBorderColor","customColor","Icon","undefined","onPress","switch"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/localeSwitcher/index.tsx"],"mappings":";;AAAA,SACIA,SAAS,EACTC,QAAQ,QAEL,OAAO;AAKd,SACIC,kBAAkB,QACf,qBAAkB;AAIzB,OAAOC,MAAM,MAAM,oBAAW;AAC9B,SACIC,QAAQ,EACRC,QAAQ,QACL,2BAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["useEffect","useState","NCoreUIKitLocalize","Button","EnUsIcon","TRTRIcon","HighlightButton","jsx","_jsx","PaletteSwitcher","variants","variantsProps","isWorkWithHighlightButton","isWorkWithNextShowSystem","customLocalize","color","style","props","activeLocale","localeKeys","useContext","currentIndex","setCurrentIndex","findIndex","t","cI","tI","nextCI","length","variantsPre","isHaveNCTRTR","iV","localeKey","isHaveNCENUS","unshift","borderColor","backgroundColor","iconColor","icon","size","sort","a","b","indexOf","currentVariantIndex","e","nextVariantIndex","viewVariantIndex","currentVariant","allProps","customBorderColor","customColor","Icon","undefined","onPress","switch"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/localeSwitcher/index.tsx"],"mappings":";;AAAA,SACIA,SAAS,EACTC,QAAQ,QAEL,OAAO;AAKd,SACIC,kBAAkB,QACf,qBAAkB;AAIzB,OAAOC,MAAM,MAAM,oBAAW;AAC9B,SACIC,QAAQ,EACRC,QAAQ,QACL,2BAAkB;AACzB,OAAOC,eAAe,MAAM,6BAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,MAAMC,eAAyC,GAAGA,CAAC;EAC/CC,QAAQ,EAAEC,aAAa,GAAG,EAAE;EAC5BC,yBAAyB;EACzBC,wBAAwB;EACxBC,cAAc;EACdC,KAAK;EACLC,KAAK;EACL,GAAGC;AACP,CAAC,KAAK;EACF,MAAM;IACFC,YAAY;IACZC;EACJ,CAAC,GAAGjB,kBAAkB,CAACkB,UAAU,CAACN,cAAc,CAAC;EAEjD,MAAM,CACFO,YAAY,EACZC,eAAe,CAClB,GAAGrB,QAAQ,CAACkB,UAAU,CAACI,SAAS,CAACC,CAAC,IAAIA,CAAC,KAAKN,YAAY,CAAC,CAAC;EAE3DlB,SAAS,CAAC,MAAM;IACZ,MAAMyB,EAAE,GAAGN,UAAU,CAACI,SAAS,CAACG,EAAE,IAAIA,EAAE,KAAKR,YAAY,CAAC;IAE1D,MAAMS,MAAM,GAAGd,wBAAwB,GAAGY,EAAE,GAAG,CAAC,GAAGN,UAAU,CAACS,MAAM,GAAG,CAAC,GAAG,CAAC,GAAGH,EAAE,GAAG,CAAC,GAAGA,EAAE;IAE1F,IAAGJ,YAAY,KAAKM,MAAM,EAAE;MACxBL,eAAe,CAACK,MAAM,CAAC;IAC3B;EACJ,CAAC,EAAE,CAACT,YAAY,CAAC,CAAC;EAElB,MAAMW,WAAiC,GAAGlB,aAAa;EAEvD,MAAMmB,YAAY,GAAGnB,aAAa,CAACY,SAAS,CAACQ,EAAE,IAAIA,EAA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|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { NCoreUIKitTheme } from "../../core/hooks.js";
|
|
5
5
|
import Button from "../button/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { NIBGATCommunityIcon, CayCoreIcon, NIBGATIcon } from "../../assets/svg/index.js";
|
|
7
|
+
import HighlightButton from "../highlightButton/index.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
const PaletteSwitcher = ({
|
|
9
10
|
variants: variantsProps = [],
|
|
11
|
+
isWorkWithHighlightButton,
|
|
10
12
|
isWorkWithNextShowSystem,
|
|
11
13
|
customTheme,
|
|
12
14
|
color,
|
|
@@ -84,7 +86,7 @@ const PaletteSwitcher = ({
|
|
|
84
86
|
const nextVariantIndex = currentVariantIndex + 1;
|
|
85
87
|
const viewVariantIndex = nextVariantIndex > variants.length - 1 ? 0 : nextVariantIndex;
|
|
86
88
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
87
|
-
|
|
89
|
+
const allProps = {
|
|
88
90
|
...props,
|
|
89
91
|
customBorderColor: currentVariant && currentVariant.borderColor ? currentVariant.borderColor : color,
|
|
90
92
|
customColor: currentVariant && currentVariant.backgroundColor ? currentVariant.backgroundColor : color,
|
|
@@ -105,6 +107,14 @@ const PaletteSwitcher = ({
|
|
|
105
107
|
});
|
|
106
108
|
},
|
|
107
109
|
style: [style]
|
|
110
|
+
};
|
|
111
|
+
if (isWorkWithHighlightButton) {
|
|
112
|
+
return /*#__PURE__*/_jsx(HighlightButton, {
|
|
113
|
+
...allProps
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
117
|
+
...allProps
|
|
108
118
|
});
|
|
109
119
|
};
|
|
110
120
|
export default PaletteSwitcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","NCoreUIKitTheme","Button","
|
|
1
|
+
{"version":3,"names":["useEffect","useState","NCoreUIKitTheme","Button","NIBGATCommunityIcon","CayCoreIcon","NIBGATIcon","HighlightButton","jsx","_jsx","PaletteSwitcher","variants","variantsProps","isWorkWithHighlightButton","isWorkWithNextShowSystem","customTheme","color","style","props","activePalette","paletteKeys","useContext","currentIndex","setCurrentIndex","findIndex","t","cI","tI","nextCI","length","variantsPre","isHaveNC","iV","paletteKey","isHaveCC","isHaveN","unshift","borderColor","backgroundColor","iconColor","icon","size","sort","a","b","indexOf","currentVariantIndex","e","nextVariantIndex","viewVariantIndex","currentVariant","allProps","customBorderColor","customColor","Icon","undefined","onPress","switch"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/paletteSwitcher/index.tsx"],"mappings":";;AAAA,SACIA,SAAS,EACTC,QAAQ,QAEL,OAAO;AAKd,SACIC,eAAe,QACZ,qBAAkB;AAIzB,OAAOC,MAAM,MAAM,oBAAW;AAC9B,SACIC,mBAAmB,EACnBC,WAAW,EACXC,UAAU,QACP,2BAAkB;AACzB,OAAOC,eAAe,MAAM,6BAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,MAAMC,eAA0C,GAAGA,CAAC;EAChDC,QAAQ,EAAEC,aAAa,GAAG,EAAE;EAC5BC,yBAAyB;EACzBC,wBAAwB;EACxBC,WAAW;EACXC,KAAK;EACLC,KAAK;EACL,GAAGC;AACP,CAAC,KAAK;EACF,MAAM;IACFC,aAAa;IACbC;EACJ,CAAC,GAAGlB,eAAe,CAACmB,UAAU,CAACN,WAAW,CAAC;EAE3C,MAAM,CACFO,YAAY,EACZC,eAAe,CAClB,GAAGtB,QAAQ,CAACmB,WAAW,CAACI,SAAS,CAACC,CAAC,IAAIA,CAAC,KAAKN,aAAa,CAAC,CAAC;EAE7DnB,SAAS,CAAC,MAAM;IACZ,MAAM0B,EAAE,GAAGN,WAAW,CAACI,SAAS,CAACG,EAAE,IAAIA,EAAE,KAAKR,aAAa,CAAC;IAE5D,MAAMS,MAAM,GAAGd,wBAAwB,GAAG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,cAAc,CAACZ,eAAe,GACzDY,cAAc,CAACZ,eAAe,GAE9BtB,KAAK;IACTwB,IAAI,EAAEA,CAAC;MACHxB,KAAK;MACLyB;IAIJ,CAAC,KAAK;MACF,MAAMa,IAAI,GAAGJ,cAAc,EAAEV,IAAsB;MAEnD,oBAAO/B,IAAA,CAAC6C,IAAI;QACRD,WAAW,EAAEH,cAAc,IAAIA,cAAc,CAACX,SAAS,GAAGW,cAAc,CAACX,SAAS,GAAGgB,SAAU;QAC/FvC,KAAK,EAAEA,KAAM;QACbyB,IAAI,EAAEA;MAAK,CACd,CAAC;IACN,CAAC;IACDe,OAAO,EAAEA,CAAA,KAAM;MACXtD,eAAe,CAACuD,MAAM,CAAC;QACnBxB,UAAU,EAAEb,WAAW,CAAC6B,gBAAgB;MAC5C,CAAC,CAAC;IACN,CAAC;IACDhC,KAAK,EAAE,CACHA,KAAK;EAEb,CAAC;EAED,IAAGJ,yBAAyB,EAAE;IAC1B,oBAAOJ,IAAA,CAACF,eAAe;MAAA,GACf4C;IAAQ,CACf,CAAC;EACN;EAEA,oBAAO1C,IAAA,CAACN,MAAM;IAAA,GACNgD;EAAQ,CACf,CAAC;AACN,CAAC;AACD,eAAezC,eAAe","ignoreList":[]}
|
|
@@ -4,9 +4,11 @@ import { useEffect, useState } from "react";
|
|
|
4
4
|
import { NCoreUIKitTheme } from "../../core/hooks.js";
|
|
5
5
|
import { Moon as MoonIcon, Sun as SunIcon } from "lucide-react-native";
|
|
6
6
|
import Button from "../button/index.js";
|
|
7
|
+
import HighlightButton from "../highlightButton/index.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
const ThemeSwitcher = ({
|
|
9
10
|
variants: variantsProps = [],
|
|
11
|
+
isWorkWithHighlightButton,
|
|
10
12
|
isWorkWithNextShowSystem,
|
|
11
13
|
customTheme,
|
|
12
14
|
color,
|
|
@@ -77,7 +79,7 @@ const ThemeSwitcher = ({
|
|
|
77
79
|
const nextVariantIndex = currentVariantIndex + 1;
|
|
78
80
|
const viewVariantIndex = nextVariantIndex > variants.length - 1 ? 0 : nextVariantIndex;
|
|
79
81
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
80
|
-
|
|
82
|
+
const allProps = {
|
|
81
83
|
...props,
|
|
82
84
|
customBorderColor: currentVariant && currentVariant.borderColor ? currentVariant.borderColor : color,
|
|
83
85
|
customColor: currentVariant && currentVariant.backgroundColor ? currentVariant.backgroundColor : color,
|
|
@@ -98,6 +100,14 @@ const ThemeSwitcher = ({
|
|
|
98
100
|
});
|
|
99
101
|
},
|
|
100
102
|
style: [style]
|
|
103
|
+
};
|
|
104
|
+
if (isWorkWithHighlightButton) {
|
|
105
|
+
return /*#__PURE__*/_jsx(HighlightButton, {
|
|
106
|
+
...allProps
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
110
|
+
...allProps
|
|
101
111
|
});
|
|
102
112
|
};
|
|
103
113
|
export default ThemeSwitcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","NCoreUIKitTheme","Moon","MoonIcon","Sun","SunIcon","Button","jsx","_jsx","ThemeSwitcher","variants","variantsProps","isWorkWithNextShowSystem","customTheme","color","style","props","activeTheme","themeKeys","colors","useContext","currentIndex","setCurrentIndex","findIndex","t","cI","tI","nextCI","length","variantsPre","isHaveLight","iV","themeKey","isHaveDark","unshift","borderColor","backgroundColor","iconColor","icon","customColor","size","_customColor","project","content","sort","a","b","indexOf","currentVariantIndex","e","nextVariantIndex","viewVariantIndex","currentVariant","customBorderColor","Icon","undefined","onPress","switch"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/themeSwitcher/index.tsx"],"mappings":";;AAAA,SACIA,SAAS,EACTC,QAAQ,QAEL,OAAO;AAKd,SACIC,eAAe,QACZ,qBAAkB;AAIzB,SACIC,IAAI,IAAIC,QAAQ,EAChBC,GAAG,IAAIC,OAAO,QACX,qBAAqB;AAC5B,OAAOC,MAAM,MAAM,oBAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["useEffect","useState","NCoreUIKitTheme","Moon","MoonIcon","Sun","SunIcon","Button","HighlightButton","jsx","_jsx","ThemeSwitcher","variants","variantsProps","isWorkWithHighlightButton","isWorkWithNextShowSystem","customTheme","color","style","props","activeTheme","themeKeys","colors","useContext","currentIndex","setCurrentIndex","findIndex","t","cI","tI","nextCI","length","variantsPre","isHaveLight","iV","themeKey","isHaveDark","unshift","borderColor","backgroundColor","iconColor","icon","customColor","size","_customColor","project","content","sort","a","b","indexOf","currentVariantIndex","e","nextVariantIndex","viewVariantIndex","currentVariant","allProps","customBorderColor","Icon","undefined","onPress","switch"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/themeSwitcher/index.tsx"],"mappings":";;AAAA,SACIA,SAAS,EACTC,QAAQ,QAEL,OAAO;AAKd,SACIC,eAAe,QACZ,qBAAkB;AAIzB,SACIC,IAAI,IAAIC,QAAQ,EAChBC,GAAG,IAAIC,OAAO,QACX,qBAAqB;AAC5B,OAAOC,MAAM,MAAM,oBAAW;AAC9B,OAAOC,eAAe,MAAM,6BAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,MAAMC,aAAsC,GAAGA,CAAC;EAC5CC,QAAQ,EAAEC,aAAa,GAAG,EAAE;EAC5BC,yBAAyB;EACzBC,wBAAwB;EACxBC,WAAW;EACXC,KAAK;EACLC,KAAK;EACL,GAAGC;AACP,CAAC,KAAK;EACF,MAAM;IACFC,WAAW;IACXC,SAAS;IACTC;EACJ,CAAC,GAAGpB,eAAe,CAACqB,UAAU,CAACP,WAAW,CAAC;EAE3C,MAAM,CACFQ,YAAY,EACZC,eAAe,CAClB,GAAGxB,QAAQ,CAACoB,SAAS,CAACK,SAAS,CAACC,CAAC,IAAIA,CAAC,KAAKP,WAAW,CAAC,CAAC;EAEzDpB,SAAS,CAAC,M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AAGH,mBAAmB,CAAC;EAElG,MAAMK,QAAQ,GAAG;IACb,GAAGrC,KAAK;IACRsC,iBAAiB,EAAEF,cAAc,IAAIA,cAAc,CAACjB,WAAW,GAC3DiB,cAAc,CAACjB,WAAW,GAE1BrB,KAAK;IACTyB,WAAW,EAAEa,cAAc,IAAIA,cAAc,CAAChB,eAAe,GACzDgB,cAAc,CAAChB,eAAe,GAE9BtB,KAAK;IACTwB,IAAI,EAAEA,CAAC;MACHxB,KAAK;MACL0B;IAIJ,CAAC,KAAK;MACF,MAAMe,IAAI,GAAGH,cAAc,EAAEd,IAAsB;MAEnD,oBAAO/B,IAAA,CAACgD,IAAI;QACRhB,WAAW,EAAEa,cAAc,IAAIA,cAAc,CAACf,SAAS,GAAGe,cAAc,CAACf,SAAS,GAAGmB,SAAU;QAC/F1C,KAAK,EAAEA,KAAM;QACb0B,IAAI,EAAEA;MAAK,CACd,CAAC;IACN,CAAC;IACDiB,OAAO,EAAEA,CAAA,KAAM;MACX1D,eAAe,CAAC2D,MAAM,CAAC;QACnB1B,QAAQ,EAAEd,SAAS,CAACiC,gBAAgB;MACxC,CAAC,CAAC;IACN,CAAC;IACDpC,KAAK,EAAE,CACHA,KAAK;EAEb,CAAC;EAED,IAAGJ,yBAAyB,EAAE;IAC1B,oBAAOJ,IAAA,CAACF,eAAe;MAAA,GACfgD;IAAQ,CACf,CAAC;EACN;EAEA,oBAAO9C,IAAA,CAACH,MAAM;IAAA,GACNiD;EAAQ,CACf,CAAC;AACN,CAAC;AACD,eAAe7C,aAAa","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -7,4 +7,5 @@ export { blockquoteMarkdown, centerMarkdown, enterMarkdown, imageMarkdown, parse
|
|
|
7
7
|
export { mergeTypographyTokens, parseRRuleConfig, mergeTypography, mergeRadiuses, mergePalettes, mergeBorders, mergeSpaces, mergeShapes, mergeTheme } from "./helpers/index.js";
|
|
8
8
|
export { NIBGATCommunityIcon, CayCoreIcon, LoadingIcon, NIBGATIcon, TRTRIcon, EnUsIcon } from "./assets/svg/index.js";
|
|
9
9
|
export { Portal, Host } from "./helpers/portalize/index.js";
|
|
10
|
+
export { androidTypographyFixer, windowHeight, windowWidth, webStyle, uuid } from "./utils/index.js";
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getNCoreUIKitVersion","setupNCoreUIKit","NCoreUIKitEmbeddedMenu","NCoreUIKitBottomSheet","NCoreUIKitLocalize","NCoreUIKitSnackBar","NCoreUIKitDialog","NCoreUIKitModal","NCoreUIKitTheme","NCoreUIKitToast","NCoreUIKitMenu","NotificationIndicator","HighlightButton","PaletteSwitcher","MarkdownViewer","DateTimePicker","LocaleSwitcher","PageContainer","DateTimeSheet","TextAreaInput","MonthSelector","ThemeSwitcher","NumericInput","TimeSelector","EmbeddedMenu","DateSelector","BottomSheet","AvatarGroup","SelectSheet","RadioButton","MenuButton","MainHeader","SelectBox","StateCard","TextInput","Seperator","SiteLogo","SnackBar","CheckBox","Sticker","RowCard","Loading","Dialog","Avatar","Switch","Button","Header","Modal","Toast","Menu","Chip","Text","blockquoteMarkdown","centerMarkdown","enterMarkdown","imageMarkdown","parseMarkdown","rightMarkdown","codeMarkdown","leftMarkdown","linkMarkdown","listMarkdown","textMarkdown","mergeTypographyTokens","parseRRuleConfig","mergeTypography","mergeRadiuses","mergePalettes","mergeBorders","mergeSpaces","mergeShapes","mergeTheme","NIBGATCommunityIcon","CayCoreIcon","LoadingIcon","NIBGATIcon","TRTRIcon","EnUsIcon","Portal","Host"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;AAAA,SACIA,oBAAoB,EACpBC,eAAe,QACZ,iBAAQ;AAEf,SACIC,sBAAsB,EACtBC,qBAAqB,EACrBC,kBAAkB,EAClBC,kBAAkB,EAClBC,gBAAgB,EAChBC,eAAe,EACfC,eAAe,EACfC,eAAe,EACfC,cAAc,QACX,iBAAc;AAErB,SACIC,qBAAqB,EACrBC,eAAe,EACfC,eAAe,EACfC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,IAAI,QACD,uBAAc;AAmBrB,SACIC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,YAAY,QACT,qCAAkC;AAEzC,SACIC,qBAAqB,EACrBC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,UAAU,QACP,oBAAW;AAElB,SACIC,mBAAmB,EACnBC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACRC,QAAQ,QACL,uBAAc;
|
|
1
|
+
{"version":3,"names":["getNCoreUIKitVersion","setupNCoreUIKit","NCoreUIKitEmbeddedMenu","NCoreUIKitBottomSheet","NCoreUIKitLocalize","NCoreUIKitSnackBar","NCoreUIKitDialog","NCoreUIKitModal","NCoreUIKitTheme","NCoreUIKitToast","NCoreUIKitMenu","NotificationIndicator","HighlightButton","PaletteSwitcher","MarkdownViewer","DateTimePicker","LocaleSwitcher","PageContainer","DateTimeSheet","TextAreaInput","MonthSelector","ThemeSwitcher","NumericInput","TimeSelector","EmbeddedMenu","DateSelector","BottomSheet","AvatarGroup","SelectSheet","RadioButton","MenuButton","MainHeader","SelectBox","StateCard","TextInput","Seperator","SiteLogo","SnackBar","CheckBox","Sticker","RowCard","Loading","Dialog","Avatar","Switch","Button","Header","Modal","Toast","Menu","Chip","Text","blockquoteMarkdown","centerMarkdown","enterMarkdown","imageMarkdown","parseMarkdown","rightMarkdown","codeMarkdown","leftMarkdown","linkMarkdown","listMarkdown","textMarkdown","mergeTypographyTokens","parseRRuleConfig","mergeTypography","mergeRadiuses","mergePalettes","mergeBorders","mergeSpaces","mergeShapes","mergeTheme","NIBGATCommunityIcon","CayCoreIcon","LoadingIcon","NIBGATIcon","TRTRIcon","EnUsIcon","Portal","Host","androidTypographyFixer","windowHeight","windowWidth","webStyle","uuid"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;AAAA,SACIA,oBAAoB,EACpBC,eAAe,QACZ,iBAAQ;AAEf,SACIC,sBAAsB,EACtBC,qBAAqB,EACrBC,kBAAkB,EAClBC,kBAAkB,EAClBC,gBAAgB,EAChBC,eAAe,EACfC,eAAe,EACfC,eAAe,EACfC,cAAc,QACX,iBAAc;AAErB,SACIC,qBAAqB,EACrBC,eAAe,EACfC,eAAe,EACfC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,IAAI,QACD,uBAAc;AAmBrB,SACIC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,YAAY,QACT,qCAAkC;AAEzC,SACIC,qBAAqB,EACrBC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,UAAU,QACP,oBAAW;AAElB,SACIC,mBAAmB,EACnBC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACRC,QAAQ,QACL,uBAAc;AAuBrB,SACIC,MAAM,EACNC,IAAI,QACD,8BAAqB;AAE5B,SACIC,sBAAsB,EACtBC,YAAY,EACZC,WAAW,EACXC,QAAQ,EACRC,IAAI,QACD,kBAAS","ignoreList":[]}
|
package/lib/module/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["safeGlobal","globalThis"],"sourceRoot":"..\\..\\..\\src","sources":["types/index.ts"],"mappings":";;AA+
|
|
1
|
+
{"version":3,"names":["safeGlobal","globalThis"],"sourceRoot":"..\\..\\..\\src","sources":["types/index.ts"],"mappings":";;AA+EgG;AAWhG,OAAO,MAAMA,UAAU,GAAGC,UAAsC","ignoreList":[]}
|
|
@@ -4,7 +4,9 @@ import { Dimensions, Platform } from "react-native";
|
|
|
4
4
|
const dimensions = Dimensions.get("window");
|
|
5
5
|
export const windowHeight = dimensions.height;
|
|
6
6
|
export const windowWidth = dimensions.width;
|
|
7
|
-
export const webStyle = styles =>
|
|
7
|
+
export const webStyle = styles => {
|
|
8
|
+
return Platform.OS === "web" ? styles : {};
|
|
9
|
+
};
|
|
8
10
|
export const uuid = () => {
|
|
9
11
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
10
12
|
const r = Math.random() * 16 | 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dimensions","Platform","dimensions","get","windowHeight","height","windowWidth","width","webStyle","styles","OS","uuid","replace","c","r","Math","random","v","toString","ANDROID_FONT_FIX","androidTypographyFixer","defaultPaletteData","isNeedAndroidTypographyFixer","spacious","typography","compact","Object","keys","forEach","key","fontWeight","fontFamily","indexOf"],"sourceRoot":"..\\..\\..\\src","sources":["utils/index.ts"],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"names":["Dimensions","Platform","dimensions","get","windowHeight","height","windowWidth","width","webStyle","styles","OS","uuid","replace","c","r","Math","random","v","toString","ANDROID_FONT_FIX","androidTypographyFixer","defaultPaletteData","isNeedAndroidTypographyFixer","spacious","typography","compact","Object","keys","forEach","key","fontWeight","fontFamily","indexOf"],"sourceRoot":"..\\..\\..\\src","sources":["utils/index.ts"],"mappings":";;AAAA,SAEIA,UAAU,EACVC,QAAQ,QACL,cAAc;AAKrB,MAAMC,UAAU,GAAGF,UAAU,CAACG,GAAG,CAAC,QAAQ,CAAC;AAE3C,OAAO,MAAMC,YAAY,GAAGF,UAAU,CAACG,MAAM;AAC7C,OAAO,MAAMC,WAAW,GAAGJ,UAAU,CAACK,KAAK;AAE3C,OAAO,MAAMC,QAAQ,GAAyBC,MAAS,IAAgB;EACnE,OAAQR,QAAQ,CAACS,EAAE,KAAK,KAAK,GAAGD,MAAM,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAM;EACtB,OAAO,sCAAsC,CAACC,OAAO,CAAC,OAAO,EAAE,UAASC,CAAC,EAAE;IACvE,MAAMC,CAAC,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC;MAAEC,CAAC,GAAGJ,CAAC,IAAI,GAAG,GAAGC,CAAC,GAAIA,CAAC,GAAG,GAAG,GAAG,GAAI;IACpE,OAAOG,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC;EACzB,CAAC,CAAC;AACN,CAAC;AA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G,CAAC,KAAK,CAAC,CAAC,GACjD,GAAGP,OAAO,CAACI,GAAG,CAAC,CAACE,UAAU,IAAIZ,gBAAgB,CAACM,OAAO,CAACI,GAAG,CAAC,CAACC,UAAU,CAAkC,EAAE,GAC1GL,OAAO,CAACI,GAAG,CAAC,CAACE;MACvB,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;MACH,GAAGV,kBAAkB;MACrBG,UAAU,EAAE;QACRD,QAAQ,EAAEA,QAAQ;QAClBE,OAAO,EAAEA;MACb;IACJ,CAAC;EACL,CAAC,MAAM;IACH,OAAOJ,kBAAkB;EAC7B;AACJ,CAAC","ignoreList":[]}
|
package/lib/package.json
CHANGED
|
@@ -3,7 +3,8 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { NCoreUIKitLocalize } from "../../core/hooks";
|
|
4
4
|
import Button from "../button";
|
|
5
5
|
import { EnUsIcon, TRTRIcon } from "../../assets/svg";
|
|
6
|
-
|
|
6
|
+
import HighlightButton from "../highlightButton";
|
|
7
|
+
const PaletteSwitcher = ({ variants: variantsProps = [], isWorkWithHighlightButton, isWorkWithNextShowSystem, customLocalize, color, style, ...props }) => {
|
|
7
8
|
const { activeLocale, localeKeys } = NCoreUIKitLocalize.useContext(customLocalize);
|
|
8
9
|
const [currentIndex, setCurrentIndex] = useState(localeKeys.findIndex(t => t === activeLocale));
|
|
9
10
|
useEffect(() => {
|
|
@@ -48,21 +49,32 @@ const PaletteSwitcher = ({ variants: variantsProps = [], isWorkWithNextShowSyste
|
|
|
48
49
|
const nextVariantIndex = currentVariantIndex + 1;
|
|
49
50
|
const viewVariantIndex = nextVariantIndex > variants.length - 1 ? 0 : nextVariantIndex;
|
|
50
51
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
51
|
-
|
|
52
|
+
const allProps = {
|
|
53
|
+
...props,
|
|
54
|
+
customBorderColor: currentVariant && currentVariant.borderColor ?
|
|
52
55
|
currentVariant.borderColor
|
|
53
56
|
:
|
|
54
|
-
color,
|
|
57
|
+
color,
|
|
58
|
+
customColor: currentVariant && currentVariant.backgroundColor ?
|
|
55
59
|
currentVariant.backgroundColor
|
|
56
60
|
:
|
|
57
|
-
color,
|
|
61
|
+
color,
|
|
62
|
+
icon: ({ color, size }) => {
|
|
58
63
|
const Icon = currentVariant?.icon;
|
|
59
64
|
return _jsx(Icon, { customColor: currentVariant && currentVariant.iconColor ? currentVariant.iconColor : undefined, color: color, size: size });
|
|
60
|
-
},
|
|
65
|
+
},
|
|
66
|
+
onPress: () => {
|
|
61
67
|
NCoreUIKitLocalize.switch({
|
|
62
68
|
localeKey: localeKeys[viewVariantIndex]
|
|
63
69
|
});
|
|
64
|
-
},
|
|
70
|
+
},
|
|
71
|
+
style: [
|
|
65
72
|
style
|
|
66
|
-
]
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
if (isWorkWithHighlightButton) {
|
|
76
|
+
return _jsx(HighlightButton, { ...allProps });
|
|
77
|
+
}
|
|
78
|
+
return _jsx(Button, { ...allProps });
|
|
67
79
|
};
|
|
68
80
|
export default PaletteSwitcher;
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { NCoreUIKitTheme } from "../../core/hooks";
|
|
4
4
|
import Button from "../button";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { NIBGATCommunityIcon, CayCoreIcon, NIBGATIcon } from "../../assets/svg";
|
|
6
|
+
import HighlightButton from "../highlightButton";
|
|
7
|
+
const PaletteSwitcher = ({ variants: variantsProps = [], isWorkWithHighlightButton, isWorkWithNextShowSystem, customTheme, color, style, ...props }) => {
|
|
7
8
|
const { activePalette, paletteKeys } = NCoreUIKitTheme.useContext(customTheme);
|
|
8
9
|
const [currentIndex, setCurrentIndex] = useState(paletteKeys.findIndex(t => t === activePalette));
|
|
9
10
|
useEffect(() => {
|
|
@@ -60,21 +61,32 @@ const PaletteSwitcher = ({ variants: variantsProps = [], isWorkWithNextShowSyste
|
|
|
60
61
|
const nextVariantIndex = currentVariantIndex + 1;
|
|
61
62
|
const viewVariantIndex = nextVariantIndex > variants.length - 1 ? 0 : nextVariantIndex;
|
|
62
63
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
63
|
-
|
|
64
|
+
const allProps = {
|
|
65
|
+
...props,
|
|
66
|
+
customBorderColor: currentVariant && currentVariant.borderColor ?
|
|
64
67
|
currentVariant.borderColor
|
|
65
68
|
:
|
|
66
|
-
color,
|
|
69
|
+
color,
|
|
70
|
+
customColor: currentVariant && currentVariant.backgroundColor ?
|
|
67
71
|
currentVariant.backgroundColor
|
|
68
72
|
:
|
|
69
|
-
color,
|
|
73
|
+
color,
|
|
74
|
+
icon: ({ color, size }) => {
|
|
70
75
|
const Icon = currentVariant?.icon;
|
|
71
76
|
return _jsx(Icon, { customColor: currentVariant && currentVariant.iconColor ? currentVariant.iconColor : undefined, color: color, size: size });
|
|
72
|
-
},
|
|
77
|
+
},
|
|
78
|
+
onPress: () => {
|
|
73
79
|
NCoreUIKitTheme.switch({
|
|
74
80
|
paletteKey: paletteKeys[viewVariantIndex]
|
|
75
81
|
});
|
|
76
|
-
},
|
|
82
|
+
},
|
|
83
|
+
style: [
|
|
77
84
|
style
|
|
78
|
-
]
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
if (isWorkWithHighlightButton) {
|
|
88
|
+
return _jsx(HighlightButton, { ...allProps });
|
|
89
|
+
}
|
|
90
|
+
return _jsx(Button, { ...allProps });
|
|
79
91
|
};
|
|
80
92
|
export default PaletteSwitcher;
|
|
@@ -3,7 +3,8 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { NCoreUIKitTheme } from "../../core/hooks";
|
|
4
4
|
import { Moon as MoonIcon, Sun as SunIcon } from "lucide-react-native";
|
|
5
5
|
import Button from "../button";
|
|
6
|
-
|
|
6
|
+
import HighlightButton from "../highlightButton";
|
|
7
|
+
const ThemeSwitcher = ({ variants: variantsProps = [], isWorkWithHighlightButton, isWorkWithNextShowSystem, customTheme, color, style, ...props }) => {
|
|
7
8
|
const { activeTheme, themeKeys, colors } = NCoreUIKitTheme.useContext(customTheme);
|
|
8
9
|
const [currentIndex, setCurrentIndex] = useState(themeKeys.findIndex(t => t === activeTheme));
|
|
9
10
|
useEffect(() => {
|
|
@@ -50,21 +51,32 @@ const ThemeSwitcher = ({ variants: variantsProps = [], isWorkWithNextShowSystem,
|
|
|
50
51
|
const nextVariantIndex = currentVariantIndex + 1;
|
|
51
52
|
const viewVariantIndex = nextVariantIndex > variants.length - 1 ? 0 : nextVariantIndex;
|
|
52
53
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
53
|
-
|
|
54
|
+
const allProps = {
|
|
55
|
+
...props,
|
|
56
|
+
customBorderColor: currentVariant && currentVariant.borderColor ?
|
|
54
57
|
currentVariant.borderColor
|
|
55
58
|
:
|
|
56
|
-
color,
|
|
59
|
+
color,
|
|
60
|
+
customColor: currentVariant && currentVariant.backgroundColor ?
|
|
57
61
|
currentVariant.backgroundColor
|
|
58
62
|
:
|
|
59
|
-
color,
|
|
63
|
+
color,
|
|
64
|
+
icon: ({ color, size }) => {
|
|
60
65
|
const Icon = currentVariant?.icon;
|
|
61
66
|
return _jsx(Icon, { customColor: currentVariant && currentVariant.iconColor ? currentVariant.iconColor : undefined, color: color, size: size });
|
|
62
|
-
},
|
|
67
|
+
},
|
|
68
|
+
onPress: () => {
|
|
63
69
|
NCoreUIKitTheme.switch({
|
|
64
70
|
themeKey: themeKeys[viewVariantIndex]
|
|
65
71
|
});
|
|
66
|
-
},
|
|
72
|
+
},
|
|
73
|
+
style: [
|
|
67
74
|
style
|
|
68
|
-
]
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
if (isWorkWithHighlightButton) {
|
|
78
|
+
return _jsx(HighlightButton, { ...allProps });
|
|
79
|
+
}
|
|
80
|
+
return _jsx(Button, { ...allProps });
|
|
69
81
|
};
|
|
70
82
|
export default ThemeSwitcher;
|
package/lib/src/index.js
CHANGED
|
@@ -5,3 +5,4 @@ export { blockquoteMarkdown, centerMarkdown, enterMarkdown, imageMarkdown, parse
|
|
|
5
5
|
export { mergeTypographyTokens, parseRRuleConfig, mergeTypography, mergeRadiuses, mergePalettes, mergeBorders, mergeSpaces, mergeShapes, mergeTheme } from "./helpers";
|
|
6
6
|
export { NIBGATCommunityIcon, CayCoreIcon, LoadingIcon, NIBGATIcon, TRTRIcon, EnUsIcon } from "./assets/svg";
|
|
7
7
|
export { Portal, Host } from "./helpers/portalize";
|
|
8
|
+
export { androidTypographyFixer, windowHeight, windowWidth, webStyle, uuid } from "./utils";
|
package/lib/src/utils/index.js
CHANGED
|
@@ -2,7 +2,9 @@ import { Dimensions, Platform } from "react-native";
|
|
|
2
2
|
const dimensions = Dimensions.get("window");
|
|
3
3
|
export const windowHeight = dimensions.height;
|
|
4
4
|
export const windowWidth = dimensions.width;
|
|
5
|
-
export const webStyle = (styles) =>
|
|
5
|
+
export const webStyle = (styles) => {
|
|
6
|
+
return (Platform.OS === "web" ? styles : {});
|
|
7
|
+
};
|
|
6
8
|
export const uuid = () => {
|
|
7
9
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
8
10
|
const r = Math.random() * 16 | 0, v = c == "x" ? r : (r & 0x3 | 0x8);
|