@atlaskit/app-provider
Advanced tools
Comparing version 0.2.0 to 0.3.0
# @atlaskit/app-provider | ||
## 0.3.0 | ||
### Minor Changes | ||
- [#42091](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42091) [`4ec3142822b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ec3142822b) - Add the `routerLinkComponent` prop to support router link configuration within the Design System. | ||
## 0.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -11,2 +11,3 @@ "use strict"; | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _routerLinkProvider = _interopRequireDefault(require("./router-link-provider")); | ||
var _themeProvider = _interopRequireDefault(require("./theme-provider")); | ||
@@ -27,3 +28,4 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
defaultColorMode = _ref$defaultColorMode === void 0 ? 'light' : _ref$defaultColorMode, | ||
defaultTheme = _ref.defaultTheme; | ||
defaultTheme = _ref.defaultTheme, | ||
routerLinkComponent = _ref.routerLinkComponent; | ||
var isInsideAppProvider = (0, _react.useContext)(InsideAppProviderContext); | ||
@@ -38,4 +40,6 @@ if (isInsideAppProvider) { | ||
defaultTheme: defaultTheme | ||
}, children)); | ||
}, /*#__PURE__*/_react.default.createElement(_routerLinkProvider.default, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children))); | ||
} | ||
var _default = exports.default = AppProvider; |
@@ -19,2 +19,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "useRouterLink", { | ||
enumerable: true, | ||
get: function get() { | ||
return _useRouterLink.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "useSetColorMode", { | ||
@@ -39,2 +45,3 @@ enumerable: true, | ||
var _appProvider = _interopRequireDefault(require("./app-provider")); | ||
var _themeProvider = require("./theme-provider"); | ||
var _themeProvider = require("./theme-provider"); | ||
var _useRouterLink = _interopRequireDefault(require("./router-link-provider/hooks/use-router-link")); |
import React, { createContext, useContext } from 'react'; | ||
import RouterLinkProvider from './router-link-provider'; | ||
import ThemeProvider from './theme-provider'; | ||
@@ -14,3 +15,4 @@ const InsideAppProviderContext = /*#__PURE__*/createContext(false); | ||
defaultColorMode = 'light', | ||
defaultTheme | ||
defaultTheme, | ||
routerLinkComponent | ||
}) { | ||
@@ -26,4 +28,6 @@ const isInsideAppProvider = useContext(InsideAppProviderContext); | ||
defaultTheme: defaultTheme | ||
}, children)); | ||
}, /*#__PURE__*/React.createElement(RouterLinkProvider, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children))); | ||
} | ||
export default AppProvider; |
export { default } from './app-provider'; | ||
export { useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider'; | ||
export { useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider'; | ||
import useRouterLink from './router-link-provider/hooks/use-router-link'; | ||
export { useRouterLink }; |
import React, { createContext, useContext } from 'react'; | ||
import RouterLinkProvider from './router-link-provider'; | ||
import ThemeProvider from './theme-provider'; | ||
@@ -15,3 +16,4 @@ var InsideAppProviderContext = /*#__PURE__*/createContext(false); | ||
defaultColorMode = _ref$defaultColorMode === void 0 ? 'light' : _ref$defaultColorMode, | ||
defaultTheme = _ref.defaultTheme; | ||
defaultTheme = _ref.defaultTheme, | ||
routerLinkComponent = _ref.routerLinkComponent; | ||
var isInsideAppProvider = useContext(InsideAppProviderContext); | ||
@@ -26,4 +28,6 @@ if (isInsideAppProvider) { | ||
defaultTheme: defaultTheme | ||
}, children)); | ||
}, /*#__PURE__*/React.createElement(RouterLinkProvider, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children))); | ||
} | ||
export default AppProvider; |
export { default } from './app-provider'; | ||
export { useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider'; | ||
export { useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider'; | ||
import useRouterLink from './router-link-provider/hooks/use-router-link'; | ||
export { useRouterLink }; |
import React from 'react'; | ||
import { type RouterLinkComponent } from './router-link-provider'; | ||
import { type ColorMode, type Theme } from './theme-provider'; | ||
@@ -13,2 +14,6 @@ interface AppProviderProps { | ||
/** | ||
* A configured router link component. | ||
*/ | ||
routerLinkComponent?: RouterLinkComponent<any>; | ||
/** | ||
* App content. | ||
@@ -25,3 +30,3 @@ */ | ||
*/ | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, }: AppProviderProps): JSX.Element; | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, }: AppProviderProps): JSX.Element; | ||
export default AppProvider; |
export { default } from './app-provider'; | ||
export { useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider'; | ||
export { type RouterLinkComponentProps } from './router-link-provider'; | ||
import useRouterLink from './router-link-provider/hooks/use-router-link'; | ||
export { useRouterLink }; |
import React from 'react'; | ||
import { type RouterLinkComponent } from './router-link-provider'; | ||
import { type ColorMode, type Theme } from './theme-provider'; | ||
@@ -13,2 +14,6 @@ interface AppProviderProps { | ||
/** | ||
* A configured router link component. | ||
*/ | ||
routerLinkComponent?: RouterLinkComponent<any>; | ||
/** | ||
* App content. | ||
@@ -25,3 +30,3 @@ */ | ||
*/ | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, }: AppProviderProps): JSX.Element; | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, }: AppProviderProps): JSX.Element; | ||
export default AppProvider; |
export { default } from './app-provider'; | ||
export { useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider'; | ||
export { type RouterLinkComponentProps } from './router-link-provider'; | ||
import useRouterLink from './router-link-provider/hooks/use-router-link'; | ||
export { useRouterLink }; |
{ | ||
"name": "@atlaskit/app-provider", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A top level provider for the Design System.", | ||
@@ -60,2 +60,4 @@ "author": "Atlassian Pty Ltd", | ||
"react-dom": "^16.8.0", | ||
"react-resource-router": "^0.20.0", | ||
"react-router-dom": "^4.2.2", | ||
"typescript": "~4.9.5", | ||
@@ -62,0 +64,0 @@ "wait-for-expect": "^1.2.0" |
@@ -26,2 +26,3 @@ <!-- API Report Version: 2.3 --> | ||
defaultTheme, | ||
routerLinkComponent, | ||
}: AppProviderProps): JSX.Element; | ||
@@ -35,2 +36,3 @@ export default AppProvider; | ||
defaultTheme?: Partial<Theme>; | ||
routerLinkComponent?: RouterLinkComponent<any>; | ||
} | ||
@@ -45,2 +47,12 @@ | ||
// @public (undocumented) | ||
type RouterLinkComponent<RouterLinkConfig extends {} = {}> = | ||
React_2.ComponentType<RouterLinkComponentProps<RouterLinkConfig>>; | ||
// @public (undocumented) | ||
export type RouterLinkComponentProps<RouterLinkConfig extends {} = {}> = { | ||
href: RouterLinkConfig | string; | ||
children: React_2.ReactNode; | ||
}; | ||
// @public (undocumented) | ||
type Theme = Omit<ThemeState, 'colorMode' | 'contrastMode'>; | ||
@@ -52,2 +64,5 @@ | ||
// @public | ||
export const useRouterLink: () => RouterLinkComponent | undefined; | ||
// @public | ||
export function useSetColorMode(): (value: ColorMode) => void; | ||
@@ -54,0 +69,0 @@ |
@@ -11,3 +11,3 @@ ## API Report File for "@atlaskit/app-provider" | ||
// @public | ||
function AppProvider({ children, defaultColorMode, defaultTheme, }: AppProviderProps): JSX.Element; | ||
function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, }: AppProviderProps): JSX.Element; | ||
export default AppProvider; | ||
@@ -20,2 +20,3 @@ | ||
defaultTheme?: Partial<Theme>; | ||
routerLinkComponent?: RouterLinkComponent<any>; | ||
} | ||
@@ -30,2 +31,11 @@ | ||
// @public (undocumented) | ||
type RouterLinkComponent<RouterLinkConfig extends {} = {}> = React_2.ComponentType<RouterLinkComponentProps<RouterLinkConfig>>; | ||
// @public (undocumented) | ||
export type RouterLinkComponentProps<RouterLinkConfig extends {} = {}> = { | ||
href: RouterLinkConfig | string; | ||
children: React_2.ReactNode; | ||
}; | ||
// @public (undocumented) | ||
type Theme = Omit<ThemeState, 'colorMode' | 'contrastMode'>; | ||
@@ -37,2 +47,5 @@ | ||
// @public | ||
export const useRouterLink: () => RouterLinkComponent | undefined; | ||
// @public | ||
export function useSetColorMode(): (value: ColorMode) => void; | ||
@@ -39,0 +52,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46540
33
1001
15