@kwiz/fluentui 1.0.59 → 1.0.61
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/helpers/context-const.d.ts +25 -0
- package/dist/helpers/context-const.js +4 -0
- package/dist/helpers/context-const.js.map +1 -0
- package/dist/helpers/context-export.d.ts +7 -24
- package/dist/helpers/context-export.js +2 -1
- package/dist/helpers/context-export.js.map +1 -1
- package/dist/helpers/context-internal.d.ts +1 -4
- package/dist/helpers/context-internal.js +1 -2
- package/dist/helpers/context-internal.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/context-const.ts +28 -0
- package/src/helpers/{context-export.ts → context-export.tsx} +5 -27
- package/src/helpers/context-internal.ts +1 -4
package/README.md
CHANGED
@@ -11,7 +11,7 @@ To successfully use these controls you should create a context:
|
|
11
11
|
|
12
12
|
```ts
|
13
13
|
const root = React.useRef<HTMLDivElement>(null);
|
14
|
-
const kwizFluentContext = useKWIZFluentContextProvider({
|
14
|
+
const { KWIZFluentContext, value: kwizFluentContext } = useKWIZFluentContextProvider({
|
15
15
|
ctx: {
|
16
16
|
buttonShape: "rounded"
|
17
17
|
},
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from "react";
|
2
|
+
export interface iKWIZFluentContext {
|
3
|
+
/**
|
4
|
+
* Where the portal children are mounted on DOM
|
5
|
+
*
|
6
|
+
* @default a new element on document.body without any styling
|
7
|
+
*/
|
8
|
+
mountNode?: HTMLElement | null | {
|
9
|
+
element?: HTMLElement | null;
|
10
|
+
className?: string;
|
11
|
+
};
|
12
|
+
/**
|
13
|
+
* Controls the colors and borders of the input.
|
14
|
+
*
|
15
|
+
* @default 'underline'
|
16
|
+
*/
|
17
|
+
inputAppearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
18
|
+
/**
|
19
|
+
* A button can be rounded, circular, or square.
|
20
|
+
*
|
21
|
+
* @default 'rounded'
|
22
|
+
*/
|
23
|
+
buttonShape?: 'rounded' | 'circular' | 'square';
|
24
|
+
}
|
25
|
+
export declare const KWIZFluentContext: React.Context<iKWIZFluentContext>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"context-const.js","sourceRoot":"","sources":["../../src/helpers/context-const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAqB,IAAI,CAAC,CAAC"}
|
@@ -1,27 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
*
|
5
|
-
* @default a new element on document.body without any styling
|
6
|
-
*/
|
7
|
-
mountNode?: HTMLElement | null | {
|
8
|
-
element?: HTMLElement | null;
|
9
|
-
className?: string;
|
10
|
-
};
|
11
|
-
/**
|
12
|
-
* Controls the colors and borders of the input.
|
13
|
-
*
|
14
|
-
* @default 'underline'
|
15
|
-
*/
|
16
|
-
inputAppearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
17
|
-
/**
|
18
|
-
* A button can be rounded, circular, or square.
|
19
|
-
*
|
20
|
-
* @default 'rounded'
|
21
|
-
*/
|
22
|
-
buttonShape?: 'rounded' | 'circular' | 'square';
|
23
|
-
}
|
1
|
+
import React from "react";
|
2
|
+
import { iKWIZFluentContext } from "./context-const";
|
3
|
+
export type { iKWIZFluentContext } from "./context-const";
|
24
4
|
export declare function useKWIZFluentContextProvider(options: {
|
25
5
|
root?: React.MutableRefObject<HTMLDivElement>;
|
26
6
|
ctx?: iKWIZFluentContext;
|
27
|
-
}):
|
7
|
+
}): {
|
8
|
+
KWIZFluentContext: React.Context<iKWIZFluentContext>;
|
9
|
+
value: iKWIZFluentContext;
|
10
|
+
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { makeStyles } from "@fluentui/react-components";
|
2
2
|
import { useEffect, useState } from "react";
|
3
|
+
import { KWIZFluentContext } from "./context-const";
|
3
4
|
const useContextStyles = makeStyles({
|
4
5
|
root: {
|
5
6
|
"& *": {
|
@@ -18,6 +19,6 @@ export function useKWIZFluentContextProvider(options) {
|
|
18
19
|
// we need to set it into state so it will trigger a ui update
|
19
20
|
setKwizFluentContext(Object.assign(Object.assign({}, v), { mountNode: options.root.current }));
|
20
21
|
}, [options.root]);
|
21
|
-
return kwizFluentContext;
|
22
|
+
return { KWIZFluentContext, value: kwizFluentContext };
|
22
23
|
}
|
23
24
|
//# sourceMappingURL=context-export.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context-export.js","sourceRoot":"","sources":["../../src/helpers/context-export.
|
1
|
+
{"version":3,"file":"context-export.js","sourceRoot":"","sources":["../../src/helpers/context-export.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAsB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGxE,MAAM,gBAAgB,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE;QACF,KAAK,EAAE;YACH,cAAc,EAAE,MAAM;SACzB;KACJ;CACJ,CAAC,CAAA;AAEF,MAAM,UAAU,4BAA4B,CAAC,OAG5C;IACG,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,IAAI,CAAC,GAAuB,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;IACzD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAqB,CAAC,CAAC,CAAC;IAClF,SAAS,CAAC,GAAG,EAAE;;QACX,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,OAAO,0CAAE,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACjE,kEAAkE;QAClE,8DAA8D;QAC9D,oBAAoB,iCACb,CAAC,KACJ,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,IACjC,CAAC;IACP,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;AAC3D,CAAC"}
|
@@ -1,4 +1 @@
|
|
1
|
-
|
2
|
-
import { iKWIZFluentContext } from "./context-export";
|
3
|
-
export declare const KWIZFluentContext: React.Context<iKWIZFluentContext>;
|
4
|
-
export declare function useKWIZFluentContext(): iKWIZFluentContext;
|
1
|
+
export declare function useKWIZFluentContext(): import("./context-const").iKWIZFluentContext;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { isNullOrUndefined } from "@kwiz/common";
|
2
2
|
import React from "react";
|
3
|
-
|
4
|
-
export const KWIZFluentContext = React.createContext(null);
|
3
|
+
import { KWIZFluentContext } from "./context-const";
|
5
4
|
//use context from within controls
|
6
5
|
export function useKWIZFluentContext() {
|
7
6
|
let ctx = React.useContext(KWIZFluentContext) || {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context-internal.js","sourceRoot":"","sources":["../../src/helpers/context-internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"context-internal.js","sourceRoot":"","sources":["../../src/helpers/context-internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,kCAAkC;AAClC,MAAM,UAAU,oBAAoB;IAChC,IAAI,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;IACpD,cAAc;IACd,IAAI,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC;QACtC,GAAG,CAAC,eAAe,GAAG,WAAW,CAAC;IACtC,IAAI,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC;QAClC,GAAG,CAAC,WAAW,GAAG,UAAU,CAAC;IACjC,OAAO,GAAG,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from "react";
|
2
|
+
export interface iKWIZFluentContext {
|
3
|
+
/**
|
4
|
+
* Where the portal children are mounted on DOM
|
5
|
+
*
|
6
|
+
* @default a new element on document.body without any styling
|
7
|
+
*/
|
8
|
+
mountNode?: HTMLElement | null | {
|
9
|
+
element?: HTMLElement | null;
|
10
|
+
className?: string;
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* Controls the colors and borders of the input.
|
14
|
+
*
|
15
|
+
* @default 'underline'
|
16
|
+
*/
|
17
|
+
inputAppearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
18
|
+
|
19
|
+
/**
|
20
|
+
* A button can be rounded, circular, or square.
|
21
|
+
*
|
22
|
+
* @default 'rounded'
|
23
|
+
*/
|
24
|
+
buttonShape?: 'rounded' | 'circular' | 'square';
|
25
|
+
}
|
26
|
+
|
27
|
+
//create context
|
28
|
+
export const KWIZFluentContext = React.createContext<iKWIZFluentContext>(null);
|
@@ -1,30 +1,7 @@
|
|
1
1
|
import { makeStyles } from "@fluentui/react-components";
|
2
|
-
import { useEffect, useState } from "react";
|
3
|
-
|
4
|
-
export
|
5
|
-
/**
|
6
|
-
* Where the portal children are mounted on DOM
|
7
|
-
*
|
8
|
-
* @default a new element on document.body without any styling
|
9
|
-
*/
|
10
|
-
mountNode?: HTMLElement | null | {
|
11
|
-
element?: HTMLElement | null;
|
12
|
-
className?: string;
|
13
|
-
}
|
14
|
-
/**
|
15
|
-
* Controls the colors and borders of the input.
|
16
|
-
*
|
17
|
-
* @default 'underline'
|
18
|
-
*/
|
19
|
-
inputAppearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
20
|
-
|
21
|
-
/**
|
22
|
-
* A button can be rounded, circular, or square.
|
23
|
-
*
|
24
|
-
* @default 'rounded'
|
25
|
-
*/
|
26
|
-
buttonShape?: 'rounded' | 'circular' | 'square';
|
27
|
-
}
|
2
|
+
import React, { useEffect, useState } from "react";
|
3
|
+
import { iKWIZFluentContext, KWIZFluentContext } from "./context-const";
|
4
|
+
export type { iKWIZFluentContext } from "./context-const";
|
28
5
|
|
29
6
|
const useContextStyles = makeStyles({
|
30
7
|
root: {
|
@@ -33,6 +10,7 @@ const useContextStyles = makeStyles({
|
|
33
10
|
}
|
34
11
|
},
|
35
12
|
})
|
13
|
+
|
36
14
|
export function useKWIZFluentContextProvider(options: {
|
37
15
|
root?: React.MutableRefObject<HTMLDivElement>;
|
38
16
|
ctx?: iKWIZFluentContext;
|
@@ -49,5 +27,5 @@ export function useKWIZFluentContextProvider(options: {
|
|
49
27
|
mountNode: options.root.current
|
50
28
|
});
|
51
29
|
}, [options.root]);
|
52
|
-
return kwizFluentContext;
|
30
|
+
return { KWIZFluentContext, value: kwizFluentContext };
|
53
31
|
}
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import { isNullOrUndefined } from "@kwiz/common";
|
2
2
|
import React from "react";
|
3
|
-
import {
|
3
|
+
import { KWIZFluentContext } from "./context-const";
|
4
4
|
|
5
|
-
|
6
|
-
//create context
|
7
|
-
export const KWIZFluentContext = React.createContext<iKWIZFluentContext>(null);
|
8
5
|
//use context from within controls
|
9
6
|
export function useKWIZFluentContext() {
|
10
7
|
let ctx = React.useContext(KWIZFluentContext) || {};
|