@kwiz/fluentui 1.0.59 → 1.0.60

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,4 @@
1
+ import React from "react";
2
+ //create context
3
+ export const KWIZFluentContext = React.createContext(null);
4
+ //# sourceMappingURL=context-const.js.map
@@ -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,7 @@
1
- export interface iKWIZFluentContext {
2
- /**
3
- * Where the portal children are mounted on DOM
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, { PropsWithChildren } 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
- }): iKWIZFluentContext;
7
+ }): (props: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { makeStyles } from "@fluentui/react-components";
2
3
  import { useEffect, useState } from "react";
4
+ import { KWIZFluentContext } from "./context-const";
3
5
  const useContextStyles = makeStyles({
4
6
  root: {
5
7
  "& *": {
@@ -18,6 +20,6 @@ export function useKWIZFluentContextProvider(options) {
18
20
  // we need to set it into state so it will trigger a ui update
19
21
  setKwizFluentContext(Object.assign(Object.assign({}, v), { mountNode: options.root.current }));
20
22
  }, [options.root]);
21
- return kwizFluentContext;
23
+ return (props) => _jsx(KWIZFluentContext.Provider, { value: kwizFluentContext, children: props.children });
22
24
  }
23
25
  //# sourceMappingURL=context-export.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-export.js","sourceRoot":"","sources":["../../src/helpers/context-export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA2B5C,MAAM,gBAAgB,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE;QACF,KAAK,EAAE;YACH,cAAc,EAAE,MAAM;SACzB;KACJ;CACJ,CAAC,CAAA;AACF,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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,KACJ,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,IACjC,CAAC;IACP,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,KAAwB,EAAE,EAAE,CAAC,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,iBAAiB,YAAG,KAAK,CAAC,QAAQ,GAA8B,CAAC;AAC7I,CAAC"}
@@ -1,4 +1 @@
1
- import React from "react";
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
- //create context
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;AAI1B,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAqB,IAAI,CAAC,CAAC;AAC/E,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"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/fluentui",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "KWIZ common controls for FluentUI",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 interface iKWIZFluentContext {
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, { PropsWithChildren, 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 (props: PropsWithChildren) => <KWIZFluentContext.Provider value={kwizFluentContext}>{props.children}</KWIZFluentContext.Provider>;
53
31
  }
@@ -1,10 +1,7 @@
1
1
  import { isNullOrUndefined } from "@kwiz/common";
2
2
  import React from "react";
3
- import { iKWIZFluentContext } from "./context-export";
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) || {};