@prom-ui/core 1.3.1 → 1.4.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/Avatar/cjs/index.development.js +99 -67
- package/Avatar/cjs/index.development.v2.js +99 -67
- package/Avatar/cjs/index.production.js +1 -1
- package/Avatar/cjs/index.production.v2.js +1 -1
- package/Avatar/index.d.ts +14 -14
- package/Avatar/package.json +1 -1
- package/Avatar/utils.d.ts +2 -2
- package/Backdrop/cjs/index.development.js +131 -77
- package/Backdrop/cjs/index.development.v2.js +131 -77
- package/Backdrop/cjs/index.production.js +1 -1
- package/Backdrop/cjs/index.production.v2.js +1 -1
- package/Backdrop/index.d.ts +25 -25
- package/Backdrop/package.json +1 -1
- package/Body/cjs/index.development.js +2 -0
- package/Body/cjs/index.development.v2.js +2 -0
- package/Body/index.d.ts +36 -36
- package/Body/package.json +1 -1
- package/BodyContext/cjs/index.development.js +6 -7
- package/BodyContext/cjs/index.development.v2.js +6 -7
- package/BodyContext/cjs/index.production.js +1 -1
- package/BodyContext/cjs/index.production.v2.js +1 -1
- package/BodyContext/index.d.ts +12 -12
- package/BodyContext/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +7 -6
- package/BodyProvider/cjs/index.development.v2.js +7 -6
- package/BodyProvider/index.d.ts +10 -10
- package/BodyProvider/package.json +1 -1
- package/Box/cjs/index.development.js +4 -4
- package/Box/cjs/index.development.v2.js +4 -4
- package/Box/index.d.ts +106 -106
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +67 -62
- package/Button/cjs/index.development.v2.js +67 -62
- package/Button/cjs/index.production.js +1 -1
- package/Button/cjs/index.production.v2.js +1 -1
- package/Button/index.d.ts +45 -45
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +195 -85
- package/ButtonPageUp/cjs/index.development.v2.js +195 -85
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/index.d.ts +18 -18
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +99 -67
- package/Checkbox/cjs/index.development.v2.js +99 -67
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/index.d.ts +8 -8
- package/Checkbox/package.json +1 -1
- package/Flex/index.d.ts +34 -34
- package/Flex/package.json +1 -1
- package/Grid/index.d.ts +46 -46
- package/Grid/package.json +1 -1
- package/Icon/index.d.ts +9 -9
- package/Icon/package.json +1 -1
- package/Image/index.d.ts +42 -42
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +70 -63
- package/ImageEmoji/cjs/index.development.v2.js +70 -63
- package/ImageEmoji/cjs/index.production.js +1 -1
- package/ImageEmoji/cjs/index.production.v2.js +1 -1
- package/ImageEmoji/index.d.ts +9 -9
- package/ImageEmoji/package.json +1 -1
- package/Input/index.d.ts +18 -18
- package/Input/package.json +1 -1
- package/InputField/addons/AfterClearValue.d.ts +3 -3
- package/InputField/addons/AfterCorrectValue.d.ts +2 -2
- package/InputField/addons/AfterLoading.d.ts +2 -2
- package/InputField/addons/AfterTogglePassword.d.ts +6 -6
- package/InputField/addons/ErrorText.d.ts +6 -6
- package/InputField/cjs/index.development.js +237 -173
- package/InputField/cjs/index.development.v2.js +237 -173
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/index.d.ts +18 -18
- package/InputField/package.json +1 -1
- package/InputField/utils.d.ts +10 -10
- package/KeyPress/cjs/index.development.js +13 -13
- package/KeyPress/cjs/index.development.v2.js +13 -13
- package/KeyPress/index.d.ts +14 -14
- package/KeyPress/package.json +1 -1
- package/Line/index.d.ts +13 -13
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +5 -5
- package/Link/cjs/index.development.v2.js +5 -5
- package/Link/index.d.ts +28 -28
- package/Link/package.json +1 -1
- package/List/index.d.ts +23 -23
- package/List/package.json +1 -1
- package/Media/MediaProvider.d.ts +8 -8
- package/Media/cjs/index.development.js +70 -19
- package/Media/cjs/index.development.v2.js +70 -19
- package/Media/cjs/index.production.js +1 -1
- package/Media/cjs/index.production.v2.js +1 -1
- package/Media/index.d.ts +20 -20
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.js +117 -61
- package/OutsideClick/cjs/index.development.v2.js +117 -61
- package/OutsideClick/cjs/index.production.js +1 -1
- package/OutsideClick/cjs/index.production.v2.js +1 -1
- package/OutsideClick/index.d.ts +12 -12
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +197 -183
- package/Overlay/cjs/index.development.v2.js +197 -183
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/components/OverlayHeader.d.ts +11 -11
- package/Overlay/components/SwipeClose.d.ts +11 -11
- package/Overlay/components/TouchScrollable.d.ts +8 -8
- package/Overlay/index.d.ts +76 -76
- package/Overlay/package.json +1 -1
- package/Overlay/utils.d.ts +10 -10
- package/Picture/index.d.ts +70 -70
- package/Picture/package.json +1 -1
- package/Portal/cjs/index.development.js +11 -11
- package/Portal/cjs/index.development.v2.js +11 -11
- package/Portal/index.d.ts +10 -10
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +11 -11
- package/QRCode/cjs/index.development.v2.js +11 -11
- package/QRCode/index.d.ts +17 -17
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +75 -69
- package/Rating/cjs/index.development.v2.js +75 -69
- package/Rating/cjs/index.production.js +1 -1
- package/Rating/cjs/index.production.v2.js +1 -1
- package/Rating/index.d.ts +17 -17
- package/Rating/package.json +1 -1
- package/RatingSelect/cjs/index.development.js +148 -68
- package/RatingSelect/cjs/index.development.v2.js +148 -68
- package/RatingSelect/cjs/index.production.js +1 -1
- package/RatingSelect/cjs/index.production.v2.js +1 -1
- package/RatingSelect/index.d.ts +22 -18
- package/RatingSelect/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +158 -110
- package/SafeQuery/cjs/index.development.v2.js +158 -110
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/components/Error.d.ts +7 -7
- package/SafeQuery/index.d.ts +10 -10
- package/SafeQuery/package.json +1 -1
- package/Scroll/index.d.ts +25 -25
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +11 -11
- package/ScrollControls/cjs/index.development.js +201 -113
- package/ScrollControls/cjs/index.development.v2.js +201 -113
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +16 -16
- package/ScrollControls/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +270 -158
- package/SimpleSlider/cjs/index.development.v2.js +270 -158
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/index.d.ts +41 -41
- package/SimpleSlider/package.json +1 -1
- package/SimpleSlider/useAutoPlay.d.ts +3 -3
- package/SimpleSlider/utils.d.ts +19 -19
- package/Skeleton/cjs/index.development.js +118 -64
- package/Skeleton/cjs/index.development.v2.js +118 -64
- package/Skeleton/cjs/index.production.js +1 -1
- package/Skeleton/cjs/index.production.v2.js +1 -1
- package/Skeleton/index.d.ts +37 -37
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +66 -61
- package/Spinner/cjs/index.development.v2.js +66 -61
- package/Spinner/cjs/index.production.js +1 -1
- package/Spinner/cjs/index.production.v2.js +1 -1
- package/Spinner/index.d.ts +29 -29
- package/Spinner/package.json +1 -1
- package/Text/index.d.ts +25 -25
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +65 -60
- package/TextEmoji/cjs/index.development.v2.js +65 -60
- package/TextEmoji/cjs/index.production.js +1 -1
- package/TextEmoji/cjs/index.production.v2.js +1 -1
- package/TextEmoji/index.d.ts +9 -9
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +80 -91
- package/Tooltip/cjs/index.development.v2.js +80 -91
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/index.d.ts +87 -87
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +98 -66
- package/Tumbler/cjs/index.development.v2.js +98 -66
- package/Tumbler/cjs/index.production.js +1 -1
- package/Tumbler/cjs/index.production.v2.js +1 -1
- package/Tumbler/index.d.ts +8 -8
- package/Tumbler/package.json +1 -1
- package/package.json +7 -5
- package/useBodyTTag/cjs/index.development.js +1 -1
- package/useBodyTTag/cjs/index.development.v2.js +1 -1
- package/useBodyTTag/index.d.ts +2 -2
- package/useBodyTTag/package.json +1 -1
- package/useDebounce/cjs/index.development.js +58 -6
- package/useDebounce/cjs/index.development.v2.js +58 -6
- package/useDebounce/cjs/index.production.js +1 -1
- package/useDebounce/cjs/index.production.v2.js +1 -1
- package/useDebounce/index.d.ts +4 -4
- package/useDebounce/package.json +1 -1
- package/useId/cjs/index.development.js +6 -7
- package/useId/cjs/index.development.v2.js +6 -7
- package/useId/cjs/index.production.js +1 -1
- package/useId/cjs/index.production.v2.js +1 -1
- package/useId/index.d.ts +4 -4
- package/useId/package.json +1 -1
- package/useIsMounted/cjs/index.development.js +3 -3
- package/useIsMounted/cjs/index.development.v2.js +3 -3
- package/useIsMounted/index.d.ts +4 -4
- package/useIsMounted/package.json +1 -1
- package/useKeyPress/cjs/index.development.js +76 -22
- package/useKeyPress/cjs/index.development.v2.js +76 -22
- package/useKeyPress/cjs/index.production.js +1 -1
- package/useKeyPress/cjs/index.production.v2.js +1 -1
- package/useKeyPress/index.d.ts +6 -6
- package/useKeyPress/package.json +1 -1
- package/useMedia/cjs/index.development.js +5 -5
- package/useMedia/cjs/index.development.v2.js +5 -5
- package/useMedia/index.d.ts +21 -21
- package/useMedia/package.json +1 -1
- package/useOutsideClick/cjs/index.development.js +2 -2
- package/useOutsideClick/cjs/index.development.v2.js +2 -2
- package/useOutsideClick/index.d.ts +5 -5
- package/useOutsideClick/package.json +1 -1
- package/usePortal/cjs/index.development.js +32 -27
- package/usePortal/cjs/index.development.v2.js +32 -27
- package/usePortal/index.d.ts +12 -12
- package/usePortal/package.json +1 -1
- package/useScrollPosition/cjs/index.development.js +2 -2
- package/useScrollPosition/cjs/index.development.v2.js +2 -2
- package/useScrollPosition/index.d.ts +5 -5
- package/useScrollPosition/package.json +1 -1
package/Body/index.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import type { CreateBlock, EvokitProp, EvokitMediaSufix } from '@prom-ui/core/base/types';
|
|
2
|
-
import './style.css';
|
|
3
|
-
type BodySectionDisplay = EvokitMediaSufix<'block' | 'none'>;
|
|
4
|
-
type BodySectionHeight = EvokitMediaSufix<'auto' | 'inherit' | '1-1'>;
|
|
5
|
-
export type BodySectionProps = {
|
|
6
|
-
'body-section-display'?: EvokitProp<BodySectionDisplay>;
|
|
7
|
-
'body-section-height'?: EvokitProp<BodySectionHeight>;
|
|
8
|
-
};
|
|
9
|
-
type BodyThemes = EvokitMediaSufix<'black-100' | 'black-900' | 'white'>;
|
|
10
|
-
type BodyDisplay = EvokitMediaSufix<'block' | 'none'>;
|
|
11
|
-
type BodyIndent = EvokitMediaSufix<'none' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl'>;
|
|
12
|
-
type BodyOverflowAnchor = EvokitMediaSufix<'auto' | 'none'>;
|
|
13
|
-
type BodyOverflow = EvokitMediaSufix<'auto' | 'hidden' | 'scroll' | 'visible'>;
|
|
14
|
-
type BodyWidth = EvokitMediaSufix<'none' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl'>;
|
|
15
|
-
export type BodyProps = {
|
|
16
|
-
'body-background'?: EvokitProp<BodyThemes>;
|
|
17
|
-
'body-color'?: EvokitProp<BodyThemes>;
|
|
18
|
-
'body-display'?: EvokitProp<BodyDisplay>;
|
|
19
|
-
'body-indent'?: EvokitProp<BodyIndent>;
|
|
20
|
-
'body-overflow-anchor'?: EvokitProp<BodyOverflowAnchor>;
|
|
21
|
-
'body-overflow'?: EvokitProp<BodyOverflow | `${BodyOverflow} ${string}`>;
|
|
22
|
-
/** @ignore */
|
|
23
|
-
'body-overflow-x'?: EvokitProp<BodyOverflow>;
|
|
24
|
-
/** @ignore */
|
|
25
|
-
'body-overflow-y'?: EvokitProp<BodyOverflow>;
|
|
26
|
-
'body-width'?: EvokitProp<BodyWidth | `${BodyWidth} ${string}`>;
|
|
27
|
-
/** @ignore */
|
|
28
|
-
'body-width-min'?: EvokitProp<BodyWidth>;
|
|
29
|
-
/** @ignore */
|
|
30
|
-
'body-width-max'?: EvokitProp<BodyWidth>;
|
|
31
|
-
};
|
|
32
|
-
declare const BodySection: CreateBlock<'div', 'body-section', BodySectionProps>;
|
|
33
|
-
export declare const Body: CreateBlock<'body', 'body', BodyProps> & {
|
|
34
|
-
Section: typeof BodySection;
|
|
35
|
-
};
|
|
36
|
-
export {};
|
|
1
|
+
import type { CreateBlock, EvokitProp, EvokitMediaSufix } from '@prom-ui/core/base/types';
|
|
2
|
+
import './style.css';
|
|
3
|
+
type BodySectionDisplay = EvokitMediaSufix<'block' | 'none'>;
|
|
4
|
+
type BodySectionHeight = EvokitMediaSufix<'auto' | 'inherit' | '1-1'>;
|
|
5
|
+
export type BodySectionProps = {
|
|
6
|
+
'body-section-display'?: EvokitProp<BodySectionDisplay>;
|
|
7
|
+
'body-section-height'?: EvokitProp<BodySectionHeight>;
|
|
8
|
+
};
|
|
9
|
+
type BodyThemes = EvokitMediaSufix<'black-100' | 'black-900' | 'white'>;
|
|
10
|
+
type BodyDisplay = EvokitMediaSufix<'block' | 'none'>;
|
|
11
|
+
type BodyIndent = EvokitMediaSufix<'none' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl'>;
|
|
12
|
+
type BodyOverflowAnchor = EvokitMediaSufix<'auto' | 'none'>;
|
|
13
|
+
type BodyOverflow = EvokitMediaSufix<'auto' | 'hidden' | 'scroll' | 'visible'>;
|
|
14
|
+
type BodyWidth = EvokitMediaSufix<'none' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl'>;
|
|
15
|
+
export type BodyProps = {
|
|
16
|
+
'body-background'?: EvokitProp<BodyThemes>;
|
|
17
|
+
'body-color'?: EvokitProp<BodyThemes>;
|
|
18
|
+
'body-display'?: EvokitProp<BodyDisplay>;
|
|
19
|
+
'body-indent'?: EvokitProp<BodyIndent>;
|
|
20
|
+
'body-overflow-anchor'?: EvokitProp<BodyOverflowAnchor>;
|
|
21
|
+
'body-overflow'?: EvokitProp<BodyOverflow | `${BodyOverflow} ${string}`>;
|
|
22
|
+
/** @ignore */
|
|
23
|
+
'body-overflow-x'?: EvokitProp<BodyOverflow>;
|
|
24
|
+
/** @ignore */
|
|
25
|
+
'body-overflow-y'?: EvokitProp<BodyOverflow>;
|
|
26
|
+
'body-width'?: EvokitProp<BodyWidth | `${BodyWidth} ${string}`>;
|
|
27
|
+
/** @ignore */
|
|
28
|
+
'body-width-min'?: EvokitProp<BodyWidth>;
|
|
29
|
+
/** @ignore */
|
|
30
|
+
'body-width-max'?: EvokitProp<BodyWidth>;
|
|
31
|
+
};
|
|
32
|
+
declare const BodySection: CreateBlock<'div', 'body-section', BodySectionProps>;
|
|
33
|
+
export declare const Body: CreateBlock<'body', 'body', BodyProps> & {
|
|
34
|
+
Section: typeof BodySection;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
package/Body/package.json
CHANGED
|
@@ -25,29 +25,28 @@ function _interopNamespaceCompat(e) {
|
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
27
27
|
|
|
28
|
-
var idConstructor = function (
|
|
29
|
-
|
|
30
|
-
prefix = '';
|
|
31
|
-
}
|
|
28
|
+
var idConstructor = function idConstructor() {
|
|
29
|
+
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
32
30
|
var me = {
|
|
33
31
|
id: 0,
|
|
34
|
-
get: function () {
|
|
32
|
+
get: function get() {
|
|
35
33
|
return ":".concat(prefix, "p").concat(me.id++, ":");
|
|
36
34
|
}
|
|
37
35
|
};
|
|
38
36
|
return me;
|
|
39
37
|
};
|
|
40
|
-
var useIdGetter = function (prefix) {
|
|
38
|
+
var useIdGetter = function useIdGetter(prefix) {
|
|
41
39
|
var ref = React__namespace.useRef();
|
|
42
40
|
if (!ref.current) {
|
|
43
41
|
ref.current = idConstructor(prefix);
|
|
44
42
|
}
|
|
45
43
|
return ref.current.get;
|
|
46
44
|
};
|
|
45
|
+
|
|
47
46
|
// default instances of unused BodyProvider
|
|
48
47
|
var globalTTag = new ttag.TTag();
|
|
49
48
|
var globalGetUseId = idConstructor().get;
|
|
50
|
-
var BodyContext = React__namespace.createContext({
|
|
49
|
+
var BodyContext = /*#__PURE__*/React__namespace.createContext({
|
|
51
50
|
globalTTag: globalTTag,
|
|
52
51
|
globalGetUseId: globalGetUseId
|
|
53
52
|
});
|
|
@@ -25,29 +25,28 @@ function _interopNamespaceCompat(e) {
|
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
27
27
|
|
|
28
|
-
var idConstructor = function (
|
|
29
|
-
|
|
30
|
-
prefix = '';
|
|
31
|
-
}
|
|
28
|
+
var idConstructor = function idConstructor() {
|
|
29
|
+
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
32
30
|
var me = {
|
|
33
31
|
id: 0,
|
|
34
|
-
get: function () {
|
|
32
|
+
get: function get() {
|
|
35
33
|
return ":".concat(prefix, "p").concat(me.id++, ":");
|
|
36
34
|
}
|
|
37
35
|
};
|
|
38
36
|
return me;
|
|
39
37
|
};
|
|
40
|
-
var useIdGetter = function (prefix) {
|
|
38
|
+
var useIdGetter = function useIdGetter(prefix) {
|
|
41
39
|
var ref = React__namespace.useRef();
|
|
42
40
|
if (!ref.current) {
|
|
43
41
|
ref.current = idConstructor(prefix);
|
|
44
42
|
}
|
|
45
43
|
return ref.current.get;
|
|
46
44
|
};
|
|
45
|
+
|
|
47
46
|
// default instances of unused BodyProvider
|
|
48
47
|
var globalTTag = new ttag.TTag();
|
|
49
48
|
var globalGetUseId = idConstructor().get;
|
|
50
|
-
var BodyContext = React__namespace.createContext({
|
|
49
|
+
var BodyContext = /*#__PURE__*/React__namespace.createContext({
|
|
51
50
|
globalTTag: globalTTag,
|
|
52
51
|
globalGetUseId: globalGetUseId
|
|
53
52
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag");function r(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),o=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag");function r(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={id:0,get:function(){return":".concat(e,"p").concat(t.id++,":")}};return t},u=new t.TTag,c=o().get,a=n.createContext({globalTTag:u,globalGetUseId:c});a.displayName="BodyContext",exports.BodyContext=a,exports.useIdGetter=function(e){var t=n.useRef();return t.current||(t.current=o(e)),t.current.get};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag");function r(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),o=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag");function r(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={id:0,get:function(){return":".concat(e,"p").concat(t.id++,":")}};return t},u=new t.TTag,c=o().get,a=n.createContext({globalTTag:u,globalGetUseId:c});a.displayName="BodyContext",exports.BodyContext=a,exports.useIdGetter=function(e){var t=n.useRef();return t.current||(t.current=o(e)),t.current.get};
|
package/BodyContext/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { TTag } from 'ttag';
|
|
3
|
-
declare const idConstructor: (prefix?: string) => {
|
|
4
|
-
id: number;
|
|
5
|
-
get: () => string;
|
|
6
|
-
};
|
|
7
|
-
export declare const useIdGetter: (prefix: Parameters<typeof idConstructor>[0]) => () => string;
|
|
8
|
-
export declare const BodyContext: React.Context<{
|
|
9
|
-
globalTTag: TTag;
|
|
10
|
-
globalGetUseId: () => string;
|
|
11
|
-
}>;
|
|
12
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TTag } from 'ttag';
|
|
3
|
+
declare const idConstructor: (prefix?: string) => {
|
|
4
|
+
id: number;
|
|
5
|
+
get: () => string;
|
|
6
|
+
};
|
|
7
|
+
export declare const useIdGetter: (prefix: Parameters<typeof idConstructor>[0]) => () => string;
|
|
8
|
+
export declare const BodyContext: React.Context<{
|
|
9
|
+
globalTTag: TTag;
|
|
10
|
+
globalGetUseId: () => string;
|
|
11
|
+
}>;
|
|
12
|
+
export {};
|
package/BodyContext/package.json
CHANGED
|
@@ -332,14 +332,15 @@ var localeKk = {
|
|
|
332
332
|
translations: translations
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
-
var BodyProvider = function (
|
|
336
|
-
var children =
|
|
337
|
-
|
|
338
|
-
locale =
|
|
339
|
-
identifierPrefix =
|
|
335
|
+
var BodyProvider = function BodyProvider(_ref) {
|
|
336
|
+
var children = _ref.children,
|
|
337
|
+
_ref$locale = _ref.locale,
|
|
338
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
|
339
|
+
identifierPrefix = _ref.identifierPrefix;
|
|
340
340
|
var globalGetUseId = BodyContext.useIdGetter(identifierPrefix);
|
|
341
341
|
var globalTTag = React__namespace.useMemo(function () {
|
|
342
342
|
var newTTag = new ttag.TTag();
|
|
343
|
+
|
|
343
344
|
// add locales from json file
|
|
344
345
|
newTTag.addLocale('uk', localeUk);
|
|
345
346
|
newTTag.addLocale('ro', localeRo);
|
|
@@ -347,7 +348,7 @@ var BodyProvider = function (_a) {
|
|
|
347
348
|
return newTTag;
|
|
348
349
|
}, []);
|
|
349
350
|
globalTTag.useLocale(locale);
|
|
350
|
-
return React__namespace.createElement(BodyContext.BodyContext.Provider, {
|
|
351
|
+
return /*#__PURE__*/React__namespace.createElement(BodyContext.BodyContext.Provider, {
|
|
351
352
|
value: {
|
|
352
353
|
globalTTag: globalTTag,
|
|
353
354
|
globalGetUseId: globalGetUseId
|
|
@@ -332,14 +332,15 @@ var localeKk = {
|
|
|
332
332
|
translations: translations
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
-
var BodyProvider = function (
|
|
336
|
-
var children =
|
|
337
|
-
|
|
338
|
-
locale =
|
|
339
|
-
identifierPrefix =
|
|
335
|
+
var BodyProvider = function BodyProvider(_ref) {
|
|
336
|
+
var children = _ref.children,
|
|
337
|
+
_ref$locale = _ref.locale,
|
|
338
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
|
339
|
+
identifierPrefix = _ref.identifierPrefix;
|
|
340
340
|
var globalGetUseId = BodyContext.useIdGetter(identifierPrefix);
|
|
341
341
|
var globalTTag = React__namespace.useMemo(function () {
|
|
342
342
|
var newTTag = new ttag.TTag();
|
|
343
|
+
|
|
343
344
|
// add locales from json file
|
|
344
345
|
newTTag.addLocale('uk', localeUk);
|
|
345
346
|
newTTag.addLocale('ro', localeRo);
|
|
@@ -347,7 +348,7 @@ var BodyProvider = function (_a) {
|
|
|
347
348
|
return newTTag;
|
|
348
349
|
}, []);
|
|
349
350
|
globalTTag.useLocale(locale);
|
|
350
|
-
return React__namespace.createElement(BodyContext.BodyContext.Provider, {
|
|
351
|
+
return /*#__PURE__*/React__namespace.createElement(BodyContext.BodyContext.Provider, {
|
|
351
352
|
value: {
|
|
352
353
|
globalTTag: globalTTag,
|
|
353
354
|
globalGetUseId: globalGetUseId
|
package/BodyProvider/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useIdGetter } from '@prom-ui/core/BodyContext';
|
|
3
|
-
export type BodyProviderProps = {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
/** Настройка текста локали */
|
|
6
|
-
locale?: 'ru' | 'uk' | 'ro' | 'kk';
|
|
7
|
-
/** Префикса для всех сгенерированных идентификаторов с помощю хука [useId](/#/Hooks/useId) */
|
|
8
|
-
identifierPrefix?: Parameters<typeof useIdGetter>[0];
|
|
9
|
-
};
|
|
10
|
-
export declare const BodyProvider: React.FC<BodyProviderProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useIdGetter } from '@prom-ui/core/BodyContext';
|
|
3
|
+
export type BodyProviderProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/** Настройка текста локали */
|
|
6
|
+
locale?: 'ru' | 'uk' | 'ro' | 'kk';
|
|
7
|
+
/** Префикса для всех сгенерированных идентификаторов с помощю хука [useId](/#/Hooks/useId) */
|
|
8
|
+
identifierPrefix?: Parameters<typeof useIdGetter>[0];
|
|
9
|
+
};
|
|
10
|
+
export declare const BodyProvider: React.FC<BodyProviderProps>;
|