@instructure/emotion 8.9.2-snapshot.2 → 8.9.2-snapshot.9

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.
Files changed (53) hide show
  1. package/es/EmotionThemeProvider/index.js +3 -3
  2. package/es/EmotionTypes.js +1 -0
  3. package/es/getComponentThemeOverride.js +16 -4
  4. package/es/index.js +2 -2
  5. package/es/styleUtils/ThemeablePropTypes.js +5 -5
  6. package/es/styleUtils/bidirectionalPolyfill.js +8 -5
  7. package/es/useTheme.js +6 -3
  8. package/es/withStyle.js +10 -8
  9. package/lib/EmotionThemeProvider/index.js +4 -4
  10. package/lib/EmotionTypes.js +1 -0
  11. package/lib/getComponentThemeOverride.js +16 -5
  12. package/lib/index.js +51 -26
  13. package/lib/styleUtils/ThemeablePropTypes.js +5 -5
  14. package/lib/styleUtils/bidirectionalPolyfill.js +7 -5
  15. package/lib/useTheme.js +4 -2
  16. package/lib/withStyle.js +11 -9
  17. package/package.json +10 -10
  18. package/src/EmotionThemeProvider/index.tsx +11 -22
  19. package/src/EmotionTypes.ts +89 -0
  20. package/src/getComponentThemeOverride.ts +33 -11
  21. package/src/index.ts +23 -2
  22. package/src/styleUtils/ThemeablePropTypes.ts +36 -12
  23. package/src/styleUtils/ThemeablePropValues.ts +1 -1
  24. package/src/styleUtils/bidirectionalPolyfill.ts +29 -10
  25. package/src/styleUtils/getShorthandPropValue.ts +1 -0
  26. package/src/styleUtils/makeThemeVars.ts +5 -5
  27. package/src/styleUtils/mirrorShorthandCorners.ts +1 -0
  28. package/src/styleUtils/mirrorShorthandEdges.ts +1 -0
  29. package/src/useTheme.ts +7 -2
  30. package/src/withStyle.tsx +88 -18
  31. package/types/EmotionThemeProvider/index.d.ts +1 -15
  32. package/types/EmotionThemeProvider/index.d.ts.map +1 -1
  33. package/types/EmotionTypes.d.ts +29 -0
  34. package/types/EmotionTypes.d.ts.map +1 -0
  35. package/types/getComponentThemeOverride.d.ts +14 -2
  36. package/types/getComponentThemeOverride.d.ts.map +1 -1
  37. package/types/index.d.ts +5 -2
  38. package/types/index.d.ts.map +1 -1
  39. package/types/styleUtils/ThemeablePropTypes.d.ts +8 -6
  40. package/types/styleUtils/ThemeablePropTypes.d.ts.map +1 -1
  41. package/types/styleUtils/ThemeablePropValues.d.ts +1 -1
  42. package/types/styleUtils/ThemeablePropValues.d.ts.map +1 -1
  43. package/types/styleUtils/bidirectionalPolyfill.d.ts +5 -1
  44. package/types/styleUtils/bidirectionalPolyfill.d.ts.map +1 -1
  45. package/types/styleUtils/getShorthandPropValue.d.ts.map +1 -1
  46. package/types/styleUtils/makeThemeVars.d.ts +4 -5
  47. package/types/styleUtils/makeThemeVars.d.ts.map +1 -1
  48. package/types/styleUtils/mirrorShorthandCorners.d.ts.map +1 -1
  49. package/types/styleUtils/mirrorShorthandEdges.d.ts.map +1 -1
  50. package/types/useTheme.d.ts +4 -1
  51. package/types/useTheme.d.ts.map +1 -1
  52. package/types/withStyle.d.ts +11 -5
  53. package/types/withStyle.d.ts.map +1 -1
@@ -1,3 +1,5 @@
1
+ import type { ThemeOrOverride } from './EmotionTypes';
2
+ import type { ComponentTheme } from '@instructure/shared-types';
1
3
  /**
2
4
  * ---
3
5
  * private: true
@@ -6,9 +8,19 @@
6
8
  * based on every possible override there is.
7
9
 
8
10
  * @param {object} theme - Theme object
9
- * @param {*} componentName - Name of the component
11
+ * @param {*} displayName - Name of the component
12
+ * @param {*} componentId - componentId of the component
10
13
  * @param {*} props - The component's props object
11
14
  * @returns {object} The calculated theme override object
12
15
  */
