@zendeskgarden/react-chrome 8.49.0 → 8.49.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.
Files changed (28) hide show
  1. package/dist/index.cjs.js +52 -52
  2. package/dist/index.esm.js +52 -52
  3. package/dist/typings/elements/Chrome.d.ts +2 -7
  4. package/dist/typings/elements/SkipNav.d.ts +2 -7
  5. package/dist/typings/elements/body/Body.d.ts +2 -5
  6. package/dist/typings/elements/header/Header.d.ts +2 -5
  7. package/dist/typings/elements/header/HeaderItem.d.ts +2 -18
  8. package/dist/typings/elements/header/HeaderItemText.d.ts +2 -5
  9. package/dist/typings/elements/header/HeaderItemWrapper.d.ts +2 -9
  10. package/dist/typings/elements/nav/Nav.d.ts +2 -5
  11. package/dist/typings/elements/nav/NavItem.d.ts +2 -12
  12. package/dist/typings/elements/nav/NavItemText.d.ts +2 -5
  13. package/dist/typings/elements/sheet/Sheet.d.ts +2 -15
  14. package/dist/typings/elements/sheet/components/Footer.d.ts +2 -5
  15. package/dist/typings/elements/subnav/CollapsibleSubNavItem.d.ts +2 -13
  16. package/dist/typings/elements/subnav/SubNavItem.d.ts +2 -5
  17. package/dist/typings/elements/subnav/SubNavItemText.d.ts +2 -8
  18. package/dist/typings/index.d.ts +4 -16
  19. package/dist/typings/styled/header/StyledLogoHeaderItem.d.ts +2 -2
  20. package/dist/typings/styled/index.d.ts +0 -10
  21. package/dist/typings/styled/nav/StyledLogoNavItem.d.ts +2 -2
  22. package/dist/typings/styled/sheet/StyledSheet.d.ts +2 -1
  23. package/dist/typings/styled/sheet/StyledSheetClose.d.ts +1 -1
  24. package/dist/typings/styled/sheet/StyledSheetHeader.d.ts +4 -0
  25. package/dist/typings/styled/sheet/StyledSheetWrapper.d.ts +2 -1
  26. package/dist/typings/types/index.d.ts +117 -0
  27. package/package.json +4 -4
  28. package/dist/typings/utils/types.d.ts +0 -8
@@ -4,11 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { ButtonHTMLAttributes } from 'react';
8
- export interface ISubNavItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
9
- /** Indicates that the item is current in the subnav */
10
- isCurrent?: boolean;
11
- }
7
+ import React from 'react';
8
+ import { ISubNavItemProps } from '../../types';
12
9
  /**
13
10
  * @extends ButtonHTMLAttributes<HTMLButtonElement>
14
11
  */
@@ -4,14 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
8
- export interface ISubNavItemTextProps extends HTMLAttributes<HTMLSpanElement> {
9
- /**
10
- * Wraps overflow item text instead of truncating long strings with an ellipsis.
11
- * Use when `max-width` styling is applied to the subnav container.
12
- **/
13
- isWrapped?: boolean;
14
- }
7
+ import React from 'react';
8
+ import { ISubNavItemTextProps } from '../../types';
15
9
  /**
16
10
  * @extends HTMLAttributes<HTMLSpanElement>
17
11
  */
@@ -5,40 +5,28 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  export { Chrome } from './elements/Chrome';
8
- export type { IChromeProps } from './elements/Chrome';
9
8
  export { SkipNav } from './elements/SkipNav';
10
- export type { ISkipNavProps } from './elements/SkipNav';
11
9
  export { Body } from './elements/body/Body';
12
- export type { IBodyProps } from './elements/body/Body';
13
10
  export { Content } from './elements/body/Content';
14
11
  export { Main } from './elements/body/Main';
15
12
  export { Sidebar } from './elements/body/Sidebar';
16
13
  export { Header } from './elements/header/Header';
17
- export type { IHeaderProps } from './elements/header/Header';
18
14
  export { HeaderItem } from './elements/header/HeaderItem';
19
- export type { IHeaderItemProps } from './elements/header/HeaderItem';
20
15
  export { HeaderItemIcon } from './elements/header/HeaderItemIcon';
21
16
  export { HeaderItemText } from './elements/header/HeaderItemText';
22
- export type { IHeaderItemTextProps } from './elements/header/HeaderItemText';
23
17
  export { HeaderItemWrapper } from './elements/header/HeaderItemWrapper';
24
- export type { IHeaderItemWrapperProps } from './elements/header/HeaderItemWrapper';
25
18
  export { Footer } from './elements/footer/Footer';
26
19
  export { FooterItem } from './elements/footer/FooterItem';
27
20
  export { Nav } from './elements/nav/Nav';
