@atlaskit/app-provider 1.3.2 → 1.3.3

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/CHANGELOG.md CHANGED
@@ -1,110 +1,118 @@
1
1
  # @atlaskit/app-provider
2
2
 
3
+ ## 1.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#110702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110702)
8
+ [`b8c2eefeb195b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b8c2eefeb195b) -
9
+ Router link component configurations no longer require `children`, so labels can be supplied
10
+ through aria attributes if required
11
+
3
12
  ## 1.3.2
4
13
 
5
14
  ### Patch Changes
6
15
 
7
- - [#89307](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89307)
8
- [`5e4a7780400d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5e4a7780400d) -
9
- Adding new functionality to allow easier migration of theming.
16
+ - [#89307](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89307)
17
+ [`5e4a7780400d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5e4a7780400d) -
18
+ Adding new functionality to allow easier migration of theming.
10
19
 
11
20
  ## 1.3.1
12
21
 
13
22
  ### Patch Changes
14
23
 
15
- - [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)
16
- [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -
17
- Upgrading internal dependency `bind-event-listener` to `@^3.0.0`
24
+ - [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)
25
+ [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -
26
+ Upgrading internal dependency `bind-event-listener` to `@^3.0.0`
18
27
 
19
28
  ## 1.3.0
20
29
 
21
30
  ### Minor Changes
22
31
 
23
- - [#88515](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88515)
24
- [`ef20ec7145b7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef20ec7145b7) -
25
- Add type export for `RouterLinkComponent` to enable router link configuration
32
+ - [#88515](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88515)
33
+ [`ef20ec7145b7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef20ec7145b7) -
34
+ Add type export for `RouterLinkComponent` to enable router link configuration
26
35
 
27
36
  ## 1.2.0
28
37
 
29
38
  ### Minor Changes
30
39
 
31
- - [#87603](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87603)
32
- [`07a08e440f76`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a08e440f76) -
33
- Added support for React 18
40
+ - [#87603](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87603)
41
+ [`07a08e440f76`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a08e440f76) -
42
+ Add support for React 18 in non-strict mode.
34
43
 
35
44
  ## 1.1.0
36
45
 
37
46
  ### Minor Changes
38
47
 
39
- - [#87244](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87244)
40
- [`7d9d0320d3da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d9d0320d3da) -
41
- Add option to disable theming features with `UNSAFE_isThemingDisabled`
48
+ - [#87244](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87244)
49
+ [`7d9d0320d3da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d9d0320d3da) -
50
+ Add option to disable theming features with `UNSAFE_isThemingDisabled`
42
51
 
43
52
  ## 1.0.1
44
53
 
45
54
  ### Patch Changes
46
55
 
47
- - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
48
- [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
49
- Upgrade Typescript from `4.9.5` to `5.4.2`
56
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
57
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
58
+ Upgrade Typescript from `4.9.5` to `5.4.2`
50
59
 
51
60
  ## 1.0.0
52
61
 
53
62
  ### Major Changes
54
63
 
55
- - [#69683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69683)
56
- [`203c0f3c8b03`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/203c0f3c8b03) -
57
- Stable v1 release of app provider
64
+ - [#69683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69683)
65
+ [`203c0f3c8b03`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/203c0f3c8b03) -
66
+ Stable v1 release of app provider
58
67
 
59
68
  ## 0.4.0
60
69
 
61
70
  ### Minor Changes
62
71
 
63
- - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305)
64
- [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - -
65
- Router link components are now required to forward refs
66
- - The `useRouterLink()` hook now supports generic router link configuration:
67
- `useRouterLink<YourLinkConfigObject>()`
72
+ - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305)
73
+ [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - - Router
74
+ link components are now required to forward refs
75
+ - The `useRouterLink()` hook now supports generic router link configuration:
76
+ `useRouterLink<YourLinkConfigObject>()`
68
77
 
69
78
  ### Patch Changes
70
79
 
71
- - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305)
72
- [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - -
73
- Fixes a bug with router link component generic `href` prop typings where non-object types were
74
- allowed
80
+ - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305)
81
+ [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - - Fixes
82
+ a bug with router link component generic `href` prop typings where non-object types were allowed
75
83
 
76
84
  ## 0.3.1
77
85
 
78
86
  ### Patch Changes
79
87
 
80
- - [#42130](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42130)
81
- [`b9b8b2c1e0a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9b8b2c1e0a) -
82
- Removed unused dev dependencies `@atlaskit/primitives` and `@atlaskit/dropdown-menu`
88
+ - [#42130](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42130)
89
+ [`b9b8b2c1e0a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9b8b2c1e0a) - Removed
90
+ unused dev dependencies `@atlaskit/primitives` and `@atlaskit/dropdown-menu`
83
91
 
84
92
  ## 0.3.0
85
93
 
86
94
  ### Minor Changes
87
95
 
88
- - [#42091](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42091)
89
- [`4ec3142822b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ec3142822b) - Add
90
- the `routerLinkComponent` prop to support router link configuration within the Design System.
96
+ - [#42091](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42091)
97
+ [`4ec3142822b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ec3142822b) - Add the
98
+ `routerLinkComponent` prop to support router link configuration within the Design System.
91
99
 
92
100
  ## 0.2.0
93
101
 
94
102
  ### Minor Changes
95
103
 
96
- - [#41931](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41931)
97
- [`5df5614a6b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5df5614a6b5) -
98
- defaultTheme now applies default sub-themes when ommited.
104
+ - [#41931](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41931)
105
+ [`5df5614a6b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5df5614a6b5) -
106
+ defaultTheme now applies default sub-themes when ommited.
99
107
 
100
108
  ## 0.1.0
101
109
 
102
110
  ### Minor Changes
103
111
 
104
- - [#41035](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41035)
105
- [`e7344823cff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7344823cff) -
106
- Created the AppProvider component with support for theming.
112
+ - [#41035](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41035)
113
+ [`e7344823cff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7344823cff) - Created
114
+ the AppProvider component with support for theming.
107
115
 
108
116
  ## 0.0.1
109
117
 
110
- - Scaffold AppProvider component.
118
+ - Scaffold AppProvider component.
package/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  Copyright 2023 Atlassian Pty Ltd
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4
+ compliance with the License. You may obtain a copy of the License at
6
5
 
7
6
  http://www.apache.org/licenses/LICENSE-2.0
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10
+ implied. See the License for the specific language governing permissions and limitations under the
11
+ License.
package/README.md CHANGED
@@ -4,4 +4,5 @@ A top level provider for the Design System.
4
4
 
5
5
  ## Usage
6
6
 
7
- Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/design-system/app-provider).
7
+ Detailed docs and example usage can be found
8
+ [here](https://atlaskit.atlassian.com/packages/design-system/app-provider).
@@ -11,26 +11,29 @@ import routerLinkComponentExample from '../../examples/constellation/2-router-li
11
11
  AppProvider sets up theming for an app, enabling [design tokens](/tokens/design-tokens) to be used.
12
12
 
13
13
  <Example
14
- Component={defaultExample.example}
15
- source={defaultExample.code}
16
- packageName="@atlaskit/app-provider"
14
+ Component={defaultExample.example}
15
+ source={defaultExample.code}
16
+ packageName="@atlaskit/app-provider"
17
17
  />
18
18
 
19
19
  ## Color mode and theme switching
20
20
 
21
- The `useColorMode` hook can be used to get the active color mode. When the color mode is set to `auto`, the active color mode will be determined by the user's system preference.
21
+ The `useColorMode` hook can be used to get the active color mode. When the color mode is set to
22
+ `auto`, the active color mode will be determined by the user's system preference.
22
23
 
23
- The `useTheme` hook can be used to get the active themes. The `useSetTheme` hook can be used to change themes.
24
+ The `useTheme` hook can be used to get the active themes. The `useSetTheme` hook can be used to
25
+ change themes.
24
26
 
25
27
  <Example
26
- Component={themeSwitcherExample.example}
27
- source={themeSwitcherExample.code}
28
- packageName="@atlaskit/app-provider"
28
+ Component={themeSwitcherExample.example}
29
+ source={themeSwitcherExample.code}
30
+ packageName="@atlaskit/app-provider"
29
31
  />
30
32
 
31
33
  ## Router links
32
34
 
33
- The `routerLinkComponent` prop provides support for configuring router links within Design System components.
35
+ The `routerLinkComponent` prop provides support for configuring router links within Design System
36
+ components.
34
37
 
35
38
  Support for this is limited as Design System components are being updated, starting with:
36
39
 
@@ -39,11 +42,13 @@ Support for this is limited as Design System components are being updated, start
39
42
  - [Link](/components/link/examples).
40
43
  - [Anchor primitive](/components/primitives/anchor/examples).
41
44
 
42
- This example shows how links can be configured to utilize the router link component supplied by [React Resource Router](https://github.com/atlassian-labs/react-resource-router), however any routing library can be used.
45
+ This example shows how links can be configured to utilize the router link component supplied by
46
+ [React Resource Router](https://github.com/atlassian-labs/react-resource-router), however any
47
+ routing library can be used.
43
48
 
44
49
  <Example
45
- Component={routerLinkComponentExample.example}
46
- source={routerLinkComponentExample.code}
47
- appearance="source-only"
48
- packageName="@atlaskit/app-provider"
50
+ Component={routerLinkComponentExample.example}
51
+ source={routerLinkComponentExample.code}
52
+ appearance="source-only"
53
+ packageName="@atlaskit/app-provider"
49
54
  />
@@ -4,4 +4,5 @@ order: 2
4
4
 
5
5
  ## Usage
6
6
 
7
- AppProvider provides app-level configuration for the Design System, such as global theming. Place it at the root of your application.
7
+ AppProvider provides app-level configuration for the Design System, such as global theming. Place it
8
+ at the root of your application.
@@ -1,5 +1,5 @@
1
1
  export { default } from './app-provider';
2
2
  export { UNSAFE_useColorModeForMigration, useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider';
3
- export { type RouterLinkComponent, type RouterLinkComponentProps, } from './router-link-provider';
3
+ export { type RouterLinkComponent, type RouterLinkComponentProps } from './router-link-provider';
4
4
  import useRouterLink from './router-link-provider/hooks/use-router-link';
5
5
  export { useRouterLink };
@@ -25,7 +25,7 @@ export type RouterLinkComponentProps<RouterLinkConfig extends Record<string, any
25
25
  * ```
26
26
  */
27
27
  href: string | RouterLinkConfig;
28
- children: React.ReactNode;
28
+ children?: React.ReactNode;
29
29
  };
30
30
  export type RouterLinkProviderContextProps<RouterLinkConfig extends Record<string, any> = never> = {
31
31
  routerLinkComponent?: RouterLinkComponent<RouterLinkConfig>;
@@ -1,5 +1,5 @@
1
1
  export { default } from './app-provider';
2
2
  export { UNSAFE_useColorModeForMigration, useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider';
3
- export { type RouterLinkComponent, type RouterLinkComponentProps, } from './router-link-provider';
3
+ export { type RouterLinkComponent, type RouterLinkComponentProps } from './router-link-provider';
4
4
  import useRouterLink from './router-link-provider/hooks/use-router-link';
5
5
  export { useRouterLink };
@@ -25,7 +25,7 @@ export type RouterLinkComponentProps<RouterLinkConfig extends Record<string, any
25
25
  * ```
26
26
  */
27
27
  href: string | RouterLinkConfig;
28
- children: React.ReactNode;
28
+ children?: React.ReactNode;
29
29
  };
30
30
  export type RouterLinkProviderContextProps<RouterLinkConfig extends Record<string, any> = never> = {
31
31
  routerLinkComponent?: RouterLinkComponent<RouterLinkConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/app-provider",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "A top level provider for the Design System.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,7 @@
39
39
  ".": "./src/index.tsx"
40
40
  },
41
41
  "dependencies": {
42
- "@atlaskit/tokens": "^1.49.0",
42
+ "@atlaskit/tokens": "^1.50.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "bind-event-listener": "^3.0.0"
45
45
  },
@@ -51,7 +51,6 @@
51
51
  "@atlaskit/ds-lib": "^2.3.0",
52
52
  "@atlaskit/ssr": "*",
53
53
  "@atlaskit/visual-regression": "*",
54
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
55
54
  "@testing-library/react": "^12.1.5",
56
55
  "@testing-library/react-hooks": "^8.0.1",
57
56
  "@testing-library/user-event": "^14.4.3",
@@ -92,6 +91,5 @@
92
91
  ]
93
92
  }
94
93
  },
95
- "homepage": "https://atlassian.design/components/app-provider",
96
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
94
+ "homepage": "https://atlassian.design/components/app-provider"
97
95
  }
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/app-provider"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -20,19 +21,19 @@ import { ThemeState } from '@atlaskit/tokens';
20
21
 
21
22
  // @public
22
23
  function AppProvider({
23
- children,
24
- defaultColorMode,
25
- defaultTheme,
26
- routerLinkComponent,
24
+ children,
25
+ defaultColorMode,
26
+ defaultTheme,
27
+ routerLinkComponent,
27
28
  }: AppProviderProps): JSX.Element;
28
29
  export default AppProvider;
29
30
 
30
31
  // @public (undocumented)
31
32
  interface AppProviderProps {
32
- children: React_2.ReactNode;
33
- defaultColorMode?: ColorMode;
34
- defaultTheme?: Partial<Theme>;
35
- routerLinkComponent?: RouterLinkComponent<any>;
33
+ children: React_2.ReactNode;
34
+ defaultColorMode?: ColorMode;
35
+ defaultTheme?: Partial<Theme>;
36
+ routerLinkComponent?: RouterLinkComponent<any>;
36
37
  }
37
38
 
38
39
  // @public (undocumented)
@@ -43,17 +44,14 @@ type ReconciledColorMode = Exclude<ColorMode, 'auto'>;
43
44
 
44
45
  // @public (undocumented)
45
46
  type RouterLinkComponent<RouterLinkConfig extends Record<string, any> = never> =
46
- React_2.ForwardRefExoticComponent<
47
- RouterLinkComponentProps<RouterLinkConfig> &
48
- React_2.RefAttributes<HTMLAnchorElement>
49
- >;
47
+ React_2.ForwardRefExoticComponent<
48
+ RouterLinkComponentProps<RouterLinkConfig> & React_2.RefAttributes<HTMLAnchorElement>
49
+ >;
50
50
 
51
51
  // @public (undocumented)
52
- export type RouterLinkComponentProps<
53
- RouterLinkConfig extends Record<string, any> = never,
54
- > = {
55
- href: RouterLinkConfig | string;
56
- children: React_2.ReactNode;
52
+ export type RouterLinkComponentProps<RouterLinkConfig extends Record<string, any> = never> = {
53
+ href: RouterLinkConfig | string;
54
+ children: React_2.ReactNode;
57
55
  };
58
56
 
59
57
  // @public (undocumented)
@@ -63,9 +61,9 @@ type Theme = Omit<ThemeState, 'colorMode' | 'contrastMode'>;
63
61
  export function useColorMode(): ReconciledColorMode;
64
62
 
65
63
  // @public
66
- export const useRouterLink: <
67
- RouterLinkConfig extends Record<string, any> = never,
68
- >() => RouterLinkComponent<RouterLinkConfig> | undefined;
64
+ export const useRouterLink: <RouterLinkConfig extends Record<string, any> = never>() =>
65
+ | RouterLinkComponent<RouterLinkConfig>
66
+ | undefined;
69
67
 
70
68
  // @public
71
69
  export function useSetColorMode(): (value: ColorMode) => void;
@@ -87,7 +85,7 @@ export function useTheme(): Theme;
87
85
 
88
86
  ```json
89
87
  {
90
- "react": "^16.8.0"
88
+ "react": "^16.8.0"
91
89
  }
92
90
  ```
93
91