13
- export declare const getComponentThemeOverride: (theme: any, componentName: any, props: any) => any;
16
+ declare const getComponentThemeOverride: (theme: ThemeOrOverride, displayName: string, componentId?: string | undefined, props?: ({
17
+ [k: string]: unknown;
18
+ } & {
19
+ styles?: import("./EmotionTypes").ComponentStyle<string> | undefined;
20
+ makeStyles?: ((extraArgs?: Record<string, unknown> | undefined) => void) | undefined;
21
+ } & {
22
+ themeOverride?: Partial<ComponentTheme> | undefined;
23
+ }) | undefined) => ComponentTheme;
24
+ export default getComponentThemeOverride;
25
+ export { getComponentThemeOverride };
14
26
  //# sourceMappingURL=getComponentThemeOverride.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getComponentThemeOverride.d.ts","sourceRoot":"","sources":["../src/getComponentThemeOverride.ts"],"names":[],"mappings":"AAwBA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,UAC7B,GAAG,iBACK,GAAG,SACX,GAAG,QAQX,CAAA"}
1
+ {"version":3,"file":"getComponentThemeOverride.d.ts","sourceRoot":"","sources":["../src/getComponentThemeOverride.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAK/D;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,yBAAyB,UACtB,eAAe,eACT,MAAM;;;;;;;mBAGlB,cAcF,CAAA;AAED,eAAe,yBAAyB,CAAA;AACxC,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from '@emotion/react';
2
2
  export { EmotionThemeProvider } from './EmotionThemeProvider';
3
- export * from './styleUtils';
4
- export * from './withStyle';
3
+ export { withStyle } from './withStyle';
4
+ export { ThemeablePropValues, ThemeablePropTypes, makeThemeVars, getShorthandPropValue, mirrorShorthandCorners, mirrorShorthandEdges } from './styleUtils';
5
+ export type { ComponentStyle } from './EmotionTypes';
6
+ export type { WithStyleProps } from './withStyle';
7
+ export type { SpacingValues, Spacing, Shadow, Stacking, Background, BorderRadiiValues, BorderRadii, BorderWidthValues, BorderWidth } from './styleUtils';
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,cAAc,gBAAgB,CAAA;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,cAAc,gBAAgB,CAAA;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AAErB,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,YAAY,EACV,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACZ,MAAM,cAAc,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
+ import type { BorderRadiiValues, BorderRadii, BorderWidthValues, BorderWidth, SpacingValues, Spacing } from './ThemeablePropValues';
2
3
  /**
3
4
  * ---
4
5
  * category: utilities/themes
@@ -8,14 +9,15 @@ import PropTypes from 'prop-types';
8
9
  */
9
10
  declare const ThemeablePropTypes: {
10
11
  shadow: PropTypes.Requireable<"resting" | "above" | "topmost" | "none">;
11
- stacking: PropTypes.Requireable<"resting" | "above" | "topmost" | "deepest" | "below">;
12
- borderWidth: (props: any, propName: any, componentName: any, location: any) => any;
13
- borderRadius: (props: any, propName: any, componentName: any, location: any) => any;
14
- background: PropTypes.Requireable<"default" | "inverse" | "transparent">;
12
+ stacking: PropTypes.Requireable<"resting" | "above" | "topmost" | "below" | "deepest">;
13
+ borderWidth: PropTypes.Validator<BorderWidth>;
14
+ borderRadius: PropTypes.Validator<BorderRadii>;
15
+ background: PropTypes.Requireable<"transparent" | "default" | "inverse">;
15
16
  size: PropTypes.Requireable<"small" | "medium" | "large" | "x-small" | "x-large">;
16
- spacing: (props: any, propName: any, componentName: any, location: any) => any;
17
+ spacing: PropTypes.Validator<Spacing>;
17
18
  };
18
- declare function shorthandPropType(validValues: any): (props: any, propName: any, componentName: any, location: any) => any;
19
+ declare type ValueKeys = BorderWidthValues[] | BorderRadiiValues[] | SpacingValues[] | string[];
20
+ declare function shorthandPropType<V extends ValueKeys>(validValues: V): PropTypes.Validator<V extends BorderWidthValues[] ? BorderWidth : V extends BorderRadiiValues[] ? BorderRadii : V extends SpacingValues[] ? Spacing : string[]>;
19
21
  export default ThemeablePropTypes;
20
22
  export { ThemeablePropTypes, shorthandPropType };
21
23
  //# sourceMappingURL=ThemeablePropTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeablePropTypes.d.ts","sourceRoot":"","sources":["../../src/styleUtils/ThemeablePropTypes.ts"],"names":[],"mappings":"AAwBA,OAAO,SAAS,MAAM,YAAY,CAAA;AAclC;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB;;;yBAYb,GAAG,YACA,GAAG,iBACE,GAAG,YACR,GAAG,KACZ,GAAG;0BAJG,GAAG,YACA,GAAG,iBACE,GAAG,YACR,GAAG,KACZ,GAAG;;;qBAJG,GAAG,YACA,GAAG,iBACE,GAAG,YACR,GAAG,KACZ,GAAG;CARP,CAAA;AAED,iBAAS,iBAAiB,CAAC,WAAW,EAAE,GAAG,WAEhC,GAAG,YACA,GAAG,iBACE,GAAG,YACR,GAAG,KACZ,GAAG,CAqCP;AAED,eAAe,kBAAkB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"ThemeablePropTypes.d.ts","sourceRoot":"","sources":["../../src/styleUtils/ThemeablePropTypes.ts"],"names":[],"mappings":"AAwBA,OAAO,SAAS,MAAM,YAAY,CAAA;AAGlC,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,OAAO,EACR,MAAM,uBAAuB,CAAA;AAY9B;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB;;;;;;;;CAQvB,CAAA;AAED,aAAK,SAAS,GACV,iBAAiB,EAAE,GACnB,iBAAiB,EAAE,GACnB,aAAa,EAAE,GACf,MAAM,EAAE,CAAA;AAEZ,iBAAS,iBAAiB,CAAC,CAAC,SAAS,SAAS,EAC5C,WAAW,EAAE,CAAC,GACb,SAAS,CAAC,SAAS,CACpB,CAAC,SAAS,iBAAiB,EAAE,GACzB,WAAW,GACX,CAAC,SAAS,iBAAiB,EAAE,GAC7B,WAAW,GACX,CAAC,SAAS,aAAa,EAAE,GACzB,OAAO,GACP,MAAM,EAAE,CACb,CA2CA;AAED,eAAe,kBAAkB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { CSSShorthandValue } from '@instructure/shared-types';
1
+ import type { CSSShorthandValue } from '@instructure/shared-types';
2
2
  declare const ThemeablePropValues: {
3
3
  readonly SHADOW_TYPES: {
4
4
  readonly resting: "resting";
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeablePropValues.d.ts","sourceRoot":"","sources":["../../src/styleUtils/ThemeablePropValues.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE7D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Df,CAAA;AAGV,aAAK,WAAW,GAAG,MAAM,OAAO,mBAAmB,CAAC,OAAO,CAAA;AAC3D,aAAK,aAAa,GAAG,OAAO,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;AACpE,aAAK,OAAO,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAA;AAG/C,aAAK,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CAAA"}
@@ -1,2 +1,6 @@
1
- export declare const bidirectionalPolyfill: (styles: any, dir: any) => {};
1
+ import type { StyleObject } from '../EmotionTypes';
2
+ declare type Direction = 'ltr' | 'rtl';
3
+ declare const bidirectionalPolyfill: <S extends StyleObject>(styles: S, dir: Direction) => S;
4
+ export default bidirectionalPolyfill;
5
+ export { bidirectionalPolyfill };
2
6
  //# sourceMappingURL=bidirectionalPolyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bidirectionalPolyfill.d.ts","sourceRoot":"","sources":["../../src/styleUtils/bidirectionalPolyfill.ts"],"names":[],"mappings":"AA0LA,eAAO,MAAM,qBAAqB,WAAY,GAAG,OAAO,GAAG,OAOxD,CAAA"}
1
+ {"version":3,"file":"bidirectionalPolyfill.d.ts","sourceRoot":"","sources":["../../src/styleUtils/bidirectionalPolyfill.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,aAAK,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AA0K9B,QAAA,MAAM,qBAAqB,0CAEpB,SAAS,MAQR,CAAA;AAER,eAAe,qBAAqB,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getShorthandPropValue.d.ts","sourceRoot":"","sources":["../../src/styleUtils/getShorthandPropValue.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,qBAAqB,CAC5B,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC/C,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,sBAqCjB;AAED,eAAe,qBAAqB,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
1
+ {"version":3,"file":"getShorthandPropValue.d.ts","sourceRoot":"","sources":["../../src/styleUtils/getShorthandPropValue.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,qBAAqB,CAC5B,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC/C,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,sBAqCjB;AAED,eAAe,qBAAqB,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -1,7 +1,6 @@
1
- import { BaseTheme } from '@instructure/shared-types';
2
- declare type ThemeVars = Omit<BaseTheme, 'key' | 'description'>;
3
- declare type Vars = ThemeVars[keyof ThemeVars];
4
- declare type PrefixedThemeVars<P extends string, Variables extends Partial<Vars>> = Variables extends Record<infer R, any> ? Record<`${P}${R extends string ? Capitalize<R> : string}`, Variables extends BaseTheme['stacking'] ? number : string> : Variables;
1
+ import type { BaseTheme, BaseThemeVariables } from '@instructure/shared-types';
2
+ declare type ThemeVarGroup = BaseThemeVariables[keyof BaseThemeVariables];
3
+ declare type PrefixedThemeVars<P extends string, Variables extends Partial<ThemeVarGroup>> = Variables extends Record<infer R, any> ? Record<`${P}${R extends string ? Capitalize<R> : string}`, Variables extends BaseTheme['stacking'] ? number : string> : Variables;
5
4
  /**
6
5
  * ---
7
6
  * category: utilities/themes
@@ -13,7 +12,7 @@ declare type PrefixedThemeVars<P extends string, Variables extends Partial<Vars>
13
12
  * @param {Object} vars - an object
14
13
  * @returns {Object} a modified object with prefixed keys
15
14
  */
16
- declare function makeThemeVars<P extends string, V extends Partial<Vars>>(prefix: P, vars: V): PrefixedThemeVars<P, V>;
15
+ declare function makeThemeVars<P extends string, V extends Partial<ThemeVarGroup>>(prefix: P, vars: V): PrefixedThemeVars<P, V>;
17
16
  export default makeThemeVars;
18
17
  export { makeThemeVars };
19
18
  //# sourceMappingURL=makeThemeVars.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"makeThemeVars.d.ts","sourceRoot":"","sources":["../../src/styleUtils/makeThemeVars.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,aAAK,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,aAAa,CAAC,CAAA;AACvD,aAAK,IAAI,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC,CAAA;AACtC,aAAK,iBAAiB,CACpB,CAAC,SAAS,MAAM,EAChB,SAAS,SAAS,OAAO,CAAC,IAAI,CAAC,IAC7B,SAAS,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GACtC,MAAM,CACJ,GAAG,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,EAClD,SAAS,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,MAAM,CAC1D,GACD,SAAS,CAAA;AAEb;;;;;;;;;;GAUG;AACH,iBAAS,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,IAAI,CAAC,EAC9D,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,2BAOR;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"makeThemeVars.d.ts","sourceRoot":"","sources":["../../src/styleUtils/makeThemeVars.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9E,aAAK,aAAa,GAAG,kBAAkB,CAAC,MAAM,kBAAkB,CAAC,CAAA;AACjE,aAAK,iBAAiB,CACpB,CAAC,SAAS,MAAM,EAChB,SAAS,SAAS,OAAO,CAAC,aAAa,CAAC,IACtC,SAAS,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GACtC,MAAM,CACJ,GAAG,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,EAClD,SAAS,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,MAAM,CAC1D,GACD,SAAS,CAAA;AAEb;;;;;;;;;;GAUG;AACH,iBAAS,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,aAAa,CAAC,EACvE,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,2BAOR;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"mirrorShorthandCorners.d.ts","sourceRoot":"","sources":["../../src/styleUtils/mirrorShorthandCorners.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,eAAe,sBAAsB,CAAA;AACrC,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
1
+ {"version":3,"file":"mirrorShorthandCorners.d.ts","sourceRoot":"","sources":["../../src/styleUtils/mirrorShorthandCorners.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,eAAe,sBAAsB,CAAA;AACrC,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"mirrorShorthandEdges.d.ts","sourceRoot":"","sources":["../../src/styleUtils/mirrorShorthandEdges.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,eAAe,oBAAoB,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
1
+ {"version":3,"file":"mirrorShorthandEdges.d.ts","sourceRoot":"","sources":["../../src/styleUtils/mirrorShorthandEdges.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,eAAe,oBAAoB,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
@@ -1,3 +1,4 @@
1
+ import type { ThemeOrOverride } from './EmotionTypes';
1
2
  /**
2
3
  * ---
3
4
  * private: true
@@ -6,5 +7,7 @@
6
7
  * If there is no theme provided to the Context it will return the default `canvas` theme.
7
8
  * @returns {object} the theme object
8
9
  */
9
- export declare const useTheme: () => import("@emotion/react").Theme;
10
+ declare const useTheme: () => ThemeOrOverride;
11
+ export default useTheme;
12
+ export { useTheme };
10
13
  //# sourceMappingURL=useTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/useTheme.ts"],"names":[],"mappings":"AA4BA;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,sCAYpB,CAAA"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/useTheme.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD;;;;;;;GAOG;AACH,QAAA,MAAM,QAAQ,uBAYb,CAAA;AAED,eAAe,QAAQ,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,9 +1,14 @@
1
1
  import React from 'react';
2
- import type { CSSObject } from '@emotion/react';
3
- export declare type WithStyleProps = Partial<{
4
- styles: CSSObject;
5
- makeStyles: (...extraArgs: unknown[]) => void;
6
- }>;
2
+ import type { ComponentTheme } from '@instructure/shared-types';
3
+ import type { ComponentStyle } from './EmotionTypes';
4
+ declare type WithStylePrivateProps<Style extends ComponentStyle | null = ComponentStyle> = Style extends null ? {} : {
5
+ styles?: Style;
6
+ makeStyles?: (extraArgs?: Record<string, unknown>) => void;
7
+ };
8
+ declare type ThemeOverrideProp<Theme extends ComponentTheme | null = ComponentTheme> = {
9
+ themeOverride?: Partial<Theme>;
10
+ };
11
+ declare type WithStyleProps<Theme extends ComponentTheme | null = ComponentTheme, Style extends ComponentStyle | null = ComponentStyle> = Theme extends null ? WithStylePrivateProps<Style> : WithStylePrivateProps<Style> & ThemeOverrideProp<Theme>;
7
12
  /**
8
13
  * ---
9
14
  * category: utilities/themes
@@ -75,4 +80,5 @@ export declare type WithStyleProps = Partial<{
75
80
  declare const withStyle: (...args: unknown[]) => (ComposedComponent: React.ComponentClass<any, any>) => any;
76
81
  export default withStyle;
77
82
  export { withStyle };
83
+ export type { WithStyleProps };
78
84
  //# sourceMappingURL=withStyle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withStyle.d.ts","sourceRoot":"","sources":["../src/withStyle.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAA6C,MAAM,OAAO,CAAA;AAQjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,oBAAY,cAAc,GAAG,OAAO,CAAC;IACnC,MAAM,EAAE,SAAS,CAAA;IACjB,UAAU,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAC9C,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,QAAA,MAAM,SAAS,oFAmEd,CAAA;AACD,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"withStyle.d.ts","sourceRoot":"","sources":["../src/withStyle.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAA+C,MAAM,OAAO,CAAA;AAiBnE,OAAO,KAAK,EAAa,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,KAAK,EACV,cAAc,EAKf,MAAM,gBAAgB,CAAA;AASvB,aAAK,qBAAqB,CACxB,KAAK,SAAS,cAAc,GAAG,IAAI,GAAG,cAAc,IAClD,KAAK,SAAS,IAAI,GAElB,EAAE,GACF;IACE,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,EA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