28
- export type { INavProps } from './elements/nav/Nav';
29
21
  export { NavItem } from './elements/nav/NavItem';
30
- export type { INavItemProps } from './elements/nav/NavItem';
31
22
  export { NavItemIcon } from './elements/nav/NavItemIcon';
32
23
  export { NavItemText } from './elements/nav/NavItemText';
33
- export type { INavItemTextProps } from './elements/nav/NavItemText';
34
24
  export { SubNav } from './elements/subnav/SubNav';
35
25
  export { SubNavItem } from './elements/subnav/SubNavItem';
36
- export type { ISubNavItemProps } from './elements/subnav/SubNavItem';
37
26
  export { SubNavItemText } from './elements/subnav/SubNavItemText';
38
- export type { ISubNavItemTextProps } from './elements/subnav/SubNavItemText';
39
27
  export { CollapsibleSubNavItem } from './elements/subnav/CollapsibleSubNavItem';
40
- export type { ICollapsibleSubNavItemProps } from './elements/subnav/CollapsibleSubNavItem';
41
28
  export { Sheet } from './elements/sheet/Sheet';
42
- export type { ISheetProps } from './elements/sheet/Sheet';
43
- export type { ISheetFooterProps } from './elements/sheet/components/Footer';
44
- export { PRODUCT, PRODUCTS } from './utils/types';
29
+ export { PRODUCT as PRODUCTS } from './types';
30
+ export type { IChromeProps, ISkipNavProps, IBodyProps, IHeaderProps, IHeaderItemProps, IHeaderItemTextProps, IHeaderItemWrapperProps, INavProps, INavItemProps, INavItemTextProps, ISubNavItemProps, ICollapsibleSubNavItemProps, ISheetProps, ISheetFooterProps,
31
+ /** @deprecated can be accessed via IHeaderItemProps['product'] */
32
+ Product as PRODUCT } from './types';
@@ -4,9 +4,9 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { PRODUCT } from '../../utils/types';
7
+ import { Product } from '../../types';
8
8
  export interface IStyledLogoHeaderItemProps {
9
- product?: PRODUCT;
9
+ product?: Product;
10
10
  }
11
11
  /**
12
12
  * 1. Anchor reset
@@ -14,32 +14,23 @@ export { StyledSidebar } from './body/StyledSidebar';
14
14
  export { StyledFooter } from './footer/StyledFooter';
15
15
  export { StyledFooterItem } from './footer/StyledFooterItem';
16
16
  export { StyledHeader } from './header/StyledHeader';
17
- export type { IStyledHeaderProps } from './header/StyledHeader';
18
17
  export { StyledBaseHeaderItem } from './header/StyledBaseHeaderItem';
19
- export type { IStyledBaseHeaderItemProps } from './header/StyledBaseHeaderItem';
20
18
  export { StyledHeaderItem } from './header/StyledHeaderItem';
21
19
  export { StyledHeaderItemIcon } from './header/StyledHeaderItemIcon';
22
20
  export { StyledLogoHeaderItem } from './header/StyledLogoHeaderItem';
23
- export type { IStyledLogoHeaderItemProps } from './header/StyledLogoHeaderItem';
24
21
  export { StyledHeaderItemText } from './header/StyledHeaderItemText';
25
- export type { IStyledHeaderItemTextProps } from './header/StyledHeaderItemText';
26
22
  export { StyledHeaderItemWrapper } from './header/StyledHeaderItemWrapper';
27
23
  export { StyledNav } from './nav/StyledNav';
28
24
  export { StyledBaseNavItem } from './nav/StyledBaseNavItem';
29
25
  export { StyledLogoNavItem } from './nav/StyledLogoNavItem';
30
- export type { IStyledLogoNavItemProps } from './nav/StyledLogoNavItem';
31
26
  export { StyledBrandmarkNavItem } from './nav/StyledBrandmarkNavItem';
32
27
  export { StyledNavItem } from './nav/StyledNavItem';
33
28
  export { StyledNavItemIcon } from './nav/StyledNavItemIcon';
34
29
  export { StyledNavItemText } from './nav/StyledNavItemText';
35
- export type { IStyledNavItemTextProps } from './nav/StyledNavItemText';
36
30
  export { StyledSubNav } from './subnav/StyledSubNav';
37
31
  export { StyledSubNavItem } from './subnav/StyledSubNavItem';
38
- export type { IStyledSubNavItemProps } from './subnav/StyledSubNavItem';
39
32
  export { StyledSubNavItemText } from './subnav/StyledSubNavItemText';
40
- export type { IStyledSubNavItemTextProps } from './subnav/StyledSubNavItemText';
41
33
  export { StyledSubNavItemHeader } from './subnav/StyledSubNavItemHeader';
42
- export type { IStyledSubNavItemHeaderProps } from './subnav/StyledSubNavItemHeader';
43
34
  export { StyledSubNavItemIconWrapper, StyledSubNavItemIcon } from './subnav/StyledSubNavItemIcon';
44
35
  export { StyledSubNavPanel } from './subnav/StyledSubNavPanel';
45
36
  export { StyledSheet } from './sheet/StyledSheet';
@@ -49,6 +40,5 @@ export { StyledSheetDescription } from './sheet/StyledSheetDescription';
49
40
  export { StyledSheetBody } from './sheet/StyledSheetBody';
50
41
  export { StyledSheetClose } from './sheet/StyledSheetClose';
51
42
  export { StyledSheetFooter } from './sheet/StyledSheetFooter';
52
- export type { IStyledSheetFooterProps } from './sheet/StyledSheetFooter';
53
43
  export { StyledSheetFooterItem } from './sheet/StyledSheetFooterItem';
54
44
  export { StyledSheetHeader } from './sheet/StyledSheetHeader';
@@ -5,9 +5,9 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { ThemeProps, DefaultTheme } from 'styled-components';
8
- import { PRODUCT } from '../../utils/types';
8
+ import { Product } from '../../types';
9
9
  export interface IStyledLogoNavItemProps extends ThemeProps<DefaultTheme> {
10
- product?: PRODUCT;
10
+ product?: Product;
11
11
  isDark?: boolean;
12
12
  isLight?: boolean;
13
13
  }
@@ -5,8 +5,9 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
+ import { ISheetProps } from '../../types';
8
9
  interface IStyledSheetProps {
9
- placement?: 'start' | 'end';
10
+ placement?: ISheetProps['placement'];
10
11
  isOpen?: boolean;
11
12
  isAnimated?: boolean;
12
13
  size?: string;
@@ -5,7 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { ThemeProps, DefaultTheme } from 'styled-components';
8
- export declare const baseMultipliers: {
8
+ export declare const BASE_MULTIPLIERS: {
9
9
  top: number;
10
10
  side: number;
11
11
  size: number;
@@ -8,6 +8,10 @@ import { ThemeProps, DefaultTheme } from 'styled-components';
8
8
  export interface IStyledSheetHeaderProps {
9
9
  isCloseButtonPresent?: boolean;
10
10
  }
11
+ /**
12
+ * 1. the padding size accounts for 40px (10 base units) size of the button,
13
+ * 8px additional padding and 8px padding for the button position from a given side.
14
+ */
11
15
  export declare const StyledSheetHeader: import("styled-components").StyledComponent<"header", DefaultTheme, {
12
16
  'data-garden-id': string;
13
17
  'data-garden-version': string;
@@ -5,10 +5,11 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ import { ISheetProps } from '../../types';
8
9
  interface IStyledSheetWrapperProps {
9
10
  isOpen?: boolean;
10
11
  isAnimated?: boolean;
11
- placement?: 'start' | 'end';
12
+ placement?: ISheetProps['placement'];
12
13
  size?: string;
13
14
  }
14
15
  export declare const StyledSheetWrapper: import("styled-components").StyledComponent<"div", DefaultTheme, {
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
8
+ export declare const PLACEMENT: readonly ["end", "start"];
9
+ export declare const PRODUCT: readonly ["chat", "connect", "explore", "guide", "message", "support", "talk"];
10
+ export declare type Product = typeof PRODUCT[number];
11
+ export interface IChromeProps extends HTMLAttributes<HTMLDivElement> {
12
+ /** Applies a custom hue to the chrome navigation */
13
+ hue?: string;
14
+ /** Prevents fixed positioning from being applied to the `<html>` element */
15
+ isFluid?: boolean;
16
+ }
17
+ export interface ISkipNavProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
18
+ /** Sets the ID of the element to navigate to */
19
+ targetId: string;
20
+ /** Sets the `z-index` of the element */
21
+ zIndex?: number;
22
+ }
23
+ export interface IBodyProps extends HTMLAttributes<HTMLDivElement> {
24
+ /** Adjusts the body content height to allow space for a footer component */
25
+ hasFooter?: boolean;
26
+ }
27
+ export interface IHeaderProps extends HTMLAttributes<HTMLElement> {
28
+ /** Displays logo for standlone usage */
29
+ isStandalone?: boolean;
30
+ }
31
+ export interface IHeaderItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
32
+ /** Maximizes the width of a flex item in the header */
33
+ maxX?: boolean;
34
+ /** Maximizes the height of the item (i.e. contains a search input) */
35
+ maxY?: boolean;
36
+ /** Rounds the border radius of the item */
37
+ isRound?: boolean;
38
+ /**
39
+ * Applies a
40
+ * [brand color](/design/color#brand-colors)
41
+ * to the product logo
42
+ */
43
+ product?: Product;
44
+ /** Applies header logo styles to the item */
45
+ hasLogo?: boolean;
46
+ }
47
+ export interface IHeaderItemTextProps extends HTMLAttributes<HTMLElement> {
48
+ /** Hides item text. Text remains accessible to screen readers. */
49
+ isClipped?: boolean;
50
+ }
51
+ export interface IHeaderItemWrapperProps extends HTMLAttributes<HTMLDivElement> {
52
+ /** Maximizes the width of a flex item in the header */
53
+ maxX?: boolean;
54
+ /** Maximizes the height of the item (i.e. contains a search input) */
55
+ maxY?: boolean;
56
+ /** Rounds the border radius of the item */
57
+ isRound?: boolean;
58
+ }
59
+ export interface INavProps extends HTMLAttributes<HTMLElement> {
60
+ /** Expands the nav area to display the item text */
61
+ isExpanded?: boolean;
62
+ }
63
+ export interface INavItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
64
+ /** Applies a product-specific color palette */
65
+ product?: Product;
66
+ /** Indicates that the item is current in the nav */
67
+ isCurrent?: boolean;
68
+ /** Indicates that the item contains a product logo */
69
+ hasLogo?: boolean;
70
+ /** Indicates that the item contains the company brandmark */
71
+ hasBrandmark?: boolean;
72
+ }
73
+ export interface INavItemTextProps extends HTMLAttributes<HTMLSpanElement> {
74
+ /** Wraps overflow item text instead of truncating long strings with an ellipsis */
75
+ isWrapped?: boolean;
76
+ }
77
+ export interface ISubNavItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
78
+ /** Indicates that the item is current in the subnav */
79
+ isCurrent?: boolean;
80
+ }
81
+ export interface ISubNavItemTextProps extends HTMLAttributes<HTMLSpanElement> {
82
+ /**
83
+ * Wraps overflow item text instead of truncating long strings with an ellipsis.
84
+ * Use when `max-width` styling is applied to the subnav container.
85
+ */
86
+ isWrapped?: boolean;
87
+ }
88
+ export interface ICollapsibleSubNavItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
89
+ /** Sets the item's section header */
90
+ header?: ReactNode;
91
+ /** Reveals the item's section */
92
+ isExpanded?: boolean;
93
+ /**
94
+ * Handles changes in the item's expansion state
95
+ *
96
+ * @param {boolean} isExpanded An item's expansion state
97
+ */
98
+ onChange?: (isExpanded: boolean) => void;
99
+ }
100
+ export interface ISheetProps extends HTMLAttributes<HTMLElement> {
101
+ /** Opens the sheet */
102
+ isOpen?: boolean;
103
+ /** Determines whether animation for opening and closing the sheet is used */
104
+ isAnimated?: boolean;
105
+ /** Directs keyboard focus to the sheet on mount */
106
+ focusOnMount?: boolean;
107
+ /** Returns keyboard focus to the element that triggered the sheet */
108
+ restoreFocus?: boolean;
109
+ /** Adjusts the placement of the sheet */
110
+ placement?: typeof PLACEMENT[number];
111
+ /** Sets the size of the open sheet */
112
+ size?: string;
113
+ }
114
+ export interface ISheetFooterProps extends HTMLAttributes<HTMLElement> {
115
+ /** Applies compact styling and centers the elements */
116
+ isCompact?: boolean;
117
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-chrome",
3
- "version": "8.49.0",
3
+ "version": "8.49.3",
4
4
  "description": "Components relating to Chrome within the Garden Design System.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -35,8 +35,8 @@
35
35
  "styled-components": "^4.2.0 || ^5.0.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@zendeskgarden/react-theming": "^8.49.0",
39
- "@zendeskgarden/svg-icons": "6.30.2"
38
+ "@zendeskgarden/react-theming": "^8.49.3",
39
+ "@zendeskgarden/svg-icons": "6.31.1"
40
40
  },
41
41
  "keywords": [
42
42
  "components",
@@ -48,5 +48,5 @@
48
48
  "access": "public"
49
49
  },
50
50
  "zendeskgarden:src": "src/index.ts",
51
- "gitHead": "9c2b7501c2b0100f23fa3715a4d3b0d413645d99"
51
+ "gitHead": "983322364971c051ca6ce478770edfc3310e4c4b"
52
52
  }
@@ -1,8 +0,0 @@
1
- /**
2
- * Copyright Zendesk, Inc.
3
- *
4
- * Use of this source code is governed under the Apache License, Version 2.0
5
- * found at http://www.apache.org/licenses/LICENSE-2.0.
6
- */
7
- export declare type PRODUCT = 'chat' | 'connect' | 'explore' | 'guide' | 'message' | 'support' | 'talk';
8
- export declare const PRODUCTS: PRODUCT[];